LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/kilobyte[P]colormatch/243-256.c
// Function: main
int main()
{
    for (int c = 0; c < 16777216; ++c)
    {
        nt[c] = closest(c);
        if (!(c&0xff))
            printf("%06X\n", c);
    }

    int fd = creat("243.rgb", 0666);
    write(fd, nt, sizeof(nt));
    close(fd);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0xff, %r15d
xorl %r14d, %r14d
movl %r14d, %eax
shrl $0x10, %eax
movl %eax, 0xc(%rsp)
movl %r14d, %ebx
shrl $0x8, %ebx
andl %r15d, %ebx
movq %r14, 0x10(%rsp)
movl %r14d, %r12d
andl %r15d, %r12d
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %r14d, %r14d
xorl %ebp, %ebp
movl %ebp, %edi
callq 0x1280
movl %eax, %ecx
shrl $0x10, %ecx
movl %eax, %edx
shrl $0x8, %edx
andl %r15d, %ecx
subl 0xc(%rsp), %ecx
imull %ecx, %ecx
andl %r15d, %edx
subl %ebx, %edx
imull %edx, %edx
andl %r15d, %eax
subl %r12d, %eax
imull %eax, %eax
leal (%rax,%rax,2), %eax
leal (%rax,%rdx,4), %eax
leal (%rax,%rcx,2), %eax
cmpl %r13d, %eax
cmovll %eax, %r13d
cmovll %ebp, %r14d
incl %ebp
cmpl $0x100, %ebp            # imm = 0x100
jne 0x11bc
leaq 0x2e53(%rip), %rax      # 0x4060
movq 0x10(%rsp), %rcx
movb %r14b, (%rcx,%rax)
movq %rcx, %r14
testl %r12d, %r12d
jne 0x122f
leaq 0xddf(%rip), %rdi       # 0x2004
movl %r14d, %esi
xorl %eax, %eax
callq 0x1050
incq %r14
cmpq $0x1000000, %r14        # imm = 0x1000000
jne 0x1193
leaq 0xdc4(%rip), %rdi       # 0x200a
movl $0x1b6, %esi            # imm = 0x1B6
callq 0x1070
movl %eax, %ebx
leaq 0x2e07(%rip), %rsi      # 0x4060
movl $0x1000000, %edx        # imm = 0x1000000
movl %eax, %edi
callq 0x1040
movl %ebx, %edi
callq 0x1060
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/mcxiaoke[P]dsaac/ch3/sort_bucket/main.c
// Function: printArray
void printArray(int array[], int n){
    int i;
    for(i=0;i<n;i++){
        printf("%d ",array[i]);
    }
    printf("\n");
}

// Assembly:
testl %esi, %esi
jle 0x1199
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl %esi, %r15d
leaq 0xe8c(%rip), %r14       # 0x2004
xorl %r12d, %r12d
movl (%rbx,%r12,4), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
incq %r12
cmpq %r12, %r15
jne 0x117b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movl $0xa, %edi
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/mcxiaoke[P]dsaac/ch3/sort_bucket/main.c
// Function: main
int main(int argc, char **argv)
{
    int i;
    for(i=0;i<10;i++){
        nums[i]=rand()%100;
    }
    
    int j;
    for(j=0;j<10;j++){
        bucket[nums[j]]++;
    }
    
    printArray(nums,10);
    int k;
    for(k=0;k<100;k++){
        if(bucket[k]==1){
            printf("%d ",k);
        }
    }
	printf("\n");
    
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %r14d, %r14d
leaq 0x2e99(%rip), %rbx      # 0x4050
callq 0x1050
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
movl %eax, (%r14,%rbx)
addq $0x4, %r14
cmpq $0x28, %r14
jne 0x11b7
xorl %eax, %eax
leaq 0x2e92(%rip), %r15      # 0x4080
movslq (%rax,%rbx), %rcx
incl (%r15,%rcx,4)
addq $0x4, %rax
cmpq $0x28, %rax
jne 0x11ee
leaq 0x2e49(%rip), %rdi      # 0x4050
movl $0xa, %esi
callq 0x115c
leaq 0xdec(%rip), %rbx       # 0x2004
xorl %r14d, %r14d
cmpl $0x1, (%r15)
jne 0x122e
movq %rbx, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x1040
incq %r14
addq $0x4, %r15
cmpq $0x64, %r14
jne 0x121b
movl $0xa, %edi
callq 0x1030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/yueyoum[P]termgif/record.c
// Function: main
int main(int argc, char *argv[])
{
    Display *d = XOpenDisplay(NULL);
    if (d==NULL) {
        fprintf(stderr, "can not connect x server!\n");
        exit(2);
    }
    Window active;
    int revert;
    XWindowAttributes attr;

    XGetInputFocus(d, &active, &revert);
    /* active = current_window(d); */
    active = target_window(d);
    XGetWindowAttributes(d, active, &attr);

    int width = attr.width;
    int height = attr.height;
    printf("%d, %d, %d, %d\n", attr.x, attr.y, width, height);


    struct timeval delay;
    delay.tv_sec = 0;
    int i;
    char name[12] = {'\0'};
    XImage *image = XGetImage(d, active, 0, 0, width, height, AllPlanes, ZPixmap);
    init_wjpeg(image->width, image->height);

    for(i = 0; i<20; i++)
    {
        sprintf(name, "test_%02d.jpg", i);
        printf("%s\n", name);
        fflush(stdout);
        image = XGetImage(d, active, 0, 0, width, height, AllPlanes, ZPixmap);
        write_jpeg(image, name);
        delay.tv_usec = 500 * 1000;
        select(0, NULL, NULL, NULL, &delay);
    }

    destroy_wjpeg();
    XCloseDisplay(d);
    return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
xorl %edi, %edi
callq 0x20d0
testq %rax, %rax
je 0x2458
movq %rax, %rbx
leaq -0x30(%rbp), %r12
leaq -0x34(%rbp), %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2644
movq %rax, (%r12)
leaq -0xe0(%rbp), %r13
movq %rbx, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x2130
movl 0x8(%r13), %r14d
movl 0xc(%r13), %r15d
movl (%r13), %esi
movl 0x4(%r13), %edx
leaq 0x2ecb1(%rip), %rdi     # 0x3101f
movl %r14d, %ecx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x20a0
leaq -0x48(%rbp), %rax
xorl %ecx, %ecx
movq %rcx, (%rax)
leaq -0x58(%rbp), %r13
movq %rcx, (%r13)
movl $0x0, 0x8(%r13)
movq (%r12), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
movl %r15d, %r9d
pushq $0x2
pushq $-0x1
callq 0x21a0
addq $0x10, %rsp
movl (%rax), %edi
movl 0x4(%rax), %esi
callq 0x2460
xorl %r12d, %r12d
movq %r13, %rdi
leaq 0x2ec66(%rip), %rsi     # 0x3102f
movl %r12d, %edx
xorl %eax, %eax
callq 0x2150
movq %r13, %rdi
callq 0x2050
movq 0x6eb5e(%rip), %rax     # 0x70f40
movq (%rax), %rdi
callq 0x2110
movq -0x30(%rbp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
movl %r15d, %r9d
pushq $0x2
pushq $-0x1
callq 0x21a0
addq $0x10, %rsp
movq %rax, %rdi
movq %r13, %rsi
callq 0x24a8
movq $0x7a120, -0x40(%rbp)   # imm = 0x7A120
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
leaq -0x48(%rbp), %r8
callq 0x20f0
incl %r12d
cmpl $0x14, %r12d
jne 0x23bf
xorl %eax, %eax
callq 0x248b
movq %rbx, %rdi
callq 0x2190
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x21e0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/yueyoum[P]termgif/get_target_window.c
// Function: target_window
Window target_window(Display *d)
{
    Window w;
    Window parent;
    Window root = None;
    Window *children;
    unsigned int nchildren;
    Status s;

    while(parent != root)
    {
        w = parent;
        s = XQueryTree(d, w, &root, &parent, &children, &nchildren);

        if(s) XFree(children);
    }

    return w;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rax
testq %rax, %rax
je 0x26a9
movq %rdi, %rbx
leaq -0x38(%rbp), %r15
leaq -0x40(%rbp), %r12
leaq -0x44(%rbp), %r14
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
leaq -0x30(%rbp), %rdx
movq %r15, %rcx
movq %r12, %r8
movq %r14, %r9
callq 0x2080
testl %eax, %eax
je 0x269d
movq -0x40(%rbp), %rdi
callq 0x20b0
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x2675
jmp 0x26a9
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Env_find
bool Env_find(Env *env, const char *key, word *result) {
  if (env == NULL) {
    return false;
  }
  if (strcmp(env->name, key) == 0) {
    *result = env->value;
    return true;
  }
  return Env_find(env->prev, key, result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
testq %r14, %r14
je 0x18e8
movq (%r14), %rdi
movq %r15, %rsi
callq 0x10f0
testl %eax, %eax
je 0x18ec
movq 0x10(%r14), %r14
jmp 0x18ce
xorl %eax, %eax
jmp 0x18f5
movq 0x8(%r14), %rax
movq %rax, (%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: AST_heap_free
void AST_heap_free(ASTNode *node) {
  if (!AST_is_heap_object(node)) {
    return;
  }
  if (AST_is_pair(node)) {
    AST_heap_free(AST_pair_car(node));
    AST_heap_free(AST_pair_cdr(node));
  }
  free((void *)Object_address(node));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testb $0x3, %bl
sete %al
movl %ebx, %ecx
notl %ecx
testb $0x7, %cl
sete %cl
orb %al, %cl
jne 0x1a3f
movl %ebx, %eax
andl $0x7, %eax
cmpl $0x1, %eax
jne 0x1a2f
movq %rbx, %r14
andq $-0x8, %r14
movq (%r14), %rdi
callq 0x19ef
movq 0x8(%r14), %rdi
callq 0x19ef
andq $-0x8, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1030
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: AST_new_pair
ASTNode *AST_new_pair(ASTNode *car, ASTNode *cdr) {
  ASTNode *node = AST_heap_alloc(kPairTag, sizeof(Pair));
  AST_pair_set_car(node, car);
  AST_pair_set_cdr(node, cdr);
  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x10, %edi
movl $0x1, %esi
callq 0x10e0
movq %rax, %rcx
orq $0x1, %rax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x1, %edx
jne 0x1afb
andq $-0x8, %rcx
movq %r14, (%rcx)
movq %rbx, 0x8(%rcx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xdb34(%rip), %rdi      # 0xf636
leaq 0xda92(%rip), %rsi      # 0xf59b
leaq 0xdb38(%rip), %rcx      # 0xf648
movl $0xf0, %edx
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: AST_new_symbol
ASTNode *AST_new_symbol(const char *str) {
  word data_length = strlen(str) + 1;
  ASTNode *node = AST_heap_alloc(kSymbolTag, sizeof(Symbol) + data_length);
  Symbol *s = AST_as_symbol(node);
  s->length = data_length;
  memcpy(s->cstr, str, data_length);
  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1070
movq %rax, %r14
leaq 0x9(%rax), %rdi
movl $0x1, %esi
callq 0x10e0
movq %rax, %r15
orq $0x5, %r15
movl %r15d, %ecx
andl $0x7, %ecx
cmpl $0x5, %ecx
jne 0x1c19
incq %r14
andq $-0x8, %rax
movq %r14, (%rax)
addq $0x8, %rax
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1110
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xda45(%rip), %rdi      # 0xf665
leaq 0xd974(%rip), %rsi      # 0xf59b
leaq 0xda4b(%rip), %rcx      # 0xf679
movl $0x110, %edx            # imm = 0x110
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Buffer_alloc_writable
byte *Buffer_alloc_writable(size_t capacity) {
  byte *result = mmap(NULL, capacity, PROT_READ | PROT_WRITE,
                      MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
  assert(result != MAP_FAILED);
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rsi
xorl %edi, %edi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x1080
cmpq $-0x1, %rax
je 0x1d1f
popq %rbp
retq
leaq 0xd974(%rip), %rdi      # 0xf69a
leaq 0xd86e(%rip), %rsi      # 0xf59b
leaq 0xd97b(%rip), %rcx      # 0xf6af
movl $0x12e, %edx            # imm = 0x12E
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Buffer_init
void Buffer_init(Buffer *result, size_t capacity) {
  result->address = Buffer_alloc_writable(capacity);
  assert(result->address != MAP_FAILED);
  result->state = kWritable;
  result->len = 0;
  result->capacity = capacity;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1cf6
movq %rax, (%r14)
movl $0x0, 0x8(%r14)
movq $0x0, 0x10(%r14)
movq %rbx, 0x18(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Buffer_deinit
void Buffer_deinit(Buffer *buf) {
  munmap(buf->address, buf->capacity);
  buf->address = NULL;
  buf->len = 0;
  buf->capacity = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x18(%rbx), %rsi
callq 0x1150
movq $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Buffer_ensure_capacity
void Buffer_ensure_capacity(Buffer *buf, word additional_capacity) {
  if (buf->len + additional_capacity <= buf->capacity) {
    return;
  }
  word new_capacity =
      max(buf->capacity * 2, buf->capacity + additional_capacity);
  byte *address = Buffer_alloc_writable(new_capacity);
  memcpy(address, buf->address, buf->len);
  int result = munmap(buf->address, buf->capacity);
  assert(result == 0 && "munmap failed");
  buf->address = address;
  buf->capacity = new_capacity;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rcx
addq %rsi, %rcx
movq 0x18(%rdi), %rax
cmpq %rax, %rcx
jbe 0x1e72
movq %rsi, %rbx
movq %rdi, %r14
leaq (%rax,%rax), %rcx
addq %rax, %rbx
cmpq %rbx, %rcx
cmovgq %rcx, %rbx
movq %rbx, %rdi
callq 0x1cf6
movq %rax, %r15
movq (%r14), %rsi
movq 0x10(%r14), %rdx
movq %rax, %rdi
callq 0x1110
movq (%r14), %rdi
movq 0x18(%r14), %rsi
callq 0x1150
testl %eax, %eax
jne 0x1e7d
movq %r15, (%r14)
movq %rbx, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd84f(%rip), %rdi      # 0xf6d3
leaq 0xd710(%rip), %rsi      # 0xf59b
leaq 0xd860(%rip), %rcx      # 0xf6f2
movl $0x15d, %edx            # imm = 0x15D
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_mov_reg_imm32
void Emit_mov_reg_imm32(Buffer *buf, Register dst, int32_t src) {
  Buffer_write8(buf, kRexPrefix);
  Buffer_write8(buf, 0xc7);
  Buffer_write8(buf, modrm(3, dst, 0));
  Buffer_write32(buf, src);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x1, %esi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $0x48, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $-0x39, (%rax,%rcx)
andb $0x7, %r15b
orb $-0x40, %r15b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r15b, (%rax,%rcx)
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1ec9
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_add_reg_imm32
void Emit_add_reg_imm32(Buffer *buf, Register dst, int32_t src) {
  Buffer_write8(buf, kRexPrefix);
  if (dst == kRax) {
    // Optimization: add eax, {imm32} can either be encoded as 05 {imm32} or 81
    // c0 {imm32}.
    Buffer_write8(buf, 0x05);
  } else {
    Buffer_write8(buf, 0x81);
    Buffer_write8(buf, modrm(3, dst, 0));
  }
  Buffer_write32(buf, src);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x1, %esi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $0x48, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
testl %r15d, %r15d
je 0x20ec
movb $-0x7f, (%rax,%rcx)
andb $0x7, %r15b
orb $-0x40, %r15b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r15b, (%rax,%rcx)
jmp 0x20f0
movb $0x5, (%rax,%rcx)
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1ec9
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_sub_reg_imm32
void Emit_sub_reg_imm32(Buffer *buf, Register dst, int32_t src) {
  Buffer_write8(buf, kRexPrefix);
  if (dst == kRax) {
    // Optimization: sub eax, {imm32} can either be encoded as 2d {imm32} or 81
    // e8 {imm32}.
    Buffer_write8(buf, 0x2d);
  } else {
    Buffer_write8(buf, 0x81);
    Buffer_write8(buf, modrm(3, dst, 5));
  }
  Buffer_write32(buf, src);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x1, %esi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $0x48, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
testl %r15d, %r15d
je 0x2182
movb $-0x7f, (%rax,%rcx)
andb $0x7, %r15b
orb $-0x18, %r15b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r15b, (%rax,%rcx)
jmp 0x2186
movb $0x2d, (%rax,%rcx)
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1ec9
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_shl_reg_imm8
void Emit_shl_reg_imm8(Buffer *buf, Register dst, int8_t bits) {
  Buffer_write8(buf, kRexPrefix);
  Buffer_write8(buf, 0xc1);
  Buffer_write8(buf, modrm(3, dst, 4));
  Buffer_write8(buf, bits);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x1, %esi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $0x48, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $-0x3f, (%rax,%rcx)
andb $0x7, %r15b
orb $-0x20, %r15b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r15b, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %bl, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_shr_reg_imm8
void Emit_shr_reg_imm8(Buffer *buf, Register dst, int8_t bits) {
  Buffer_write8(buf, kRexPrefix);
  Buffer_write8(buf, 0xc1);
  Buffer_write8(buf, modrm(3, dst, 5));
  Buffer_write8(buf, bits);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x1, %esi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $0x48, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $-0x3f, (%rax,%rcx)
andb $0x7, %r15b
orb $-0x18, %r15b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r15b, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %bl, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_or_reg_imm8
void Emit_or_reg_imm8(Buffer *buf, Register dst, uint8_t tag) {
  Buffer_write8(buf, kRexPrefix);
  Buffer_write8(buf, 0x83);
  Buffer_write8(buf, modrm(3, dst, 1));
  Buffer_write8(buf, tag);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x1, %esi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $0x48, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $-0x7d, (%rax,%rcx)
andb $0x7, %r15b
orb $-0x38, %r15b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r15b, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %bl, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_cmp_reg_imm32
void Emit_cmp_reg_imm32(Buffer *buf, Register left, int32_t right) {
  Buffer_write8(buf, kRexPrefix);
  if (left == kRax) {
    // Optimization: cmp rax, {imm32} can be encoded as 0x3d {imm32}
    Buffer_write8(buf, 0x3d);
  } else {
    Buffer_write8(buf, 0x81);
    Buffer_write8(buf, modrm(3, left, 7));
  }
  Buffer_write32(buf, right);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x1, %esi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $0x48, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
testl %r15d, %r15d
je 0x2498
movb $-0x7f, (%rax,%rcx)
orb $-0x8, %r15b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r15b, (%rax,%rcx)
jmp 0x249c
movb $0x3d, (%rax,%rcx)
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1ec9
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_address_disp8
void Emit_address_disp8(Buffer *buf, Register direct, Indirect indirect) {
  if (indirect.reg == kRsp) {
    Buffer_write8(buf, modrm(1, kIndexNone, direct));
    Buffer_write8(buf, sib(kRsp, kIndexNone, Scale1));
  } else {
    Buffer_write8(buf, modrm(1, indirect.reg, direct));
  }
  Buffer_write8(buf, disp8(indirect.disp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r14
shlb $0x3, %r15b
andb $0x38, %r15b
cmpl $0x4, %ebx
jne 0x2592
orb $0x44, %r15b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r15b, (%rax,%rcx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movb $0x24, %r12b
jmp 0x25ad
movl %ebx, %r12d
andb $0x7, %r12b
orb %r15b, %r12b
orb $0x40, %r12b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r12b, (%rax,%rcx)
shrq $0x20, %rbx
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %bl, (%rax,%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_jcc
word Emit_jcc(Buffer *buf, Condition cond, int32_t offset) {
  Buffer_write8(buf, 0x0f);
  Buffer_write8(buf, 0x80 + cond);
  word pos = Buffer_len(buf);
  Buffer_write32(buf, disp32(offset));
  return pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
movl $0x1, %esi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $0xf, (%rax,%rcx)
addb $-0x80, %r15b
movl $0x1, %esi
movq %r14, %rdi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb %r15b, (%rax,%rcx)
movq 0x10(%r14), %r15
movq %r14, %rdi
movl %ebx, %esi
callq 0x1ec9
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_jmp
word Emit_jmp(Buffer *buf, int32_t offset) {
  Buffer_write8(buf, 0xe9);
  word pos = Buffer_len(buf);
  Buffer_write32(buf, disp32(offset));
  return pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x1, %esi
callq 0x1e13
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r14)
movb $-0x17, (%rax,%rcx)
movq 0x10(%r14), %r15
movq %r14, %rdi
movl %ebx, %esi
callq 0x1ec9
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Emit_rsp_adjust
void Emit_rsp_adjust(Buffer *buf, word adjust) {
  if (adjust < 0) {
    Emit_sub_reg_imm32(buf, kRsp, -adjust);
  } else if (adjust > 0) {
    Emit_add_reg_imm32(buf, kRsp, adjust);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, %rdx
testq %rsi, %rsi
js 0x29d1
je 0x29de
movl $0x4, %esi
popq %rbp
jmp 0x206e
negl %edx
movl $0x4, %esi
popq %rbp
jmp 0x2104
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Compile_expr
int Compile_expr(Buffer *buf, ASTNode *node, word stack_index, Env *varenv,
                 Env *labels) {
  if (AST_is_integer(node)) {
    word value = AST_get_integer(node);
    Emit_mov_reg_imm32(buf, kRax, Object_encode_integer(value));
    return 0;
  }
  if (AST_is_char(node)) {
    char value = AST_get_char(node);
    Emit_mov_reg_imm32(buf, kRax, Object_encode_char(value));
    return 0;
  }
  if (AST_is_bool(node)) {
    bool value = AST_get_bool(node);
    Emit_mov_reg_imm32(buf, kRax, Object_encode_bool(value));
    return 0;
  }
  if (AST_is_nil(node)) {
    Emit_mov_reg_imm32(buf, kRax, Object_nil());
    return 0;
  }
  if (AST_is_pair(node)) {
    return Compile_call(buf, AST_pair_car(node), AST_pair_cdr(node),
                        stack_index, varenv, labels);
  }
  if (AST_is_symbol(node)) {
    const char *symbol = AST_symbol_cstr(node);
    word value;
    if (Env_find(varenv, symbol, &value)) {
      Emit_load_reg_indirect(buf, kRax, Ind(kRsp, value));
      return 0;
    }
    return -1;
  }
  assert(0 && "unexpected node type");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rax
movq %rdi, %rbx
testb $0x3, %al
je 0x2b39
movq %r8, %r9
movq %rcx, %r8
movq %rdx, %rcx
movl %eax, %edx
andl $0x3f, %edx
cmpq $0x1f, %rdx
je 0x2b47
cmpl $0xf, %edx
jne 0x2b6a
movswl %ax, %edx
andl $0xffffff00, %edx       # imm = 0xFFFFFF00
orl $0xf, %edx
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x2b59
sarq $0x2, %rax
movq %rax, %rdi
callq 0x172c
jmp 0x2b4f
andl $0x80, %eax
orl $0x1f, %eax
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x1fb6
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
cmpq $0x2f, %rax
je 0x2b9b
movl %eax, %edx
andl $0x7, %edx
cmpq $0x5, %rdx
je 0x2baa
cmpl $0x1, %edx
jne 0x2bec
andq $-0x8, %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2c0b
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2f, %edx
jmp 0x2b59
andq $-0x8, %rax
addq $0x8, %rax
leaq -0x18(%rbp), %rdx
movq %r8, %rdi
movq %rax, %rsi
callq 0x18bb
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testb %al, %al
je 0x2b5e
movq -0x18(%rbp), %rax
movzbl %al, %edx
shlq $0x20, %rdx
orq $0x4, %rdx
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x27e8
jmp 0x2b5e
leaq 0xcb2b(%rip), %rdi      # 0xf71e
leaq 0xc9a1(%rip), %rsi      # 0xf59b
leaq 0xcb39(%rip), %rcx      # 0xf73a
movl $0x2aa, %edx            # imm = 0x2AA
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Compile_if
int Compile_if(Buffer *buf, ASTNode *cond, ASTNode *consequent,
               ASTNode *alternate, word stack_index, Env *varenv, Env *labels) {
  _(Compile_expr(buf, cond, stack_index, varenv, labels));
  Emit_cmp_reg_imm32(buf, kRax, Object_false());
  word alternate_pos = Emit_jcc(buf, kEqual, kLabelPlaceholder);
  _(Compile_expr(buf, consequent, stack_index, varenv, labels));
  word end_pos = Emit_jmp(buf, kLabelPlaceholder);
  Emit_backpatch_imm32(buf, alternate_pos);
  _(Compile_expr(buf, alternate, stack_index, varenv, labels));
  Emit_backpatch_imm32(buf, end_pos);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r12
movq %r8, %r15
movq %rcx, %r14
movq %rdx, -0x30(%rbp)
movq %rdi, %rbx
movq 0x10(%rbp), %r8
movq %r15, %rdx
movq %r9, %rcx
callq 0x2af5
movl %eax, %r8d
testl %eax, %eax
jne 0x375e
movl %eax, %r13d
movq %r14, -0x38(%rbp)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1f, %edx
callq 0x241e
movq %rbx, %rdi
movl $0x4, %esi
movl $0xdeadbeef, %edx       # imm = 0xDEADBEEF
callq 0x2850
movq %rax, %r14
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
movq %r15, %rdx
movq %r12, %rcx
movq 0x10(%rbp), %r8
callq 0x2af5
xorl %r8d, %r8d
movl %eax, %ecx
negl %ecx
sbbl %r8d, %r8d
orl %r13d, %r8d
testl %eax, %eax
jne 0x375e
movq %r8, -0x30(%rbp)
movq %r12, %r13
movl $0x1, %esi
movq %rbx, %rdi
callq 0x1e13
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rbx)
movb $-0x17, (%rax,%rcx)
movq 0x10(%rbx), %r12
movq %rbx, %rdi
movl $0xdeadbeef, %esi       # imm = 0xDEADBEEF
callq 0x1ec9
movl 0x10(%rbx), %eax
movslq %r14d, %rdx
subl %edx, %eax
addl $-0x4, %eax
xorl %ecx, %ecx
movl %eax, %esi
shrl %cl, %esi
movq (%rbx), %rdi
movb %sil, (%rdi,%rdx)
addq $0x8, %rcx
incq %rdx
cmpq $0x20, %rcx
jne 0x36f4
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %r15, %rdx
movq %r13, %rcx
movq 0x10(%rbp), %r8
callq 0x2af5
xorl %ecx, %ecx
movl %eax, %edx
negl %edx
sbbl %ecx, %ecx
testl %eax, %eax
je 0x3736
orl -0x30(%rbp), %ecx
movl %ecx, %r8d
jmp 0x375e
movl 0x10(%rbx), %eax
movslq %r12d, %rdx
subl %edx, %eax
addl $-0x4, %eax
xorl %r8d, %r8d
xorl %ecx, %ecx
movl %eax, %esi
shrl %cl, %esi
movq (%rbx), %rdi
movb %sil, (%rdi,%rdx)
addq $0x8, %rcx
incq %rdx
cmpq $0x20, %rcx
jne 0x3746
movl %r8d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Compile_cons
int Compile_cons(Buffer *buf, ASTNode *car, ASTNode *cdr, int stack_index,
                 Env *varenv, Env *labels) {
  // Compile and store car on the stack
  _(Compile_expr(buf, car, stack_index, varenv, labels));
  Emit_store_reg_indirect(buf, Ind(kRbp, stack_index), kRax);
  // Compile and store cdr
  _(Compile_expr(buf, cdr, stack_index - kWordSize, varenv, labels));
  Emit_store_reg_indirect(buf, Ind(kHeapPointer, kCdrOffset), kRax);
  // Fetch car and store in heap
  Emit_load_reg_indirect(buf, kRax, Ind(kRbp, stack_index));
  Emit_store_reg_indirect(buf, Ind(kHeapPointer, kCarOffset), kRax);

  // Store tagged pointer in tax
  Emit_mov_reg_reg(buf, kRax, kHeapPointer);
  Emit_or_reg_imm8(buf, kRax, kPairTag);
  // Bump the heap pointer
  Emit_add_reg_imm32(buf, kHeapPointer, kPairSize);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebx
movq %rdx, -0x38(%rbp)
movq %rdi, %r14
movslq %ecx, %rdx
movq %r8, %rcx
movq %r9, %r8
callq 0x2af5
testl %eax, %eax
jne 0x385d
movl %eax, %r13d
movq %r15, -0x30(%rbp)
movq %r14, %r15
movzbl %bl, %r14d
shlq $0x20, %r14
orq $0x5, %r14
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x25ec
addl $-0x8, %ebx
movslq %ebx, %rdx
movq %r15, %rbx
movq %r15, %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rcx
movq -0x30(%rbp), %r8
callq 0x2af5
movl %eax, %ecx
negl %ecx
movl $0x0, %ecx
sbbl %ecx, %ecx
testl %eax, %eax
je 0x37fb
orl %r13d, %ecx
movl %ecx, %eax
jmp 0x385d
movabsq $0x800000006, %rsi      # imm = 0x800000006
movq %rbx, %rdi
xorl %edx, %edx
callq 0x25ec
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x27e8
movl $0x6, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x25ec
movq %rbx, %rdi
xorl %esi, %esi
movl $0x6, %edx
callq 0x2932
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x22dc
movq %rbx, %rdi
movl $0x6, %esi
movl $0x10, %edx
callq 0x206e
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: list_length
word list_length(ASTNode *node) {
  if (AST_is_nil(node)) {
    return 0;
  }
  assert(AST_is_pair(node));
  return 1 + list_length(AST_pair_cdr(node));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
cmpq $0x2f, %rdi
je 0x388f
movl %edi, %ecx
andl $0x7, %ecx
cmpl $0x1, %ecx
jne 0x3891
andq $-0x8, %rdi
movq 0x8(%rdi), %rdi
incq %rax
jmp 0x3872
popq %rbp
retq
leaq 0xbd9e(%rip), %rdi      # 0xf636
leaq 0xbcfc(%rip), %rsi      # 0xf59b
leaq 0xbece(%rip), %rcx      # 0xf774
movl $0x2d6, %edx            # imm = 0x2D6
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Compile_labelcall
int Compile_labelcall(Buffer *buf, ASTNode *callable, ASTNode *args,
                      word stack_index, Env *varenv, Env *labels, word nargs,
                      word rsp_adjust) {
  if (AST_is_nil(args)) {
    const char *symbol = AST_symbol_cstr(callable);
    word code_address;
    if (!Env_find(labels, symbol, &code_address)) {
      return -1;
    }
    Emit_rsp_adjust(buf, rsp_adjust);
    Emit_call_imm32(buf, code_address);
    Emit_rsp_adjust(buf, -rsp_adjust);
    return 0;
  }

  assert(AST_is_pair(args));
  ASTNode *arg = AST_pair_car(args);
  _(Compile_expr(buf, arg, stack_index, varenv, labels));
  Emit_store_reg_indirect(buf, Ind(kRsp, stack_index), kRax);
  return Compile_labelcall(buf, callable, AST_pair_cdr(args),
                           stack_index - kWordSize, varenv, labels, nargs,
                           rsp_adjust);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, -0x30(%rbp)
movq %r8, %r13
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, -0x38(%rbp)
movq %rdi, %rbx
movq %rcx, %r14
shlq $0x20, %r14
cmpq $0x2f, %r12
je 0x3949
movl %r12d, %eax
andl $0x7, %eax
cmpl $0x1, %eax
jne 0x39b1
andq $-0x8, %r12
movq (%r12), %rsi
movq %rbx, %rdi
movq %r15, %rdx
movq %r13, %rcx
movq -0x30(%rbp), %r8
callq 0x2af5
testl %eax, %eax
jne 0x39a2
movq %r14, %rsi
movabsq $0xff00000000, %rax     # imm = 0xFF00000000
andq %rax, %rsi
orq $0x4, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x25ec
movq 0x8(%r12), %r12
addq $-0x8, %r15
movabsq $-0x800000000, %rax     # imm = 0xFFFFFFF800000000
addq %rax, %r14
jmp 0x38dc
movq -0x38(%rbp), %rsi
movl %esi, %eax
andl $0x7, %eax
cmpl $0x5, %eax
jne 0x39d0
andq $-0x8, %rsi
addq $0x8, %rsi
leaq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x18bb
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %cl, %cl
je 0x39a2
movq %rbx, %rdi
movq 0x18(%rbp), %r14
movq %r14, %rsi
callq 0x29b8
movq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x29e0
negq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29b8
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbdd8(%rip), %rdi      # 0xf790
leaq 0xbbdc(%rip), %rsi      # 0xf59b
leaq 0xbddc(%rip), %rcx      # 0xf7a2
movl $0x2e9, %edx            # imm = 0x2E9
callq 0x1090
leaq 0xbc8e(%rip), %rdi      # 0xf665
leaq 0xbbbd(%rip), %rsi      # 0xf59b
leaq 0xbc94(%rip), %rcx      # 0xf679
movl $0x110, %edx            # imm = 0x110
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Compile_let
int Compile_let(Buffer *buf, ASTNode *bindings, ASTNode *body, word stack_index,
                Env *binding_env, Env *body_env, Env *labels) {
  if (AST_is_nil(bindings)) {
    // Base case: no bindings (or none left)
    _(Compile_expr(buf, body, stack_index, body_env, labels));
    return 0;
  }
  assert(AST_is_pair(bindings));
  // Unpack the binding
  ASTNode *binding = AST_pair_car(bindings);
  ASTNode *name = AST_pair_car(binding);
  assert(AST_is_symbol(name));
  ASTNode *binding_expr = AST_pair_car(AST_pair_cdr(binding));
  // Evaluate the RHS, store result on stack
  _(Compile_expr(buf, binding_expr, stack_index, binding_env, labels));
  Emit_store_reg_indirect(buf, Ind(kRsp, stack_index), kRax);
  // Bind the name to a stack offset
  Env entry = Env_bind(AST_symbol_cstr(name), stack_index, body_env);
  _(Compile_let(buf, AST_pair_cdr(bindings), body, stack_index - kWordSize,
                binding_env, &entry, labels));
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
movq %rdi, %r15
movq 0x10(%rbp), %r10
cmpq $0x2f, %rsi
je 0x3b00
movq %rsi, %r13
movl %r13d, %eax
andl $0x7, %eax
cmpl $0x1, %eax
jne 0x3b41
andq $-0x8, %r13
movq (%r13), %rax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x1, %ecx
jne 0x3b22
andq $-0x8, %rax
movq (%rax), %r12
movl %r12d, %ecx
andl $0x7, %ecx
cmpl $0x5, %ecx
jne 0x3b60
movq %r9, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq 0x8(%rax), %rax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x1, %ecx
jne 0x3b22
andq $-0x8, %rax
movq (%rax), %rsi
movq %r15, %rdi
movq %rbx, %rdx
movq %r8, %rcx
movq %r8, -0x38(%rbp)
movq %r10, %r8
movq %r10, -0x30(%rbp)
callq 0x2af5
movl %eax, %r14d
testl %eax, %eax
jne 0x3aee
movzbl %bl, %esi
shlq $0x20, %rsi
orq $0x4, %rsi
xorl %r14d, %r14d
movq %r15, %rdi
xorl %edx, %edx
callq 0x25ec
andq $-0x8, %r12
addq $0x8, %r12
leaq -0x60(%rbp), %r9
movq %r12, (%r9)
movq %rbx, 0x8(%r9)
movq -0x40(%rbp), %rax
movq %rax, 0x10(%r9)
movq 0x8(%r13), %rsi
addq $-0x8, %rbx
movq -0x30(%rbp), %rax
movq %rax, (%rsp)
movq %r15, %rdi
movq -0x48(%rbp), %rdx
movq %rbx, %rcx
movq -0x38(%rbp), %r8
callq 0x39ef
negl %eax
sbbl %r14d, %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %rdx, %rsi
movq %rbx, %rdx
movq %r9, %rcx
movq %r10, %r8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2af5
leaq 0xbb0d(%rip), %rdi      # 0xf636
leaq 0xba6b(%rip), %rsi      # 0xf59b
leaq 0xbb11(%rip), %rcx      # 0xf648
movl $0xf0, %edx
callq 0x1090
leaq 0xbd75(%rip), %rdi      # 0xf8bd
leaq 0xba4c(%rip), %rsi      # 0xf59b
leaq 0xbd7d(%rip), %rcx      # 0xf8d3
movl $0x386, %edx            # imm = 0x386
callq 0x1090
leaq 0xbdb7(%rip), %rdi      # 0xf91e
leaq 0xba2d(%rip), %rsi      # 0xf59b
leaq 0xbd5e(%rip), %rcx      # 0xf8d3
movl $0x38a, %edx            # imm = 0x38A
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Compile_compare_imm32
void Compile_compare_imm32(Buffer *buf, int32_t value) {
  Emit_cmp_reg_imm32(buf, kRax, value);
  Emit_mov_reg_imm32(buf, kRax, 0);
  Emit_setcc_imm8(buf, kEqual, kAl);
  Emit_shl_reg_imm8(buf, kRax, kBoolShift);
  Emit_or_reg_imm8(buf, kRax, kBoolTag);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %edx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x241e
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1fb6
movq %rbx, %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x24b0
movq %rbx, %rdi
xorl %esi, %esi
movl $0x7, %edx
callq 0x219a
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1f, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x22dc
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Compile_code_impl
int Compile_code_impl(Buffer *buf, ASTNode *formals, ASTNode *body,
                      word stack_index, Env *varenv) {
  if (AST_is_nil(formals)) {
    _(Compile_expr(buf, body, stack_index, varenv, NULL));
    Buffer_write_arr(buf, kFunctionEpilogue, sizeof kFunctionEpilogue);
    return 0;
  }

  assert(AST_is_pair(formals));
  ASTNode *name = AST_pair_car(formals);
  assert(AST_is_symbol(name));
  Env entry = Env_bind(AST_symbol_cstr(name), stack_index, varenv);
  return Compile_code_impl(buf, AST_pair_cdr(formals), body,
                           stack_index - kWordSize, &entry);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpq $0x2f, %rsi
je 0x3c31
movl %esi, %eax
andl $0x7, %eax
cmpl $0x1, %eax
jne 0x3c72
andq $-0x8, %rsi
movq (%rsi), %rdi
movl %edi, %eax
andl $0x7, %eax
cmpl $0x5, %eax
jne 0x3c91
andq $-0x8, %rdi
addq $0x8, %rdi
leaq -0x20(%rbp), %rax
movq %rdi, (%rax)
movq %rcx, 0x8(%rax)
movq %r8, 0x10(%rax)
movq 0x8(%rsi), %rsi
addq $-0x8, %rcx
movq %rbx, %rdi
movq %rax, %r8
callq 0x3bd0
jmp 0x3c6b
movq %rbx, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
xorl %r8d, %r8d
callq 0x2af5
testl %eax, %eax
jne 0x3c6b
movl $0x1, %esi
movq %rbx, %rdi
callq 0x1e13
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rbx)
movb $-0x3d, (%rax,%rcx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0xbcb9(%rip), %rdi      # 0xf932
leaq 0xb91b(%rip), %rsi      # 0xf59b
leaq 0xbcc0(%rip), %rcx      # 0xf947
movl $0x3ab, %edx            # imm = 0x3AB
callq 0x1090
leaq 0xbc86(%rip), %rdi      # 0xf91e
leaq 0xb8fc(%rip), %rsi      # 0xf59b
leaq 0xbca1(%rip), %rcx      # 0xf947
movl $0x3ad, %edx            # imm = 0x3AD
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Compile_code
int Compile_code(Buffer *buf, ASTNode *code) {
  assert(AST_is_pair(code));
  ASTNode *code_sym = AST_pair_car(code);
  assert(AST_is_symbol(code_sym));
  assert(AST_symbol_matches(code_sym, "code"));
  ASTNode *formals = AST_pair_car(AST_pair_cdr(code));
  ASTNode *code_body = AST_pair_car(AST_pair_cdr(AST_pair_cdr(code)));
  return Compile_code_impl(buf, formals, code_body, -kWordSize, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %r14d, %eax
andl $0x7, %eax
cmpl $0x1, %eax
jne 0x3d54
movq %rdi, %rbx
andq $-0x8, %r14
movq (%r14), %rdi
movl %edi, %eax
andl $0x7, %eax
cmpl $0x5, %eax
jne 0x3d73
leaq 0xbcf2(%rip), %rsi      # 0xf9da
callq 0x1cb5
testb %al, %al
je 0x3d92
movq 0x8(%r14), %rax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x1, %ecx
jne 0x3d35
andq $-0x8, %rax
movq 0x8(%rax), %rcx
movl %ecx, %edx
andl $0x7, %edx
cmpl $0x1, %edx
jne 0x3d35
movq (%rax), %rsi
andq $-0x8, %rcx
movq (%rcx), %rdx
movq %rbx, %rdi
movq $-0x8, %rcx
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %rbp
jmp 0x3bd0
leaq 0xb8fa(%rip), %rdi      # 0xf636
leaq 0xb858(%rip), %rsi      # 0xf59b
leaq 0xb8fe(%rip), %rcx      # 0xf648
movl $0xf0, %edx
callq 0x1090
leaq 0xbc2f(%rip), %rdi      # 0xf98a
leaq 0xb839(%rip), %rsi      # 0xf59b
leaq 0xbc33(%rip), %rcx      # 0xf99c
movl $0x3b4, %edx            # imm = 0x3B4
callq 0x1090
leaq 0xbc48(%rip), %rdi      # 0xf9c2
leaq 0xb81a(%rip), %rsi      # 0xf59b
leaq 0xbc14(%rip), %rcx      # 0xf99c
movl $0x3b6, %edx            # imm = 0x3B6
callq 0x1090
leaq 0xbc46(%rip), %rdi      # 0xf9df
leaq 0xb7fb(%rip), %rsi      # 0xf59b
leaq 0xbbf5(%rip), %rcx      # 0xf99c
movl $0x3b7, %edx            # imm = 0x3B7
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/mtnygard[P]complisp/lisp.c
// Function: Compile_labels
int Compile_labels(Buffer *buf, ASTNode *bindings, ASTNode *body, Env *labels,
                   word body_pos) {
  if (AST_is_nil(bindings)) {
    Emit_backpatch_imm32(buf, body_pos);
    // Base case: no bindings; compile the body
    _(Compile_expr(buf, body, -kWordSize, NULL, labels));
    Buffer_write_arr(buf, kFunctionEpilogue, sizeof kFunctionEpilogue);
    return 0;
  }

  assert(AST_is_pair(bindings));
  // Get the next binding
  ASTNode *binding = AST_pair_car(bindings);
  ASTNode *name = AST_pair_car(binding);
  assert(AST_is_symbol(name));
  ASTNode *binding_code = AST_pair_car(AST_pair_cdr(binding));
  word function_location = Buffer_len(buf);
  // Compile the binding function
  _(Compile_code(buf, binding_code));
  // Bind the name to the location in the instruction strema
  Env entry = Env_bind(AST_symbol_cstr(name), function_location, labels);
  _(Compile_labels(buf, AST_pair_cdr(bindings), body, &entry, body_pos));
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r9
movq %rdi, %rbx
cmpq $0x2f, %rsi
je 0x3e7e
movq %rsi, %r13
movl %r13d, %eax
andl $0x7, %eax
cmpl $0x1, %eax
jne 0x3f18
andq $-0x8, %r13
movq (%r13), %rax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x1, %ecx
jne 0x3ef9
andq $-0x8, %rax
movq (%rax), %r15
movl %r15d, %ecx
andl $0x7, %ecx
cmpl $0x5, %ecx
jne 0x3f37
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq 0x8(%rax), %rax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x1, %ecx
jne 0x3ef9
andq $-0x8, %rax
movq (%rax), %rsi
movq 0x10(%rbx), %r12
movq %rbx, %rdi
callq 0x3cb0
testl %eax, %eax
jne 0x3ec2
andq $-0x8, %r15
addq $0x8, %r15
leaq -0x58(%rbp), %rcx
movq %r15, (%rcx)
movq %r12, 0x8(%rcx)
movq -0x38(%rbp), %rax
movq %rax, 0x10(%rcx)
movq 0x8(%r13), %rsi
movq %rbx, %rdi
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %r8
callq 0x3db1
xorl %r14d, %r14d
negl %eax
sbbl %r14d, %r14d
jmp 0x3ec5
movl 0x10(%rbx), %eax
movslq %r8d, %r8
subl %r8d, %eax
addl $-0x4, %eax
xorl %ecx, %ecx
movl %eax, %esi
shrl %cl, %esi
movq (%rbx), %rdi
movb %sil, (%rdi,%r8)
addq $0x8, %rcx
incq %r8
cmpq $0x20, %rcx
jne 0x3e8c
xorl %r14d, %r14d
movq %rbx, %rdi
movq %rdx, %rsi
movq $-0x8, %rdx
xorl %ecx, %ecx
movq %r9, %r8
callq 0x2af5
testl %eax, %eax
je 0x3ed7
movl %eax, %r14d
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %esi
movq %rbx, %rdi
callq 0x1e13
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rbx)
movb $-0x3d, (%rax,%rcx)
jmp 0x3ec5
leaq 0xb736(%rip), %rdi      # 0xf636
leaq 0xb694(%rip), %rsi      # 0xf59b
leaq 0xb73a(%rip), %rcx      # 0xf648
movl $0xf0, %edx
callq 0x1090
leaq 0xb99e(%rip), %rdi      # 0xf8bd
leaq 0xb675(%rip), %rsi      # 0xf59b
leaq 0xbad7(%rip), %rcx      # 0xfa04
movl $0x3c7, %edx            # imm = 0x3C7
callq 0x1090
leaq 0xb9e0(%rip), %rdi      # 0xf91e
leaq 0xb656(%rip), %rsi      # 0xf59b
leaq 0xbab8(%rip), %rcx      # 0xfa04
movl $0x3cb, %edx            # imm = 0x3CB
callq 0x1090