LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: razimantv[P]DancingLinks/spangram/Trie.cpp
// Function: TrieNode::insert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void TrieNode::insert(const std::string& word) {
  TrieNode* node = this;

  // Iterate through trie nodes for each character in the word
  for (char c : word) {
    // If the child node doesn't exist, create it
    if (!node->children[c - 'a']) node->children[c - 'a'] = new TrieNode();
    node = node->children[c - 'a'];
  }
  node->end = true; // Mark the end of the word
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x3240
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rdi
callq 0x3430
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xd6a0
testb $0x1, %al
jne 0xd5d8
jmp 0xd67d
leaq 0x30(%rsp), %rdi
callq 0xd6e0
movb (%rax), %al
movb %al, 0x27(%rsp)
movq 0x40(%rsp), %rax
movsbl 0x27(%rsp), %ecx
subl $0x61, %ecx
movslq %ecx, %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0xd655
movl $0xd8, %edi
callq 0x3260
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
callq 0xd4c0
jmp 0xd61b
movq 0x8(%rsp), %rdx
movq 0x40(%rsp), %rax
movsbl 0x27(%rsp), %ecx
subl $0x61, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xd655
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
movl $0xd8, %esi
callq 0x3270
jmp 0xd68e
movq 0x40(%rsp), %rax
movsbl 0x27(%rsp), %ecx
subl $0x61, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x40(%rsp)
leaq 0x30(%rsp), %rdi
callq 0xd6f0
jmp 0xd5c0
movq 0x40(%rsp), %rax
movb $0x1, 0xd0(%rax)
addq $0x58, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0x33f0
nopl (%rax,%rax)
// File: mh0fm4[P]SCDC/test/demos/convert/proc_U.c
// Function: main
int main(int argc, char **argv)
{
  TRACE_F("init");

  scdc_init(SCDC_INIT_DEFAULT);

#if USE_COMPS
  compS_init();
#endif

#if USE_COMPC
  compC_init();
#endif

#if USE_COMPU
  compU_run();
#elif defined(USE_COMPS) || defined(USE_COMPC)
  TRACE_F("press ENTER to exit");
  getchar();
#endif

#if USE_COMPS
  compS_release();
#endif

#if USE_COMPC
  compC_release();
#endif

  TRACE_F("release");

  scdc_release();

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x7c82d(%rip), %rdi     # 0x8a04a
leaq 0x7c7e0(%rip), %rsi     # 0x8a004
movb $0x0, %al
callq 0xcd20
leaq 0x7c7d9(%rip), %rdi     # 0x8a00b
movb $0x0, %al
callq 0xcd20
leaq 0x7c7d0(%rip), %rdi     # 0x8a010
movb $0x0, %al
callq 0xcd20
leaq 0x7cd76(%rip), %rdi     # 0x8a5c4
movb $0x0, %al
callq 0xdfb0
movb $0x0, %al
callq 0xdd20
leaq 0x7c7e7(%rip), %rdi     # 0x8a04a
leaq 0x7c79a(%rip), %rsi     # 0x8a004
movb $0x0, %al
callq 0xcd20
leaq 0x7c79a(%rip), %rdi     # 0x8a012
movb $0x0, %al
callq 0xcd20
leaq 0x7c78a(%rip), %rdi     # 0x8a010
movb $0x0, %al
callq 0xcd20
callq 0xe160
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::initParts()
void GameBoy::initParts() {
    cpu = new CPU();
    memory = new Memory();
    lcd = new LCD();
    timer = new Timer();
    ints = new Interrupts();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x60, %edi
callq 0x2250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x20(%rbp)
callq 0x3de0
jmp 0x273f
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
movl $0x30, %edi
callq 0x2250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
callq 0x9060
jmp 0x2765
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x18, %edi
callq 0x2250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
callq 0x86f0
jmp 0x278c
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl $0x18, %edi
callq 0x2250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
callq 0x9690
jmp 0x27b3
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x18(%rax)
movl $0x28, %edi
callq 0x2250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
callq 0x9810
jmp 0x27da
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x20(%rax)
addq $0x50, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x60, %esi
callq 0x2260
jmp 0x2876
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x30, %esi
callq 0x2260
jmp 0x2876
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x18, %esi
callq 0x2260
jmp 0x2876
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x18, %esi
callq 0x2260
jmp 0x2876
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x28, %esi
callq 0x2260
movq -0x10(%rbp), %rdi
callq 0x23b0
nop
// File: klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::GameBoy()
GameBoy::GameBoy() {
    DMATransfer = false;
    IME = true;
    Halt = false;
    Stop = false;
    RAM = new byte[0x10000];
    colors = new std::vector<Uint32>({ 
        0x01C4CFA1U, 
        0x018B956DU, 
        0x016B7353U, 
        0x01414141U 
    });
    setMode(2);
    setOAMInterrupt(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movb $0x0, 0x58(%rax)
movb $0x1, 0x59(%rax)
movb $0x0, 0x5a(%rax)
movb $0x0, 0x5b(%rax)
movl $0x10000, %edi          # imm = 0x10000
callq 0x2040
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x48(%rax)
movl $0x18, %edi
callq 0x2250
movq %rax, -0x50(%rbp)
movq %rax, -0x58(%rbp)
movb $0x1, -0x3d(%rbp)
movl $0x1c4cfa1, -0x28(%rbp) # imm = 0x1C4CFA1
movl $0x18b956d, -0x24(%rbp) # imm = 0x18B956D
movl $0x16b7353, -0x20(%rbp) # imm = 0x16B7353
movl $0x1414141, -0x1c(%rbp) # imm = 0x1414141
leaq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x4, -0x10(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x3310
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x3330
jmp 0x291f
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
movb $0x0, -0x3d(%rbp)
movq %rcx, 0x50(%rax)
leaq -0x29(%rbp), %rdi
callq 0x33b0
movq -0x60(%rbp), %rdi
movl $0x2, %esi
callq 0x33d0
movq -0x60(%rbp), %rdi
movl $0x1, %esi
callq 0x3420
addq $0x60, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x33b0
testb $0x1, -0x3d(%rbp)
jne 0x2977
jmp 0x2985
movq -0x58(%rbp), %rdi
movl $0x18, %esi
callq 0x2260
jmp 0x2987
movq -0x38(%rbp), %rdi
callq 0x23b0
// File: klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::getInstance()
GameBoy* GameBoy::getInstance() {
    if (GameBoy::gb == nullptr) {
        gb = new GameBoy();
        gb->initParts();
    }
    return GameBoy::gb;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
cmpq $0x0, 0xc898(%rip)      # 0xf238
jne 0x29f2
movl $0x60, %edi
callq 0x2250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x18(%rbp)
callq 0x2880
jmp 0x29bd
movq -0x18(%rbp), %rax
movq %rax, 0xc870(%rip)      # 0xf238
movq 0xc869(%rip), %rdi      # 0xf238
callq 0x2710
jmp 0x29f2
movq -0x18(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x60, %esi
callq 0x2260
jmp 0x29ff
movq 0xc83f(%rip), %rax      # 0xf238
addq $0x20, %rsp
popq %rbp
retq
movq -0x8(%rbp), %rdi
callq 0x23b0
nopl (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::DrawPixel(int, int, int)
void GameBoy::DrawPixel(int x, int y, int color)
{
    for (int i = 0; i < scale; i++) {
        for (int j = 0; j < scale; j++) {
            int pxl = (y * scale + i) * 160 * scale + scale * x + j;
            pixels[pxl] = colors->at(color);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x28(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x40(%rcx), %eax
jge 0x2ab3
movl $0x0, -0x1c(%rbp)
movq -0x28(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0x40(%rcx), %eax
jge 0x2aa6
movq -0x28(%rbp), %rax
movl -0x10(%rbp), %ecx
imull 0x40(%rax), %ecx
addl -0x18(%rbp), %ecx
imull $0xa0, %ecx, %ecx
imull 0x40(%rax), %ecx
movl 0x40(%rax), %edx
imull -0xc(%rbp), %edx
addl %edx, %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, -0x20(%rbp)
movq 0x50(%rax), %rdi
movslq -0x14(%rbp), %rsi
callq 0x3460
movq %rax, %rcx
movq -0x28(%rbp), %rax
movl (%rcx), %edx
movq 0x38(%rax), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2a47
jmp 0x2aa8
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2a34
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::~GameBoy()
GameBoy::~GameBoy()
{
    delete cpu;
    delete memory;
    delete lcd;
    delete timer;
    delete ints;
    delete[] RAM;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x2fef
movq -0x10(%rbp), %rdi
movl $0x60, %esi
callq 0x2260
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x300f
movq -0x20(%rbp), %rdi
movl $0x30, %esi
callq 0x2260
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x302f
movq -0x28(%rbp), %rdi
movl $0x18, %esi
callq 0x2260
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x304f
movq -0x30(%rbp), %rdi
movl $0x18, %esi
callq 0x2260
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x306f
movq -0x38(%rbp), %rdi
movl $0x28, %esi
callq 0x2260
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x308a
movq -0x40(%rbp), %rdi
callq 0x2310
addq $0x40, %rsp
popq %rbp
retq
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::CPU()
CPU::CPU() {
    this->gb = GameBoy::getInstance();
    A = (byte*)&AF + 1;
    F = (byte*)&AF;
    B = (byte*)&BC + 1;
    C = (byte*)&BC;
    D = (byte*)&DE + 1;
    E = (byte*)&DE;
    H = (byte*)&HL + 1;
    L = (byte*)&HL;
    PC = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
callq 0x2990
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rax, %rcx
addq $0x2, %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, 0x28(%rax)
movq %rax, %rcx
addq $0x4, %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rax)
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x38(%rax)
movq %rax, %rcx
addq $0x6, %rcx
addq $0x1, %rcx
movq %rcx, 0x40(%rax)
movq %rax, %rcx
addq $0x6, %rcx
movq %rcx, 0x48(%rax)
movw $0x0, 0x50(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::ADDsbyteToSP()
ushort CPU::ADDsbyteToSP()
{
    Zero = false;
    Substract = false;
    tmp = gb->Read(PC);
    PC++;
    ushort newSP = SP;
    char* sb = (char*)&tmp;
    newSP += *sb;
    
    if (*sb < 0)
    {
        HalfCarry = (newSP & 0xF) <= (SP & 0xF);
        Carry = (newSP & 0xFF) <= (SP & 0xFF);
    }
    else
    {
        HalfCarry = (((SP & 0xF) + (tmp & 0xF)) & 0x10) == 0x10;
        Carry = (((SP & 0xFF) + (tmp & 0xFF)) & 0x100) == 0x100;
    }
    gb->SyncCycles(8);
    return newSP;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movb $0x0, 0x8(%rax)
movb $0x0, 0x9(%rax)
movq 0x58(%rax), %rdi
movzwl 0x50(%rax), %esi
callq 0x31a0
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x55(%rax)
movw 0x50(%rax), %cx
addw $0x1, %cx
movw %cx, 0x50(%rax)
movw 0x52(%rax), %cx
movw %cx, -0xa(%rbp)
addq $0x55, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
movzwl -0xa(%rbp), %eax
addl %ecx, %eax
movw %ax, -0xa(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jge 0x7499
movq -0x20(%rbp), %rax
movzwl -0xa(%rbp), %ecx
andl $0xf, %ecx
movzwl 0x52(%rax), %edx
andl $0xf, %edx
cmpl %edx, %ecx
setle %cl
andb $0x1, %cl
movb %cl, 0xa(%rax)
movzwl -0xa(%rbp), %ecx
andl $0xff, %ecx
movzwl 0x52(%rax), %edx
andl $0xff, %edx
cmpl %edx, %ecx
setle %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
jmp 0x74e7
movq -0x20(%rbp), %rax
movzwl 0x52(%rax), %ecx
andl $0xf, %ecx
movzbl 0x55(%rax), %edx
andl $0xf, %edx
addl %edx, %ecx
andl $0x10, %ecx
cmpl $0x10, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xa(%rax)
movzwl 0x52(%rax), %ecx
andl $0xff, %ecx
movzbl 0x55(%rax), %edx
andl $0xff, %edx
addl %edx, %ecx
andl $0x100, %ecx            # imm = 0x100
cmpl $0x100, %ecx            # imm = 0x100
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdi
movl $0x8, %esi
callq 0x3090
movw -0xa(%rbp), %ax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::POP(unsigned char*, unsigned char*)
void CPU::POP(byte* h, byte* l)
{
    *l = gb->Read(SP);
    SP++;
    *h = gb->Read(SP);
    SP++;
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x58(%rax), %rdi
movzwl 0x52(%rax), %esi
callq 0x31a0
movb %al, %dl
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movb %dl, (%rcx)
movw 0x52(%rax), %cx
addw $0x1, %cx
movw %cx, 0x52(%rax)
movq 0x58(%rax), %rdi
movzwl 0x52(%rax), %esi
callq 0x31a0
movb %al, %dl
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movb %dl, (%rcx)
movw 0x52(%rax), %cx
addw $0x1, %cx
movw %cx, 0x52(%rax)
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::ADD(unsigned char)
void CPU::ADD(byte value)
{
    Substract = false;
    HalfCarry = (((*A & 0xF) + (value & 0xF)) & 0x10) == 0x10;
    Carry = ((*A + value) & 0x100) == 0x100;
    *A += value;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0x9(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
andl $0xf, %ecx
movzbl -0x9(%rbp), %edx
andl $0xf, %edx
addl %edx, %ecx
andl $0x10, %ecx
cmpl $0x10, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xa(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
movzbl -0x9(%rbp), %edx
addl %edx, %ecx
andl $0x100, %ecx            # imm = 0x100
cmpl $0x100, %ecx            # imm = 0x100
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movzbl -0x9(%rbp), %esi
movq 0x10(%rax), %rcx
movzbl (%rcx), %edx
addl %esi, %edx
movb %dl, (%rcx)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
popq %rbp
retq
nop
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::ADC(unsigned char)
void CPU::ADC(byte value)
{
    byte carry = Carry ? 1 : 0;
    Substract = false;
    HalfCarry = (((*A & 0xF) + (value & 0xF) + carry) & 0x10) == 0x10;
    Carry = ((*A + value + carry) & 0x100) == 0x100;
    *A += value + carry;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movb 0xb(%rax), %sil
xorl %ecx, %ecx
movl $0x1, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
movb %cl, -0xa(%rbp)
movb $0x0, 0x9(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
andl $0xf, %ecx
movzbl -0x9(%rbp), %edx
andl $0xf, %edx
addl %edx, %ecx
movzbl -0xa(%rbp), %edx
addl %edx, %ecx
andl $0x10, %ecx
cmpl $0x10, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xa(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
movzbl -0x9(%rbp), %edx
addl %edx, %ecx
movzbl -0xa(%rbp), %edx
addl %edx, %ecx
andl $0x100, %ecx            # imm = 0x100
cmpl $0x100, %ecx            # imm = 0x100
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movzbl -0x9(%rbp), %esi
movzbl -0xa(%rbp), %ecx
addl %ecx, %esi
movq 0x10(%rax), %rcx
movzbl (%rcx), %edx
addl %esi, %edx
movb %dl, (%rcx)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SUB(unsigned char)
void CPU::SUB(byte value)
{
    Substract = true;
    HalfCarry = (*A & 0xF) < (value & 0xF);
    Carry = (*A & 0xFF) < (value & 0xFF);
    *A -= value;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0x9(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
andl $0xf, %ecx
movzbl -0x9(%rbp), %edx
andl $0xf, %edx
cmpl %edx, %ecx
setl %cl
andb $0x1, %cl
movb %cl, 0xa(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
andl $0xff, %ecx
movzbl -0x9(%rbp), %edx
andl $0xff, %edx
cmpl %edx, %ecx
setl %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movzbl -0x9(%rbp), %esi
movq 0x10(%rax), %rcx
movzbl (%rcx), %edx
subl %esi, %edx
movb %dl, (%rcx)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SBC(unsigned char)
void CPU::SBC(byte value)
{
    byte carry = Carry ? 1 : 0;
    Substract = true;
    HalfCarry = (*A & 0xF) < ((value & 0xF) + carry);
    Carry = (*A & 0xFF) < ((value & 0xFF) + carry);
    *A -= value + carry;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movb 0xb(%rax), %sil
xorl %ecx, %ecx
movl $0x1, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
movb %cl, -0xa(%rbp)
movb $0x1, 0x9(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
andl $0xf, %ecx
movzbl -0x9(%rbp), %edx
andl $0xf, %edx
movzbl -0xa(%rbp), %esi
addl %esi, %edx
cmpl %edx, %ecx
setl %cl
andb $0x1, %cl
movb %cl, 0xa(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
andl $0xff, %ecx
movzbl -0x9(%rbp), %edx
andl $0xff, %edx
movzbl -0xa(%rbp), %esi
addl %esi, %edx
cmpl %edx, %ecx
setl %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movzbl -0x9(%rbp), %esi
movzbl -0xa(%rbp), %ecx
addl %ecx, %esi
movq 0x10(%rax), %rcx
movzbl (%rcx), %edx
subl %esi, %edx
movb %dl, (%rcx)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
popq %rbp
retq
nop
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::AND(unsigned char)
void CPU::AND(byte value)
{
    HalfCarry = true;
    Substract = false;
    Carry = false;
    *A &= value;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0xa(%rax)
movb $0x0, 0x9(%rax)
movb $0x0, 0xb(%rax)
movzbl -0x9(%rbp), %esi
movq 0x10(%rax), %rcx
movzbl (%rcx), %edx
andl %esi, %edx
movb %dl, (%rcx)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::CP(unsigned char)
void CPU::CP(byte value)
{
    Substract = true;
    HalfCarry = (*A & 0xF) < (value & 0xF);

    if (value > *A)
        Carry = true;
    else
        Carry = false;

    if (*A == value)
        Zero = true;
    else
        Zero = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movb $0x1, 0x9(%rcx)
movq 0x10(%rcx), %rax
movzbl (%rax), %eax
andl $0xf, %eax
movzbl -0x9(%rbp), %edx
andl $0xf, %edx
cmpl %edx, %eax
setl %al
andb $0x1, %al
movb %al, 0xa(%rcx)
movzbl -0x9(%rbp), %eax
movq 0x10(%rcx), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jle 0x799e
movq -0x18(%rbp), %rax
movb $0x1, 0xb(%rax)
jmp 0x79a6
movq -0x18(%rbp), %rax
movb $0x0, 0xb(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
movzbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
jne 0x79c3
movq -0x18(%rbp), %rax
movb $0x1, 0x8(%rax)
jmp 0x79cb
movq -0x18(%rbp), %rax
movb $0x0, 0x8(%rax)
popq %rbp
retq
nopl (%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::INC(unsigned char*)
void CPU::INC(byte* value)
{
    Substract = false;
    HalfCarry = (*value & 0xF) == 0xF;
    (*value)++;
    Zero = *value == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0x9(%rax)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0xf, %ecx
cmpl $0xf, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xa(%rax)
movq -0x10(%rbp), %rcx
movb (%rcx), %dl
addb $0x1, %dl
movb %dl, (%rcx)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::DEC(unsigned char*)
void CPU::DEC(byte* value)
{
    Substract = true;
    HalfCarry = (*value & 0xF) == 0;
    (*value)--;
    Zero = *value == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0x9(%rax)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0xf, %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xa(%rax)
movq -0x10(%rbp), %rcx
movb (%rcx), %dl
addb $-0x1, %dl
movb %dl, (%rcx)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::ADD(unsigned short)
void CPU::ADD(ushort value)
{
    Substract = false;
    HalfCarry = (((HL & 0xFFF) + (value & 0xFFF)) & 0x1000) == 0x1000;
    Carry = (((HL & 0xFFFF) + (value & 0xFFFF)) & 0x10000) == 0x10000;
    HL += value;
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0x9(%rax)
movzwl 0x6(%rax), %ecx
andl $0xfff, %ecx            # imm = 0xFFF
movzwl -0xa(%rbp), %edx
andl $0xfff, %edx            # imm = 0xFFF
addl %edx, %ecx
andl $0x1000, %ecx           # imm = 0x1000
cmpl $0x1000, %ecx           # imm = 0x1000
sete %cl
andb $0x1, %cl
movb %cl, 0xa(%rax)
movzwl 0x6(%rax), %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
movzwl -0xa(%rbp), %edx
andl $0xffff, %edx           # imm = 0xFFFF
addl %edx, %ecx
andl $0x10000, %ecx          # imm = 0x10000
cmpl $0x10000, %ecx          # imm = 0x10000
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movzwl -0xa(%rbp), %edx
movzwl 0x6(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x6(%rax)
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SWAP(unsigned char*)
void CPU::SWAP(byte* value)
{
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
    Carry = false;
    *value = (*value & 0xF0) >> 4 | (*value) << 4;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
movb $0x0, 0xb(%rax)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
andl $0xf0, %eax
sarl $0x4, %eax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RLC(unsigned char*)
void CPU::RLC(byte* value)
{
    Carry = ((*value >> 7) & 1) == 1;
    *value = *value >> 7 | (*value) << 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x1, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
sarl $0x7, %ecx
movq -0x10(%rbp), %rdx
movzbl (%rdx), %edx
shll %edx
orl %edx, %ecx
movb %cl, %dl
movq -0x10(%rbp), %rcx
movb %dl, (%rcx)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RL(unsigned char*)
void CPU::RL(byte* value)
{
    byte temp = (*value);
    *value = *value << 1 | (Carry ? 1 : 0);
    Carry = ((temp >> 7) & 1) == 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movb (%rcx), %cl
movb %cl, -0x11(%rbp)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
shll %ecx
movb 0xb(%rax), %dil
xorl %edx, %edx
movl $0x1, %esi
testb $0x1, %dil
cmovnel %esi, %edx
orl %edx, %ecx
movb %cl, %dl
movq -0x10(%rbp), %rcx
movb %dl, (%rcx)
movzbl -0x11(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x1, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RR(unsigned char*)
void CPU::RR(byte* value)
{
    byte temp = (*value);
    *value = *value >> 1 | (Carry ? 0x80 : 0);
    Carry = (temp & 1) == 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movb (%rcx), %cl
movb %cl, -0x11(%rbp)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
sarl %ecx
movb 0xb(%rax), %dil
xorl %edx, %edx
movl $0x80, %esi
testb $0x1, %dil
cmovnel %esi, %edx
orl %edx, %ecx
movb %cl, %dl
movq -0x10(%rbp), %rcx
movb %dl, (%rcx)
movzbl -0x11(%rbp), %ecx
andl $0x1, %ecx
cmpl $0x1, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
popq %rbp
retq
nop
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SLA(unsigned char*)
void CPU::SLA(byte* value)
{
    Carry = (*value & 0x80) == 0x80;
    *value = *value << 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0x80, %ecx
cmpl $0x80, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
shll %ecx
movb %cl, %dl
movq -0x10(%rbp), %rcx
movb %dl, (%rcx)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SRA(unsigned char*)
void CPU::SRA(byte* value)
{
    Carry = (*value & 1) == 1;
    *value = (*value & 0x80) | (*value) >> 1;
    Zero = *value == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0x1, %ecx
cmpl $0x1, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0x80, %ecx
movq -0x10(%rbp), %rdx
movzbl (%rdx), %edx
sarl %edx
orl %edx, %ecx
movb %cl, %dl
movq -0x10(%rbp), %rcx
movb %dl, (%rcx)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SRL(unsigned char*)
void CPU::SRL(byte* value)
{
    Carry = (*value & 1) == 1;
    *value = *value >> 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0x1, %ecx
cmpl $0x1, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
sarl %ecx
movb %cl, %dl
movq -0x10(%rbp), %rcx
movb %dl, (%rcx)
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::BIT(unsigned char, unsigned char)
void CPU::BIT(byte bit, byte value)
{
    Substract = false;
    HalfCarry = true;
    Zero = true;
    if ((value >> bit) & 1) {
        Zero = false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dl, %al
movb %sil, %cl
movq %rdi, -0x8(%rbp)
movb %cl, -0x9(%rbp)
movb %al, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movb $0x0, 0x9(%rax)
movb $0x1, 0xa(%rax)
movb $0x1, 0x8(%rax)
movzbl -0xa(%rbp), %eax
movzbl -0x9(%rbp), %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7ee1
movq -0x18(%rbp), %rax
movb $0x0, 0x8(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::DAA()
void CPU::DAA()
{
    byte bias = Carry ? 0x60 : 0;

    bias += HalfCarry ? 0x6 : 0;

    if (Substract)
        *A -= bias;
    else
    {
        if ((*A & 0xF) > 9)
            bias |= 6;
        if (*A > 0x99)
        {
            bias |= 0x60;
            Carry = true;
        }
        *A += bias;
    }

    HalfCarry = false;

    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movb 0xb(%rax), %sil
xorl %ecx, %ecx
movl $0x60, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
movb %cl, -0x9(%rbp)
movb 0xa(%rax), %sil
xorl %edx, %edx
movl $0x6, %ecx
testb $0x1, %sil
cmovnel %ecx, %edx
movzbl -0x9(%rbp), %ecx
addl %edx, %ecx
movb %cl, -0x9(%rbp)
testb $0x1, 0x9(%rax)
je 0x7fab
movq -0x18(%rbp), %rax
movzbl -0x9(%rbp), %edx
movq 0x10(%rax), %rax
movzbl (%rax), %ecx
subl %edx, %ecx
movb %cl, (%rax)
jmp 0x7fff
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
andl $0xf, %eax
cmpl $0x9, %eax
jle 0x7fc8
movzbl -0x9(%rbp), %eax
orl $0x6, %eax
movb %al, -0x9(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x99, %eax
jle 0x7fec
movq -0x18(%rbp), %rax
movzbl -0x9(%rbp), %ecx
orl $0x60, %ecx
movb %cl, -0x9(%rbp)
movb $0x1, 0xb(%rax)
movq -0x18(%rbp), %rax
movzbl -0x9(%rbp), %edx
movq 0x10(%rax), %rax
movzbl (%rax), %ecx
addl %edx, %ecx
movb %cl, (%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0xa(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
popq %rbp
retq
nopl (%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::HALT()
void CPU::HALT()
{
    bool halt = gb->EnterHALTMode();
    if (!halt) {
        gb->Clock();
        PC--;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x58(%rax), %rdi
callq 0x32b0
andb $0x1, %al
movb %al, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
jne 0x80e5
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x3290
movq -0x18(%rbp), %rax
movw 0x50(%rax), %cx
addw $-0x1, %cx
movw %cx, 0x50(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::STOP()
void CPU::STOP()
{
    if (gb->Read(PC) == 0x00)
    {
        gb->Stop = true;
        PC++;
        gb->SyncCycles(-4);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq 0x58(%rax), %rdi
movzwl 0x50(%rax), %esi
callq 0x31a0
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x813f
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rcx
movb $0x1, 0x5b(%rcx)
movw 0x50(%rax), %cx
addw $0x1, %cx
movw %cx, 0x50(%rax)
movq 0x58(%rax), %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x3090
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RLCA()
void CPU::RLCA()
{
    Carry = ((*A >> 7) & 1) == 1;
    *A = *A >> 7 | (*A) << 1;
    Zero = false;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x1, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
sarl $0x7, %ecx
movq 0x10(%rax), %rdx
movzbl (%rdx), %edx
shll %edx
orl %edx, %ecx
movb %cl, %dl
movq 0x10(%rax), %rcx
movb %dl, (%rcx)
movb $0x0, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
popq %rbp
retq
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RLA()
void CPU::RLA()
{
    byte temp = (*A);
    *A = *A << 1 | (Carry ? 1 : 0);
    Carry = ((temp >> 7) & 1) == 1;
    Zero = false;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movb (%rcx), %cl
movb %cl, -0x9(%rbp)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
shll %ecx
movb 0xb(%rax), %dil
xorl %edx, %edx
movl $0x1, %esi
testb $0x1, %dil
cmovnel %esi, %edx
orl %edx, %ecx
movb %cl, %dl
movq 0x10(%rax), %rcx
movb %dl, (%rcx)
movzbl -0x9(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x1, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movb $0x0, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
popq %rbp
retq
nop
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RRA()
void CPU::RRA()
{
    byte temp = (*A);
    *A = *A >> 1 | (Carry ? 0x80 : 0);
    Carry = (temp & 1) == 1;
    Zero = false;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movb (%rcx), %cl
movb %cl, -0x9(%rbp)
movq 0x10(%rax), %rcx
movzbl (%rcx), %ecx
sarl %ecx
movb 0xb(%rax), %dil
xorl %edx, %edx
movl $0x80, %esi
testb $0x1, %dil
cmovnel %esi, %edx
orl %edx, %ecx
movb %cl, %dl
movq 0x10(%rax), %rcx
movb %dl, (%rcx)
movzbl -0x9(%rbp), %ecx
andl $0x1, %ecx
cmpl $0x1, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0xb(%rax)
movb $0x0, 0x8(%rax)
movb $0x0, 0xa(%rax)
movb $0x0, 0x9(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::JP(bool)
void CPU::JP(bool flag)
{
    if (flag)
        PC = gb->ReadWord(PC);
    else
    {
        PC += 2;
        gb->SyncCycles(4);
    }
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
testb $0x1, -0x9(%rbp)
je 0x8350
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movzwl 0x50(%rax), %esi
callq 0x31d0
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x50(%rax)
jmp 0x836d
movq -0x18(%rbp), %rax
movzwl 0x50(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x50(%rax)
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::JR(bool)
void CPU::JR(bool flag)
{
    byte value;
    char* sb;
    if (flag)
    {
        value = gb->Read(PC);
        sb = (char*)&value;
        PC = (ushort)(PC + *sb);
    }
    PC++;
    gb->SyncCycles(4);
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
testb $0x1, -0x9(%rbp)
je 0x83e5
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdi
movzwl 0x50(%rax), %esi
callq 0x31a0
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0xa(%rbp)
leaq -0xa(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movzwl 0x50(%rax), %ecx
movq -0x18(%rbp), %rdx
movsbl (%rdx), %edx
addl %edx, %ecx
movw %cx, 0x50(%rax)
movq -0x20(%rbp), %rax
movw 0x50(%rax), %cx
addw $0x1, %cx
movw %cx, 0x50(%rax)
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::CALL(bool)
void CPU::CALL(bool flag)
{
    if (flag)
    {
        SP -= 2;
        gb->WriteWord(SP, (ushort)(PC + 2));
        PC = gb->ReadWord(PC);
    }
    else
    {
        PC += 2;
        gb->SyncCycles(4);
    }
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
testb $0x1, -0x9(%rbp)
je 0x8476
movq -0x18(%rbp), %rax
movzwl 0x52(%rax), %ecx
subl $0x2, %ecx
movw %cx, 0x52(%rax)
movq 0x58(%rax), %rdi
movzwl 0x52(%rax), %esi
movzwl 0x50(%rax), %eax
addl $0x2, %eax
movzwl %ax, %edx
callq 0x3200
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movzwl 0x50(%rax), %esi
callq 0x31d0
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x50(%rax)
jmp 0x8493
movq -0x18(%rbp), %rax
movzwl 0x50(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x50(%rax)
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RST(unsigned short)
void CPU::RST(ushort addr)
{
    SP -= 2;
    gb->WriteWord(SP, PC);
    PC = addr;
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movzwl 0x52(%rax), %ecx
subl $0x2, %ecx
movw %cx, 0x52(%rax)
movq 0x58(%rax), %rdi
movzwl 0x52(%rax), %esi
movzwl 0x50(%rax), %edx
callq 0x3200
movq -0x18(%rbp), %rax
movw -0xa(%rbp), %cx
movw %cx, 0x50(%rax)
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RET(bool)
void CPU::RET(bool flag)
{
    if (flag)
    {
        PC = gb->ReadWord(SP);
        SP += 2;
        gb->SyncCycles(4);
    }
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
testb $0x1, -0x9(%rbp)
je 0x8567
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movzwl 0x52(%rax), %esi
callq 0x31d0
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x50(%rax)
movzwl 0x52(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x52(%rax)
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movl $0x4, %esi
callq 0x3090
addq $0x20, %rsp
popq %rbp
retq
nop
// File: klyushinmisha[P]GBEmu/./src/LCD.cpp
// Function: LCD::GetColor(unsigned short, int, int)
byte LCD::GetColor(ushort startAddr, int xOffset, int yOffset)
{
    byte half1 = (RAM[startAddr] >> (7 - xOffset)) & 1;
    byte half2 = (RAM[startAddr + 1] >> (7 - xOffset)) & 1;
    byte value = (half2 << 1) + half1;
    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movzwl -0xa(%rbp), %edx
movzbl (%rcx,%rdx), %edx
movl $0x7, %ecx
subl -0x10(%rbp), %ecx
sarl %cl, %edx
movl %edx, %ecx
andl $0x1, %ecx
movb %cl, -0x15(%rbp)
movq 0x10(%rax), %rax
movzwl -0xa(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl $0x7, %ecx
subl -0x10(%rbp), %ecx
sarl %cl, %eax
andl $0x1, %eax
movb %al, -0x16(%rbp)
movzbl -0x16(%rbp), %eax
shll %eax
movzbl -0x15(%rbp), %ecx
addl %ecx, %eax
movb %al, -0x17(%rbp)
movb -0x17(%rbp), %al
popq %rbp
retq
nopl (%rax)
// File: klyushinmisha[P]GBEmu/./src/LCD.cpp
// Function: LCD::LCD()
LCD::LCD()
{
    this->gb = GameBoy::getInstance();
    this->RAM = gb->getRAM();
    background = new Background();
    //s = new Sprite(gb);
    //window = new Window(gb);
    //sID = new byte[10];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x2990
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq (%rax), %rdi
callq 0x88e0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x10, %edi
callq 0x2250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x20(%rbp)
callq 0x89b0
jmp 0x8741
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x30, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x10, %esi
callq 0x2260
movq -0x10(%rbp), %rdi
callq 0x23b0
nopw %cs:(%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/LCD.cpp
// Function: LCD::PixelColor(unsigned char, int, int, bool)
byte LCD::PixelColor(byte ID, int xOffset, int yOffset, bool bank)
{
    ushort startAddr;
    if (bank)
        startAddr = (ushort)(0x8000 + ID * 16);
    else
    {
        char* sb = (char*)&ID;
        startAddr = (ushort)(0x9000 + *sb * 16);
    }
    
    startAddr += (ushort)(yOffset * 2);

    return GetColor(startAddr, xOffset, yOffset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movb %sil, -0x9(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
andb $0x1, %al
movb %al, -0x15(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
testb $0x1, -0x15(%rbp)
je 0x885e
movzbl -0x9(%rbp), %eax
shll $0x4, %eax
addl $0x8000, %eax           # imm = 0x8000
movw %ax, -0x18(%rbp)
jmp 0x8879
leaq -0x9(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
shll $0x4, %eax
addl $0x9000, %eax           # imm = 0x9000
movw %ax, -0x18(%rbp)
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %eax
shll %eax
movzwl %ax, %ecx
movzwl -0x18(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x18(%rbp)
movw -0x18(%rbp), %ax
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movzwl %ax, %esi
callq 0x8680
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: klyushinmisha[P]GBEmu/./src/Background.cpp
// Function: Background::TileFromMap(int, int)
byte Background::TileFromMap(int x, int y)
{
    ushort startAddr;
    if (gb->getBGTileMapDisplaySelect())
        startAddr = 0x9C00;
    else
        startAddr = 0x9800;
    return RAM[startAddr + y * 32 + x];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq (%rax), %rdi
callq 0x8b00
testb $0x1, %al
jne 0x8978
jmp 0x8980
movw $0x9c00, -0x12(%rbp)    # imm = 0x9C00
jmp 0x8986
movw $0x9800, -0x12(%rbp)    # imm = 0x9800
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movzwl -0x12(%rbp), %ecx
movl -0x10(%rbp), %edx
shll $0x5, %edx
addl %edx, %ecx
addl -0xc(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: klyushinmisha[P]GBEmu/./src/Background.cpp
// Function: Background::GetPalleteColor(int)
byte Background::GetPalleteColor(int pixel)
{
    byte x = (gb->getScrollX() + pixel) % 256;
    byte y = (gb->getScrollY() + gb->getYCoordinate()) % 256;
    if (gb->getBGDisplayEnable())
        return gb->PixelColor(TileFromMap(x / 8, y / 8), x % 8, y % 8, gb->getBGWindowTileDataSelect());
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq (%rax), %rdi
callq 0x8b30
movzbl %al, %eax
addl -0x14(%rbp), %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movq -0x20(%rbp), %rax
movb %dl, %cl
movb %cl, -0x15(%rbp)
movq (%rax), %rdi
callq 0x8b50
movb %al, %cl
movq -0x20(%rbp), %rax
movzbl %cl, %ecx
movl %ecx, -0x24(%rbp)
movq (%rax), %rdi
callq 0x8900
movb %al, %cl
movl -0x24(%rbp), %eax
movzbl %cl, %ecx
addl %ecx, %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movq -0x20(%rbp), %rax
movb %dl, %cl
movb %cl, -0x16(%rbp)
movq (%rax), %rdi
callq 0x8b70
testb $0x1, %al
jne 0x8a6b
jmp 0x8ae8
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
movq %rax, -0x38(%rbp)
movzbl -0x15(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %esi
movzbl -0x16(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %edx
callq 0x8950
movb %al, -0x39(%rbp)
movzbl -0x15(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x2c(%rbp)
movzbl -0x16(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movq -0x20(%rbp), %rax
movl %edx, -0x28(%rbp)
movq (%rax), %rdi
callq 0x8ba0
movb -0x39(%rbp), %sil
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl -0x28(%rbp), %ecx
movzbl %sil, %esi
movzbl %al, %r8d
andl $0x1, %r8d
callq 0x3100
movb %al, -0x1(%rbp)
jmp 0x8aec
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: klyushinmisha[P]GBEmu/./src/Memory.cpp
// Function: Memory::Memory()
Memory::Memory()
{
    //Init all components
    this->gb = GameBoy::getInstance();
    this->RAM = gb->getRAM();
    RAMBank = 0;
    
    
    //Clear this item
    //because 0 means all keys down
    RAM[0xFF00] = 0xFF;

    //Switch to ROM bank on start
    //Copys data from boot.bin to ROM
    isBooting = true;
    std::fstream fs;
    try
    {
        fs.open("boot.bin", std::fstream::in);
        char* tmpR = new char[256];
        fs.read(tmpR, 256);
        ROM = (byte*)tmpR;
    }
    catch (std::exception e)
    {
        std::cout << "Can't find boot.gb" << std::endl;
    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x248(%rbp)
callq 0x2990
movq %rax, %rcx
movq -0x248(%rbp), %rax
movq %rcx, (%rax)
movq (%rax), %rdi
callq 0x88e0
movq %rax, %rcx
movq -0x248(%rbp), %rax
movq %rcx, 0x28(%rax)
movb $0x0, 0x1d(%rax)
movq 0x28(%rax), %rcx
movb $-0x1, 0xff00(%rcx)
movb $0x1, 0x1a(%rax)
leaq -0x218(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x22d0
movq -0x240(%rbp), %rdi
leaq 0x2875(%rip), %rsi      # 0xb94b
movl $0x8, %edx
callq 0x2220
jmp 0x90e2
movl $0x100, %edi            # imm = 0x100
callq 0x2040
movq %rax, -0x250(%rbp)
jmp 0x90f5
movq -0x250(%rbp), %rax
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x2300
jmp 0x911d
movq -0x248(%rbp), %rax
movq -0x230(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x91cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
movl -0x224(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x921d
movq -0x220(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x22f0
movq %rax, %rsi
leaq -0x238(%rbp), %rdi
callq 0x9670
movq -0x260(%rbp), %rdi
callq 0x20e0
movq 0x5e4a(%rip), %rdi      # 0xefd8
leaq 0x27bf(%rip), %rsi      # 0xb954
callq 0x2240
movq %rax, -0x258(%rbp)
jmp 0x91a3
movq -0x258(%rbp), %rdi
movq 0x5e0f(%rip), %rsi      # 0xefc0
callq 0x2270
jmp 0x91b8
leaq -0x238(%rbp), %rdi
callq 0x23f0
callq 0x2380
jmp 0x91cb
jmp 0x91cd
leaq -0x218(%rbp), %rdi
callq 0x20b0
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x23f0
callq 0x2380
jmp 0x921b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x921d
jmp 0x921d
leaq -0x218(%rbp), %rdi
callq 0x20b0
movq -0x220(%rbp), %rdi
callq 0x23b0
movq %rax, %rdi
callq 0x3a20
nopl (%rax)