LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/cpu.cpp
// Function: void Rnes::Cpu::zeroPageYFormat<&Rnes::Cpu::stxInst(unsigned short)>(Rnes::Cpu::Instruction const&)
void Cpu::zeroPageYFormat(const Instruction &ins) {
  uint16_t zeroPageAddr = pc + 1;

  if (debug) {
    int zeroPageLoad = load(zeroPageAddr);
    std::stringstream str;
    str << std::setfill('0') << std::right;
    str << ins.nemonic << " $" << std::hex << std::uppercase << std::setw(2) << zeroPageLoad
        << ",Y";
    instTrace(str.str(), 2);
  }
  pc += 2;
  (this->*fx)((uint16_t)((load(zeroPageAddr) + y)) & 0xff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xc(%rdi), %eax
leal 0x1(%rax), %ecx
addl $0x2, %eax
movw %ax, 0xc(%rdi)
movq (%rdi), %rdi
movzwl %cx, %esi
callq 0x2072e
addb 0xa(%rbx), %al
movzbl 0x9(%rbx), %edx
movq (%rbx), %rdi
movzbl %al, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x20656
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Controller::setShiftReg()
void Controller::setShiftReg() {
  sdl->parseInput();
  shiftReg = 0;
  shiftReg |= (sdl->getButtonState(Sdl::BUTTON_A) ? 1u : 0u) << 0;
  shiftReg |= (sdl->getButtonState(Sdl::BUTTON_B) ? 1u : 0u) << 1;
  shiftReg |= (sdl->getButtonState(Sdl::BUTTON_SELECT) ? 1u : 0u) << 2;
  shiftReg |= (sdl->getButtonState(Sdl::BUTTON_START) ? 1u : 0u) << 3;
  shiftReg |= (sdl->getButtonState(Sdl::BUTTON_UP) ? 1u : 0u) << 4;
  shiftReg |= (sdl->getButtonState(Sdl::BUTTON_DOWN) ? 1u : 0u) << 5;
  shiftReg |= (sdl->getButtonState(Sdl::BUTTON_LEFT) ? 1u : 0u) << 6;
  shiftReg |= (sdl->getButtonState(Sdl::BUTTON_RIGHT) ? 1u : 0u) << 7;

  if (debug) {
    std::cerr << "shiftReg: " << std::hex << (int)shiftReg << "\n";
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x21ad2
movb $0x0, 0x9(%rbx)
movq (%rbx), %rdi
movl $0x6, %esi
callq 0x21bfa
orb %al, 0x9(%rbx)
movq (%rbx), %rdi
movl $0x7, %esi
callq 0x21bfa
addb %al, %al
orb %al, 0x9(%rbx)
movq (%rbx), %rdi
movl $0x5, %esi
callq 0x21bfa
shlb $0x2, %al
orb %al, 0x9(%rbx)
movq (%rbx), %rdi
movl $0x4, %esi
callq 0x21bfa
shlb $0x3, %al
orb %al, 0x9(%rbx)
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x21bfa
shlb $0x4, %al
orb %al, 0x9(%rbx)
movq (%rbx), %rdi
movl $0x1, %esi
callq 0x21bfa
shlb $0x5, %al
orb %al, 0x9(%rbx)
movq (%rbx), %rdi
movl $0x2, %esi
callq 0x21bfa
shlb $0x6, %al
orb %al, 0x9(%rbx)
movq (%rbx), %rdi
movl $0x3, %esi
callq 0x21bfa
shlb $0x7, %al
orb %al, 0x9(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Controller::read()
uint8_t Controller::read() {
  if (control & 0x1) {
    sdl->parseInput();
    return (sdl->getButtonState(Sdl::BUTTON_A) ? 1u : 0u) << 0;
  } else {
    uint8_t ret = 0;
    ret |= shiftReg & 0x1;
    shiftReg >>= 1;
    shiftReg |= 1u << 7;
    return ret;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x1, 0x8(%rdi)
jne 0x205ce
movb 0x9(%rbx), %cl
movl %ecx, %eax
andb $0x1, %al
shrb %cl
orb $-0x80, %cl
movb %cl, 0x9(%rbx)
jmp 0x205e3
movq (%rbx), %rdi
callq 0x21ad2
movq (%rbx), %rdi
movl $0x6, %esi
callq 0x21bfa
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Nes::spriteDmaExecute()
uint32_t Nes::spriteDmaExecute() {
  const uint32_t cyclesPerItr = 2;
  assert(spriteDmaMode);
  cpuMemWrite(ppuRegBase + Ppu::SPR_DATA_REG, cpuMemRead(spriteDmaSourceAddr));
  spriteDmaSourceAddr++;
  spriteDmaCycle += cyclesPerItr;
  if (spriteDmaCycleEnd == spriteDmaCycle) {
    spriteDmaMode = false;
  }
  return cyclesPerItr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpb $0x0, 0x30(%rdi)
je 0x20636
movq %rdi, %rbx
movzwl 0x38(%rdi), %esi
callq 0x2072e
movzbl %al, %edx
movq %rbx, %rdi
movl $0x2004, %esi           # imm = 0x2004
callq 0x20656
incw 0x38(%rbx)
movl 0x34(%rbx), %eax
addl $0x2, %eax
movl %eax, 0x34(%rbx)
cmpl $0x200, %eax            # imm = 0x200
jne 0x2062a
movb $0x0, 0x30(%rbx)
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x13e34(%rip), %rdi     # 0x34471
leaq 0x13e3b(%rip), %rsi     # 0x3447f
leaq 0x13e3c(%rip), %rcx     # 0x34487
movl $0x83, %edx
callq 0xa160
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Nes::cpuMemWrite(unsigned short, unsigned char)
void Nes::cpuMemWrite(uint16_t addr, uint8_t val) {
  addr = translateCpuWindows(addr);
  if (addr >= ppuRegBase && addr <= ppuRegEnd) {
    ppu->writeReg(addr - ppuRegBase, val);
  } else if (addr == spriteDmaAddr) {
    spriteDmaSetup(val);
  } else if (addr == joypadAddr) {
    pad->write(val);
  } else if (addr >= apuRegBase && addr <= apuRegEnd) {
    apu->writeReg(addr - apuRegBase, val);
  } else {
    cpuMemory->store(addr, val);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
leal -0x800(%rsi), %eax
movzwl %ax, %eax
movl %esi, %ecx
andl $0x7ff, %ecx            # imm = 0x7FF
orl $0x800, %ecx            # imm = 0x800
cmpl $0x1800, %eax           # imm = 0x1800
cmovael %esi, %ecx
movl %ecx, %eax
andl $0xe000, %eax           # imm = 0xE000
movl %ecx, %esi
andl $0x2007, %esi           # imm = 0x2007
movl $0x2000, %edx           # imm = 0x2000
cmpl %edx, %eax
cmovnel %ecx, %esi
movl %esi, %eax
andl $-0x8, %eax
cmpl %edx, %eax
jne 0x206b6
movq 0x58(%rdi), %rdi
addl $0xffffe000, %esi       # imm = 0xFFFFE000
movzbl %bl, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x18504
cmpl $0x4016, %esi           # imm = 0x4016
je 0x206dd
cmpl $0x4014, %esi           # imm = 0x4014
jne 0x206ff
movb $0x1, 0x30(%rdi)
movl $0x0, 0x34(%rdi)
movzbl %bl, %eax
shll $0x8, %eax
movw %ax, 0x38(%rdi)
jmp 0x206fa
movq 0x68(%rdi), %r14
testb $0x1, %bl
jne 0x206f6
movb 0x8(%r14), %al
andb $0x1, %al
je 0x206f6
movq %r14, %rdi
callq 0x204d6
movb %bl, 0x8(%r14)
popq %rbx
popq %r14
popq %rbp
retq
leal -0x4000(%rsi), %eax
cmpw $0x17, %ax
ja 0x2071d
movq 0x60(%rdi), %rdi
movzbl %bl, %edx
movl %eax, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x19298
movq 0x70(%rdi), %rdi
movzbl %bl, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x22d84
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Nes::cpuMemRead(unsigned short)
uint8_t Nes::cpuMemRead(uint16_t addr) {
  addr = translateCpuWindows(addr);
  if (addr >= ppuRegBase && addr <= ppuRegEnd) {
    return ppu->readReg(addr - ppuRegBase);
  } else if (addr == joypadAddr) {
    return pad->read();
  } else if (addr >= apuRegBase && addr <= apuRegEnd) {
    return apu->readReg(addr - apuRegBase);
  } else {
    return cpuMemory->load(addr);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal -0x800(%rsi), %eax
movzwl %ax, %eax
movl %esi, %ecx
andl $0x7ff, %ecx            # imm = 0x7FF
orl $0x800, %ecx            # imm = 0x800
cmpl $0x1800, %eax           # imm = 0x1800
cmovael %esi, %ecx
movl %ecx, %eax
andl $0xe000, %eax           # imm = 0xE000
movl %ecx, %esi
andl $0x2007, %esi           # imm = 0x2007
movl $0x2000, %edx           # imm = 0x2000
cmpl %edx, %eax
cmovnel %ecx, %esi
movl %esi, %eax
andl $-0x8, %eax
cmpl %edx, %eax
jne 0x20783
movq 0x58(%rdi), %rdi
addl $0xffffe000, %esi       # imm = 0xFFFFE000
popq %rbp
jmp 0x1866e
cmpl $0x4016, %esi           # imm = 0x4016
jne 0x20795
movq 0x68(%rdi), %rdi
popq %rbp
jmp 0x205ae
leal -0x4000(%rsi), %eax
cmpw $0x17, %ax
ja 0x207ad
movq 0x60(%rdi), %rdi
movl %eax, %esi
popq %rbp
jmp 0x193a8
movq 0x70(%rdi), %rdi
popq %rbp
jmp 0x22d24
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Nes::vidMemWrite(unsigned short, unsigned char)
static uint16_t translatePpuWindows(uint16_t addr) {
  // Name table mirrors.
  if (addr >= 0x3000 && addr < 0x3f00) {
    addr = (addr & (0xf00 - 1)) + 0x2000;
  }
  // ??
  if (addr >= 0x4000) {
    addr = addr - 0x4000;
  }

  // palette mirroring
  if (addr == 0x3f10) {
    addr = 0x3f00;
  } else if (addr == 0x3f14) {
    addr = 0x3f04;
  } else if (addr == 0x3f18) {
    addr = 0x3f08;
  } else if (addr == 0x3f1c) {
    addr = 0x3f0c;
  }
  return addr;
}

// Assembly:
leal -0x3000(%rsi), %eax
movzwl %ax, %eax
movl %esi, %ecx
andl $0x2eff, %ecx           # imm = 0x2EFF
cmpl $0xf00, %eax            # imm = 0xF00
cmovael %esi, %ecx
leal -0x4000(%rcx), %eax
cmpl $0x4000, %ecx           # imm = 0x4000
cmovbl %ecx, %eax
leal -0x3f10(%rax), %ecx
rolw $0xe, %cx
cmpw $0x4, %cx
jae 0x20815
shll $0x2, %ecx
orl $0x3f00, %ecx           # imm = 0x3F00
movl %ecx, %eax
jmp 0x20820
movzwl %ax, %ecx
cmpl $0x4000, %ecx           # imm = 0x4000
jae 0x2082f
movq 0x78(%rdi), %rdi
movzwl %ax, %esi
movzbl %dl, %edx
jmp 0x22fe8
pushq %rbp
movq %rsp, %rbp
leaq 0x13c74(%rip), %rdi     # 0x344ae
leaq 0x13c3e(%rip), %rsi     # 0x3447f
leaq 0x13c7d(%rip), %rcx     # 0x344c5
movl $0xb1, %edx
callq 0xa160
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Nes::run()
void Nes::run() {
  uint32_t inputCycles = 1 << 16;
  cpu->reset();
  while (1) {
    uint32_t cpuCycles;
    if (!spriteDmaMode) {
      cpuCycles = cpu->runInst();
    } else {
      cpuCycles = spriteDmaExecute();
    }
    apu->run(cpuCycles);
    ppu->run(cpuCycles);

    cycles += cpuCycles;
    if ((cycles % inputCycles) == 0) {
      sdl->parseInput();

      void loadNesState(Nes * nes, std::string saveFile);
      void saveNesState(Nes * nes, std::string saveFile);
      std::string getGameSaveDir(const std::string & romFile);

      if (sdl->getButtonState(Sdl::BUTTON_SAVE)) {
        saveNesState(this, getGameSaveDir(romFile));
      }
      if (sdl->getButtonState(Sdl::BUTTON_RESTORE)) {
        loadNesState(this, getGameSaveDir(romFile));
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x50(%rdi), %rdi
callq 0x1bbbc
leaq 0x10(%rbx), %r14
leaq -0x68(%rbp), %r15
leaq -0x48(%rbp), %r12
cmpb $0x0, 0x30(%rbx)
je 0x20955
movq %rbx, %rdi
callq 0x205ea
movl $0x2, %r13d
jmp 0x20961
movq 0x50(%rbx), %rdi
callq 0x1bae2
movl %eax, %r13d
movq 0x60(%rbx), %rdi
movl %r13d, %esi
callq 0x19276
movq 0x58(%rbx), %rdi
movl %r13d, %esi
callq 0x18344
movl %r13d, %eax
addq 0x40(%rbx), %rax
movq %rax, 0x40(%rbx)
testw %ax, %ax
jne 0x2093f
movq 0x48(%rbx), %rdi
callq 0x21ad2
movq 0x48(%rbx), %rdi
movl $0x8, %esi
callq 0x21bfa
testb %al, %al
je 0x209d3
movq %r15, %rdi
movq %r14, %rsi
callq 0x144b7
movq %rbx, %rdi
movq %r15, %rsi
callq 0x14c7b
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x209d3
movq -0x58(%rbp), %rsi
incq %rsi
callq 0xa0e0
movq 0x48(%rbx), %rdi
movl $0x9, %esi
callq 0x21bfa
testb %al, %al
je 0x2093f
movq %r12, %rdi
movq %r14, %rsi
callq 0x144b7
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14adf
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2093f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0xa0e0
jmp 0x2093f
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rcx
movq %rcx, %rax
cmpq %rcx, %rdi
jne 0x20a46
jmp 0x20a51
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x20a51
movq (%rax), %rsi
incq %rsi
callq 0xa0e0
movq %rbx, %rdi
callq 0xa4d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Nes::save(Rnes::SaveState&)
void Nes::save(SaveState &pb) {
  // date??

  // Dma state
  DmaState *dma = pb.mutable_dma();
  dma->set_spritedmamode(spriteDmaMode);
  dma->set_spritedmacycle(spriteDmaCycle);
  dma->set_spritedmasourceaddr(spriteDmaSourceAddr);

  // 6502 state
  cpu->save(*pb.mutable_cpu());

  // Audio state
  apu->save(*pb.mutable_apu());

  // PPU state
  ppu->save(*pb.mutable_ppu());

  // Controller state.
  pad->save(*pb.mutable_controller());

  // SRAM state.
  cpuMemory->save(*pb.mutable_cpumem());
  videoMemory->save(*pb.mutable_vidmem());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
orb $0x2, 0x10(%rsi)
movq %rdi, %r14
movq 0x20(%rsi), %rax
testq %rax, %rax
jne 0x20a8e
movq 0x8(%rbx), %rdi
testb $0x1, %dil
jne 0x20bf9
callq 0x30ffc
movq %rax, 0x20(%rbx)
movb 0x30(%r14), %cl
movl 0x10(%rax), %edx
movl %edx, %esi
orl $0x1, %esi
movl %esi, 0x10(%rax)
movb %cl, 0x18(%rax)
movl 0x34(%r14), %ecx
movl %ecx, 0x1c(%rax)
movzwl 0x38(%r14), %ecx
orl $0x7, %edx
movl %edx, 0x10(%rax)
movl %ecx, 0x20(%rax)
movq 0x50(%r14), %r15
orl $0x4, 0x10(%rbx)
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
jne 0x20ae0
movq 0x8(%rbx), %rdi
testb $0x1, %dil
jne 0x20c05
callq 0x30858
movq %rax, %rsi
movq %rax, 0x28(%rbx)
movq %r15, %rdi
callq 0x1c06c
movq 0x60(%r14), %r15
orl $0x8, 0x10(%rbx)
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
jne 0x20b13
movq 0x8(%rbx), %rdi
testb $0x1, %dil
jne 0x20c11
callq 0x30a08
movq %rax, %rsi
movq %rax, 0x30(%rbx)
movq %r15, %rdi
callq 0x1940e
movq 0x58(%r14), %r15
orl $0x10, 0x10(%rbx)
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
jne 0x20b46
movq 0x8(%rbx), %rdi
testb $0x1, %dil
jne 0x20c1d
callq 0x30af2
movq %rax, %rsi
movq %rax, 0x38(%rbx)
movq %r15, %rdi
callq 0x18012
movq 0x68(%r14), %r15
orl $0x20, 0x10(%rbx)
movq 0x40(%rbx), %rax
testq %rax, %rax
jne 0x20b76
movq 0x8(%rbx), %rdi
testb $0x1, %dil
jne 0x20c29
callq 0x30dee
movq %rax, 0x40(%rbx)
movzbl 0x8(%r15), %ecx
movl %ecx, 0x18(%rax)
movzbl 0x9(%r15), %ecx
orl $0x3, 0x10(%rax)
movl %ecx, 0x1c(%rax)
movq 0x70(%r14), %r15
orl $0x40, 0x10(%rbx)
movq 0x48(%rbx), %rsi
testq %rsi, %rsi
jne 0x20bb5
movq 0x8(%rbx), %rdi
testb $0x1, %dil
jne 0x20c35
callq 0x30e50
movq %rax, %rsi
movq %rax, 0x48(%rbx)
movq %r15, %rdi
callq 0x22dfa
movq 0x78(%r14), %r14
orl $0x80, 0x10(%rbx)
movq 0x50(%rbx), %rsi
testq %rsi, %rsi
jne 0x20be7
movq 0x8(%rbx), %rdi
testb $0x1, %dil
jne 0x20c41
callq 0x30f22
movq %rax, %rsi
movq %rax, 0x50(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2303a
andq $-0x2, %rdi
movq (%rdi), %rdi
jmp 0x20a85
andq $-0x2, %rdi
movq (%rdi), %rdi
jmp 0x20ad4
andq $-0x2, %rdi
movq (%rdi), %rdi
jmp 0x20b07
andq $-0x2, %rdi
movq (%rdi), %rdi
jmp 0x20b3a
andq $-0x2, %rdi
movq (%rdi), %rdi
jmp 0x20b6d
andq $-0x2, %rdi
movq (%rdi), %rdi
jmp 0x20ba9
andq $-0x2, %rdi
movq (%rdi), %rdi
jmp 0x20bdb
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Nes::restore(Rnes::SaveState const&)
void Nes::restore(const SaveState &pb) {
  // date??

  // Dma State
  spriteDmaMode = pb.dma().spritedmamode();
  spriteDmaCycle = pb.dma().spritedmacycle();
  spriteDmaSourceAddr = pb.dma().spritedmasourceaddr();

  // 6502 state.
  cpu->restore(pb.cpu());

  // Audio state.
  apu->restore(pb.apu());

  // PPU state.
  ppu->restore(pb.ppu());

  // Controller state.
  pad->restore(pb.controller());

  // SRAM state.
  cpuMemory->restore(pb.cpumem());
  videoMemory->restore(pb.vidmem());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rsi), %rax
testq %rax, %rax
jne 0x20c67
leaq 0x26eb1(%rip), %rax     # 0x47b18
movb 0x18(%rax), %cl
movb %cl, 0x30(%r14)
movl 0x1c(%rax), %ecx
movl %ecx, 0x34(%r14)
movzwl 0x20(%rax), %eax
movw %ax, 0x38(%r14)
movq 0x50(%r14), %rdi
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
jne 0x20c92
leaq 0x26b76(%rip), %rsi     # 0x47808
callq 0x1c0a8
movq 0x60(%r14), %rdi
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
jne 0x20cab
leaq 0x26c35(%rip), %rsi     # 0x478e0
callq 0x1963a
movq 0x58(%r14), %rdi
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
jne 0x20cc4
leaq 0x26cb4(%rip), %rsi     # 0x47978
callq 0x181ba
movq 0x68(%r14), %rax
movq 0x40(%rbx), %rcx
testq %rcx, %rcx
jne 0x20cdd
leaq 0x26dc3(%rip), %rcx     # 0x47aa0
movb 0x18(%rcx), %dl
movb %dl, 0x8(%rax)
movb 0x1c(%rcx), %cl
movb %cl, 0x9(%rax)
movq 0x70(%r14), %rdi
movq 0x48(%rbx), %rsi
testq %rsi, %rsi
jne 0x20cfd
leaq 0x26dc3(%rip), %rsi     # 0x47ac0
callq 0x22f2a
movq 0x78(%r14), %rdi
movq 0x50(%rbx), %rsi
testq %rsi, %rsi
jne 0x20d16
leaq 0x26dd2(%rip), %rsi     # 0x47ae8
popq %rbx
popq %r14
popq %rbp
jmp 0x231f6
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/nes.cpp
// Function: Rnes::Nes::mapRom(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int Nes::mapRom(const std::string &filename) {
  struct stat stats;
  int fd;
  int result = open(filename.c_str(), O_RDWR);
  if (result == -1) {
    return result;
  }
  fd = result;

  result = fstat(fd, &stats);
  if (result == -1) {
    perror(nullptr);
    return result;
  }

  rom = mmap(nullptr, stats.st_size, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0);
  if (rom == MAP_FAILED) {
    perror(nullptr);
    return -1;
  }
  romSize = stats.st_size;

  close(fd);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdi, %r14
movq (%rsi), %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0xa390
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x20d99
movl %eax, %r15d
leaq -0xb0(%rbp), %rsi
movl %eax, %edi
callq 0xa6a0
cmpl $-0x1, %eax
je 0x20dab
movq -0x80(%rbp), %r12
xorl %edi, %edi
movq %r12, %rsi
movl $0x1, %edx
movl $0x2, %ecx
movl %r15d, %r8d
xorl %r9d, %r9d
callq 0xa760
movq %rax, (%r14)
cmpq $-0x1, %rax
je 0x20dab
movq %r12, 0x8(%r14)
movl %r15d, %edi
callq 0xa1c0
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0xa240
jmp 0x20d99
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/sdl.cpp
// Function: Rnes::Sdl::initDisplay()
int Sdl::initDisplay() {
  window = SDL_CreateWindow("rnes", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, displayWidth,
                            displayHeight, 0);
  renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED);
  texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING,
                              renderWidth, renderHeight);
  SDL_RenderSetLogicalSize(renderer, renderWidth, renderHeight);
  SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
  image = new uint32_t[renderWidth * renderHeight];

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1172e(%rip), %rdi     # 0x33038
movl $0x2fff0000, %esi       # imm = 0x2FFF0000
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
movl $0x400, %ecx            # imm = 0x400
movl $0x3c0, %r8d            # imm = 0x3C0
xorl %r9d, %r9d
callq 0xa340
movq %rax, 0x8(%rbx)
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x6, %edx
callq 0xa320
movq %rax, 0x10(%rbx)
movq %rax, %rdi
movl $0x16362004, %esi       # imm = 0x16362004
movl $0x1, %edx
movl $0x100, %ecx            # imm = 0x100
movl $0xf0, %r8d
callq 0xa2f0
movq %rax, 0x18(%rbx)
movq 0x10(%rbx), %rdi
movl $0x100, %esi            # imm = 0x100
movl $0xf0, %edx
callq 0xa6c0
leaq 0x12cec(%rip), %rdi     # 0x34668
leaq 0x12cfe(%rip), %rsi     # 0x34681
callq 0xa5d0
movl $0x3c000, %edi          # imm = 0x3C000
callq 0xa3b0
movq %rax, 0x20(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/sdl.cpp
// Function: Rnes::Sdl::initAudio()
int Sdl::initAudio() {
  SDL_AudioSpec desired, obtained;

  desired.freq = 44100;
  desired.format = AUDIO_S16SYS;
  desired.channels = 1;
  desired.samples = 2048;
  desired.callback = callback;
  desired.userdata = this;

  if (SDL_OpenAudio(&desired, &obtained) < 0) {
    printf("Fail\n");
    return 1;
  }

  audioFreq = obtained.freq;
  audioBufferSize = obtained.samples;

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq -0x48(%rbp), %rdi
movl $0xac44, (%rdi)         # imm = 0xAC44
movw $0x8010, 0x4(%rdi)      # imm = 0x8010
movb $0x1, 0x6(%rdi)
movw $0x800, 0x8(%rdi)       # imm = 0x800
leaq -0x149(%rip), %rax      # 0x21884
movq %rax, 0x10(%rdi)
movq %rbx, 0x18(%rdi)
leaq -0x28(%rbp), %rsi
callq 0xa150
testl %eax, %eax
js 0x219f3
movl -0x28(%rbp), %eax
movl %eax, 0x48(%rbx)
movzwl -0x20(%rbp), %eax
movl %eax, 0x4c(%rbx)
xorl %eax, %eax
jmp 0x21a04
leaq 0x12c8e(%rip), %rdi     # 0x34688
callq 0xa820
movl $0x1, %eax
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/sdl.cpp
// Function: Rnes::Sdl::Sdl()
Sdl::Sdl() {
  int ret;

  ret = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
  if (ret < 0) {
    return;
  }

  if (initDisplay() < 0) {
    return;
  }

  if (initAudio() < 0) {
    return;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, (%rdi)
movq %rax, 0x28(%rdi)
movw $0x0, 0x30(%rdi)
movl $0x30, %edi
callq 0xa970
testl %eax, %eax
js 0x21a48
movq %rbx, %rdi
callq 0x218fa
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x219a0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/sdl.cpp
// Function: Rnes::Sdl::parseInput()
void Sdl::parseInput() {
  SDL_Event event;
  int button;

  while (SDL_PollEvent(&event)) {
    switch (event.type) {
    case SDL_KEYDOWN:
    case SDL_KEYUP:
      switch (event.key.keysym.sym) {
      case SDLK_UP:
      case SDLK_w:
        button = BUTTON_UP;
        break;
      case SDLK_DOWN:
      case SDLK_s:
        button = BUTTON_DOWN;
        break;
      case SDLK_LEFT:
      case SDLK_a:
        button = BUTTON_LEFT;
        break;
      case SDLK_RIGHT:
      case SDLK_d:
        button = BUTTON_RIGHT;
        break;
      case SDLK_RETURN:
      case SDLK_KP_ENTER:
        button = BUTTON_START;
        break;
      case SDLK_RSHIFT:
      case SDLK_LSHIFT:
        button = BUTTON_SELECT;
        break;
      case SDLK_z:
      case SDLK_n:
        button = BUTTON_A;
        break;
      case SDLK_x:
      case SDLK_m:
        button = BUTTON_B;
        break;
      case SDLK_k:
        button = BUTTON_SAVE;
        break;
      case SDLK_l:
        button = BUTTON_RESTORE;
        break;
      default:
        continue;
      }
      if (event.type == SDL_KEYDOWN) {
        buttonState[button] = true;
      } else {
        buttonState[button] = false;
      }
      break;
    case SDL_QUIT:
      exit(1);
      break;
    default:
      break;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq -0x60(%rbp), %rdi
callq 0xa8b0
testl %eax, %eax
je 0x21be1
leaq 0x12b22(%rip), %r15     # 0x34620
leaq 0x12ae3(%rip), %r12     # 0x345e8
leaq 0x12b34(%rip), %r13     # 0x34640
leaq -0x60(%rbp), %r14
movl -0x60(%rbp), %eax
leal -0x300(%rax), %ecx
cmpl $0x2, %ecx
jae 0x21b46
xorl %ecx, %ecx
movl -0x4c(%rbp), %edx
cmpl $0x4000004e, %edx       # imm = 0x4000004E
jg 0x21b56
leal -0x61(%rdx), %esi
cmpl $0xd, %esi
ja 0x21b72
movslq (%r12,%rsi,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movl $0x8, %ecx
jmp 0x21bc7
cmpl $0x100, %eax            # imm = 0x100
jne 0x21bd1
jmp 0x21bf0
leal -0x4000004f(%rdx), %esi
cmpl $0x9, %esi
ja 0x21b8a
movslq (%r13,%rsi,4), %rdx
addq %r13, %rdx
jmpq *%rdx
movl $0x3, %ecx
jmp 0x21bc7
leal -0x73(%rdx), %esi
cmpl $0x7, %esi
ja 0x21bb6
movslq (%r15,%rsi,4), %rdx
addq %r15, %rdx
jmpq *%rdx
movl $0x1, %ecx
jmp 0x21bc7
cmpl $0x400000e1, %edx       # imm = 0x400000E1
je 0x21b9a
cmpl $0x400000e5, %edx       # imm = 0x400000E5
jne 0x21bd1
movl $0x5, %ecx
jmp 0x21bc7
movl $0x2, %ecx
jmp 0x21bc7
movl $0x6, %ecx
jmp 0x21bc7
movl $0x7, %ecx
jmp 0x21bc7
cmpl $0xd, %edx
jne 0x21bd1
movl $0x4, %ecx
jmp 0x21bc7
movl $0x9, %ecx
cmpl $0x300, %eax            # imm = 0x300
sete 0x28(%rbx,%rcx)
movq %r14, %rdi
callq 0xa8b0
testl %eax, %eax
jne 0x21b10
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0xa4f0
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::MmcNone::MmcNone(std::vector<unsigned char*, std::allocator<unsigned char*>> const&, std::vector<unsigned char*, std::allocator<unsigned char*>> const&, unsigned int, bool)
MmcNone::MmcNone(const std::vector<uint8_t *> &prgRoms, const std::vector<uint8_t *> &chrRoms,
                 uint32_t prgRam, bool vertMirror)
    : progRoms{prgRoms}, charRoms{chrRoms}, numPrgRam{prgRam}, verticalMirror{vertMirror} {
  assert(numPrgRam == 0 || numPrgRam == 1);
  assert(prgRoms.size() <= 2);
  assert(chrRoms.size() <= 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, -0x2c(%rbp)
movl %ecx, %r12d
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x24173(%rip), %rax     # 0x45da0
movq %rax, (%rdi)
leaq 0x8(%rdi), %r13
movq %r13, %rdi
callq 0x22b18
leaq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x22b18
movl %r12d, 0x38(%r14)
movl -0x2c(%rbp), %eax
movb %al, 0x3c(%r14)
cmpl $0x2, %r12d
jae 0x21c82
movq 0x8(%r15), %rax
subq (%r15), %rax
cmpq $0x11, %rax
jae 0x21ca1
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cmpq $0x9, %rax
jae 0x21cc0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12a61(%rip), %rdi     # 0x346ea
leaq 0x12a7b(%rip), %rsi     # 0x3470b
leaq 0x12a7c(%rip), %rcx     # 0x34713
movl $0x3a, %edx
callq 0xa160
leaq 0x12ad2(%rip), %rdi     # 0x3477a
leaq 0x12a5c(%rip), %rsi     # 0x3470b
leaq 0x12a5d(%rip), %rcx     # 0x34713
movl $0x3b, %edx
callq 0xa160
leaq 0x12ac7(%rip), %rdi     # 0x3478e
leaq 0x12a3d(%rip), %rsi     # 0x3470b
leaq 0x12a3e(%rip), %rcx     # 0x34713
movl $0x3c, %edx
callq 0xa160
movq %rax, %rbx
movq (%r13), %rdi
testq %rdi, %rdi
je 0x21cf7
movq 0x18(%r14), %rsi
subq %rdi, %rsi
callq 0xa0e0
movq %rbx, %rdi
callq 0xa4d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::MmcNone::cpuMemRead(unsigned short)
uint8_t MmcNone::cpuMemRead(uint16_t addr) {
  assert(addr >= mmcCpuAddrBase);
  // prg rom 1
  if ((addr >= 0x8000) and (addr < 0x8000 + 0x4000) and (progRoms.size() == 2)) {
    return *(progRoms[0] + addr - 0x8000);
  }
  // prg rom 2
  if ((addr >= 0xc000) and (progRoms.size() >= 1)) {
    if (progRoms.size() == 1) {
      return *(progRoms[0] + addr - 0xc000);
    } else {
      return *(progRoms[1] + addr - 0xc000);
    }
  }
  return 0;
}

// Assembly:
cmpl $0x5fff, %esi           # imm = 0x5FFF
jbe 0x21dfd
movswl %si, %eax
cmpl $0xffffbfff, %eax       # imm = 0xFFFFBFFF
jg 0x21dc4
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rdx
subq %rax, %rdx
movq $-0x8000, %rcx          # imm = 0x8000
cmpq $0x10, %rdx
je 0x21df0
jmp 0x21dfa
movzwl %si, %eax
cmpl $0xc000, %eax           # imm = 0xC000
jb 0x21dfa
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
je 0x21dfa
movq $-0xc000, %rcx          # imm = 0xFFFF4000
cmpq $0x1, %rdx
je 0x21df0
addq $0x8, %rax
movzwl %si, %edx
addq (%rax), %rdx
movb (%rcx,%rdx), %al
retq
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x1299a(%rip), %rdi     # 0x347a2
leaq 0x128fc(%rip), %rsi     # 0x3470b
leaq 0x129de(%rip), %rcx     # 0x347f4
movl $0x44, %edx
callq 0xa160
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc1::cpuMemWrite(unsigned short, unsigned char)
void Mmc1::cpuMemWrite(uint16_t addr, uint8_t val) {
  // shift register writes
  if ((addr >= shiftWriteAddr) and (addr <= shiftWriteAddrLimit)) {
    // initialize shift register when 7th bit is set.
    if (val & (1 << 7)) {
      shiftRegister = shiftInit;
      controlReg |= 0x3 << 2;
      if (debug) {
        std::cerr << "mmc1: control reg reset: " << std::hex << (int)controlReg << std::endl;
      }
    } else {
      uint8_t oldShiftRegister = shiftRegister;
      shiftRegister >>= 1;
      shiftRegister |= (val & 0x1) << 4;
      // lowest bit is set on last write.
      if (oldShiftRegister & 0x1) {
        updateMmcRegister(addr, shiftRegister);
        shiftRegister = shiftInit;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testw %si, %si
js 0x22007
popq %rbp
retq
testb %dl, %dl
js 0x2203f
movb 0x54(%rdi), %al
movl %eax, %ecx
shrb %cl
shlb $0x4, %dl
andb $0x10, %dl
orb %cl, %dl
movb %dl, 0x54(%rdi)
testb $0x1, %al
je 0x22005
movzwl %si, %eax
shrl $0xd, %eax
addl $-0x4, %eax
leaq 0x1266f(%rip), %rcx     # 0x346a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb %dl, 0x50(%rdi)
jmp 0x22056
movb $0x10, 0x54(%rdi)
orb $0xc, 0x50(%rdi)
jmp 0x22005
movb %dl, 0x52(%rdi)
jmp 0x22056
movb %dl, 0x53(%rdi)
jmp 0x22056
movb %dl, 0x51(%rdi)
movb $0x10, 0x54(%rdi)
jmp 0x22005
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc1::cpuMemRead(unsigned short)
uint8_t Mmc1::cpuMemRead(uint16_t addr) {
  assert(addr >= mmcCpuAddrBase);
  // prg rom @ 0x8000
  uint32_t prgRomMode = getPrgRomMode();
  uint8_t bank = prgBank & 0xf;
  if ((addr >= 0x8000) and (addr < 0x8000 + 0x4000)) {
    switch (prgRomMode) {
    case 0:
    case 1:
      return *(progRoms[bank & ~0x1] + addr - 0x8000);
      break;
    case 2:
      return *(progRoms[0] + addr - 0x8000);
      break;
    case 3:
      return *(progRoms[bank] + addr - 0x8000);
      break;
    default:
      assert(0);
      break;
    }
  }
  // prg rom @ 0xc000
  if (addr >= 0xc000) {
    switch (prgRomMode) {
    case 0:
    case 1:
      return *(progRoms[(bank & ~0x1) + 1] + addr - 0xc000);
      break;
    case 2:
      return *(progRoms[bank] + addr - 0xc000);
      break;
    case 3:
      return *(progRoms[progRoms.size() - 1] + addr - 0xc000);
      break;
    default:
      assert(0);
      break;
    }
  }
  return 0;
}

// Assembly:
cmpl $0x5fff, %esi           # imm = 0x5FFF
jbe 0x22109
movl 0x50(%rdi), %r8d
shrl $0x2, %r8d
andl $0x3, %r8d
movzbl 0x53(%rdi), %ecx
movl %ecx, %edx
andl $0xf, %edx
movswl %si, %esi
movzwl %si, %eax
cmpl $0xffffbfff, %esi       # imm = 0xFFFFBFFF
jg 0x2209d
cmpl $0x2, %r8d
jae 0x220b9
andl $0xe, %ecx
shll $0x3, %ecx
addq 0x8(%rdi), %rcx
jmp 0x220bf
cmpl $0xc000, %eax           # imm = 0xC000
jb 0x220c8
cmpb $0x2, %r8b
jae 0x220cb
andb $0xe, %cl
movzbl %cl, %ecx
leal 0x8(,%rcx,8), %ecx
jmp 0x220da
jne 0x220e0
movq 0x8(%rdi), %rcx
movq $-0x8000, %rsi          # imm = 0x8000
jmp 0x22102
xorl %eax, %eax
retq
movzbl %r8b, %ecx
cmpl $0x2, %ecx
jne 0x220f3
movzbl %dl, %ecx
shll $0x3, %ecx
addq 0x8(%rdi), %rcx
jmp 0x220fb
shll $0x3, %edx
addq 0x8(%rdi), %rdx
movq $-0x8000, %rsi          # imm = 0x8000
movq %rdx, %rcx
jmp 0x22102
movq 0x10(%rdi), %rcx
addq $-0x8, %rcx
movq $-0xc000, %rsi          # imm = 0xFFFF4000
addq (%rcx), %rax
movb (%rsi,%rax), %al
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x1268e(%rip), %rdi     # 0x347a2
leaq 0x125f0(%rip), %rsi     # 0x3470b
leaq 0x12783(%rip), %rcx     # 0x348a5
movl $0xb1, %edx
callq 0xa160
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc1::vidMemWrite(unsigned short, unsigned char)
void Mmc1::vidMemWrite(uint16_t addr, uint8_t val) {
  addr = vidAddrTranslate(addr);
  bool chr8kMode = getChrRomMode() == 0;
  if ((charRoms.size() == 0) and (addr < 0x1000)) {
    if (chr8kMode) {
      videoMemory->patternTableMemory[addr] = val;
    } else {
      videoMemory->patternTableMemory[addr + ((chr0Bank & 0x1) ? 0x1000 : 0)] = val;
    }
  } else if ((charRoms.size() == 0) and (addr >= 0x1000) and (addr <= 0x1fff)) {
    if (chr8kMode) {
      videoMemory->patternTableMemory[addr] = val;
    } else {
      videoMemory->patternTableMemory[addr - 0x1000 + ((chr1Bank & 0x1) ? 0x1000 : 0)] = val;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
movq (%rdi), %rax
callq *0x50(%rax)
movb 0x50(%r14), %dl
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdi
cmpq %rsi, %rdi
setne %r8b
movzwl %ax, %ecx
cmpl $0x1000, %ecx           # imm = 0x1000
setae %al
orb %r8b, %al
jne 0x22176
movq 0x48(%r14), %rax
addq $0x8, %rax
testb $0x10, %dl
je 0x221a0
movzbl 0x51(%r14), %edx
jmp 0x221b2
cmpq %rsi, %rdi
setne %al
movl %ecx, %esi
andl $0xf000, %esi           # imm = 0xF000
cmpl $0x1000, %esi           # imm = 0x1000
setne %sil
orb %al, %sil
jne 0x221bf
movq 0x48(%r14), %rax
addq $0x8, %rax
testb $0x10, %dl
jne 0x221a7
movl %ecx, %ecx
addq %rcx, %rax
jmp 0x221bd
addl $0xfffff000, %ecx       # imm = 0xFFFFF000
movzbl 0x52(%r14), %edx
andl $0x1, %edx
shll $0xc, %edx
orl %ecx, %edx
addq %rdx, %rax
movb %bl, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc1::vidMemRead(unsigned short)
uint8_t Mmc1::vidMemRead(uint16_t addr) {
  bool chr8kMode = getChrRomMode() == 0;
  if (charRoms.size() > 0) {
    // chr rom @ 0x0
    if (addr < 0x1000) {
      if (chr8kMode) {
        return *(charRoms[chr0Bank >> 1] + addr);
      } else {
        return *(charRoms[chr0Bank >> 1] + addr + ((chr0Bank & 0x1) ? 0x1000 : 0));
      }
    }
    // chr rom @ 0x1000
    if ((addr >= 0x1000) and (addr <= 0x1fff)) {
      if (chr8kMode) {
        return *(charRoms[chr0Bank >> 1] + addr);
      } else {
        return *(charRoms[chr1Bank >> 1] + addr + ((chr1Bank & 0x1) ? 0x1000 : 0) - 0x1000);
      }
    }
  } else {
    if (chr8kMode) {
      if (addr < 0x2000) {
        return videoMemory->patternTableMemory[addr];
      }
    } else {
      if (addr < 0x1000) {
        return videoMemory->patternTableMemory[addr + (chr0Bank & 0x1) ? 0x1000 : 0];
      }
      if ((addr >= 0x1000) and (addr <= 0x1fff)) {
        return videoMemory->patternTableMemory[addr - 0x1000 + (chr1Bank & 0x1) ? 0x1000 : 0];
      }
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb 0x50(%rdi), %dl
movq 0x20(%rdi), %rcx
cmpq %rcx, 0x28(%rdi)
je 0x22203
movzwl %si, %eax
cmpl $0xfff, %eax            # imm = 0xFFF
ja 0x2221f
movzbl 0x51(%rdi), %esi
movl %esi, %edi
andl $-0x2, %edi
addq (%rcx,%rdi,4), %rax
testb $0x10, %dl
je 0x22298
andl $0x1, %esi
shll $0xc, %esi
addq %rsi, %rax
jmp 0x22298
testb $0x10, %dl
jne 0x22238
movzwl %si, %eax
cmpl $0x1fff, %eax           # imm = 0x1FFF
ja 0x22278
movq 0x48(%rdi), %rcx
addq %rcx, %rax
addq $0x8, %rax
jmp 0x22298
cmpl $0x1fff, %eax           # imm = 0x1FFF
ja 0x22278
testb $0x10, %dl
jne 0x2227c
movzbl 0x51(%rdi), %edx
andl $-0x2, %edx
addq (%rcx,%rdx,4), %rax
jmp 0x22298
movzwl %si, %eax
cmpl $0xfff, %eax            # imm = 0xFFF
ja 0x2224c
movq 0x48(%rdi), %rcx
movzbl 0x51(%rdi), %edx
jmp 0x22260
cmpl $0x1fff, %eax           # imm = 0x1FFF
ja 0x22278
movq 0x48(%rdi), %rcx
addl $0xfffff000, %eax       # imm = 0xFFFFF000
movzbl 0x52(%rdi), %edx
andl $0x1, %edx
xorl %esi, %esi
orl %eax, %edx
setne %sil
shll $0xc, %esi
leaq (%rcx,%rsi), %rax
addq $0x8, %rax
jmp 0x22298
xorl %eax, %eax
jmp 0x2229a
movzbl 0x52(%rdi), %edx
movl %edx, %esi
andl $-0x2, %esi
addq (%rcx,%rsi,4), %rax
andl $0x1, %edx
shll $0xc, %edx
addq %rdx, %rax
addq $-0x1000, %rax          # imm = 0xF000
movb (%rax), %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc1::vidAddrTranslate(unsigned short)
uint16_t Mmc1::vidAddrTranslate(uint16_t addr) {
  uint32_t mirrorMode = getMirroringMode();
  switch (mirrorMode) {
  case 0:
    return translateSingleMirror(addr);
  case 1:
    return translateSingleMirror(addr) + nameTableSize;
  case 2:
    return translateVerticalMirror(addr);
  case 3:
    return translateHorizMirror(addr);
  default:
    assert(0);
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0x50(%rdi), %eax
andl $0x3, %eax
leaq 0x12402(%rip), %rcx     # 0x346b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %esi, %ecx
andl $0xf000, %ecx           # imm = 0xF000
movl %esi, %eax
andl $0x23ff, %eax           # imm = 0x23FF
cmpl $0x2000, %ecx           # imm = 0x2000
cmovnel %esi, %eax
jmp 0x22341
movl %esi, %ecx
andl $0xfc00, %ecx           # imm = 0xFC00
movl %esi, %edx
andl $0x27ff, %edx           # imm = 0x27FF
movl %esi, %eax
andl $0x23ff, %eax           # imm = 0x23FF
cmpl $0x2800, %ecx           # imm = 0x2800
cmovnel %esi, %eax
cmpl $0x2c00, %ecx           # imm = 0x2C00
jmp 0x2231f
movl %esi, %ecx
andl $0xfc00, %ecx           # imm = 0xFC00
movl %esi, %edx
andl $0x23ff, %edx           # imm = 0x23FF
movl %esi, %eax
andl $0x2bff, %eax           # imm = 0x2BFF
cmpl $0x2c00, %ecx           # imm = 0x2C00
cmovnel %esi, %eax
cmpl $0x2400, %ecx           # imm = 0x2400
cmovel %edx, %eax
jmp 0x22341
movl %esi, %ecx
andl $0xf000, %ecx           # imm = 0xF000
movl %esi, %eax
andl $0x23ff, %eax           # imm = 0x23FF
cmpl $0x2000, %ecx           # imm = 0x2000
cmovnel %esi, %eax
addl $0x400, %eax            # imm = 0x400
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc1::save(Rnes::MmcState&)
void Mmc1::save(MmcState &pb) {
  MmcState_Mmc1State *mmc1 = pb.mutable_mmc1();
  mmc1->set_controlreg(controlReg);
  mmc1->set_chr0bank(chr0Bank);
  mmc1->set_chr1bank(chr1Bank);
  mmc1->set_prgbank(prgBank);
  mmc1->set_shiftregister(shiftRegister);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
orb $0x2, 0x10(%rsi)
movq %rdi, %rbx
movq 0x20(%rsi), %rax
testq %rax, %rax
jne 0x22371
movq %rsi, %r14
movq 0x8(%rsi), %rdi
testb $0x1, %dil
jne 0x2239d
callq 0x30bd4
movq %rax, 0x20(%r14)
movzbl 0x50(%rbx), %ecx
movl %ecx, 0x18(%rax)
movzbl 0x51(%rbx), %ecx
movl %ecx, 0x1c(%rax)
movzbl 0x52(%rbx), %ecx
movl %ecx, 0x20(%rax)
movzbl 0x53(%rbx), %ecx
movl %ecx, 0x24(%rax)
movzbl 0x54(%rbx), %ecx
orl $0x1f, 0x10(%rax)
movl %ecx, 0x28(%rax)
popq %rbx
popq %r14
popq %rbp
retq
andq $-0x2, %rdi
movq (%rdi), %rdi
jmp 0x22368
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc1::restore(Rnes::MmcState&)
void Mmc1::restore(MmcState &pb) {
  const MmcState_Mmc1State &mmc1 = pb.mmc1();
  controlReg = mmc1.controlreg();
  chr0Bank = mmc1.chr0bank();
  chr1Bank = mmc1.chr1bank();
  prgBank = mmc1.prgbank();
  shiftRegister = mmc1.shiftregister();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x20(%rsi), %rax
testq %rax, %rax
jne 0x223ba
leaq 0x2564e(%rip), %rax     # 0x47a08
movb 0x18(%rax), %cl
movb %cl, 0x50(%rdi)
movb 0x1c(%rax), %cl
movb %cl, 0x51(%rdi)
movb 0x20(%rax), %cl
movb %cl, 0x52(%rdi)
movb 0x24(%rax), %cl
movb %cl, 0x53(%rdi)
movb 0x28(%rax), %al
movb %al, 0x54(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc3::get1kChrBank(unsigned int)
uint8_t *Mmc3::get1kChrBank(uint32_t bank) {
  if (charRoms.size() == 0) {
    return &videoMemory->patternTableMemory[bank * 1024];
  } else {
    return charRoms[bank >> 3] + (bank & 0x7) * 1024;
  }
}

// Assembly:
movl %esi, %eax
movq 0x20(%rdi), %rcx
cmpq %rcx, 0x28(%rdi)
je 0x22527
pushq %rbp
movq %rsp, %rbp
movl %eax, %edx
andl $-0x8, %edx
andl $0x7, %eax
shll $0xa, %eax
addq (%rcx,%rdx), %rax
popq %rbp
retq
movq 0x48(%rdi), %rcx
shll $0xa, %eax
addq %rcx, %rax
addq $0x8, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc3::cpuMemWrite(unsigned short, unsigned char)
void Mmc3::cpuMemWrite(uint16_t addr, uint8_t val) {
  assert(addr >= mmcCpuAddrBase);

  // mmc control register writes
  if (addr >= 0x8000 and addr <= 0x9fff) {
    if (addr & 0x1) {
      updateBankRegister(val);
    } else {
      bankSelectReg = val;
    }
  } else if (addr >= 0xa000 and addr <= 0xbfff) {
    if (addr & 0x1) {
      prgRamReg = val;
    } else {
      mirrorReg = val;
    }
  } else if (addr >= 0xc000 and addr <= 0xdfff) {
    if (addr & 0x1) {
      irqCounterReg = 0;
    } else {
      irqReloadReg = val;
    }
  } else if (addr >= 0xe000 and addr <= 0xffff) {
    if (addr & 0x1) {
      irqEnabled = true;
    } else {
      irqEnabled = false;
      irqPending = false;
    }
  }
}

// Assembly:
cmpl $0x5fff, %esi           # imm = 0x5FFF
jbe 0x22604
movswl %si, %eax
cmpl $0xffff9fff, %eax       # imm = 0xFFFF9FFF
jg 0x225aa
testb $0x1, %sil
jne 0x225c9
movb %dl, 0x50(%rdi)
retq
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpl $0xc000, %eax           # imm = 0xC000
je 0x225d5
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x225df
testb $0x1, %sil
jne 0x225f6
movb %dl, 0x51(%rdi)
retq
movzbl 0x50(%rdi), %eax
andl $0x7, %eax
movb %dl, 0x53(%rdi,%rax)
retq
testb $0x1, %sil
jne 0x225fa
movb %dl, 0x5b(%rdi)
retq
movzwl %si, %eax
cmpl $0xe000, %eax           # imm = 0xE000
jb 0x225f5
testb $0x1, %sil
jne 0x225ff
movw $0x0, 0x5d(%rdi)
retq
movb %dl, 0x52(%rdi)
retq
movb $0x0, 0x5c(%rdi)
retq
movb $0x1, 0x5d(%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x12193(%rip), %rdi     # 0x347a2
leaq 0x120f5(%rip), %rsi     # 0x3470b
leaq 0x12336(%rip), %rcx     # 0x34953
movl $0x15b, %edx            # imm = 0x15B
callq 0xa160
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc3::cpuMemRead(unsigned short)
uint8_t Mmc3::cpuMemRead(uint16_t addr) {
  assert(addr >= mmcCpuAddrBase);

  // prg rom @ 0x8000
  if ((addr >= 0x8000) and (addr < 0x8000 + 0x2000)) {
    uint8_t bank;
    if (isLowerPrgRomSwappable())
      bank = bankRegister[6];
    else
      bank = get8kPrgBankCount() - 2;
    return *(get8kPrgBank(bank) + addr - 0x8000);
  }
  // prg rom @ 0xa000
  if ((addr >= 0xa000) and (addr < 0xa000 + 0x2000)) {
    uint8_t bank = bankRegister[7];
    return *(get8kPrgBank(bank) + addr - 0xa000);
  }

  // prg rom @ 0xc000
  if ((addr >= 0xc000) and (addr <= 0xdfff)) {
    uint8_t bank;
    if (isLowerPrgRomSwappable())
      bank = get8kPrgBankCount() - 2;
    else
      bank = bankRegister[6];
    return *(get8kPrgBank(bank) + addr - 0xc000);
  }
  // prg rom @ 0xe000
  if ((addr >= 0xe000) and (addr <= 0xffff)) {
    return *(get8kPrgBank(get8kPrgBankCount() - 1) + addr - 0xe000);
  }
  return 0;
}

// Assembly:
cmpl $0x5fff, %esi           # imm = 0x5FFF
jbe 0x2272d
movswl %si, %ecx
movzwl %si, %eax
cmpl $0xffff9fff, %ecx       # imm = 0xFFFF9FFF
jg 0x22651
testb $0x40, 0x50(%rdi)
jne 0x2268a
movb 0x59(%rdi), %cl
movq 0x8(%rdi), %rdx
jmp 0x2269c
andl $0xe000, %esi           # imm = 0xE000
cmpl $0xc000, %esi           # imm = 0xC000
je 0x226b7
cmpl $0xa000, %esi           # imm = 0xA000
jne 0x226d1
movzbl 0x5a(%rdi), %ecx
movq 0x8(%rdi), %rdx
movl %ecx, %esi
andl $0x3e, %esi
andl $0x1, %ecx
shll $0xd, %ecx
addq (%rdx,%rsi,4), %rcx
movq $-0xa000, %rdx          # imm = 0xFFFF6000
jmp 0x22723
movl 0x10(%rdi), %ecx
movq 0x8(%rdi), %rdx
subl %edx, %ecx
shrl $0x2, %ecx
andb $-0x2, %cl
addb $-0x2, %cl
movzbl %cl, %ecx
movl %ecx, %esi
andl $0x3e, %esi
andl $0x1, %ecx
shll $0xd, %ecx
addq (%rdx,%rsi,4), %rcx
movq $-0x8000, %rdx          # imm = 0x8000
jmp 0x22723
testb $0x40, 0x50(%rdi)
jne 0x22703
movl 0x10(%rdi), %ecx
movq 0x8(%rdi), %rdx
subl %edx, %ecx
shrl $0x2, %ecx
andb $-0x2, %cl
addb $-0x2, %cl
jmp 0x2270a
cmpl $0xe000, %eax           # imm = 0xE000
jb 0x2272a
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rsi
subq %rdx, %rsi
shrq $0x2, %rsi
andl $-0x2, %esi
decl %esi
shrl %esi
andl $-0x61, %esi
movl $0x2000, %ecx           # imm = 0x2000
addq (%rdx,%rsi,8), %rcx
movq $-0xe000, %rdx          # imm = 0xFFFF2000
jmp 0x22723
movb 0x59(%rdi), %cl
movq 0x8(%rdi), %rdx
movzbl %cl, %ecx
movl %ecx, %esi
andl $0x3e, %esi
andl $0x1, %ecx
shll $0xd, %ecx
addq (%rdx,%rsi,4), %rcx
movq $-0xc000, %rdx          # imm = 0xFFFF4000
addq %rcx, %rax
movb (%rdx,%rax), %al
retq
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x1206a(%rip), %rdi     # 0x347a2
leaq 0x11fcc(%rip), %rsi     # 0x3470b
leaq 0x12245(%rip), %rcx     # 0x3498b
movl $0x17b, %edx            # imm = 0x17B
callq 0xa160
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc3::notifyScanlineComplete()
void Mmc3::notifyScanlineComplete() {
  if (irqCounterReg == 0) {
    irqCounterReg = irqReloadReg;
  } else {
    irqCounterReg--;
    if (irqCounterReg == 0 and irqEnabled) {
      irqPending = true;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb 0x5c(%rdi), %al
testb %al, %al
je 0x2297c
decb %al
movb %al, 0x5c(%rdi)
jne 0x22982
cmpb $0x1, 0x5d(%rdi)
jne 0x22982
movb $0x1, 0x5e(%rdi)
jmp 0x22982
movb 0x5b(%rdi), %al
movb %al, 0x5c(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/mmc.cpp
// Function: Rnes::Mmc3::save(Rnes::MmcState&)
void Mmc3::save(MmcState &pb) {
  /*
  // internal control registers
  uint8_t bankSelectReg = 1 << 6;
  uint8_t mirrorReg = 0;
  uint8_t prgRamReg = 0;
  uint8_t bankRegister[8] = {0};
  uint8_t irqReloadReg = 0;
  uint8_t irqCounterReg = 0;
  bool irqEnabled = false;
  bool irqPending = false;
  */

  MmcState_Mmc3State *mmc3 = pb.mutable_mmc3();
  mmc3->set_bankselectreg(bankSelectReg);
  mmc3->set_mirrorreg(mirrorReg);
  mmc3->set_prgramreg(prgRamReg);
  mmc3->set_bankregister(bankRegister, bankRegisterCount);
  mmc3->set_irqreloadreg(irqReloadReg);
  mmc3->set_irqcounterreg(irqCounterReg);
  mmc3->set_irqenabled(irqEnabled);
  mmc3->set_irqpending(irqPending);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
orb $0x4, 0x10(%rsi)
movq %rdi, %rbx
movq 0x28(%rsi), %r14
testq %r14, %r14
jne 0x229ca
movq %rsi, %r15
movq 0x8(%rsi), %rdi
testb $0x1, %dil
jne 0x22a83
callq 0x30c3a
movq %rax, %r14
movq %rax, 0x28(%r15)
movzbl 0x50(%rbx), %eax
movl %eax, 0x20(%r14)
movzbl 0x51(%rbx), %eax
movl %eax, 0x24(%r14)
movzbl 0x52(%rbx), %eax
movl %eax, 0x28(%r14)
orl $0xf, 0x10(%r14)
leaq 0x18(%r14), %rdi
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq 0x53(%rbx), %rax
movq %rax, (%r15)
movq $0x8, -0x8(%r15)
movb $0x0, 0x8(%r15)
movq 0x8(%r14), %rsi
testb $0x1, %sil
jne 0x22a7a
movq (%rdi), %rax
cmpq 0x245a5(%rip), %rax     # 0x46fc0
je 0x22a2b
leaq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0xa900
jmp 0x22a34
leaq -0x38(%rbp), %rdx
callq 0x22bf0
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x22a49
movq -0x28(%rbp), %rsi
incq %rsi
callq 0xa0e0
movzbl 0x5b(%rbx), %eax
movl %eax, 0x2c(%r14)
movzbl 0x5c(%rbx), %eax
movl %eax, 0x30(%r14)
movb 0x5d(%rbx), %al
movb %al, 0x34(%r14)
movb 0x5e(%rbx), %al
orl $0xf0, 0x10(%r14)
movb %al, 0x35(%r14)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
andq $-0x2, %rsi
movq (%rsi), %rsi
jmp 0x22a11
andq $-0x2, %rdi
movq (%rdi), %rdi
jmp 0x229be
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x22aa7
movq -0x28(%rbp), %rsi
incq %rsi
callq 0xa0e0
movq %rbx, %rdi
callq 0xa4d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/memory.cpp
// Function: Rnes::CpuMemory::load(unsigned short) const
uint8_t CpuMemory::load(uint16_t addr) const {
  if (addr < cpuSramSize) {
    return cpuSram[addr];
  } else if ((addr >= prgSramBase) and (addr < prgSramBase + prgSramSize) and
             mmc->isPrgSramEnabled()) {
    return prgSram[addr - prgSramBase];
  } else {
    return mmc->cpuMemRead(addr);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0x7ff, %esi            # imm = 0x7FF
ja 0x22d46
movzwl %r14w, %eax
movb 0x8(%rbx,%rax), %al
popq %rbx
popq %r14
popq %rbp
retq
movswl %r14w, %eax
cmpl $0x6000, %eax           # imm = 0x6000
jl 0x22d70
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
testb %al, %al
je 0x22d70
movzwl %r14w, %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movb 0x808(%rbx,%rax), %al
jmp 0x22d41
movq (%rbx), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movzwl %r14w, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O3/mindbeast[P]rnes/memory.cpp
// Function: Rnes::CpuMemory::store(unsigned short, unsigned char)
void CpuMemory::store(uint16_t addr, uint8_t data) {
  if (addr < cpuSramSize) {
    cpuSram[addr] = data;
  } else if ((addr >= prgSramBase) and (addr < prgSramBase + prgSramSize) and
             mmc->isPrgSramWriteable()) {
    prgSram[addr - prgSramBase] = data;
  } else {
    mmc->cpuMemWrite(addr, data);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
cmpl $0x7ff, %esi            # imm = 0x7FF
ja 0x22db2
movzwl %r15w, %eax
movb %bl, 0x8(%r14,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movswl %r15w, %eax
cmpl $0x6000, %eax           # imm = 0x6000
jl 0x22ddd
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
testb %al, %al
je 0x22ddd
movzwl %r15w, %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movb %bl, 0x808(%r14,%rax)
jmp 0x22da7
movq (%r14), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
movzwl %r15w, %esi
movzbl %bl, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%rax