;switch2.s
;此时不适合建表了,此时的效率应该和if - else 差不多
switch_eg:
pushl %ebp
movl $123, %eax
movl %esp, %ebp
movl 8(%ebp), %edx
cmpl $102, %edx
je .L9
jle .L12
cmpl $104, %edx
je .L7
.p2align 4,,9
jge .L13
movl $114, %eax
.p2align 4,,7
.L9:
popl %ebp
.p2align 4,,6
ret
.p2align 4,,7
.L12:
cmpl $1, %edx
movb $3, %al
.p2align 4,,5
je .L9
cmpl $100, %edx
.p2align 4,,3
je .L14
.L2:
popl %ebp
xorl %eax, %eax
.p2align 4,,2
ret
.p2align 4,,7
.L13:
cmpl $106, %edx
.p2align 4,,5
jne .L2
.p2align 4,,7
.L7:
movl %edx, %eax
imull %edx, %eax
popl %ebp
.p2align 4,,2
ret
.L14:
popl %ebp
movl $1300, %eax
.p2align 4,,2
ret
|