LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/alloc.c
// Function: alloc_scoped_env
static int alloc_scoped_env(env_t *env, int offset) {
    pair_t *pair;

    // Allocate homes for each variable at the current level
    map_for_each(env->homes, pair) {
        var_info_t *v = pair->value;
        string_t *name = pair->key;

        offset -= 8;
        debug("Found variable %s\n", string_get(name));
        v->home.reg = REG_RBP;
        v->home.offset = offset;
    }

    // Recursively allocate vars for all child envs
    env_t *child_env;
    list_for_each(env->children, child_env) {
        int child_offset = alloc_scoped_env(child_env, offset); 
        if (child_offset < offset)
            offset = child_offset;
    }

    return offset;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rdi)
addq $0x10, %rdi
leaq 0x10(%rsp), %rsi
callq 0x309c
testb %al, %al
je 0x133a
movslq %ebx, %r12
addq $-0x8, %r12
leaq 0x10(%rsp), %r15
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movl $0x5, 0x8(%rax)
movq %r12, 0x10(%rax)
movq (%r14), %rax
movq (%rax), %rdi
addq $0x10, %rdi
movq %r15, %rsi
callq 0x309c
addl $-0x8, %ebx
addq $-0x8, %r12
testb %al, %al
jne 0x1309
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rdi)
addq $0x10, %rdi
leaq 0x8(%rsp), %rsi
callq 0x309c
testb %al, %al
je 0x1385
leaq 0x8(%rsp), %r15
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x12ca
cmpl %ebx, %eax
cmovll %eax, %ebx
movq 0x8(%r14), %rdi
addq $0x10, %rdi
movq %r15, %rsi
callq 0x309c
testb %al, %al
jne 0x1360
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/asm.c
// Function: unique_label
static string_t *unique_label(char *seed) {
    static int count = 0;
    char buf[32];

    string_t *name = string_new();
    string_append(name, seed, strnlen(seed, 100));

    snprintf(buf, 32, "%d", count++);
    string_append(name, buf, strnlen(buf, 32));
    return name;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
callq 0x4d75
movq %rax, %rbx
movl $0x64, %esi
movq %r14, %rdi
callq 0x10b0
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x4db1
movl 0x8946(%rip), %ecx      # 0xa0ac
leal 0x1(%rcx), %eax
movl %eax, 0x893d(%rip)      # 0xa0ac
leaq 0x4b08(%rip), %rdx      # 0x627e
movq %rsp, %r14
movl $0x20, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
movl $0x20, %esi
movq %r14, %rdi
callq 0x10b0
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x4db1
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/asm.c
// Function: instr_noarg
static output_t *instr_noarg(opcode_t op) {
    output_t *out = malloc(sizeof(output_t));
    if (!out) {
        UNREACHABLE("instr: malloc failed");
    }

    out->instr.num_args = op_to_num_args(op);
    if (out->instr.num_args != 0) {
        UNREACHABLE("instr: opcode has nonzero number of args\n");
    }

    out->type = OUTPUT_INSTR;
    out->instr.op = op;

    return out;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x40, %edi
callq 0x10e0
testq %rax, %rax
je 0x1e73
leal -0x1(%rbx), %ecx
cmpl $0x16, %ecx
ja 0x1e67
movl $0x7fdffb, %edx         # imm = 0x7FDFFB
btl %ecx, %edx
jb 0x1e8f
xorl %ecx, %ecx
movl %ecx, 0xc(%rax)
movl %ecx, (%rax)
movl %ebx, 0x8(%rax)
popq %rbx
retq
leaq 0x42ba(%rip), %rdi      # 0x6134
leaq 0x42ed(%rip), %rsi      # 0x616e
leaq 0x47a1(%rip), %rcx      # 0x6629
movl $0xcc, %edx
jmp 0x1eb8
movl %ecx, %ecx
leaq 0x4240(%rip), %rdx      # 0x60d8
movl (%rdx,%rcx,4), %ecx
movl %ecx, 0xc(%rax)
leaq 0x428f(%rip), %rdi      # 0x6134
leaq 0x42c2(%rip), %rsi      # 0x616e
leaq 0x478b(%rip), %rcx      # 0x663e
movl $0xd1, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/asm.c
// Function: instr_r
static output_t *instr_r(opcode_t op, reg_t src) {
    output_t *out = malloc(sizeof(output_t));
    if (!out) {
        UNREACHABLE("instr_r: malloc failed\n");
    }

    out->instr.num_args = op_to_num_args(op);
    if (out->instr.num_args != 1) {
        UNREACHABLE("instr_r: num args != 1 for this opcode\n");
    }

    out->type = OUTPUT_INSTR;
    out->instr.op = op;

    out->instr.src.type = OPERAND_REG;
    out->instr.src.reg = src;
    return out;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %ebx
movl $0x40, %edi
callq 0x10e0
testq %rax, %rax
je 0x1f09
cmpl $0x17, %ebx
ja 0x1f62
movl $0xff93e0, %ecx         # imm = 0xFF93E0
btl %ebx, %ecx
jae 0x1f25
movq $0x1, 0xc(%rax)
movl $0x0, (%rax)
movl %ebx, 0x8(%rax)
movl %ebp, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x4224(%rip), %rdi      # 0x6134
leaq 0x4257(%rip), %rsi      # 0x616e
leaq 0x42b8(%rip), %rcx      # 0x61d6
movl $0xa2, %edx
jmp 0x1f51
movl $0x2, %ecx
movl $0x2c16, %edx           # imm = 0x2C16
btl %ebx, %edx
jae 0x1f62
movl %ecx, 0xc(%rax)
leaq 0x41f6(%rip), %rdi      # 0x6134
leaq 0x4229(%rip), %rsi      # 0x616e
leaq 0x42a2(%rip), %rcx      # 0x61ee
movl $0xa7, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
xorl %ecx, %ecx
jmp 0x1f34
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/asm.c
// Function: instr_r2r
static output_t *instr_r2r(opcode_t op, reg_t src, reg_t dst) {
    output_t *out = malloc(sizeof(output_t));
    if (!out) {
        UNREACHABLE("instr_r2r: malloc failed\n");
    }

    out->instr.num_args = op_to_num_args(op);
    if (out->instr.num_args != 2) {
        UNREACHABLE("instr_r2r: num args != 2\n");
    }

    out->type = OUTPUT_INSTR;
    out->instr.op = op;
    out->instr.src.type = OPERAND_REG;
    out->instr.src.reg = src;

    out->instr.dst.type = OPERAND_REG;
    out->instr.dst.reg = dst;
    return out;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %r14d
movl %edi, %ebp
movl $0x40, %edi
callq 0x10e0
testq %rax, %rax
je 0x1fdf
cmpl $0x17, %ebp
ja 0x200a
movl $0x2c16, %ecx           # imm = 0x2C16
btl %ebp, %ecx
jae 0x1fb1
movq $0x2, 0xc(%rax)
xorl %ecx, %ecx
movl %ecx, (%rax)
movl %ebp, 0x8(%rax)
movl %r14d, 0x18(%rax)
movl %ecx, 0x28(%rax)
movl %ebx, 0x30(%rax)
popq %rbx
popq %r14
popq %rbp
retq
movl $0x1, %ecx
movl $0xff93e0, %edx         # imm = 0xFF93E0
btl %ebp, %edx
jae 0x200a
movl %ecx, 0xc(%rax)
leaq 0x416a(%rip), %rdi      # 0x6134
leaq 0x419d(%rip), %rsi      # 0x616e
leaq 0x4258(%rip), %rcx      # 0x6230
movl $0x42, %edx
jmp 0x1ff9
leaq 0x414e(%rip), %rdi      # 0x6134
leaq 0x4181(%rip), %rsi      # 0x616e
leaq 0x4222(%rip), %rcx      # 0x6216
movl $0x3d, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
xorl %ecx, %ecx
jmp 0x1fc0
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/asm.c
// Function: instr_i2r
static output_t *instr_i2r(opcode_t op, imm_t src, reg_t dst) {
    output_t *out = malloc(sizeof(output_t));
    if (!out) {
        UNREACHABLE("instr_i2r: malloc failed\n");
    }

    out->instr.num_args = op_to_num_args(op);
    if (out->instr.num_args != 2) {
        UNREACHABLE("instr_i2r: num args != 2\n");
    }

    out->type = OUTPUT_INSTR;
    out->instr.op = op;

    out->instr.src.type = OPERAND_IMM;
    out->instr.src.imm = src;

    out->instr.dst.type = OPERAND_REG;
    out->instr.dst.reg = dst;
    return out;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %ebp
movl $0x40, %edi
callq 0x10e0
testq %rax, %rax
je 0x208d
cmpl $0x17, %ebp
ja 0x20b8
movl $0x2c16, %ecx           # imm = 0x2C16
btl %ebp, %ecx
jae 0x205f
movabsq $0x300000002, %rcx      # imm = 0x300000002
movq %rcx, 0xc(%rax)
xorl %ecx, %ecx
movl %ecx, (%rax)
movl %ebp, 0x8(%rax)
movq %r14, 0x18(%rax)
movl %ecx, 0x28(%rax)
movl %ebx, 0x30(%rax)
popq %rbx
popq %r14
popq %rbp
retq
movl $0x1, %ecx
movl $0xff93e0, %edx         # imm = 0xFF93E0
btl %ebp, %edx
jae 0x20b8
movl %ecx, 0xc(%rax)
leaq 0x40bc(%rip), %rdi      # 0x6134
leaq 0x40ef(%rip), %rsi      # 0x616e
leaq 0x41de(%rip), %rcx      # 0x6264
movl $0x57, %edx
jmp 0x20a7
leaq 0x40a0(%rip), %rdi      # 0x6134
leaq 0x40d3(%rip), %rsi      # 0x616e
leaq 0x41a8(%rip), %rcx      # 0x624a
movl $0x52, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
xorl %ecx, %ecx
jmp 0x206e
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/asm.c
// Function: instr_label
static output_t *instr_label(opcode_t op, string_t *label) {
    if (op != OP_JMP && op != OP_JE && op != OP_JNE && op != OP_CALL) {
        UNREACHABLE("intsr_label: not a jmp or call opcode\n");
    }

    if (!label) {
        UNREACHABLE("intsr_label: null label\n");
    }

    output_t *out = malloc(sizeof(output_t));
    out->type = OUTPUT_INSTR;
 
    out->instr.num_args = op_to_num_args(op);
    if (out->instr.num_args != 1) {
        UNREACHABLE("instr_label: opcode has wrong number of args, not even sure how this happens\n");
    }

    out->instr.op = op;
    out->instr.src.type = OPERAND_LABEL;
    out->instr.src.label = label;
    return out;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %r14d
leal -0x18(%r14), %eax
cmpl $-0x5, %eax
jbe 0x2c8b
movq %rsi, %rbx
testq %rsi, %rsi
je 0x2ca7
movl $0x40, %edi
callq 0x10e0
movl $0x0, (%rax)
movabsq $0x400000001, %rcx      # imm = 0x400000001
movq %rcx, 0xc(%rax)
movl %r14d, 0x8(%rax)
movq %rbx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x34a2(%rip), %rdi      # 0x6134
leaq 0x34d5(%rip), %rsi      # 0x616e
leaq 0x3949(%rip), %rcx      # 0x65e9
movl $0xb4, %edx
jmp 0x2cc1
leaq 0x3486(%rip), %rdi      # 0x6134
leaq 0x34b9(%rip), %rsi      # 0x616e
leaq 0x3954(%rip), %rcx      # 0x6610
movl $0xb8, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/asm.c
// Function: block_or_single_to_instrs
static list_t *block_or_single_to_instrs(block_or_single_t *block_or_single, context_t context) {
    list_t *ret = list_new();
    if (block_or_single->type == SINGLE) {
        list_concat(ret, stmt_to_instrs(block_or_single->single, context));
    } else {
        list_concat(ret, block_to_instrs(block_or_single->block, context));
    }
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
leaq 0x40(%rsp), %r15
callq 0x2ea0
movq %rax, %rbx
cmpl $0x1, (%r14)
movq 0x8(%r14), %rdi
jne 0x2d0e
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x17ad
jmp 0x2d25
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2d3d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2f51
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/asm.c
// Function: block_to_instrs
static list_t *block_to_instrs(block_t *block, context_t context) {
    list_t *ret = list_new();
    stmt_t *curr_stmt = list_pop(block->stmts);
    context.env = block->env;
    for (; curr_stmt; curr_stmt = list_pop(block->stmts)) {
        list_concat(ret, stmt_to_instrs(curr_stmt, context));
    }
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x2ea0
movq %rax, %r14
movq (%rbx), %rdi
callq 0x2f9f
movq 0x8(%rbx), %rcx
movq %rcx, 0x58(%rsp)
testq %rax, %rax
je 0x2d9e
leaq 0x40(%rsp), %r15
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0x17ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x2f51
movq (%rbx), %rdi
callq 0x2f9f
testq %rax, %rax
jne 0x2d6c
movq %r14, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/env.c
// Function: env_new
env_t *env_new(env_t *parent) {
    env_t *new_env = malloc(sizeof(env_t));
    if (!new_env)
        return NULL;

    new_env->parent = parent;
    new_env->children = list_new();
    new_env->homes = map_new();

    if (parent)
        list_push(parent->children, new_env);

    return new_env;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x18, %edi
callq 0x10e0
movq %rax, %rbx
testq %rax, %rax
je 0x2deb
movq %r14, 0x10(%rbx)
callq 0x2ea0
movq %rax, 0x8(%rbx)
callq 0x3158
movq %rax, (%rbx)
testq %r14, %r14
je 0x2deb
movq 0x8(%r14), %rdi
movq %rbx, %rsi
callq 0x2f0b
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/env.c
// Function: env_get
var_info_t *env_get(env_t *env, string_t *var) {
    var_info_t *ret = NULL;
    while (env) {
        if ((ret = map_get(env->homes, var)))
            return ret;
        env = env->parent;
    }
    return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x2e28
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3183
testq %rax, %rax
jne 0x2e20
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x2e05
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/env.c
// Function: env_get_declared
var_info_t *env_get_declared(env_t *env, string_t *var) {
    var_info_t *ret = NULL;
    while (env) {
        if ((ret = map_get(env->homes, var)) && ret->declared)
            return ret;
        env = env->parent;
    }
    return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x2e63
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3183
testq %rax, %rax
je 0x2e50
cmpb $0x0, 0x18(%rax)
jne 0x2e5b
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x2e3a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/env.c
// Function: env_add
void env_add(env_t *env, string_t *name, builtin_type_t type, bool declared) {
    var_info_t *info = malloc(sizeof(var_info_t)); 
    info->type = type;
    info->declared = declared;
    map_set(env->homes, name, info);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl $0x20, %edi
callq 0x10e0
movl %ebp, (%rax)
movb %bl, 0x18(%rax)
movq (%r15), %rdi
movq %r14, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x31fd
nop
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/list.c
// Function: list_new
list_t *list_new(void) {
    list_t *list = malloc(sizeof(list_t));
    if (list_init(list) < 0)
        return NULL;
    return list;
}

// Assembly:
pushq %rbx
movl $0x20, %edi
callq 0x10e0
movq %rax, %rbx
testq %rax, %rax
je 0x2ed3
movl $0x0, 0x18(%rbx)
movl $0x10, %edi
callq 0x10e0
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
movq $0x0, 0x8(%rax)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/list.c
// Function: list_push
int list_push(list_t *list, void *data) {
    if (!data)
        return -1;

    list_node_t *new_node = malloc(sizeof(list_node_t));
    if (!new_node)
        return -1;

    new_node->data = data;
    new_node->next = NULL;
    list->tail->next = new_node;
    list->tail = list->tail->next;
    list->len++;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x2f4a
movq %rsi, %r14
movq %rdi, %rbx
movl $0x10, %edi
callq 0x10e0
testq %rax, %rax
je 0x2f4a
movq %r14, (%rax)
movq $0x0, 0x8(%rax)
movq 0x8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq %rax, 0x8(%rbx)
incl 0x18(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/list.c
// Function: list_concat
int list_concat(list_t *l1, list_t *l2) {
    if (!l1 || !l2)
        return -1;

    l1->tail->next = l2->head->next;
    if (l2->len)
        l1->tail = l2->tail;
    l1->len += l2->len;
    free(l2->head);
    free(l2);
    return 0;
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
orb %cl, %dl
jne 0x2f9e
pushq %rbx
movq %rsi, %rbx
movq (%rsi), %rax
movq 0x8(%rax), %rcx
movq 0x8(%rdi), %rdx
movq %rcx, 0x8(%rdx)
movl 0x18(%rsi), %ecx
testl %ecx, %ecx
je 0x2f88
movq 0x8(%rbx), %rdx
movq %rdx, 0x8(%rdi)
addl %ecx, 0x18(%rdi)
movq %rax, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/list.c
// Function: list_pop
void *list_pop(list_t *list) {
    if (!list)
        return NULL;
    if (list->len == 0)
        return NULL;
    assert(list->head->next);
    list_node_t *removed = list->head->next;
    void *ret_data = removed->data;
    list->head->next = removed->next;
    list->len--;
    if (list->len == 0)
        list->tail = NULL;

    free(removed);
    return ret_data;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2fdc
movl 0x18(%rdi), %ecx
testl %ecx, %ecx
je 0x2fdc
movq (%rdi), %rdx
movq 0x8(%rdx), %rax
testq %rax, %rax
je 0x2fe3
movq (%rax), %rbx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rdx)
decl %ecx
movl %ecx, 0x18(%rdi)
jne 0x2fd2
movq $0x0, 0x8(%rdi)
movq %rax, %rdi
callq 0x1030
jmp 0x2fde
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
leaq 0x367e(%rip), %rdi      # 0x6668
leaq 0x3688(%rip), %rsi      # 0x6679
leaq 0x3688(%rip), %rcx      # 0x6680
movl $0x39, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/list.c
// Function: list_peek
void *list_peek(list_t *list) {
    if (!list)
        return NULL;
    if (!list->len)
        return NULL;
    assert(list->head->next);
    return list->head->next->data;
}

// Assembly:
testq %rdi, %rdi
je 0x301d
cmpl $0x0, 0x18(%rdi)
je 0x301d
movq (%rdi), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x3020
movq (%rax), %rax
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x3640(%rip), %rdi      # 0x6668
leaq 0x364a(%rip), %rsi      # 0x6679
leaq 0x3663(%rip), %rcx      # 0x6699
movl $0x4a, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/list.c
// Function: list_free
void list_free(list_t *list) {
    if (!list)
        return;
    void *data;
    while ((data = list_pop(list))) {
        // assume it's heap allocated
        free(data);
    }
    assert(list->head->next == list->tail);
    free(list->head);
    free(list);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x307b
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x2f9f
testq %rax, %rax
je 0x3060
movq %rax, %rdi
callq 0x1030
jmp 0x3049
movq (%rbx), %rdi
movq 0x8(%rdi), %rax
cmpq 0x8(%rbx), %rax
jne 0x307d
callq 0x1030
movq %rbx, %rdi
popq %rbx
jmp 0x1030
popq %rbx
retq
leaq 0x362f(%rip), %rdi      # 0x66b3
leaq 0x35ee(%rip), %rsi      # 0x6679
leaq 0x3640(%rip), %rcx      # 0x66d2
movl $0x57, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/list.c
// Function: _list_iterate
inline bool __list_iterate(list_node_t **node, void **data) {
    if (*node == NULL)
        return false;

    *data = (*node)->data;
    *node = (*node)->next;
    return true;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x30b4
movq (%rax), %rcx
movq %rcx, (%rsi)
movq (%rdi), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%rdi)
testq %rax, %rax
setne %al
retq
nop
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/main.c
// Function: main
int main(int argc, char **argv) {
    if (argc != 2) {
        usage();
        return -1;
    }
   
    char *filename = argv[1];
    string_t *input = file_to_string(filename);
    if (!input || !input->len)
        return -1;

    debug("Tokenizing...\n");
    list_t *tokens = tokenize(input);
    if (!tokens || !tokens->len)
        return -1;

    debug("Parsing...\n");
    program_t *prog = parse(tokens);
    if (!prog || !prog->fn_defs)
        return -1;

    /*
     * TODO - do variable allocation here.
     */
    debug("Allocating variable homes...\n");
    alloc_homes(prog);

    debug("Generating asm...\n");
    list_t *instrs = gen_asm(prog);
    if (!instrs || !instrs->len)
        return -1;

    debug("Outputting asm...\n");
    print_asm(instrs);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jne 0x313a
movq 0x8(%rsi), %rdi
callq 0x4ca0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x314b
cmpl $0x0, 0x8(%rax)
je 0x314b
movq %rax, %rdi
callq 0x4f18
testq %rax, %rax
je 0x314b
cmpl $0x0, 0x18(%rax)
je 0x314b
movq %rax, %rdi
callq 0x35f0
testq %rax, %rax
je 0x314b
movq %rax, %r14
cmpq $0x0, (%rax)
je 0x314b
movq %r14, %rdi
callq 0x125c
movq %r14, %rdi
callq 0x1394
testq %rax, %rax
je 0x314b
cmpl $0x0, 0x18(%rax)
je 0x314b
movq %rax, %rdi
callq 0x3268
xorl %ebx, %ebx
jmp 0x314b
leaq 0x35aa(%rip), %rdi      # 0x66eb
callq 0x1050
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/map.c
// Function: map_new
map_t *map_new(void) {
    map_t *ret = malloc(sizeof(map_t)); 
    if (!ret)
        return NULL;
    ret->pairs = list_new();
    if (!ret->pairs)
        return NULL;
    return ret;
}

// Assembly:
pushq %rbx
movl $0x8, %edi
callq 0x10e0
testq %rax, %rax
je 0x317c
movq %rax, %rbx
callq 0x2ea0
movq %rax, (%rbx)
testq %rax, %rax
cmoveq %rax, %rbx
jmp 0x317e
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/map.c
// Function: map_get_pair_from_key
static pair_t *map_get_pair_from_key(map_t *map, string_t *key) {
    pair_t *pair;
    list_for_each(map->pairs, pair) {
        if (string_eq(key, pair->key) == 0) {
            return pair;
        }
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
movq (%rax), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq %rsp, %r12
xorl %ebx, %ebx
movq (%r15), %rdi
addq $0x10, %rdi
movq %r12, %rsi
callq 0x309c
testb %al, %al
je 0x31ee
movq (%rsp), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x4ec2
testl %eax, %eax
jne 0x31c4
movq (%rsp), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/map.c
// Function: map_set
int map_set(map_t *map, string_t *key, void *value) {
    if (!map)
        return -1;

    // Overwrite the value if the key already exists in the map
    pair_t *pair = map_get_pair_from_key(map, key);
    if (pair) {
        pair->value = value;
        return 0;
    }
   
    pair = malloc(sizeof(pair_t));
    if (!pair)
        return -1;
    pair->key = key;
    pair->value = value;
    list_push(map->pairs, pair);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x324b
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
callq 0x31a3
testq %rax, %rax
je 0x3228
movq %r14, 0x8(%rax)
jmp 0x3249
movl $0x10, %edi
callq 0x10e0
testq %rax, %rax
je 0x324b
movq %r12, (%rax)
movq %r14, 0x8(%rax)
movq (%r15), %rdi
movq %rax, %rsi
callq 0x2f0b
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/output.c
// Function: operand_to_string
static char *operand_to_string(operand_t operand) {
    if (operand.type == OPERAND_REG) {
        return reg_to_string(operand.reg);
    }

    if (operand.type == OPERAND_LABEL) {
        return string_get(operand.label);
    }

    if (operand.type == OPERAND_VAR) {
        UNREACHABLE("VARs should not be in output\n");
    }

    string_t string;
    char buf[100];
    if (string_init(&string) < 0)
        return NULL;
    
    if (operand.type == OPERAND_IMM) {
        snprintf(buf, 100, "$%ld", operand.imm);
    } else if (operand.type == OPERAND_MEM_LOC) {
        snprintf(buf, 100, "%ld(%s)", operand.mem.offset, reg_to_string(operand.mem.reg));
    }
    string_append(&string, buf, strlen(buf));
    return string_get(&string);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
leaq 0xa0(%rsp), %rbx
movl (%rbx), %ebp
testl %ebp, %ebp
je 0x34ff
cmpl $0x4, %ebp
je 0x34eb
cmpl $0x2, %ebp
je 0x35c3
movq %rsp, %rdi
callq 0x4e06
testl %eax, %eax
js 0x353b
cmpl $0x1, %ebp
je 0x353f
cmpl $0x3, %ebp
jne 0x3592
movq 0x8(%rbx), %rcx
leaq 0x32f2(%rip), %rdx      # 0x67c7
leaq 0x10(%rsp), %rdi
movl $0x64, %esi
xorl %eax, %eax
callq 0x1090
jmp 0x3592
movq 0x8(%rbx), %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4e85
movl 0x8(%rbx), %eax
cmpl $0x1, %eax
jne 0x3513
leaq 0x32c6(%rip), %rax      # 0x67d4
jmp 0x35b7
movl $0x18, %edx
leaq 0x6691(%rip), %rcx      # 0x9bb0
movq %rdx, %rsi
addq $0x10, %rdx
cmpq $0xe8, %rdx
je 0x3535
cmpl %eax, -0x8(%rsi,%rcx)
jne 0x351f
movq (%rsi,%rcx), %rax
jmp 0x35b7
xorl %eax, %eax
jmp 0x35b7
movq 0x10(%rbx), %rcx
movl 0x8(%rbx), %eax
cmpl $0x1, %eax
jne 0x3554
leaq 0x3282(%rip), %r8       # 0x67d4
jmp 0x357a
movl $0x18, %esi
leaq 0x6650(%rip), %rdx      # 0x9bb0
movq %rsi, %rdi
addq $0x10, %rsi
cmpq $0xe8, %rsi
je 0x3576
cmpl %eax, -0x8(%rdi,%rdx)
jne 0x3560
movq (%rdi,%rdx), %r8
leaq 0x324b(%rip), %rdx      # 0x67cc
leaq 0x10(%rsp), %rdi
movl $0x64, %esi
xorl %eax, %eax
callq 0x1090
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x1070
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x4db1
movq %r14, %rdi
callq 0x4e85
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2b6a(%rip), %rdi      # 0x6134
leaq 0x31cf(%rip), %rsi      # 0x67a0
leaq 0x31d1(%rip), %rcx      # 0x67a9
movl $0x5c, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
nop
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: match
static bool match(list_t *tokens, token_type_t expectation) {
    token_t *next = list_peek(tokens);
    if (!next || next->type != expectation) {
        return false;
    }
    debug("Found expected\n");
    list_pop(tokens);
    return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x3002
testq %rax, %rax
je 0x393e
cmpl %ebp, (%rax)
jne 0x393e
movq %rbx, %rdi
callq 0x2f9f
movb $0x1, %al
jmp 0x3940
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_stmt_list
static list_t *parse_stmt_list(list_t *tokens, env_t *env) {
    expect_next(tokens, TOK_OPEN_BRACE);
    list_t *stmt_list = list_new();
    token_t *curr;
    debug("parsing statement list\n");
    while ((curr = list_peek(tokens)) && curr->type != TOK_CLOSE_BRACE) {
        list_push(stmt_list, parse_stmt(tokens, env));
    }
    debug("done parsing statement list\n");
    expect_next(tokens, TOK_CLOSE_BRACE);
    return stmt_list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0xc, %esi
callq 0x39e5
callq 0x2ea0
movq %rax, %r15
movq %rbx, %rdi
callq 0x3002
testq %rax, %rax
je 0x398e
cmpl $0xd, (%rax)
je 0x398e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3a23
movq %r15, %rdi
movq %rax, %rsi
callq 0x2f0b
jmp 0x3964
movq %rbx, %rdi
movl $0xd, %esi
callq 0x39e5
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: expect_next
static token_t *expect_next(list_t *tokens, token_type_t expectation) {
    token_t *next = list_pop(tokens);
    if (!next || next->type != expectation) {
        debug("Unexpected token: %u\n", (unsigned)next->type);
        UNREACHABLE("Parse failed");
    }
    return next;
}

// Assembly:
pushq %rbx
movl %esi, %ebx
callq 0x2f9f
testq %rax, %rax
je 0x39f8
cmpl %ebx, (%rax)
jne 0x39f8
popq %rbx
retq
leaq 0x2735(%rip), %rdi      # 0x6134
leaq 0x2e46(%rip), %rsi      # 0x684c
leaq 0x2f1e(%rip), %rcx      # 0x692b
movl $0x20, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_block
static block_t *parse_block(list_t *tokens, env_t *outer) {
    block_t *block = malloc(sizeof(block_t));
    block->env = env_new(outer);
    block->stmts = parse_stmt_list(tokens, block->env);
    return block;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x10, %edi
callq 0x10e0
movq %rax, %r15
movq %rbx, %rdi
callq 0x2dac
movq %rax, 0x8(%r15)
movq %r14, %rdi
movq %rax, %rsi
callq 0x3947
movq %rax, (%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_declare_stmt
static declare_stmt_t *parse_declare_stmt(list_t *tokens, env_t *env) {
    declare_stmt_t *declare = malloc(sizeof(declare_stmt_t));
    declare->init_expr = NULL;
    token_t *next = list_pop(tokens);
    declare->type = token_to_builtin_type(next->type); 
    next = list_peek(tokens);
    if (next->type != TOK_IDENT) {
        debug("Error in parse_declare_stmt: No identifier found following the type.\n");
        return NULL;
    }

    declare->name = next->ident;
    debug("parse_declare_stmt: Found variable %s\n", string_get(declare->name));

    if (map_contains(env->homes, declare->name)) {
        UNREACHABLE("parse_declare_stmt: variable is redeclared!\n");
    }
    env_add(env, declare->name, declare->type, false);

    list_pop(tokens);
    next = list_peek(tokens);
    if (next->type != TOK_SEMICOLON) {
        debug("parse_declare_stmt: Found init_expr\n");
        expect_next(tokens, TOK_ASSIGN);
        declare->init_expr = parse_expr(tokens, env);
    }
    expect_next(tokens, TOK_SEMICOLON);
    debug("parse_declare_stmt: Returning\n");
    return declare;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x18, %edi
callq 0x10e0
movq %rax, %rbx
movq $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x2f9f
movl (%rax), %edi
callq 0x39a4
movl %eax, %ebp
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x3002
cmpl $0x3, (%rax)
jne 0x3f40
movq 0x8(%rax), %r12
movq %r12, 0x8(%rbx)
movq (%r15), %rdi
movq %r12, %rsi
callq 0x3259
testb %al, %al
jne 0x3f4e
movq %r15, %rdi
movq %r12, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x2e66
movq %r14, %rdi
callq 0x2f9f
movq %r14, %rdi
callq 0x3002
cmpl $0x12, (%rax)
je 0x3f31
movq %r14, %rdi
movl $0xb, %esi
callq 0x39e5
movq %r14, %rdi
movq %r15, %rsi
callq 0x3f79
movq %rax, 0x10(%rbx)
movq %r14, %rdi
movl $0x12, %esi
callq 0x39e5
jmp 0x3f42
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21df(%rip), %rdi      # 0x6134
leaq 0x28f0(%rip), %rsi      # 0x684c
leaq 0x2a18(%rip), %rcx      # 0x697b
movl $0x242, %edx            # imm = 0x242
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_block_or_single
static block_or_single_t *parse_block_or_single(list_t *tokens, env_t *env) {
    block_or_single_t *ret = malloc(sizeof(block_or_single_t));
    if (check_next(tokens, TOK_OPEN_BRACE)) {
        debug("Parsing block\n");
        ret->type = BLOCK;
        ret->block = parse_block(tokens, env);
    } else {
        debug("Parsing single\n");
        ret->type = SINGLE;
        ret->single = parse_stmt(tokens, env);
        if (ret->single->type == STMT_DECLARE) {
            UNREACHABLE("Error: in single of block or single, statement cannot be a declare");
        }
    }
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x10, %edi
callq 0x10e0
movq %rax, %rbx
movq %r15, %rdi
callq 0x3002
testq %rax, %rax
je 0x4063
cmpl $0xc, (%rax)
jne 0x4063
movl $0x0, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e5c
movq %rax, 0x8(%rbx)
jmp 0x407d
movl $0x1, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x3a23
movq %rax, 0x8(%rbx)
cmpl $0x1, (%rax)
je 0x4086
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x20a7(%rip), %rdi      # 0x6134
leaq 0x27b8(%rip), %rsi      # 0x684c
leaq 0x289d(%rip), %rcx      # 0x6938
movl $0x25d, %edx            # imm = 0x25D
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_ternary
static expr_t *parse_ternary(list_t *tokens, env_t *env) {
    expr_t *cond = parse_logical_or(tokens, env);
    if (!check_next(tokens, TOK_QUESTION)) {
        debug("parse_ternary: no question mark found, not a ternary\n");
        return cond;
    }

    debug("parse_ternary: Found a ternary\n");
    expect_next(tokens, TOK_QUESTION);
    expr_t *then = parse_expr(tokens, env);
    debug("parse_ternary: got then\n");
    expect_next(tokens, TOK_COLON);
    expr_t *els = parse_ternary(tokens, env);
    debug("parse_ternary: got else\n");

    return new_ternary(cond, then, els);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x4362
movq %rax, %rbx
movq %r15, %rdi
callq 0x3002
testq %rax, %rax
je 0x4143
cmpl $0x1a, (%rax)
jne 0x4143
movq %r15, %rdi
callq 0x2f9f
movq %r15, %rdi
movq %r14, %rsi
callq 0x4362
movl $0xb, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4279
jmp 0x4109
movq %r15, %rdi
callq 0x3002
testq %rax, %rax
je 0x41c8
cmpl $0x27, (%rax)
jne 0x41c8
movq %r15, %rdi
movl $0x27, %esi
callq 0x39e5
movq %r15, %rdi
movq %r14, %rsi
callq 0x3f79
movq %rax, %r12
movq %r15, %rdi
movl $0x26, %esi
callq 0x39e5
movq %r15, %rdi
movq %r14, %rsi
callq 0x40f6
movl 0x4(%r12), %ebp
cmpl 0x4(%rax), %ebp
jne 0x41d4
movq %rax, %r14
movl $0x10, %edi
callq 0x10e0
movq %rax, %r15
movl $0x3, (%rax)
movl $0x18, %edi
callq 0x10e0
movq %rax, 0x8(%r15)
movq %rbx, (%rax)
movq %r12, 0x8(%rax)
movq %r14, 0x10(%rax)
movl %ebp, 0x4(%r15)
movq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f59(%rip), %rdi      # 0x6134
leaq 0x266a(%rip), %rsi      # 0x684c
leaq 0x2a04(%rip), %rcx      # 0x6bed
movl $0xaf, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: new_assign
static expr_t *new_assign(expr_t *lhs, expr_t *rhs) {
    if (lhs->c_type != rhs->c_type) {
        // TODO implicit type conversions?
        UNREACHABLE("new_assign: lhs type doesn't equal rhs type\n");
    }
    expr_t *ret = malloc(sizeof(expr_t)); 
    ret->type = ASSIGN;
    ret->assign = malloc(sizeof(assign_t));
    ret->assign->lhs = lhs;
    ret->assign->rhs = rhs;
    ret->c_type = lhs->c_type;
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x4(%rdi), %ebp
cmpl 0x4(%rsi), %ebp
jne 0x424e
movq %rsi, %rbx
movq %rdi, %r14
movl $0x10, %edi
callq 0x10e0
movq %rax, %r15
movl $0x4, (%rax)
movl $0x10, %edi
callq 0x10e0
movq %rax, 0x8(%r15)
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
movl %ebp, 0x4(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1edf(%rip), %rdi      # 0x6134
leaq 0x25f0(%rip), %rsi      # 0x684c
leaq 0x29c3(%rip), %rcx      # 0x6c26
movl $0x76, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: new_bin_expr
static expr_t *new_bin_expr(enum bin_op op, expr_t *lhs, expr_t *rhs) {
    if (!rhs || !lhs) {
        UNREACHABLE("");
    }

    if (rhs->c_type != lhs->c_type) {
        UNREACHABLE("new_bin_expr: lhs type doesn't match rhs type\n");
    }

    expr_t *expr = malloc(sizeof(bin_expr_t));
    if (!expr) {
        UNREACHABLE("");
    }

    expr->bin = malloc(sizeof(bin_expr_t));
    if (!expr->bin) {
        UNREACHABLE("");
    }
    expr->type = BIN_OP;
    expr->bin->op = op;
    expr->bin->lhs = lhs;
    expr->bin->rhs = rhs;
    expr->c_type = lhs->c_type;
    return expr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rsi, %rsi
je 0x42e3
movq %rdx, %rbx
testq %rdx, %rdx
je 0x42e3
movq %rsi, %r14
movl 0x4(%rbx), %r12d
cmpl 0x4(%rsi), %r12d
jne 0x42ff
movl %edi, %ebp
movl $0x18, %edi
callq 0x10e0
testq %rax, %rax
je 0x431b
movq %rax, %r15
movl $0x18, %edi
callq 0x10e0
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x4337
movl $0x2, (%r15)
movl %ebp, (%rax)
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
movl %r12d, 0x4(%r15)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e4a(%rip), %rdi      # 0x6134
leaq 0x255b(%rip), %rsi      # 0x684c
leaq 0x298c(%rip), %rcx      # 0x6c84
movl $0x47, %edx
jmp 0x4351
leaq 0x1e2e(%rip), %rdi      # 0x6134
leaq 0x253f(%rip), %rsi      # 0x684c
leaq 0x293f(%rip), %rcx      # 0x6c53
movl $0x4b, %edx
jmp 0x4351
leaq 0x1e12(%rip), %rdi      # 0x6134
leaq 0x2523(%rip), %rsi      # 0x684c
leaq 0x2954(%rip), %rcx      # 0x6c84
movl $0x50, %edx
jmp 0x4351
leaq 0x1df6(%rip), %rdi      # 0x6134
leaq 0x2507(%rip), %rsi      # 0x684c
leaq 0x2938(%rip), %rcx      # 0x6c84
movl $0x55, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_logical_and
static expr_t *parse_logical_and(list_t *tokens, env_t *env) {
    expr_t *ret = parse_equality(tokens, env);

    token_t *curr;
    while ((curr = list_peek(tokens))) {
        if (curr->type == TOK_AND) {
            debug("Found logical and expr\n");
            list_pop(tokens);
            ret = new_bin_expr(BIN_AND, ret, parse_equality(tokens, env));
        } else {
            break;
        }
    }
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x43b5
movq %rax, %r15
movq %r14, %rdi
callq 0x3002
testq %rax, %rax
je 0x43ac
cmpl $0x19, (%rax)
jne 0x43ac
movq %r14, %rdi
callq 0x2f9f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x43b5
movl $0xa, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4279
jmp 0x4372
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_equality
static expr_t *parse_equality(list_t *tokens, env_t *env) {
    expr_t *ret = parse_relational(tokens, env);

    token_t *curr;
    while ((curr = list_peek(tokens))) {
        if (curr->type == TOK_NE) {
            debug("Found not equal\n");
            list_pop(tokens);
            ret = new_bin_expr(BIN_NE, ret, parse_relational(tokens, env));
        } else if (curr->type == TOK_EQ) {
            debug("Found equal to\n");
            list_pop(tokens);
            ret = new_bin_expr(BIN_EQ, ret, parse_relational(tokens, env));
        } else {
            break;
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x441d
movq %rax, %r15
movq %r14, %rdi
callq 0x3002
testq %rax, %rax
je 0x440f
movl (%rax), %eax
movl $0x9, %ebp
cmpl $0x1c, %eax
je 0x43ed
cmpl $0x1b, %eax
jne 0x440f
movl $0x8, %ebp
movq %r14, %rdi
callq 0x2f9f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x441d
movl %ebp, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4279
jmp 0x43c7
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_relational
static expr_t *parse_relational(list_t *tokens, env_t *env) {
    expr_t *ret = parse_add_sub(tokens, env);

    token_t *curr;
    while ((curr = list_peek(tokens))) {
        if (curr->type == TOK_GT) {
            debug("Found gt");
            list_pop(tokens);
            ret = new_bin_expr(BIN_GT, ret, parse_add_sub(tokens, env));
        } else if (curr->type == TOK_LT) {
            debug("Found lt");
            list_pop(tokens);
            ret = new_bin_expr(BIN_LT, ret, parse_add_sub(tokens, env));
        } else if (curr->type == TOK_GTE) {
            debug("Found lte");
            list_pop(tokens);
            ret = new_bin_expr(BIN_GTE, ret, parse_add_sub(tokens, env));
        } else if (curr->type == TOK_LTE) {
            debug("Found lte");
            list_pop(tokens);
            ret = new_bin_expr(BIN_LTE, ret, parse_add_sub(tokens, env));
        } else {
            break;
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4493
movq %rax, %r15
movq %r14, %rdi
callq 0x3002
testq %rax, %rax
je 0x4487
leaq 0x23d9(%rip), %r12      # 0x6820
movl (%rax), %eax
addl $-0x1d, %eax
cmpl $0x3, %eax
ja 0x4487
movl %eax, %eax
movl (%r12,%rax,4), %ebp
movq %r14, %rdi
callq 0x2f9f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4493
movl %ebp, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4279
movq %rax, %r15
movq %r14, %rdi
callq 0x3002
testq %rax, %rax
jne 0x4447
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_add_sub
static expr_t *parse_add_sub(list_t *tokens, env_t *env) {
    expr_t *ret = parse_mul_div(tokens, env);

    while (tokens->len) {
        if (match(tokens, TOK_PLUS)) {
            debug("Found plus\n");
            ret = new_bin_expr(BIN_ADD, ret, parse_mul_div(tokens, env));
        } else if (match(tokens, TOK_MINUS)) {
            debug("Found minus\n");
            ret = new_bin_expr(BIN_SUB, ret, parse_mul_div(tokens, env));
        } else {
            break;
        }
    }
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4501
movq %rax, %r15
cmpl $0x0, 0x18(%r14)
je 0x44f8
movq %r14, %rdi
movl $0x8, %esi
callq 0x391c
movq %r14, %rdi
testb %al, %al
je 0x44cd
movq %rbx, %rsi
callq 0x4501
xorl %edi, %edi
jmp 0x44eb
movl $0x14, %esi
callq 0x391c
testb %al, %al
je 0x44f8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4501
movl $0x1, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4279
jmp 0x44a3
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: parse_mul_div
static expr_t *parse_mul_div(list_t *tokens, env_t *env) {
    expr_t *ret = parse_unary(tokens, env);

    while (tokens->len) {
        if (match(tokens, TOK_MULT)) {
            debug("Found mult\n");
            ret = new_bin_expr(BIN_MUL, ret, parse_unary(tokens, env));
        } else if (match(tokens, TOK_DIV)) {
            debug("Found div\n");
            ret = new_bin_expr(BIN_DIV, ret, parse_unary(tokens, env));
        } else if (match(tokens, TOK_MODULO)){
            debug("Found modulo\n");
            ret = new_bin_expr(BIN_MODULO, ret, parse_mul_div(tokens, env));
        } else {
            break;
        }
    }
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4592
movq %rax, %r15
cmpl $0x0, 0x18(%r14)
je 0x4589
movq %r14, %rdi
movl $0x9, %esi
callq 0x391c
movq %r14, %rdi
testb %al, %al
je 0x453e
movq %rbx, %rsi
callq 0x4592
movl $0x2, %edi
jmp 0x457c
movl $0xa, %esi
callq 0x391c
movq %r14, %rdi
testb %al, %al
je 0x455e
movq %rbx, %rsi
callq 0x4592
movl $0x3, %edi
jmp 0x457c
movl $0x21, %esi
callq 0x391c
testb %al, %al
je 0x4589
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4501
movl $0xc, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4279
jmp 0x4511
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/parse.c
// Function: new_unary_expr
static expr_t *new_unary_expr(enum unary_op op, expr_t *inner) {
    if (!inner) {
        UNREACHABLE("");
    }

    expr_t *expr = malloc(sizeof(unary_expr_t));
    if (!expr) {
        UNREACHABLE("");
    }
    expr->unary = malloc(sizeof(unary_expr_t));
    if (!expr->unary) {
        UNREACHABLE("");
    }
    expr->type = UNARY_OP;
    expr->unary->op = op;
    expr->unary->expr = inner;
    expr->c_type = inner->c_type;
    return expr;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x4c3b
movq %rsi, %rbx
movl %edi, %ebp
movl $0x10, %edi
callq 0x10e0
testq %rax, %rax
je 0x4c57
movq %rax, %r14
movl $0x10, %edi
callq 0x10e0
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x4c73
movl $0x1, (%r14)
movl %ebp, (%rax)
movq %rbx, 0x8(%rax)
movl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x14f2(%rip), %rdi      # 0x6134
leaq 0x1c03(%rip), %rsi      # 0x684c
leaq 0x2034(%rip), %rcx      # 0x6c84
movl $0x61, %edx
jmp 0x4c8d
leaq 0x14d6(%rip), %rdi      # 0x6134
leaq 0x1be7(%rip), %rsi      # 0x684c
leaq 0x2018(%rip), %rcx      # 0x6c84
movl $0x66, %edx
jmp 0x4c8d
leaq 0x14ba(%rip), %rdi      # 0x6134
leaq 0x1bcb(%rip), %rsi      # 0x684c
leaq 0x1ffc(%rip), %rcx      # 0x6c84
movl $0x6a, %edx
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
nop
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/string.c
// Function: file_to_string
string_t *file_to_string(char *filename) {
    FILE *fp = fopen(filename, "r");
    if (!fp)
        return NULL;
    char buf[1024];
    string_t *new = string_new(); 
    while (1) {
        int nread = fread(buf, 1, sizeof(buf), fp);
        if (nread == 0)
            break;
        string_append(new, buf, nread);
    }

    string_append(new, "\n\n", 2);
    return new;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
leaq 0x2053(%rip), %rsi      # 0x6d0a
callq 0x1100
testq %rax, %rax
je 0x4d5f
movq %rax, %r14
callq 0x4d75
movq %rax, %rbx
movq %rsp, %rdi
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rcx
callq 0x1060
testl %eax, %eax
je 0x4d34
movq %rsp, %r15
movb (%rsp), %cl
testb %cl, %cl
je 0x4d1b
movl %eax, %r12d
movl $0x1, %r13d
movsbl %cl, %esi
movq %rbx, %rdi
callq 0x4e43
movb (%rsp,%r13), %cl
testb %cl, %cl
je 0x4d1b
leaq 0x1(%r13), %rax
cmpl %r13d, %r12d
movq %rax, %r13
jne 0x4cfc
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %r14, %rcx
callq 0x1060
testl %eax, %eax
jne 0x4cec
movb $0xa, %al
xorl %r15d, %r15d
leaq 0x1f42(%rip), %r14      # 0x6c82
leaq 0x1(%r15), %r12
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4e43
movb 0x1(%r15,%r14), %al
movq %r12, %r15
cmpq $0x2, %r12
jne 0x4d40
jmp 0x4d61
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/string.c
// Function: string_new
string_t *string_new(void) {
    string_t *new = malloc(sizeof(string_t));
    if (string_init(new) < 0)
        return NULL;
    return new;
}

// Assembly:
pushq %rbx
movl $0x10, %edi
callq 0x10e0
testq %rax, %rax
je 0x4daa
movq %rax, %rbx
movl $0x8, %edi
callq 0x10e0
movq %rax, (%rbx)
testq %rax, %rax
je 0x4daa
movabsq $0x800000000, %rax      # imm = 0x800000000
movq %rax, 0x8(%rbx)
jmp 0x4dac
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/string.c
// Function: string_init
int string_init(string_t *string) {
    if (!string)
        return -1;
    string->buf = malloc(sizeof(char) * STRING_DEFAULT_CAPACITY);
    if (!string->buf)
        return -1;
    string->len = 0;
    string->capacity = STRING_DEFAULT_CAPACITY;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x4e39
movq %rdi, %r14
movl $0x8, %edi
callq 0x10e0
movq %rax, (%r14)
testq %rax, %rax
je 0x4e39
movabsq $0x800000000, %rax      # imm = 0x800000000
movq %rax, 0x8(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/johnvtan[P]ccccc/string.c
// Function: string_free
void string_free(string_t *string) {
    if (!string)
        return;
    if (string->buf)
        free(string->buf);
    free(string);
}

// Assembly:
testq %rdi, %rdi
je 0x4ec1
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x4eb8
callq 0x1030
movq %rbx, %rdi
popq %rbx
jmp 0x1030
retq