// File: /workspace/github_cpp_makefile_star2_O1/NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::debug_dump(unsigned char)
void Cpu::debug_dump(uint8_t inst) {
    cout << "INSTRUCCION" << std::hex << (int) inst << endl;
    cout << "regA =  " << std::hex << (unsigned) regA << endl;
    cout << "regX =  " << std::hex << (unsigned) regX << endl;
    cout << "regY =  " << std::hex << (unsigned) regY << endl;
    cout << "regPC = " << std::hex << (unsigned) regPC << endl;
    cout << "regSP = " << std::hex << (unsigned) regSP << endl;
    cout << "regP =" << endl;
    cout << "    C = " << regP.C;
    cout << "    Z = " << regP.Z;
    cout << "    I = " << regP.I;
    cout << "    D = " << regP.D;
    cout << "    B = " << regP.B;
    cout << "    V = " << regP.V;
    cout << "    N = " << regP.N << endl;
    cout << "cycles = " << clock->cycles << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movq 0x51db(%rip), %rbx      # 0x8fd8
leaq 0x26b8(%rip), %rsi      # 0x64bc
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x21f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x2667(%rip), %rsi      # 0x64c8
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movzbl 0x10020(%r14), %esi
movq %rbx, %rdi
callq 0x20e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x260d(%rip), %rsi      # 0x64d1
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movzbl 0x10021(%r14), %esi
movq %rbx, %rdi
callq 0x20e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x25b3(%rip), %rsi      # 0x64da
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movzbl 0x10022(%r14), %esi
movq %rbx, %rdi
callq 0x20e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x2559(%rip), %rsi      # 0x64e3
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movzwl 0x10024(%r14), %esi
movq %rbx, %rdi
callq 0x20e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x24ff(%rip), %rsi      # 0x64ec
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movzwl 0x10026(%r14), %esi
movq %rbx, %rdi
callq 0x20e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x24a5(%rip), %rsi      # 0x64f5
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x2471(%rip), %rsi      # 0x64fc
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movzbl 0x10028(%r14), %esi
movq %rbx, %rdi
callq 0x21e0
leaq 0x2456(%rip), %rsi      # 0x6505
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movzbl 0x10029(%r14), %esi
movq %rbx, %rdi
callq 0x21e0
leaq 0x243b(%rip), %rsi      # 0x650e
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movzbl 0x1002a(%r14), %esi
movq %rbx, %rdi
callq 0x21e0
leaq 0x2420(%rip), %rsi      # 0x6517
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movzbl 0x1002b(%r14), %esi
movq %rbx, %rdi
callq 0x21e0
leaq 0x2405(%rip), %rsi      # 0x6520
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movzbl 0x1002c(%r14), %esi
movq %rbx, %rdi
callq 0x21e0
leaq 0x23ea(%rip), %rsi      # 0x6529
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movzbl 0x1002d(%r14), %esi
movq %rbx, %rdi
callq 0x21e0
leaq 0x23cf(%rip), %rsi      # 0x6532
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2170
movzbl 0x1002e(%r14), %esi
movq %rbx, %rdi
callq 0x21e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x238a(%rip), %rsi      # 0x653b
movl $0x9, %edx
movq %rbx, %rdi
callq 0x2170
movq (%r14), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0x20e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20f0
nop