-
-
Save germ/4a57f35636b96a4797cdfe9b359490ea 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 main(int argc, char *argv[]) { | |
if (argc == 1) return 0x0F; | |
if (argc == 2) return 0xFF; | |
return 0x00; | |
} |
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 "a.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) | |
cmpl $1, -4(%rbp) | |
jne .L2 | |
movl $15, %eax | |
jmp .L3 | |
.L2: | |
cmpl $2, -4(%rbp) | |
jne .L4 | |
movl $255, %eax | |
jmp .L3 | |
.L4: | |
movl $0, %eax | |
.L3: | |
popq %rbp | |
.cfi_def_cfa 7, 8 | |
ret | |
.cfi_endproc | |
.LFE0: | |
.size main, .-main | |
.ident "GCC: (GNU) 10.1.0" | |
.section .note.GNU-stack,"",@progbits |
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 main(int argc, char *argv[]) { | |
if (argc == 1) return 0x0F; | |
else if (argc == 2) return 0xFF; | |
return 0x00; | |
} |
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 "b.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) | |
cmpl $1, -4(%rbp) | |
jne .L2 | |
movl $15, %eax | |
jmp .L3 | |
.L2: | |
cmpl $2, -4(%rbp) | |
jne .L4 | |
movl $255, %eax | |
jmp .L3 | |
.L4: | |
movl $0, %eax | |
.L3: | |
popq %rbp | |
.cfi_def_cfa 7, 8 | |
ret | |
.cfi_endproc | |
.LFE0: | |
.size main, .-main | |
.ident "GCC: (GNU) 10.1.0" | |
.section .note.GNU-stack,"",@progbits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment