Created
December 20, 2016 19:54
-
-
Save fetus-hina/b1ef2d376740d3d7202a12d93e1d9ad1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int div2(int a) { | |
return a / 2; | |
} | |
int div3(int a) { | |
return a / 3; | |
} | |
int div4(int a) { | |
return a / 4; | |
} | |
int div5(int a) { | |
return a / 5; | |
} | |
int div6(int a) { | |
return a / 6; | |
} | |
int div7(int a) { | |
return a / 7; | |
} | |
int div8(int a) { | |
return a / 8; | |
} | |
int div9(int a) { | |
return a / 9; | |
} | |
int div10(int a) { | |
return a / 10; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.file "hoge.c" | |
.text | |
.p2align 4,,15 | |
.globl div2 | |
.type div2, @function | |
div2: | |
.LFB0: | |
.cfi_startproc | |
movl %edi, %eax | |
shrl $31, %eax | |
addl %edi, %eax | |
sarl %eax | |
ret | |
.cfi_endproc | |
.LFE0: | |
.size div2, .-div2 | |
.p2align 4,,15 | |
.globl div3 | |
.type div3, @function | |
div3: | |
.LFB1: | |
.cfi_startproc | |
movl %edi, %eax | |
movl $1431655766, %edx | |
sarl $31, %edi | |
imull %edx | |
subl %edi, %edx | |
movl %edx, %eax | |
ret | |
.cfi_endproc | |
.LFE1: | |
.size div3, .-div3 | |
.p2align 4,,15 | |
.globl div4 | |
.type div4, @function | |
div4: | |
.LFB2: | |
.cfi_startproc | |
leal 3(%rdi), %eax | |
testl %edi, %edi | |
cmovns %edi, %eax | |
sarl $2, %eax | |
ret | |
.cfi_endproc | |
.LFE2: | |
.size div4, .-div4 | |
.p2align 4,,15 | |
.globl div5 | |
.type div5, @function | |
div5: | |
.LFB3: | |
.cfi_startproc | |
movl %edi, %eax | |
movl $1717986919, %edx | |
sarl $31, %edi | |
imull %edx | |
sarl %edx | |
subl %edi, %edx | |
movl %edx, %eax | |
ret | |
.cfi_endproc | |
.LFE3: | |
.size div5, .-div5 | |
.p2align 4,,15 | |
.globl div6 | |
.type div6, @function | |
div6: | |
.LFB4: | |
.cfi_startproc | |
movl %edi, %eax | |
movl $715827883, %edx | |
sarl $31, %edi | |
imull %edx | |
subl %edi, %edx | |
movl %edx, %eax | |
ret | |
.cfi_endproc | |
.LFE4: | |
.size div6, .-div6 | |
.p2align 4,,15 | |
.globl div7 | |
.type div7, @function | |
div7: | |
.LFB5: | |
.cfi_startproc | |
movl %edi, %eax | |
movl $-1840700269, %edx | |
imull %edx | |
leal (%rdx,%rdi), %eax | |
sarl $31, %edi | |
sarl $2, %eax | |
subl %edi, %eax | |
ret | |
.cfi_endproc | |
.LFE5: | |
.size div7, .-div7 | |
.p2align 4,,15 | |
.globl div8 | |
.type div8, @function | |
div8: | |
.LFB6: | |
.cfi_startproc | |
leal 7(%rdi), %eax | |
testl %edi, %edi | |
cmovns %edi, %eax | |
sarl $3, %eax | |
ret | |
.cfi_endproc | |
.LFE6: | |
.size div8, .-div8 | |
.p2align 4,,15 | |
.globl div9 | |
.type div9, @function | |
div9: | |
.LFB7: | |
.cfi_startproc | |
movl %edi, %eax | |
movl $954437177, %edx | |
sarl $31, %edi | |
imull %edx | |
sarl %edx | |
subl %edi, %edx | |
movl %edx, %eax | |
ret | |
.cfi_endproc | |
.LFE7: | |
.size div9, .-div9 | |
.p2align 4,,15 | |
.globl div10 | |
.type div10, @function | |
div10: | |
.LFB8: | |
.cfi_startproc | |
movl %edi, %eax | |
movl $1717986919, %edx | |
sarl $31, %edi | |
imull %edx | |
sarl $2, %edx | |
subl %edi, %edx | |
movl %edx, %eax | |
ret | |
.cfi_endproc | |
.LFE8: | |
.size div10, .-div10 | |
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-11)" | |
.section .note.GNU-stack,"",@progbits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment