LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_type_ref
static fin_ast_type_ref_t* fin_ast_parse_type_ref(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_type_ref_t* type = (fin_ast_type_ref_t*)ctx->alloc(NULL, sizeof(fin_ast_type_ref_t));
    type->module = NULL;
    type->name = fin_str_from_lex(ctx, fin_lex_consume_name(lex));
    if (fin_lex_match(lex, fin_lex_type_dot)) {
        type->module = type->name;
        type->name = fin_str_from_lex(ctx, fin_lex_consume_name(lex));
    }
    return type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
xorl %edi, %edi
movl $0x10, %esi
callq *(%r14)
movq %rax, %rbx
movq $0x0, (%rax)
movq %r15, %rdi
callq 0x5844
movq %r14, %rdi
movq %rax, %rsi
callq 0x80e4
movq %rax, 0x8(%rbx)
movq %r15, %rdi
movl $0x8, %esi
callq 0x5782
testb %al, %al
je 0x3abb
movq 0x8(%rbx), %rax
movq %rax, (%rbx)
movq %r15, %rdi
callq 0x5844
movq %r14, %rdi
movq %rax, %rsi
callq 0x80e4
movq %rax, 0x8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_expr
static fin_ast_expr_t* fin_ast_parse_expr(fin_ctx_t* ctx, fin_lex_t* lex, fin_ast_expr_t* expr) {
    if (!expr)
        expr = fin_ast_parse_cond_or_expr(ctx, lex);
    switch (fin_lex_get_type(lex)) {
        case fin_lex_type_question:
            return fin_ast_parse_cond_expr(ctx, lex, expr);
        case fin_lex_type_dot:
            return fin_ast_parse_id_expr(ctx, lex, expr);
        case fin_lex_type_l_paren:
            return fin_ast_parse_invoke_expr(ctx, lex, expr);
        case fin_lex_type_eq:
        case fin_lex_type_plus_eq:
        case fin_lex_type_minus_eq:
        case fin_lex_type_star_eq:
        case fin_lex_type_slash_eq:
        case fin_lex_type_percent_eq:
        case fin_lex_type_amp_eq:
        case fin_lex_type_pipe_eq:
        case fin_lex_type_caret_eq:
        case fin_lex_type_lt_lt_eq:
        case fin_lex_type_gt_gt_eq:
            return fin_ast_parse_assign_expr(ctx, lex, expr);
        default:
            return expr;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
jne 0x3af0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3bc2
movq %rax, %r15
movq %rbx, %rdi
callq 0x57a4
cmpl $0x2e, %eax
ja 0x3b47
movl %eax, %ecx
movabsq $0x223fc0010000, %rdx   # imm = 0x223FC0010000
btq %rcx, %rdx
jae 0x3b25
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3d5e
cmpq $0xa, %rcx
je 0x3b62
cmpq $0x2e, %rcx
jne 0x3b47
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3c8d
cmpl $0x8, %eax
jne 0x3bb6
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3c2b
xorl %edi, %edi
movl $0x20, %esi
callq *(%r14)
movq %rax, %r12
movl $0x8, (%rax)
movq %r15, 0x8(%rax)
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3985
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3bc2
movq %rax, 0x10(%r12)
movq %rbx, %rdi
movl $0xb, %esi
callq 0x3985
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3bc2
movq %rax, 0x18(%r12)
movq %r12, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_cond_or_expr
static fin_ast_expr_t* fin_ast_parse_cond_or_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* lhs = fin_ast_parse_cond_and_expr(ctx, lex);
    fin_ast_binary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_pipe_pipe))
        op = fin_ast_binary_type_or;
    else
        return lhs;
    fin_ast_binary_expr_t* bin_expr = (fin_ast_binary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_binary_expr_t));
    bin_expr->base.type = fin_ast_expr_type_binary;
    bin_expr->op = op;
    bin_expr->lhs = lhs;
    bin_expr->rhs = fin_ast_parse_cond_or_expr(ctx, lex);
    return &bin_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3edb
movq %rax, %r15
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x5782
testb %al, %al
je 0x3c1f
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movabsq $0x1100000007, %rax     # imm = 0x1100000007
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3bc2
movq %rax, 0x10(%r12)
movq %r12, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_id_expr
static fin_ast_expr_t* fin_ast_parse_id_expr(fin_ctx_t* ctx, fin_lex_t* lex, fin_ast_expr_t* primary) {
    fin_ast_id_expr_t* id_expr = (fin_ast_id_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_id_expr_t));
    id_expr->base.type = fin_ast_expr_type_id;
    id_expr->primary = primary;
    id_expr->name = fin_str_from_lex(ctx, fin_lex_consume_name(lex));
    if (fin_lex_match(lex, fin_lex_type_dot))
        return fin_ast_parse_id_expr(ctx, lex, &id_expr->base);
    return &id_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq %r15, %r12
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r15
movl $0x0, (%rax)
movq %r12, 0x8(%rax)
movq %rbx, %rdi
callq 0x5844
movq %r14, %rdi
movq %rax, %rsi
callq 0x80e4
movq %rax, 0x10(%r15)
movq %rbx, %rdi
movl $0x8, %esi
callq 0x5782
testb %al, %al
jne 0x3c3f
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_invoke_expr
static fin_ast_expr_t* fin_ast_parse_invoke_expr(fin_ctx_t* ctx, fin_lex_t* lex, fin_ast_expr_t* id) {
    fin_ast_invoke_expr_t* invoke_expr = (fin_ast_invoke_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_invoke_expr_t));
    invoke_expr->base.type = fin_ast_expr_type_invoke;
    invoke_expr->id = id;
    fin_ast_expect(lex, fin_lex_type_l_paren);
    fin_ast_arg_expr_t** tail = &invoke_expr->args;
    *tail = NULL;
    while (!fin_lex_match(lex, fin_lex_type_r_paren)) {
        if (invoke_expr->args)
            fin_ast_expect(lex, fin_lex_type_comma);
        *tail = fin_ast_parse_arg_expr(ctx, lex);
        tail = &(*tail)->next;
    }
    return &invoke_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r15
movl $0xa, (%rax)
movq %r12, 0x8(%rax)
movq %rbx, %rdi
movl $0x2e, %esi
callq 0x3985
movq %r15, -0x30(%rbp)
movq $0x0, 0x10(%r15)
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x5782
testb %al, %al
jne 0x3d4b
movq -0x30(%rbp), %r15
addq $0x10, %r15
movq %r15, %r13
cmpq $0x0, (%r15)
je 0x3d03
movq %rbx, %rdi
movl $0x9, %esi
callq 0x3985
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3ac9
movq %rax, %r12
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movl $0x9, (%rax)
movq %r12, 0x8(%rax)
leaq 0x10(%rax), %r12
movq $0x0, 0x10(%rax)
movq %rax, (%r13)
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x5782
movq %r12, %r13
testb %al, %al
je 0x3cf0
movq -0x30(%rbp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_cond_and_expr
static fin_ast_expr_t* fin_ast_parse_cond_and_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* lhs = fin_ast_parse_or_expr(ctx, lex);
    fin_ast_binary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_amp_amp))
        op = fin_ast_binary_type_and;
    else
        return lhs;
    fin_ast_binary_expr_t* bin_expr = (fin_ast_binary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_binary_expr_t));
    bin_expr->base.type = fin_ast_expr_type_binary;
    bin_expr->op = op;
    bin_expr->lhs = lhs;
    bin_expr->rhs = fin_ast_parse_cond_and_expr(ctx, lex);
    return &bin_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3f44
movq %rax, %r15
movq %rbx, %rdi
movl $0x1b, %esi
callq 0x5782
testb %al, %al
je 0x3f38
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movabsq $0x1000000007, %rax     # imm = 0x1000000007
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3edb
movq %rax, 0x10(%r12)
movq %r12, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_or_expr
static fin_ast_expr_t* fin_ast_parse_or_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* lhs = fin_ast_parse_xor_expr(ctx, lex);
    fin_ast_binary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_pipe))
        op = fin_ast_binary_type_bor;
    else
        return lhs;
    fin_ast_binary_expr_t* bin_expr = (fin_ast_binary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_binary_expr_t));
    bin_expr->base.type = fin_ast_expr_type_binary;
    bin_expr->op = op;
    bin_expr->lhs = lhs;
    bin_expr->rhs = fin_ast_parse_or_expr(ctx, lex);
    return &bin_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3fad
movq %rax, %r15
movq %rbx, %rdi
movl $0x16, %esi
callq 0x5782
testb %al, %al
je 0x3fa1
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movabsq $0xe00000007, %rax      # imm = 0xE00000007
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3f44
movq %rax, 0x10(%r12)
movq %r12, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_xor_expr
static fin_ast_expr_t* fin_ast_parse_xor_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* lhs = fin_ast_parse_and_expr(ctx, lex);
    fin_ast_binary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_caret))
        op = fin_ast_binary_type_bxor;
    else
        return lhs;
    fin_ast_binary_expr_t* bin_expr = (fin_ast_binary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_binary_expr_t));
    bin_expr->base.type = fin_ast_expr_type_binary;
    bin_expr->op = op;
    bin_expr->lhs = lhs;
    bin_expr->rhs = fin_ast_parse_xor_expr(ctx, lex);
    return &bin_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4016
movq %rax, %r15
movq %rbx, %rdi
movl $0xd, %esi
callq 0x5782
testb %al, %al
je 0x400a
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movabsq $0xf00000007, %rax      # imm = 0xF00000007
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3fad
movq %rax, 0x10(%r12)
movq %r12, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_and_expr
static fin_ast_expr_t* fin_ast_parse_and_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* lhs = fin_ast_parse_equality_expr(ctx, lex);
    fin_ast_binary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_amp))
        op = fin_ast_binary_type_eq;
    else
        return lhs;
    fin_ast_binary_expr_t* bin_expr = (fin_ast_binary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_binary_expr_t));
    bin_expr->base.type = fin_ast_expr_type_binary;
    bin_expr->op = op;
    bin_expr->lhs = lhs;
    bin_expr->rhs = fin_ast_parse_and_expr(ctx, lex);
    return &bin_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x407f
movq %rax, %r15
movq %rbx, %rdi
movl $0xf, %esi
callq 0x5782
testb %al, %al
je 0x4073
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movabsq $0xb00000007, %rax      # imm = 0xB00000007
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4016
movq %rax, 0x10(%r12)
movq %r12, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_equality_expr
static fin_ast_expr_t* fin_ast_parse_equality_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* lhs = fin_ast_parse_relational_expr(ctx, lex);
    fin_ast_binary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_eq_eq))
        op = fin_ast_binary_type_eq;
    else if (fin_lex_match(lex, fin_lex_type_bang_eq))
        op = fin_ast_binary_type_neq;
    else
        return lhs;
    fin_ast_binary_expr_t* bin_expr = (fin_ast_binary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_binary_expr_t));
    bin_expr->base.type = fin_ast_expr_type_binary;
    bin_expr->op = op;
    bin_expr->lhs = lhs;
    bin_expr->rhs = fin_ast_parse_equality_expr(ctx, lex);
    return &bin_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4193
movq %rax, %r15
movq %rbx, %rdi
movl $0x26, %esi
callq 0x5782
movl $0x7, %r13d
testb %al, %al
jne 0x40f7
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x5782
movl $0x9, %r13d
testb %al, %al
jne 0x40f7
movq %rbx, %rdi
movl $0x28, %esi
callq 0x5782
movl $0x8, %r13d
testb %al, %al
jne 0x40f7
movq %rbx, %rdi
movl $0x2c, %esi
callq 0x5782
movl $0xa, %r13d
testb %al, %al
je 0x4125
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movl $0x7, (%rax)
movl %r13d, 0x4(%rax)
movq %r15, 0x8(%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4193
movq %rax, 0x10(%r12)
movq %r12, %r15
movq %rbx, %rdi
movl $0x1c, %esi
callq 0x5782
movl $0xb, %r13d
testb %al, %al
jne 0x4153
movq %rbx, %rdi
movl $0x1d, %esi
callq 0x5782
movl $0xc, %r13d
testb %al, %al
je 0x4181
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movl $0x7, (%rax)
movl %r13d, 0x4(%rax)
movq %r15, 0x8(%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x407f
movq %rax, 0x10(%r12)
movq %r12, %r15
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/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_shift_expr
static fin_ast_expr_t* fin_ast_parse_shift_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* lhs = fin_ast_parse_additive_expr(ctx, lex);
    fin_ast_binary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_lt_lt))
        op = fin_ast_binary_type_shl;
    else if (fin_lex_match(lex, fin_lex_type_gt_gt))
        op = fin_ast_binary_type_shr;
    else
        return lhs;
    fin_ast_binary_expr_t* bin_expr = (fin_ast_binary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_binary_expr_t));
    bin_expr->base.type = fin_ast_expr_type_binary;
    bin_expr->op = op;
    bin_expr->lhs = lhs;
    bin_expr->rhs = fin_ast_parse_shift_expr(ctx, lex);
    return &bin_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x421d
movq %rax, %r15
movq %rbx, %rdi
movl $0x27, %esi
callq 0x5782
movl $0x5, %r13d
testb %al, %al
jne 0x41dd
movq %rbx, %rdi
movl $0x2b, %esi
callq 0x5782
movl $0x6, %r13d
testb %al, %al
je 0x420b
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movl $0x7, (%rax)
movl %r13d, 0x4(%rax)
movq %r15, 0x8(%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4193
movq %rax, 0x10(%r12)
movq %r12, %r15
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/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_additive_expr
static fin_ast_expr_t* fin_ast_parse_additive_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* lhs = fin_ast_parse_multiplicative_expr(ctx, lex);
    fin_ast_binary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_plus))
        op = fin_ast_binary_type_add;
    else if (fin_lex_match(lex, fin_lex_type_minus))
        op = fin_ast_binary_type_sub;
    else
        return lhs;
    fin_ast_binary_expr_t* bin_expr = (fin_ast_binary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_binary_expr_t));
    bin_expr->base.type = fin_ast_expr_type_binary;
    bin_expr->op = op;
    bin_expr->lhs = lhs;
    bin_expr->rhs = fin_ast_parse_additive_expr(ctx, lex);
    return &bin_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x42a4
movq %rax, %r15
movq %rbx, %rdi
movl $0x12, %esi
callq 0x5782
xorl %r13d, %r13d
testb %al, %al
jne 0x4264
movq %rbx, %rdi
movl $0x13, %esi
callq 0x5782
movl $0x1, %r13d
testb %al, %al
je 0x4292
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movl $0x7, (%rax)
movl %r13d, 0x4(%rax)
movq %r15, 0x8(%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x421d
movq %rax, 0x10(%r12)
movq %r12, %r15
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/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_multiplicative_expr
static fin_ast_expr_t* fin_ast_parse_multiplicative_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* lhs = fin_ast_parse_unary_expr(ctx, lex);
    fin_ast_binary_type_t op;
    if (fin_lex_match(lex, fin_lex_type_star))
        op = fin_ast_binary_type_mul;
    else if (fin_lex_match(lex, fin_lex_type_slash))
        op = fin_ast_binary_type_div;
    else if (fin_lex_match(lex, fin_lex_type_percent))
        op = fin_ast_binary_type_mod;
    else
        return lhs;
    fin_ast_binary_expr_t* bin_expr = (fin_ast_binary_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_binary_expr_t));
    bin_expr->base.type = fin_ast_expr_type_binary;
    bin_expr->op = op;
    bin_expr->lhs = lhs;
    bin_expr->rhs = fin_ast_parse_multiplicative_expr(ctx, lex);
    return &bin_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4345
