	.file	"stretchby2.c"
gcc2_compiled.:
.text
	.p2align 2
.globl stretchby2
	.type	 stretchby2,@function
stretchby2:

        pushl   %edi                    // Put EDI on Stack
        pushl   %esi                    // Put ESI on Stack
		pushl	%ebx

        movl    16(%esp),%esi           // Source Address
        movl    24(%esp),%edx           // Source Height
        movl    32(%esp),%edi           // Destination Address

        movl    20(%esp),%ebx           // Source Width to EBX
        addl    %ebx,%ebx               // Double Source Width -> Dest. Width
        addl    36(%esp),%ebx           // Add Destination Skip

// Double line in horizontal and vertical direction

.L2:  
        movl    20(%esp),%ecx           // Source Width
        shrl    $2,%ecx                 // Source Width / 4

        pushl   %edx                    // Save Height Counter
.L1:
        mov		(%esi),%eax              // get 4 pixels
		xor     %edx,%edx
        mov     %ax,%dx                   //                            edx = 0x0000CCDD
        mov     %dl,%dh                   //                            edx = 0x0000DDDD
		mov     %ah,%al                   //                            eax = 0xAABBCCCC
        shl     $16,%eax                 // Shift second Pixel         eax = 0xCCCC0000
        addl    %edx,%eax               // Add first Pixel            eax = 0xCCCCDDDD

        movl    %eax,(%edi)             // Put four Pixels to Destination
        movl    %eax,(%edi,%ebx)        // Double Line

        addl    $4,%edi                 // Next Destination Position

        mov     (%esi),%eax             // Get four Pixel to AX       eax = 0xAABBCCDD
		shr     $16,%eax                //                            eax = 0x0000AABB
        mov     %eax,%edx               //                            edx = 0x0000AABB
        mov     %dl,%dh                 //                            edx = 0x0000BBBB
		mov     %ah,%al                 //                            eax = 0x0000AAAA
        shl     $16,%eax                // Shift second Pixel         eax = 0xAAAA0000
        addl    $4,%esi                 // Next Position in Source

        addl    %edx,%eax               // Add first Pixel            eax = 0xAAAABBBB

        movl    %eax,(%edi)             // Put four Pixels to Destination
        movl    %eax,(%edi,%ebx)        // Double Line

        addl    $4,%edi                 // Next Destination Position
        decl    %ecx                    // Decrease Counter
        jnz     .L1                     // Repeat

        popl    %edx                    // Get Height Counter
                
        addl    %ebx,%edi               // Add Destination-Skip + 2 * Width
        addl    36(%esp),%edi           // Add Destination-Skip

        addl    28(%esp),%esi           // Add Source-Skip

        decl    %edx                    // Subtract Height Counter
        jnz     .L2                     // Repeat

		popl	%ebx
        popl    %esi                    // Get old ESI from Stack
        popl    %edi
        ret















.Lfe1:
	.size	 stretchby2,.Lfe1-stretchby2
	.ident	"GCC: (GNU) 2.9-beos-991026"
