LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x47d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x582e
movq -0x18(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
je 0x585f
jmp 0x5830
jmp 0x5832
jmp 0x5834
leaq 0x37c9(%rip), %rdi      # 0x9004
leaq 0x3f9f(%rip), %rsi      # 0x97e1
movl $0x20, %edx
leaq 0x4072(%rip), %rcx      # 0x98c0
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_param
static string_t *parse_param(list_t *tokens, env_t *env) {
    token_t *type_token = list_pop(tokens);
    token_t *curr = expect_next(tokens, TOK_IDENT);

    // The parameter should automatically be declared when it's a parameter.
    env_add(env, curr->ident, token_to_builtin_type(type_token->type), true);
    return curr->ident;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x47d0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x5800
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x5790
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl %eax, %edx
movl $0x1, %ecx
callq 0x4590
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4430
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x56f0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_return_stmt
static return_stmt_t *parse_return_stmt(list_t *tokens, env_t *env) {
    debug("parse_return_stmt: parsing return stmt\n");
    return_stmt_t *ret = malloc(sizeof(return_stmt_t));
    expect_next(tokens, TOK_RETURN);
    ret->expr = parse_expr(tokens, env);
    expect_next(tokens, TOK_SEMICOLON);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
jmp 0x5c62
movl $0x8, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x5800
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0x12, %esi
callq 0x5800
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_if_stmt
static if_stmt_t *parse_if_stmt(list_t *tokens, env_t *env) {
    expect_next(tokens, TOK_IF);
    debug("parse_if_stmt: found if\n");
    if_stmt_t *ret = malloc(sizeof(if_stmt_t));
    expect_next(tokens, TOK_OPEN_PAREN);
    ret->cond = parse_expr(tokens, env);
    debug("parse_if_stmt: got cond\n");
    expect_next(tokens, TOK_CLOSE_PAREN);

    ret->then = malloc(sizeof(block_or_single_t));
    ret->then = parse_block_or_single(tokens, env);
    ret->els = NULL;
    if (check_next(tokens, TOK_ELSE)) {
        debug("parse_if_stmt: found else\n");
        list_pop(tokens);
        ret->els = parse_block_or_single(tokens, env);
    }
    debug("parse_if_stmt: done\n");
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x24, %esi
callq 0x5800
jmp 0x5cd0
movl $0x18, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0xe, %esi
callq 0x5800
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x5d05
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x5800
movl $0x10, %edi
callq 0x10e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x61b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rdi
movl $0x25, %esi
callq 0x6280
testb $0x1, %al
jne 0x5d60
jmp 0x5d85
jmp 0x5d62
jmp 0x5d64
movq -0x8(%rbp), %rdi
callq 0x47d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x61b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x5d87
jmp 0x5d89
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_for_stmt
static for_stmt_t *parse_for_stmt(list_t *tokens, env_t *env) {
    expect_next(tokens, TOK_FOR);
    debug("parse_for_stmt: found for\n");

    for_stmt_t *ret = malloc(sizeof(for_stmt_t));
    ret->env = env_new(env);
    expect_next(tokens, TOK_OPEN_PAREN);
    ret->init = parse_for_init_clause(tokens, ret->env);

    debug("for: got init\n");
    ret->cond = parse_optional_expr(tokens, ret->env, TOK_SEMICOLON);
    // For loops with no cond should run forever - replace the cond with a nonzero int.
    if (ret->cond->type == NULL_EXPR) {
        ret->cond = new_primary_int(1);
    }
    expect_next(tokens, TOK_SEMICOLON);
    debug("for: got cond\n");
    ret->post = parse_optional_expr(tokens, ret->env, TOK_CLOSE_PAREN);
    expect_next(tokens, TOK_CLOSE_PAREN);
    debug("for: got post\n");
    ret->body = parse_block_or_single(tokens, ret->env);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x28, %esi
callq 0x5800
jmp 0x5dc0
movl $0x28, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4430
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movl $0xe, %esi
callq 0x5800
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x62d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x5e0d
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0x12, %edx
callq 0x6370
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x5, (%rax)
jne 0x5e50
movl $0x1, %edi
callq 0x63c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movl $0x12, %esi
callq 0x5800
jmp 0x5e60
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0xf, %edx
callq 0x6370
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x5800
jmp 0x5e91
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x61b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_while_stmt
static while_stmt_t *parse_while_stmt(list_t *tokens, env_t *env) {
    expect_next(tokens, TOK_WHILE);
    debug("parse_while_stmt: found while\n");
    while_stmt_t *ret = malloc(sizeof(while_stmt_t));
    expect_next(tokens, TOK_OPEN_PAREN);
    ret->cond = parse_expr(tokens, env);
    debug("parse_while_stmt: got cond\n");
    expect_next(tokens, TOK_CLOSE_PAREN);
    ret->body = parse_block_or_single(tokens, env);
    debug("parse_while_stmt: got body\n");
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x29, %esi
callq 0x5800
jmp 0x5ee0
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0xe, %esi
callq 0x5800
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x5f15
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x5800
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x61b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x5f3d
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_do_stmt
static do_stmt_t *parse_do_stmt(list_t *tokens, env_t *env) {
    expect_next(tokens, TOK_DO);
    debug("parse_do_stmt: do found\n");
    do_stmt_t *ret = malloc(sizeof(do_stmt_t));
    ret->body = parse_block_or_single(tokens, env);
    debug("parse_do_stmt: got body\n");

    expect_next(tokens, TOK_WHILE);
    expect_next(tokens, TOK_OPEN_PAREN);
    ret->cond = parse_expr(tokens, env);
    debug("parse_do_stmt: got cond\n");
    expect_next(tokens, TOK_CLOSE_PAREN);
    expect_next(tokens, TOK_SEMICOLON);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2a, %esi
callq 0x5800
jmp 0x5f70
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x61b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x5f98
movq -0x8(%rbp), %rdi
movl $0x29, %esi
callq 0x5800
movq -0x8(%rbp), %rdi
movl $0xe, %esi
callq 0x5800
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x5fcd
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x5800
movq -0x8(%rbp), %rdi
movl $0x12, %esi
callq 0x5800
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: is_type
static bool is_type(token_type_t type) {
    switch (type) {
        case TOK_INT_TYPE:
        case TOK_CHAR_TYPE:
            return true;
        default:
            return false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
addl $-0x5, %eax
subl $0x1, %eax
ja 0x601a
jmp 0x6014
movb $0x1, -0x1(%rbp)
jmp 0x601e
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x18, %edi
callq 0x10e0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x47d0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %edi
callq 0x5790
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x48b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x3, (%rax)
je 0x60a1
jmp 0x6092
jmp 0x6094
movq $0x0, -0x8(%rbp)
jmp 0x6174
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x60b3
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x4d40
testb $0x1, %al
jne 0x60cd
jmp 0x60fa
jmp 0x60cf
leaq 0x2f2e(%rip), %rdi      # 0x9004
leaq 0x3704(%rip), %rsi      # 0x97e1
movl $0x242, %edx            # imm = 0x242
leaq 0x3827(%rip), %rcx      # 0x9910
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rax
movl (%rax), %edx
xorl %ecx, %ecx
callq 0x4590
movq -0x10(%rbp), %rdi
callq 0x47d0
movq -0x10(%rbp), %rdi
callq 0x48b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x12, (%rax)
je 0x615c
jmp 0x6134
jmp 0x6136
movq -0x10(%rbp), %rdi
movl $0xb, %esi
callq 0x5800
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6180
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movl $0x12, %esi
callq 0x5800
jmp 0x616c
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0xc, %esi
callq 0x6280
testb $0x1, %al
jne 0x61e2
jmp 0x620a
jmp 0x61e4
jmp 0x61e6
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5bf0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x626c
jmp 0x620c
jmp 0x620e
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x58e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, (%rax)
jne 0x626a
jmp 0x623f
leaq 0x2dbe(%rip), %rdi      # 0x9004
leaq 0x3594(%rip), %rsi      # 0x97e1
movl $0x25d, %edx            # imm = 0x25D
leaq 0x3674(%rip), %rcx      # 0x98cd
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
jmp 0x626c
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: check_next
static bool check_next(list_t *tokens, token_type_t expectation) {
    token_t *next = list_peek(tokens);
    if (!next || next->type != expectation) {
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x48b0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x62ae
movq -0x20(%rbp), %rax
movl (%rax), %eax
cmpl -0x14(%rbp), %eax
je 0x62b4
movb $0x0, -0x1(%rbp)
jmp 0x62b8
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_for_init_clause
static stmt_t *parse_for_init_clause(list_t *tokens, env_t *env) {
    token_t *curr_token = list_peek(tokens);
    if (is_type(curr_token->type))
        return parse_stmt(tokens, env);

    stmt_t *ret = malloc(sizeof(stmt_t));
    ret->type = STMT_EXPR; 
    ret->expr = parse_optional_expr(tokens, env, TOK_SEMICOLON);
    expect_next(tokens, TOK_SEMICOLON);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x48b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x6000
testb $0x1, %al
jne 0x62fe
jmp 0x6311
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x58e0
movq %rax, -0x8(%rbp)
jmp 0x635c
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl $0x4, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x12, %edx
callq 0x6370
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movl $0x12, %esi
callq 0x5800
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: new_primary_int
static expr_t *new_primary_int(int val) {
    expr_t *expr = malloc(sizeof(expr_t));
    expr->type = PRIMARY;
    expr->primary = malloc(sizeof(primary_t));
    expr->primary->type = PRIMARY_INT;
    expr->primary->integer = val;
    expr->c_type = TYPE_INT;
    return expr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movl $0x10, %edi
callq 0x10e0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x0, (%rax)
movl -0x4(%rbp), %ecx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: new_null_expr
static expr_t *new_null_expr(void) {
    debug("new_null_expr called\n");
    expr_t *expr = malloc(sizeof(expr_t));
    expr->type = NULL_EXPR;
    expr->c_type = TYPE_VOID;
    return expr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
jmp 0x643a
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x5, (%rax)
movq -0x8(%rbp), %rax
movl $0x3, 0x4(%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_assign
static expr_t *parse_assign(list_t *tokens, env_t *env) {
    expr_t *maybe_lhs = parse_ternary(tokens, env);
    if (!is_valid_lhs(maybe_lhs)) {
        debug("parse_assign: Not a valid lhs so returning\n");
        return maybe_lhs;
    }

    // here we might have an assignment statement
    // we have a valid lhs at least
    debug("parse_assign: Maybe an assign\n");
    token_t *next = list_peek(tokens);
    if (next->type == TOK_ASSIGN) {
        // ok cool we got an assignment statement
        debug("parse_assign: got an assignment statement\n");
        list_pop(tokens);
        expr_t *rhs = parse_expr(tokens, env);
        return new_assign(maybe_lhs, rhs);
    }

    if (next->type == TOK_PLUS_EQ) {
        debug("parse_assign: Got plus equals assignment statement\n");
        list_pop(tokens);

        // plus equals means that lhs = lhs + remaining expr 
        expr_t *rhs = new_bin_expr(BIN_ADD, maybe_lhs, parse_expr(tokens, env));
        return new_assign(maybe_lhs, rhs);
    }

    if (next->type == TOK_MINUS_EQ) {
        debug("parse_assign: Got minus equals assignment statement\n");
        list_pop(tokens);
        expr_t *rhs = new_bin_expr(BIN_SUB, maybe_lhs, parse_expr(tokens, env));
        return new_assign(maybe_lhs, rhs);
    }

    debug("parse_assign: Didn't actually get an assignment :(\n");
    return maybe_lhs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x65c0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x6670
testb $0x1, %al
jne 0x64af
jmp 0x64a0
jmp 0x64a2
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x65ac
jmp 0x64b1
jmp 0x64b3
movq -0x10(%rbp), %rdi
callq 0x48b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0xb, (%rax)
jne 0x64fd
jmp 0x64cb
jmp 0x64cd
movq -0x10(%rbp), %rdi
callq 0x47d0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6180
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x66b0
movq %rax, -0x8(%rbp)
jmp 0x65ac
movq -0x28(%rbp), %rax
cmpl $0x22, (%rax)
jne 0x654d
jmp 0x6508
jmp 0x650a
movq -0x10(%rbp), %rdi
callq 0x47d0
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6180
movq -0x48(%rbp), %rsi
movq %rax, %rdx
xorl %edi, %edi
callq 0x6770
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x66b0
movq %rax, -0x8(%rbp)
jmp 0x65ac
movq -0x28(%rbp), %rax
cmpl $0x23, (%rax)
jne 0x65a0
jmp 0x6558
jmp 0x655a
movq -0x10(%rbp), %rdi
callq 0x47d0
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6180
movq -0x50(%rbp), %rsi
movq %rax, %rdx
movl $0x1, %edi
callq 0x6770
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x66b0
movq %rax, -0x8(%rbp)
jmp 0x65ac
jmp 0x65a2
jmp 0x65a4
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x68e0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl $0x27, %esi
callq 0x6280
testb $0x1, %al
jne 0x6601
jmp 0x65f5
jmp 0x65f7
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x665c
jmp 0x6603
jmp 0x6605
movq -0x10(%rbp), %rdi
movl $0x27, %esi
callq 0x5800
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6180
movq %rax, -0x28(%rbp)
jmp 0x6626
movq -0x10(%rbp), %rdi
movl $0x26, %esi
callq 0x5800
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x65c0
movq %rax, -0x30(%rbp)
jmp 0x6647
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x6970
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x66fd
jmp 0x66d2
leaq 0x292b(%rip), %rdi      # 0x9004
leaq 0x3101(%rip), %rsi      # 0x97e1
movl $0x76, %edx
leaq 0x34cf(%rip), %rcx      # 0x9bbb
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x4, (%rax)
movl $0x10, %edi
callq 0x10e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x6791
cmpq $0x0, -0x10(%rbp)
jne 0x67be
jmp 0x6793
leaq 0x286a(%rip), %rdi      # 0x9004
leaq 0x3040(%rip), %rsi      # 0x97e1
movl $0x47, %edx
leaq 0x346c(%rip), %rcx      # 0x9c19
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x67fb
jmp 0x67d0
leaq 0x282d(%rip), %rdi      # 0x9004
leaq 0x3003(%rip), %rsi      # 0x97e1
movl $0x4b, %edx
leaq 0x33fe(%rip), %rcx      # 0x9be8
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movl $0x18, %edi
callq 0x10e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x683d
jmp 0x6812
leaq 0x27eb(%rip), %rdi      # 0x9004
leaq 0x2fc1(%rip), %rsi      # 0x97e1
movl $0x50, %edx
leaq 0x33ed(%rip), %rcx      # 0x9c19
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movl $0x18, %edi
callq 0x10e0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x688a
jmp 0x685f
leaq 0x279e(%rip), %rdi      # 0x9004
leaq 0x2f74(%rip), %rsi      # 0x97e1
movl $0x55, %edx
leaq 0x33a0(%rip), %rcx      # 0x9c19
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movq -0x20(%rbp), %rax
movl $0x2, (%rax)
movl -0x4(%rbp), %ecx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_logical_or
static expr_t *parse_logical_or(list_t *tokens, env_t *env) {
    expr_t *ret = parse_logical_and(tokens, env);

    token_t *curr;
    while ((curr = list_peek(tokens))) {
        if (curr->type == TOK_OR) {
            debug("Found logical or expr\n");
            list_pop(tokens);
            ret = new_bin_expr(BIN_OR, ret, parse_logical_and(tokens, env));
        } else {
            break;
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6a40
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x48b0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x695a
movq -0x20(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x6956
jmp 0x691f
jmp 0x6921
movq -0x8(%rbp), %rdi
callq 0x47d0
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6a40
movq -0x28(%rbp), %rsi
movq %rax, %rdx
movl $0xb, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6958
jmp 0x695a
jmp 0x6901
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: new_ternary
static expr_t *new_ternary(expr_t *cond, expr_t *then, expr_t *els) {
    if (then->c_type != els->c_type) {
        UNREACHABLE("new_ternary: then clause doesn't match else clause type\n");
    }
    expr_t *expr = malloc(sizeof(expr_t));
    expr->type = TERNARY;
    expr->ternary = malloc(sizeof(ternary_t));
    expr->ternary->cond = cond;
    expr->ternary->then = then;
    expr->ternary->els = els;
    expr->c_type = then->c_type;
    return expr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x69c1
jmp 0x6996
leaq 0x2667(%rip), %rdi      # 0x9004
leaq 0x2e3d(%rip), %rsi      # 0x97e1
movl $0xaf, %edx
leaq 0x31d2(%rip), %rcx      # 0x9b82
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl $0x3, (%rax)
movl $0x18, %edi
callq 0x10e0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6ad0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x48b0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x6aba
movq -0x20(%rbp), %rax
cmpl $0x19, (%rax)
jne 0x6ab6
jmp 0x6a7f
jmp 0x6a81
movq -0x8(%rbp), %rdi
callq 0x47d0
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6ad0
movq -0x28(%rbp), %rsi
movq %rax, %rdx
movl $0xa, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6ab8
jmp 0x6aba
jmp 0x6a61
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6ba0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x48b0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x6b95
movq -0x20(%rbp), %rax
cmpl $0x1c, (%rax)
jne 0x6b4a
jmp 0x6b13
jmp 0x6b15
movq -0x8(%rbp), %rdi
callq 0x47d0
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6ba0
movq -0x28(%rbp), %rsi
movq %rax, %rdx
movl $0x9, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6b90
movq -0x20(%rbp), %rax
cmpl $0x1b, (%rax)
jne 0x6b8c
jmp 0x6b55
jmp 0x6b57
movq -0x8(%rbp), %rdi
callq 0x47d0
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6ba0
movq -0x30(%rbp), %rsi
movq %rax, %rdx
movl $0x8, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6b8e
jmp 0x6b95
jmp 0x6b90
jmp 0x6af1
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6d00
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x48b0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x6cf3
movq -0x20(%rbp), %rax
cmpl $0x1f, (%rax)
jne 0x6c1d
jmp 0x6be3
jmp 0x6be5
movq -0x8(%rbp), %rdi
callq 0x47d0
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6d00
movq -0x28(%rbp), %rsi
movq %rax, %rdx
movl $0x5, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6cee
movq -0x20(%rbp), %rax
cmpl $0x1d, (%rax)
jne 0x6c62
jmp 0x6c28
jmp 0x6c2a
movq -0x8(%rbp), %rdi
callq 0x47d0
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6d00
movq -0x30(%rbp), %rsi
movq %rax, %rdx
movl $0x4, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6cec
movq -0x20(%rbp), %rax
cmpl $0x20, (%rax)
jne 0x6ca4
jmp 0x6c6d
jmp 0x6c6f
movq -0x8(%rbp), %rdi
callq 0x47d0
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6d00
movq -0x38(%rbp), %rsi
movq %rax, %rdx
movl $0x7, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6cea
movq -0x20(%rbp), %rax
cmpl $0x1e, (%rax)
jne 0x6ce6
jmp 0x6caf
jmp 0x6cb1
movq -0x8(%rbp), %rdi
callq 0x47d0
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6d00
movq -0x40(%rbp), %rsi
movq %rax, %rdx
movl $0x6, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6ce8
jmp 0x6cf3
jmp 0x6cea
jmp 0x6cec
jmp 0x6cee
jmp 0x6bc1
movq -0x18(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6dd0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x6dbd
movq -0x8(%rbp), %rdi
movl $0x8, %esi
callq 0x56a0
testb $0x1, %al
jne 0x6d43
jmp 0x6d70
jmp 0x6d45
jmp 0x6d47
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6dd0
movq -0x20(%rbp), %rsi
movq %rax, %rdx
xorl %edi, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6db8
movq -0x8(%rbp), %rdi
movl $0x14, %esi
callq 0x56a0
testb $0x1, %al
jne 0x6d84
jmp 0x6db4
jmp 0x6d86
jmp 0x6d88
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6dd0
movq -0x28(%rbp), %rsi
movq %rax, %rdx
movl $0x1, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6db6
jmp 0x6dbd
jmp 0x6db8
jmp 0x6d21
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6ef0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x6ed9
movq -0x8(%rbp), %rdi
movl $0x9, %esi
callq 0x56a0
testb $0x1, %al
jne 0x6e13
jmp 0x6e46
jmp 0x6e15
jmp 0x6e17
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6ef0
movq -0x20(%rbp), %rsi
movq %rax, %rdx
movl $0x2, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6ed4
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x56a0
testb $0x1, %al
jne 0x6e5a
jmp 0x6e8a
jmp 0x6e5c
jmp 0x6e5e
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6ef0
movq -0x28(%rbp), %rsi
movq %rax, %rdx
movl $0x3, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6ed2
movq -0x8(%rbp), %rdi
movl $0x21, %esi
callq 0x56a0
testb $0x1, %al
jne 0x6e9e
jmp 0x6ece
jmp 0x6ea0
jmp 0x6ea2
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6dd0
movq -0x30(%rbp), %rsi
movq %rax, %rdx
movl $0xc, %edi
callq 0x6770
movq %rax, -0x18(%rbp)
jmp 0x6ed0
jmp 0x6ed9
jmp 0x6ed2
jmp 0x6ed4
jmp 0x6df1
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x7193
jmp 0x7168
leaq 0x1e95(%rip), %rdi      # 0x9004
leaq 0x266b(%rip), %rsi      # 0x97e1
movl $0x61, %edx
leaq 0x2a97(%rip), %rcx      # 0x9c19
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x71d5
jmp 0x71aa
leaq 0x1e53(%rip), %rdi      # 0x9004
leaq 0x2629(%rip), %rsi      # 0x97e1
movl $0x66, %edx
leaq 0x2a55(%rip), %rcx      # 0x9c19
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movl $0x10, %edi
callq 0x10e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x7222
jmp 0x71f7
leaq 0x1e06(%rip), %rdi      # 0x9004
leaq 0x25dc(%rip), %rsi      # 0x97e1
movl $0x6a, %edx
leaq 0x2a08(%rip), %rcx      # 0x9c19
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movl -0x4(%rbp), %ecx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: parse_postfix
static expr_t *parse_postfix(list_t *tokens, env_t *env) {
    if (!tokens || !tokens->len) {
        UNREACHABLE("wtf you doin\n");
    }

    expr_t *primary_expr = parse_primary(tokens, env);
    if (!tokens->len) {
        UNREACHABLE("compile error? should at least be a semicolon here\n");
    }

    if (match(tokens, TOK_INCREMENT)) {
        debug("Found postinc\n");
        if (!is_valid_lhs(primary_expr)) {
            UNREACHABLE("compile error: trying to postinc invalid lhs\n");
        }
        return new_unary_expr(UNARY_POSTINC, primary_expr);
    }

    if (match(tokens, TOK_DECREMENT)) {
        debug("Found postdec\n");
        if (!is_valid_lhs(primary_expr)) {
            UNREACHABLE("compile error: trying to postdec invalid lhs\n");
        }
        return new_unary_expr(UNARY_POSTDEC, primary_expr);
    }

    return primary_expr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7291
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x72be
jmp 0x7293
leaq 0x1d6a(%rip), %rdi      # 0x9004
leaq 0x2540(%rip), %rsi      # 0x97e1
movl $0x128, %edx            # imm = 0x128
leaq 0x2690(%rip), %rcx      # 0x993d
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x73f0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x7306
jmp 0x72db
leaq 0x1d22(%rip), %rdi      # 0x9004
leaq 0x24f8(%rip), %rsi      # 0x97e1
movl $0x12d, %edx            # imm = 0x12D
leaq 0x26c2(%rip), %rcx      # 0x99b7
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movq -0x10(%rbp), %rdi
movl $0x17, %esi
callq 0x56a0
testb $0x1, %al
jne 0x731a
jmp 0x736c
jmp 0x731c
jmp 0x731e
movq -0x20(%rbp), %rdi
callq 0x6670
testb $0x1, %al
jne 0x7358
jmp 0x732d
leaq 0x1cd0(%rip), %rdi      # 0x9004
leaq 0x24a6(%rip), %rsi      # 0x97e1
movl $0x133, %edx            # imm = 0x133
leaq 0x26a4(%rip), %rcx      # 0x99eb
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movq -0x20(%rbp), %rsi
movl $0x3, %edi
callq 0x7150
movq %rax, -0x8(%rbp)
jmp 0x73da
movq -0x10(%rbp), %rdi
movl $0x18, %esi
callq 0x56a0
testb $0x1, %al
jne 0x7380
jmp 0x73d2
jmp 0x7382
jmp 0x7384
movq -0x20(%rbp), %rdi
callq 0x6670
testb $0x1, %al
jne 0x73be
jmp 0x7393
leaq 0x1c6a(%rip), %rdi      # 0x9004
leaq 0x2440(%rip), %rsi      # 0x97e1
movl $0x13b, %edx            # imm = 0x13B
leaq 0x266c(%rip), %rcx      # 0x9a19
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movq -0x20(%rbp), %rsi
movl $0x4, %edi
callq 0x7150
movq %rax, -0x8(%rbp)
jmp 0x73da
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: new_primary_var
static expr_t *new_primary_var(string_t *var, builtin_type_t type) {
    if (!var) {
        UNREACHABLE("new_primary_var: invalid var\n");
    }
    expr_t *expr = malloc(sizeof(expr_t));
    expr->type = PRIMARY;
    expr->primary = malloc(sizeof(primary_t));
    expr->primary->type = PRIMARY_VAR;
    expr->primary->var = var;
    expr->c_type = type;
    return expr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x7623
jmp 0x75f8
leaq 0x1a05(%rip), %rdi      # 0x9004
leaq 0x21db(%rip), %rsi      # 0x97e1
movl $0x98, %edx
leaq 0x2474(%rip), %rcx      # 0x9a86
movb $0x0, %al
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl $0x10, %edi
callq 0x10e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x2, (%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: new_primary_expr
static expr_t *new_primary_expr(expr_t *e) {
    expr_t *expr = malloc(sizeof(expr_t));
    expr->type = PRIMARY;
    expr->primary = malloc(sizeof(primary_t));
    expr->primary->type = PRIMARY_EXPR;
    expr->primary->expr = e;
    expr->c_type = e->c_type;
    return expr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movl $0x10, %edi
callq 0x10e0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x3, (%rax)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x2340(%rip), %rsi      # 0x9cda
callq 0x1100
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x79b4
movq $0x0, -0x8(%rbp)
jmp 0x7a29
callq 0x7a40
movq %rax, -0x428(%rbp)
leaq -0x420(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x1050
movl %eax, -0x42c(%rbp)
cmpl $0x0, -0x42c(%rbp)
jne 0x79eb
jmp 0x7a06
movq -0x428(%rbp), %rdi
leaq -0x420(%rbp), %rsi
movl -0x42c(%rbp), %edx
callq 0x7a80
jmp 0x79c0
movq -0x428(%rbp), %rdi
leaq 0x2203(%rip), %rsi      # 0x9c17
movl $0x2, %edx
callq 0x7a80
movq -0x428(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x10, %edi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7af0
cmpl $0x0, %eax
jge 0x7a6e
movq $0x0, -0x8(%rbp)
jmp 0x7a76
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq