LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rdx
movq %rdx, 0x30(%rax)
movq 0x20(%rcx), %rdx
movq %rdx, 0x38(%rax)
movq 0x28(%rcx), %rcx
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq -0x20(%rbp), %rdi
callq 0xb9d0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
cmpl $0x35, 0x18(%rax)
je 0x8e2c
jmp 0x8e2e
jmp 0x8dec
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: let_declaration
static void let_declaration(Parser *parser) {
    Debug_Log(parser);

    uint8_t index = variable(parser, "expect a variable name");

    if (consume_if(parser, TOKEN_EQUAL)) {
        expression(parser);
    } else {
        emit_byte(parser, OP_PUSH_NIL);
    }

    define_variable(parser, index);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x59c5(%rip), %rsi      # 0xe83c
callq 0x90d0
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1f, %esi
callq 0x8c60
testb $0x1, %al
jne 0x8e93
jmp 0x8e9e
movq -0x8(%rbp), %rdi
callq 0x8fe0
jmp 0x8eac
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x9000
movq -0x8(%rbp), %rdi
movzbl -0x9(%rbp), %esi
callq 0x91f0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: fn_declaration
static void fn_declaration(Parser *parser) {
    Debug_Log(parser);

    uint8_t index = variable(parser, "expect a function name");

    if (parser->context->scope_depth > 0) {
        mark_initialized(parser->context);
    }

    function(parser, FunctionDeclaration);
    define_variable(parser, index);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x59f0(%rip), %rsi      # 0xe8c7
callq 0x90d0
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x221c(%rax)
jle 0x8efd
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x95e0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9660
movq -0x8(%rbp), %rdi
movzbl -0x9(%rbp), %esi
callq 0x91f0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: return_statement
static void return_statement(Parser *parser) {
    Debug_Log(parser);

    if (parser->context->toplevel) {
        error_previous(parser, "cannot return in a top-level code");
    }

    if (consume_if(parser, TOKEN_SEMICOLON)) {
        emit_bytes(parser, OP_PUSH_NIL, OP_RETURN);
        return;
    }

    expression(parser);
    emit_byte(parser, OP_RETURN);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x10(%rax)
je 0x8f4a
movq -0x8(%rbp), %rdi
leaq 0x5a75(%rip), %rsi      # 0xe9ba
callq 0x9340
movq -0x8(%rbp), %rdi
movl $0x26, %esi
callq 0x8c60
testb $0x1, %al
jne 0x8f5e
jmp 0x8f73
movq -0x8(%rbp), %rdi
movl $0x2, %esi
movl $0x34, %edx
callq 0x9620
jmp 0x8f8a
movq -0x8(%rbp), %rdi
callq 0x8fe0
movq -0x8(%rbp), %rdi
movl $0x34, %esi
callq 0x9000
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: continue_statement
static void continue_statement(Parser *parser) {
    Debug_Log(parser);

    // In a loop?
    if (parser->inner_loop_start == -1) {
        error_previous(parser, "use of continue outside a loop");
    }

    unwind_stack(parser, parser->inner_loop_depth);
    emit_loop(parser, parser->inner_loop_start);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x4c(%rax)
jne 0x8fb6
movq -0x8(%rbp), %rdi
leaq 0x5a2b(%rip), %rsi      # 0xe9dc
callq 0x9340
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x50(%rax), %esi
callq 0x99e0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %esi
callq 0x9ae0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: recover
static void recover(Parser *parser) {
    parser->panic_mode = false;

    for (;;) {
        switch (parser->current.type) {
        case TOKEN_LET:
        case TOKEN_FN:
        case TOKEN_TYPE:
        case TOKEN_RETURN:
        case TOKEN_BREAK:
        case TOKEN_CONTINUE:
        case TOKEN_EOF:
            return;

        default:
            if (parser->previous.type == TOKEN_SEMICOLON) return;
        }

        advance(parser);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0x49(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0xc(%rbp)
testl %eax, %eax
je 0x90a0
jmp 0x9064
movl -0xc(%rbp), %eax
subl $0x2, %eax
je 0x90a0
jmp 0x906e
movl -0xc(%rbp), %eax
subl $0x5, %eax
je 0x90a0
jmp 0x9078
movl -0xc(%rbp), %eax
subl $0x9, %eax
je 0x90a0
jmp 0x9082
movl -0xc(%rbp), %eax
subl $0xc, %eax
je 0x90a0
jmp 0x908c
movl -0xc(%rbp), %eax
subl $0xf, %eax
je 0x90a0
jmp 0x9096
movl -0xc(%rbp), %eax
subl $0x36, %eax
jne 0x90a2
jmp 0x90a0
jmp 0x90bb
movq -0x8(%rbp), %rax
cmpl $0x26, 0x30(%rax)
jne 0x90ae
jmp 0x90bb
jmp 0x90b0
movq -0x8(%rbp), %rdi
callq 0x8dc0
jmp 0x9054
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x2f, %esi
callq 0x9240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x221c(%rax)
jg 0x911c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x30, %rsi
callq 0x9280
movb %al, -0x1(%rbp)
jmp 0x91da
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x2018(%rax), %eax
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x91b0
movq -0x20(%rbp), %rax
addq $0x18, %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpl $-0x1, 0x18(%rax)
je 0x917e
movq -0x38(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x221c(%rcx), %eax
jge 0x9180
jmp 0x91b0
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x92e0
testb $0x1, %al
jne 0x9193
jmp 0x91a3
movq -0x10(%rbp), %rdi
leaq 0x56b5(%rip), %rsi      # 0xe853
callq 0x9340
jmp 0x91a5
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9144
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x9370
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x221c(%rax)
jle 0x9222
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x95e0
jmp 0x9234
movq -0x8(%rbp), %rdi
movl $0x16, %esi
movzbl -0x9(%rbp), %edx
callq 0x9620
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: consume
static inline void consume(Parser *parser, TokenType type, const char *message) {
    if (parser->current.type == type) {
        advance(parser);
    } else {
        error_current(parser, message);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x926a
movq -0x8(%rbp), %rdi
callq 0x8dc0
jmp 0x9277
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9420
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: add_local
static void add_local(Parser *parser, Token name) {
    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 = name;
    local->depth = -1; // Uninitialized
    local->is_captured = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x100, 0x2018(%rax)    # imm = 0x100
jne 0x93b7
movq -0x8(%rbp), %rdi
leaq 0x54e9(%rip), %rsi      # 0xe894
movl $0x100, %edx            # imm = 0x100
callq 0x9580
jmp 0x9413
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq -0x10(%rbp), %rsi
movl 0x2018(%rsi), %edx
movl %edx, %edi
addl $0x1, %edi
movl %edi, 0x2018(%rsi)
movslq %edx, %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movb $0x0, 0x1c(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0x49(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x48(%rax)
movq 0x9b31(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
leaq 0x538a(%rip), %rsi      # 0xe86c
movb $0x0, %al
callq 0x2150
movq -0x10(%rbp), %rax
cmpl $0x36, (%rax)
jne 0x950c
movq 0x9aff(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq 0x537e(%rip), %rsi      # 0xe881
movb $0x0, %al
callq 0x2150
jmp 0x953e
movq -0x10(%rbp), %rax
cmpl $0x35, (%rax)
je 0x953c
movq 0x9adc(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x5354(%rip), %rsi      # 0xe889
movb $0x0, %al
callq 0x2150
jmp 0x953e
movq 0x9ab3(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq 0x519a(%rip), %rsi      # 0xe6e9
movb $0x0, %al
callq 0x2150
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x2240, %rsp           # imm = 0x2240
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
leaq -0x2230(%rbp), %rdi
callq 0x8b20
movq -0x8(%rbp), %rdi
callq 0x97e0
cmpl $0x1, -0xc(%rbp)
jne 0x96c2
movq -0x8(%rbp), %rdi
movl $0x28, %esi
leaq 0x523a(%rip), %rdx      # 0xe8de
callq 0x9240
movq -0x8(%rbp), %rdi
movl $0x29, %esi
callq 0x9810
movq -0x8(%rbp), %rdi
callq 0x98c0
jmp 0x9715
cmpl $0x2, -0xc(%rbp)
jne 0x96e1
movq -0x8(%rbp), %rdi
movl $0x24, %esi
callq 0x9810
movq -0x8(%rbp), %rdi
callq 0x8fe0
jmp 0x9713
cmpl $0x3, -0xc(%rbp)
jne 0x96f2
movq -0x8(%rbp), %rdi
callq 0x8fe0
jmp 0x9711
leaq 0x51fb(%rip), %rdi      # 0xe8f4
leaq 0x520d(%rip), %rsi      # 0xe90d
movl $0x66f, %edx            # imm = 0x66F
leaq 0x5210(%rip), %rcx      # 0xe91c
callq 0x20e0
jmp 0x9713
jmp 0x9715
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x8d60
movq %rax, -0x2238(%rbp)
movq -0x8(%rbp), %rdi
movq -0x2238(%rbp), %rsi
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rsi
callq 0x9970
movb %al, -0x2239(%rbp)
movq -0x8(%rbp), %rdi
movl $0x22, %esi
movzbl -0x2239(%rbp), %edx
callq 0x9620
movl $0x0, -0x2240(%rbp)
movl -0x2240(%rbp), %eax
movq -0x2238(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jge 0x97cb
movq -0x8(%rbp), %rdi
movslq -0x2240(%rbp), %rax
movb -0x214(%rbp,%rax,2), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movzbl %al, %esi
callq 0x9000
movq -0x8(%rbp), %rdi
movslq -0x2240(%rbp), %rax
movzbl -0x213(%rbp,%rax,2), %esi
callq 0x9000
movl -0x2240(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2240(%rbp)
jmp 0x9769
addq $0x2240, %rsp           # imm = 0x2240
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x8c60
testb $0x1, %al
jne 0x9831
jmp 0x9836
jmp 0x98ba
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rax
cmpl $0xff, 0x18(%rax)
jle 0x9875
movq -0x8(%rbp), %rdi
leaq 0x50d7(%rip), %rsi      # 0xe942
movl $0xff, %edx
callq 0x9580
movq -0x8(%rbp), %rdi
leaq 0x50cd(%rip), %rsi      # 0xe94d
callq 0x90d0
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x19(%rbp), %esi
callq 0x91f0
movq -0x8(%rbp), %rdi
movl $0x25, %esi
callq 0x8c60
testb $0x1, %al
jne 0x9846
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x50ae(%rip), %rdx      # 0xe963
callq 0x9240
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: function_block
static void function_block(Parser *parser) {
    Debug_Log(parser);

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

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

    // Push the value of the last expression in the block.
    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);
    }

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x23, %esi
callq 0x8e40
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x11(%rbp)
jne 0x98f9
movq -0x8(%rbp), %rdi
movl $0x36, %esi
callq 0x8e40
xorb $-0x1, %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0x9902
jmp 0x990d
movq -0x8(%rbp), %rdi
callq 0x8ca0
jmp 0x98cc
movq -0x8(%rbp), %rdi
movl $0x23, %esi
leaq 0x5069(%rip), %rdx      # 0xe986
callq 0x9240
movq -0x8(%rbp), %rdi
callq 0x9560
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x5, %eax
jne 0x9959
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
jmp 0x9967
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x9000
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9560
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x7180
movl %eax, -0x1c(%rbp)
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jl 0x99cf
movq -0x10(%rbp), %rdi
leaq 0x5004(%rip), %rsi      # 0xe9b0
movl $0x100, %edx            # imm = 0x100
callq 0x9580
movq -0x10(%rbp), %rdi
callq 0x9560
movl $0x0, 0x828(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x99d5
movl -0x1c(%rbp), %eax
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movb $0x0, -0x1d(%rbp)
movq -0x18(%rbp), %rax
movl 0x2018(%rax), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x9a88
movq -0x18(%rbp), %rax
addq $0x18, %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
cmpl -0xc(%rbp), %eax
jge 0x9a39
jmp 0x9a88
movq -0x18(%rbp), %rax
addq $0x18, %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
testb $0x1, 0x1c(%rax)
je 0x9a66
movq -0x8(%rbp), %rdi
movl $0x23, %esi
callq 0x9000
movb $0x1, -0x1d(%rbp)
jmp 0x9a74
movq -0x8(%rbp), %rdi
movl $0x7, %esi
callq 0x9000
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x9a16
movl -0x1c(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x2018(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2018(%rax)
testb $0x1, -0x1d(%rbp)
jne 0x9ad5
cmpl $0x0, -0x1c(%rbp)
je 0x9ad5
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9560
movl -0x28(%rbp), %edx
movl (%rax), %ecx
subl %edx, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl $0x8, %esi
movzbl %al, %edx
callq 0x9620
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1f, %esi
callq 0x9000
movq -0x8(%rbp), %rdi
callq 0x9560
movl (%rax), %eax
subl -0xc(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x10(%rbp)
cmpl $0xffff, -0x10(%rbp)    # imm = 0xFFFF
jle 0x9b2a
movq -0x8(%rbp), %rdi
leaq 0x4ed6(%rip), %rsi      # 0xe9fb
callq 0x9420
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movl -0x10(%rbp), %eax
andl $0xff, %eax
movzbl %cl, %esi
movzbl %al, %edx
callq 0x9620
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8dc0
movq -0x8(%rbp), %rax
movl 0x30(%rax), %edi
callq 0x9c00
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x9ba4
movq -0x8(%rbp), %rdi
leaq 0x4e82(%rip), %rsi      # 0xea1f
callq 0x9340
jmp 0x9bec
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x9c00
movq %rax, %rcx
movl -0x1c(%rbp), %eax
cmpl 0x10(%rcx), %eax
ja 0x9bec
movq -0x8(%rbp), %rdi
callq 0x8dc0
movq -0x8(%rbp), %rax
movl 0x30(%rax), %edi
callq 0x9c00
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
jmp 0x9bae
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8fe0
movq -0x8(%rbp), %rdi
movl $0x22, %esi
leaq 0x4cdf(%rip), %rdx      # 0xeaa4
callq 0x9240
movq -0x8(%rbp), %rdi
movl $0x21, %esi
callq 0xab90
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0xac70
movq -0x8(%rbp), %rdi
movl $0x1e, %esi
callq 0xab90
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xabe0
movq -0x8(%rbp), %rax
cmpl $0x3, 0x30(%rax)
jne 0x9e16
movq -0x8(%rbp), %rdi
callq 0xa520
jmp 0x9e24
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x9000
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0xabe0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0x9c00
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %esi
incl %esi
callq 0x9b60
movl -0xc(%rbp), %eax
addl $-0x10, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x11, %eax
ja 0xa239
movq -0x20(%rbp), %rax
leaq 0x45c0(%rip), %rcx      # 0xe734
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movl $0x9, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0xb, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0xc, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0xd, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0x11, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0x12, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0x13, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0x14, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x9000
jmp 0xa258
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x9000
jmp 0xa258
leaq 0x4a48(%rip), %rdi      # 0xec88
leaq 0x46c6(%rip), %rsi      # 0xe90d
movl $0x2c0, %edx            # imm = 0x2C0
leaq 0x4a4b(%rip), %rcx      # 0xec9e
callq 0x20e0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x9b60
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
subl $0x11, %eax
je 0xa29b
jmp 0xa291
movl -0x10(%rbp), %eax
subl $0x16, %eax
je 0xa2ab
jmp 0xa2bb
movq -0x8(%rbp), %rdi
movl $0xe, %esi
callq 0x9000
jmp 0xa2da
movq -0x8(%rbp), %rdi
movl $0x15, %esi
callq 0x9000
jmp 0xa2da
leaq 0x49c6(%rip), %rdi      # 0xec88
leaq 0x4644(%rip), %rsi      # 0xe90d
movl $0x5e0, %edx            # imm = 0x5E0
leaq 0x49df(%rip), %rcx      # 0xecb4
callq 0x20e0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x20, %esi
callq 0xab90
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl $0x7, %esi
callq 0x9000
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x9b60
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xabe0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x20, %esi
callq 0xab90
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1e, %esi
callq 0xab90
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xabe0
movq -0x8(%rbp), %rdi
movl $0x7, %esi
callq 0x9000
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x9b60
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0xabe0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9560
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jge 0xa437
movq -0x8(%rbp), %rdi
leaq 0x489c(%rip), %rsi      # 0xecc9
callq 0x9340
jmp 0xa517
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x2b, %eax
jne 0xa480
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9b60
movq -0x8(%rbp), %rdi
movl $0x2a, %esi
callq 0x9000
jmp 0xa517
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x18, %eax
je 0xa4c7
movzbl -0x11(%rbp), %eax
cmpl $0x1a, %eax
je 0xa4c7
movzbl -0x11(%rbp), %eax
cmpl $0x1c, %eax
je 0xa4c7
movq -0x8(%rbp), %rdi
leaq 0x4809(%rip), %rsi      # 0xecc9
callq 0x9340
jmp 0xa517
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x12(%rbp)
movzbl -0x11(%rbp), %eax
subl $0x1, %eax
movb %al, -0x13(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
subl $0x2, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9b60
movq -0x8(%rbp), %rdi
movb -0x13(%rbp), %al
movzbl %al, %esi
movzbl -0x12(%rbp), %edx
callq 0x9620
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x97e0
movq -0x8(%rbp), %rdi
movl $0x23, %esi
callq 0x8e40
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x9(%rbp)
jne 0xa562
movq -0x8(%rbp), %rdi
movl $0x36, %esi
callq 0x8e40
xorb $-0x1, %al
movb %al, -0x9(%rbp)
movb -0x9(%rbp), %al
testb $0x1, %al
jne 0xa56b
jmp 0xa576
movq -0x8(%rbp), %rdi
callq 0x8ca0
jmp 0xa535
movq -0x8(%rbp), %rdi
movl $0x23, %esi
leaq 0x475d(%rip), %rdx      # 0xece3
callq 0x9240
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xad20
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: lambda
static void lambda(Parser *parser) {
    Debug_Log(parser);

    // Headless lambda (i.e -> <expression>)?
    if (parser->previous.type == TOKEN_ARROW) {
        function(parser, FunctionLambdaHeadless);
    } else {
        function(parser, FunctionLambda);
    }

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x24, 0x30(%rax)
jne 0xa5c6
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x9660
jmp 0xa5d4
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x9660
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2b, %esi
callq 0x8c60
testb $0x1, %al
jne 0xa670
jmp 0xa685
movq -0x8(%rbp), %rdi
movl $0x28, %esi
xorl %edx, %edx
callq 0x9620
jmp 0xa7aa
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2f, %esi
leaq 0x46bf(%rip), %rdx      # 0xed5c
callq 0x9240
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x8(%rbp), %rax
movl 0x40(%rax), %edx
callq 0x7880
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rsi
callq 0xb5c0
movq -0x8(%rbp), %rdi
movl $0x27, %esi
leaq 0x4686(%rip), %rdx      # 0xed72
callq 0x9240
cmpq $0x10000, -0x10(%rbp)   # imm = 0x10000
jne 0xa712
movq -0x8(%rbp), %rdi
leaq 0x4685(%rip), %rsi      # 0xed8b
movl $0x10000, %edx          # imm = 0x10000
callq 0x9580
jmp 0xa73d
movq -0x8(%rbp), %rdi
callq 0x8fe0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x25, %esi
callq 0x8c60
testb $0x1, %al
jne 0xa68d
cmpq $0xff, -0x10(%rbp)
jbe 0xa780
movq -0x8(%rbp), %rdi
movl $0x29, %esi
callq 0x9000
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
shrq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x10(%rbp), %rax
andq $0xff, %rax
movzbl %cl, %esi
movzbl %al, %edx
callq 0x9620
jmp 0xa795
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl $0x28, %esi
movzbl %al, %edx
callq 0x9620
movq -0x8(%rbp), %rdi
movl $0x2b, %esi
leaq 0x45fb(%rip), %rdx      # 0xeda0
callq 0x9240
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2d, %esi
callq 0x8c60
testb $0x1, %al
jne 0xa7d0
jmp 0xa7e5
movq -0x8(%rbp), %rdi
movl $0x26, %esi
xorl %edx, %edx
callq 0x9620
jmp 0xa8a2
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8fe0
cmpq $0x10000, -0x10(%rbp)   # imm = 0x10000
jne 0xa817
movq -0x8(%rbp), %rdi
leaq 0x45b3(%rip), %rsi      # 0xedbe
movl $0x10000, %edx          # imm = 0x10000
callq 0x9580
jmp 0xa835
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x25, %esi
callq 0x8c60
testb $0x1, %al
jne 0xa7ed
cmpq $0xff, -0x10(%rbp)
jbe 0xa878
movq -0x8(%rbp), %rdi
movl $0x27, %esi
callq 0x9000
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
shrq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x10(%rbp), %rax
andq $0xff, %rax
movzbl %cl, %esi
movzbl %al, %edx
callq 0x9620
jmp 0xa88d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl $0x26, %esi
movzbl %al, %edx
callq 0x9620
movq -0x8(%rbp), %rdi
movl $0x2d, %esi
leaq 0x4538(%rip), %rdx      # 0xedd5
callq 0x9240
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8fe0
movq -0x8(%rbp), %rdi
movl $0x2d, %esi
leaq 0x4520(%rip), %rdx      # 0xedf5
callq 0x9240
movq -0x8(%rbp), %rdi
movl $0x2b, %esi
callq 0x9000
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0xb740
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
je 0xa928
movb $0x1a, -0x15(%rbp)
jmp 0xa969
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rdx
callq 0xb7c0
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
je 0xa94c
movb $0x1c, -0x15(%rbp)
jmp 0xa967
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x30, %rsi
callq 0x9280
movzbl %al, %eax
movl %eax, -0x14(%rbp)
movb $0x18, -0x15(%rbp)
jmp 0xa969
movq -0x8(%rbp), %rdi
movb -0x15(%rbp), %cl
movl -0x14(%rbp), %eax
movzbl %cl, %esi
movzbl %al, %edx
callq 0x9620
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
addq $0x1, %rsi
movq -0x8(%rbp), %rax
movl 0x40(%rax), %edx
subl $0x2, %edx
callq 0x7880
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rsi
callq 0xb5c0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9560
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
subl -0xc(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x1c(%rbp)
cmpl $0xffff, -0x1c(%rbp)    # imm = 0xFFFF
jle 0xac24
movq -0x8(%rbp), %rdi
leaq 0x3e5f(%rip), %rsi      # 0xea7e
callq 0x9420
movl -0x1c(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/compiler.c
// Function: if_block
static void if_block(Parser *parser) {
    Debug_Log(parser);

    begin_scope(parser);

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

    if (!consume_if(parser, TOKEN_ELSE)) {
        consume(parser, TOKEN_END, "expect closing 'end' after if block");
    }

    end_scope(parser, true);

    Debug_Exit(parser);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x97e0
movq -0x8(%rbp), %rdi
movl $0x23, %esi
callq 0x8e40
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x9(%rbp)
jne 0xaccc
movq -0x8(%rbp), %rdi
movl $0x36, %esi
callq 0x8e40
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x9(%rbp)
jne 0xaccc
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x8e40
xorb $-0x1, %al
movb %al, -0x9(%rbp)
movb -0x9(%rbp), %al
testb $0x1, %al
jne 0xacd5
jmp 0xace0
movq -0x8(%rbp), %rdi
callq 0x8ca0
jmp 0xac85
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x8c60
testb $0x1, %al
jne 0xad07
movq -0x8(%rbp), %rdi
movl $0x23, %esi
leaq 0x3dc1(%rip), %rdx      # 0xeac3
callq 0x9240
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xad20
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)