movq %rax, %r15
movq %rbx, %rdi
movl $0x14, %esi
callq 0x5782
movl $0x2, %r13d
testb %al, %al
jne 0x4305
movq %rbx, %rdi
movl $0x15, %esi
callq 0x5782
movl $0x3, %r13d
testb %al, %al
jne 0x4305
movq %rbx, %rdi
movl $0x17, %esi
callq 0x5782
movl $0x4, %r13d
testb %al, %al
je 0x4333
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r12
movl $0x7, (%rax)
movl %r13d, 0x4(%rax)
movq %r15, 0x8(%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42a4
movq %rax, 0x10(%r12)
movq %r12, %r15
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/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_const_expr
static fin_ast_expr_t* fin_ast_parse_const_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    if (fin_lex_get_type(lex) == fin_lex_type_bool) {
        fin_ast_bool_expr_t* bool_expr = (fin_ast_bool_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_bool_expr_t));
        bool_expr->base.type = fin_ast_expr_type_bool;
        bool_expr->value = fin_lex_consume_bool(lex);
        return &bool_expr->base;
    }
    else if (fin_lex_get_type(lex) == fin_lex_type_int) {
        fin_ast_int_expr_t* int_expr = (fin_ast_int_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_int_expr_t));
        int_expr->base.type = fin_ast_expr_type_int;
        int_expr->value = fin_lex_consume_int(lex);
        return &int_expr->base;
    }
    else if (fin_lex_get_type(lex) == fin_lex_type_float) {
        fin_ast_float_expr_t* float_expr = (fin_ast_float_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_float_expr_t));
        float_expr->base.type = fin_ast_expr_type_float;
        float_expr->value = fin_lex_consume_float(lex);
        return &float_expr->base;
    }
    else if (fin_lex_get_type(lex) == fin_lex_type_string) {
        fin_ast_str_expr_t* str_expr = (fin_ast_str_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_str_expr_t));
        str_expr->base.type = fin_ast_expr_type_str;
        str_expr->value = fin_str_from_lex(ctx, fin_lex_consume_string(lex));
        return &str_expr->base;
    }
    else {
        assert(0);
        return NULL;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x57a4
testl %eax, %eax
je 0x450a
movq %rbx, %rdi
callq 0x57a4
cmpl $0x1, %eax
jne 0x452b
xorl %edi, %edi
movl $0x10, %esi
callq *(%r14)
movq %rax, %r15
movl $0x2, (%rax)
movq %rbx, %rdi
callq 0x57cb
jmp 0x458e
xorl %edi, %edi
movl $0x8, %esi
callq *(%r14)
movq %rax, %r15
movl $0x1, (%rax)
movq %rbx, %rdi
callq 0x57ad
movb %al, 0x4(%r15)
jmp 0x4592
movq %rbx, %rdi
callq 0x57a4
cmpl $0x2, %eax
jne 0x455b
xorl %edi, %edi
movl $0x10, %esi
callq *(%r14)
movq %rax, %r15
movl $0x3, (%rax)
movq %rbx, %rdi
callq 0x57f8
movsd %xmm0, 0x8(%r15)
jmp 0x4592
movq %rbx, %rdi
callq 0x57a4
cmpl $0x3, %eax
jne 0x45a0
xorl %edi, %edi
movl $0x10, %esi
callq *(%r14)
movq %rax, %r15
movl $0x4, (%rax)
movq %rbx, %rdi
callq 0x5825
movq %r14, %rdi
movq %rax, %rsi
callq 0x80e4
movq %rax, 0x8(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5b1a(%rip), %rdi      # 0xa0c1
leaq 0x5b15(%rip), %rsi      # 0xa0c3
leaq 0x5b4d(%rip), %rcx      # 0xa102
movl $0x88, %edx
callq 0x3120
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_str_interp_expr
static fin_ast_expr_t* fin_ast_parse_str_interp_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_str_interp_expr_t* expr = NULL;
    fin_ast_str_interp_expr_t** tail = &expr;
    fin_ast_expect(lex, fin_lex_type_quot);
    while (!fin_lex_match(lex, fin_lex_type_quot)) {
        fin_ast_expr_t* next = NULL;
        if (fin_lex_get_type(lex) == fin_lex_type_string)
            next = fin_ast_parse_const_expr(ctx, lex);
        else if (fin_lex_match(lex, fin_lex_type_l_str_interp)) {
            next = fin_ast_parse_expr(ctx, lex, NULL);
            fin_ast_expect(lex, fin_lex_type_r_str_interp);
        }
        *tail = (fin_ast_str_interp_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_str_interp_expr_t));
        (*tail)->base.type = fin_ast_expr_type_str_interp;
        (*tail)->expr = next;
        (*tail)->next = NULL;
        tail = &(*tail)->next;
    }
    return &expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, -0x28(%rbp)
movq %rsi, %rdi
movl $0x5, %esi
callq 0x3985
movq %rbx, %rdi
movl $0x5, %esi
callq 0x5782
testb %al, %al
jne 0x4693
leaq -0x28(%rbp), %r12
movq %rbx, %rdi
callq 0x57a4
cmpl $0x3, %eax
jne 0x461f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44c1
movq %rax, %r15
jmp 0x4652
movq %rbx, %rdi
movl $0x6, %esi
callq 0x5782
testb %al, %al
je 0x464f
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3ac9
movq %rax, %r15
movq %rbx, %rdi
movl $0x7, %esi
callq 0x3985
jmp 0x4652
xorl %r15d, %r15d
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, (%r12)
movl $0x5, (%rax)
movq %r15, 0x8(%rax)
movq (%r12), %rax
movq $0x0, 0x10(%rax)
movq (%r12), %r12
addq $0x10, %r12
movq %rbx, %rdi
movl $0x5, %esi
callq 0x5782
testb %al, %al
je 0x4602
movq -0x28(%rbp), %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_block_stmt
static fin_ast_block_stmt_t* fin_ast_parse_block_stmt(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_block_stmt_t* block = (fin_ast_block_stmt_t*)ctx->alloc(NULL, sizeof(fin_ast_block_stmt_t));
    block->base.type = fin_ast_stmt_type_block;
    block->base.next = NULL;
    fin_ast_expect(lex, fin_lex_type_l_brace);
    fin_ast_stmt_t** tail = &block->stmts;
    *tail = NULL;
    while (!fin_lex_match(lex, fin_lex_type_r_brace)) {
        *tail = fin_ast_parse_stmt(ctx, lex);
        tail = &(*tail)->next;
    }
    return block;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r15
movl $0x7, (%rax)
movq %r12, 0x8(%rax)
movq %rbx, %rdi
movl $0x32, %esi
callq 0x3985
movq %r12, 0x10(%r15)
movq %rbx, %rdi
movl $0x33, %esi
callq 0x5782
testb %al, %al
jne 0x4725
movq %r15, %r13
addq $0x10, %r13
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4737
movq %rax, %r12
movq %rax, (%r13)
addq $0x8, %r12
movq %rbx, %rdi
movl $0x33, %esi
callq 0x5782
movq %r12, %r13
testb %al, %al
je 0x46fb
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/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_expr_stmt
static fin_ast_stmt_t* fin_ast_parse_expr_stmt(fin_ctx_t* ctx, fin_lex_t* lex, fin_ast_expr_t* expr) {
    if (expr == NULL)
        expr = fin_ast_parse_expr(ctx, lex, NULL);
    fin_ast_expr_stmt_t* stmt = (fin_ast_expr_stmt_t*)ctx->alloc(NULL, sizeof(fin_ast_expr_stmt_t));
    stmt->base.type = fin_ast_stmt_type_expr;
    stmt->base.next = NULL;
    stmt->expr = expr;
    fin_ast_expect(lex, fin_lex_type_semicolon);
    return &stmt->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
jne 0x4bda
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3ac9
movq %rax, %r15
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movq %rax, %r14
movl $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq %r15, 0x10(%rax)
movq %rbx, %rdi
movl $0xc, %esi
callq 0x3985
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_init_expr
static fin_ast_expr_t* fin_ast_parse_init_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_init_expr_t* init_expr = (fin_ast_init_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_init_expr_t));
    init_expr->base.type = fin_ast_expr_type_init;
    fin_ast_expect(lex, fin_lex_type_l_brace);
    fin_ast_arg_expr_t** tail = &init_expr->args;
    *tail = NULL;
    while (!fin_lex_match(lex, fin_lex_type_r_brace)) {
        if (init_expr->args)
            fin_ast_expect(lex, fin_lex_type_comma);
        *tail = fin_ast_parse_arg_expr(ctx, lex);
        tail = &(*tail)->next;
    }
    return &init_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %edi, %edi
movl $0x10, %esi
callq *(%r14)
movq %rax, %r15
movl $0xb, (%rax)
movq %rbx, %rdi
movl $0x32, %esi
callq 0x3985
movq %r15, -0x30(%rbp)
movq $0x0, 0x8(%r15)
movq %rbx, %rdi
movl $0x33, %esi
callq 0x5782
testb %al, %al
jne 0x4ccb
movq -0x30(%rbp), %r15
addq $0x8, %r15
movq %r15, %r13
cmpq $0x0, (%r15)
je 0x4c83
movq %rbx, %rdi
movl $0x9, %esi
callq 0x3985
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3ac9
movq %rax, %r12
xorl %edi, %edi
movl $0x18, %esi
callq *(%r14)
movl $0x9, (%rax)
movq %r12, 0x8(%rax)
leaq 0x10(%rax), %r12
movq $0x0, 0x10(%rax)
movq %rax, (%r13)
movq %rbx, %rdi
movl $0x33, %esi
callq 0x5782
movq %r12, %r13
testb %al, %al
je 0x4c70
movq -0x30(%rbp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_param_destroy
static void fin_ast_param_destroy(fin_ast_module_t* mod, fin_ast_param_t* param) {
    if (!param)
        return;
    fin_ast_param_destroy(mod, param->next);
    fin_ast_type_ref_destroy(mod, param->type);
    fin_str_destroy(mod->ctx, param->name);
    mod->ctx->alloc(param, 0);
}

// Assembly:
testq %rsi, %rsi
je 0x4d21
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rsi
callq 0x4cde
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4e09
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0x82ed
movq (%r14), %rax
movq (%rax), %rax
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_type_ref_destroy
static void fin_ast_type_ref_destroy(fin_ast_module_t* mod, fin_ast_type_ref_t* type) {
    fin_str_destroy(mod->ctx, type->name);
    if (type->module)
        fin_str_destroy(mod->ctx, type->module);
    mod->ctx->alloc(type, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%rsi), %rsi
callq 0x82ed
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x4e32
movq (%r14), %rdi
callq 0x82ed
movq (%r14), %rax
movq (%rax), %rax
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_enum_val_destroy
static void fin_ast_enum_val_destroy(fin_ast_module_t* mod, fin_ast_enum_val_t* val) {
    if (!val)
        return;
    fin_ast_enum_val_destroy(mod, val->next);
    fin_str_destroy(mod->ctx, val->name);
    fin_ast_expr_destroy(mod, val->expr);
    mod->ctx->alloc(val, 0);
}

// Assembly:
testq %rsi, %rsi
je 0x4f37
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rsi
callq 0x4ef4
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0x82ed
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4e43
movq (%r14), %rax
movq (%rax), %rax
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_field_destroy
static void fin_ast_field_destroy(fin_ast_module_t* mod, fin_ast_field_t* field) {
    if (!field)
        return;
    fin_ast_field_destroy(mod, field->next);
    fin_str_destroy(mod->ctx, field->name);
    fin_ast_type_ref_destroy(mod, field->type);
    mod->ctx->alloc(field, 0);
}

// Assembly:
testq %rsi, %rsi
je 0x4f7b
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rsi
callq 0x4f38
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0x82ed
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4e09
movq (%r14), %rax
movq (%rax), %rax
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ctx.c
// Function: fin_ctx_create
fin_ctx_t* fin_ctx_create(fin_alloc alloc) {
    fin_ctx_t* ctx = (fin_ctx_t*)alloc(NULL, sizeof(fin_ctx_t));
    ctx->alloc = alloc;
    ctx->pool = fin_str_pool_create(alloc);
    ctx->mod = NULL;
    fin_io_register(ctx); // this should be optional
    fin_math_register(ctx); // this should be optional
    fin_time_register(ctx); // this should be optional
    fin_std_register(ctx); // this should be optional
    return ctx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
movl $0x18, %esi
callq *%rbx
movq %rax, %r14
movq %rbx, (%rax)
movq %rbx, %rdi
callq 0x809a
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
movq %r14, %rdi
callq 0x890c
movq %r14, %rdi
callq 0x89d8
movq %r14, %rdi
callq 0x9124
movq %r14, %rdi
callq 0x8d58
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ctx.c
// Function: fin_allocator
static void* fin_allocator(void* ptr, unsigned int size) {
    if (ptr) {
        if (size) {
            return realloc(ptr, size);
        }
        else {
            free(ptr);
            return NULL;
        }
    }
    else if (size) {
        return malloc(size);
    }
    return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x4ff2
testl %esi, %esi
je 0x4ffd
movl %esi, %esi
jmp 0x3230
testl %esi, %esi
je 0x5007
movl %esi, %edi
jmp 0x31f0
pushq %rbp
movq %rsp, %rbp
callq 0x3030
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ctx.c
// Function: fin_ctx_destroy
void fin_ctx_destroy(fin_ctx_t* ctx) {
    fin_mod_t* mod = ctx->mod;
    while (mod) {
        fin_mod_t* tmp = mod;
        mod = mod->next;
        fin_mod_destroy(ctx, tmp);
    }

    fin_str_pool_destroy(ctx->pool);
    ctx->alloc(ctx, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rsi
testq %rsi, %rsi
je 0x5031
movq 0x40(%rsi), %r14
movq %rbx, %rdi
callq 0x63b7
movq %r14, %rsi
testq %r14, %r14
jne 0x501d
movq 0x8(%rbx), %rdi
callq 0x80bd
movq (%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ctx.c
// Function: fin_ctx_eval_str
void fin_ctx_eval_str(fin_ctx_t* ctx, const char* cstr) {
    fin_mod_t* mod = fin_mod_compile(ctx, cstr);
    if (mod && mod->entry) {
        fin_vm_t* vm = fin_vm_create(ctx);
        fin_vm_invoke(vm, mod->entry);
        fin_vm_destroy(vm);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x5e03
testq %rax, %rax
je 0x5089
movq %rax, %r14
cmpq $0x0, 0x38(%rax)
je 0x5089
movq %rbx, %rdi
callq 0x8831
movq %rax, %rbx
movq 0x38(%r14), %rsi
movq %rax, %rdi
callq 0x887a
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x8867
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_ctx.c
// Function: fin_ctx_eval_file
void fin_ctx_eval_file(fin_ctx_t* ctx, const char* path) {
    FILE* fp = fopen(path, "rb");
    if (!fp)
        return;

    fseek(fp, 0, SEEK_END);
    int32_t file_size = (int32_t)ftell(fp);
    fseek(fp, 0, SEEK_SET);

    char* buffer = (char*)ctx->alloc(NULL, file_size + 1);
    assert(buffer);
    int32_t read = (int32_t)fread(buffer, 1, file_size, fp);
    buffer[file_size] = '\0';
    assert(read == file_size);
    fclose(fp);

    fin_ctx_eval_str(ctx, buffer);

    ctx->alloc(buffer, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x509c(%rip), %rsi      # 0xa145
movq %rax, %rdi
callq 0x3250
testq %rax, %rax
je 0x513e
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x3220
movq %r14, %rdi
callq 0x31b0
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3220
leal 0x1(%r15), %esi
xorl %edi, %edi
callq *(%rbx)
testq %rax, %rax
je 0x514d
movq %rax, %r12
movslq %r15d, %r13
movl $0x1, %esi
movq %rax, %rdi
movq %r13, %rdx
movq %r14, %rcx
callq 0x30a0
movb $0x0, (%r12,%r13)
cmpl %r15d, %eax
jne 0x516c
movq %r14, %rdi
callq 0x30f0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5048
movq (%rbx), %rax
movq %r12, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4ff4(%rip), %rdi      # 0xa148
leaq 0x4ff4(%rip), %rsi      # 0xa14f
leaq 0x4ffb(%rip), %rcx      # 0xa15d
movl $0x51, %edx
callq 0x3120
leaq 0x501c(%rip), %rdi      # 0xa18f
leaq 0x4fd5(%rip), %rsi      # 0xa14f
leaq 0x4fdc(%rip), %rcx      # 0xa15d
movl $0x54, %edx
callq 0x3120
nop
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_lex.c
// Function: fin_lex_create
fin_lex_t* fin_lex_create(fin_alloc alloc, const char* cstr) {
    fin_lex_t* lex = (fin_lex_t*)alloc(NULL, sizeof(fin_lex_t));
    lex->cstr = cstr;
    lex->line = 1;
    lex->state_idx = 0;
    lex->states[0].type = fin_lex_state_type_global;
    lex->states[0].cstr = cstr;
    fin_lex_next(lex);
    return lex;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rax
xorl %r15d, %r15d
xorl %edi, %edi
movl $0x130, %esi            # imm = 0x130
callq *%rax
movq %rax, %r14
movq %rbx, (%rax)
movl $0x1, 0x8(%rax)
movl %r15d, 0x128(%rax)
movl %r15d, 0x28(%rax)
movq %rbx, 0x30(%rax)
movq %rax, %rdi
callq 0x51da
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_lex.c
// Function: fin_lex_match
bool fin_lex_match(fin_lex_t* lex, fin_lex_type_t type) {
    if (lex->token.type == type) {
        fin_lex_next(lex);
        return true;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl 0x10(%rdi), %r14d
cmpl %esi, %r14d
jne 0x5799
callq 0x51da
cmpl %ebx, %r14d
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_lex.c
// Function: fin_lex_consume_string
fin_lex_str_t fin_lex_consume_string(fin_lex_t* lex) {
    fin_lex_str_t value;
    value.cstr = lex->token.cstr;
    value.len = lex->token.len;
    fin_lex_next(lex);
    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x18(%rdi), %rbx
movl 0x20(%rdi), %r14d
callq 0x51da
movq %rbx, %rax
movl %r14d, %edx
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_lex.c
// Function: fin_lex_create_name_token
static fin_lex_token_t fin_lex_create_name_token(fin_lex_t* lex) {
    fin_lex_token_t token;
    token.cstr = lex->cstr - 1;
    token.line = lex->line;

    while (fin_lex_is_name(*lex->cstr) || fin_lex_is_digit(*lex->cstr))
        lex->cstr++;
    token.len = (int32_t)(lex->cstr - token.cstr);

    for (int32_t i=0; i<FIN_COUNT_OF(fin_lex_keywords); i++) {
        const char* keyword = fin_lex_keywords[i].cstr;
        if (strncmp(keyword, token.cstr, token.len) == 0 && keyword[token.len] == '\0') {
            token.type = fin_lex_keywords[i].type;
            return token;
        }
    }

    token.type = fin_lex_type_name;
    return token;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rsi), %rdx
leaq -0x1(%rdx), %rax
movq %rax, -0x38(%rbp)
movq %rax, 0x8(%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x14(%rdi)
movq (%rsi), %rax
leaq 0x1(%rax), %rcx
movl %ecx, %r15d
subl %edx, %r15d
shlq $0x20, %r15
subl %edx, %eax
incl %eax
movabsq $0x100000000, %rdx      # imm = 0x100000000
movb -0x1(%rcx), %r10b
cmpb $0x5f, %r10b
sete %r8b
leal -0x61(%r10), %r9d
cmpb $0x1a, %r9b
setb %r9b
orb %r8b, %r9b
jne 0x5913
leal -0x41(%r10), %r8d
cmpb $0x1a, %r8b
setae %r8b
addb $-0x30, %r10b
cmpb $0xa, %r10b
setae %r9b
testb %r9b, %r8b
jne 0x5920
movq %rcx, (%rsi)
addq %rdx, %r15
incl %eax
incq %rcx
jmp 0x58d9
movq %rdi, -0x30(%rbp)
movl %eax, 0x10(%rdi)
sarq $0x20, %r15
leaq 0x8ea6(%rip), %r13      # 0xe7d8
xorl %ebx, %ebx
xorl %r14d, %r14d
movq -0x8(%r13), %r12
movq %r12, %rdi
movq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0x3080
testl %eax, %eax
jne 0x5955
cmpb $0x0, (%r12,%r15)
je 0x5988
cmpq $0xd, %rbx
leaq 0x1(%rbx), %rax
setae %r14b
addq $0x10, %r13
movq %rax, %rbx
cmpq $0xe, %rax
jne 0x5937
movl $0x4, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, %r14b
jne 0x596e
movl (%r13), %ecx
jmp 0x5973
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_lex.c
// Function: fin_lex_create_number_token
static fin_lex_token_t fin_lex_create_number_token(fin_lex_t* lex) {
    fin_lex_token_t token;
    token.cstr = lex->cstr - 1;
    token.line = lex->line;

    bool is_float = false;
    while (fin_lex_is_digit(*lex->cstr))
        lex->cstr++;
    if (fin_lex_match_char(lex, '.'))
        is_float = true;
    while (fin_lex_is_digit(*lex->cstr))
        lex->cstr++;

    token.type = is_float ? fin_lex_type_float : fin_lex_type_int;
    return token;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq (%rsi), %rcx
decq %rcx
movq %rcx, 0x8(%rdi)
movl 0x8(%rsi), %ecx
movl %ecx, 0x14(%rdi)
movq (%rsi), %rdx
movb (%rdx), %cl
leal -0x30(%rcx), %edi
cmpb $0x9, %dil
ja 0x59d0
incq %rdx
movq %rdx, (%rsi)
movb (%rdx), %cl
leal -0x30(%rcx), %edi
incq %rdx
cmpb $0xa, %dil
jb 0x59bc
decq %rdx
cmpb $0x2e, %cl
jne 0x59db
incq %rdx
movq %rdx, (%rsi)
movq (%rsi), %rdx
movb (%rdx), %dil
addb $-0x30, %dil
cmpb $0x9, %dil
ja 0x5a01
incq %rdx
movq %rdx, (%rsi)
movb (%rdx), %dil
addb $-0x30, %dil
incq %rdx
cmpb $0xa, %dil
jb 0x59ee
xorl %edx, %edx
cmpb $0x2e, %cl
sete %dl
incl %edx
movl %edx, (%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_lex.c
// Function: fin_lex_error
static void fin_lex_error(fin_lex_t* lex, const char* format, ...) {
    char message[256];
    va_list args;
    va_start(args, format);
    vsprintf(message, format, args);
    va_end(args);
    printf("<file>:%d:%d error: %s\n", lex->line, 0, message);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, %rbx
leaq -0xe0(%rbp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x5a64
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq -0x30(%rbp), %rdx
movq %rdi, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
leaq -0x1e0(%rbp), %r14
movq %r14, %rdi
callq 0x3240
movl 0x8(%rbx), %esi
leaq 0x4871(%rip), %rdi      # 0xa30b
xorl %edx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x3110
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_register
static void fin_mod_register(fin_ctx_t* ctx, fin_mod_t* mod) {
    mod->next = ctx->mod;
    ctx->mod = mod;

    for (int32_t i=0; i<mod->binds_count; i++) {
        fin_mod_t* m = ctx->mod;
        while (m) {
            for (int32_t f=0; f<m->funcs_count; f++) {
                if (m->funcs[f].sign == mod->binds[i].sign) {
                    mod->binds[i].func = &m->funcs[f];
                    break;
                }
            }
            if (mod->binds[i].func)
                break;
            m = m->next;
        }
        if (!mod->binds[i].func) {
            printf("Unresolved function %s\n", fin_str_cstr(mod->binds[i].sign));
            assert(mod->binds[i].func);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rax
movq %rax, 0x40(%rsi)
movq %rsi, 0x10(%rdi)
cmpl $0x0, 0x34(%rsi)
jle 0x5dd5
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x46f3(%rip), %r15      # 0xa427
xorl %r12d, %r12d
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x5d8e
movq 0x20(%rbx), %rdx
movq %r12, %rcx
shlq $0x4, %rcx
addq %rcx, %rdx
addq $0x8, %rdx
movslq 0x2c(%rax), %rsi
testq %rsi, %rsi
jle 0x5d7f
movq 0x10(%rax), %rdi
movq 0x20(%rbx), %r8
movq (%r8,%rcx), %r9
addq %rcx, %r8
cmpq %r9, 0x10(%rdi)
je 0x5d7b
addq $0x38, %rdi
decq %rsi
jne 0x5d6a
jmp 0x5d7f
movq %rdi, 0x8(%r8)
cmpq $0x0, (%rdx)
jne 0x5d8e
movq 0x40(%rax), %rax
testq %rax, %rax
jne 0x5d52
movq 0x20(%rbx), %rax
movq %r12, %r13
shlq $0x4, %r13
cmpq $0x0, 0x8(%rax,%r13)
jne 0x5dc5
addq %r13, %rax
movq (%rax), %rdi
callq 0x8477
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x3110
movq 0x20(%rbx), %rax
cmpq $0x0, 0x8(%rax,%r13)
je 0x5de4
incq %r12
movslq 0x34(%rbx), %rax
cmpq %rax, %r12
jl 0x5d37
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4654(%rip), %rdi      # 0xa43f
leaq 0x4660(%rip), %rsi      # 0xa452
leaq 0x4667(%rip), %rcx      # 0xa460
movl $0x307, %edx            # imm = 0x307
callq 0x3120
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_find_func
static fin_mod_func_t* fin_mod_find_func(fin_ctx_t* ctx, fin_mod_t* mod, fin_str_t* sign) {
    for (int32_t i=0; i<mod->funcs_count; i++) {
        if (mod->funcs[i].sign == sign)
            return &mod->funcs[i];
    }
    fin_mod_t* m = ctx->mod;
    while (m) {
        for (int32_t i=0; i<m->funcs_count; i++) {
            if (m->funcs[i].sign == sign)
                return &m->funcs[i];
        }
        m = m->next;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x2c(%rsi), %rcx
testq %rcx, %rcx
setg %r8b
jle 0x634a
movq 0x10(%rsi), %rax
cmpq %rdx, 0x10(%rax)
je 0x6350
movl $0x1, %esi
cmpq %rsi, %rcx
je 0x634c
leaq 0x38(%rax), %r9
incq %rsi
cmpq %rdx, 0x48(%rax)
movq %r9, %rax
jne 0x6326
decq %rsi
cmpq %rcx, %rsi
setb %r8b
movq %r9, %rax
jmp 0x6350
jmp 0x6350
seta %r8b
testb %r8b, %r8b
jne 0x63b5
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x63b3
movslq 0x2c(%rcx), %rsi
testq %rsi, %rsi
setg %r8b
jle 0x63a8
movq 0x10(%rcx), %rdi
cmpq %rdx, 0x10(%rdi)
je 0x6396
movl $0x1, %r10d
movq %r10, %r8
cmpq %r10, %rsi
je 0x639b
leaq 0x1(%r8), %r10
leaq 0x38(%rdi), %r9
cmpq %rdx, 0x48(%rdi)
movq %r9, %rdi
jne 0x637b
jmp 0x639e
movq %rdi, %rax
jmp 0x63a8
movq %rax, %r9
cmpq %rsi, %r8
setb %r8b
movq %r9, %rax
testb %r8b, %r8b
jne 0x63b5
movq 0x40(%rcx), %rcx
jmp 0x6359
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_destroy
void fin_mod_destroy(fin_ctx_t* ctx, fin_mod_t* mod) {
    if (mod->name)
        fin_str_destroy(ctx, mod->name);
    for (int32_t i=0; i<mod->types_count; i++) {
        fin_mod_type_t* type = &mod->types[i];
        fin_str_destroy(ctx, type->name);
        for (int32_t j=0; j<type->fields_count; j++) {
            fin_str_destroy(ctx, type->fields[j].name);
            fin_str_destroy(ctx, type->fields[j].type);
        }
        ctx->alloc(type->fields, 0);
    }
    for (int32_t i=0; i<mod->funcs_count; i++) {
        fin_mod_func_t* func = &mod->funcs[i];
        if (func->ret_type)
            fin_str_destroy(ctx, func->ret_type);
        ctx->alloc(func->code, 0);
        fin_str_destroy(ctx, func->sign);
    }
    if (mod->binds) {
        for (int32_t i=0; i<mod->binds_count; i++) {
            fin_mod_func_bind_t* bind = &mod->binds[i];
            fin_str_destroy(ctx, bind->sign);
        }
        ctx->alloc(mod->binds, 0);
    }
    if (mod->consts)
        ctx->alloc(mod->consts, 0);
    if (mod->funcs)
        ctx->alloc(mod->funcs, 0);
    if (mod->types)
        ctx->alloc(mod->types, 0);
    ctx->alloc(mod, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
movq %rdi, %r14
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x63db
movq %r14, %rdi
callq 0x82ed
cmpl $0x0, 0x28(%r13)
jle 0x645c
xorl %r15d, %r15d
movq %r13, -0x30(%rbp)
movq 0x8(%r13), %rax
leaq (%r15,%r15,2), %rcx
leaq (%rax,%rcx,8), %r12
movq (%r12), %rsi
movq %r14, %rdi
callq 0x82ed
cmpl $0x0, 0x10(%r12)
jle 0x6442
xorl %r13d, %r13d
xorl %ebx, %ebx
movq 0x8(%r12), %rax
movq (%rax,%r13), %rsi
movq %r14, %rdi
callq 0x82ed
movq 0x8(%r12), %rax
movq 0x8(%rax,%r13), %rsi
movq %r14, %rdi
callq 0x82ed
incq %rbx
movslq 0x10(%r12), %rax
addq $0x10, %r13
cmpq %rax, %rbx
jl 0x640e
movq 0x8(%r12), %rdi
xorl %esi, %esi
callq *(%r14)
incq %r15
movq -0x30(%rbp), %r13
movslq 0x28(%r13), %rax
cmpq %rax, %r15
jl 0x63e9
cmpl $0x0, 0x2c(%r13)
jle 0x64a8
movl $0x28, %r15d
xorl %r12d, %r12d
movq 0x10(%r13), %rbx
movq -0x20(%rbx,%r15), %rsi
testq %rsi, %rsi
je 0x6482
movq %r14, %rdi
callq 0x82ed
movq (%rbx,%r15), %rdi
xorl %esi, %esi
callq *(%r14)
movq -0x18(%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x82ed
incq %r12
movslq 0x2c(%r13), %rax
addq $0x38, %r15
cmpq %rax, %r12
jl 0x646c
cmpq $0x0, 0x20(%r13)
je 0x64e4
cmpl $0x0, 0x34(%r13)
jle 0x64db
xorl %ebx, %ebx
xorl %r15d, %r15d
movq 0x20(%r13), %rax
movq (%rax,%rbx), %rsi
movq %r14, %rdi
callq 0x82ed
incq %r15
movslq 0x34(%r13), %rax
addq $0x10, %rbx
cmpq %rax, %r15
jl 0x64bb
movq 0x20(%r13), %rdi
xorl %esi, %esi
callq *(%r14)
movq 0x18(%r13), %rdi
testq %rdi, %rdi
je 0x64f2
xorl %esi, %esi
callq *(%r14)
movq 0x10(%r13), %rdi
testq %rdi, %rdi
je 0x6500
xorl %esi, %esi
callq *(%r14)
movq 0x8(%r13), %rdi
testq %rdi, %rdi
je 0x650e
xorl %esi, %esi
callq *(%r14)
movq (%r14), %rax
movq %r13, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax