LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x41db
movq %rax, %r15
pushq $0x14
popq %rsi
movq %rbx, %rdi
callq 0x5537
testb %al, %al
je 0x4177
pushq $0x2
jmp 0x419b
pushq $0x15
popq %rsi
movq %rbx, %rdi
callq 0x5537
testb %al, %al
je 0x418a
pushq $0x3
jmp 0x419b
pushq $0x17
popq %rsi
movq %rbx, %rdi
callq 0x5537
testb %al, %al
je 0x41c9
pushq $0x4
popq %r13
pushq $0x18
popq %rsi
xorl %edi, %edi
callq *(%r14)
movq %rax, %r12
movl $0x7, (%rax)
movl %r13d, 0x4(%rax)
movq %r15, 0x8(%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4148
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_O2/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 0x5559
testl %eax, %eax
je 0x4433
movq %rbx, %rdi
callq 0x5559
cmpl $0x1, %eax
jne 0x4452
pushq $0x10
popq %rsi
xorl %edi, %edi
callq *(%r14)
movq %rax, %r15
movl $0x2, (%rax)
movq %rbx, %rdi
callq 0x5580
jmp 0x44b1
pushq $0x8
popq %rsi
xorl %edi, %edi
callq *(%r14)
movq %rax, %r15
movl $0x1, (%rax)
movq %rbx, %rdi
callq 0x5562
movb %al, 0x4(%r15)
jmp 0x44b5
movq %rbx, %rdi
callq 0x5559
cmpl $0x2, %eax
jne 0x4480
pushq $0x10
popq %rsi
xorl %edi, %edi
callq *(%r14)
movq %rax, %r15
movl $0x3, (%rax)
movq %rbx, %rdi
callq 0x55ab
movsd %xmm0, 0x8(%r15)
jmp 0x44b5
movq %rbx, %rdi
callq 0x5559
cmpl $0x3, %eax
jne 0x44c3
pushq $0x10
popq %rsi
xorl %edi, %edi
callq *(%r14)
movq %rax, %r15
movl $0x4, (%rax)
movq %rbx, %rdi
callq 0x55d8
movq %r14, %rdi
movq %rax, %rsi
callq 0x781e
movq %rax, 0x8(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4bf7(%rip), %rdi      # 0x90c1
leaq 0x4bf2(%rip), %rsi      # 0x90c3
leaq 0x4c2a(%rip), %rcx      # 0x9102
movl $0x88, %edx
callq 0x3120
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_arg_expr
static fin_ast_arg_expr_t* fin_ast_parse_arg_expr(fin_ctx_t* ctx, fin_lex_t* lex) {
    fin_ast_expr_t* expr = fin_ast_parse_expr(ctx, lex, NULL);
    fin_ast_arg_expr_t* arg_expr = (fin_ast_arg_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_arg_expr_t));
    arg_expr->base.type = fin_ast_expr_type_arg;
    arg_expr->expr = expr;
    arg_expr->next = NULL;
    return arg_expr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %edx, %edx
callq 0x3a1d
movq %rax, %r14
pushq $0x18
popq %rsi
xorl %edi, %edi
callq *(%rbx)
movl $0x9, (%rax)
movq %r14, 0x8(%rax)
andq $0x0, 0x10(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x18
popq %rsi
xorl %edi, %edi
callq *(%r14)
movq %rax, %r15
movl $0x7, (%rax)
andq $0x0, 0x8(%rax)
pushq $0x32
popq %rsi
movq %rbx, %rdi
callq 0x38da
andq $0x0, 0x10(%r15)
movq %r15, %r13
addq $0x10, %r13
pushq $0x33
popq %r12
movq %rbx, %rdi
movl %r12d, %esi
callq 0x5537
testb %al, %al
jne 0x457d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x458f
movq %rax, (%r13)
addq $0x8, %rax
movq %rax, %r13
jmp 0x4556
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_O2/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 0x49e6
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3a1d
movq %rax, %r15
pushq $0x18
popq %rsi
xorl %edi, %edi
callq *(%r14)
movq %rax, %r14
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %r15, 0x10(%rax)
pushq $0xc
popq %rsi
movq %rbx, %rdi
callq 0x38da
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x10
popq %rsi
xorl %edi, %edi
callq *(%r14)
movq %rax, %r13
movl $0xb, (%rax)
pushq $0x32
popq %rsi
movq %rbx, %rdi
callq 0x38da
andq $0x0, 0x8(%r13)
movq %r13, -0x30(%rbp)
addq $0x8, %r13
pushq $0x33
popq %r12
movq %r13, %r15
movq %rbx, %rdi
movl %r12d, %esi
callq 0x5537
testb %al, %al
jne 0x4a92
cmpq $0x0, (%r13)
je 0x4a7b
movq %rbx, %rdi
pushq $0x9
popq %rsi
callq 0x38da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44e2
movq %rax, (%r15)
addq $0x10, %rax
movq %rax, %r15
jmp 0x4a5a
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_O2/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 0x4ae8
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rsi
callq 0x4aa5
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4bd0
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0x79ab
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_O2/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 0x79ab
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x4bf9
movq (%r14), %rdi
callq 0x79ab
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_O2/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 0x4cfe
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rsi
callq 0x4cbb
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0x79ab
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4c0a
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_O2/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 0x4d42
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rsi
callq 0x4cff
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0x79ab
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4bd0
movq (%r14), %rax
movq (%rax), %rax
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x18
popq %rsi
xorl %edi, %edi
callq *%rbx
movq %rax, %r14
movq %rbx, (%rax)
movq %rbx, %rdi
callq 0x77d6
movq %rax, 0x8(%r14)
andq $0x0, 0x10(%r14)
movq %r14, %rdi
callq 0x7eac
movq %r14, %rdi
callq 0x7f74
movq %r14, %rdi
callq 0x86b8
movq %r14, %rdi
callq 0x82f0
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4db5
testl %esi, %esi
je 0x4dc0
movl %esi, %esi
jmp 0x3230
testl %esi, %esi
je 0x4dca
movl %esi, %edi
jmp 0x31f0
pushq %rbp
movq %rsp, %rbp
callq 0x3030
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4df1
movq 0x40(%rsi), %r14
movq %rbx, %rdi
callq 0x5f34
movq %r14, %rsi
jmp 0x4ddb
movq 0x8(%rbx), %rdi
callq 0x77f7
movq (%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/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 0x5a4c
testq %rax, %rax
je 0x4e49
movq %rax, %r14
cmpq $0x0, 0x38(%rax)
je 0x4e49
movq %rbx, %rdi
callq 0x7e1c
movq %rax, %rbx
movq 0x38(%r14), %rsi
movq %rax, %rdi
callq 0x7e65
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x7e52
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x42dc(%rip), %rsi      # 0x9145
movq %rax, %rdi
callq 0x3250
testq %rax, %rax
je 0x4efa
movq %rax, %r14
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
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 0x4f09
movq %rax, %r12
movslq %r15d, %r13
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r13, %rdx
movq %r14, %rcx
callq 0x30a0
movb $0x0, (%r12,%r13)
cmpl %r15d, %eax
jne 0x4f22
movq %r14, %rdi
callq 0x30f0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4e08
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 0x4238(%rip), %rdi      # 0x9148
leaq 0x4238(%rip), %rsi      # 0x914f
leaq 0x423f(%rip), %rcx      # 0x915d
pushq $0x51
jmp 0x4f39
leaq 0x4266(%rip), %rdi      # 0x918f
leaq 0x421f(%rip), %rsi      # 0x914f
leaq 0x4226(%rip), %rcx      # 0x915d
pushq $0x54
popq %rdx
callq 0x3120
nop
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %rax
xorl %edi, %edi
movl $0x130, %esi            # imm = 0x130
callq *%rax
movq %rax, %r14
movq %rbx, (%rax)
movl $0x1, 0x8(%rax)
andl $0x0, 0x128(%rax)
andl $0x0, 0x28(%rax)
movq %rbx, 0x30(%rax)
movq %rax, %rdi
callq 0x4f82
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x554e
callq 0x4f82
cmpl %ebx, %r14d
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4f82
movq %rbx, %rax
movl %r14d, %edx
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rsi, %rbx
leaq 0x10(%rdi), %r11
movq 0x10(%rdi), %rax
movq %rax, 0x40(%rsi)
movq %rsi, 0x10(%rdi)
xorl %r12d, %r12d
pushq $-0x38
popq %r13
xorl %r14d, %r14d
movq %r11, -0x30(%rbp)
movslq 0x34(%rbx), %rcx
movq %r11, %rax
cmpq %rcx, %r14
jge 0x5a1e
movq (%rax), %rax
testq %rax, %rax
je 0x59d7
movl 0x2c(%rax), %ecx
testl %ecx, %ecx
cmovlel %r12d, %ecx
imulq $0x38, %rcx, %rsi
movq %r14, %rdx
shlq $0x4, %rdx
movq %r13, %r8
leaq 0x38(%r8), %rdi
cmpq %rdi, %rsi
je 0x59c5
movq 0x10(%rax), %r9
movq 0x48(%r9,%r8), %r10
movq 0x20(%rbx), %rcx
movq %rdi, %r8
cmpq (%rcx,%rdx), %r10
jne 0x5999
leaq (%rcx,%rdx), %rsi
addq %rdi, %r9
movq %r9, 0x8(%rsi)
jmp 0x59c9
movq 0x20(%rbx), %rcx
addq $0x40, %rax
cmpq $0x0, 0x8(%rcx,%rdx)
je 0x597a
jmp 0x59db
movq 0x20(%rbx), %rcx
movq %r14, %r15
shlq $0x4, %r15
cmpq $0x0, 0x8(%rcx,%r15)
jne 0x5a16
addq %r15, %rcx
movq (%rcx), %rdi
callq 0x7b28
leaq 0x3a2b(%rip), %rdi      # 0x9427
movq %rax, %rsi
xorl %eax, %eax
callq 0x3110
movq -0x30(%rbp), %r11
movq 0x20(%rbx), %rax
cmpq $0x0, 0x8(%rax,%r15)
je 0x5a2d
incq %r14
jmp 0x596a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3a0b(%rip), %rdi      # 0x943f
leaq 0x3a17(%rip), %rsi      # 0x9452
leaq 0x3a1e(%rip), %rcx      # 0x9460
movl $0x307, %edx            # imm = 0x307
callq 0x3120
// File: /workspace/github_c_makefile_star2_O2/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
movl 0x2c(%rsi), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
imulq $0x38, %rcx, %rcx
movabsq $-0x38, %r8
leaq 0x38(%r8), %r9
cmpq %r9, %rcx
je 0x5ee6
movq 0x10(%rsi), %rax
cmpq %rdx, 0x48(%rax,%r8)
movq %r9, %r8
jne 0x5eca
addq %r9, %rax
jmp 0x5f32
addq $0x10, %rdi
xorl %eax, %eax
movabsq $-0x38, %rcx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x5f32
movl 0x2c(%rdi), %esi
testl %esi, %esi
cmovlel %eax, %esi
imulq $0x38, %rsi, %rsi
movq %rcx, %r9
leaq 0x38(%r9), %r8
cmpq %r8, %rsi
je 0x5f26
movq 0x10(%rdi), %r10
cmpq %rdx, 0x48(%r10,%r9)
movq %r8, %r9
jne 0x5f0d
jmp 0x5f2c
addq $0x40, %rdi
jmp 0x5ef6
addq %r8, %r10
movq %r10, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5f58
movq %r14, %rdi
callq 0x79ab
xorl %r15d, %r15d
movq %r13, -0x30(%rbp)
movslq 0x28(%r13), %rax
cmpq %rax, %r15
jge 0x5fce
movq 0x8(%r13), %rax
imulq $0x18, %r15, %rcx
leaq (%rax,%rcx), %r12
movq (%rax,%rcx), %rsi
movq %r14, %rdi
callq 0x79ab
xorl %r13d, %r13d
xorl %ebx, %ebx
movslq 0x10(%r12), %rax
cmpq %rax, %rbx
jge 0x5fbb
movq 0x8(%r12), %rax
movq (%rax,%r13), %rsi
movq %r14, %rdi
callq 0x79ab
movq 0x8(%r12), %rax
movq 0x8(%rax,%r13), %rsi
movq %r14, %rdi
callq 0x79ab
incq %rbx
addq $0x10, %r13
jmp 0x5f85
movq 0x8(%r12), %rdi
xorl %esi, %esi
callq *(%r14)
incq %r15
movq -0x30(%rbp), %r13
jmp 0x5f5f
pushq $0x28
popq %r15
xorl %r12d, %r12d
movslq 0x2c(%r13), %rax
cmpq %rax, %r12
jge 0x6013
movq 0x10(%r13), %rbx
movq -0x20(%rbx,%r15), %rsi
testq %rsi, %rsi
je 0x5ff4
movq %r14, %rdi
callq 0x79ab
movq (%rbx,%r15), %rdi
xorl %esi, %esi
callq *(%r14)
movq -0x18(%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x79ab
incq %r12
addq $0x38, %r15
jmp 0x5fd5
cmpq $0x0, 0x20(%r13)
je 0x604a
xorl %ebx, %ebx
xorl %r15d, %r15d
movslq 0x34(%r13), %rax
cmpq %rax, %r15
jge 0x6041
movq 0x20(%r13), %rax
movq (%rax,%rbx), %rsi
movq %r14, %rdi
callq 0x79ab
incq %r15
addq $0x10, %rbx
jmp 0x601f
movq 0x20(%r13), %rdi
xorl %esi, %esi
callq *(%r14)
movq 0x18(%r13), %rdi
testq %rdi, %rdi
je 0x6058
xorl %esi, %esi
callq *(%r14)
movq 0x10(%r13), %rdi
testq %rdi, %rdi
je 0x6066
xorl %esi, %esi
callq *(%r14)
movq 0x8(%r13), %rdi
testq %rdi, %rdi
je 0x6074
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
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_compile_init_expr
static void fin_mod_compile_init_expr(fin_ctx_t* ctx, fin_mod_compiler_t* cmp, fin_ast_init_expr_t* expr, fin_str_t* type_name) {
    fin_mod_type_t* type = fin_mod_find_type(ctx, cmp->mod, type_name);
    assert(type);
    int32_t args_count = 0;
    for (fin_ast_arg_expr_t* e = expr->args; e; e = e->next)
        args_count++;
    assert(args_count == type->fields_count);
    int32_t idx = 0;
    for (fin_ast_arg_expr_t* e = expr->args; e; e = e->next) {
        fin_str_t* arg_type = fin_mod_resolve_type(ctx, cmp, e->expr);
        assert(arg_type == type->fields[idx].type);
        fin_str_destroy(ctx, arg_type);
        fin_mod_compile_expr(ctx, cmp, e->expr);
        idx++;
    }
    fin_mod_code_emit_uint8(ctx, &cmp->code, fin_op_new);
    fin_mod_code_emit_uint8(ctx, &cmp->code, type->fields_count);
    FIN_LOG("\tnew        %2d         // %s\n", type->fields_count, fin_str_cstr(type->name));
}

// 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
movq (%rsi), %rsi
movq %rcx, %rdx
callq 0x7541
testq %rax, %rax
je 0x6bef
movq %rax, %r15
addq $0x8, %r12
xorl %eax, %eax
movq %r12, %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x6b4a
incl %eax
addq $0x10, %rcx
jmp 0x6b3a
cmpl %eax, 0x10(%r15)
jne 0x6c0e
pushq $0x8
popq %r13
movq (%r12), %r12
testq %r12, %r12
je 0x6ba0
movq 0x8(%r12), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6cc3
movq 0x8(%r15), %rcx
cmpq (%rcx,%r13), %rax
jne 0x6bd0
movq %r14, %rdi
movq %rax, %rsi
callq 0x79ab
movq 0x8(%r12), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x655f
addq $0x10, %r12
addq $0x10, %r13
jmp 0x6b58
addq $0x18, %rbx
pushq $0xd
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x653a
movzbl 0x10(%r15), %edx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x653a
leaq 0x2bbd(%rip), %rdi      # 0x9794
leaq 0x2874(%rip), %rsi      # 0x9452
leaq 0x2b28(%rip), %rcx      # 0x970d
movl $0x21b, %edx            # imm = 0x21B
callq 0x3120
leaq 0x2bbc(%rip), %rdi      # 0x97b2
leaq 0x2855(%rip), %rsi      # 0x9452
leaq 0x2b09(%rip), %rcx      # 0x970d
movl $0x213, %edx            # imm = 0x213
callq 0x3120
leaq 0x2b5e(%rip), %rdi      # 0x9773
leaq 0x2836(%rip), %rsi      # 0x9452
leaq 0x2aea(%rip), %rcx      # 0x970d
movl $0x217, %edx            # imm = 0x217
callq 0x3120
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_resolve_local
static fin_mod_local_t* fin_mod_resolve_local(fin_mod_compiler_t* cmp, fin_str_t* id) {
    for (int32_t i=0; i<cmp->locals_count; i++)
        if (cmp->locals[i].name == id)
            return &cmp->locals[i];
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0x1a30(%rdi), %ecx
incq %rcx
addq $0x118, %rdi            # imm = 0x118
decq %rcx
je 0x6cbf
leaq 0x18(%rdi), %rax
cmpq %rsi, 0x18(%rdi)
movq %rax, %rdi
jne 0x6cab
jmp 0x6cc1
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_resolve_field
static int32_t fin_mod_resolve_field(fin_ctx_t* ctx, fin_mod_t* mod, fin_str_t* type_name, fin_str_t* field_name) {
    fin_mod_type_t* type = fin_mod_find_type(ctx, mod, type_name);
    for (int32_t i=0; i<type->fields_count; i++) {
        if (type->fields[i].name == field_name)
            return i;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rcx, %rbx
callq 0x7541
movl 0x10(%rax), %edx
xorl %esi, %esi
testl %edx, %edx
cmovlel %esi, %edx
pushq $-0x1
popq %rcx
xorl %edi, %edi
cmpq %rdi, %rdx
je 0x6f06
movq 0x8(%rax), %r8
cmpq %rbx, (%r8,%rsi)
je 0x6f04
incq %rdi
addq $0x10, %rsi
jmp 0x6eec
movl %edi, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_const_idx
static int16_t fin_mod_const_idx(fin_mod_compiler_t* cmp, fin_val_t val) {
    fin_mod_t* mod = cmp->mod;
    for (int32_t i=0; i<mod->consts_count; i++) {
        if (val.i == mod->consts[i].i)
            return i;
    }
    mod->consts[mod->consts_count] = val;
    return mod->consts_count++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movslq 0x30(%rcx), %rdx
xorl %eax, %eax
testl %edx, %edx
movl $0x0, %edi
cmovgl %edx, %edi
movq 0x18(%rcx), %r8
cmpq %rax, %rdi
je 0x6f3a
cmpq %rsi, (%r8,%rax,8)
je 0x6f47
incq %rax
jmp 0x6f2a
movq %rsi, (%r8,%rdx,8)
movl 0x30(%rcx), %eax
leal 0x1(%rax), %edx
movl %edx, 0x30(%rcx)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_bind_idx
static int16_t fin_mod_bind_idx(fin_mod_compiler_t* cmp, fin_str_t* sign) {
    fin_mod_t* mod = cmp->mod;
    for (int32_t i=0; i<mod->binds_count; i++) {
        if (sign == mod->binds[i].sign)
            return i;
    }
    mod->binds[mod->binds_count].sign = fin_str_clone(sign);
    mod->binds[mod->binds_count].func = NULL;
    return mod->binds_count++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq (%rdi), %rbx
movl 0x34(%rbx), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
xorl %eax, %eax
cmpq %rax, %rcx
je 0x6f76
movq 0x20(%rbx), %rdi
cmpq %rsi, (%rdi,%rdx)
je 0x6fa0
incq %rax
addq $0x10, %rdx
jmp 0x6f5e
movq %rsi, %rdi
callq 0x79dd
movq %rax, %rcx
movq 0x20(%rbx), %rdx
movslq 0x34(%rbx), %rax
movq %rax, %rsi
shlq $0x4, %rsi
movq %rcx, (%rdx,%rsi)
andq $0x0, 0x8(%rdx,%rsi)
leal 0x1(%rax), %ecx
movl %ecx, 0x34(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_unary_get_signature
static fin_str_t* fin_mod_unary_get_signature(fin_ctx_t* ctx, fin_mod_compiler_t* cmp, fin_ast_unary_expr_t* unary_expr) {
    char sign[128];
    sign[0] = '\0';
    switch (unary_expr->op) {
        case fin_ast_unary_type_pos:  strcat(sign, "__op_pos"); break;
        case fin_ast_unary_type_neg:  strcat(sign, "__op_neg"); break;
        case fin_ast_unary_type_not:  strcat(sign, "__op_not"); break;
        case fin_ast_unary_type_bnot: strcat(sign, "__op_bnot"); break;
        case fin_ast_unary_type_inc:  strcat(sign, "__op_inc"); break;
        case fin_ast_unary_type_dec:  strcat(sign, "__op_dec"); break;
    }
    strcat(sign, "(");
    strcat(sign, fin_str_cstr(fin_mod_resolve_type(ctx, cmp, unary_expr->expr)));
    strcat(sign, ")");
    return fin_str_create(ctx, sign, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, -0xa0(%rbp)
movl 0x4(%rdx), %eax
cmpq $0x5, %rax
ja 0x7099
leaq 0x23e3(%rip), %rcx      # 0x93c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0xa0(%rbp), %rdi
callq 0x3100
movabsq $0x736f705f706f5f5f, %rcx # imm = 0x736F705F706F5F5F
jmp 0x7089
leaq -0xa0(%rbp), %rdi
callq 0x3100
movabsq $0x636e695f706f5f5f, %rcx # imm = 0x636E695F706F5F5F
jmp 0x7089
leaq -0xa0(%rbp), %rdi
callq 0x3100
movabsq $0x746f6e5f706f5f5f, %rcx # imm = 0x746F6E5F706F5F5F
jmp 0x7089
leaq -0xa0(%rbp), %rdi
callq 0x3100
movabsq $0x6f6e625f706f5f5f, %rcx # imm = 0x6F6E625F706F5F5F
movq %rcx, -0xa0(%rbp,%rax)
movw $0x74, -0x98(%rbp,%rax)
jmp 0x7099
leaq -0xa0(%rbp), %rdi
callq 0x3100
movabsq $0x67656e5f706f5f5f, %rcx # imm = 0x67656E5F706F5F5F
jmp 0x7089
leaq -0xa0(%rbp), %rdi
callq 0x3100
movabsq $0x6365645f706f5f5f, %rcx # imm = 0x6365645F706F5F5F
movq %rcx, -0xa0(%rbp,%rax)
movb $0x0, -0x98(%rbp,%rax)
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
callq 0x3100
movw $0x28, -0xa0(%rbp,%rax)
movq 0x8(%r15), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6cc3
movq %rax, %rdi
callq 0x7b28
movq %r12, %rdi
movq %rax, %rsi
callq 0x3280
movq %r12, %rdi
callq 0x3100
movw $0x29, -0xa0(%rbp,%rax)
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x781e
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_invoke_get_signature
static fin_str_t* fin_mod_invoke_get_signature(fin_ctx_t* ctx, fin_mod_compiler_t* cmp, fin_ast_invoke_expr_t* expr) {
    char signature[128];
    signature[0] = '\0';
    if (expr->id->type == fin_ast_expr_type_id) {
        fin_ast_id_expr_t* id_expr = (fin_ast_id_expr_t*)expr->id;
        if (id_expr->primary && id_expr->primary->type == fin_ast_expr_type_id) {
            fin_ast_id_expr_t* prim_id_expr = (fin_ast_id_expr_t*)id_expr->primary;
            strcat(signature, fin_str_cstr(prim_id_expr->name));
            strcat(signature, ".");
        }
        strcat(signature, fin_str_cstr(id_expr->name));
    }
    strcat(signature, "(");
    for (fin_ast_arg_expr_t* e = expr->args; e; e = e->next) {
        if (e != expr->args)
            strcat(signature, ",");
        fin_str_t* arg_type = fin_mod_resolve_type(ctx, cmp, &e->base);
        strcat(signature, fin_str_cstr(arg_type));
        fin_str_destroy(ctx, arg_type);
    }
    strcat(signature, ")");
    return fin_str_create(ctx, signature, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r14
movq %rsi, -0x30(%rbp)
movq %rdi, %rbx
movb $0x0, -0xb0(%rbp)
movq 0x8(%rdx), %r15
cmpl $0x0, (%r15)
jne 0x7492
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x747a
cmpl $0x0, (%rax)
jne 0x747a
movq 0x10(%rax), %rdi
callq 0x7b28
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x3280
movq %r12, %rdi
callq 0x3100
movw $0x2e, -0xb0(%rbp,%rax)
movq 0x10(%r15), %rdi
callq 0x7b28
leaq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0x3280
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
callq 0x3100
movw $0x28, -0xb0(%rbp,%rax)
addq $0x10, %r14
movq %r14, %r13
movq (%r13), %r13
testq %r13, %r13
je 0x7508
cmpq (%r14), %r13
je 0x74d2
movq %r12, %rdi
callq 0x3100
movw $0x2c, -0xb0(%rbp,%rax)
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
movq %r13, %rdx
callq 0x6cc3
movq %rax, %r15
movq %rax, %rdi
callq 0x7b28
movq %r12, %rdi
movq %rax, %rsi
callq 0x3280
movq %rbx, %rdi
movq %r15, %rsi
callq 0x79ab
addq $0x10, %r13
jmp 0x74b2
leaq -0xb0(%rbp), %r14
movq %r14, %rdi
callq 0x3100
movw $0x29, -0xb0(%rbp,%rax)
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x781e
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_find_type
static fin_mod_type_t* fin_mod_find_type(fin_ctx_t* ctx, fin_mod_t* mod, fin_str_t* name) {
    for (int32_t i=0; i<mod->types_count; i++) {
        if (mod->types[i].name == name)
            return &mod->types[i];
    }
    fin_mod_t* m = ctx->mod;
    while (m) {
        for (int32_t i=0; i<m->types_count; i++) {
            if (m->types[i].name == name)
                return &m->types[i];
        }
        m = m->next;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x28(%rsi), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
imulq $0x18, %rcx, %rcx
movabsq $-0x18, %r8
leaq 0x18(%r8), %r9
cmpq %r9, %rcx
je 0x7579
movq 0x8(%rsi), %rax
cmpq %rdx, 0x18(%rax,%r8)
movq %r9, %r8
jne 0x755d
addq %r9, %rax
jmp 0x75c5
addq $0x10, %rdi
xorl %eax, %eax
movabsq $-0x18, %rcx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x75c5
movl 0x28(%rdi), %esi
testl %esi, %esi
cmovlel %eax, %esi
imulq $0x18, %rsi, %rsi
movq %rcx, %r9
leaq 0x18(%r9), %r8
cmpq %r8, %rsi
je 0x75b9
movq 0x8(%rdi), %r10
cmpq %rdx, 0x18(%r10,%r9)
movq %r8, %r9
jne 0x75a0
jmp 0x75bf
addq $0x40, %rdi
jmp 0x7589
addq %r8, %r10
movq %r10, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_mod.c
// Function: fin_mod_code_ensure
static void fin_mod_code_ensure(fin_ctx_t* ctx, fin_mod_code_t* code, int32_t size) {
    if (code->top + size >= code->end) {
        int32_t length;
        uint8_t* buffer;
        if (code->begin == code->storage) {
            length = sizeof(code->storage) * 2;
            buffer = ctx->alloc(NULL, length);
            memcpy(buffer, code->begin, code->top - code->begin);
        }
        else {
            length = (int32_t)(code->end - code->begin) * 2;
            buffer = ctx->alloc(code->begin, length);
        }
        code->top   = buffer + (code->top - code->begin);
        code->begin = buffer;
        code->end   = buffer + length;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ecx
addq (%rsi), %rcx
movq 0x10(%rsi), %r15
cmpq %r15, %rcx
jb 0x7640
movq %rsi, %rbx
movq %rdi, %rax
movq 0x8(%rsi), %rdi
leaq 0x18(%rsi), %rcx
cmpq %rcx, %rdi
je 0x7605
subl %edi, %r15d
addl %r15d, %r15d
movl %r15d, %esi
callq *(%rax)
movq %rax, %r14
movslq %r15d, %rax
jmp 0x7628
xorl %edi, %edi
movl $0x200, %esi            # imm = 0x200
callq *(%rax)
movq %rax, %r14
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
subq %rsi, %rdx
movq %rax, %rdi
callq 0x31c0
movl $0x200, %eax            # imm = 0x200
movq (%rbx), %rcx
subq 0x8(%rbx), %rcx
addq %r14, %rcx
movq %rcx, (%rbx)
movq %r14, 0x8(%rbx)
addq %r14, %rax
movq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_obj.c
// Function: fin_obj_create
fin_obj_t* fin_obj_create(fin_alloc alloc, fin_val_t* fields, int32_t fields_count) {
    fin_obj_t* obj = (fin_obj_t*)alloc(NULL, sizeof(fin_obj_t*) + sizeof(fin_val_t) * fields_count);
    obj->ref = 1;
    for (int32_t i=0; i<fields_count; i++)
        obj->fields[i] = fields[i];
    return obj;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %rax
leal 0x8(,%r14,8), %esi
xorl %r15d, %r15d
xorl %edi, %edi
callq *%rax
movl $0x1, (%rax)
testl %r14d, %r14d
movl $0x0, %ecx
cmovgl %r14d, %ecx
cmpq %r15, %rcx
je 0x7693
movq (%rbx,%r15,8), %rdx
movq %rdx, 0x8(%rax,%r15,8)
incq %r15
jmp 0x7680
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_str.c
// Function: fin_str_resize
void fin_str_resize(fin_str_pool_t* pool, int32_t capacity) {
    fin_str_pool_t new_pool;
    new_pool.entries = (fin_str_entry_t*)pool->alloc(NULL, sizeof(fin_str_entry_t) * capacity);
    new_pool.capacity = capacity;
    new_pool.count = 0;
    new_pool.alloc = pool->alloc;
    for (int32_t i=0; i<capacity; i++) {
        new_pool.entries[i].hash = 0;
        new_pool.entries[i].str = NULL;
    }
    for (int32_t i=0; i<pool->capacity; i++)
        if (pool->entries[i].str != 0)
            fin_str_insert(&new_pool, pool->entries[i].hash, pool->entries[i].str);
    pool->alloc(pool->entries, 0);
    *pool = new_pool;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %r14d
movq %rdi, %rbx
shll $0x4, %esi
xorl %r15d, %r15d
xorl %edi, %edi
callq *0x10(%rbx)
movq %rax, -0x38(%rbp)
movl %r14d, -0x30(%rbp)
andl $0x0, -0x2c(%rbp)
movq 0x10(%rbx), %rcx
movq %rcx, -0x28(%rbp)
testl %r14d, %r14d
movl $0x0, %ecx
cmovgl %r14d, %ecx
shlq $0x4, %rcx
cmpq %r15, %rcx
je 0x772e
andl $0x0, (%rax,%r15)
andq $0x0, 0x8(%rax,%r15)
addq $0x10, %r15
jmp 0x7718
pushq $0x8
popq %r15
xorl %r12d, %r12d
leaq -0x38(%rbp), %r14
movslq 0x8(%rbx), %rax
cmpq %rax, %r12
jge 0x7764
movq (%rbx), %rax
movq (%rax,%r15), %rdx
testq %rdx, %rdx
je 0x775b
movl -0x8(%rax,%r15), %esi
movq %r14, %rdi
callq 0x7788
incq %r12
addq $0x10, %r15
jmp 0x7739
movq (%rbx), %rdi
xorl %esi, %esi
callq *0x10(%rbx)
movups -0x38(%rbp), %xmm0
movups %xmm0, (%rbx)
movq -0x28(%rbp), %rax
movq %rax, 0x10(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_str.c
// Function: fin_str_insert
static void fin_str_insert(fin_str_pool_t* pool, int32_t hash, fin_str_t* str) {
    int32_t slot = (uint32_t)hash % pool->capacity;
    int32_t end_slot = slot;
    do {
        fin_str_entry_t* entry = &pool->entries[slot];
        if (entry->hash == 0 || entry->str == NULL) {
            entry->hash = hash;
            entry->str = str;
            str->slot = slot;
            pool->count++;
            break;
        }
        slot = (slot + 1) % pool->capacity;
    } while (slot != end_slot);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdx, %rcx
movl 0x8(%rdi), %r9d
movl %esi, %eax
xorl %edx, %edx
divl %r9d
movl %edx, %r8d
movq (%rdi), %r10
movslq %edx, %r11
shlq $0x4, %r11
leaq (%r10,%r11), %rax
cmpl $0x0, (%r10,%r11)
je 0x77c8
cmpq $0x0, 0x8(%rax)
je 0x77c8
incl %edx
movl %edx, %eax
cltd
idivl %r9d
cmpl %r8d, %edx
jne 0x77a0
jmp 0x77d4
movl %esi, (%rax)
movq %rcx, 0x8(%rax)
movl %edx, 0x8(%rcx)
incl 0xc(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_str.c
// Function: fin_str_pool_create
fin_str_pool_t* fin_str_pool_create(fin_alloc alloc) {
    fin_str_pool_t* pool = (fin_str_pool_t*)alloc(NULL, sizeof(fin_str_pool_t));
    pool->entries = NULL;
    pool->capacity = 0;
    pool->count = 0;
    pool->alloc = alloc;
    return pool;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x18
popq %rsi
xorl %edi, %edi
callq *%rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_str.c
// Function: fin_str_destroy
void fin_str_destroy(fin_ctx_t* ctx, fin_str_t* str) {
    fin_str_pool_t* pool = ctx->pool;
    if (--str->ref == 0) {
        pool->entries[str->slot].str = NULL;
        pool->entries[str->slot].hash = 1;
        pool->alloc(str, 0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
decl (%rsi)
je 0x79b9
popq %rbp
retq
movq (%rax), %rcx
movslq 0x8(%rsi), %rdx
shlq $0x4, %rdx
andq $0x0, 0x8(%rcx,%rdx)
movl $0x1, (%rcx,%rdx)
movq 0x10(%rax), %rax
movq %rsi, %rdi
xorl %esi, %esi
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_str.c
// Function: fin_str_join
fin_str_t* fin_str_join(fin_ctx_t* ctx, fin_str_t* arr, int32_t count) {
    int32_t length = 0;
    for (int32_t i=0; i<count; i++)
        length += fin_str_len(arr + i);
    char* buffer = ctx->alloc(NULL, length + 1);
    length = 0;
    for (int32_t i=0; i<count; i++) {
        if (!(arr+i))
            continue;
        strncpy(buffer, (arr+i)->cstr, (arr+i)->len);
        length += (arr+i)->len;
    }
    fin_str_t* result = fin_str_create(ctx, buffer, length);
    ctx->alloc(buffer, 0);
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %r14d
movq %rdi, %r8
movq %r14, %rcx
shlq $0x4, %rcx
xorl %esi, %esi
cmpq %rax, %rcx
je 0x7aae
testq %r15, %r15
je 0x7aa4
movl 0x4(%r15,%rax), %edx
jmp 0x7aa6
xorl %edx, %edx
addl %edx, %esi
addq $0x10, %rax
jmp 0x7a93
incl %esi
xorl %r12d, %r12d
xorl %edi, %edi
movq %r8, -0x30(%rbp)
callq *(%r8)
movq %rax, %r13
leaq 0xc(%r15), %rbx
subq $0x1, %r14
jb 0x7ae7
testq %r15, %r15
je 0x7ae1
movslq -0x8(%rbx), %rdx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3070
addl -0x8(%rbx), %r12d
addq $0x10, %rbx
jmp 0x7ac3
movq -0x30(%rbp), %r14
movq %r14, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x781e
movq %rax, %rbx
movq %r13, %rdi
xorl %esi, %esi
callq *(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/fin_vm.c
// Function: fin_vm_invoke_int
inline void fin_vm_invoke_int(fin_ctx_t* ctx, fin_mod_func_t* func, fin_val_t* stack) {
    if (func->is_native) {
        fin_val_t result;
        (*func->func)(ctx, stack - func->args, &result);
        if (func->ret_type)
            stack[-func->args] = result;
    }
    else
        fin_vm_interpret(ctx, func, stack);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
cmpb $0x1, 0x20(%rsi)
jne 0x7e09
movzbl 0x34(%r14), %eax
shll $0x3, %eax
movq %rbx, %rsi
subq %rax, %rsi
leaq -0x18(%rbp), %rdx
callq *0x18(%r14)
cmpq $0x0, 0x8(%r14)
je 0x7e00
movzbl 0x34(%r14), %eax
shll $0x3, %eax
subq %rax, %rbx
movq -0x18(%rbp), %rax
movq %rax, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rsi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x7b40
// File: /workspace/github_c_makefile_star2_O2/naleksiev[P]fin/src/mod/fin_io.c
// Function: fin_io_file_write
static void fin_io_file_write(fin_ctx_t* ctx, const fin_val_t* args, fin_val_t* ret) {
    const char* file = fin_str_cstr(args[0].s);
    if (!file)
        return;
    FILE* fp = fopen(file, "wb");
    if (!fp)
        return;
    fputs(fin_str_cstr(args[1].s), fp);
    fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq (%rsi), %rdi
callq 0x7b28
testq %rax, %rax
je 0x7f6e
leaq 0x1926(%rip), %rsi      # 0x9864
movq %rax, %rdi
callq 0x3250
testq %rax, %rax
je 0x7f6e
movq %rax, %r14
movq 0x8(%rbx), %rdi
callq 0x7b28
movq %rax, %rdi
movq %r14, %rsi
callq 0x3130
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x30f0
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/test-show-type.c
// Function: main
int main(int argc, char **argv)
{
	struct string_list *filelist = NULL;
	char *file;

	sparse_initialize(argc, argv, &filelist);
	Wdecl = 0;
	FOR_EACH_PTR(filelist, file) {
		show_symbols(sparse(file));
	} END_FOR_EACH_PTR(file);

	return has_error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x10(%rsp), %rbx
andq $0x0, (%rbx)
movq %rbx, %rdx
callq 0xec74
leaq 0x4bdd6(%rip), %rax     # 0x5a218
andl $0x0, (%rax)
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xe4e2
leaq 0x2aba7(%rip), %rbx     # 0x39004
movq 0x8(%rsp), %r12
xorl %r13d, %r13d
movl (%r12), %eax
movsbq %al, %rcx
cmpq %rcx, %r13
jge 0xe4d6
movq 0x18(%r12,%r13,8), %rdi
cmpw $0x100, %ax             # imm = 0x100
jb 0xe482
testq %rdi, %rdi
je 0xe4d1
callq 0xef98
testq %rax, %rax
je 0xe4d1
movq %rax, %r14
movq %rax, %rbp
xorl %r15d, %r15d
movl (%rbp), %eax
movsbq %al, %rcx
cmpq %rcx, %r15
jge 0xe4c8
movq 0x18(%rbp,%r15,8), %rdi
cmpw $0x100, %ax             # imm = 0x100
jb 0xe4b1
testq %rdi, %rdi
je 0xe4c3
callq 0x197ae
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xe0f0
incq %r15
jmp 0xe495
movq 0x10(%rbp), %rbp
cmpq %r14, %rbp
jne 0xe492
incq %r13
jmp 0xe465
movq 0x10(%r12), %r12
cmpq 0x8(%rsp), %r12
jne 0xe462
leaq 0x514ab(%rip), %rax     # 0x5f994
movl (%rax), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop