// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/MMU.cpp
// Function: MMU::CheckMemory()
void MMU::CheckMemory() {
    if (Read(0xFF05) != 0x00) { std::cout << "failed on FF0F" << std::endl; exit(1); } // TIMA
    if (Read(0xFF06) != 0x00) { std::cout << "failed on FF0F" << std::endl; exit(1); } // TMA
    if (Read(0xFF07) != 0x00) { std::cout << "failed on FF07" << std::endl; exit(1); } // TAC
    // if (Read(0xFF10) != 0x80) { std::cout << "failed on FF10" << std::endl; exit(1); } // NR10
    // if (Read(0xFF11) != 0xBF) { std::cout << "failed on FF11" << std::endl; exit(1); } // NR11
    // if (Read(0xFF12) != 0xF3) { std::cout << "failed on FF12" << std::endl; exit(1); } // NR12
    // if (Read(0xFF14) != 0xBF) { std::cout << "failed on FF14" << std::endl; exit(1); } // NR14
    // if (Read(0xFF16) != 0x3F) { std::cout << "failed on FF16" << std::endl; exit(1); } // NR21
    // if (Read(0xFF17) != 0x00) { std::cout << "failed on FF17" << std::endl; exit(1); } // NR22
    // if (Read(0xFF19) != 0xBF) { std::cout << "failed on FF19" << std::endl; exit(1); } // NR24
    // if (Read(0xFF1A) != 0x7F) { std::cout << "failed on FF1A" << std::endl; exit(1); } // NR30
    // if (Read(0xFF1B) != 0xFF) { std::cout << "failed on FF1B" << std::endl; exit(1); } // NR31
    // if (Read(0xFF1C) != 0x9F) { std::cout << "failed on FF1C" << std::endl; exit(1); } // NR32
    // if (Read(0xFF1E) != 0xBF) { std::cout << "failed on FF1E" << std::endl; exit(1); } // NR33
    // if (Read(0xFF20) != 0xFF) { std::cout << "failed on FF20" << std::endl; exit(1); } // NR41
    // if (Read(0xFF21) != 0x00) { std::cout << "failed on FF21" << std::endl; exit(1); } // NR42
    // if (Read(0xFF22) != 0x00) { std::cout << "failed on FF22" << std::endl; exit(1); } // NR43
    // if (Read(0xFF23) != 0xBF) { std::cout << "failed on FF23" << std::endl; exit(1); } // NR30
    // if (Read(0xFF24) != 0x77) { std::cout << "failed on FF24" << std::endl; exit(1); } // NR50
    // if (Read(0xFF25) != 0xF3) { std::cout << "failed on FF25" << std::endl; exit(1); } // NR51
    // if (Read(0xFF26) != 0xF1) { std::cout << "failed on FF26" << std::endl; exit(1); } // NR52
    if (Read(0xFF40) != 0x91) { std::cout << "failed on FF40" << std::endl; exit(1); } // LCDC
    if (Read(0xFF42) != 0x00) { std::cout << "failed on FF42" << std::endl; exit(1); } // SCY
    if (Read(0xFF43) != 0x00) { std::cout << "failed on FF43" << std::endl; exit(1); } // SCX
    if (Read(0xFF45) != 0x00) { std::cout << "failed on FF45" << std::endl; exit(1); } // LYC
    if (Read(0xFF47) != 0xFC) { std::cout << "failed on FF47" << std::endl; exit(1); } // BGP
    if (Read(0xFF4A) != 0x00) { std::cout << "failed on FF4A" << std::endl; printf("%.2X", Read(0xFF4A)); exit(1); } // WY
    if (Read(0xFF4B) != 0x00) { std::cout << "failed on FF4B" << std::endl; printf("%.2X", Read(0xFF4B)); exit(1); } // WX
    // if (Read(0xFFFF) != 0x00) { std::cout << "failed on FFFF" << std::endl; printf("%.2X", Read(0xFFFF)); exit(1); } // IE
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpb $0x0, 0xa005(%rdi)
jne 0x16aa8
movq %rdi, %rbx
cmpb $0x0, 0xa006(%rdi)
jne 0x16aa8
cmpb $0x0, 0xa007(%rbx)
jne 0x16ab8
cmpb $-0x6f, 0xa040(%rbx)
jne 0x16ac8
cmpb $0x0, 0xa042(%rbx)
jne 0x16ad8
cmpb $0x0, 0xa043(%rbx)
jne 0x16ae8
cmpb $0x0, 0xa045(%rbx)
jne 0x16af8
cmpb $-0x4, 0xa047(%rbx)
jne 0x16b08
cmpb $0x0, 0xa04a(%rbx)
jne 0x16b2b
cmpb $0x0, 0xa04b(%rbx)
jne 0x16b4f
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0xf519(%rip), %rdi      # 0x25fc8
leaq 0x4a21(%rip), %rsi      # 0x1b4d7
jmp 0x16b16
movq 0xf509(%rip), %rdi      # 0x25fc8
leaq 0x4a20(%rip), %rsi      # 0x1b4e6
jmp 0x16b16
movq 0xf4f9(%rip), %rdi      # 0x25fc8
leaq 0x4a1f(%rip), %rsi      # 0x1b4f5
jmp 0x16b16
movq 0xf4e9(%rip), %rdi      # 0x25fc8
leaq 0x4a1e(%rip), %rsi      # 0x1b504
jmp 0x16b16
movq 0xf4d9(%rip), %rdi      # 0x25fc8
leaq 0x4a1d(%rip), %rsi      # 0x1b513
jmp 0x16b16
movq 0xf4c9(%rip), %rdi      # 0x25fc8
leaq 0x4a1c(%rip), %rsi      # 0x1b522
jmp 0x16b16
movq 0xf4b9(%rip), %rdi      # 0x25fc8
leaq 0x4a1b(%rip), %rsi      # 0x1b531
callq 0x4340
movq %rax, %rdi
callq 0x4190
pushq $0x1
popq %rdi
callq 0x4420
movq 0xf496(%rip), %rdi      # 0x25fc8
leaq 0x4a07(%rip), %rsi      # 0x1b540
callq 0x4340
movq %rax, %rdi
callq 0x4190
movzbl 0xa04a(%rbx), %esi
jmp 0x16b71
movq 0xf472(%rip), %rdi      # 0x25fc8
leaq 0x49f7(%rip), %rsi      # 0x1b554
callq 0x4340
movq %rax, %rdi
callq 0x4190
movzbl 0xa04b(%rbx), %esi
leaq 0x49d7(%rip), %rdi      # 0x1b54f
xorl %eax, %eax
callq 0x4060
jmp 0x16b23
nop