// File: /workspace/github_cpp_makefile_star2_O1/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 0x1b9ce
movq %rdi, %rbx
cmpb $0x0, 0xa006(%rdi)
jne 0x1b9ce
cmpb $0x0, 0xa007(%rbx)
jne 0x1b9de
cmpb $-0x6f, 0xa040(%rbx)
jne 0x1b9ee
cmpb $0x0, 0xa042(%rbx)
jne 0x1b9fe
cmpb $0x0, 0xa043(%rbx)
jne 0x1ba0e
cmpb $0x0, 0xa045(%rbx)
jne 0x1ba1e
cmpb $-0x4, 0xa047(%rbx)
jne 0x1ba2e
cmpb $0x0, 0xa04a(%rbx)
jne 0x1ba53
cmpb $0x0, 0xa04b(%rbx)
jne 0x1ba77
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0xe5f3(%rip), %rdi      # 0x29fc8
leaq 0x4b3f(%rip), %rsi      # 0x2051b
jmp 0x1ba3c
movq 0xe5e3(%rip), %rdi      # 0x29fc8
leaq 0x4b3e(%rip), %rsi      # 0x2052a
jmp 0x1ba3c
movq 0xe5d3(%rip), %rdi      # 0x29fc8
leaq 0x4b3d(%rip), %rsi      # 0x20539
jmp 0x1ba3c
movq 0xe5c3(%rip), %rdi      # 0x29fc8
leaq 0x4b3c(%rip), %rsi      # 0x20548
jmp 0x1ba3c
movq 0xe5b3(%rip), %rdi      # 0x29fc8
leaq 0x4b3b(%rip), %rsi      # 0x20557
jmp 0x1ba3c
movq 0xe5a3(%rip), %rdi      # 0x29fc8
leaq 0x4b3a(%rip), %rsi      # 0x20566
jmp 0x1ba3c
movq 0xe593(%rip), %rdi      # 0x29fc8
leaq 0x4b39(%rip), %rsi      # 0x20575
callq 0x4360
movq %rax, %rdi
callq 0x4190
movl $0x1, %edi
callq 0x4460
movq 0xe56e(%rip), %rdi      # 0x29fc8
leaq 0x4b23(%rip), %rsi      # 0x20584
callq 0x4360
movq %rax, %rdi
callq 0x4190
movzbl 0xa04a(%rbx), %esi
jmp 0x1ba99
movq 0xe54a(%rip), %rdi      # 0x29fc8
leaq 0x4b13(%rip), %rsi      # 0x20598
callq 0x4360
movq %rax, %rdi
callq 0x4190
movzbl 0xa04b(%rbx), %esi
leaq 0x4af3(%rip), %rdi      # 0x20593
xorl %eax, %eax
callq 0x4070
jmp 0x1ba49
nop