LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/lex.c
// Function: match
static bool match(Lex* lex, char c) {
    if (is_at_end(lex)) {
        return false;
    }

    if (lex->source[lex->pos] != c) {
        return false;
    }

    advance(lex);
    return true;
}

// Assembly:
movq 0x20(%rdi), %rax
cmpq 0x8(%rdi), %rax
je 0x1f33
movq (%rdi), %rcx
cmpb $0x3d, (%rcx,%rax)
jne 0x1f33
pushq %rax
callq 0x1ef6
movb $0x1, %al
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/lex.c
// Function: init_token_err
static void init_token_err(const Lex* lex, Token* token, const char err[]) {
    token->line = lex->line;
    token->column = lex->column;
    token->type = TOKEN_ERROR;
    token->source = err;
    token->source_len = strlen(err);
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movups 0x10(%rdi), %xmm0
movups %xmm0, (%rsi)
movl $0x27, 0x20(%rsi)
movq %rdx, 0x10(%rsi)
movq %rdx, %rdi
callq 0x10a0
movq %rax, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/main.c
// Function: main
int main(int argc, const char* argv[]) {
    if (argc == 2 && strcmp(argv[1], "repl") == 0) {
        vm_repl();
    } else if (argc == 3) {
        char* source = NULL;
        size_t source_len = 0;
        if (strcmp(argv[2], "-") == 0) {
            read_stdin(&source, &source_len);
        } else {
            read_file(argv[2], &source, &source_len);
        }

        if (strcmp(argv[1], "dump") == 0) {
            return (int)vm_interpret(source, source_len, vm_dump);
        }
        if (strcmp(argv[1], "run") == 0) {
            return (int)vm_interpret(source, source_len, vm_run_bytecode);
        }
    } else {
        cli_help(argv);
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
cmpl $0x3, %edi
je 0x1fb7
cmpl $0x2, %edi
jne 0x2048
movq 0x8(%rbx), %rdi
leaq 0x452b(%rip), %rsi      # 0x64cc
callq 0x1120
testl %eax, %eax
jne 0x2048
callq 0x53f5
xorl %eax, %eax
jmp 0x2033
andq $0x0, 0x8(%rsp)
andq $0x0, (%rsp)
movq 0x10(%rbx), %rdi
cmpb $0x2d, (%rdi)
jne 0x1fd1
cmpb $0x0, 0x1(%rdi)
je 0x2039
leaq 0x8(%rsp), %rsi
movq %rsp, %rdx
callq 0x37a9
movq 0x8(%rbx), %rbx
leaq 0x44e8(%rip), %rsi      # 0x64d1
movq %rbx, %rdi
callq 0x1120
testl %eax, %eax
je 0x201e
leaq 0x44da(%rip), %rsi      # 0x64d6
movq %rbx, %rdi
callq 0x1120
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x2033
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
leaq 0x20ab(%rip), %rdx      # 0x40c7
jmp 0x202e
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
leaq 0x1c76(%rip), %rdx      # 0x3ca4
callq 0x4df3
addq $0x10, %rsp
popq %rbx
retq
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x36d4
jmp 0x1fde
movq (%rbx), %rsi
leaq 0x4488(%rip), %rdi      # 0x64da
xorl %eax, %eax
callq 0x10b0
xorl %edi, %edi
callq 0x11e0
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: parser_compile
Result parser_compile(char* source, size_t source_len, ObjFunction** fn,
                      Vm* vm) {
    LOG("source_len=%zu source=`%.*s`\n", source_len, (int)source_len, source);

    Parser parser = {.lex = {
                         .source = source,
                         .source_len = source_len,
                         .line = 1,
                         .column = 1,
                         .pos = 0,
                     }};

    Compiler compiler;
    memset(&compiler, 0, sizeof(compiler));
    compiler_init(&compiler, TYPE_SCRIPT, &parser);

    advance(&parser);

    while (!match(&parser, TOKEN_EOF)) {
        declaration(&parser, vm);
    }

    if (parser.state == PARSER_STATE_OK) {
        *fn = compiler_end(&parser);
    }

    free(source);

    return parser.state == PARSER_STATE_OK ? RES_OK : RES_PARSE_ERR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30b8, %rsp           # imm = 0x30B8
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
movl $0x88, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x1100
movq %rbx, 0x8(%r12)
movq %r13, 0x10(%r12)
pushq $0x1
popq %rax
movq %rax, 0x18(%r12)
movq %rax, 0x20(%r12)
leaq 0x90(%rsp), %r13
movl $0x3028, %edx           # imm = 0x3028
movq %r13, %rdi
xorl %esi, %esi
callq 0x1100
pushq $0x1
popq %rbp
movq %r13, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x2134
movq %r12, %rdi
callq 0x21c6
pushq $0x28
popq %r13
movq %r12, %rdi
movl %r13d, %esi
callq 0x221a
testb %al, %al
jne 0x20f7
movq %r12, %rdi
movq %r15, %rsi
callq 0x2237
jmp 0x20db
cmpl $0x0, 0x8(%rsp)
jne 0x2118
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x2427
movq %rax, (%r14)
xorl %ebp, %ebp
cmpl $0x0, (%r15)
setne %bpl
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x30b8, %rsp           # imm = 0x30B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: compiler_init
static void compiler_init(Compiler* c, FunctionType type, Parser* p) {
    const char* const fn_name =
        type == TYPE_SCRIPT ? "<script>" : p->previous.source;
    const size_t fn_name_len = type == TYPE_SCRIPT ? 8 : p->previous.source_len;
    LOG("fn_name=`%.*s` fn_name_len=%zu\n", (int)fn_name_len, fn_name,
        fn_name_len);

    c->enclosing = p->compiler;
    c->fn = NULL;
    c->fn_type = type;
    c->locals_len = 0;
    c->scope_depth = 0;
    c->fn = value_make_fn(fn_name, fn_name_len);

    p->compiler = c;

    Local* const local = &c->locals[c->locals_len++];
    local->depth = 0;
    local->name.source = "";
    local->name.source_len = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x214f
pushq $0x8
popq %rax
leaq 0x44a3(%rip), %rdi      # 0x65f0
jmp 0x2157
movq 0x68(%r14), %rdi
movq 0x70(%r14), %rax
movq 0x80(%r14), %rcx
movq %rcx, 0x3020(%rbx)
movl %esi, 0x3018(%rbx)
andl $0x0, 0x3000(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x3008(%rbx)
movq %rax, %rsi
callq 0x39e8
movq %rax, 0x3010(%rbx)
movq %rbx, 0x80(%r14)
movslq 0x3000(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x3000(%rbx)
imulq $0x30, %rax, %rax
andq $0x0, 0x28(%rbx,%rax)
leaq 0x6320(%rip), %rcx      # 0x84d3
movq %rcx, 0x10(%rbx,%rax)
andq $0x0, 0x18(%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: advance
static void advance(Parser* parser) {
    parser->previous = parser->current;

    while (true) {
        lex_scan_token(&parser->lex, &parser->current);
        if (parser->current.type != TOKEN_ERROR) {
            return;
        }

        error(parser, &parser->current, parser->current.source,
              parser->current.source_len);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
movq 0x50(%rdi), %rax
movq %rax, 0x78(%rdi)
movups 0x30(%rdi), %xmm0
movups 0x40(%rdi), %xmm1
movups %xmm1, 0x68(%rdi)
movups %xmm0, 0x58(%rdi)
leaq 0x8(%rdi), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1778
cmpl $0x27, 0x50(%rbx)
jne 0x2214
movq 0x40(%rbx), %rdx
movq 0x48(%rbx), %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x245b
jmp 0x21ee
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: match
static bool match(Parser* parser, TokenType type) {
    if (!peek(parser, type)) {
        return false;
    }

    advance(parser);
    return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl 0x50(%rdi), %ebp
cmpl %esi, %ebp
jne 0x222b
callq 0x21c6
cmpl %ebx, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: declaration
static void declaration(Parser* parser, Vm* vm) {
    if (match(parser, TOKEN_VAR)) {
        var_declaration(parser, vm);
    } else if (match(parser, TOKEN_FUN)) {
        fn_declaration(parser, vm);
    } else {
        statement(parser, vm);
    }

    if (parser->state == PARSER_STATE_PANIC_MODE) {
        sync(parser);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3038, %rsp           # imm = 0x3038
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x25
popq %rsi
callq 0x221a
testb %al, %al
je 0x226a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24ab
jmp 0x23db
pushq $0x1c
popq %rsi
movq %rbx, %rdi
callq 0x221a
testb %al, %al
je 0x23d0
leaq 0x4673(%rip), %rdx      # 0x68f7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2932
movl %eax, %r12d
movq %rbx, %rdi
callq 0x34ee
leaq 0x10(%rsp), %r15
movl $0x3028, %edx           # imm = 0x3028
movq %r15, %rdi
xorl %esi, %esi
callq 0x1100
movq %r15, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2134
movq 0x80(%rbx), %rax
incq 0x3008(%rax)
leaq 0x463e(%rip), %rdx      # 0x690e
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2b22
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x221a
testb %al, %al
jne 0x2380
movb %r12b, 0xf(%rsp)
leaq 0x58(%rbx), %r15
leaq 0x4316(%rip), %r12      # 0x6614
leaq 0x464f(%rip), %r13      # 0x6954
pushq $0x5
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2932
movzbl %al, %esi
movq %rbx, %rdi
callq 0x2b32
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movb 0x10(%rax), %cl
cmpb $-0x1, %cl
jne 0x2356
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2b91
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movb 0x10(%rax), %cl
incb %cl
movb %cl, 0x10(%rax)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x221a
testb %al, %al
jne 0x2308
leaq 0x43de(%rip), %rdx      # 0x674e
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x2b22
movb 0xf(%rsp), %r12b
leaq 0x45a7(%rip), %rdx      # 0x692e
pushq $0x3
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2b22
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3512
movq %rbx, %rdi
callq 0x2427
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x2bbd
movzbl %al, %edx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x3270
movzbl %r12b, %esi
movq %rbx, %rdi
callq 0x2b32
jmp 0x23db
movq %rbx, %rdi
movq %r14, %rsi
callq 0x250c
cmpl $0x2, (%rbx)
jne 0x2415
movl $0x3, (%rbx)
movabsq $0x6339000000, %r14     # imm = 0x6339000000
movl 0x50(%rbx), %eax
cmpl $0x28, %eax
je 0x2415
cmpl $0x9, 0x78(%rbx)
je 0x2415
cmpl $0x26, %eax
ja 0x240b
movl %eax, %eax
btq %rax, %r14
jb 0x2415
movq %rbx, %rdi
callq 0x21c6
jmp 0x23f0
addq $0x3038, %rsp           # imm = 0x3038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: compiler_end
static ObjFunction* compiler_end(Parser* parser) {
    emit_byte(parser, OP_NIL);
    emit_byte(parser, OP_RETURN);

    ObjFunction* const fn = parser->compiler->fn;
    parser->compiler = parser->compiler->enclosing;

    return fn;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x7
popq %rsi
callq 0x2a49
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2a49
movq 0x80(%rbx), %rcx
movq 0x3010(%rcx), %rax
movq 0x3020(%rcx), %rcx
movq %rcx, 0x80(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: error
static void error(Parser* parser, const Token* token, const char* err,
                  size_t err_len) {
    switch (parser->state) {
        case PARSER_STATE_OK:
            LOG("new parser error, entering error mode err=`%.*s`\n",
                (int)err_len, err);
            parser->state = PARSER_STATE_ERROR;

            fprintf(stderr, "%zu:%zu:%.*s, got: `%.*s`\n", token->line,
                    token->column, (int)err_len, err, (int)token->source_len,
                    token->source);
            return;
        case PARSER_STATE_ERROR:
            LOG("new parser error, entering panic mode err=`%.*s`\n",
                (int)err_len, err);
            parser->state = PARSER_STATE_PANIC_MODE;
            return;
        case PARSER_STATE_PANIC_MODE:
        case PARSER_STATE_SYNCED:
            LOG("new parser error in panic mode, skipping err=`%.*s`\n",
                (int)err_len, err);
            return;
    }
}

// Assembly:
movl (%rdi), %eax
cmpl $0x1, %eax
je 0x2467
testl %eax, %eax
je 0x246e
retq
movl $0x2, (%rdi)
retq
pushq %rax
movq %rcx, %r8
movq %rdx, %r9
movq %rsi, %r10
movl $0x1, (%rdi)
movq 0x9b6b(%rip), %rax      # 0xbff0
movq (%rax), %rdi
movq (%rsi), %rdx
movq 0x8(%rsi), %rcx
movl 0x18(%rsi), %r11d
leaq 0x415f(%rip), %rsi      # 0x65f9
xorl %eax, %eax
pushq 0x10(%r10)
pushq %r11
callq 0x1140
popq %rcx
popq %rdx
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: var_declaration
static void var_declaration(Parser* parser, Vm* vm) {
    const uint8_t arg = variable_name(parser, vm, "Expected variable name");

    if (match(parser, TOKEN_EQUAL)) {
        expression(parser, vm);
    } else {
        emit_byte(parser, OP_NIL);
    }

    expect(parser, TOKEN_SEMICOLON,
           "Expected semicolon after variable declaration");

    define_variable(parser, arg);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4158(%rip), %rdx      # 0x6614
callq 0x2932
movl %eax, %ebp
pushq $0xe
popq %rsi
movq %rbx, %rdi
callq 0x221a
testb %al, %al
je 0x24df
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a3e
jmp 0x24ea
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x2a49
leaq 0x413a(%rip), %rdx      # 0x662b
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x2b22
movzbl %bpl, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2b32
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: variable_name
static uint8_t variable_name(Parser* parser, Vm* vm, const char err[]) {
    expect(parser, TOKEN_IDENTIFIER, err);

    declare_variable(parser);
    // Globals are resolved at runtime
    if (parser->compiler->scope_depth > 0) {
        return 0;
    }

    return make_identifier_constant(parser, vm);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x14
popq %rsi
callq 0x2b22
movq 0x80(%r14), %rax
cmpq $0x0, 0x3008(%rax)
je 0x2a0f
leaq 0x58(%r14), %r15
movl 0x3000(%rax), %eax
leal 0x1(%rax), %ebp
imulq $0x30, %rax, %rcx
addq $-0x8, %rcx
movq 0x80(%r14), %rax
decl %ebp
testl %ebp, %ebp
jle 0x29bd
movq (%rax,%rcx), %rdx
cmpq $-0x1, %rdx
je 0x2992
cmpq 0x3008(%rax), %rdx
jl 0x29bd
leaq -0x30(%rcx), %r12
movq -0x18(%rax,%rcx), %rdi
movq -0x10(%rax,%rcx), %rsi
movq 0x68(%r14), %rdx
movq 0x70(%r14), %rcx
callq 0x38c5
movq %r12, %rcx
testb %al, %al
je 0x2972
leaq 0x3c9e(%rip), %rdx      # 0x6659
jmp 0x29d4
movslq 0x3000(%rax), %rcx
cmpq $0xff, %rcx
jne 0x29e1
leaq 0x3cbd(%rip), %rdx      # 0x6691
movq %r14, %rdi
movq %r15, %rsi
callq 0x2b91
jmp 0x2a0f
leal 0x1(%rcx), %edx
movl %edx, 0x3000(%rax)
imulq $0x30, %rcx, %rcx
movq 0x20(%r15), %rdx
movq %rdx, 0x20(%rax,%rcx)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
orq $-0x1, 0x28(%rax,%rcx)
movq 0x80(%r14), %rax
cmpq $0x0, 0x3008(%rax)
jle 0x2a2b
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2b54
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: emit_byte
static void emit_byte(Parser* parser, uint8_t byte) {
    LOG("byte=%d opcode=%s\n", byte, opcode_str[byte]);
    Location loc = {.line = parser->previous.line,
                    .column = parser->previous.column};
    buf_push(parser->compiler->fn->chunk.locations, loc);
    buf_push(parser->compiler->fn->chunk.opcodes, byte);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
movups 0x58(%rdi), %xmm0
movq 0x80(%rdi), %rax
movq 0x3010(%rax), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x2a8d
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rdx
cmpq %rdx, %rsi
jne 0x2ab9
movaps %xmm0, (%rsp)
testq %rsi, %rsi
pushq $0x8
popq %rdx
cmovneq %rsi, %rdx
jmp 0x2a94
movaps %xmm0, (%rsp)
pushq $0x8
popq %rdx
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0x2c56
movq 0x80(%r14), %rcx
movq 0x3010(%rcx), %rcx
movq %rax, 0x20(%rcx)
movq -0x8(%rax), %rdx
movaps (%rsp), %xmm0
leaq 0x1(%rdx), %rsi
movq %rsi, -0x8(%rax)
shlq $0x4, %rdx
movups %xmm0, (%rax,%rdx)
movq 0x18(%rcx), %rax
testq %rax, %rax
je 0x2aeb
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rcx
cmpq %rcx, %rsi
jne 0x2b0f
testq %rsi, %rsi
pushq $0x8
popq %rdx
cmovneq %rsi, %rdx
jmp 0x2aee
pushq $0x8
popq %rdx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2c56
movq 0x80(%r14), %rcx
movq 0x3010(%rcx), %rcx
movq %rax, 0x18(%rcx)
movq -0x8(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, -0x8(%rax)
movb %bl, (%rax,%rcx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: make_identifier_constant
static uint8_t make_identifier_constant(Parser* parser, Vm* vm) {
    ObjString* const os =
        value_make_string(&vm->objects, parser->previous.source_len);
    memcpy(os->s, parser->previous.source, os->len);

    return make_constant(parser, OBJ_VAL(os));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x40008(%rsi), %rdi
movq 0x70(%rbx), %rsi
callq 0x399c
movq %rax, %r14
leaq 0x18(%rax), %rdi
movq 0x68(%rbx), %rsi
movq 0x10(%rax), %rdx
callq 0x1160
pushq $0x3
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2bbd
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: make_constant
static uint8_t make_constant(Parser* parser, Value v) {
    buf_push(parser->compiler->fn->chunk.constants, v);
    const size_t constant_i =
        buf_size(parser->compiler->fn->chunk.constants) - 1;

    return (uint8_t)constant_i;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x80(%rdi), %rax
movq 0x3010(%rax), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x2bf9
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rcx
cmpq %rcx, %rsi
jne 0x2c1d
testq %rsi, %rsi
pushq $0x8
popq %rdx
cmovneq %rsi, %rdx
jmp 0x2bfc
pushq $0x8
popq %rdx
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0x2c56
movq 0x80(%r14), %rcx
movq 0x3010(%rcx), %rcx
movq %rax, 0x28(%rcx)
movq -0x8(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, -0x8(%rax)
shlq $0x4, %rcx
movl %ebp, (%rax,%rcx)
movq %rbx, 0x8(%rax,%rcx)
movq 0x80(%r14), %rax
movq 0x3010(%rax), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x2c4f
movb -0x8(%rax), %al
decb %al
jmp 0x2c51
movb $-0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/./buf.h
// Function: buf_grow1
static void *buf_grow1(void *v, size_t esize, ptrdiff_t n) {
    struct buf *p;
    size_t max = (size_t)-1 - sizeof(struct buf);
    if (v) {
        p = buf_ptr(v);
        if (n > 0 && p->capacity + (size_t)n > max / esize)
            goto fail; /* overflow */
        p = realloc(p, sizeof(struct buf) + esize * (p->capacity + (size_t)n));
        if (!p) goto fail;
        p->capacity += (size_t)n;
        if (p->size > p->capacity) p->size = p->capacity;
    } else {
        if ((size_t)n > max / esize) goto fail; /* overflow */
        p = malloc(sizeof(struct buf) + esize * (size_t)n);
        if (!p) goto fail;
        p->capacity = (size_t)n;
        p->size = 0;
    }
    return p->buffer;
fail:
    BUF_ABORT;
    return 0;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
testq %rdi, %rdi
je 0x2ca3
movq -0x10(%rdi), %rcx
addq %rbx, %rcx
testq %rbx, %rbx
jle 0x2c78
pushq $-0x11
popq %rax
xorl %edx, %edx
divq %rsi
cmpq %rax, %rcx
ja 0x2cd3
addq $-0x10, %rdi
imulq %rsi, %rcx
addq $0x10, %rcx
movq %rcx, %rsi
callq 0x11a0
testq %rax, %rax
je 0x2cd3
addq (%rax), %rbx
movq %rbx, (%rax)
cmpq %rbx, 0x8(%rax)
jbe 0x2ccd
movq %rbx, 0x8(%rax)
jmp 0x2ccd
pushq $-0x11
popq %rax
xorl %edx, %edx
divq %rsi
cmpq %rbx, %rax
jb 0x2cd3
imulq %rbx, %rsi
addq $0x10, %rsi
movq %rsi, %rdi
callq 0x1170
testq %rax, %rax
je 0x2cd3
movq %rbx, (%rax)
andq $0x0, 0x8(%rax)
addq $0x10, %rax
popq %rbx
retq
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: precedence
static void precedence(Parser* parser, Precedence precedence, Vm* vm) {
    LOG("precedence=%s previous_type=%s current_type=%s\n",
        precedence_str[precedence], token_type_str[parser->previous.type],
        token_type_str[parser->current.type]);
    advance(parser);
    LOG("precedence=%s previous_type=%s current_type=%s\n",
        precedence_str[precedence], token_type_str[parser->previous.type],
        token_type_str[parser->current.type]);

    const ParseFn prefix_rule = rules[parser->previous.type].prefix;
    if (!prefix_rule) {
        error_str_nul(parser, &parser->previous, "Expected expression");
        return;
    }

    const bool canAssign = precedence <= PREC_ASSIGNMENT;
    LOG("precedence=%d canAssign=%d previous_type=%d\n", precedence, canAssign,
        parser->previous.type);
    prefix_rule(parser, vm, canAssign);
    LOG("precedence=%d canAssign=%d\n", precedence, canAssign);

    while (!peek(parser, TOKEN_EOF) &&
           (precedence <= rules[parser->current.type].precedence)) {
        LOG("precedence=%d\n", precedence);
        advance(parser);

        const ParseFn infix_rule = rules[parser->previous.type].infix;

        infix_rule(parser, vm, canAssign);
    }

    if (canAssign && peek(parser, TOKEN_EQUAL)) {
        error_str_nul(parser, &parser->previous,
                      "Expression cannot be assigned");
        return;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
callq 0x21c6
movl 0x78(%rbx), %eax
imulq $0x18, %rax, %rax
leaq 0x8d05(%rip), %r12      # 0xba00
movq (%rax,%r12), %rax
testq %rax, %rax
je 0x2d51
xorl %edx, %edx
cmpl $0x2, %ebp
setb %dl
movq %rbx, %rdi
movq %r14, %rsi
callq *%rax
movl 0x50(%rbx), %eax
cmpq $0x28, %rax
je 0x2d85
imulq $0x18, %rax, %rcx
cmpl %ebp, 0x10(%rcx,%r12)
jb 0x2d5a
xorl %r15d, %r15d
cmpl $0x2, %ebp
setb %r15b
movq %rbx, %rdi
callq 0x21c6
movl 0x78(%rbx), %eax
imulq $0x18, %rax, %rax
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq *0x8(%rax,%r12)
jmp 0x2d14
leaq 0x3963(%rip), %rdx      # 0x66bb
jmp 0x2d71
cmpl $0x2, %ebp
setae %cl
cmpl $0xe, %eax
setne %al
orb %cl, %al
jne 0x2d85
leaq 0x395e(%rip), %rdx      # 0x66cf
leaq 0x58(%rbx), %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2b91
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: unary
static void unary(Parser* parser, Vm* vm, bool canAssign) {
    (void)canAssign;
    const TokenType previousType = parser->previous.type;

    precedence(parser, PREC_UNARY, vm);

    switch (previousType) {
        case TOKEN_MINUS:
            emit_byte(parser, OP_NEGATE);
            break;
        case TOKEN_BANG:
            emit_byte(parser, OP_NOT);
            break;
        default:
            UNREACHABLE();
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rdx
movq %rdi, %rbx
movl 0x78(%rdi), %ebp
pushq $0x8
popq %rsi
callq 0x2cd8
movb $0x2, %al
cmpl $0x7, %ebp
je 0x2e5e
cmpl $0xc, %ebp
jne 0x2e6f
movb $0xa, %al
movzbl %al, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2a49
movq 0x917a(%rip), %rax      # 0xbff0
movq (%rax), %rdi
leaq 0x38f4(%rip), %rsi      # 0x6774
leaq 0x393c(%rip), %rdx      # 0x67c3
leaq 0x393d(%rip), %r8       # 0x67cb
movl $0x169, %ecx            # imm = 0x169
xorl %eax, %eax
callq 0x1140
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: binary
static void binary(Parser* parser, Vm* vm, bool canAssign) {
    (void)canAssign;
    const TokenType previousType = parser->previous.type;

    const ParseRule* const rule = &rules[previousType];
    precedence(parser, rule->precedence + 1, vm);

    switch (previousType) {
        case TOKEN_PLUS:
            emit_byte(parser, OP_ADD);
            break;
        case TOKEN_MINUS:
            emit_byte(parser, OP_SUBTRACT);
            break;
        case TOKEN_STAR:
            emit_byte(parser, OP_MULTIPLY);
            break;
        case TOKEN_SLASH:
            emit_byte(parser, OP_DIVIDE);
            break;
        case TOKEN_EQUAL_EQUAL:
            emit_byte(parser, OP_EQUAL);
            break;
        case TOKEN_BANG_EQUAL:
            emit_byte(parser, OP_EQUAL);
            emit_byte(parser, OP_NOT);
            break;
        case TOKEN_GREATER:
            emit_byte(parser, OP_GREATER);
            break;
        case TOKEN_GREATER_EQUAL:
            emit_byte(parser, OP_LESS);
            emit_byte(parser, OP_NOT);
            break;
        case TOKEN_LESS:
            emit_byte(parser, OP_LESS);
            break;
        case TOKEN_LESS_EQUAL:
            emit_byte(parser, OP_GREATER);
            emit_byte(parser, OP_NOT);
            break;
        default:
            UNREACHABLE();
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rdx
movq %rdi, %rbx
movl 0x78(%rdi), %r14d
imulq $0x18, %r14, %rax
leaq 0x8b48(%rip), %rcx      # 0xba00
movl 0x10(%rax,%rcx), %esi
incl %esi
callq 0x2cd8
leal -0x7(%r14), %eax
cmpl $0xc, %eax
ja 0x2f1f
leaq 0x362d(%rip), %rcx      # 0x6500
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x4, %al
jmp 0x2f0d
pushq $0xc
jmp 0x2efa
movb $0xd, %al
jmp 0x2f0d
pushq $0xb
jmp 0x2efa
movb $0x3, %al
jmp 0x2f0d
movb $0xb, %al
jmp 0x2f0d
movb $0x6, %al
jmp 0x2f0d
pushq $0xd
popq %rsi
movq %rbx, %rdi
callq 0x2a49
movb $0xa, %al
jmp 0x2f0d
movb $0x5, %al
jmp 0x2f0d
movb $0xc, %al
movzbl %al, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2a49
movq 0x90ca(%rip), %rax      # 0xbff0
movq (%rax), %rdi
leaq 0x3844(%rip), %rsi      # 0x6774
leaq 0x388c(%rip), %rdx      # 0x67c3
leaq 0x3893(%rip), %r8       # 0x67d1
movl $0x197, %ecx            # imm = 0x197
xorl %eax, %eax
callq 0x1140
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: string
static void string(Parser* parser, Vm* vm, bool canAssign) {
    (void)canAssign;
    assert(parser->previous.type == TOKEN_STRING);

    ObjString* const os =
        value_make_string(&vm->objects, parser->previous.source_len);
    memcpy(os->s, parser->previous.source, os->len);
    const Value v = OBJ_VAL(os);

    buf_push(parser->compiler->fn->chunk.constants, v);
    emit_byte2(
        parser, OP_CONSTANT,
        (uint8_t)((intmax_t)buf_size(parser->compiler->fn->chunk.constants) -
                  1));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x15, 0x78(%rdi)
jne 0x310b
movq %rdi, %rbx
addq $0x40008, %rsi          # imm = 0x40008
movq 0x70(%rdi), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x399c
movq %rax, %r14
movq 0x68(%rbx), %rsi
movq 0x10(%rax), %rdx
leaq 0x18(%rax), %rdi
callq 0x1160
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x309a
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rcx
cmpq %rcx, %rsi
jne 0x30be
testq %rsi, %rsi
pushq $0x8
popq %rdx
cmovneq %rsi, %rdx
jmp 0x309d
pushq $0x8
popq %rdx
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0x2c56
movq 0x80(%rbx), %rcx
movq 0x3010(%rcx), %rcx
movq %rax, 0x28(%rcx)
movq -0x8(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, -0x8(%rax)
shlq $0x4, %rcx
movl $0x3, (%rax,%rcx)
movq %r14, 0x8(%rax,%rcx)
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x30f4
movb -0x8(%rax), %al
decb %al
jmp 0x30f6
movb $-0x1, %al
movzbl %al, %edx
pushq $0x1
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3270
leaq 0x36f8(%rip), %rdi      # 0x680a
leaq 0x36aa(%rip), %rsi      # 0x67c3
leaq 0x3710(%rip), %rcx      # 0x6830
movl $0x101, %edx            # imm = 0x101
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: number
static void number(Parser* parser, Vm* vm, bool canAssign) {
    (void)canAssign;
    (void)vm;
    assert(parser->previous.type == TOKEN_NUMBER);

    const double number = strtod(parser->previous.source, NULL);
    const Value v = NUMBER_VAL(number);

    emit_byte2(parser, OP_CONSTANT, make_constant(parser, v));
}

// Assembly:
pushq %rbx
cmpl $0x16, 0x78(%rdi)
jne 0x315e
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
xorl %esi, %esi
callq 0x1080
movq %xmm0, %rdx
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x2bbd
movzbl %al, %edx
pushq $0x1
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x3270
leaq 0x36ee(%rip), %rdi      # 0x6853
leaq 0x3657(%rip), %rsi      # 0x67c3
leaq 0x3706(%rip), %rcx      # 0x6879
movl $0xf7, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: and
static void and (Parser * parser, Vm* vm, bool canAssign) {
    (void)canAssign;

    const intmax_t end_jump = jump_emit(parser, OP_JUMP_IF_FALSE);
    emit_byte(parser, OP_POP);

    precedence(parser, PREC_AND, vm);

    jump_patch(parser, end_jump);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x15
popq %rsi
callq 0x3405
movq %rax, %r15
pushq $0xf
popq %rsi
movq %r14, %rdi
callq 0x2a49
pushq $0x3
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2cd8
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x344e
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: literal
static void literal(Parser* parser, Vm* vm, bool canAssign) {
    (void)canAssign;
    (void)vm;

    switch (parser->previous.type) {
        case TOKEN_NIL:
            emit_byte(parser, OP_NIL);
            break;
        case TOKEN_TRUE:
            emit_byte(parser, OP_TRUE);
            break;
        case TOKEN_FALSE:
            emit_byte(parser, OP_FALSE);
            break;
        default:
            UNREACHABLE();
    }
}

// Assembly:
movl 0x78(%rdi), %ecx
cmpl $0x1a, %ecx
je 0x31d4
movb $0x7, %al
cmpl $0x1e, %ecx
je 0x31d6
cmpl $0x24, %ecx
jne 0x31de
movb $0x8, %al
jmp 0x31d6
movb $0x9, %al
movzbl %al, %esi
jmp 0x2a49
pushq %rax
movq 0x8e0a(%rip), %rax      # 0xbff0
movq (%rax), %rdi
leaq 0x3584(%rip), %rsi      # 0x6774
leaq 0x35cc(%rip), %rdx      # 0x67c3
leaq 0x36f1(%rip), %r8       # 0x68ef
movl $0x151, %ecx            # imm = 0x151
xorl %eax, %eax
callq 0x1140
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: or
static void or (Parser * parser, Vm* vm, bool canAssign) {
    (void)canAssign;

    const intmax_t else_jump = jump_emit(parser, OP_JUMP_IF_FALSE);
    const intmax_t end_jump = jump_emit(parser, OP_JUMP);
    jump_patch(parser, else_jump);

    emit_byte(parser, OP_POP);

    precedence(parser, PREC_OR, vm);
    jump_patch(parser, end_jump);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x15
popq %rsi
callq 0x3405
movq %rax, %r15
pushq $0x16
popq %rsi
movq %rbx, %rdi
callq 0x3405
movq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0x344e
pushq $0xf
popq %rsi
movq %rbx, %rdi
callq 0x2a49
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2cd8
movq %rbx, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x344e
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: emit_byte2
static void emit_byte2(Parser* parser, uint8_t byte1, uint8_t byte2) {
    LOG("opcode1=%s byte2=%d\n", opcode_str[byte1], byte2);
    Location loc = {.line = parser->previous.line,
                    .column = parser->previous.column};
    buf_push(parser->compiler->fn->chunk.locations, loc);
    buf_push(parser->compiler->fn->chunk.opcodes, byte1);
    buf_push(parser->compiler->fn->chunk.locations, loc);
    buf_push(parser->compiler->fn->chunk.opcodes, byte2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq 0x58(%rdi), %r15
movq 0x60(%rdi), %r12
movq 0x80(%rdi), %rax
movq 0x3010(%rax), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x32b7
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rdx
cmpq %rdx, %rsi
jne 0x32db
testq %rsi, %rsi
pushq $0x8
popq %rdx
cmovneq %rsi, %rdx
jmp 0x32ba
pushq $0x8
popq %rdx
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0x2c56
movq 0x80(%r14), %rcx
movq 0x3010(%rcx), %rcx
movq %rax, 0x20(%rcx)
movq -0x8(%rax), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, -0x8(%rax)
shlq $0x4, %rdx
movq %r15, (%rax,%rdx)
movq %r12, 0x8(%rax,%rdx)
movq 0x18(%rcx), %rax
testq %rax, %rax
je 0x3312
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rcx
cmpq %rcx, %rsi
jne 0x3336
testq %rsi, %rsi
pushq $0x8
popq %rdx
cmovneq %rsi, %rdx
jmp 0x3315
pushq $0x8
popq %rdx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2c56
movq 0x80(%r14), %rcx
movq 0x3010(%rcx), %rcx
movq %rax, 0x18(%rcx)
movq -0x8(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, -0x8(%rax)
movb %bpl, (%rax,%rcx)
movq 0x80(%r14), %rax
movq 0x3010(%rax), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x3372
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rdx
cmpq %rdx, %rsi
jne 0x3396
testq %rsi, %rsi
pushq $0x8
popq %rdx
cmovneq %rsi, %rdx
jmp 0x3375
pushq $0x8
popq %rdx
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0x2c56
movq 0x80(%r14), %rcx
movq 0x3010(%rcx), %rcx
movq %rax, 0x20(%rcx)
movq -0x8(%rax), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, -0x8(%rax)
shlq $0x4, %rdx
movq %r15, (%rax,%rdx)
movq %r12, 0x8(%rax,%rdx)
movq 0x18(%rcx), %rax
testq %rax, %rax
je 0x33cd
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rcx
cmpq %rcx, %rsi
jne 0x33f1
testq %rsi, %rsi
pushq $0x8
popq %rdx
cmovneq %rsi, %rdx
jmp 0x33d0
pushq $0x8
popq %rdx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2c56
movq 0x80(%r14), %rcx
movq 0x3010(%rcx), %rcx
movq %rax, 0x18(%rcx)
movq -0x8(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, -0x8(%rax)
movb %bl, (%rax,%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: jump_emit
static intmax_t jump_emit(Parser* parser, uint8_t op) {
    emit_byte(parser, op);
    emit_byte(parser, UINT8_MAX);
    emit_byte(parser, UINT8_MAX);

    return (intmax_t)(buf_size(parser->compiler->fn->chunk.opcodes) - 2);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2a49
movq %rbx, %rdi
movl $0xff, %esi
callq 0x2a49
movq %rbx, %rdi
movl $0xff, %esi
callq 0x2a49
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x3449
movq -0x8(%rax), %rax
addq $-0x2, %rax
jmp 0x344c
pushq $-0x2
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: jump_patch
static void jump_patch(Parser* parser, intmax_t offset) {
    const intmax_t jump =
        (intmax_t)buf_size(parser->compiler->fn->chunk.opcodes) - offset - 2;
    assert(jump >= 0);

    if (jump > UINT16_MAX) {
        error_str_nul(parser, &parser->previous,
                      "Reached jump limit for the `if` body");
    }

    const uint16_t u16_jump = (uint16_t)jump;
    LOG("patch jump=%hu\n", u16_jump);
    const uint8_t b1 = (u16_jump >> (uint8_t)8);
    const uint8_t b2 = (uint8_t)u16_jump;

    parser->compiler->fn->chunk.opcodes[offset] = b1;
    parser->compiler->fn->chunk.opcodes[offset + 1] = b2;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbp
movq %rdi, %r14
movq 0x80(%rdi), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x3475
movq -0x8(%rax), %rbx
jmp 0x3477
xorl %ebx, %ebx
subq %rbp, %rbx
cmpq $0x1, %rbx
jle 0x34cf
cmpq $0x10002, %rbx          # imm = 0x10002
jb 0x34ae
leaq 0x58(%r14), %rsi
leaq 0x3436(%rip), %rdx      # 0x68ca
movq %r14, %rdi
callq 0x2b91
movq 0x80(%r14), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
addl $-0x2, %ebx
movb %bh, (%rax,%rbp)
movq 0x80(%r14), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
movb %bl, 0x1(%rax,%rbp)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x33c6(%rip), %rdi      # 0x689c
leaq 0x32e6(%rip), %rsi      # 0x67c3
leaq 0x33c2(%rip), %rcx      # 0x68a6
movl $0x1cf, %edx            # imm = 0x1CF
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: end_scope
static void end_scope(Parser* parser) {
    parser->compiler->scope_depth -= 1;

    while (parser->compiler->locals_len > 0 &&
           parser->compiler->locals[parser->compiler->locals_len - 1].depth >
               parser->compiler->scope_depth) {
        emit_byte(parser, OP_POP);
        parser->compiler->locals_len -= 1;
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x80(%rdi), %rax
decq 0x3008(%rax)
movl 0x3000(%rax), %ecx
pushq $0xf
popq %rbp
testl %ecx, %ecx
jle 0x35a5
decl %ecx
imulq $0x30, %rcx, %rcx
movq 0x28(%rax,%rcx), %rcx
cmpq 0x3008(%rax), %rcx
jle 0x35a5
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2a49
movq 0x80(%rbx), %rax
movl 0x3000(%rax), %ecx
decl %ecx
movl %ecx, 0x3000(%rax)
jmp 0x356c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: expr_stmt
static void expr_stmt(Parser* parser, Vm* vm) {
    expression(parser, vm);
    expect(parser, TOKEN_SEMICOLON,
           "Expected terminating semicolon after expression");
    emit_byte(parser, OP_POP);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2a3e
leaq 0x3573(%rip), %rdx      # 0x6b2f
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x2b22
pushq $0xf
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2a49
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/parse.c
// Function: emit_loop
static void emit_loop(Parser* parser, size_t loop_start) {
    emit_byte(parser, OP_LOOP);

    const intmax_t jump = (intmax_t)(
        buf_size(parser->compiler->fn->chunk.opcodes) - loop_start + 2);
    assert(jump >= 0);

    if (jump > UINT16_MAX) {
        error_str_nul(parser, &parser->previous,
                      "Reached jump limit for the for-loop body");
    }

    const uint16_t u16_jump = (uint16_t)jump;
    const uint8_t b1 = (u16_jump >> (uint8_t)8);
    const uint8_t b2 = (uint8_t)u16_jump;

    emit_byte(parser, b1);
    emit_byte(parser, b2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x17
popq %rsi
callq 0x2a49
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x3605
movq -0x8(%rax), %r14
jmp 0x3608
xorl %r14d, %r14d
subq %r15, %r14
addq $0x2, %r14
js 0x365a
cmpq $0x10000, %r14          # imm = 0x10000
jb 0x362d
leaq 0x58(%rbx), %rsi
leaq 0x3438(%rip), %rdx      # 0x6a5d
movq %rbx, %rdi
callq 0x2b91
movl %r14d, %esi
shrl $0x8, %esi
movl $0xff, %ebp
andl %ebp, %esi
movq %rbx, %rdi
callq 0x2a49
andl %ebp, %r14d
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2a49
leaq 0x323b(%rip), %rdi      # 0x689c
leaq 0x315b(%rip), %rsi      # 0x67c3
leaq 0x33cd(%rip), %rcx      # 0x6a3c
movl $0x22e, %edx            # imm = 0x22E
callq 0x10f0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/utils.c
// Function: realloc_safe
void* realloc_safe(void** ptr, size_t new_size, const char* func, int line) {
    if ((*ptr = realloc(*ptr, new_size)) == NULL) {
        fprintf(stderr, "%s:%d: Could not allocate %zu bytes of memory\n", func,
                line, new_size);
        exit(ENOMEM);
    }
    LOG("func=%s line=%d allocated=%zu\n", func, line, new_size);

    return *ptr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
movq (%rdi), %rdi
callq 0x11a0
movq %rax, (%r12)
testq %rax, %rax
je 0x36ac
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x893d(%rip), %rax      # 0xbff0
movq (%rax), %rdi
leaq 0x34a2(%rip), %rsi      # 0x6b5f
movq %r15, %rdx
movl %ebx, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x1140
pushq $0xc
popq %rdi
callq 0x11e0
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/utils.c
// Function: read_stdin
void read_stdin(char** content, size_t* content_len) {
    char buf[BUF_LEN] = "";

    ssize_t effectivily_read = 0;
    while ((effectivily_read = read(0, buf, BUF_LEN)) > 0) {
        *content_len += (size_t)effectivily_read;
        REALLOC_SAFE(content, *content_len);

        memcpy(*content + *content_len - effectivily_read, buf,
               (size_t)effectivily_read);
    }
    if (effectivily_read == -1) {
        fprintf(stderr, "Error reading from stdin: errno=%s error=%d\n",
                strerror(errno), errno);
        exit(errno);
    }
    LOG("content_len=%zu\n", *content_len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, 0x50(%r15)
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
andl $0x0, 0x60(%r15)
movaps %xmm0, (%r15)
pushq $0x64
popq %r12
pushq $0x1a
popq %rbp
xorl %edi, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1110
movq %rax, %r13
testq %rax, %rax
jle 0x375c
movq (%rbx), %rsi
addq %r13, %rsi
movq %rsi, (%rbx)
movq %r14, %rdi
leaq 0x344f(%rip), %rdx      # 0x6b8e
movl %ebp, %ecx
callq 0x367c
movq (%r14), %rdi
addq (%rbx), %rdi
subq %r13, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1160
jmp 0x3717
cmpq $-0x1, %r13
je 0x3771
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8878(%rip), %rax      # 0xbff0
movq (%rax), %rbx
callq 0x1050
movq %rax, %r14
movl (%rax), %edi
callq 0x11f0
movl (%r14), %ecx
leaq 0x3405(%rip), %rsi      # 0x6b99
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1140
movl (%r14), %edi
callq 0x11e0
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/utils.c
// Function: read_file
void read_file(const char path[], char** content, size_t* content_len) {
    FILE* file = NULL;

    if ((file = fopen(path, "r")) == NULL) {
        fprintf(stderr, "Could not open the file `%s`: errno=%d error=%s\n",
                path, errno, strerror(errno));
        exit(errno);
    }

    int ret = 0;
    if ((ret = fseek(file, 0, SEEK_END)) != 0) {
        fprintf(stderr,
                "Could not move the file cursor to the end of the file `%s`: "
                "errno=%d error=%s\n",
                path, errno, strerror(errno));
        exit(errno);
    }
    const size_t file_size = (size_t)ftell(file);

    rewind(file);

    REALLOC_SAFE(content, file_size + 1);
    (*content)[file_size] = '\0';

    const size_t bytes_read = fread(*content, 1, file_size, file);
    if (bytes_read != file_size) {
        fprintf(stderr,
                "Could not read whole file: bytes_read=%zu file_size=%zu\n",
                bytes_read, file_size);
        exit(EIO);
    }
    *content_len = bytes_read;

    fclose(file);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
leaq 0x2cf0(%rip), %rsi      # 0x64b1
callq 0x11c0
testq %rax, %rax
je 0x383f
movq %rax, %r15
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x1190
testl %eax, %eax
jne 0x3863
movq %r15, %rdi
callq 0x1150
movq %rax, %r14
movq %r15, %rdi
callq 0x10c0
leaq 0x1(%r14), %rsi
leaq 0x3445(%rip), %rdx      # 0x6c46
pushq $0x3c
popq %rcx
movq %r12, %rdi
callq 0x367c
movq (%r12), %rax
movb $0x0, (%rax,%r14)
movq (%r12), %rdi
pushq $0x1
popq %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x1070
cmpq %r14, %rax
jne 0x389f
movq %r14, (%rbx)
movq %r15, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1090
movq 0x87aa(%rip), %rax      # 0xbff0
movq (%rax), %rbx
callq 0x1050
movq %rax, %r15
movl (%rax), %ebp
movl %ebp, %edi
callq 0x11f0
leaq 0x3365(%rip), %rsi      # 0x6bc6
jmp 0x3885
movq 0x8786(%rip), %rax      # 0xbff0
movq (%rax), %rbx
callq 0x1050
movq %rax, %r15
movl (%rax), %ebp
movl %ebp, %edi
callq 0x11f0
leaq 0x3372(%rip), %rsi      # 0x6bf7
movq %rbx, %rdi
movq %r14, %rdx
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x1140
movl (%r15), %edi
callq 0x11e0
movq 0x874a(%rip), %rcx      # 0xbff0
movq (%rcx), %rdi
leaq 0x33a0(%rip), %rsi      # 0x6c50
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1140
pushq $0x5
popq %rdi
callq 0x11e0
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/value.c
// Function: value_eq
bool value_eq(Value lhs, Value rhs) {
    if (lhs.type != rhs.type) {
        return false;
    }

    switch (lhs.type) {
        case VAL_BOOL:
            return AS_BOOL(lhs) == AS_BOOL(rhs);
        case VAL_NIL:
            return true;
        case VAL_NUMBER:
            return fabs(AS_NUMBER(lhs) - AS_NUMBER(rhs)) < DBL_EPSILON;
        case VAL_OBJ:
            if (!IS_STRING(lhs) || !IS_STRING(rhs)) {
                return false;
            }

            if (AS_STRING(lhs)->len != AS_STRING(rhs)->len) {
                return false;
            }
            return memcmp(AS_STRING(lhs)->s, AS_STRING(rhs)->s,
                          AS_STRING(lhs)->len) == 0;
    }
}

// Assembly:
cmpl %edx, %edi
jne 0x398b
cmpl $0x3, %edi
je 0x3959
cmpl $0x2, %edi
je 0x3933
movb $0x1, %al
testl %edi, %edi
jne 0x3932
xorl %esi, %ecx
testb $0x1, %cl
sete %al
retq
movq %rsi, %xmm0
movq %rcx, %xmm1
subsd %xmm1, %xmm0
andpd 0x3347(%rip), %xmm0     # 0x6c90
movsd 0x334f(%rip), %xmm1     # 0x6ca0
ucomisd %xmm0, %xmm1
seta %al
retq
cmpl $0x0, (%rsi)
jne 0x398b
cmpl $0x0, (%rcx)
jne 0x398b
movq 0x10(%rsi), %rdx
cmpq 0x10(%rcx), %rdx
jne 0x398b
pushq %rax
addq $0x18, %rsi
addq $0x18, %rcx
movq %rsi, %rdi
movq %rcx, %rsi
callq 0x1180
testl %eax, %eax
sete %al
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/value.c
// Function: value_make_string
ObjString* value_make_string(Obj** objects, size_t s_len) {
    ObjString* os = value_obj_str_allocate(objects, sizeof(ObjString) + s_len);
    os->len = s_len;
    LOG("allocated string size=%zu\n", os->len);
    os->obj.type = OBJ_STRING;

    return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
addq $0x18, %rsi
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
leaq 0x338d(%rip), %rdx      # 0x6d4c
pushq $0x2a
popq %rcx
movq %r15, %rdi
callq 0x367c
movq (%r14), %rcx
movq (%r15), %rax
movq %rcx, 0x8(%rax)
movq %rax, (%r14)
movq %rbx, 0x10(%rax)
andl $0x0, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/value.c
// Function: value_make_fn
ObjFunction* value_make_fn(const char* name, size_t name_len) {
    ObjFunction* fn = NULL;
    REALLOC_SAFE(&fn, sizeof(ObjFunction) + name_len);
    fn->obj.type = OBJ_FUNCTION;
    fn->arity = 0;
    fn->chunk = (Chunk){0};
    memcpy(fn->name, name, name_len);
    fn->name_len = name_len;
    return fn;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
addq $0x38, %rsi
leaq 0x32bd(%rip), %rdx      # 0x6cc8
pushq $0x41
popq %rcx
movq %r15, %rdi
callq 0x367c
movq (%r15), %r15
movl $0x1, (%r15)
movb $0x0, 0x10(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r15)
andq $0x0, 0x28(%r15)
leaq 0x38(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1160
movq %rbx, 0x30(%r15)
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gaultier[P]lox-c/value.c
// Function: value_make_fn_native
ObjNative* value_make_fn_native(NativeFn fn) {
    ObjNative* n = NULL;
    REALLOC_SAFE(&n, sizeof(ObjNative));
    n->obj.type = OBJ_NATIVE;
    n->fn = fn;

    return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
andq $0x0, (%r14)
leaq 0x326f(%rip), %rdx      # 0x6cd6
pushq $0x18
popq %rsi
pushq $0x4c
popq %rcx
movq %r14, %rdi
callq 0x367c
movq (%r14), %rax
movl $0x2, (%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq