Skip to content

Instantly share code, notes, and snippets.

@heatd
Created October 1, 2022 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heatd/ce8bbf25d2ecb7d7998c65febf17e82b to your computer and use it in GitHub Desktop.
Save heatd/ce8bbf25d2ecb7d7998c65febf17e82b to your computer and use it in GitHub Desktop.
Dump of assembler code for function malloc(size_t):
0xffffffff80137700 <+0>: cmp $0x2,%rdi
0xffffffff80137704 <+4>: jb 0xffffffff80137740 <malloc(size_t)+64>
0xffffffff80137706 <+6>: dec %rdi
0xffffffff80137709 <+9>: cmp $0x8,%rdi
0xffffffff8013770d <+13>: jb 0xffffffff80137740 <malloc(size_t)+64>
0xffffffff8013770f <+15>: bsr %rdi,%rax
0xffffffff80137713 <+19>: xor $0xffffffffffffffc0,%rax
0xffffffff80137717 <+23>: add $0x3d,%rax
0xffffffff8013771b <+27>: cmp $0x15,%rax
0xffffffff8013771f <+31>: ja 0xffffffff8013773d <malloc(size_t)+61>
0xffffffff80137721 <+33>: mov %eax,%ecx
0xffffffff80137723 <+35>: and $0x80000000,%ecx
0xffffffff80137729 <+41>: jne 0xffffffff8013773d <malloc(size_t)+61>
0xffffffff8013772b <+43>: push %rbp
0xffffffff8013772c <+44>: mov %rsp,%rbp
0xffffffff8013772f <+47>: mov -0x7fdd9d60(,%rax,8),%rdi
0xffffffff80137737 <+55>: pop %rbp
0xffffffff80137738 <+56>: jmp 0xffffffff80136ef0 <_Z16kmem_cache_allocP10slab_cachej>
0xffffffff8013773d <+61>: xor %eax,%eax
0xffffffff8013773f <+63>: ret
0xffffffff80137740 <+64>: xor %eax,%eax
0xffffffff80137742 <+66>: jmp 0xffffffff8013772b <malloc(size_t)+43>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment