LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: declaration
static void declaration(Parser *parser) {
    Debug_Log(parser);

    if (consume_if(parser, TOKEN_LET)) {
        let_declaration(parser);
    } else if (consume_if(parser, TOKEN_FN)) {
        fn_declaration(parser);
    } else if (consume_if(parser, TOKEN_RETURN)) {
        return_statement(parser);
    } else if (consume_if(parser, TOKEN_CONTINUE)) {
        continue_statement(parser);
    } else {
        expression(parser);
        emit_byte(parser, OP_POP_X);
    }

    if (parser->panic_mode) {
        recover(parser);
    }

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x9
popq %rsi
callq 0x5876
testb %al, %al
je 0x58d0
leaq 0x3f09(%rip), %rsi      # 0x97b6
movq %rbx, %rdi
callq 0x5ab5
movl %eax, %ebp
pushq $0x1f
popq %rsi
movq %rbx, %rdi
callq 0x5876
testb %al, %al
je 0x591e
movq %rbx, %rdi
callq 0x5a96
jmp 0x5929
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x5876
testb %al, %al
je 0x596d
leaq 0x3f57(%rip), %rsi      # 0x9841
movq %rbx, %rdi
callq 0x5ab5
movl %eax, %ebp
movq 0x8(%rbx), %rax
movl 0x221c(%rax), %ecx
testl %ecx, %ecx
jle 0x5911
movslq 0x2018(%rax), %rdx
shlq $0x5, %rdx
movl %ecx, 0x10(%rdx,%rax)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x5d7e
jmp 0x5929
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x5bc8
cmpb $0x1, 0x49(%rbx)
jne 0x5968
movb $0x0, 0x49(%rbx)
movabsq $0x40000000009225, %r14 # imm = 0x40000000009225
movl 0x18(%rbx), %eax
cmpq $0x36, %rax
ja 0x5958
btq %rax, %r14
jb 0x5968
cmpl $0x26, 0x30(%rbx)
je 0x5968
movq %rbx, %rdi
callq 0x5a44
jmp 0x5949
popq %rbx
popq %r14
popq %rbp
retq
pushq $0xc
popq %rsi
movq %rbx, %rdi
callq 0x5876
testb %al, %al
je 0x59b4
movq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rax)
jne 0x5995
leaq 0x3f68(%rip), %rsi      # 0x98f5
movq %rbx, %rdi
callq 0x5c5c
pushq $0x26
popq %rsi
movq %rbx, %rdi
callq 0x5876
testb %al, %al
je 0x59f3
pushq $0x2
popq %rsi
pushq $0x34
popq %rdx
movq %rbx, %rdi
callq 0x5d5f
jmp 0x5935
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x5876
testb %al, %al
je 0x59ff
cmpl $-0x1, 0x4c(%rbx)
jne 0x59d8
leaq 0x3f47(%rip), %rsi      # 0x9917
movq %rbx, %rdi
callq 0x5c5c
movl 0x50(%rbx), %esi
movq %rbx, %rdi
callq 0x5f95
movl 0x4c(%rbx), %esi
movq %rbx, %rdi
callq 0x604b
jmp 0x5935
movq %rbx, %rdi
callq 0x5a96
pushq $0x34
jmp 0x5a09
movq %rbx, %rdi
callq 0x5a96
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
jmp 0x5935
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: advance
static inline void advance(Parser *parser) {
    parser->previous = parser->current;

    for (;;) {
        parser->current = lexer_next(parser->lexer);
        if (parser->current.type != TOKEN_ERROR) break;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x18(%rdi), %r15
movq 0x28(%rdi), %rax
movq %rax, 0x40(%rdi)
movups 0x18(%rdi), %xmm0
movups %xmm0, 0x30(%rdi)
leaq 0x8(%rsp), %r14
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x7333
movq 0x18(%rsp), %rax
movq %rax, 0x10(%r15)
movups 0x8(%rsp), %xmm0
movups %xmm0, (%r15)
cmpl $0x35, 0x18(%rbx)
je 0x5a69
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: variable
static uint8_t variable(Parser *parser, const char *error) {
    consume(parser, TOKEN_IDENTIFIER, error);

    // global scope
    if (parser->context->scope_depth <= 0) {
        return identifier_constant(parser, &parser->previous);
    }

    // local scope
    Context *context = parser->context;
    Token *name = &parser->previous;

    // Check if the variable was already declared, since raven doesn't
    // support shadowing in local scopes.
    for (int i = context->local_count - 1; i >= 0; i--) {
        Local *local = &context->locals[i];

        if (local->depth == -1 || local->depth < context->scope_depth) {
            break; // Not previously declared in the current scope.
        }

        if (same_identifier(name, &local->name)) {
            error_previous(parser, "name is already declared");
        }
    }

    // Declare the local variable.
    add_local(parser, *name);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
pushq $0x2f
popq %rsi
callq 0x5bf2
movq 0x8(%rbx), %r13
leaq 0x30(%rbx), %r14
cmpl $0x0, 0x221c(%r13)
jle 0x5b77
movl 0x2018(%r13), %ebp
movq %rbp, %rax
shlq $0x5, %rax
leaq (%rax,%r13), %r15
addq $-0x8, %r15
leaq 0x3cc9(%rip), %r12      # 0x97cd
testl %ebp, %ebp
jle 0x5b3c
movl 0x18(%r15), %eax
cmpl $-0x1, %eax
je 0x5b3c
cmpl 0x221c(%r13), %eax
jl 0x5b3c
movq %r14, %rdi
movq %r15, %rsi
callq 0x5c38
testb %al, %al
je 0x5b34
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5c5c
decl %ebp
addq $-0x20, %r15
jmp 0x5b04
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movaps %xmm0, (%rsp)
movq 0x8(%rbx), %rax
movslq 0x2018(%rax), %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x5b8d
leaq 0x3ca6(%rip), %rsi      # 0x980e
movq %rbx, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x5d22
jmp 0x5bb7
movq %rbx, %rdi
movq %r14, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5c01
leal 0x1(%rcx), %edx
movl %edx, 0x2018(%rax)
shlq $0x5, %rcx
movq 0x10(%rsp), %rdx
movq %rdx, 0x28(%rax,%rcx)
movaps (%rsp), %xmm0
movups %xmm0, 0x18(%rax,%rcx)
orl $-0x1, 0x30(%rax,%rcx)
movb $0x0, 0x34(%rax,%rcx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: define_variable
static void define_variable(Parser *parser, uint8_t name_index) {
    // local scope
    if (parser->context->scope_depth > 0) {
        mark_initialized(parser->context);
        return;
    }

    // global scope
    emit_bytes(parser, OP_DEF_GLOBAL, name_index);
}

// Assembly:
movq 0x8(%rdi), %rax
movl 0x221c(%rax), %ecx
testl %ecx, %ecx
jle 0x5be6
movslq 0x2018(%rax), %rdx
shlq $0x5, %rdx
movl %ecx, 0x10(%rdx,%rax)
retq
movzbl %sil, %edx
pushq $0x16
popq %rsi
jmp 0x5d5f
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: error_header
static void error_header(Parser *parser, Token *where) {
    parser->panic_mode = true;
    parser->had_error = true;

    fprintf(stderr, "[%s: %d] SyntaxError",
            parser->lexer->file, where->line);

    if (where->type == TOKEN_EOF) {
        fprintf(stderr, " at end");
    } else if (where->type != TOKEN_ERROR) {
        fprintf(stderr, " at '%.*s'", where->length, where->lexeme);
    }

    fprintf(stderr, ": ");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movw $0x101, 0x48(%rdi)      # imm = 0x101
movq 0x8342(%rip), %r14      # 0xdff0
movq (%r14), %rax
movq (%rdi), %rcx
movq (%rcx), %rdx
movl 0x14(%rsi), %ecx
leaq 0x3b25(%rip), %rsi      # 0x97e6
movq %rax, %rdi
xorl %eax, %eax
callq 0x2140
movl (%rbx), %eax
cmpl $0x35, %eax
je 0x5d06
cmpl $0x36, %eax
jne 0x5cee
movq (%r14), %rcx
leaq 0x3b1a(%rip), %rdi      # 0x97fb
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
callq 0x2200
jmp 0x5d06
movq (%r14), %rdi
movl 0x10(%rbx), %edx
movq 0x8(%rbx), %rcx
leaq 0x3b04(%rip), %rsi      # 0x9803
xorl %eax, %eax
callq 0x2140
movq (%r14), %rcx
leaq 0x3a19(%rip), %rdi      # 0x9729
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2200
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: function
static void function(Parser *parser, FunctionType type) {
    Context context;
    init_context(&context, parser, type);
    begin_scope(parser);

    if (type == FunctionDeclaration) {
        consume(parser, TOKEN_LEFT_PAREN, "expect '(' after name");
        parameters(parser, TOKEN_RIGHT_PAREN);
        function_block(parser);
    } else if (type == FunctionLambda) {
        parameters(parser, TOKEN_ARROW);
        expression(parser);
    } else if (type == FunctionLambdaHeadless) {
        expression(parser);
    } else {
        assert(!"invalid function type");
    }

    RavFunction *function = end_context(parser, false);
    uint8_t index = make_constant(parser, Obj_Value(function));
    emit_bytes(parser, OP_CLOSURE, index);

    for (int i = 0; i < function->upvalue_count; i++) {
        emit_byte(parser, context.upvalues[i].is_local ? 1 : 0);
        emit_byte(parser, context.upvalues[i].index);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x2228, %rsp           # imm = 0x2228
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x57d4
movq 0x8(%rbx), %rax
incl 0x221c(%rax)
cmpl $0x2, %ebp
je 0x5e1b
cmpl $0x1, %ebp
jne 0x5e26
leaq 0x3a9e(%rip), %rdx      # 0x9858
pushq $0x28
popq %rsi
movq %rbx, %rdi
callq 0x5bf2
pushq $0x29
popq %rsi
movq %rbx, %rdi
callq 0x5eac
movl 0x18(%rbx), %eax
cmpl $0x23, %eax
je 0x5de7
cmpl $0x36, %eax
je 0x5de7
movq %rbx, %rdi
callq 0x5893
jmp 0x5dd0
leaq 0x3ad3(%rip), %rdx      # 0x98c1
pushq $0x23
popq %rsi
movq %rbx, %rdi
callq 0x5bf2
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rdx
movslq 0x20(%rax), %rcx
cmpb $0x5, -0x1(%rdx,%rcx)
jne 0x5e9f
decl %ecx
movl %ecx, 0x20(%rax)
jmp 0x5e2e
pushq $0x24
popq %rsi
movq %rbx, %rdi
callq 0x5eac
movq %rbx, %rdi
callq 0x5a96
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5a17
movq %rax, %r14
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
orq %rax, %rsi
movq %rbx, %rdi
callq 0x5f52
movzbl %al, %edx
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0x5d5f
movslq 0x1c(%r14), %rax
cmpq %rax, %r15
jge 0x5e91
movzbl 0x2024(%rsp,%r15,2), %esi
movq %rbx, %rdi
callq 0x5a9e
movzbl 0x2025(%rsp,%r15,2), %esi
movq %rbx, %rdi
callq 0x5a9e
incq %r15
jmp 0x5e61
addq $0x2228, %rsp           # imm = 0x2228
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
jmp 0x5e2e
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: parameters
static void parameters(Parser *parser, TokenType closing_token) {
    if (consume_if(parser, closing_token)) return;

    RavFunction *function = parser->context->function;
    do {
        function->arity++;

        if (function->arity > UINT8_MAX) {
            error_limit(parser, "parameters", 255);
        }

        uint8_t index = variable(parser, "expect parameter name");
        define_variable(parser, index);
    } while (consume_if(parser, TOKEN_COMMA));

    consume(parser, closing_token, "expect a closing pararmeters token");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x5876
testb %al, %al
je 0x5ed4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rax
movq 0x8(%rax), %r13
leaq 0x399a(%rip), %r15      # 0x987d
leaq 0x399e(%rip), %r12      # 0x9888
pushq $0x25
popq %rbp
movl 0x18(%r13), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x18(%r13)
cmpl $0xff, %eax
jl 0x5f0f
movq %r14, %rdi
movq %r15, %rsi
movl $0xff, %edx
callq 0x5d22
movq %r14, %rdi
movq %r12, %rsi
callq 0x5ab5
movzbl %al, %esi
movq %r14, %rdi
callq 0x5bc8
movq %r14, %rdi
movl %ebp, %esi
callq 0x5876
testb %al, %al
jne 0x5eed
leaq 0x3964(%rip), %rdx      # 0x989e
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5bf2
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: make_constant
static inline uint8_t make_constant(Parser *parser, Value value) {
    int constant_index = chunk_write_constant(parser_chunk(parser), value);

    if (constant_index >= CONST_LIMIT) {
        error_limit(parser, "constants", CONST_LIMIT);
        parser_chunk(parser)->constants_count = 0;
        return 0;
    }

    return (uint8_t)constant_index;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rdi
addq $0x20, %rdi
callq 0x4a18
cmpl $0x100, %eax            # imm = 0x100
jl 0x5f93
leaq 0x3976(%rip), %rsi      # 0x98eb
movq %rbx, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x5d22
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
andl $0x0, 0x848(%rax)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: unwind_stack
static void unwind_stack(Parser *parser, int depth) {
    Context *context = parser->context;
    int local_count = 0;
    bool do_closing = false;

    for (int i = context->local_count - 1; i >= 0; i--) {
        if (context->locals[i].depth < depth) {
            break;
        }

        if (context->locals[i].is_captured) {
            emit_byte(parser, OP_CLOSE_UPVALUE);
            do_closing = true;
        } else {
            emit_byte(parser, OP_POP);
        }

        local_count++;
    }
    context->local_count -= local_count;

    // If no closing occurs, optimize the consecutive pop instructions.
    if (!do_closing && local_count != 0) {
        parser_chunk(parser)->count -= local_count;
        emit_bytes(parser, OP_POPN, (uint8_t)local_count);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movl 0x2018(%rcx), %r12d
movq %r12, %rax
shlq $0x5, %rax
movq %rcx, (%rsp)
leaq (%rax,%rcx), %r13
addq $0x14, %r13
xorl %r14d, %r14d
xorl %r15d, %r15d
testl %r12d, %r12d
jle 0x5ff9
cmpl %ebp, -0x4(%r13)
jl 0x5ff9
movb (%r13), %al
pushq $0x23
popq %rsi
testb %al, %al
jne 0x5fe2
pushq $0x7
popq %rsi
orb %al, %r15b
movq %rbx, %rdi
callq 0x5a9e
incl %r14d
decl %r12d
addq $-0x20, %r13
jmp 0x5fc9
movq (%rsp), %rax
subl %r14d, 0x2018(%rax)
testl %r14d, %r14d
sete %al
orb %al, %r15b
testb $0x1, %r15b
je 0x6022
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
subl %r14d, 0x20(%rax)
movzbl %r14b, %edx
pushq $0x8
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5d5f
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: emit_loop
static inline void emit_loop(Parser *parser, int start) {
    emit_byte(parser, OP_JMP_BACK);

    // +2 for the OP_JMP_BACK 2-bytes operand.
    int offset = parser_chunk(parser)->count - start + 2;
    if (offset > UINT16_MAX) {
        error_current(parser, "loop body exceeds the allowed limit");
    }

    emit_bytes(parser, (offset >> 8) & 0xff, offset & 0xff);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
pushq $0x1f
popq %rsi
callq 0x5a9e
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movl 0x20(%rax), %ebp
subl %r14d, %ebp
cmpl $0xfffe, %ebp           # imm = 0xFFFE
jl 0x6082
leaq 0x38bc(%rip), %rsi      # 0x9936
movq %rbx, %rdi
callq 0x5c65
addl $0x2, %ebp
movl %ebp, %esi
shrl $0x8, %esi
movl $0xff, %eax
andl %eax, %ebp
andl %eax, %esi
movq %rbx, %rdi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x5d5f
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: parse_precedence
static void parse_precedence(Parser *parser, Precedence precedence) {
    Debug_Logf(parser, "expression(%s)", precedence_string[precedence]);

    advance(parser);

    ParseFn prefix = token_rule(parser->previous.type)->prefix;
    if (prefix == NULL) {
        error_previous(parser, "Unexpected token, expect expression");
        return;
    }

    prefix(parser);
    while (precedence <= token_rule(parser->current.type)->precedence) {
        advance(parser);
        token_rule(parser->previous.type)->infix(parser);
    }

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x5a44
movl 0x30(%rbx), %eax
imulq $0x18, %rax, %rax
leaq 0x77e3(%rip), %r14      # 0xd8a0
movq (%rax,%r14), %rax
testq %rax, %rax
je 0x60f7
movq %rbx, %rdi
callq *%rax
movl 0x18(%rbx), %eax
imulq $0x18, %rax, %rax
cmpl %ebp, 0x10(%rax,%r14)
jb 0x60f2
movq %rbx, %rdi
callq 0x5a44
movl 0x30(%rbx), %eax
imulq $0x18, %rax, %rax
movq %rbx, %rdi
callq *0x8(%rax,%r14)
jmp 0x60cb
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x385c(%rip), %rsi      # 0x995a
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5c5c
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: if_
static void if_(Parser *parser) {
    // If Control Flow:
    //
    // Condition
    // OP_JMP_POP_FALSE    -------.
    //                            |
    // Then Block                 |
    // OP_JMP              -----------.
    //                            |   |
    // Else Block | Nil    <-------   |
    // ....                <-----------

    Debug_Log(parser);

    expression(parser); // Condition
    consume(parser, TOKEN_DO, "expect 'do' after if condition");

    int then_jump = emit_jump(parser, OP_JMP_POP_FALSE);  // ---. false
    if_block(parser);                                     //    |
                                                          //    |
    int else_jump = emit_jump(parser, OP_JMP);            // ---|--. true
                                                          //    |  |
    patch_jump(parser, then_jump);                        // <---  |
                                                          //       |
    if (parser->previous.type == TOKEN_ELSE) {            //       |
        block(parser);                                    //       |
    } else {                                              //       |
        emit_byte(parser, OP_PUSH_NIL);                   //       |
    }                                                     //       |
                                                          //       |
    patch_jump(parser, else_jump);                        // <------

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x5a96
leaq 0x37cb(%rip), %rdx      # 0x99df
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0x5bf2
pushq $0x21
popq %rsi
movq %rbx, %rdi
callq 0x6b8f
movl %eax, %ebp
movq 0x8(%rbx), %rax
incl 0x221c(%rax)
movabsq $0x40000800000008, %r14 # imm = 0x40000800000008
movl 0x18(%rbx), %eax
cmpq $0x36, %rax
ja 0x624f
btq %rax, %r14
jb 0x6259
movq %rbx, %rdi
callq 0x5893
jmp 0x6240
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x5876
testb %al, %al
jne 0x627a
leaq 0x378f(%rip), %rdx      # 0x99fe
pushq $0x23
popq %rsi
movq %rbx, %rdi
callq 0x5bf2
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x6bfc
pushq $0x1e
popq %rsi
movq %rbx, %rdi
callq 0x6b8f
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6bba
cmpl $0x3, 0x30(%rbx)
jne 0x62ad
movq %rbx, %rdi
callq 0x6708
jmp 0x62b8
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
movq %rbx, %rdi
movl %r14d, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x6bba
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: while_
static void while_(Parser *parser) {
    // While Control Flow
    //
    // Condition       <----------.
    // OP_JMP_POP_FALSE   -----.  |
    //                         |  |
    // [continue]              |  |
    // OP_JMP_BACK        --------|
    //                         |  |
    // Loop Body               |  |
    // OP_JMP_BACK        ---------
    //                         |
    // ....            <--------

    Debug_Log(parser);

    // Register the surrounding loop state.
    int previous_inner_loop_start = parser->inner_loop_start;
    int previous_inner_loop_depth = parser->inner_loop_depth;

    int loop_start = parser_chunk(parser)->count;             // <-----.
                                                              //       |
    // Push the current loop state                            //       |
    parser->inner_loop_start = loop_start;                    //       |
    parser->inner_loop_depth = parser->context->scope_depth;  //       |
                                                              //       |
    expression(parser); // Condition                          //       |
                                                              //       |
    consume(parser, TOKEN_DO, "expect 'do' after while condition"); // |
                                                              //       |
    int exit_jump = emit_jump(parser, OP_JMP_POP_FALSE);      // ---.  |
                                                              //    |  |
    loop_block(parser);                                       //    |  |
                                                              //    |  |
    emit_loop(parser, loop_start);                            // -------
                                                              //    |
    patch_jump(parser, exit_jump);                            // <---

    // The resulting expression of a loop is always nil.
    emit_byte(parser, OP_PUSH_NIL);

    // Pop the current loop state.
    parser->inner_loop_start = previous_inner_loop_start;
    parser->inner_loop_depth = previous_inner_loop_depth;

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movsd 0x4c(%rdi), %xmm0
movaps %xmm0, (%rsp)
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rcx
movl 0x20(%rcx), %ebp
movl %ebp, 0x4c(%rdi)
movl 0x221c(%rax), %eax
movl %eax, 0x50(%rdi)
callq 0x5a96
leaq 0x3704(%rip), %rdx      # 0x9b7b
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0x5bf2
pushq $0x21
popq %rsi
movq %rbx, %rdi
callq 0x6b8f
movl %eax, %r14d
movq 0x8(%rbx), %rax
incl 0x221c(%rax)
movl 0x18(%rbx), %eax
cmpl $0x23, %eax
je 0x64b1
cmpl $0x36, %eax
je 0x64b1
movq %rbx, %rdi
callq 0x5893
jmp 0x649a
leaq 0x36e5(%rip), %rdx      # 0x9b9d
pushq $0x23
popq %rsi
movq %rbx, %rdi
callq 0x5bf2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6bfc
movq %rbx, %rdi
movl %ebp, %esi
callq 0x604b
movq %rbx, %rdi
movl %r14d, %esi
callq 0x6bba
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
movaps (%rsp), %xmm0
movlps %xmm0, 0x4c(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: binary
static void binary(Parser *parser) {
    Debug_Log(parser);

    TokenType operator = parser->previous.type;

    ParseRule *rule = token_rule(operator);
    parse_precedence(parser, (Precedence)(rule->precedence + 1));

    switch (operator) {
    case TOKEN_PLUS:          emit_byte(parser, OP_ADD); break;
    case TOKEN_MINUS:         emit_byte(parser, OP_SUB); break;
    case TOKEN_STAR:          emit_byte(parser, OP_MUL); break;
    case TOKEN_SLASH:         emit_byte(parser, OP_DIV); break;
    case TOKEN_PERCENT:       emit_byte(parser, OP_MOD); break;
    case TOKEN_LESS:          emit_byte(parser, OP_LT);  break;
    case TOKEN_LESS_EQUAL:    emit_byte(parser, OP_LTQ); break;
    case TOKEN_GREATER:       emit_byte(parser, OP_GT);  break;
    case TOKEN_GREATER_EQUAL: emit_byte(parser, OP_GTQ); break;
    case TOKEN_EQUAL_EQUAL:   emit_byte(parser, OP_EQ);  break;
    case TOKEN_BANG_EQUAL:    emit_byte(parser, OP_NEQ); break;
    default:
        assert(!"invalid token type");
    }

    Debug_Exit(parser);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x30(%rdi), %r14d
imulq $0x18, %r14, %rax
leaq 0x738c(%rip), %rcx      # 0xd8a0
movl 0x10(%rax,%rcx), %esi
incl %esi
callq 0x60a1
leal -0x10(%r14), %eax
cmpl $0x12, %eax
jae 0x654e
movl $0x3781f, %ecx          # imm = 0x3781F
btl %eax, %ecx
jae 0x654e
movl %eax, %eax
leaq 0x3269(%rip), %rcx      # 0x97a4
movzbl (%rax,%rcx), %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5a9e
leaq 0x366e(%rip), %rdi      # 0x9bc3
leaq 0x3312(%rip), %rsi      # 0x986e
leaq 0x3676(%rip), %rcx      # 0x9bd9
movl $0x2c0, %edx            # imm = 0x2C0
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: unary
static void unary(Parser *parser) {
    Debug_Log(parser);

    TokenType operator = parser->previous.type;
    parse_precedence(parser, PREC_UNARY);

    switch (operator) {
    case TOKEN_MINUS: emit_byte(parser, OP_NEG); break;
    case TOKEN_NOT:   emit_byte(parser, OP_NOT); break;
    default:
        assert(!"invalid token type");
    }

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x30(%rdi), %ebp
pushq $0xa
popq %rsi
callq 0x60a1
movb $0xe, %al
cmpl $0x11, %ebp
je 0x658c
cmpl $0x16, %ebp
jne 0x659d
movb $0x15, %al
movzbl %al, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5a9e
leaq 0x361f(%rip), %rdi      # 0x9bc3
leaq 0x32c3(%rip), %rsi      # 0x986e
leaq 0x363d(%rip), %rcx      # 0x9bef
movl $0x5e0, %edx            # imm = 0x5E0
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: and_
static void and_(Parser *parser) {
    // Operator Flow:
    //
    // [Left Operand]
    // OP_JMP_FALSE   ---.
    // OP_POP            |
    // [Right Operand]   |
    // ....    <----------

    Debug_Log(parser);

    int jump = emit_jump(parser, OP_JMP_FALSE);

    emit_byte(parser, OP_POP);
    parse_precedence(parser, PREC_AND + 1);

    patch_jump(parser, jump);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x20
popq %rsi
callq 0x6b8f
movl %eax, %ebp
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x60a1
movq %rbx, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6bba
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: or_
static void or_(Parser *parser) {
    // Operator Flow:
    //
    // [Left Operand]
    // OP_JMP_FALSE   ---.
    // OP_JMP         ---|--.
    // OP_POP  <----------  |
    // [Right Operand]      |
    // ....    <-------------

    Debug_Log(parser);

    // first operand is falsy
    int false_jump = emit_jump(parser, OP_JMP_FALSE);

    // first operand is not falsy
    int true_jump = emit_jump(parser, OP_JMP);

    patch_jump(parser, false_jump);

    emit_byte(parser, OP_POP);
    parse_precedence(parser, PREC_OR + 1);

    patch_jump(parser, true_jump);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x20
popq %rsi
callq 0x6b8f
movl %eax, %ebp
pushq $0x1e
popq %rsi
movq %rbx, %rdi
callq 0x6b8f
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6bba
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x60a1
movq %rbx, %rdi
movl %r14d, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x6bba
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: assignment
static void assignment(Parser *parser) {
    Debug_Log(parser);

    Chunk *chunk = parser_chunk(parser);
    if (chunk->count < 2) {
        error_previous(parser, "invalid assignment target");
        return;
    }

    // Special case of indexing
    if (chunk->opcodes[chunk->count - 1] == OP_GET_ELEMENT) {
        chunk->count--;
        parse_precedence(parser, PREC_ASSIGNMENT);
        emit_byte(parser, OP_SET_ELEMENT);
        return;
    }

    // Check if the left hand side was an identifier, it's kind of a hack.
    // If it's an identifier, the last written opcode should be one of
    // these getters opcodes.
    uint8_t opcode = chunk->opcodes[chunk->count - 2];
    if (opcode != OP_GET_GLOBAL &&
        opcode != OP_GET_LOCAL &&
        opcode != OP_GET_UPVALUE) {
        error_previous(parser, "invalid assignment target");
        return;
    }

    // Get slot index of the variable and extract the corresponding
    // set instruction, and then discard the get instruction.
    uint8_t index = chunk->opcodes[chunk->count - 1];
    uint8_t set_op = opcode - 1;
    chunk->count -= 2;

    // Not PREC_ASSIGNMENT + 1, since assignment is right associated.
    parse_precedence(parser, PREC_ASSIGNMENT);
    emit_bytes(parser, set_op, index);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rax
movslq 0x20(%rax), %rcx
cmpq $0x1, %rcx
jg 0x669c
leaq 0x3574(%rip), %rsi      # 0x9c04
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5c5c
movq 0x28(%rax), %rdx
movb -0x1(%rdx,%rcx), %bpl
cmpb $0x2b, %bpl
jne 0x66ca
decl %ecx
movl %ecx, 0x20(%rax)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x60a1
pushq $0x2a
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5a9e
addl $-0x2, %ecx
movzbl (%rdx,%rcx), %r14d
cmpl $0x1c, %r14d
ja 0x6689
movl $0x15000000, %edx       # imm = 0x15000000
btl %r14d, %edx
jae 0x6689
decb %r14b
movl %ecx, 0x20(%rax)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x60a1
movzbl %bpl, %edx
movzbl %r14b, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5d5f
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: block
static void block(Parser *parser) {
    Debug_Log(parser);

    begin_scope(parser);

    while (!current_is(parser, TOKEN_END) && !current_is(parser, TOKEN_EOF)) {
        declaration(parser);
    }

    consume(parser, TOKEN_END, "expect closing 'end' after block");

    end_scope(parser, true);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
incl 0x221c(%rax)
movl 0x18(%rbx), %eax
cmpl $0x23, %eax
je 0x672d
cmpl $0x36, %eax
je 0x672d
movq %rbx, %rdi
callq 0x5893
jmp 0x6716
leaq 0x34ea(%rip), %rdx      # 0x9c1e
pushq $0x23
popq %rsi
movq %rbx, %rdi
callq 0x5bf2
pushq $0x1
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x6bfc
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: map
static void map(Parser* parser) {
    Debug_Log(parser);

    if (consume_if(parser, TOKEN_RIGHT_BRACE)) {
        emit_bytes(parser, OP_MAP_8, 0);
        Debug_Exit(parser);
        return;
    }

    size_t count = 0;
    do {
        consume(parser, TOKEN_IDENTIFIER, "expect a map key name");

        // key
        RavString *key = object_string(
            &parser->vm->allocator,
            parser->previous.lexeme,
            parser->previous.length
        );
        emit_constant(parser, Obj_Value(key));

        consume(parser, TOKEN_COLON, "expect ':' after map key");

        if (count == MAP_LIMIT) {
            error_limit(parser, "map literal elements", MAP_LIMIT);
            break;
        }

        // value
        expression(parser);

        count++;
    } while (consume_if(parser, TOKEN_COMMA));

    if (count > UINT8_MAX) {
        emit_byte(parser, OP_MAP_16);
        emit_bytes(parser, (count >> 8) & 0xff, count & 0xff);
    } else {
        emit_bytes(parser, OP_MAP_8, (uint8_t)count);
    }

    consume(parser, TOKEN_RIGHT_BRACE, "expect '}' after map elements");

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x2b
popq %rsi
callq 0x5876
testb %al, %al
je 0x6827
pushq $0x28
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5d5f
pushq $-0x1
popq %r14
movabsq $-0x4000000000000, %rbp # imm = 0xFFFC000000000000
leaq 0x3471(%rip), %r15      # 0x9cad
pushq $0x27
popq %r12
pushq $0x25
popq %r13
movq %rbx, %rdi
pushq $0x2f
popq %rsi
leaq 0x3446(%rip), %rdx      # 0x9c97
callq 0x5bf2
movq 0x10(%rbx), %rdi
movq 0x38(%rbx), %rsi
movl 0x40(%rbx), %edx
callq 0x4de8
orq %rbp, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x71c6
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x5bf2
cmpq $0xffff, %r14           # imm = 0xFFFF
je 0x68b6
movq %rbx, %rdi
callq 0x5a96
movq %rbx, %rdi
movl %r13d, %esi
callq 0x5876
incq %r14
testb %al, %al
jne 0x6844
leaq 0x1(%r14), %r15
movb $0x28, %al
cmpq $0xff, %r14
jae 0x68d0
jmp 0x68e1
leaq 0x3409(%rip), %rsi      # 0x9cc6
movq %rbx, %rdi
movl $0x10000, %edx          # imm = 0x10000
callq 0x5d22
movl $0x10000, %r15d         # imm = 0x10000
pushq $0x29
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
movl %r15d, %eax
shrl $0x8, %eax
movzbl %al, %esi
movzbl %r15b, %edx
movq %rbx, %rdi
callq 0x5d5f
leaq 0x33e4(%rip), %rdx      # 0x9cdb
pushq $0x2b
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5bf2
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: array
static void array(Parser *parser) {
    Debug_Log(parser);

    if (consume_if(parser, TOKEN_RIGHT_BRACKET)) {
        emit_bytes(parser, OP_ARRAY_8, 0);
        Debug_Exit(parser);
        return;
    }

    size_t count = 0;
    do {
        expression(parser);

        if (count == ARRAY_LIMIT) {
            error_limit(parser, "array literal elements", ARRAY_LIMIT);
            break;
        }

        count++;
    } while (consume_if(parser, TOKEN_COMMA));

    if (count > UINT8_MAX) {
        emit_byte(parser, OP_ARRAY_16);
        emit_bytes(parser, (count >> 8) & 0xff, count & 0xff);
    } else {
        emit_bytes(parser, OP_ARRAY_8, (uint8_t)count);
    }

    consume(parser, TOKEN_RIGHT_BRACKET, "expect ']' after array elements");

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x2d
popq %rsi
callq 0x5876
testb %al, %al
je 0x693d
pushq $0x26
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5d5f
pushq $-0x1
popq %r15
pushq $0x25
popq %rbp
movq %rbx, %rdi
callq 0x5a96
cmpq $0xffff, %r15           # imm = 0xFFFF
je 0x6977
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5876
incq %r15
testb %al, %al
jne 0x6944
leaq 0x1(%r15), %r14
movb $0x26, %al
cmpq $0xff, %r15
jae 0x6991
jmp 0x69a2
leaq 0x337b(%rip), %rsi      # 0x9cf9
movq %rbx, %rdi
movl $0x10000, %edx          # imm = 0x10000
callq 0x5d22
movl $0x10000, %r14d         # imm = 0x10000
pushq $0x27
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
movl %r14d, %eax
shrl $0x8, %eax
movzbl %al, %esi
movzbl %r14b, %edx
movq %rbx, %rdi
callq 0x5d5f
leaq 0x3358(%rip), %rdx      # 0x9d10
pushq $0x2d
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5bf2
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: indexing
static void indexing(Parser *parser) {
    Debug_Log(parser);

    expression(parser);
    consume(parser, TOKEN_RIGHT_BRACKET, "expect ']' after index");

    emit_byte(parser, OP_GET_ELEMENT);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x5a96
leaq 0x3353(%rip), %rdx      # 0x9d30
pushq $0x2d
popq %rsi
movq %rbx, %rdi
callq 0x5bf2
pushq $0x2b
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x5a9e
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: identifier
static void identifier(Parser *parser) {
    Debug_Log(parser);

    Token *name = &parser->previous;
    int index = resolve_local(parser->context, name);

    uint8_t get_op;

    // Local?
    if (index != -1) {
        get_op = OP_GET_LOCAL;
    } else {
        index = resolve_upvalue(parser, parser->context, name);

        // Upvalue?
        if (index != -1) {
            get_op = OP_GET_UPVALUE;
        } else {
            index = identifier_constant(parser, &parser->previous);
            get_op = OP_GET_GLOBAL;
        }
    }

    emit_bytes(parser, get_op, index);

    Debug_Exit(parser);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
movq 0x8(%rdi), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x71de
cmpl $-0x1, %eax
je 0x6a18
movb $0x1a, %cl
jmp 0x6a3f
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x7237
cmpl $-0x1, %eax
je 0x6a2f
movb $0x1c, %cl
jmp 0x6a3f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5c01
movzbl %al, %eax
movb $0x18, %cl
movzbl %cl, %esi
movzbl %al, %edx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x5d5f
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: number
static void number(Parser *parser) {
    Debug_Log(parser);

    Value value = Num_Value(strtod(parser->previous.lexeme, NULL));
    emit_constant(parser, value);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
xorl %esi, %esi
callq 0x2090
movq %xmm0, %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x71c6
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: string
static void string(Parser *parser) {
    Debug_Log(parser);

    // +1 and -2 for the literal string quotes
    RavString *string = object_string(
        &parser->vm->allocator,
        parser->previous.lexeme + 1,
        parser->previous.length - 2
    );
    emit_constant(parser, Obj_Value(string));

    Debug_Exit(parser);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x38(%rbx), %rsi
incq %rsi
movl 0x40(%rbx), %edx
addl $-0x2, %edx
callq 0x4de8
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
orq %rax, %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x71c6
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: string_interpolated
static void string_interpolated(Parser *parser) {
    Debug_Log(parser);

    Allocator *allocator = &parser->vm->allocator;
    RavString *begin = object_string(
        allocator,
        parser->previous.lexeme + 1, // +1 advances the double quote
        parser->previous.length - 3  // -3 for the delimiters count
    );
    emit_constant(parser, Obj_Value(begin));

    while (parser->previous.type != TOKEN_STRING_END) {
        expression(parser);
        emit_byte(parser, OP_CONCAT);

        bool string_part = consume_if(parser, TOKEN_STRING_PART);
        bool string_end = consume_if(parser, TOKEN_STRING_END);

        if (string_part || string_end) {
            const char *chars = parser->previous.lexeme + 2; // +2 advances '}}'
            int length = 0;

            // enclosed between '}}' and '{{'
            if (string_part) {
                length = parser->previous.length - 4;
            }
            // enclosed between '}}' and '"'
            else if (string_end) {
                length = parser->previous.length - 3;
            }

            if (length != 0) {
                RavString *part = object_string(allocator, chars, length);
                emit_constant(parser, Obj_Value(part));
                emit_byte(parser, OP_CONCAT);
            }
        } else {
            error_current(parser, "ill-formed interpolated string");
            break;
        }
    }

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movabsq $-0x4000000000000, %r15 # imm = 0xFFFC000000000000
movq 0x10(%rdi), %r14
movq 0x38(%rdi), %rsi
incq %rsi
movl 0x40(%rdi), %edx
addl $-0x3, %edx
movq %r14, %rdi
callq 0x4de8
orq %r15, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x71c6
pushq $0x24
popq %rbp
pushq $0x33
popq %r15
pushq $0x34
popq %r12
cmpl $0x34, 0x30(%rbx)
je 0x6b63
movq %rbx, %rdi
callq 0x5a96
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5a9e
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5876
movl %eax, %r13d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x5876
orb %r13b, %al
cmpb $0x1, %al
jne 0x6b72
jne 0x6ae9
movzbl %r13b, %edx
xorl $-0x3, %edx
addl 0x40(%rbx), %edx
je 0x6ae9
movq 0x38(%rbx), %rsi
addq $0x2, %rsi
movq %r14, %rdi
callq 0x4de8
movabsq $-0x4000000000000, %rcx # imm = 0xFFFC000000000000
orq %rcx, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x71c6
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5a9e
jmp 0x6ae9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x31e1(%rip), %rsi      # 0x9d5a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5c65
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: patch_jump
static inline void patch_jump(Parser *parser, int from) {
    Chunk *chunk = parser_chunk(parser);

    // -2 because of the jmp instruction 2-bytes immediate argument
    int offset = chunk->count - from - 2;

    if (offset > UINT16_MAX) {
        error_current(parser, "jump offset exceeds the allowed limit");
    }

    chunk->opcodes[from] = (offset >> 8) & 0xff;
    chunk->opcodes[from + 1] = offset & 0xff;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq 0x8(%rdi), %rax
movq 0x8(%rax), %r14
movl 0x20(%r14), %ebx
subl %esi, %ebx
cmpl $0x10002, %ebx          # imm = 0x10002
jl 0x6be2
leaq 0x2ddc(%rip), %rsi      # 0x99b9
callq 0x5c65
addl $-0x2, %ebx
movq 0x28(%r14), %rax
movslq %ebp, %rcx
movb %bh, (%rax,%rcx)
movq 0x28(%r14), %rax
movb %bl, 0x1(%rax,%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: end_scope
static void end_scope(Parser *parser, bool loading) {
    unwind_stack(parser, parser->context->scope_depth);

    // Push the value of the last expression in the block.
    if (loading) {
        Chunk *chunk = parser_chunk(parser);

        // If possible optimize out OP_SAVE_X/OP_PUSH_X pattern.
        if (chunk->opcodes[chunk->count - 1] == OP_POP_X) {
            chunk->count--;
        } else {
            emit_byte(parser, OP_PUSH_X);
        }
    }
    parser->context->scope_depth--;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl 0x221c(%rax), %esi
callq 0x5f95
movq 0x8(%rbx), %rax
testl %ebp, %ebp
je 0x6c44
movq 0x8(%rax), %rcx
movq 0x28(%rcx), %rsi
movslq 0x20(%rcx), %rdx
cmpb $0x5, -0x1(%rsi,%rdx)
jne 0x6c35
decl %edx
movl %edx, 0x20(%rcx)
jmp 0x6c44
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x5a9e
movq 0x8(%rbx), %rax
decl 0x221c(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: pattern_fail_if_true
static void pattern_fail_if_true(Parser *parser, Pattern_Context *context, bool subvalue) {
    // count of the values that are needed to be poped from the stack if the
    // pattern failed, note that the match value is discarded only if it is
    // subvalue, toplevel `match` value shouldn't be discarded because it could
    // be used in subsequent patterns
    int values_count = context->bindings_count + (int)subvalue;

    // Skip the failure handling, if the pattern matched the value.
    int success_jump = emit_jump(parser, OP_JMP_POP_FALSE);                 // ---- false
                                                                            //    |
    // Unwind the binding introduced by the failed pattern.                 //    |
    emit_bytes(parser, OP_POPN, (uint8_t)(values_count));                   //    |
                                                                            //    |
    // Finally jump to the next case, as the pattern didn't match.          //    |
    context->cases_next[context->cases_count] = emit_jump(parser, OP_JMP);  // -------
    context->cases_count += 1;                                              //    |  |
                                                                            //    |  :
    patch_jump(parser, success_jump);                                       // <---  V
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
addl 0x84(%rsi), %ebx
pushq $0x21
popq %rsi
callq 0x6b8f
movl %eax, %ebp
movzbl %bl, %edx
pushq $0x8
popq %rsi
movq %r15, %rdi
callq 0x5d5f
pushq $0x1e
popq %rsi
movq %r15, %rdi
callq 0x6b8f
movslq 0x80(%r14), %rcx
movl %eax, (%r14,%rcx,4)
incl 0x80(%r14)
movq %r15, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6bba
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: add_dummy_local
static void add_dummy_local(Parser* parser) {
    Context *context = parser->context;

    if (context->local_count == LOCALS_LIMIT) {
        error_limit(parser, "function locals", LOCALS_LIMIT);
        return;
    }

    Local *local = &context->locals[context->local_count++];
    local->name = (Token){0};
    local->depth = context->scope_depth;
    local->is_captured = false;
}

// Assembly:
movq 0x8(%rdi), %rax
movslq 0x2018(%rax), %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x719b
leaq 0x267d(%rip), %rsi      # 0x980e
movl $0x100, %edx            # imm = 0x100
jmp 0x5d22
leal 0x1(%rcx), %edx
movl %edx, 0x2018(%rax)
shlq $0x5, %rcx
xorps %xmm0, %xmm0
andq $0x0, 0x28(%rax,%rcx)
movups %xmm0, 0x18(%rax,%rcx)
movl 0x221c(%rax), %edx
movl %edx, 0x30(%rax,%rcx)
movb $0x0, 0x34(%rax,%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: resolve_local
static inline int resolve_local(Context *context, Token *name) {
    for (int i = context->local_count - 1; i >= 0; i--) {
        Local *local = &context->locals[i];

        // Find an initialized local variable with this name.
        // The "local->depth != -1" test skips the edge case:
        //   let x = x;
        // But in the same time, allow same name shadowing:
        //   do
        //     let x = 1;
        //     do
        //       let x = x + x; // x -> 2
        //       ...
        //     end
        //     ...
        //   end
        if (local->depth != -1 && same_identifier(name, &local->name)) {
            return i;
        }
    }

    // Not Found
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x2018(%rdi), %r15d
addq $0x18, %r14
pushq $-0x1
popq %rbp
testl %r15d, %r15d
jle 0x722c
leaq -0x1(%r15), %r12
movl %r12d, %esi
shlq $0x5, %rsi
cmpl $-0x1, 0x18(%r14,%rsi)
je 0x7221
addq %r14, %rsi
movq %rbx, %rdi
callq 0x5c38
testb %al, %al
jne 0x7226
movq %r12, %r15
jmp 0x71fa
decl %r15d
movl %r15d, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: resolve_upvalue
static int resolve_upvalue(Parser *parser, Context *context, Token *name) {
    if (context->enclosing == NULL) {
        return -1;
    }

    int local = resolve_local(context->enclosing, name);
    if (local != -1) {
        context->enclosing->locals[local].is_captured = true;
        return add_upvalue(parser, context, (uint8_t)local, true);
    }

    int upvalue = resolve_upvalue(parser, context->enclosing, name);
    if (upvalue != -1) {
        return add_upvalue(parser, context, (uint8_t)upvalue, false);
    }

    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rsi), %r15
testq %r15, %r15
je 0x72a0
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq %r15, %rdi
movq %rdx, %rsi
callq 0x71de
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x7272
movl %ebp, %eax
shlq $0x5, %rax
movb $0x1, 0x34(%r15,%rax)
movl %ebp, %eax
jmp 0x7285
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7237
cmpl $-0x1, %eax
je 0x72a0
xorl %ecx, %ecx
cmpl $-0x1, %ebp
setne %cl
movzbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x72ac
pushq $-0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mahrr[P]raven/src/compiler.c
// Function: add_upvalue
static int add_upvalue(Parser *parser, Context *context, uint8_t index, bool is_local) {
    int upvalue_count = context->function->upvalue_count;

    // Check first if the upvalue is already captured.
    for (int i = 0; i < upvalue_count; i++) {
        Upvalue *upvalue = &context->upvalues[i];

        if (upvalue->index == index && upvalue->is_local == is_local) {
            return i;
        }
    }

    if (upvalue_count == UPVALUES_LIMIT) {
        error_limit(parser, "captured variables", UPVALUES_LIMIT);
        return 0;
    }

    context->upvalues[upvalue_count].is_local = is_local;
    context->upvalues[upvalue_count].index = index;

    return context->function->upvalue_count++;
}

// Assembly:
pushq %rax
movq 0x8(%rsi), %r8
movl 0x1c(%r8), %eax
movslq %eax, %r9
xorl %r10d, %r10d
testl %r9d, %r9d
movl $0x0, %r11d
cmovgl %eax, %r11d
cmpq %r10, %r11
je 0x72e6
cmpb %dl, 0x201d(%rsi,%r10,2)
jne 0x72e1
cmpb %cl, 0x201c(%rsi,%r10,2)
je 0x731b
incq %r10
jmp 0x72c8
cmpl $0x100, %eax            # imm = 0x100
jne 0x7302
leaq 0x2a53(%rip), %rsi      # 0x9d47
movl $0x100, %edx            # imm = 0x100
callq 0x5d22
xorl %eax, %eax
jmp 0x731e
movb %cl, 0x201c(%rsi,%r9,2)
movb %dl, 0x201d(%rsi,%r9,2)
leal 0x1(%rax), %ecx
movl %ecx, 0x1c(%r8)
jmp 0x731e
movl %r10d, %eax
popq %rcx
retq