	.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    $1,%ecx                 // Half Source Width

        pushl   %edx                    // Save Height Counter
.L1:
        movw    (%esi),%ax              // Get two Pixel to AX
        movb    %al,%dh                 // Second Pixel to DH

        movb    %ah,%al                 // Double Pixel to AX
        movb    %dh,%dl                 // Double Pixel to DX

        shll    $16,%eax                // Shift second Pixel

        addl    $2,%esi                 // Next Position in Source
        addl    %edx,%eax               // Add first Pixel

        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"
