- C code
- Assembly Code
herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
11!=?
-
計算你上學期加權平均
-
計算你的BMI
-
int a[]={21, 23, 57, 13 ,17, 6}; float average; average=?
-
猜數字
-
輸出字串20次
-
1. 利用遞迴input n算2^n 2. 用C算GCD(3333,456)
-
C字串練習 字串 char word[]="You win!"; 輸出為: You win! You win You wi You w You You Yo Y 給進階使用者: gets () 是個危險的函式!
61 則留言:
.file "steven.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "steven.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
#include
int main(){
int a,c,f ;
double b,e,g ;
b=g=e=0 ;
scanf("%d",&a) ;
for(c=1;c<=a;c=c+2){
b=1.0/c ;
e=e+b ;
}
for(f=2;f<=a;f=f+2){
g=1.0/f ;
e=e-g ;
}
printf ("%6f\n",e);
return 0;
}
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
1.
#include <stdio.h>
int gcd(int x , int y);
int main(int argc, char** argv){
printf("gcd=%d\n",gcd(123456789,987654321));
return 0;
}
int gcd(int x,int y){
int r = x % y ;
if (r == 0){
return y;
}
return gcd(y,r);
}
2.
.file "gcd.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
1.
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0){
return y;
}
return gcd(y,r);
}
2.
.file "gcd.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "fuck.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
C語言
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits
.file "wocow.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "sexygirl.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "hahaha.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "yaya.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "Daishablue.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "GGWP.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "MRTMRT LOL.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
組合語言:
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言:
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
.file "GGGGGGGGG.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "BEGSH.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
.file "ZZZZZZ.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "infinite.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
機器語言
.file "steven.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
C語言
int gcd(int x, int y);
int main(int argc, char** argv) {
return 0;
}
int gcd(int x, int y) {
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
.file "my owo.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
.file "123.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
C語言
int gcd(int x, int y);
int main(int argc, char** argv) {
return 0;
}
int gcd(int x, int y) {
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
機器語言
.file "steven.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
1.
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if(r == 0){
return y;
}
return gcd(y, r);
}
2.
.file "gcd.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
#include <stdio.h>
int gad(int x, int y);
int main(int argc, char** argv){
printf("gad=%d\n", gad(12345,54321));
return 0;
}
int gad(int x, int y) {
int r = x % y ;
if(r == 0){
return y;
}
return gad(y, r);
}
.file "gad.c"
.section .rodata
.LC0:
.string "gad=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $54321, %esi
movl $12345, %edi
call gad
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gad
.type gad, @function
gad:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gad
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gad, .-gad
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
C語言
int gcd(int x, int y);
int main(int argc, char** argv) {
return 0;
}
int gcd(int x, int y) {
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
機器語言
.file "wocow.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
#include
int gcd(int x, int y);
int main(int argc, char** argv) {
printf("gcd=% d\n",gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y) {
int r = x % y;
if (x == 0) {
return y;
}
return gcd(y, r);
}
組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
1.
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0){
return y;
}
return gcd(y,r);
}
2.
.file "gcd.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "wocow.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "wocow.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "sdew.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "sdew.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
#include
int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y){
int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
張貼留言