LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x3b0a
addq $-0x10, %rdi
testq %rbx, %rbx
jle 0x3add
movq (%rdi), %rcx
addq %rbx, %rcx
movq $-0x11, %rax
xorl %edx, %edx
divq %rsi
cmpq %rax, %rcx
ja 0x3b41
movq (%rdi), %rax
addq %rbx, %rax
imulq %rsi, %rax
addq $0x10, %rax
movq %rax, %rsi
callq 0x11a0
testq %rax, %rax
je 0x3b41
addq (%rax), %rbx
movq %rbx, (%rax)
cmpq %rbx, 0x8(%rax)
jbe 0x3b3b
movq %rbx, 0x8(%rax)
jmp 0x3b3b
movq $-0x11, %rax
xorl %edx, %edx
divq %rsi
cmpq %rbx, %rax
jb 0x3b41
imulq %rbx, %rsi
addq $0x10, %rsi
movq %rsi, %rdi
callq 0x1170
testq %rax, %rax
je 0x3b41
movq %rbx, (%rax)
movq $0x0, 0x8(%rax)
addq $0x10, %rax
popq %rbx
retq
callq 0x1040
// File: /workspace/github_c_makefile_star2_O1/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 0x2f64
leaq 0x58(%rbx), %r14
movl 0x78(%rbx), %eax
leaq (%rax,%rax,2), %rax
leaq 0x8e90(%rip), %r13      # 0xca00
movq (%r13,%rax,8), %rax
testq %rax, %rax
je 0x3bef
xorl %edx, %edx
cmpl $0x2, %ebp
setb %dl
movq %rbx, %rdi
movq %r15, %rsi
callq *%rax
movl 0x50(%rbx), %eax
cmpl $0x28, %eax
jne 0x3b96
xorl %eax, %eax
jmp 0x3bd8
movl %eax, %ecx
leaq (%rcx,%rcx,2), %rcx
cmpl %ebp, 0x10(%r13,%rcx,8)
jb 0x3bd2
xorl %r12d, %r12d
cmpl $0x2, %ebp
setb %r12b
movq %rbx, %rdi
callq 0x2f64
movl 0x78(%rbx), %eax
leaq (%rax,%rax,2), %rax
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
callq *0x8(%r13,%rax,8)
movl 0x50(%rbx), %eax
cmpl $0x28, %eax
jne 0x3b96
cmpl $0xe, %eax
sete %al
cmpl $0x1, %ebp
ja 0x3c14
testb %al, %al
je 0x3c14
leaq 0x3ae7(%rip), %rdx      # 0x76cf
movl $0x1d, %ecx
jmp 0x3bfb
leaq 0x3ac5(%rip), %rdx      # 0x76bb
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 0x31f4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3b46
movb $0x2, %al
cmpl $0x7, %ebp
je 0x3d13
cmpl $0xc, %ebp
jne 0x3d24
movb $0xa, %al
movzbl %al, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x384f
callq 0x1220
// File: /workspace/github_c_makefile_star2_O1/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 0x8cbe(%rip), %rcx      # 0xca00
movl 0x10(%rcx,%rax,8), %esi
incl %esi
callq 0x3b46
leal -0x7(%r14), %eax
cmpl $0xc, %eax
ja 0x3db7
leaq 0x37a3(%rip), %rcx      # 0x7500
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x4, %al
jmp 0x3da5
movq %rbx, %rdi
movl $0xc, %esi
jmp 0x3d96
movb $0xd, %al
jmp 0x3da5
movq %rbx, %rdi
movl $0xb, %esi
jmp 0x3d96
movb $0x3, %al
jmp 0x3da5
movb $0xb, %al
jmp 0x3da5
movb $0x6, %al
jmp 0x3da5
movq %rbx, %rdi
movl $0xd, %esi
callq 0x384f
movb $0xa, %al
jmp 0x3da5
movb $0x5, %al
jmp 0x3da5
movb $0xc, %al
movzbl %al, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x384f
callq 0x1251
// File: /workspace/github_c_makefile_star2_O1/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 0x4006
movq %rdi, %rbx
addq $0x40008, %rsi          # imm = 0x40008
movq 0x70(%rdi), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x4950
movq %rax, %r14
leaq 0x18(%rax), %rdi
movq 0x68(%rbx), %rsi
movq 0x10(%rax), %rdx
callq 0x1160
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x28(%rax), %rdi
testq %rdi, %rdi
je 0x3f55
movq -0x10(%rdi), %rax
jmp 0x3f57
xorl %eax, %eax
testq %rdi, %rdi
je 0x3f62
movq -0x8(%rdi), %rcx
jmp 0x3f64
xorl %ecx, %ecx
cmpq %rcx, %rax
jne 0x3fa1
testq %rdi, %rdi
je 0x3f80
movq -0x10(%rdi), %rax
testq %rax, %rax
movl $0x8, %edx
cmovneq %rax, %rdx
jmp 0x3f85
movl $0x8, %edx
movl $0x10, %esi
callq 0x3ab4
movq 0x80(%rbx), %rcx
movq 0x3010(%rcx), %rcx
movq %rax, 0x28(%rcx)
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x28(%rax), %rax
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 0x3fed
movb -0x8(%rax), %al
decb %al
jmp 0x3fef
movb $-0x1, %al
movzbl %al, %edx
movq %rbx, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4152
leaq 0x37fd(%rip), %rdi      # 0x780a
leaq 0x37af(%rip), %rsi      # 0x77c3
leaq 0x3815(%rip), %rcx      # 0x7830
movl $0x101, %edx            # imm = 0x101
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 0x405d
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
xorl %esi, %esi
callq 0x1080
movq %xmm0, %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x39f0
movzbl %al, %edx
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmp 0x4152
leaq 0x37ef(%rip), %rdi      # 0x7853
leaq 0x3758(%rip), %rsi      # 0x77c3
leaq 0x3807(%rip), %rcx      # 0x7879
movl $0xf7, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 0x4393
movq %rax, %r15
movq %r14, %rdi
movl $0xf, %esi
callq 0x384f
movq %r14, %rdi
movl $0x3, %esi
movq %rbx, %rdx
callq 0x3b46
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x43e0
// File: /workspace/github_c_makefile_star2_O1/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 0x4393
movq %rax, %r15
movq %r14, %rdi
movl $0x16, %esi
callq 0x4393
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x43e0
movq %r14, %rdi
movl $0xf, %esi
callq 0x384f
movq %r14, %rdi
movl $0x2, %esi
movq %rbx, %rdx
callq 0x3b46
movq %r14, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x43e0
// File: /workspace/github_c_makefile_star2_O1/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 0x384f
movq %rbx, %rdi
movl $0xff, %esi
callq 0x384f
movq %rbx, %rdi
movl $0xff, %esi
callq 0x384f
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x43d7
movq -0x8(%rax), %rax
addq $-0x2, %rax
jmp 0x43de
movq $-0x2, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4407
movq -0x8(%rax), %rbx
jmp 0x4409
xorl %ebx, %ebx
subq %rbp, %rbx
cmpq $0x1, %rbx
jle 0x4466
cmpq $0x10002, %rbx          # imm = 0x10002
jl 0x4433
leaq 0x58(%r14), %rsi
leaq 0x34a4(%rip), %rdx      # 0x78ca
movl $0x24, %ecx
movq %r14, %rdi
callq 0x31f4
addl $-0x2, %ebx
movq 0x80(%r14), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
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 0x342f(%rip), %rdi      # 0x789c
leaq 0x334f(%rip), %rsi      # 0x77c3
leaq 0x342b(%rip), %rcx      # 0x78a6
movl $0x1cf, %edx            # imm = 0x1CF
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 0x4520
movq %rdi, %rbx
decl %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq 0x28(%rax,%rcx), %rcx
cmpq 0x3008(%rax), %rcx
jle 0x4520
movq %rbx, %rdi
movl $0xf, %esi
callq 0x384f
movq 0x80(%rbx), %rax
movl 0x3000(%rax), %edx
leal -0x1(%rdx), %ecx
movl %ecx, 0x3000(%rax)
cmpl $0x1, %edx
jg 0x44e0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/gaultier[P]lox-c/parse.c
// Function: return_stmt
static void return_stmt(Parser* parser, Vm* vm) {
    if (parser->compiler->fn_type == TYPE_SCRIPT) {
        error_str_nul(parser, &parser->current,
                      "Cannot return from top-level code");
    }

    if (match(parser, TOKEN_SEMICOLON)) {
        emit_byte(parser, OP_NIL);
    } else {
        expression(parser, vm);
        expect(parser, TOKEN_SEMICOLON, "Expect `;` after return value");
    }
    emit_byte(parser, OP_RETURN);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x80(%rdi), %rax
cmpl $0x1, 0x3018(%rax)
jne 0x4554
leaq 0x30(%rbx), %rsi
leaq 0x35a8(%rip), %rdx      # 0x7aef
movl $0x21, %ecx
movq %rbx, %rdi
callq 0x31f4
cmpl $0x9, 0x50(%rbx)
jne 0x4571
movq %rbx, %rdi
callq 0x2f64
movq %rbx, %rdi
movl $0x7, %esi
callq 0x384f
jmp 0x4595
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x3b46
leaq 0x3589(%rip), %rdx      # 0x7b11
movq %rbx, %rdi
movl $0x9, %esi
callq 0x397b
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x384f
// File: /workspace/github_c_makefile_star2_O1/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 0x3b46
leaq 0x3571(%rip), %rdx      # 0x7b2f
movq %rbx, %rdi
movl $0x9, %esi
callq 0x397b
movq %rbx, %rdi
movl $0xf, %esi
popq %rbx
jmp 0x384f
// File: /workspace/github_c_makefile_star2_O1/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 0x384f
movq 0x80(%rbx), %rax
movq 0x3010(%rax), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x460d
movq -0x8(%rax), %r14
jmp 0x4610
xorl %r14d, %r14d
subq %r15, %r14
addq $0x2, %r14
js 0x4667
cmpq $0x10000, %r14          # imm = 0x10000
jl 0x463a
leaq 0x58(%rbx), %rsi
leaq 0x3430(%rip), %rdx      # 0x7a5d
movl $0x28, %ecx
movq %rbx, %rdi
callq 0x31f4
movl %r14d, %esi
shrl $0x8, %esi
movl $0xff, %ebp
andl %ebp, %esi
movq %rbx, %rdi
callq 0x384f
andl %ebp, %r14d
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x384f
leaq 0x322e(%rip), %rdi      # 0x789c
leaq 0x314e(%rip), %rsi      # 0x77c3
leaq 0x33c0(%rip), %rcx      # 0x7a3c
movl $0x22e, %edx            # imm = 0x22E
callq 0x10f0
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x46b8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x8931(%rip), %rax      # 0xcff0
movq (%rax), %rdi
leaq 0x3496(%rip), %rsi      # 0x7b5f
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_O1/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 0x477b
leaq 0x345a(%rip), %r15      # 0x7b8e
movq %rsp, %r13
movq (%rbx), %rsi
addq %r12, %rsi
movq %rsi, (%rbx)
movq %r14, %rdi
movq %r15, %rdx
movl $0x1a, %ecx
callq 0x4688
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 0x4737
cmpq $-0x1, %r12
je 0x478f
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x12b3
// File: /workspace/github_c_makefile_star2_O1/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 0x2d05(%rip), %rsi      # 0x74b1
callq 0x11c0
testq %rax, %rax
je 0x482e
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1190
testl %eax, %eax
jne 0x4836
movq %r14, %rdi
callq 0x1150
movq %rax, %r12
movq %r14, %rdi
callq 0x10c0
leaq 0x1(%r12), %rsi
leaq 0x345b(%rip), %rdx      # 0x7c46
movq %r15, %rdi
movl $0x3c, %ecx
callq 0x4688
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 0x483e
movq %rax, (%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_O1/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:
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
movq %rcx, (%rsp)
cmpl %edx, %edi
jne 0x4931
cmpl $0x3, %edi
je 0x48f4
cmpl $0x2, %edi
je 0x48cd
movb $0x1, %al
testl %edi, %edi
jne 0x4933
movb (%rsp), %al
xorb 0x8(%rsp), %al
testb $0x1, %al
sete %al
jmp 0x4933
movq %rsi, %xmm0
movq %rcx, %xmm1
subsd %xmm1, %xmm0
andpd 0x33ad(%rip), %xmm0     # 0x7c90
movsd 0x33b5(%rip), %xmm1     # 0x7ca0
ucomisd %xmm0, %xmm1
seta %al
jmp 0x4933
cmpl $0x0, (%rsi)
jne 0x4931
movq %rcx, 0x10(%rsp)
cmpl $0x3, %edx
jne 0x4931
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x4931
movq 0x8(%rsp), %rdi
movq 0x10(%rdi), %rdx
movq (%rsp), %rsi
cmpq 0x10(%rsi), %rdx
jne 0x4931
addq $0x18, %rdi
addq $0x18, %rsi
callq 0x1180
testl %eax, %eax
jmp 0x48c8
xorl %eax, %eax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x33d6(%rip), %rdx      # 0x7d4c
movq %r15, %rdi
movl $0x2a, %ecx
callq 0x4688
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_O1/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 0x3302(%rip), %rdx      # 0x7cc8
movq %r15, %rdi
movl $0x41, %ecx
callq 0x4688
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_O1/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 0x32ae(%rip), %rdx      # 0x7cd6
movl $0x18, %esi
movq %r14, %rdi
movl $0x4c, %ecx
callq 0x4688
movq (%r14), %rax
movl $0x2, (%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, (%rsp)
leaq 0x87ce(%rip), %rdi      # 0xd230
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1100
cmpl $0x3, %ebp
ja 0x4b57
movl %ebp, %eax
leaq 0x3228(%rip), %rcx      # 0x7ca8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x325e(%rip), %rax      # 0x7cee
leaq 0x325c(%rip), %rcx      # 0x7cf3
testb $0x1, (%rsp)
cmovneq %rax, %rcx
leaq 0x878a(%rip), %rdi      # 0xd230
leaq 0x323e(%rip), %rdx      # 0x7ceb
movl $0xff, %esi
xorl %eax, %eax
callq 0x10d0
jmp 0x4b57
movq %rbx, %xmm0
leaq 0x8766(%rip), %rdi      # 0xd230
leaq 0x3228(%rip), %rdx      # 0x7cf9
movl $0xff, %esi
movb $0x1, %al
callq 0x10d0
jmp 0x4b57
movq (%rsp), %r8
movl (%r8), %eax
cmpl $0x2, %eax
je 0x4b3c
cmpl $0x1, %eax
je 0x4b18
testl %eax, %eax
jne 0x4b57
movl 0x10(%r8), %ecx
addq $0x18, %r8
leaq 0x872d(%rip), %rdi      # 0xd230
leaq 0x31f5(%rip), %rdx      # 0x7cff
jmp 0x4b2e
movl $0x6c696e, 0x871a(%rip) # imm = 0x6C696E
jmp 0x4b57
movl 0x30(%r8), %ecx
addq $0x38, %r8
leaq 0x8709(%rip), %rdi      # 0xd230
leaq 0x31ce(%rip), %rdx      # 0x7cfc
movl $0xff, %esi
xorl %eax, %eax
callq 0x10d0
jmp 0x4b57
movabsq $0x6974616e3c406e66, %rax # imm = 0x6974616E3C406E66
movq %rax, 0x86e3(%rip)      # 0xd230
movl $0x3e6576, 0x86e1(%rip) # imm = 0x3E6576
leaq 0x86d2(%rip), %rax      # 0xd230
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, (%rsp)
leaq 0x87b8(%rip), %rdi      # 0xd330
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x1100
cmpl $0x3, %ebp
ja 0x4c6d
movl %ebp, %eax
leaq 0x3122(%rip), %rcx      # 0x7cb8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x3148(%rip), %rax      # 0x7cee
leaq 0x3146(%rip), %rcx      # 0x7cf3
testb $0x1, (%rsp)
cmovneq %rax, %rcx
leaq 0x8774(%rip), %rdi      # 0xd330
leaq 0x314d(%rip), %rdx      # 0x7d10
movl $0xff, %esi
xorl %eax, %eax
callq 0x10d0
jmp 0x4c6d
movq %rbx, %xmm0
leaq 0x8750(%rip), %rdi      # 0xd330
leaq 0x3136(%rip), %rdx      # 0x7d1d
movl $0xff, %esi
movb $0x1, %al
callq 0x10d0
jmp 0x4c6d
movq (%rsp), %r8
movl (%r8), %eax
cmpl $0x2, %eax
je 0x4c52
cmpl $0x1, %eax
je 0x4c2e
testl %eax, %eax
jne 0x4c6d
movl 0x10(%r8), %ecx
addq $0x18, %r8
leaq 0x8717(%rip), %rdi      # 0xd330
leaq 0x3109(%rip), %rdx      # 0x7d29
jmp 0x4c44
movl $0x6c696e, 0x8704(%rip) # imm = 0x6C696E
jmp 0x4c6d
movl 0x30(%r8), %ecx
addq $0x38, %r8
leaq 0x86f3(%rip), %rdi      # 0xd330
leaq 0x30f5(%rip), %rdx      # 0x7d39
movl $0xff, %esi
xorl %eax, %eax
callq 0x10d0
jmp 0x4c6d
movabsq $0x6974616e3c406e66, %rax # imm = 0x6974616E3C406E66
movq %rax, 0x86cd(%rip)      # 0xd330
movl $0x3e6576, 0x86cb(%rip) # imm = 0x3E6576
leaq 0x86bc(%rip), %rax      # 0xd330
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x4f49
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 0x4f25
movq -0x8(%rdx), %r8
jmp 0x4f28
xorl %r8d, %r8d
addq %r8, %rdx
cmpq %rdx, %rax
ja 0x4f68
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 0x4010(%rip), %rdi      # 0x8f60
leaq 0x401b(%rip), %rsi      # 0x8f72
leaq 0x42a7(%rip), %rcx      # 0x9205
movl $0x90, %edx
callq 0x10f0
leaq 0x42b6(%rip), %rdi      # 0x9225
leaq 0x3ffc(%rip), %rsi      # 0x8f72
leaq 0x4288(%rip), %rcx      # 0x9205
movl $0x93, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 0x4fc1
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 0x3f97(%rip), %rdi      # 0x8f60
leaq 0x3fa2(%rip), %rsi      # 0x8f72
leaq 0x4299(%rip), %rcx      # 0x9270
movl $0x36, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movsbq 0x40618(%rdi), %rax
testq %rax, %rax
jle 0x504b
movq %rsi, %rbx
movq %rdi, %r14
decl %eax
leaq (%rax,%rax,2), %r12
leaq 0x7(%rsp), %r15
movb $0x0, (%r15)
movq %r15, %rsi
callq 0x4ef2
movzbl (%r15), %eax
movq 0x40018(%r14,%r12,8), %rcx
movq 0x28(%rcx), %rcx
testq %rcx, %rcx
je 0x502e
movq -0x8(%rcx), %rdx
jmp 0x5030
xorl %edx, %edx
cmpq %rax, %rdx
jbe 0x506a
shll $0x4, %eax
movups (%rcx,%rax), %xmm0
movups %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x3f0e(%rip), %rdi      # 0x8f60
leaq 0x3f19(%rip), %rsi      # 0x8f72
leaq 0x4239(%rip), %rcx      # 0x9299
movl $0x9b, %edx
callq 0x10f0
leaq 0x424c(%rip), %rdi      # 0x92bd
leaq 0x3efa(%rip), %rsi      # 0x8f72
leaq 0x421a(%rip), %rcx      # 0x9299
movl $0xa2, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 0x4ef2
leaq 0xe(%rsp), %r12
movb %bpl, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x4ef2
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_O1/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 0x5f31
cmpb $0x1, %al
jne 0x5f27
popq %rax
retq
movzbl %al, %esi
callq 0x1963
jmp 0x5f25
leaq 0x3028(%rip), %rdi      # 0x8f60
leaq 0x3033(%rip), %rsi      # 0x8f72
leaq 0x3419(%rip), %rcx      # 0x935f
movl $0x4f, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 0x5f80
cmpq %rdx, %rcx
jbe 0x5f9f
notq %rdx
shlq $0x4, %rdx
movups (%rax,%rdx), %xmm0
movups %xmm0, (%rsi)
popq %rax
retq
leaq 0x339b(%rip), %rdi      # 0x9322
leaq 0x2fe4(%rip), %rsi      # 0x8f72
leaq 0x3449(%rip), %rcx      # 0x93de
movl $0x7b, %edx
callq 0x10f0
leaq 0x3475(%rip), %rdi      # 0x941b
leaq 0x2fc5(%rip), %rsi      # 0x8f72
leaq 0x342a(%rip), %rcx      # 0x93de
movl $0x7c, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 0x1ddc
movq %rax, 0x40010(%r14)
movq %r14, 0x40000(%r14)
leaq 0x31af(%rip), %rsi      # 0x91b9
leaq 0x1ea(%rip), %rdx       # 0x61fb
movq %r14, %rdi
callq 0x60d0
leaq 0x319f(%rip), %rsi      # 0x91bf
leaq 0x254(%rip), %rdx       # 0x627b
movq %r14, %rdi
callq 0x60d0
leaq 0x3192(%rip), %rsi      # 0x91c8
leaq 0x2d9(%rip), %rdx       # 0x6316
movq %r14, %rdi
callq 0x60d0
movq %rsp, %rdx
movq $0x0, (%rdx)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x2d40
testl %eax, %eax
jne 0x60a2
movq 0x40008(%rsp), %rax
movq %rax, %rcx
subq %r14, %rcx
cmpq $0x3fff0, %rcx          # imm = 0x3FFF0
jae 0x60b1
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 0x640a
movq %r14, %rdi
callq *%rbx
addq $0x40628, %rsp          # imm = 0x40628
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x326a(%rip), %rdi      # 0x9322
leaq 0x2eb3(%rip), %rsi      # 0x8f72
leaq 0x327a(%rip), %rcx      # 0x9340
movl $0x6f, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 0x4950
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 0x61bd
movl $0x3, (%rax)
movq %r13, 0x8(%rax)
addq $0x10, 0x40000(%rbx)
movq %r12, %rdi
callq 0x4a10
movq 0x40000(%rbx), %rcx
movq %rcx, %rdx
subq %rbx, %rdx
cmpq $0x3fff0, %rdx          # imm = 0x3FFF0
jae 0x61bd
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 0x1efe
movq 0x40000(%rbx), %rax
cmpq %rbx, %rax
je 0x61dc
leaq -0x10(%rax), %rcx
movq %rcx, 0x40000(%rbx)
cmpq %rbx, %rcx
je 0x61dc
addq $-0x20, %rax
movq %rax, 0x40000(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x315e(%rip), %rdi      # 0x9322
leaq 0x2da7(%rip), %rsi      # 0x8f72
leaq 0x316e(%rip), %rcx      # 0x9340
movl $0x6f, %edx
callq 0x10f0
leaq 0x310d(%rip), %rdi      # 0x92f0
leaq 0x2d88(%rip), %rsi      # 0x8f72
leaq 0x3111(%rip), %rcx      # 0x9302
movl $0x86, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 0x6268
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 0x19e1
movl $0x2, %r14d
jmp 0x625b
// File: /workspace/github_c_makefile_star2_O1/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 0x62fa
movq %rcx, %rbx
movq %rsp, %rdi
movq $0x0, (%rdi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq 0x6d24(%rip), %rax      # 0xcfd0
movq (%rax), %rdx
callq 0x11d0
testq %rax, %rax
jle 0x6307
movq %rax, %r15
addq $0x40008, %r14          # imm = 0x40008
decq %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4950
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 0x1a39
jmp 0x630f
movq %r14, %rdi
callq 0x1a91
movl $0x2, %eax
jmp 0x62f0
// File: /workspace/github_c_makefile_star2_O1/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 0x63d6
movq %rcx, %r15
movq %rsi, %r14
movl (%rsi), %edi
leaq 0x8(%rsi), %r12
movq 0x8(%rsi), %rsi
xorl %edx, %edx
callq 0x4938
testb %al, %al
je 0x63e3
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 0x31d2(%rip), %rdx      # 0x9543
movq %rbx, %rdi
movl $0x176, %ecx            # imm = 0x176
callq 0x4688
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 0x63b7
movq 0x8(%rsp), %rax
cmpb $0x0, (%rax)
jne 0x63f3
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 0x1afa
jmp 0x6402
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1b52
jmp 0x6402
movq (%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1bbf
movl $0x2, %r13d
jmp 0x63c4
// File: /workspace/github_c_makefile_star2_O1/gaultier[P]lox-c/vm.c
// Function: fn_call
static Result fn_call(Vm* vm, ObjFunction* fn, uint8_t arg_count) {
    if (fn->arity != arg_count) {
        VM_ERROR(vm, get_location(vm),
                 "Wrong arity in function call: expected %d, got: %d",
                 fn->arity, arg_count);
    }

    if ((vm->frame_len + 1) == FRAMES_MAX) {
        VM_ERROR(vm, get_location(vm), "Reached maximum number of frames: %d",
                 FRAMES_MAX);
    }

    CallFrame* frame = &vm->frames[vm->frame_len++];

    LOG("frames=%d\n", vm->frame_len);
    frame->fn = fn;

    frame->ip = fn->chunk.opcodes;
    frame->slots = vm->stack_top - arg_count - 1;

    return RES_OK;
}

// Assembly:
pushq %rax
movq %rsi, %rax
movq %rdi, %rsi
cmpb %dl, 0x10(%rax)
jne 0x6466
movsbq 0x40618(%rsi), %rcx
cmpq $0x3f, %rcx
je 0x6477
leal 0x1(%rcx), %edi
movb %dil, 0x40618(%rsi)
leaq (%rcx,%rcx,2), %rcx
movq %rax, 0x40018(%rsi,%rcx,8)
movq 0x18(%rax), %rax
movq %rax, 0x40020(%rsi,%rcx,8)
movq 0x40000(%rsi), %rax
movzbl %dl, %edx
shll $0x4, %edx
subq %rdx, %rax
addq $-0x10, %rax
movq %rax, 0x40028(%rsi,%rcx,8)
xorl %eax, %eax
popq %rcx
retq
addq $0x10, %rax
movzbl %dl, %edi
movq %rax, %rdx
callq 0x1c41
jmp 0x647f
movq %rsi, %rdi
callq 0x1c9f
movl $0x2, %eax
jmp 0x6464
// File: /workspace/github_c_makefile_star2_O1/bobrippling[P]tim/main.c
// Function: args_next_fname
char *args_next_fname(bool pop)
{
	char *fname = remaining_fnames ? *remaining_fnames : NULL;
	if(pop && fname)
		remaining_fnames++;
	return fname;
}

// Assembly:
movq 0x12c05(%rip), %rcx     # 0x173c8
testq %rcx, %rcx
je 0x47cd
movq (%rcx), %rax
jmp 0x47cf
xorl %eax, %eax
testq %rax, %rax
setne %dl
andb %dl, %dil
cmpb $0x1, %dil
jne 0x47e9
addq $0x8, %rcx
movq %rcx, 0x12bdf(%rip)     # 0x173c8
retq