LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/default_scope_initialize.c
// Function: print
ast_node* _print(ss_vector* args) {
    for (int i = 0; i < args->size; i++) {
        ast_node* node = (ast_node*)args->items[i];

        if (node->type == AST_TYPE_INTEGER) {
            ast_node_integer* node_integer = (ast_node_integer*) node;
            printf("%d\n", node_integer->value);
        } else if (node->type == AST_TYPE_FLOAT) {
            ast_node_float* node_float = (ast_node_float*) node;
            printf("%f\n", node_float->value);
        } else if (node->type == AST_TYPE_CHAR) {
            ast_node_char* node_char = (ast_node_char*) node;
            printf("%c\n", node_char->value);
        } else if (node->type == AST_TYPE_STRING) {
            ast_node_string* node_string = (ast_node_string*) node;
            printf("%s\n", node_string->value);
        } else {
            printf("<%d>\n", (int)node->type);
        }
    }

    return (ast_node*) init_ast_node_empty((void*)0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1cfd
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x1c53
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x20(%rax), %esi
leaq 0x53db(%rip), %rdi      # 0x7022
movb $0x0, %al
callq 0x1080
jmp 0x1ced
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x1c81
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movss 0x20(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x53ae(%rip), %rdi      # 0x7026
movb $0x1, %al
callq 0x1080
jmp 0x1ceb
movq -0x18(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x1caa
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsbl 0x20(%rax), %esi
leaq 0x5389(%rip), %rdi      # 0x702a
movb $0x0, %al
callq 0x1080
jmp 0x1ce9
movq -0x18(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x1cd3
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0x5530(%rip), %rdi      # 0x71fa
movb $0x0, %al
callq 0x1080
jmp 0x1ce7
movq -0x18(%rbp), %rax
movl (%rax), %esi
leaq 0x534e(%rip), %rdi      # 0x702e
movb $0x0, %al
callq 0x1080
jmp 0x1ce9
jmp 0x1ceb
jmp 0x1ced
jmp 0x1cef
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1c03
xorl %eax, %eax
movl %eax, %edi
callq 0x1560
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/default_scope_initialize.c
// Function: strlen
ast_node* _strlen(ss_vector* args) {
    ast_node* _node = (ast_node*)args->items[0];

    if (_node->type != AST_TYPE_STRING)
        return (ast_node*) init_ast_node_empty((void*)0); 

    ast_node_string* node_string = (ast_node_string*) _node;

    int length = strlen(node_string->value);

    return (ast_node*) init_ast_node_integer(
        init_token(_INTEGER, ""),
        length
    );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x5, (%rax)
je 0x1d43
xorl %eax, %eax
movl %eax, %edi
callq 0x1560
movq %rax, -0x8(%rbp)
jmp 0x1d7b
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x1070
movl %eax, -0x24(%rbp)
movl $0x2, %edi
leaq 0x54ba(%rip), %rsi      # 0x7221
callq 0x61f0
movq %rax, %rdi
movl -0x24(%rbp), %esi
callq 0x17a0
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/sebbekarlsson[P]cola/src/default_scope_initialize.c
// Function: strsplit
ast_node* _strsplit(ss_vector* args) {
    ast_node* _node0 = (ast_node*)args->items[0];
    ast_node* _node1 = (ast_node*)args->items[1];

    if (_node0->type != AST_TYPE_STRING)
        return (ast_node*) init_ast_node_empty((void*)0);

    if (_node1->type != AST_TYPE_STRING)
        return (ast_node*) init_ast_node_empty((void*)0);


    ast_node_string* node_string0 = (ast_node_string*) _node0;
    ast_node_string* node_string1 = (ast_node_string*) _node1;

    ss_vector* items = ss_init_vector(sizeof(ast_node));

    char* token;
    token = strtok(node_string0->value, node_string1->value);

    ast_node_string* item_str = init_ast_node_string(
        (void*)0,
        token
    );
    ss_vector_append(items, (ast_node*) item_str);

    while (token != NULL) {
        token = strtok(NULL, node_string1->value);

        if (!token)
            continue;

        ast_node_string* item_str = init_ast_node_string(
            (void*)0,
            token
        );
        ss_vector_append(items, (ast_node*) item_str);
    }

    return (ast_node*) init_ast_node_vector(
        (void*)0,
        _DATA_TYPE_VECTOR,
        items        
    );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x5, (%rax)
je 0x1dd6
xorl %eax, %eax
movl %eax, %edi
callq 0x1560
movq %rax, -0x8(%rbp)
jmp 0x1ea1
movq -0x20(%rbp), %rax
cmpl $0x5, (%rax)
je 0x1df1
xorl %eax, %eax
movl %eax, %edi
callq 0x1560
movq %rax, -0x8(%rbp)
jmp 0x1ea1
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x18, %edi
callq 0x6010
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x1100
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x18a0
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x6060
cmpq $0x0, -0x40(%rbp)
je 0x1e8b
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x1100
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1e6b
jmp 0x1e46
movq -0x40(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x18a0
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x6060
jmp 0x1e46
movq -0x38(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
movl $0x2e, %esi
callq 0x1a50
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/default_scope_initialize.c
// Function: default_scope_initialize
void default_scope_initialize(scope* sc) {

    ss_vector* args = ss_init_vector(sizeof(ast_node));

    ast_node_function_definition* print_definition = init_ast_node_function_definition(
        init_token(_ID, "print"),
        _DATA_TYPE_VOID,
        args,
        (void*)0
    );

    print_definition->call = _print;
    save_function_definition(sc, print_definition);

    ast_node_function_definition* strlen_definition = init_ast_node_function_definition(
        init_token(_ID, "strlen"),
        _DATA_TYPE_INTEGER,
        args,
        (void*)0
    );

    strlen_definition->call = _strlen;
    save_function_definition(sc, strlen_definition);

    ast_node_function_definition* strsplit_definition = init_ast_node_function_definition(
        init_token(_ID, "strsplit"),
        _DATA_TYPE_VECTOR,
        args,
        (void*)0
    );

    strsplit_definition->call = _strsplit;
    save_function_definition(sc, strsplit_definition);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x18, %edi
callq 0x6010
movq %rax, -0x10(%rbp)
movl $0x1, %edi
leaq 0x515e(%rip), %rsi      # 0x7034
callq 0x61f0
movq %rax, %rdi
movq -0x10(%rbp), %rdx
movl $0x2b, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x16c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
leaq -0x30f(%rip), %rcx      # 0x1bf0
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5de0
movl $0x1, %edi
leaq 0x511e(%rip), %rsi      # 0x703a
callq 0x61f0
movq %rax, %rdi
movq -0x10(%rbp), %rdx
movl $0x29, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x16c0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
leaq -0x235(%rip), %rcx      # 0x1d10
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x5de0
movl $0x1, %edi
leaq 0x50df(%rip), %rsi      # 0x7041
callq 0x61f0
movq %rax, %rdi
movq -0x10(%rbp), %rdx
movl $0x2e, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x16c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
leaq -0x1fb(%rip), %rcx      # 0x1d90
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x5de0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/eval.c
// Function: eval_file_contents
int eval_file_contents(char* filename, scope** sc) {
    (*sc) = init_scope();

    default_scope_initialize(*sc);

    char* file_contents = read_file(filename);
    lex_state* lex_state = lex_init(file_contents);
    parse_state* parse_state = parse_init(lex_state);

    ast_node* tree = (ast_node*) parse_parse(parse_state, (void*)0);
    interpret_visit(tree);

    free(tree);
    free(lex_state);
    free(parse_state);
    free(file_contents);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, %al
callq 0x5ca0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1eb0
movq -0x8(%rbp), %rdi
callq 0x38e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movb $0x0, %al
callq 0x3980
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movb $0x0, %al
callq 0x44d0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x59f0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x2110
movq -0x30(%rbp), %rdi
callq 0x1030
movq -0x20(%rbp), %rdi
callq 0x1030
movq -0x28(%rbp), %rdi
callq 0x1030
movq -0x18(%rbp), %rdi
callq 0x1030
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_compound
ast_node* interpret_visit_compound(ast_node_compound* node) {
    for (int i = 0; i < node->nodes->size; i++) {
        ast_node* child_node = (ast_node*)node->nodes->items[i];

        if (child_node->type == AST_TYPE_RETURN) {
           return interpret_visit(child_node);
        } else { 
            interpret_visit(child_node);
        }
    }

    return (ast_node*) node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
cmpq (%rcx), %rax
jae 0x235a
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x13, (%rax)
jne 0x2344
movq -0x20(%rbp), %rdi
callq 0x2110
movq %rax, -0x8(%rbp)
jmp 0x2362
movq -0x20(%rbp), %rdi
callq 0x2110
jmp 0x234f
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2303
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_if
ast_node* interpret_visit_if(ast_node_if* node) {
    int expr_int = 0;
    ast_node* expr = interpret_visit(node->expr);
    if (expr->type == AST_TYPE_INTEGER) {
        ast_node_integer* tmp_ast = (ast_node_integer*) expr;
        expr_int = tmp_ast->value;
        free(tmp_ast);
    }

    if (expr_int) {
        return interpret_visit((ast_node*)node->body);
    } else {
        return interpret_visit((ast_node*)node->elsenode);
    }

    return (ast_node*) init_ast_node_empty(node->tok);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2110
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x2f28
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1030
cmpl $0x0, -0x14(%rbp)
je 0x2f41
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2110
movq %rax, -0x8(%rbp)
jmp 0x2f52
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2110
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_else
ast_node* interpret_visit_else(ast_node_else* node) {
    if (node->ifnode) {
        return interpret_visit((ast_node*)node->ifnode);
    } else {
        return interpret_visit((ast_node*)node->body);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x2f8a
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2110
movq %rax, -0x8(%rbp)
jmp 0x2f9b
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2110
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_while
ast_node* interpret_visit_while(ast_node_while* node) {
    int expr_int = 0;
    ast_node_integer* tmp_ast = (void*)0;

    ast_node* expr = interpret_visit((ast_node*) node->expr);
    if (expr->type == AST_TYPE_INTEGER) {
        tmp_ast = (ast_node_integer*) expr;
        expr_int = tmp_ast->value;
    }

    while(expr_int) {
        interpret_visit((ast_node*)node->body);

        expr = interpret_visit((ast_node* )node->expr);
        if (expr->type == AST_TYPE_INTEGER) {
            tmp_ast = (ast_node_integer*) expr;
            expr_int = tmp_ast->value;
        }
    }

    // causes undefined behaviour
    //free(tmp_ast);

    return (ast_node*) init_ast_node_empty(node->tok);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2110
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x2ff7
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0xc(%rbp)
jmp 0x2ff9
cmpl $0x0, -0xc(%rbp)
je 0x303a
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2110
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2110
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x3038
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0xc(%rbp)
jmp 0x2ff9
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1560
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_vecptr
ast_node* interpret_visit_vecptr(ast_node_vecptr* node) {
    ast_node* target = interpret_visit(node->target);
    ast_node* index = interpret_visit(node->index);

    if (target->type == AST_TYPE_STRING) {
        ast_node_string* target_string = (ast_node_string*) target;
        if (index->type == AST_TYPE_INTEGER) {
            ast_node_integer* index_integer = (ast_node_integer*) index;
            char value = target_string->value[index_integer->value];
            char* strval = char_to_string(value);
            return (ast_node*) init_ast_node_char(init_token(_CHAR, strval), value);
        }
    } else if (target->type == AST_TYPE_VECTOR) {
        ast_node_vector* target_vector = (ast_node_vector*) target;
        if (index->type == AST_TYPE_INTEGER) {
            ast_node_integer* index_integer = (ast_node_integer*) index;
            return (ast_node*) target_vector->vector->items[index_integer->value];
        }
    }

    return (ast_node*) interpret_visit(node->target);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2110
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2110
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x3515
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x3513
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rcx
movslq 0x20(%rcx), %rcx
movb (%rax,%rcx), %al
movb %al, -0x31(%rbp)
movsbl -0x31(%rbp), %edi
callq 0x6130
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
movl $0x26, %edi
callq 0x61f0
movq %rax, %rdi
movsbl -0x31(%rbp), %esi
callq 0x13f0
movq %rax, -0x8(%rbp)
jmp 0x356a
jmp 0x3559
movq -0x18(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x3557
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x3555
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq -0x50(%rbp), %rcx
movslq 0x20(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x8(%rbp)
jmp 0x356a
jmp 0x3557
jmp 0x3559
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2110
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/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_variable
ast_node* interpret_visit_variable(ast_node_variable* node) {

    ast_node_variable_definition* definition = get_variable_definition(
        (scope*) ast_node_get_scope((ast_node*)node),
        node->tok->value
    );

    if (!definition) {
        // definition not found in the nodes scope, so let's look for it
        // in the global scope.
        definition = get_variable_definition(
            global_scope,
            node->tok->value
        );
    }

    if (definition) {
        ast_node* value = interpret_visit(definition->value);

        return value;
    } else {
        char msg[32];
        sprintf(msg, "could not find definition for: %s", node->tok->value);
        error_in_interpreter(msg);
    }

    return (ast_node*) node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12b0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5e40
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x35e3
leaq 0x6afd(%rip), %rax      # 0xa0c8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5e40
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3605
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2110
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3634
leaq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdx
leaq 0x3b8e(%rip), %rsi      # 0x71aa
movb $0x0, %al
callq 0x1130
leaq -0x40(%rbp), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_function_call
ast_node* interpret_visit_function_call(ast_node_function_call* node) {
    ast_node_function_definition* definition = get_function_definition(
        (scope*) ast_node_get_scope((ast_node*) node),
        node->tok->value 
    );

    if (!definition) {
        // definition not found in the nodes scope, so let's look for it
        // in the global scope.
        definition = get_function_definition(
            global_scope,
            node->tok->value
        );
    }

    if (definition) {
        ss_vector* visited_args = ss_init_vector(sizeof(ast_node));

        for (int i = 0; i < node->args->size; i++) {
            ss_vector_append(
                visited_args,
                interpret_visit((ast_node*)node->args->items[i])
            );
        }

        if (definition->call) {
            return interpret_visit(definition->call(visited_args));
        }
        return interpret_visit((ast_node*)definition->body);
    } else {
        printf("could not find definition for %s\n", node->tok->value);
        return (void*)0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12b0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5ed0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3693
leaq 0x6a4d(%rip), %rax      # 0xa0c8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5ed0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3738
movl $0x18, %edi
callq 0x6010
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
cmpq (%rcx), %rax
jae 0x36fc
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2110
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x6060
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x36b3
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x3725
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x20(%rbp), %rdi
movb $0x0, %al
callq *%rcx
movq %rax, %rdi
callq 0x2110
movq %rax, -0x8(%rbp)
jmp 0x375a
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2110
movq %rax, -0x8(%rbp)
jmp 0x375a
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x3a91(%rip), %rdi      # 0x71dc
movb $0x0, %al
callq 0x1080
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_variable_definition
ast_node* interpret_visit_variable_definition(ast_node_variable_definition* node) {
    node->value = interpret_visit(node->value);

    node->value = interpret_visit(node->value);

    if (
        (node->data_type == _DATA_TYPE_INTEGER && node->value->type != AST_TYPE_INTEGER) ||
        (node->data_type == _DATA_TYPE_FLOAT && node->value->type != AST_TYPE_FLOAT) ||
        (node->data_type == _DATA_TYPE_VOID && node->value->type != AST_TYPE_EMPTY) ||
        (node->data_type == _DATA_TYPE_STRING && node->value->type != AST_TYPE_STRING)
    ) {
        error_in_interpreter("Wrong data_type");
    }

    save_variable_definition(
        (scope*)ast_node_get_scope((
            ast_node*)node
         ),
        node
    );

    return (ast_node*) node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
cmpl $0x29, 0x20(%rax)
jne 0x37c3
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x3, (%rax)
jne 0x3808
movq -0x8(%rbp), %rax
cmpl $0x2a, 0x20(%rax)
jne 0x37da
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x4, (%rax)
jne 0x3808
movq -0x8(%rbp), %rax
cmpl $0x2b, 0x20(%rax)
jne 0x37f1
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x0, (%rax)
jne 0x3808
movq -0x8(%rbp), %rax
cmpl $0x2d, 0x20(%rax)
jne 0x3814
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x5, (%rax)
je 0x3814
leaq 0x397d(%rip), %rdi      # 0x718c
callq 0x2040
movq -0x8(%rbp), %rdi
callq 0x12b0
movq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x5d00
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_function_definition
ast_node* interpret_visit_function_definition(ast_node_function_definition* node) {
    save_function_definition(
        (scope*)ast_node_get_scope((
                ast_node*)node
         ),
        node
    );

    return (ast_node*) node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x12b0
movq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x5de0
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit_interpreter_instr
ast_node* interpret_visit_interpreter_instr(ast_node_interpreter_instr* node) {
    struct scope* sc = ast_node_get_scope((ast_node*) node);

    int eval_i = eval_file_contents(node->value, (scope**) &sc);
    char eval_s[2]; // string that will hold int
    sprintf(eval_s, "%d", eval_i); // int to string conversion

    return (ast_node*) init_ast_node_integer(
        init_token(_INTEGER, eval_s),
        eval_i
    );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x12b0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0x2070
movl %eax, -0x14(%rbp)
leaq -0x16(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq 0x3953(%rip), %rsi      # 0x71fe
movb $0x0, %al
callq 0x1130
leaq -0x16(%rbp), %rsi
movl $0x2, %edi
callq 0x61f0
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x17a0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/io.c
// Function: read_file
char* read_file(char* filename) {
    char * buffer = 0;
    long length;
    FILE * f = fopen (filename, "rb");

    if (f) {
        fseek (f, 0, SEEK_END);
        length = ftell (f);
        fseek (f, 0, SEEK_SET);
        buffer = calloc (length, length);
        if (buffer)
            fread (buffer, 1, length, f);

        fclose (f);
    }

    return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x3902(%rip), %rsi      # 0x7201
callq 0x10f0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3974
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x10d0
movq -0x20(%rbp), %rdi
callq 0x10b0
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10d0
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1090
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x396b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x1, %esi
callq 0x1040
movq -0x20(%rbp), %rdi
callq 0x1060
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/lex.c
// Function: lex_init
lex_state* lex_init(char* buffer) {
    lex_state* state;
    state = malloc(sizeof(struct LEX_STATE_STRUCT));
    state->buffer = buffer;
    state->pos = 0;
    state->current_char = state->buffer[state->pos];

    return state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x10, %edi
callq 0x10c0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0xc(%rcx), %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/lex.c
// Function: lex_parse_string
char* lex_parse_string(lex_state* state) {
    lex_advance(state);

    char* buff;
    char* charstr;

    buff = calloc(2, sizeof(char*));
    charstr = char_to_string(state->current_char);
    strcat(buff, charstr);
    lex_advance(state);
    free(charstr);

    while (state->current_char != '\0') {
        if (state->current_char == '"')
            break;

        buff = realloc(buff, strlen(buff) + ((sizeof(char) * 2) + 1));
        charstr = char_to_string(state->current_char);
        strcat(buff, charstr);
        lex_advance(state);
        free(charstr);
    }

    lex_advance(state);

    return buff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x39e0
movl $0x2, %edi
movl $0x8, %esi
callq 0x1090
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x18(%rbp), %rdi
callq 0x1030
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %eax
cmpl $0x0, %eax
je 0x408b
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %eax
cmpl $0x22, %eax
jne 0x4034
jmp 0x408b
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1070
movq -0x20(%rbp), %rdi
movq %rax, %rsi
addq $0x3, %rsi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x18(%rbp), %rdi
callq 0x1030
jmp 0x4018
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/lex.c
// Function: lex_parse_id
char* lex_parse_id(lex_state* state) {
    char* buff;
    char* charstr;

    buff = calloc(2, sizeof(char*));
    charstr = char_to_string(state->current_char);
    strcat(buff, charstr);
    lex_advance(state);
    free(charstr);

    while (isalnum(state->current_char) || state->current_char == '_') {
        buff = realloc(buff, sizeof(buff) + (sizeof(char) * 2));
        charstr = char_to_string(state->current_char);
        strcat(buff, charstr);
        lex_advance(state);
        free(charstr);
    }

    return buff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x2, %edi
movl $0x8, %esi
callq 0x1090
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x18(%rbp), %rdi
callq 0x1030
callq 0x1150
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl 0x8(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x8, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x19(%rbp)
jne 0x4124
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %eax
cmpl $0x5f, %eax
sete %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x412d
jmp 0x4174
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x18(%rbp), %rdi
callq 0x1030
jmp 0x40ef
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/lex.c
// Function: lex_parse_char
char* lex_parse_char(lex_state* state) {
    lex_advance(state);

    char* buff;
    char* charstr;

    buff = calloc(2, sizeof(char*));
    charstr = char_to_string(state->current_char);
    strcat(buff, charstr);
    lex_advance(state);
    free(charstr);
    int count = 0;

    while (state->current_char != '\0') {
        if (state->current_char == '\'')
            break;

        if (count >= 1)
            error_in_lexer("Characters can only have one character");

        buff = realloc(buff, strlen(buff) + ((sizeof(char) * 2) + 1));
        charstr = char_to_string(state->current_char);
        strcat(buff, charstr);
        lex_advance(state);
        free(charstr);
        count++;
    }

    lex_advance(state);

    return buff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x39e0
movl $0x2, %edi
movl $0x8, %esi
callq 0x1090
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x18(%rbp), %rdi
callq 0x1030
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %eax
cmpl $0x0, %eax
je 0x4274
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %eax
cmpl $0x27, %eax
jne 0x41ff
jmp 0x4274
cmpl $0x1, -0x1c(%rbp)
jl 0x4211
leaq 0x3016(%rip), %rdi      # 0x7222
callq 0x1fe0
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1070
movq -0x28(%rbp), %rdi
movq %rax, %rsi
addq $0x3, %rsi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x18(%rbp), %rdi
callq 0x1030
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x41df
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/lex.c
// Function: lex_parse_number
token* lex_parse_number(lex_state* state) {
    char* buff;
    char* charstr;
    int type = _INTEGER;

    buff = calloc(2, sizeof(char*));
    charstr = char_to_string(state->current_char);
    strcat(buff, charstr);
    lex_advance(state);
    free(charstr);

    while (isdigit(state->current_char)) {
        buff = realloc(buff, sizeof(buff) + (sizeof(char) * 2));
        charstr = char_to_string(state->current_char);
        strcat(buff, charstr);
        lex_advance(state);
        free(charstr);
    }

    // float
    if (state->current_char == '.') {
        buff = realloc(buff, sizeof(buff) + (sizeof(char) * 2));
        charstr = char_to_string(state->current_char);
        strcat(buff, charstr);
        lex_advance(state);

        while (isdigit(state->current_char)) {
            buff = realloc(buff, sizeof(buff) + (sizeof(char) * 2));
            charstr = char_to_string(state->current_char);
            strcat(buff, charstr);
            lex_advance(state);
        }

        free(charstr);

        type = _FLOAT;
    }

    return init_token(type, buff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x2, -0x1c(%rbp)
movl $0x2, %edi
movl $0x8, %esi
callq 0x1090
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x18(%rbp), %rdi
callq 0x1030
callq 0x1150
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl 0x8(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x434b
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
movq -0x18(%rbp), %rdi
callq 0x1030
jmp 0x42e6
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %eax
cmpl $0x2e, %eax
jne 0x4401
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
callq 0x1150
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl 0x8(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x43f1
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x8(%rax), %edi
callq 0x6130
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1120
movq -0x8(%rbp), %rdi
callq 0x39e0
jmp 0x4395
movq -0x18(%rbp), %rdi
callq 0x1030
movl $0x27, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x61f0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/lex.c
// Function: lex_peek_next
char lex_peek_next(lex_state* state, int start) {
    int peek_pos = start;
    char c = '\0';

    while (peek_pos < (int)strlen(state->buffer)) {
        c = state->buffer[peek_pos];

        if (c == '\0' || c == ' ' || c == '\n') {
            peek_pos++;
            continue;
        } else {
            break;
        }
    }

    return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x1070
movq %rax, %rcx
movl -0x18(%rbp), %eax
cmpl %ecx, %eax
jge 0x448e
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x10(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0x4481
movsbl -0x11(%rbp), %eax
cmpl $0x20, %eax
je 0x4481
movsbl -0x11(%rbp), %eax
cmpl $0xa, %eax
jne 0x448c
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4439
jmp 0x448e
movb -0x11(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_init
parse_state* parse_init(lex_state* lex) {
    parse_state* state;
    state = malloc(sizeof(struct PARSE_STATE_STRUCT));
    state->lex = lex;
    state->current_token = lex_get_next_token(state->lex);

    return state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x18, %edi
callq 0x10c0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3a30
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_eat
void parse_eat(parse_state* state, int token_type) {
    if (state->current_token->type == token_type) {
        state->current_token = lex_get_next_token(state->lex);
    } else {
        printf("Unexpected token_type: `%d` (was expecting `%d`)\n", state->current_token->type, token_type);
        // TODO: error
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x4557
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x3a30
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x4572
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %esi
movl -0xc(%rbp), %edx
leaq 0x2cde(%rip), %rdi      # 0x7249
movb $0x0, %al
callq 0x1080
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_integer
ast_node_integer* parse_integer(parse_state* state, scope* sc) {
    ast_node_integer* node = init_ast_node_integer(state->current_token, atoi(state->current_token->value));
    parse_eat(state, _INTEGER);
    ast_node_set_scope((ast_node*) node, (struct scope*) sc);
    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x1110
movq -0x20(%rbp), %rdi
movl %eax, %esi
callq 0x17a0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x4520
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12f0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_vecptr
ast_node_vecptr* parse_vecptr(parse_state* state, scope* sc) {
    ast_node* target = parse_expr(state, sc);
    parse_eat(state, _LBRACKET);
    ast_node* index = (ast_node*) parse_expr(state, sc);
    parse_eat(state, _RBRACKET);

    ast_node_vecptr* vecptr_node = init_ast_node_vecptr(
        (void*)0,
        target,
        index
    );

    ast_node_set_scope((ast_node*)vecptr_node, (struct scope*) sc);

    return vecptr_node;
}

// 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 0x4670
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4670
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x23, %esi
callq 0x4520
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x19f0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12f0
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_vector
ast_node_vector* parse_vector(parse_state* state, scope* sc) {
    parse_eat(state, _LBRACKET);
    ss_vector* items = ss_init_vector(sizeof(ast_node));
    
    ss_vector_append(items, (ast_node*) parse_expr(state, sc));
    
    while (state->current_token->type == _COMMA) {
        parse_eat(state, _COMMA);
        ss_vector_append(items, (ast_node*) parse_expr(state, sc));
    }

    parse_eat(state, _RBRACKET);

    ast_node_vector* node = init_ast_node_vector(
        state->current_token,
        0,
        items
    );

    ast_node_set_scope((ast_node*) node, (struct scope*) sc);

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x4520
movl $0x18, %edi
callq 0x6010
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4670
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x6060
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x10, (%rax)
jne 0x49ab
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x4520
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4670
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x6060
jmp 0x496d
movq -0x8(%rbp), %rdi
movl $0x23, %esi
callq 0x4520
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x1a50
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12f0
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_float
ast_node_float* parse_float(parse_state* state, scope* sc) {
    ast_node_float* node = init_ast_node_float(state->current_token, atof(state->current_token->value));
    parse_eat(state, _FLOAT);
    ast_node_set_scope((ast_node*) node, (struct scope*) sc);
    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x1050
movq -0x20(%rbp), %rdi
cvtsd2ss %xmm0, %xmm0
callq 0x15a0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x27, %esi
callq 0x4520
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12f0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_return
ast_node_return* parse_return(parse_state* state, scope* sc) {
    parse_eat(state, _RETURN);
    ast_node* expr = parse_expr(state, sc);

    ast_node_return* return_ast = init_ast_node_return(
        state->current_token,
        expr
    );

    ast_node_set_scope((ast_node*) return_ast, (struct scope*) sc);

    return return_ast;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x11, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4670
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x1850
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12f0
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_while
ast_node_while* parse_while(parse_state* state, scope* sc) {
    parse_eat(state, _WHILE);
    parse_eat(state, _LPAREN);
    ast_node* expr = parse_expr(state, sc);
    parse_eat(state, _RPAREN);
    parse_eat(state, _LBRACE);

    ast_node_compound* body = parse_compound(state, sc);
    ast_node_set_scope((ast_node*) body, (struct scope*) sc);

    parse_eat(state, _RBRACE);

    ast_node_while* while_ast = init_ast_node_while(
        state->current_token,
        expr,
        body
    );

    ast_node_set_scope((ast_node*) while_ast, (struct scope*) sc);

    return while_ast;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1d, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movl $0xc, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4670
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0xd, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movl $0xe, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4b80
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12f0
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x4520
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x1ab0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12f0
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/parse.c
// Function: parse_foreach
ast_node_foreach* parse_foreach(parse_state* state, scope* sc) {
    parse_eat(state, _FOREACH);
    parse_eat(state, _LPAREN);
    ast_node* iterable = parse_expr(state, sc);
    parse_eat(state, _AS);
    token* value_name_tok = state->current_token;
    parse_eat(state, _ID);
    parse_eat(state, _RPAREN);
    parse_eat(state, _LBRACE);
    ast_node_compound* body = parse_compound(state, sc);
    parse_eat(state, _RBRACE);

    ast_node_foreach* foreach_ast = init_ast_node_foreach(
        value_name_tok,
        iterable,
        value_name_tok,
        body        
    );

    ast_node_set_scope((ast_node*) foreach_ast, (struct scope*) sc);

    return foreach_ast;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1e, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movl $0xc, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4670
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1f, %esi
callq 0x4520
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movl $0xd, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movl $0xe, %esi
callq 0x4520
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4b80
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x4520
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x1600
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12f0
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq