.file "testsort.c" .text .globl fillArray .type fillArray,@function fillArray: #------------------------- pushl $__pcfillArray call __count addl $4, %esp #------------------------- pushl %ebp movl %esp, %ebp subl $8, %esp movl $0, -4(%ebp) .L2: movl -4(%ebp), %eax cmpl 12(%ebp), %eax jl .L5 jmp .L1 .L5: call rand movl %eax, %ecx movl -4(%ebp), %eax leal 0(,%eax,4), %edx movl 8(%ebp), %eax movl %ecx, (%eax,%edx) leal -4(%ebp), %eax incl (%eax) jmp .L2 .L1: leave ret .Lfe1: .size fillArray,.Lfe1-fillArray .globl swap #------------------------- __endfillArray: #------------------------- .type swap,@function swap: #------------------------- pushl $__pcswap call __count addl $4, %esp #------------------------- pushl %ebp movl %esp, %ebp pushl %ebx subl $4, %esp movl 12(%ebp), %eax leal 0(,%eax,4), %edx movl 8(%ebp), %eax movl (%eax,%edx), %eax movl %eax, -8(%ebp) movl 12(%ebp), %eax leal 0(,%eax,4), %ebx movl 8(%ebp), %ecx movl 16(%ebp), %eax leal 0(,%eax,4), %edx movl 8(%ebp), %eax movl (%eax,%edx), %eax movl %eax, (%ecx,%ebx) movl 16(%ebp), %eax leal 0(,%eax,4), %ecx movl 8(%ebp), %edx movl -8(%ebp), %eax movl %eax, (%edx,%ecx) addl $4, %esp popl %ebx leave ret .Lfe2: .size swap,.Lfe2-swap .globl partition #------------------------- __endswap: #------------------------- .type partition,@function partition: #------------------------- pushl $__pcpartition call __count addl $4, %esp #------------------------- pushl %ebp movl %esp, %ebp pushl %esi pushl %ebx subl $16, %esp movl 12(%ebp), %eax decl %eax movl %eax, -12(%ebp) movl 16(%ebp), %eax movl %eax, -16(%ebp) .L11: leal -12(%ebp), %eax incl (%eax) movl -12(%ebp), %eax leal 0(,%eax,4), %esi movl 8(%ebp), %ebx movl 16(%ebp), %eax leal 0(,%eax,4), %ecx movl 8(%ebp), %edx movl (%ebx,%esi), %eax cmpl (%edx,%ecx), %eax jl .L11 nop .L14: movl 16(%ebp), %eax leal 0(,%eax,4), %ebx movl 8(%ebp), %esi leal -16(%ebp), %eax decl (%eax) movl -16(%ebp), %eax leal 0(,%eax,4), %ecx movl 8(%ebp), %edx movl (%esi,%ebx), %eax cmpl (%edx,%ecx), %eax jl .L16 jmp .L15 .L16: movl -16(%ebp), %eax cmpl 12(%ebp), %eax jne .L14 .L15: movl -12(%ebp), %eax cmpl -16(%ebp), %eax jl .L18 jmp .L9 .L18: subl $4, %esp pushl -16(%ebp) pushl -12(%ebp) pushl 8(%ebp) call swap addl $16, %esp jmp .L11 .L9: subl $4, %esp pushl 16(%ebp) pushl -12(%ebp) pushl 8(%ebp) call swap addl $16, %esp movl -12(%ebp), %eax leal -8(%ebp), %esp popl %ebx popl %esi leave ret .Lfe3: .size partition,.Lfe3-partition .globl quicksort #------------------------- __endpartition: #------------------------- .type quicksort,@function quicksort: #------------------------- pushl $__pcquicksort call __count addl $4, %esp #------------------------- pushl %ebp movl %esp, %ebp subl $8, %esp movl 16(%ebp), %eax cmpl 12(%ebp), %eax jle .L19 subl $4, %esp pushl 16(%ebp) pushl 12(%ebp) pushl 8(%ebp) call partition addl $16, %esp movl %eax, -4(%ebp) subl $4, %esp movl -4(%ebp), %eax decl %eax pushl %eax pushl 12(%ebp) pushl 8(%ebp) call quicksort addl $16, %esp subl $4, %esp pushl 16(%ebp) movl -4(%ebp), %eax incl %eax pushl %eax pushl 8(%ebp) call quicksort addl $16, %esp .L19: leave ret .Lfe4: .size quicksort,.Lfe4-quicksort .section .rodata .LC0: .string "%d\n" .text .globl printArray #------------------------- __endquicksort: #------------------------- .type printArray,@function printArray: #------------------------- pushl $__pcprintArray call __count addl $4, %esp #------------------------- pushl %ebp movl %esp, %ebp subl $8, %esp movl $0, -4(%ebp) .L22: movl -4(%ebp), %eax cmpl 12(%ebp), %eax jl .L25 jmp .L21 .L25: subl $8, %esp movl -4(%ebp), %eax leal 0(,%eax,4), %edx movl 8(%ebp), %eax pushl (%eax,%edx) pushl $.LC0 call printf addl $16, %esp leal -4(%ebp), %eax incl (%eax) jmp .L22 .L21: leave ret .Lfe5: .size printArray,.Lfe5-printArray .globl main #------------------------- __endprintArray: #------------------------- .type main,@function main: #------------------------- pushl $__pcmain call __count addl $4, %esp #------------------------- pushl %ebp movl %esp, %ebp subl $8, %esp andl $-16, %esp movl $0, %eax subl %eax, %esp subl $8, %esp pushl $10000000 pushl $piArray call fillArray addl $16, %esp subl $4, %esp pushl $9999999 pushl $0 pushl $piArray call quicksort addl $16, %esp movl $0, %eax leave ret .Lfe6: .size main,.Lfe6-main .comm piArray,40000000,32 .ident "GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)" #------------------------- __endmain: #------------------------- #------------------------- .section ".rodata" __pcfillArray: .asciz "fillArray" __pcswap: .asciz "swap" __pcpartition: .asciz "partition" __pcquicksort: .asciz "quicksort" __pcprintArray: .asciz "printArray" __pcmain: .asciz "main" #------------------------- #------------------------- .section ".rodata" .globl __table __table: .long __pcfillArray # function name .long fillArray # function start address .long __endfillArray # function end address .long __pcswap # function name .long swap # function start address .long __endswap # function end address .long __pcpartition # function name .long partition # function start address .long __endpartition # function end address .long __pcquicksort # function name .long quicksort # function start address .long __endquicksort # function end address .long __pcprintArray # function name .long printArray # function start address .long __endprintArray # function end address .long __pcmain # function name .long main # function start address .long __endmain # function end address .long 0 #-------------------------