// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/debug.c
// Function: disassemble_instruction
int disassemble_instruction(Chunk *chunk, int offset) {
    printf("%04d", offset);

    int line = chunk_decode_line(chunk, offset);
    int instruction = chunk->opcodes[offset];

    if (offset > 0 && line == chunk_decode_line(chunk, offset - 1)) {
        printf("   | ");
    } else {
        printf("%4d ", line);
    }

    switch (instruction) {
    case OP_PUSH_TRUE:
        return basic_instruction("PUSH_TRUE", offset);

    case OP_PUSH_FALSE:
        return basic_instruction("PUSH_FALSE", offset);

    case OP_PUSH_NIL:
        return basic_instruction("PUSH_NIL", offset);

    case OP_PUSH_CONST:
        return const_instruction("PUSH_CONST", chunk, offset);

    case OP_PUSH_X:
        return basic_instruction("PUSH_X", offset);

    case OP_POP_X:
        return basic_instruction("POP_X", offset);

    case OP_DUP:
        return basic_instruction("DUP", offset);

    case OP_POP:
        return basic_instruction("POP", offset);

    case OP_POPN:
        return byte_instruction("POPN", chunk, offset);

    case OP_ADD:
        return basic_instruction("ADD", offset);

    case OP_SUB:
        return basic_instruction("SUB", offset);

    case OP_MUL:
        return basic_instruction("MUL", offset);

    case OP_DIV:
        return basic_instruction("DIV", offset);

    case OP_MOD:
        return basic_instruction("MOD", offset);

    case OP_NEG:
        return basic_instruction("NEG", offset);

    case OP_EQ:
        return basic_instruction("EQ", offset);

    case OP_NEQ:
        return basic_instruction("NEQ", offset);

    case OP_LT:
        return basic_instruction("LT", offset);

    case OP_LTQ:
        return basic_instruction("LTQ", offset);

    case OP_GT:
        return basic_instruction("GT", offset);

    case OP_GTQ:
        return basic_instruction("GTQ", offset);

    case OP_NOT:
        return basic_instruction("NOT", offset);

    case OP_DEF_GLOBAL:
        return byte_instruction("DEF_GLOBAL", chunk, offset);

    case OP_SET_GLOBAL:
        return byte_instruction("SET_GLOBAL", chunk, offset);

    case OP_GET_GLOBAL:
        return byte_instruction("GET_GLOBAL", chunk, offset);

    case OP_SET_LOCAL:
        return byte_instruction("SET_LOCAL", chunk, offset);

    case OP_GET_LOCAL:
        return byte_instruction("GET_LOCAL", chunk, offset);

    case OP_SET_UPVALUE:
        return byte_instruction("SET_UPVALUE", chunk, offset);

    case OP_GET_UPVALUE:
        return byte_instruction("GET_UPVALUE", chunk, offset);

    case OP_CALL:
        return byte_instruction("CALL", chunk, offset);

    case OP_JMP:
        return jump_instruction("JMP", chunk, 1, offset);

    case OP_JMP_BACK:
        return jump_instruction("JMP_BACK", chunk, -1, offset);

    case OP_JMP_FALSE:
        return jump_instruction("JMP_FALSE", chunk, 1, offset);

    case OP_JMP_POP_FALSE:
        return jump_instruction("JMP_POP_FALSE", chunk, 1, offset);

    case OP_CLOSURE:
        return closure_instruction(chunk, offset);

    case OP_CLOSE_UPVALUE:
        return basic_instruction("CLOSE_UPVALUE", offset);

    case OP_CONCAT:
        return basic_instruction("CONCAT", offset);

    case OP_CONS:
        return basic_instruction("CONS", offset);

    case OP_ARRAY_8:
        return byte_instruction("ARRAY_8", chunk, offset);

    case OP_ARRAY_16:
        return short_instruction("ARRAY_16", chunk, offset);

    case OP_MAP_8:
        return byte_instruction("MAP_8", chunk, offset);

    case OP_MAP_16:
        return short_instruction("MAP_16", chunk, offset);

    case OP_SET_ELEMENT:
        return basic_instruction("SET_ELEMENT", offset);

    case OP_GET_ELEMENT:
        return basic_instruction("GET_ELEMENT", offset);

    case OP_CAR:
        return basic_instruction("CAR", offset);

    case OP_CDR:
        return basic_instruction("CDR", offset);

    case OP_ARRAY_LEN:
        return basic_instruction("ARRAY_LEN", offset);

    case OP_ARRAY_PUSH_ELEMENT:
        return byte_instruction("ARRAY_PUSH_ELEMENT", chunk, offset);

    case OP_MAP_PUSH_ELEMENT:
        return const_instruction("MAP_PUSH_ELEMENT", chunk, offset);

    case OP_IS_PAIR:
        return basic_instruction("IS_PAIR", offset);

    case OP_IS_ARRAY:
        return basic_instruction("IS_ARRAY", offset);

    case OP_IS_MAP:
        return basic_instruction("IS_MAP", offset);

    case OP_RETURN:
        return basic_instruction("RETURN", offset);

    case OP_EXIT:
        return basic_instruction("EXIT", offset);
    }

    assert(!"invalid instruction type");
    return 0; // For Warnings
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %esi
leaq 0x2623(%rip), %rdi      # 0xf1bc
movb $0x0, %al
callq 0x20b0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x71c0
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0xcbf6
movl -0x18(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
callq 0x71c0
movl %eax, %ecx
movl -0x20(%rbp), %eax
cmpl %ecx, %eax
jne 0xcbf6
leaq 0x25d4(%rip), %rdi      # 0xf1c1
movb $0x0, %al
callq 0x20b0
jmp 0xcc07
movl -0x18(%rbp), %esi
leaq 0x27eb(%rip), %rdi      # 0xf3eb
movb $0x0, %al
callq 0x20b0
movl -0x1c(%rbp), %eax
movq %rax, -0x28(%rbp)
subq $0x35, %rax
ja 0xd158
movq -0x28(%rbp), %rax
leaq 0x24c1(%rip), %rcx      # 0xf0e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x14(%rbp), %esi
leaq 0x2591(%rip), %rdi      # 0xf1c7
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2584(%rip), %rdi      # 0xf1d1
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2578(%rip), %rdi      # 0xf1dc
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x2566(%rip), %rdi      # 0xf1e5
callq 0xd1b0
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x255a(%rip), %rdi      # 0xf1f0
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x254a(%rip), %rdi      # 0xf1f7
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2539(%rip), %rdi      # 0xf1fd
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2526(%rip), %rdi      # 0xf201
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x250f(%rip), %rdi      # 0xf205
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x24fd(%rip), %rdi      # 0xf20a
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x24ea(%rip), %rdi      # 0xf20e
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x24d7(%rip), %rdi      # 0xf212
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x24c4(%rip), %rdi      # 0xf216
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x24b1(%rip), %rdi      # 0xf21a
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x249e(%rip), %rdi      # 0xf21e
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x248c(%rip), %rdi      # 0xf223
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2474(%rip), %rdi      # 0xf222
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2461(%rip), %rdi      # 0xf226
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x244d(%rip), %rdi      # 0xf229
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x243a(%rip), %rdi      # 0xf22d
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2426(%rip), %rdi      # 0xf230
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2413(%rip), %rdi      # 0xf234
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x23fc(%rip), %rdi      # 0xf238
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x23ec(%rip), %rdi      # 0xf243
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x23dc(%rip), %rdi      # 0xf24e
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x23cc(%rip), %rdi      # 0xf259
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x23bb(%rip), %rdi      # 0xf263
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x23aa(%rip), %rdi      # 0xf26d
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x239b(%rip), %rdi      # 0xf279
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x238c(%rip), %rdi      # 0xf285
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
leaq 0x2376(%rip), %rdi      # 0xf28a
movl $0x1, %edx
callq 0xd270
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
leaq 0x235a(%rip), %rdi      # 0xf28e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xd270
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
leaq 0x2343(%rip), %rdi      # 0xf297
movl $0x1, %edx
callq 0xd270
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
leaq 0x232d(%rip), %rdi      # 0xf2a1
movl $0x1, %edx
callq 0xd270
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xd2f0
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x230b(%rip), %rdi      # 0xf2af
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2302(%rip), %rdi      # 0xf2bd
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x22f2(%rip), %rdi      # 0xf2c4
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x22dc(%rip), %rdi      # 0xf2c9
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x22c9(%rip), %rdi      # 0xf2d1
callq 0xd410
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x22b7(%rip), %rdi      # 0xf2da
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x22a2(%rip), %rdi      # 0xf2e0
callq 0xd410
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2292(%rip), %rdi      # 0xf2e7
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2287(%rip), %rdi      # 0xf2f3
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x227c(%rip), %rdi      # 0xf2ff
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2269(%rip), %rdi      # 0xf303
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2256(%rip), %rdi      # 0xf307
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x2245(%rip), %rdi      # 0xf311
callq 0xd220
movl %eax, -0x4(%rbp)
jmp 0xd177
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x223d(%rip), %rdi      # 0xf324
callq 0xd1b0
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2237(%rip), %rdi      # 0xf335
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x222b(%rip), %rdi      # 0xf33d
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2220(%rip), %rdi      # 0xf346
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2213(%rip), %rdi      # 0xf34d
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
movl -0x14(%rbp), %esi
leaq 0x2206(%rip), %rdi      # 0xf354
callq 0xd180
movl %eax, -0x4(%rbp)
jmp 0xd177
leaq 0x21fa(%rip), %rdi      # 0xf359
leaq 0x220f(%rip), %rsi      # 0xf375
movl $0xf2, %edx
leaq 0x220f(%rip), %rcx      # 0xf381
callq 0x20e0
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq