LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movq (%rax), %r14
cmpl $0x5, (%r14)
jne 0x1a2f
movq 0x8(%rax), %r15
cmpl $0x5, (%r15)
jne 0x1a2f
movl $0x18, %edi
callq 0x4948
movq %rax, %rbx
movq 0x20(%r14), %rdi
movq 0x20(%r15), %rsi
callq 0x1120
movq %rax, %r14
xorl %edi, %edi
movq %rax, %rsi
callq 0x1664
movq %rbx, %rdi
movq %rax, %rsi
callq 0x497c
testq %r14, %r14
jne 0x1a06
jmp 0x1a16
xorl %edi, %edi
movq %rax, %rsi
callq 0x1664
movq %rbx, %rdi
movq %rax, %rsi
callq 0x497c
movq 0x20(%r15), %rsi
xorl %edi, %edi
callq 0x1120
testq %rax, %rax
jne 0x19f1
xorl %edi, %edi
movl $0x2e, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1774
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1458
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x18, %edi
callq 0x4948
movq %rax, %r14
leaq 0x35e8(%rip), %rsi      # 0x5046
movl $0x1, %edi
callq 0x4a78
movq %rax, %rdi
movl $0x2b, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1534
leaq -0x1e1(%rip), %rcx      # 0x18a0
movq %rcx, 0x38(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x480e
leaq 0x35b5(%rip), %rsi      # 0x504c
movl $0x1, %edi
callq 0x4a78
movq %rax, %rdi
movl $0x29, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1534
leaq -0x16d(%rip), %rcx      # 0x194d
movq %rcx, 0x38(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x480e
leaq 0x3583(%rip), %rsi      # 0x5053
movl $0x1, %edi
callq 0x4a78
movq %rax, %rdi
movl $0x2e, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1534
leaq -0x160(%rip), %rcx      # 0x1993
movq %rcx, 0x38(%rax)
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x480e
nop
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
callq 0x4760
movq %rax, (%rbx)
movq %rax, %rdi
callq 0x1a40
movq %r14, %rdi
callq 0x2bfc
movq %rax, %rbx
movq %rax, %rdi
xorl %eax, %eax
callq 0x2c84
movq %rax, %r14
movq %rax, %rdi
xorl %eax, %eax
callq 0x37e8
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x4564
movq %rax, %r12
movq %rax, %rdi
callq 0x1c48
movq %r12, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rcx
cmpq $0x0, (%rcx)
je 0x1de3
xorl %r14d, %r14d
movq %rax, %r15
movq 0x8(%rcx), %rax
movq (%rax,%r14,8), %rdi
movl (%rdi), %r12d
callq 0x1c48
cmpl $0x13, %r12d
cmovneq %r15, %rax
je 0x1de0
incq %r14
movq 0x20(%rbx), %rcx
cmpq %r14, (%rcx)
ja 0x1db5
jmp 0x1de3
movq %rax, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x1c48
cmpl $0x3, (%rax)
jne 0x253a
movl 0x20(%rax), %r14d
movq %rax, %rdi
callq 0x1030
movl $0x28, %eax
testl %r14d, %r14d
jne 0x253f
movl $0x30, %eax
movq (%rbx,%rax), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1c48
// File: /workspace/github_c_makefile_star2_O1/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
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x2562
movq %rax, %rdi
popq %rbp
jmp 0x1c48
movq 0x20(%rdi), %rdi
popq %rbp
jmp 0x1c48
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x1c48
movq %rax, %r14
movq 0x28(%rbx), %rdi
callq 0x1c48
movl (%r14), %ecx
cmpl $0x15, %ecx
je 0x2955
cmpl $0x5, %ecx
jne 0x2971
movl (%rax), %r15d
cmpl $0x3, %r15d
jne 0x2941
movq 0x20(%r14), %rcx
movslq 0x20(%rax), %rax
movsbl (%rcx,%rax), %r14d
movl %r14d, %edi
callq 0x49f4
movl $0x26, %edi
movq %rax, %rsi
callq 0x4a78
movq %rax, %rdi
movl %r14d, %esi
callq 0x1370
movq %rax, %rcx
cmpl $0x3, %r15d
jne 0x2971
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl (%rax), %edx
cmpl $0x3, %edx
jne 0x296c
movq 0x28(%r14), %rcx
movq 0x8(%rcx), %rcx
movslq 0x20(%rax), %rax
movq (%rcx,%rax,8), %rcx
cmpl $0x3, %edx
je 0x2947
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1c48
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x12b2
movq 0x18(%rbx), %rcx
movq 0x8(%rcx), %rsi
movq %rax, %rdi
callq 0x482a
testq %rax, %rax
jne 0x29cc
leaq 0x571c(%rip), %rax      # 0x80d8
movq (%rax), %rdi
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x482a
testq %rax, %rax
je 0x29e2
movq 0x28(%rax), %rdi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x1c48
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rdx
leaq 0x2831(%rip), %rsi      # 0x5222
leaq -0x30(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x1150
movq %r14, %rdi
callq 0x1b8d
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x12b2
movq 0x18(%rbx), %rcx
movq 0x8(%rcx), %rsi
movq %rax, %rdi
callq 0x4882
movq %rax, %r14
testq %rax, %rax
jne 0x2a58
leaq 0x5693(%rip), %rax      # 0x80d8
movq (%rax), %rdi
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x4882
movq %rax, %r14
testq %r14, %r14
je 0x2ab0
movl $0x18, %edi
callq 0x4948
movq %rax, %r15
movq 0x20(%rbx), %rax
cmpq $0x0, (%rax)
je 0x2a9b
xorl %r12d, %r12d
movq 0x8(%rax), %rax
movq (%rax,%r12,8), %rdi
callq 0x1c48
movq %r15, %rdi
movq %rax, %rsi
callq 0x497c
incq %r12
movq 0x20(%rbx), %rax
cmpq %r12, (%rax)
ja 0x2a77
movq 0x38(%r14), %rcx
testq %rcx, %rcx
je 0x2ad1
movq %r15, %rdi
xorl %eax, %eax
callq *%rcx
movq %rax, %rdi
jmp 0x2ad5
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x2795(%rip), %rdi      # 0x5254
xorl %eax, %eax
callq 0x10a0
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%r14), %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1c48
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x1c48
movq %rax, 0x28(%rbx)
movq %rax, %rdi
callq 0x1c48
movq %rax, 0x28(%rbx)
movl 0x20(%rbx), %ecx
leal -0x29(%rcx), %edx
cmpl $0x4, %edx
ja 0x2b5d
leaq 0x262a(%rip), %rsi      # 0x5140
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
cmpl $0x3, (%rax)
jne 0x2b51
cmpl $0x2d, %ecx
je 0x2b4c
cmpl $0x2b, %ecx
je 0x2b42
cmpl $0x2a, %ecx
jne 0x2b5d
cmpl $0x4, (%rax)
jne 0x2b51
cmpl $0x2d, %ecx
je 0x2b4c
cmpl $0x2b, %ecx
jne 0x2b5d
cmpl $0x0, (%rax)
jne 0x2b51
cmpl $0x2d, %ecx
jne 0x2b5d
cmpl $0x5, (%rax)
je 0x2b5d
leaq 0x26ac(%rip), %rdi      # 0x5204
callq 0x1b8d
movq %rbx, %rdi
callq 0x12b2
movq %rax, %rdi
movq %rbx, %rsi
callq 0x47a6
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x12b2
movq %rax, %rdi
movq %rbx, %rsi
callq 0x480e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x12b2
leaq -0x20(%rbp), %rsi
movq %rax, (%rsi)
movq 0x28(%rbx), %rdi
callq 0x1bc0
movl %eax, %ebx
leaq 0x26ad(%rip), %rsi      # 0x5276
leaq -0x12(%rbp), %r14
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x1150
movl $0x2, %edi
movq %r14, %rsi
callq 0x4a78
movq %rax, %rdi
movl %ebx, %esi
callq 0x15c4
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x266c(%rip), %rsi      # 0x5279
callq 0x1110
testq %rax, %rax
je 0x2c70
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x10f0
movq %rbx, %rdi
callq 0x10d0
movq %rax, %r15
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10f0
movq %r15, %rdi
movq %r15, %rsi
callq 0x10b0
movq %rax, %r14
testq %rax, %rax
je 0x2c66
movl $0x1, %esi
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x1060
movq %rbx, %rdi
callq 0x1080
jmp 0x2c73
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x10, %edi
callq 0x10e0
movq %rbx, (%rax)
movl $0x0, 0xc(%rax)
movb (%rbx), %cl
movb %cl, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movslq 0xc(%rdi), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x3389
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%rbx)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%rbx)
movl $0x2, %edi
movl $0x8, %esi
callq 0x10b0
movq %rax, %r14
movsbl 0x8(%rbx), %edi
callq 0x49f4
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x1140
movq (%rbx), %rax
movslq 0xc(%rbx), %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x33f4
movq %r15, %rdi
callq 0x1030
movzbl 0x8(%rbx), %r15d
testl %r15d, %r15d
je 0x3407
cmpl $0x22, %r15d
je 0x3407
movq %r14, %rdi
callq 0x1090
leaq 0x3(%rax), %rsi
movq %r14, %rdi
callq 0x1100
movq %rax, %r14
movsbl %r15b, %edi
jmp 0x339f
movslq %ecx, %rcx
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%rbx)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%rbx)
jmp 0x33bf
movq (%rbx), %rax
movslq 0xc(%rbx), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x3422
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%rbx)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x2, %edi
movl $0x8, %esi
callq 0x10b0
movq %rax, %r14
movsbl 0x8(%rbx), %edi
callq 0x49f4
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x1140
movq (%rbx), %rax
movslq 0xc(%rbx), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x3482
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%rbx)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%rbx)
movq %r15, %rdi
callq 0x1030
callq 0x1170
movq %rax, %r15
movsbq 0x8(%rbx), %r12
cmpq $0x5f, %r12
je 0x34aa
movq (%r15), %rax
movzwl (%rax,%r12,2), %eax
andl $0x8, %eax
je 0x34f6
movl $0xa, %esi
movq %r14, %rdi
callq 0x1100
movq %rax, %r14
movsbl %r12b, %edi
callq 0x49f4
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
callq 0x1140
movq (%rbx), %rax
movslq 0xc(%rbx), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x34ec
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%rbx)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%rbx)
movq %r12, %rdi
callq 0x1030
jmp 0x3492
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movslq 0xc(%rdi), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x352e
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%rbx)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%rbx)
movl $0x2, %edi
movl $0x8, %esi
callq 0x10b0
movq %rax, %r14
movsbl 0x8(%rbx), %edi
callq 0x49f4
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x1140
movq (%rbx), %rax
movslq 0xc(%rbx), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x3572
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%rbx)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%rbx)
movq %r15, %rdi
callq 0x1030
xorl %r13d, %r13d
leaq 0x1da2(%rip), %r15      # 0x5326
movzbl 0x8(%rbx), %eax
testl %eax, %eax
je 0x35f2
cmpl $0x27, %eax
je 0x35f2
subl $0x1, %r13d
jb 0x359f
movq %r15, %rdi
callq 0x1b27
movq %r14, %rdi
callq 0x1090
leaq 0x3(%rax), %rsi
movq %r14, %rdi
callq 0x1100
movq %rax, %r14
movsbl 0x8(%rbx), %edi
callq 0x49f4
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
callq 0x1140
movq (%rbx), %rax
movslq 0xc(%rbx), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x35e8
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%rbx)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%rbx)
movq %r12, %rdi
callq 0x1030
jmp 0x3584
movq (%rbx), %rax
movslq 0xc(%rbx), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x360d
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%rbx)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x2, %edi
movl $0x8, %esi
callq 0x10b0
movq %rax, %rbx
movsbl 0x8(%r14), %edi
callq 0x49f4
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1140
movq (%r14), %rax
movslq 0xc(%r14), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x3677
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%r14)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%r14)
movq %r15, %rdi
callq 0x1030
callq 0x1170
movq %rax, %r15
movq (%rax), %rax
movsbq 0x8(%r14), %r12
testb $0x8, 0x1(%rax,%r12,2)
je 0x36e8
movl $0xa, %esi
movq %rbx, %rdi
callq 0x1100
movq %rax, %rbx
movsbl %r12b, %edi
callq 0x49f4
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1140
movq (%r14), %rax
movslq 0xc(%r14), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x36db
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%r14)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%r14)
movq %r12, %rdi
callq 0x1030
movq (%r15), %rax
jmp 0x368a
movl $0x2, %edi
cmpb $0x2e, %r12b
jne 0x376a
movl $0xa, %esi
movq %rbx, %rdi
callq 0x1100
movq %rax, %rbx
movsbl %r12b, %edi
callq 0x49f4
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1140
movq (%r14), %rax
movslq 0xc(%r14), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x3737
leaq 0x1(%rcx), %rdx
movl %edx, 0xc(%r14)
movb 0x1(%rax,%rcx), %al
movb %al, 0x8(%r14)
movq (%r15), %rax
movsbq 0x8(%r14), %r13
testb $0x8, 0x1(%rax,%r13,2)
je 0x375d
movl $0xa, %esi
movq %rbx, %rdi
callq 0x1100
movq %rax, %rbx
movsbl %r13b, %edi
jmp 0x3707
movq %r12, %rdi
callq 0x1030
movl $0x27, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4a78
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movl %esi, %r14d
movq (%rdi), %rbx
movq %rbx, %rdi
callq 0x1090
subl %r14d, %eax
jle 0x37c5
movslq %r14d, %rcx
addq %rcx, %rbx
xorl %edx, %edx
movabsq $0x100000401, %rsi      # imm = 0x100000401
movzbl (%rbx,%rdx), %ecx
cmpq $0x20, %rcx
ja 0x37c7
btq %rcx, %rsi
jae 0x37c7
incq %rdx
cmpl %edx, %eax
jne 0x37ac
jmp 0x37c7
xorl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x18, %edi
callq 0x10e0
movq %rax, %r14
movq %rbx, (%rax)
movq %rbx, %rdi
callq 0x2cce
movq %rax, 0x8(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movl %esi, %edx
movq 0x8(%rdi), %rax
movl (%rax), %esi
cmpl %edx, %esi
jne 0x383e
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2cce
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x1b6b(%rip), %rdi      # 0x53b0
xorl %eax, %eax
jmp 0x10a0
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r15
movq 0x8(%r15), %rdi
callq 0x1130
movq %r15, %rdi
movl %eax, %esi
callq 0x15c4
movq %rax, %r15
movq %r14, %rdi
movl $0x2, %esi
callq 0x3816
movq %r15, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3904
movq %rax, %r15
movq %r14, %rdi
movl $0x22, %esi
callq 0x3816
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3904
movq %rax, %r12
movq %r14, %rdi
movl $0x23, %esi
callq 0x3816
xorl %edi, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1734
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sebbekarlsson[P]cola/src/parse.c
// Function: parse_expr
ast_node* parse_expr(parse_state* state, scope* sc) {
    token* tok = (void*)0;

    // invalid pointer type
    ast_node* node = parse_term(state, sc);

    if (state->current_token->type == _LBRACKET) {
        tok = state->current_token;
        parse_eat(state, _LBRACKET);
        ast_node_vecptr* vecptrnode = init_ast_node_vecptr((void*)0, node, parse_expr(state, sc));
        parse_eat(state, _RBRACKET);
        return (ast_node*) vecptrnode;
    }

    while(
            state->current_token->type == _OP_PLUS ||
            state->current_token->type == _OP_SUBTRACT ||
            state->current_token->type == _NOT_EQUALS ||
            state->current_token->type == _LESS_THAN ||
            state->current_token->type == _LARGER_THAN ||
            state->current_token->type == _LESS_OR_EQUALS ||
            state->current_token->type == _LARGER_OR_EQUALS ||
            state->current_token->type == _EQUALS_EQUALS ||
            state->current_token->type == _DOT
         ) {
        tok = state->current_token;

        if (tok->type == _OP_PLUS) {
            parse_eat(state, _OP_PLUS);
        } else if (tok->type == _OP_SUBTRACT) {
            parse_eat(state, _OP_SUBTRACT);
        } else if (tok->type == _NOT_EQUALS) {
            parse_eat(state, _NOT_EQUALS);
        } else if (tok->type == _LESS_THAN) {
            parse_eat(state, _LESS_THAN);
        } else if (tok->type == _LARGER_THAN) {
            parse_eat(state, _LARGER_THAN);
        } else if (tok->type == _LESS_OR_EQUALS) {
            parse_eat(state, _LESS_OR_EQUALS);
        } else if (tok->type == _LARGER_OR_EQUALS) {
            parse_eat(state, _LARGER_OR_EQUALS);
        } else if (tok->type == _EQUALS_EQUALS) {
            parse_eat(state, _EQUALS_EQUALS);
        } else if (tok->type == _DOT) {
            parse_eat(state, _DOT);
        }

        // invalid pointer type
        node = (ast_node*) init_ast_node_binop(tok, node, parse_term(state, sc));
        ast_node_set_scope((ast_node*) node, (struct scope*) sc);
    };

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x416e
movq %rax, %r15
movq 0x8(%rbx), %rax
cmpl $0x22, (%rax)
jne 0x3963
movq %rbx, %rdi
movl $0x22, %esi
callq 0x3816
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3904
xorl %edi, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1734
movq %rax, %r14
movq %rbx, %rdi
movl $0x23, %esi
callq 0x3816
movq %r14, %rax
jmp 0x39be
movabsq $0x1000000060, %r13     # imm = 0x1000000060
movq 0x8(%rbx), %r12
movl (%r12), %esi
leal -0x15(%rsi), %eax
cmpl $0x6, %eax
jb 0x398a
cmpl $0x24, %esi
ja 0x39bb
movl %esi, %eax
btq %rax, %r13
jae 0x39bb
movq %rbx, %rdi
callq 0x3816
movq %rbx, %rdi
movq %r14, %rsi
callq 0x416e
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1318
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x12cb
jmp 0x396d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x22, %esi
callq 0x3816
movl $0x18, %edi
callq 0x4948
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3904
movq %r15, %rdi
movq %rax, %rsi
callq 0x497c
movq 0x8(%r14), %rax
cmpl $0x10, (%rax)
jne 0x3a22
movq %r14, %rdi
movl $0x10, %esi
callq 0x3816
jmp 0x39f4
movq %r14, %rdi
movl $0x23, %esi
callq 0x3816
movq 0x8(%r14), %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1774
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r15
movq 0x8(%r15), %rdi
callq 0x1070
cvtsd2ss %xmm0, %xmm0
movq %r15, %rdi
callq 0x1484
movq %rax, %r15
movq %r14, %rdi
movl $0x27, %esi
callq 0x3816
movq %r15, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x11, %esi
callq 0x3816
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3904
movq 0x8(%r14), %rdi
movq %rax, %rsi
callq 0x1634
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1d, %esi
callq 0x3816
movq %r14, %rdi
movl $0xc, %esi
callq 0x3816
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3904
movq %rax, %r15
movq %r14, %rdi
movl $0xd, %esi
callq 0x3816
movq %r14, %rdi
movl $0xe, %esi
callq 0x3816
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44fd
xorl %edi, %edi
movq %rax, %rsi
callq 0x13e8
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r14, %rdi
movl $0xf, %esi
callq 0x3816
movq 0x8(%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x17b4
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1e, %esi
callq 0x3816
movq %r14, %rdi
movl $0xc, %esi
callq 0x3816
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3904
movq %rax, %r15
movq %r14, %rdi
movl $0x1f, %esi
callq 0x3816
movq 0x8(%r14), %r12
movq %r14, %rdi
movl $0x1, %esi
callq 0x3816
movq %r14, %rdi
movl $0xd, %esi
callq 0x3816
movq %r14, %rdi
movl $0xe, %esi
callq 0x3816
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44fd
xorl %edi, %edi
movq %rax, %rsi
callq 0x13e8
movq %rax, %r13
movq %r14, %rdi
movl $0xf, %esi
callq 0x3816
movq %r12, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x14bc
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sebbekarlsson[P]cola/src/parse.c
// Function: parse_else
ast_node_else* parse_else(parse_state* state, scope* sc) {
    parse_eat(state, _ELSE);
    ast_node_if* ifnode = (void*)0;
    ast_node_compound* body = (void*)0;

    if (state->current_token->type == _IF) {
        ifnode = parse_if(state, sc);
    } else {
        parse_eat(state, _LBRACE);
        body =  parse_compound(state, sc);
        parse_eat(state, _RBRACE);
    }

    ast_node_else* else_ast = init_ast_node_else(
        state->current_token,
        body,
        (struct ast_node_if*) ifnode
    );

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

    return else_ast;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x13, %esi
callq 0x3816
movq 0x8(%r14), %rax
cmpl $0x12, (%rax)
jne 0x3caa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3d08
movq %rax, %r15
xorl %r12d, %r12d
jmp 0x3cdf
movq %r14, %rdi
movl $0xe, %esi
callq 0x3816
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44fd
xorl %r15d, %r15d
xorl %edi, %edi
movq %rax, %rsi
callq 0x13e8
movq %rax, %r12
movq %r14, %rdi
movl $0xf, %esi
callq 0x3816
movq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1418
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sebbekarlsson[P]cola/src/parse.c
// Function: parse_if
ast_node_if* parse_if(parse_state* state, scope* sc) {
    parse_eat(state, _IF);
    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);
    parse_eat(state, _RBRACE);

    ast_node_else* elsenode = (void*)0;

    if (state->current_token->type == _ELSE)
        elsenode = parse_else(state, sc);

    ast_node_if* if_ast = init_ast_node_if(
        state->current_token,
        expr,
        body,
        elsenode
    );

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

    return if_ast;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x12, %esi
callq 0x3816
movq %r14, %rdi
movl $0xc, %esi
callq 0x3816
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3904
movq %rax, %r15
movq %r14, %rdi
movl $0xd, %esi
callq 0x3816
movq %r14, %rdi
movl $0xe, %esi
callq 0x3816
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44fd
xorl %r12d, %r12d
xorl %edi, %edi
movq %rax, %rsi
callq 0x13e8
movq %rax, %r13
movq %r14, %rdi
movl $0xf, %esi
callq 0x3816
movq 0x8(%r14), %rax
cmpl $0x13, (%rax)
jne 0x3d9a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3c73
movq %rax, %r12
movq 0x8(%r14), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x157c
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sebbekarlsson[P]cola/src/parse.c
// Function: parse_variable
ast_node_variable* parse_variable(parse_state* state, scope* sc) {
    ast_node_variable* var = init_ast_node_variable(state->current_token, (void*)0);
    parse_eat(state, _ID);

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

    return var;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
xorl %esi, %esi
callq 0x16c4
movq %rax, %r15
movq %r14, %rdi
movl $0x1, %esi
callq 0x3816
movq %r15, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sebbekarlsson[P]cola/src/parse.c
// Function: parse_function_call
ast_node_function_call* parse_function_call(parse_state* state, scope* sc) {
    token* tok = state->current_token;
    parse_eat(state, _FUNCTION_CALL);
    ss_vector* args = ss_init_vector(sizeof(ast_node));

    parse_eat(state, _LPAREN);

    if (state->current_token->type != _RPAREN) {
        ss_vector_append(args, (ast_node*) parse_expr(state, sc));

        while (state->current_token->type == _COMMA) {
            parse_eat(state, _COMMA);
            ss_vector_append(args, (ast_node*) parse_expr(state, sc));
        }
    }

    parse_eat(state, _RPAREN);

    ast_node_function_call* call = init_ast_node_function_call(
        tok,
        args
    );

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

    return call;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq 0x8(%rdi), %r14
movl $0x1c, %esi
callq 0x3816
movl $0x18, %edi
callq 0x4948
movq %rax, %r12
movq %r15, %rdi
movl $0xc, %esi
callq 0x3816
movq 0x8(%r15), %rax
cmpl $0xd, (%rax)
jne 0x3e84
movq %r15, %rdi
movl $0xd, %esi
callq 0x3816
movq %r14, %rdi
movq %r12, %rsi
callq 0x1504
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12cb
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3904
movq %r12, %rdi
movq %rax, %rsi
callq 0x497c
movq 0x8(%r15), %rax
cmpl $0x10, (%rax)
jne 0x3e52
movq %r15, %rdi
movl $0x10, %esi
callq 0x3816
jmp 0x3e84
// File: /workspace/github_c_makefile_star2_O1/sebbekarlsson[P]cola/src/parse.c
// Function: parse_component
ast_node_component* parse_component(parse_state* state, scope* sc) {
    parse_eat(state, _TYPE_COMPONENT);

    sc = init_scope();
    
    token* name = state->current_token;
    parse_eat(state, _ID);

    ss_vector* deps = ss_init_vector(sizeof(token));

    if (state->current_token->type == _USE) {
        parse_eat(state, _USE);
        ss_vector_append(deps, state->current_token);
        parse_eat(state, _ID); 

        while (state->current_token->type == _COMMA) {
            parse_eat(state, _COMMA);
            parse_eat(state, _ID); 
            ss_vector_append(deps, state->current_token);
        }
    }

    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_component* component = init_ast_node_component(
        name,
        name,
        body,
        deps
    );
    
    //ast_node_set_scope((ast_node*)component, (struct scope*)sc);

    return component;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2f, %esi
callq 0x3816
xorl %eax, %eax
callq 0x4760
movq %rax, %r15
movq 0x8(%rbx), %r14
movq %rbx, %rdi
movl $0x1, %esi
callq 0x3816
movl $0x10, %edi
callq 0x4948
movq %rax, %r12
movq 0x8(%rbx), %rax
cmpl $0xb, (%rax)
jne 0x4112
movq %rbx, %rdi
movl $0xb, %esi
callq 0x3816
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0x497c
movq %rbx, %rdi
movl $0x1, %esi
callq 0x3816
movq 0x8(%rbx), %rax
cmpl $0x10, (%rax)
jne 0x4112
movq %rbx, %rdi
movl $0x10, %esi
callq 0x3816
movq %rbx, %rdi
movl $0x1, %esi
callq 0x3816
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0x497c
jmp 0x40e1
movq %rbx, %rdi
movl $0xe, %esi
callq 0x3816
movq %rbx, %rdi
movq %r15, %rsi
callq 0x44fd
xorl %edi, %edi
movq %rax, %rsi
callq 0x13e8
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x12cb
movq %rbx, %rdi
movl $0xf, %esi
callq 0x3816
movq %r14, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r12, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13a0