LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x38ec
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rcx
cmpq %rcx, %rsi
jne 0x3914
testq %rsi, %rsi
movl $0x8, %edx
cmovneq %rsi, %rdx
jmp 0x38f1
movl $0x8, %edx
movl $0x10, %esi
movq %rax, %rdi
callq 0x394d
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 0x3946
movb -0x8(%rax), %al
decb %al
jmp 0x3948
movb $-0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x399e
movq -0x10(%rdi), %rcx
addq %rbx, %rcx
testq %rbx, %rbx
jle 0x3973
movq $-0x11, %rax
xorl %edx, %edx
divq %rsi
cmpq %rax, %rcx
ja 0x39d5
addq $-0x10, %rdi
imulq %rsi, %rcx
addq $0x10, %rcx
movq %rcx, %rsi
callq 0x11a0
testq %rax, %rax
je 0x39d5
addq (%rax), %rbx
movq %rbx, (%rax)
cmpq %rbx, 0x8(%rax)
jbe 0x39cf
movq %rbx, 0x8(%rax)
jmp 0x39cf
movq $-0x11, %rax
xorl %edx, %edx
divq %rsi
cmpq %rbx, %rax
jb 0x39d5
imulq %rbx, %rsi
addq $0x10, %rsi
movq %rsi, %rdi
callq 0x1170
testq %rax, %rax
je 0x39d5
movq %rbx, (%rax)
movq $0x0, 0x8(%rax)
addq $0x10, %rax
popq %rbx
retq
callq 0x1040
// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
callq 0x2e64
leaq 0x58(%rbx), %r14
movl 0x78(%rbx), %eax
leaq (%rax,%rax,2), %rax
leaq 0x8ffc(%rip), %r13      # 0xca00
movq (%r13,%rax,8), %rax
testq %rax, %rax
je 0x3a5c
xorl %edx, %edx
cmpl $0x2, %ebp
setb %dl
movq %rbx, %rdi
movq %r15, %rsi
callq *%rax
movl 0x50(%rbx), %eax
cmpl $0x28, %eax
je 0x3a9f
movl %eax, %ecx
leaq (%rcx,%rcx,2), %rcx
cmpl %ebp, 0x10(%r13,%rcx,8)
jb 0x3a81
xorl %r12d, %r12d
cmpl $0x2, %ebp
setb %r12b
movq %rbx, %rdi
callq 0x2e64
movl 0x78(%rbx), %eax
leaq (%rax,%rax,2), %rax
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
callq *0x8(%r13,%rax,8)
jmp 0x3a1e
leaq 0x3c88(%rip), %rdx      # 0x76eb
movl $0x13, %ecx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30f3
cmpl $0x2, %ebp
setae %cl
cmpl $0xe, %eax
setne %al
orb %cl, %al
jne 0x3a9f
leaq 0x3c67(%rip), %rdx      # 0x76ff
movl $0x1d, %ecx
jmp 0x3a68
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x8, %esi
callq 0x39da
movb $0x2, %al
cmpl $0x7, %ebp
je 0x3b9e
cmpl $0xc, %ebp
jne 0x3baf
movb $0xa, %al
movzbl %al, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3754
callq 0x1220
// File: /workspace/github_c_makefile_star2_O3/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
leaq (%r14,%r14,2), %rax
leaq 0x8e33(%rip), %rcx      # 0xca00
movl 0x10(%rcx,%rax,8), %esi
incl %esi
callq 0x39da
leal -0x7(%r14), %eax
cmpl $0xc, %eax
ja 0x3c42
leaq 0x3948(%rip), %rcx      # 0x7530
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x4, %al
jmp 0x3c30
movq %rbx, %rdi
movl $0xc, %esi
jmp 0x3c21
movb $0xd, %al
jmp 0x3c30
movq %rbx, %rdi
movl $0xb, %esi
jmp 0x3c21
movb $0x3, %al
jmp 0x3c30
movb $0xb, %al
jmp 0x3c30
movb $0x6, %al
jmp 0x3c30
movq %rbx, %rdi
movl $0xd, %esi
callq 0x3754
movb $0xa, %al
jmp 0x3c30
movb $0x5, %al
jmp 0x3c30
movb $0xc, %al
movzbl %al, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3754
callq 0x1251
// File: /workspace/github_c_makefile_star2_O3/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 0x3e42
movq %rdi, %rbx
addq $0x40008, %rsi          # imm = 0x40008
movq 0x70(%rdi), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x4644
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 0x3dcb
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rcx
cmpq %rcx, %rsi
jne 0x3df3
testq %rsi, %rsi
movl $0x8, %edx
cmovneq %rsi, %rdx
jmp 0x3dd0
movl $0x8, %edx
movl $0x10, %esi
movq %rax, %rdi
callq 0x394d
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 0x3e29
movb -0x8(%rax), %al
decb %al
jmp 0x3e2b
movb $-0x1, %al
movzbl %al, %edx
movq %rbx, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3f8e
leaq 0x39f1(%rip), %rdi      # 0x783a
leaq 0x39a3(%rip), %rsi      # 0x77f3
leaq 0x3a09(%rip), %rcx      # 0x7860
movl $0x101, %edx            # imm = 0x101
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/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 0x3e99
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
xorl %esi, %esi
callq 0x1080
movq %xmm0, %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x38ae
movzbl %al, %edx
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmp 0x3f8e
leaq 0x39e3(%rip), %rdi      # 0x7883
leaq 0x394c(%rip), %rsi      # 0x77f3
leaq 0x39fb(%rip), %rcx      # 0x78a9
movl $0xf7, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x15, %esi
callq 0x413b
movq %rax, %r15
movq %r14, %rdi
movl $0xf, %esi
callq 0x3754
movq %r14, %rdi
movl $0x3, %esi
movq %rbx, %rdx
callq 0x39da
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x4188
// File: /workspace/github_c_makefile_star2_O3/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, %rbx
movq %rdi, %r14
movl $0x15, %esi
callq 0x413b
movq %rax, %r15
movq %r14, %rdi
movl $0x16, %esi
callq 0x413b
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x4188
movq %r14, %rdi
movl $0xf, %esi
callq 0x3754
movq %r14, %rdi
movl $0x2, %esi
movq %rbx, %rdx
callq 0x39da
movq %r14, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4188
// File: /workspace/github_c_makefile_star2_O3/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 0x3fd7
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rdx
cmpq %rdx, %rsi
jne 0x3fff
testq %rsi, %rsi
movl $0x8, %edx
cmovneq %rsi, %rdx
jmp 0x3fdc
movl $0x8, %edx
movl $0x10, %esi
movq %rax, %rdi
callq 0x394d
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 0x4038
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rcx
cmpq %rcx, %rsi
jne 0x4060
testq %rsi, %rsi
movl $0x8, %edx
cmovneq %rsi, %rdx
jmp 0x403d
movl $0x8, %edx
movl $0x1, %esi
movq %rax, %rdi
callq 0x394d
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 0x409e
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rdx
cmpq %rdx, %rsi
jne 0x40c6
testq %rsi, %rsi
movl $0x8, %edx
cmovneq %rsi, %rdx
jmp 0x40a3
movl $0x8, %edx
movl $0x10, %esi
movq %rax, %rdi
callq 0x394d
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 0x40ff
movq -0x10(%rax), %rsi
movq -0x8(%rax), %rcx
cmpq %rcx, %rsi
jne 0x4127
testq %rsi, %rsi
movl $0x8, %edx
cmovneq %rsi, %rdx
jmp 0x4104
movl $0x8, %edx
movl $0x1, %esi
movq %rax, %rdi
callq 0x394d
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_O3/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 0x3754
movq %rbx, %rdi
movl $0xff, %esi
callq 0x3754
movq %rbx, %rdi
movl $0xff, %esi
callq 0x3754
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x417f
movq -0x8(%rax), %rax
addq $-0x2, %rax
jmp 0x4186
movq $-0x2, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x41af
movq -0x8(%rax), %rbx
jmp 0x41b1
xorl %ebx, %ebx
subq %rbp, %rbx
cmpq $0x1, %rbx
jle 0x420e
cmpq $0x10002, %rbx          # imm = 0x10002
jb 0x41ed
leaq 0x58(%r14), %rsi
leaq 0x372c(%rip), %rdx      # 0x78fa
movl $0x24, %ecx
movq %r14, %rdi
callq 0x30f3
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 0x36b7(%rip), %rdi      # 0x78cc
leaq 0x35d7(%rip), %rsi      # 0x77f3
leaq 0x36b3(%rip), %rcx      # 0x78d6
movl $0x1cf, %edx            # imm = 0x1CF
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movq 0x80(%rdi), %rax
decq 0x3008(%rax)
movl 0x3000(%rax), %ecx
testl %ecx, %ecx
jle 0x42c8
movq %rdi, %rbx
decl %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq 0x28(%rax,%rcx), %rcx
cmpq 0x3008(%rax), %rcx
jle 0x42c8
movq %rbx, %rdi
movl $0xf, %esi
callq 0x3754
movq 0x80(%rbx), %rax
movl 0x3000(%rax), %edx
leal -0x1(%rdx), %ecx
movl %ecx, 0x3000(%rax)
cmpl $0x1, %edx
jg 0x4288
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rsi, %rdx
movq %rdi, %rbx
movl $0x1, %esi
callq 0x39da
leaq 0x387d(%rip), %rdx      # 0x7b5f
movq %rbx, %rdi
movl $0x9, %esi
callq 0x3839
movq %rbx, %rdi
movl $0xf, %esi
popq %rbx
jmp 0x3754
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x17, %esi
callq 0x3754
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x4331
movq -0x8(%rax), %r14
jmp 0x4334
xorl %r14d, %r14d
subq %r15, %r14
addq $0x2, %r14
js 0x438b
cmpq $0x10000, %r14          # imm = 0x10000
jb 0x435e
leaq 0x58(%rbx), %rsi
leaq 0x373c(%rip), %rdx      # 0x7a8d
movl $0x28, %ecx
movq %rbx, %rdi
callq 0x30f3
movl %r14d, %esi
shrl $0x8, %esi
movl $0xff, %ebp
andl %ebp, %esi
movq %rbx, %rdi
callq 0x3754
andl %ebp, %r14d
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3754
leaq 0x353a(%rip), %rdi      # 0x78cc
leaq 0x345a(%rip), %rsi      # 0x77f3
leaq 0x36cc(%rip), %rcx      # 0x7a6c
movl $0x22e, %edx            # imm = 0x22E
callq 0x10f0
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x43dc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x8c0d(%rip), %rax      # 0xcff0
movq (%rax), %rdi
leaq 0x37a2(%rip), %rsi      # 0x7b8f
movq %r15, %rdx
movl %ebx, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x1140
movl $0xc, %edi
callq 0x11e0
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x0, 0x60(%rsi)
movl $0x64, %edx
xorl %edi, %edi
callq 0x1110
movq %rax, %r12
testq %rax, %rax
jle 0x449f
leaq 0x3766(%rip), %r15      # 0x7bbe
movq %rsp, %r13
movq (%rbx), %rsi
addq %r12, %rsi
movq %rsi, (%rbx)
movq %r14, %rdi
movq %r15, %rdx
movl $0x1a, %ecx
callq 0x43ac
movq (%r14), %rdi
addq (%rbx), %rdi
subq %r12, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1160
movl $0x64, %edx
xorl %edi, %edi
movq %r13, %rsi
callq 0x1110
movq %rax, %r12
testq %rax, %rax
jg 0x445b
cmpq $-0x1, %r12
je 0x44b3
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x12b3
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x2fe1(%rip), %rsi      # 0x74b1
callq 0x11c0
testq %rax, %rax
je 0x4552
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1190
testl %eax, %eax
jne 0x455a
movq %r14, %rdi
callq 0x1150
movq %rax, %r12
movq %r14, %rdi
callq 0x10c0
leaq 0x1(%r12), %rsi
leaq 0x3767(%rip), %rdx      # 0x7c76
movq %r15, %rdi
movl $0x3c, %ecx
callq 0x43ac
movq (%r15), %rax
movb $0x0, (%rax,%r12)
movq (%r15), %rdi
movl $0x1, %esi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1070
cmpq %r12, %rax
jne 0x4562
movq %r12, (%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1090
movq %r12, %rdi
callq 0x135c
movq %r12, %rdi
callq 0x12ef
movq %rax, %rdi
movq %r12, %rsi
callq 0x1335
// File: /workspace/github_c_makefile_star2_O3/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 0x4633
cmpl $0x3, %edi
je 0x4601
cmpl $0x2, %edi
je 0x45db
movb $0x1, %al
testl %edi, %edi
jne 0x45da
xorl %esi, %ecx
testb $0x1, %cl
sete %al
retq
movq %rsi, %xmm0
movq %rcx, %xmm1
subsd %xmm1, %xmm0
andpd 0x36cf(%rip), %xmm0     # 0x7cc0
movsd 0x36d7(%rip), %xmm1     # 0x7cd0
ucomisd %xmm0, %xmm1
seta %al
retq
cmpl $0x0, (%rsi)
jne 0x4633
cmpl $0x0, (%rcx)
jne 0x4633
movq 0x10(%rsi), %rdx
cmpq 0x10(%rcx), %rdx
jne 0x4633
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_O3/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
movq $0x0, (%r15)
leaq 0x3712(%rip), %rdx      # 0x7d7c
movq %r15, %rdi
movl $0x2a, %ecx
callq 0x43ac
movq (%r14), %rcx
movq (%r15), %rax
movq %rcx, 0x8(%rax)
movq %rax, (%r14)
movq %rbx, 0x10(%rax)
movl $0x0, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq %rsp, %r15
movq %r12, (%r15)
addq $0x38, %rsi
leaq 0x363e(%rip), %rdx      # 0x7cf8
movq %r15, %rdi
movl $0x41, %ecx
callq 0x43ac
movq (%r15), %r15
movl $0x1, (%r15)
movb $0x0, 0x10(%r15)
movq %r12, 0x28(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r15)
leaq 0x38(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1160
movq %rbx, 0x30(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq $0x0, (%r14)
leaq 0x35ea(%rip), %rdx      # 0x7d06
movl $0x18, %esi
movq %r14, %rdi
movl $0x4c, %ecx
callq 0x43ac
movq (%r14), %rax
movl $0x2, (%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/value.c
// Function: value_to_str
const char* value_to_str(Value v) {
    static char str[UINT8_MAX + 1] = "";
    memset(str, 0, UINT8_MAX + 1);

    switch (v.type) {
        case VAL_BOOL:
            snprintf(str, UINT8_MAX, "%s", v.as.boolean ? "true" : "false");
            break;
        case VAL_NIL:
            snprintf(str, UINT8_MAX, "nil");
            break;
        case VAL_NUMBER:
            snprintf(str, UINT8_MAX, "%g", v.as.number);
            break;
        case VAL_OBJ:
            switch (AS_OBJ(v)->type) {
                case OBJ_STRING:
                    snprintf(str, UINT8_MAX, "%.*s", (int)AS_STRING(v)->len,
                             AS_CSTRING(v));
                    break;
                case OBJ_FUNCTION:
                    snprintf(str, UINT8_MAX, "fn@%.*s", (int)AS_FN(v)->name_len,
                             AS_FN(v)->name);
                    break;
                case OBJ_NATIVE:
                    snprintf(str, UINT8_MAX, "fn@<native>");
                    break;
            }
            break;
    }
    return str;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8ade(%rip), %rdi      # 0xd230
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1100
cmpl $0x3, %ebp
ja 0x4842
movl %ebp, %eax
leaq 0x3568(%rip), %rcx      # 0x7cd8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x359e(%rip), %rax      # 0x7d1e
leaq 0x359c(%rip), %rcx      # 0x7d23
testb $0x1, %bl
cmovneq %rax, %rcx
leaq 0x8a9b(%rip), %rdi      # 0xd230
leaq 0x357f(%rip), %rdx      # 0x7d1b
movl $0xff, %esi
xorl %eax, %eax
callq 0x10d0
jmp 0x4842
movq %rbx, %xmm0
leaq 0x8a77(%rip), %rdi      # 0xd230
leaq 0x3569(%rip), %rdx      # 0x7d29
movl $0xff, %esi
movb $0x1, %al
callq 0x10d0
jmp 0x4842
movl (%rbx), %eax
cmpl $0x2, %eax
je 0x4827
cmpl $0x1, %eax
je 0x4801
testl %eax, %eax
jne 0x4842
movl 0x10(%rbx), %ecx
addq $0x18, %rbx
leaq 0x8a44(%rip), %rdi      # 0xd230
leaq 0x353c(%rip), %rdx      # 0x7d2f
jmp 0x4816
movl $0x6c696e, 0x8a31(%rip) # imm = 0x6C696E
jmp 0x4842
movl 0x30(%rbx), %ecx
addq $0x38, %rbx
leaq 0x8a21(%rip), %rdi      # 0xd230
leaq 0x3516(%rip), %rdx      # 0x7d2c
movl $0xff, %esi
movq %rbx, %r8
xorl %eax, %eax
callq 0x10d0
jmp 0x4842
movabsq $0x6974616e3c406e66, %rax # imm = 0x6974616E3C406E66
movq %rax, 0x89f8(%rip)      # 0xd230
movl $0x3e6576, 0x89f6(%rip) # imm = 0x3E6576
leaq 0x89e7(%rip), %rax      # 0xd230
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/value.c
// Function: value_to_str_debug
const char* value_to_str_debug(Value v) {
    static char str[UINT8_MAX + 1] = "";
    memset(str, 0, UINT8_MAX + 1);

    switch (v.type) {
        case VAL_BOOL:
            snprintf(str, UINT8_MAX, "boolean (%s)",
                     v.as.boolean ? "true" : "false");
            break;
        case VAL_NIL:
            snprintf(str, UINT8_MAX, "nil");
            break;
        case VAL_NUMBER:
            snprintf(str, UINT8_MAX, "number (%g)", v.as.number);
            break;
        case VAL_OBJ:
            switch (AS_OBJ(v)->type) {
                case OBJ_STRING:
                    snprintf(str, UINT8_MAX, "string (\"%.*s\")",
                             (int)AS_STRING(v)->len, AS_CSTRING(v));
                    break;
                case OBJ_FUNCTION:
                    snprintf(str, UINT8_MAX, "function (fn@%.*s)",
                             (int)AS_FN(v)->name_len, AS_FN(v)->name);
                    break;
                case OBJ_NATIVE:
                    snprintf(str, UINT8_MAX, "fn@<native>");
                    break;
            }
            break;
    }
    return str;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8ad1(%rip), %rdi      # 0xd330
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1100
cmpl $0x3, %ebp
ja 0x494f
movl %ebp, %eax
leaq 0x346b(%rip), %rcx      # 0x7ce8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x3491(%rip), %rax      # 0x7d1e
leaq 0x348f(%rip), %rcx      # 0x7d23
testb $0x1, %bl
cmovneq %rax, %rcx
leaq 0x8a8e(%rip), %rdi      # 0xd330
leaq 0x3497(%rip), %rdx      # 0x7d40
movl $0xff, %esi
xorl %eax, %eax
callq 0x10d0
jmp 0x494f
movq %rbx, %xmm0
leaq 0x8a6a(%rip), %rdi      # 0xd330
leaq 0x3480(%rip), %rdx      # 0x7d4d
movl $0xff, %esi
movb $0x1, %al
callq 0x10d0
jmp 0x494f
movl (%rbx), %eax
cmpl $0x2, %eax
je 0x4934
cmpl $0x1, %eax
je 0x490e
testl %eax, %eax
jne 0x494f
movl 0x10(%rbx), %ecx
addq $0x18, %rbx
leaq 0x8a37(%rip), %rdi      # 0xd330
leaq 0x3459(%rip), %rdx      # 0x7d59
jmp 0x4923
movl $0x6c696e, 0x8a24(%rip) # imm = 0x6C696E
jmp 0x494f
movl 0x30(%rbx), %ecx
addq $0x38, %rbx
leaq 0x8a14(%rip), %rdi      # 0xd330
leaq 0x3446(%rip), %rdx      # 0x7d69
movl $0xff, %esi
movq %rbx, %r8
xorl %eax, %eax
callq 0x10d0
jmp 0x494f
movabsq $0x6974616e3c406e66, %rax # imm = 0x6974616E3C406E66
movq %rax, 0x89eb(%rip)      # 0xd330
movl $0x3e6576, 0x89e9(%rip) # imm = 0x3E6576
leaq 0x89da(%rip), %rax      # 0xd330
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: read_u8
static Result read_u8(Vm* vm, uint8_t* byte) {
    assert(vm->frame_len > 0);
    CallFrame* const frame = &vm->frames[vm->frame_len - 1];
    assert(frame->ip <=
           frame->fn->chunk.opcodes + buf_size(frame->fn->chunk.opcodes));

    *byte = *frame->ip++;

    return RES_OK;
}

// Assembly:
pushq %rax
movsbq 0x40618(%rdi), %rax
testq %rax, %rax
jle 0x4c21
decl %eax
leaq (%rax,%rax,2), %rcx
movq 0x40018(%rdi,%rcx,8), %rdx
movq 0x40020(%rdi,%rcx,8), %rax
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
je 0x4bfd
movq -0x8(%rdx), %r8
jmp 0x4c00
xorl %r8d, %r8d
addq %r8, %rdx
cmpq %rdx, %rax
ja 0x4c40
leaq (%rdi,%rcx,8), %rcx
addq $0x40018, %rcx          # imm = 0x40018
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rcx)
movb (%rax), %al
movb %al, (%rsi)
popq %rax
retq
leaq 0x4368(%rip), %rdi      # 0x8f90
leaq 0x4373(%rip), %rsi      # 0x8fa2
leaq 0x45ff(%rip), %rcx      # 0x9235
movl $0x90, %edx
callq 0x10f0
leaq 0x460e(%rip), %rdi      # 0x9255
leaq 0x4354(%rip), %rsi      # 0x8fa2
leaq 0x45e0(%rip), %rcx      # 0x9235
movl $0x93, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: get_location
static const Location* get_location(const Vm* vm) {
    assert(vm->frame_len > 0);
    const CallFrame* const frame = &vm->frames[vm->frame_len - 1];

    return &frame->fn->chunk
                .locations[frame->ip - frame->fn->chunk.opcodes - 1];
}

// Assembly:
movsbq 0x40618(%rdi), %rax
testq %rax, %rax
jle 0x4c99
decl %eax
leaq (%rax,%rax,2), %rax
movq 0x40018(%rdi,%rax,8), %rcx
movq 0x18(%rcx), %rdx
notq %rdx
shlq $0x4, %rdx
addq 0x20(%rcx), %rdx
movq 0x40020(%rdi,%rax,8), %rax
shlq $0x4, %rax
addq %rdx, %rax
retq
pushq %rax
leaq 0x42ef(%rip), %rdi      # 0x8f90
leaq 0x42fa(%rip), %rsi      # 0x8fa2
leaq 0x45f1(%rip), %rcx      # 0x92a0
movl $0x36, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: read_constant
static Result read_constant(Vm* vm, Value* v) {
    assert(vm->frame_len > 0);
    const CallFrame* const frame = &vm->frames[vm->frame_len - 1];

    uint8_t value_index = 0;
    RETURN_IF_ERR(read_u8(vm, &value_index));
    LOG("constant index=%d constants size=%zu\n", value_index,
        buf_size(frame->fn->chunk.constants));
    assert(value_index < buf_size(frame->fn->chunk.constants));
    *v = frame->fn->chunk.constants[value_index];

    return RES_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsbq 0x40618(%rdi), %rax
testq %rax, %rax
jle 0x4d37
movq %rsi, %rbx
movq %rdi, %r14
decl %eax
leaq (%rax,%rax,2), %r15
leaq 0xf(%rsp), %rsi
movb $0x0, (%rsi)
callq 0x4bca
movq 0x40018(%r14,%r15,8), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x4d18
movzbl 0xf(%rsp), %ecx
cmpq %rcx, -0x8(%rax)
jbe 0x4d18
shll $0x4, %ecx
movups (%rax,%rcx), %xmm0
movups %xmm0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x45ce(%rip), %rdi      # 0x92ed
leaq 0x427c(%rip), %rsi      # 0x8fa2
leaq 0x459c(%rip), %rcx      # 0x92c9
movl $0xa2, %edx
callq 0x10f0
leaq 0x4252(%rip), %rdi      # 0x8f90
leaq 0x425d(%rip), %rsi      # 0x8fa2
leaq 0x457d(%rip), %rcx      # 0x92c9
movl $0x9b, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: read_u16
static Result read_u16(Vm* vm, uint16_t* u16) {
    uint8_t b1 = 0;
    RETURN_IF_ERR(read_u8(vm, &b1));

    uint8_t b2 = 0;
    RETURN_IF_ERR(read_u8(vm, &b2));

    *u16 = (uint16_t)(b1 << (uint8_t)8) | b2;
    return RES_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
leaq 0xf(%rsp), %r15
movb %bpl, (%r15)
movq %r15, %rsi
callq 0x4bca
leaq 0xe(%rsp), %r12
movb %bpl, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x4bca
movzbl (%r15), %eax
shll $0x8, %eax
movzbl (%r12), %ecx
orl %eax, %ecx
movw %cx, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: stack_trace_print
static void stack_trace_print(const Vm* vm) {
    assert(vm->frame_len > 0);

    for (int i = vm->frame_len - 1; i > 0; i--) {
        const CallFrame* const frame = &vm->frames[i];

        const Location* const loc =
            &frame->fn->chunk
                 .locations[frame->ip - frame->fn->chunk.opcodes - 1];
        fprintf(stderr, "%zu:%zu: in %.*s()\n", loc->line, loc->column,
                (int)frame->fn->name_len, frame->fn->name);
    }
}

// Assembly:
pushq %rax
movb 0x40618(%rdi), %al
testb %al, %al
jle 0x5ae5
cmpb $0x1, %al
jne 0x5adb
popq %rax
retq
movzbl %al, %esi
callq 0x190e
jmp 0x5ad9
leaq 0x34a4(%rip), %rdi      # 0x8f90
leaq 0x34af(%rip), %rsi      # 0x8fa2
leaq 0x3895(%rip), %rcx      # 0x938f
movl $0x4f, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: stack_peek_from_top_at
static Result stack_peek_from_top_at(const Vm* vm, Value* v,
                                     intmax_t distance) {
    assert(stack_len(vm) < STACK_MAX - 1);
    assert((size_t)distance < stack_len(vm));

    *v = vm->stack_top[-1 - distance];

    LOG("peek stack distance=%jd v=%s\n", distance, value_to_str_debug(*v));

    return RES_OK;
}

// Assembly:
pushq %rax
movq 0x40000(%rdi), %rax
movq %rax, %rcx
subq %rdi, %rcx
sarq $0x4, %rcx
cmpq $0x3fff, %rcx           # imm = 0x3FFF
jae 0x5b34
cmpq %rdx, %rcx
jbe 0x5b53
notq %rdx
shlq $0x4, %rdx
movups (%rax,%rdx), %xmm0
movups %xmm0, (%rsi)
popq %rax
retq
leaq 0x3817(%rip), %rdi      # 0x9352
leaq 0x3460(%rip), %rsi      # 0x8fa2
leaq 0x38c5(%rip), %rcx      # 0x940e
movl $0x7b, %edx
callq 0x10f0
leaq 0x38f1(%rip), %rdi      # 0x944b
leaq 0x3441(%rip), %rsi      # 0x8fa2
leaq 0x38a6(%rip), %rcx      # 0x940e
movl $0x7c, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: vm_interpret
Result vm_interpret(char* source, size_t source_len,
                    Result (*bytecode_fn)(Vm*)) {
    Vm vm = {.globals = ht_init(UINT8_MAX, NULL)};
    vm.stack_top = vm.stack;

    fn_define_native(&vm, "clock", fn_native_clock);
    fn_define_native(&vm, "readLine", fn_native_read_line);
    fn_define_native(&vm, "parseNumber", fn_native_parse_number);

    Result result = RES_OK;

    ObjFunction* fn = NULL;
    if ((result = parser_compile(source, source_len, &fn, &vm)) != RES_OK) {
        return result;
    }

    LOG("parsing successful%s\n", "");

    stack_push(&vm, OBJ_VAL(fn));

    fn_call(&vm, fn, 0);
    result = bytecode_fn(&vm);

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40628, %rsp          # imm = 0x40628
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8(%rsp), %r14
movl $0x40620, %edx          # imm = 0x40620
movq %r14, %rdi
xorl %esi, %esi
callq 0x1100
movl $0xff, %edi
xorl %esi, %esi
callq 0x1d8c
movq %rax, 0x40010(%r14)
movq %r14, 0x40000(%r14)
leaq 0x362b(%rip), %rsi      # 0x91e9
leaq 0x1ea(%rip), %rdx       # 0x5daf
movq %r14, %rdi
callq 0x5c84
leaq 0x361b(%rip), %rsi      # 0x91ef
leaq 0x254(%rip), %rdx       # 0x5e2f
movq %r14, %rdi
callq 0x5c84
leaq 0x360e(%rip), %rsi      # 0x91f8
leaq 0x2d9(%rip), %rdx       # 0x5eca
movq %r14, %rdi
callq 0x5c84
movq %rsp, %rdx
movq $0x0, (%rdx)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x2c64
testl %eax, %eax
jne 0x5c56
movq 0x40008(%rsp), %rax
movq %rax, %rcx
subq %r14, %rcx
cmpq $0x3fff0, %rcx          # imm = 0x3FFF0
jae 0x5c65
movq (%rsp), %rsi
movl $0x3, (%rax)
movq %rsi, 0x8(%rax)
leaq 0x8(%rsp), %r14
addq $0x10, 0x40000(%r14)
movq %r14, %rdi
xorl %edx, %edx
callq 0x5fbe
movq %r14, %rdi
callq *%rbx
addq $0x40628, %rsp          # imm = 0x40628
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x36e6(%rip), %rdi      # 0x9352
leaq 0x332f(%rip), %rsi      # 0x8fa2
leaq 0x36f6(%rip), %rcx      # 0x9370
movl $0x6f, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: fn_define_native
static Result fn_define_native(Vm* vm, char name[], NativeFn fn) {
    const size_t name_len = strlen(name);
    ObjString* const os = value_make_string(&vm->objects, name_len);
    memcpy(os->s, name, name_len);
    RETURN_IF_ERR(stack_push(vm, OBJ_VAL(os)));

    RETURN_IF_ERR(stack_push(vm, OBJ_VAL(value_make_fn_native(fn))));
    Value* v = vm->stack_top - 1;

    ht_insert(vm->globals, name, name_len, v, sizeof(*v));

    Value dummy;
    RETURN_IF_ERR(stack_pop(vm, &dummy));
    RETURN_IF_ERR(stack_pop(vm, &dummy));

    return RES_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x10a0
movq %rax, %r15
leaq 0x40008(%rbx), %rdi
movq %rax, %rsi
callq 0x4644
movq %rax, %r13
leaq 0x18(%rax), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1160
movq 0x40000(%rbx), %rax
movq %rax, %rcx
subq %rbx, %rcx
cmpq $0x3fff0, %rcx          # imm = 0x3FFF0
jae 0x5d71
movl $0x3, (%rax)
movq %r13, 0x8(%rax)
addq $0x10, 0x40000(%rbx)
movq %r12, %rdi
callq 0x4704
movq 0x40000(%rbx), %rcx
movq %rcx, %rdx
subq %rbx, %rdx
cmpq $0x3fff0, %rdx          # imm = 0x3FFF0
jae 0x5d71
movl $0x3, (%rcx)
movq %rax, 0x8(%rcx)
movq 0x40000(%rbx), %rcx
movq 0x40010(%rbx), %rdi
leaq 0x10(%rcx), %rax
movq %rax, 0x40000(%rbx)
movl $0x10, %r8d
movq %r14, %rsi
movq %r15, %rdx
callq 0x1eae
movq 0x40000(%rbx), %rax
cmpq %rbx, %rax
je 0x5d90
leaq -0x10(%rax), %rcx
movq %rcx, 0x40000(%rbx)
cmpq %rbx, %rcx
je 0x5d90
addq $-0x20, %rax
movq %rax, 0x40000(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x35da(%rip), %rdi      # 0x9352
leaq 0x3223(%rip), %rsi      # 0x8fa2
leaq 0x35ea(%rip), %rcx      # 0x9370
movl $0x6f, %edx
callq 0x10f0
leaq 0x3589(%rip), %rdi      # 0x9320
leaq 0x3204(%rip), %rsi      # 0x8fa2
leaq 0x358d(%rip), %rcx      # 0x9332
movl $0x86, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: fn_native_clock
static Result fn_native_clock(Vm* vm, Value* args, uint8_t args_len,
                              Value* ret) {
    (void)args;
    if (args_len > 0) {
        VM_ERROR(vm, get_location(vm),
                 "Wrong arity in function call: expected 0, got: %d", args_len);
    }

    struct timeval tp = {0};
    gettimeofday(&tp, NULL);

    *ret = NUMBER_VAL(tp.tv_sec * 1000 + tp.tv_usec / 1000);

    return RES_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
testl %edx, %edx
jne 0x5e1c
movq %rcx, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
xorl %r14d, %r14d
movq %r15, %rdi
xorl %esi, %esi
callq 0x10e0
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%r15)
imulq $0x3e8, (%r15), %rax    # imm = 0x3E8
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x7, %rdx
addq %rcx, %rdx
addq %rax, %rdx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
movl $0x2, (%rbx)
movsd %xmm0, 0x8(%rbx)
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rdi, %rsi
movzbl %dl, %edi
callq 0x198c
movl $0x2, %r14d
jmp 0x5e0f
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: fn_native_read_line
static Result fn_native_read_line(Vm* vm, Value* args, uint8_t args_len,
                                  Value* ret) {
    (void)args;
    if (args_len > 0) {
        VM_ERROR(vm, get_location(vm),
                 "Wrong arity in function call: expected 0, got: %d", args_len);
    }

    char* source = NULL;
    ssize_t source_len = 0;
    size_t line_cap = UINT32_MAX;

    if ((source_len = getline(&source, &line_cap, stdin)) <= 0) {
        VM_ERROR(vm, get_location(vm),
                 "Could not read from stdin: errno=%s error=%d\n",
                 strerror(errno), errno);
    }

    ObjString* const os =
        value_make_string(&vm->objects, (size_t)source_len - 1);
    memcpy(os->s, source, (size_t)(source_len - 1));  // Trim trailing newline
    *ret = OBJ_VAL(os);

    return RES_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
testl %edx, %edx
jne 0x5eae
movq %rcx, %rbx
movq %rsp, %rdi
movq $0x0, (%rdi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq 0x7170(%rip), %rax      # 0xcfd0
movq (%rax), %rdx
callq 0x11d0
testq %rax, %rax
jle 0x5ebb
movq %rax, %r15
addq $0x40008, %r14          # imm = 0x40008
decq %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4644
movq %rax, %r14
leaq 0x18(%rax), %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x1160
movl $0x3, (%rbx)
movq %r14, 0x8(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movzbl %dl, %edi
movq %r14, %rsi
callq 0x19e4
jmp 0x5ec3
movq %r14, %rdi
callq 0x1a3c
movl $0x2, %eax
jmp 0x5ea4
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: fn_native_parse_number
static Result fn_native_parse_number(Vm* vm, Value* args, uint8_t args_len,
                                     Value* ret) {
    if (args_len != 1) {
        VM_ERROR(vm, get_location(vm),
                 "Wrong arity in function call: expected 1, got: %d", args_len);
    }

    const Value* const v = &args[0];

    if (!IS_STRING(*v)) {
        VM_ERROR(vm, get_location(vm), "Expected a string, got: %s",
                 value_to_str_debug(*v));
    }

    char* s_nul = NULL;
    const size_t s_len = AS_STRING(*v)->len;
    REALLOC_SAFE(&s_nul, s_len + 1);
    memcpy(s_nul, AS_CSTRING(*v), s_len);
    s_nul[s_len] = '\0';

    char* err = NULL;
    const double num = strtod(s_nul, &err);

    if (s_len > 0 && *err != '\0') {
        VM_ERROR(vm, get_location(vm), "Cannot convert %s to number: %s",
                 value_to_str_debug(*v), strerror(errno));
    }
    *ret = NUMBER_VAL(num);

    return RES_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x1, %edx
jne 0x5f8a
movq %rcx, %r15
movq %rsi, %r14
movl (%rsi), %edi
leaq 0x8(%rsi), %r12
movq 0x8(%rsi), %rsi
xorl %edx, %edx
callq 0x4636
testb %al, %al
je 0x5f97
movq %rbx, (%rsp)
xorl %r13d, %r13d
leaq 0x10(%rsp), %rbx
movq %r13, (%rbx)
movq (%r12), %rax
movq 0x10(%rax), %rbp
leaq 0x1(%rbp), %rsi
leaq 0x364e(%rip), %rdx      # 0x9573
movq %rbx, %rdi
movl $0x176, %ecx            # imm = 0x176
callq 0x43ac
movq (%rbx), %rdi
movq (%r12), %rsi
addq $0x18, %rsi
movq %rbp, %rdx
callq 0x1160
movq (%rbx), %rax
movb $0x0, (%rax,%rbp)
leaq 0x8(%rsp), %rsi
movq %r13, (%rsi)
movq (%rbx), %rdi
callq 0x1080
testq %rbp, %rbp
je 0x5f6b
movq 0x8(%rsp), %rax
cmpb $0x0, (%rax)
jne 0x5fa7
movl $0x2, (%r15)
movsd %xmm0, 0x8(%r15)
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl %dl, %edi
movq %rbx, %rsi
callq 0x1aa5
jmp 0x5fb6
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1afd
jmp 0x5fb6
movq (%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1b6a
movl $0x2, %r13d
jmp 0x5f78