Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KristianLyng/f745a4cb0a0a8d14b4fc2d905ad5eedb to your computer and use it in GitHub Desktop.
Save KristianLyng/f745a4cb0a0a8d14b4fc2d905ad5eedb to your computer and use it in GitHub Desktop.
00000000000006f0 <main>:
#include <stdio.h>
#include <limits.h>
int main() {
6f0: 55 push %rbp
6f1: 48 89 e5 mov %rsp,%rbp
6f4: 48 83 ec 10 sub $0x10,%rsp
int si = INT_MAX;
6f8: c7 45 fc ff ff ff 7f movl $0x7fffffff,-0x4(%rbp)
unsigned int ui = UINT_MAX;
6ff: c7 45 f8 ff ff ff ff movl $0xffffffff,-0x8(%rbp)
printf ("si: %d (INT_MAX)\n", si);
706: 8b 45 fc mov -0x4(%rbp),%eax
709: 89 c6 mov %eax,%esi
70b: 48 8d 3d 02 01 00 00 lea 0x102(%rip),%rdi # 814 <_IO_stdin_used+0x4>
712: b8 00 00 00 00 mov $0x0,%eax
717: e8 84 fe ff ff callq 5a0 <printf@plt>
printf ("ui: %u (UINT_MAX)\n", ui);
71c: 8b 45 f8 mov -0x8(%rbp),%eax
71f: 89 c6 mov %eax,%esi
721: 48 8d 3d fe 00 00 00 lea 0xfe(%rip),%rdi # 826 <_IO_stdin_used+0x16>
728: b8 00 00 00 00 mov $0x0,%eax
72d: e8 6e fe ff ff callq 5a0 <printf@plt>
if (si > si + 1)
732: 8b 45 fc mov -0x4(%rbp),%eax
735: 83 c0 01 add $0x1,%eax
738: 3b 45 fc cmp -0x4(%rbp),%eax
73b: 7d 0e jge 74b <main+0x5b>
printf("si larger than si + 1\n");
73d: 48 8d 3d f5 00 00 00 lea 0xf5(%rip),%rdi # 839 <_IO_stdin_used+0x29>
744: e8 47 fe ff ff callq 590 <puts@plt>
749: eb 0c jmp 757 <main+0x67>
else
printf("si not larger than si + 1\n");
74b: 48 8d 3d fd 00 00 00 lea 0xfd(%rip),%rdi # 84f <_IO_stdin_used+0x3f>
752: e8 39 fe ff ff callq 590 <puts@plt>
if (ui > ui + 1)
757: 8b 45 f8 mov -0x8(%rbp),%eax
75a: 83 c0 01 add $0x1,%eax
75d: 3b 45 f8 cmp -0x8(%rbp),%eax
760: 73 0e jae 770 <main+0x80>
printf("ui larger than ui + 1\n");
762: 48 8d 3d 00 01 00 00 lea 0x100(%rip),%rdi # 869 <_IO_stdin_used+0x59>
769: e8 22 fe ff ff callq 590 <puts@plt>
76e: eb 0c jmp 77c <main+0x8c>
else
printf("ui not larger than ui + 1\n");
770: 48 8d 3d 08 01 00 00 lea 0x108(%rip),%rdi # 87f <_IO_stdin_used+0x6f>
777: e8 14 fe ff ff callq 590 <puts@plt>
return 0;
77c: b8 00 00 00 00 mov $0x0,%eax
}
781: c9 leaveq
782: c3 retq
783: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
78a: 00 00 00
78d: 0f 1f 00 nopl (%rax)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment