.file "p4.c" .section .rodata .LC0: .string "You are wrong\n" .LC1: .string "You are a wizard\n" .text .globl checkguess .type checkguess,@function checkguess: pushl %ebp movl %esp, %ebp subl $24, %esp movl $8, -4(%ebp) movl $0, -8(%ebp) cmpl $7, 8(%ebp) ja .L2 movl 8(%ebp), %eax sall $2, %eax movl .L11(%eax), %eax jmp *%eax .section .rodata .align 4 .align 4 .L11: .long .L3 .long .L4 .long .L5 .long .L6 .long .L7 .long .L8 .long .L9 .long .L10 .text .L3: movl $22, -8(%ebp) jmp .L2 .L4: movl $7, -8(%ebp) jmp .L2 .L5: movl $11, -8(%ebp) jmp .L2 .L6: movl $103, -8(%ebp) jmp .L2 .L7: movl $14, -8(%ebp) jmp .L2 .L8: movl $88, -8(%ebp) jmp .L2 .L9: movl $102, -8(%ebp) jmp .L2 .L10: movl $-2, -8(%ebp) .L2: cmpl $0, -8(%ebp) jne .L13 subl $12, %esp pushl $.LC0 call printf addl $16, %esp jmp .L1 .L13: movl -8(%ebp), %eax addl -4(%ebp), %eax cmpl 12(%ebp), %eax jne .L14 movl -4(%ebp), %eax movl %eax, %edx imull -8(%ebp), %edx movl %edx, %eax movl $28, %ecx cltd idivl %ecx movl %eax, -12(%ebp) movl -12(%ebp), %eax cmpl 8(%ebp), %eax jne .L14 subl $12, %esp pushl $.LC1 call printf addl $16, %esp jmp .L1 .L14: subl $12, %esp pushl $.LC0 call printf addl $16, %esp .L1: leave ret .Lfe1: .size checkguess,.Lfe1-checkguess .section .rodata .align 32 .LC2: .string "You need to enter two numbers on the command line\n" .text .globl main .type main,@function main: pushl %ebp movl %esp, %ebp subl $24, %esp andl $-16, %esp movl $0, %eax subl %eax, %esp cmpl $2, 8(%ebp) jg .L17 subl $12, %esp pushl $.LC2 call printf addl $16, %esp movl $1, -12(%ebp) jmp .L16 .L17: subl $12, %esp movl 12(%ebp), %eax addl $4, %eax pushl (%eax) call atoi addl $16, %esp movl %eax, -4(%ebp) subl $12, %esp movl 12(%ebp), %eax addl $8, %eax pushl (%eax) call atoi addl $16, %esp movl %eax, -8(%ebp) subl $8, %esp pushl -8(%ebp) pushl -4(%ebp) call checkguess addl $16, %esp movl $0, -12(%ebp) .L16: movl -12(%ebp), %eax leave ret .Lfe2: .size main,.Lfe2-main .ident "GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)"