LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Pulse::clockLengthAndSweep()
void Pulse::clockLengthAndSweep() {
  // Length
  if (!isHalted() and lengthCounter) {
    lengthCounter--;
  }
  // Sweep
  if (resetSweepDivider) {
    sweepDivider = getSweepP() + 1;
    resetSweepDivider = false;
  } else {
    if (sweepDivider) {
      sweepDivider--;
    } else {
      if (isSweepEnabled()) {
        sweepDivider = getSweepP() + 1;
        sweepPeriod();
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
callq 0x2ce10
testb $0x1, %al
jne 0x2c264
movq -0x10(%rbp), %rax
cmpb $0x0, 0x11(%rax)
je 0x2c264
movq -0x10(%rbp), %rax
movb 0x11(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x11(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x15(%rax)
je 0x2c28c
movq -0x10(%rbp), %rdi
callq 0x2ce30
movb %al, %cl
movq -0x10(%rbp), %rax
movzbl %cl, %ecx
addl $0x1, %ecx
movb %cl, 0x16(%rax)
movb $0x0, 0x15(%rax)
jmp 0x2c2d3
movq -0x10(%rbp), %rax
cmpb $0x0, 0x16(%rax)
je 0x2c2a5
movq -0x10(%rbp), %rax
movb 0x16(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x16(%rax)
jmp 0x2c2d1
movq -0x10(%rbp), %rdi
callq 0x2ce50
testb $0x1, %al
jne 0x2c2b4
jmp 0x2c2cf
movq -0x10(%rbp), %rdi
callq 0x2ce30
movq -0x10(%rbp), %rdi
movzbl %al, %eax
addl $0x1, %eax
movb %al, 0x16(%rdi)
callq 0x2bea0
jmp 0x2c2d1
jmp 0x2c2d3
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Triangle::save(Rnes::TriangleState&)
void Triangle::save(TriangleState &pb) {
  // length logic
  pb.set_lengthcounter(lengthCounter);

  // linear counter logic
  pb.set_linearcounterhalt(linearCounterHalt);
  pb.set_linearcounter(linearCounter);

  // current sample
  pb.set_currentsample(currentSample);

  // timer
  pb.set_timerdivider(timerDivider);

  // sequencer offset
  pb.set_sequenceroffset(sequencerOffset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movzbl 0x28(%rax), %esi
callq 0x2cea0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movb 0x29(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x2ced0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzbl 0x2a(%rax), %esi
callq 0x2cf00
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzbl 0x2b(%rax), %esi
callq 0x2cf30
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movl 0x2c(%rax), %esi
callq 0x2cf60
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movl 0x30(%rax), %esi
callq 0x2cf90
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Triangle::restore(Rnes::TriangleState const&)
void Triangle::restore(const TriangleState &pb) {
  lengthCounter = pb.lengthcounter();
  linearCounterHalt = pb.linearcounterhalt();
  linearCounter = pb.linearcounter();

  currentSample = pb.currentsample();
  timerDivider = pb.timerdivider();

  sequencerOffset = pb.sequenceroffset();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2cfc0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0x28(%rax)
movq -0x10(%rbp), %rdi
callq 0x2cfe0
movb %al, %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x29(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d000
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0x2a(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d020
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0x2b(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d040
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d060
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Triangle::clockLinearCounter()
void Triangle::clockLinearCounter() {
  if (linearCounterHalt) {
    linearCounter = getLinearCounterReload();
  } else if (linearCounter) {
    linearCounter--;
  }
  if (!getControlFlag()) {
    linearCounterHalt = false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
testb $0x1, 0x29(%rax)
je 0x2c51e
movq -0x10(%rbp), %rdi
callq 0x2d0b0
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x2a(%rax)
jmp 0x2c537
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2a(%rax)
je 0x2c535
movq -0x10(%rbp), %rax
movb 0x2a(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x2a(%rax)
jmp 0x2c537
movq -0x10(%rbp), %rdi
callq 0x2d0d0
testb $0x1, %al
jne 0x2c54c
movq -0x10(%rbp), %rax
movb $0x0, 0x29(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Noise::getNextShiftReg(unsigned short) const
uint16_t Noise::getNextShiftReg(uint16_t reg) const {
  uint16_t newBit = 0;
  if (isShortMode()) {
    newBit = (0x1 & ((reg) ^ (reg >> 6))) << 14;
  } else {
    newBit = (0x1 & ((reg) ^ (reg >> 1))) << 14;
  }
  return newBit | (reg >> 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movw $0x0, -0xc(%rbp)
callq 0x2d150
testb $0x1, %al
jne 0x2c628
jmp 0x2c641
movzwl -0xa(%rbp), %eax
movzwl -0xa(%rbp), %ecx
sarl $0x6, %ecx
xorl %ecx, %eax
andl $0x1, %eax
shll $0xe, %eax
movw %ax, -0xc(%rbp)
jmp 0x2c657
movzwl -0xa(%rbp), %eax
movzwl -0xa(%rbp), %ecx
sarl %ecx
xorl %ecx, %eax
andl $0x1, %eax
shll $0xe, %eax
movw %ax, -0xc(%rbp)
movzwl -0xc(%rbp), %eax
movzwl -0xa(%rbp), %ecx
sarl %ecx
orl %ecx, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Noise::getVolume() const
uint8_t Noise::getVolume() const {
  if (isDisabled()) {
    return getEnvelopeN();
  } else {
    return envelope;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x2d180
testb $0x1, %al
jne 0x2c68f
jmp 0x2c69d
movq -0x18(%rbp), %rdi
callq 0x2d1a0
movb %al, -0x1(%rbp)
jmp 0x2c6a7
movq -0x18(%rbp), %rax
movb 0xc(%rax), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Noise::envelopeDividerClock()
void Noise::envelopeDividerClock() {
  if (envelope) {
    envelope--;
  } else if (isEnvelopeLoopSet()) {
    envelope = 15;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpb $0x0, 0xc(%rax)
je 0x2c6d9
movq -0x10(%rbp), %rax
movb 0xc(%rax), %cl
addb $-0x1, %cl
movb %cl, 0xc(%rax)
jmp 0x2c6f2
movq -0x10(%rbp), %rdi
callq 0x2d1c0
testb $0x1, %al
jne 0x2c6e8
jmp 0x2c6f0
movq -0x10(%rbp), %rax
movb $0xf, 0xc(%rax)
jmp 0x2c6f2
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Noise::getCurrentSample() const
uint8_t Noise::getCurrentSample() const {
  if (!currentSample) {
    return 0;
  }
  if (!isNonZeroLength()) {
    return 0;
  }
  return getVolume();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpb $0x0, 0xf(%rax)
jne 0x2c720
movb $0x0, -0x1(%rbp)
jmp 0x2c73f
movq -0x18(%rbp), %rdi
callq 0x27850
testb $0x1, %al
jne 0x2c733
movb $0x0, -0x1(%rbp)
jmp 0x2c73f
movq -0x18(%rbp), %rdi
callq 0x2c670
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Noise::save(Rnes::NoiseState&)
void Noise::save(NoiseState &pb) {
  // length logic
  pb.set_lengthcounter(lengthCounter);

  // noise shift register
  pb.set_shiftregister(shiftRegister);

  // envelope logic
  pb.set_envelope(envelope);
  pb.set_envelopedivider(envelopeDivider);
  pb.set_resetenvelopeanddivider(resetEnvelopeAndDivider);

  // current sample
  pb.set_currentsample(currentSample);

  // timer
  pb.set_timerdivider(timerDivider);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movzbl 0x8(%rax), %esi
callq 0x2d1e0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzwl 0xa(%rax), %esi
callq 0x2d210
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzbl 0xc(%rax), %esi
callq 0x2d240
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzbl 0xd(%rax), %esi
callq 0x2d270
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movb 0xe(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x2d2a0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzbl 0xf(%rax), %esi
callq 0x2d2d0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movl 0x10(%rax), %esi
callq 0x2d300
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/apuunit.cpp
// Function: Rnes::Noise::restore(Rnes::NoiseState const&)
void Noise::restore(const NoiseState &pb) {
  lengthCounter = pb.lengthcounter();
  shiftRegister = pb.shiftregister();
  envelope = pb.envelope();
  envelopeDivider = pb.envelopedivider();
  resetEnvelopeAndDivider = pb.resetenvelopeanddivider();
  currentSample = pb.currentsample();
  timerDivider = pb.timerdivider();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2d330
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d350
movl %eax, %ecx
movq -0x18(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d370
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d390
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0xd(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d3b0
movb %al, %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0xe(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d3d0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0xf(%rax)
movq -0x10(%rbp), %rdi
callq 0x2d3f0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::setZeroAndNeg(unsigned char)
void Cpu::setZeroAndNeg(uint8_t val) {
  if (val == 0) {
    setFlag(ZERO);
  } else {
    clearFlag(ZERO);
  }
  if (val & (1 << 7)) {
    setFlag(NEGATIVE);
  } else {
    clearFlag(NEGATIVE);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jne 0x2deb3
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x2de00
jmp 0x2dec1
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x2de20
movzbl -0x9(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2dedf
movq -0x18(%rbp), %rdi
movl $0x80, %esi
callq 0x2de00
jmp 0x2deed
movq -0x18(%rbp), %rdi
movl $0x80, %esi
callq 0x2de20
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::relativeBranchPenalty(unsigned short, unsigned short)
void Cpu::relativeBranchPenalty(uint16_t start, uint16_t end) {
  // one cycle penalty if dst of branch is same page
  if ((start & 0xff00) == (end & 0xff00)) {
    cycle++;
  }
  // two if not
  else {
    cycle += 2;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %dx, %ax
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movw %ax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
movzwl -0xc(%rbp), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
cmpl %ecx, %eax
jne 0x2dfd7
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
jmp 0x2dfe7
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x2, %rcx
movq %rcx, 0x10(%rax)
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::doInt()
uint32_t Cpu::doInt() {
  pushStack((uint8_t)(pc >> 8));
  pushStack((uint8_t)pc);
  pushStack(status);
  setFlag(INT_DISABLE);
  pc = load(irqBaseAddr) | ((uint16_t)load(irqBaseAddr + 1) << 8);
  cycle += 7;
  return 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
movzwl 0xc(%rdi), %eax
sarl $0x8, %eax
movzbl %al, %esi
callq 0x2df00
movq -0x10(%rbp), %rdi
movw 0xc(%rdi), %ax
movzbl %al, %esi
callq 0x2df00
movq -0x10(%rbp), %rax
movq %rax, %rdi
movzbl 0x18(%rax), %esi
callq 0x2df00
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x2de00
movq -0x10(%rbp), %rdi
movl $0xfffe, %esi           # imm = 0xFFFE
callq 0x2dd90
movq -0x10(%rbp), %rdi
movzbl %al, %eax
movl %eax, -0x14(%rbp)
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x2dd90
movl -0x14(%rbp), %ecx
movb %al, %dl
movq -0x10(%rbp), %rax
movzbl %dl, %edx
movzwl %dx, %edx
shll $0x8, %edx
orl %edx, %ecx
movw %cx, 0xc(%rax)
movq 0x10(%rax), %rcx
addq $0x7, %rcx
movq %rcx, 0x10(%rax)
movl $0x7, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::adcInst(unsigned short)
void Cpu::adcInst(uint16_t addr) {
  uint8_t v = load(addr);
  uint16_t result = a + v + (getFlag(CARRY) ? 1 : 0);
  if (result & (1u << 8)) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
  if (isNeg((uint8_t)result) && isPos(a) && isPos(v)) {
    setFlag(OVERFL);
  } else if (isPos((uint8_t)result) && isNeg((a) && isNeg(v))) {
    setFlag(OVERFL);
  } else {
    clearFlag(OVERFL);
  }
  a = (uint8_t)result;
  setZeroAndNeg(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movzwl -0xa(%rbp), %esi
callq 0x2dd90
movq -0x20(%rbp), %rdi
movb %al, -0xb(%rbp)
movzbl 0x8(%rdi), %eax
movzbl -0xb(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x14(%rbp)
movl $0x1, %esi
callq 0x2de50
movb %al, %sil
movl -0x14(%rbp), %eax
xorl %ecx, %ecx
movl $0x1, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
addl %ecx, %eax
movw %ax, -0xe(%rbp)
movzwl -0xe(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x2e20a
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2e218
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
movw -0xe(%rbp), %ax
movzbl %al, %edi
callq 0x2e2e0
testb $0x1, %al
jne 0x2e22a
jmp 0x2e25c
movq -0x20(%rbp), %rax
movzbl 0x8(%rax), %edi
callq 0x2e310
testb $0x1, %al
jne 0x2e23d
jmp 0x2e25c
movzbl -0xb(%rbp), %edi
callq 0x2e310
testb $0x1, %al
jne 0x2e24c
jmp 0x2e25c
movq -0x20(%rbp), %rdi
movl $0x40, %esi
callq 0x2de00
jmp 0x2e2bc
movw -0xe(%rbp), %ax
movzbl %al, %edi
callq 0x2e310
testb $0x1, %al
jne 0x2e26e
jmp 0x2e2ac
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, 0x8(%rcx)
movb %al, -0x21(%rbp)
je 0x2e289
movzbl -0xb(%rbp), %edi
callq 0x2e2e0
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %edi
callq 0x2e2e0
testb $0x1, %al
jne 0x2e29c
jmp 0x2e2ac
movq -0x20(%rbp), %rdi
movl $0x40, %esi
callq 0x2de00
jmp 0x2e2ba
movq -0x20(%rbp), %rdi
movl $0x40, %esi
callq 0x2de20
jmp 0x2e2bc
movq -0x20(%rbp), %rax
movw -0xe(%rbp), %cx
movb %cl, 0x8(%rax)
movq %rax, %rdi
movzbl 0x8(%rax), %esi
callq 0x2de80
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: isNeg(unsigned char)
static bool isNeg(uint8_t val) {
  if (val & (1 << 7)) {
    return true;
  } else {
    return false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x2(%rbp)
movzbl -0x2(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2e2fe
movb $0x1, -0x1(%rbp)
jmp 0x2e302
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::aslInstMem(unsigned short)
void Cpu::aslInstMem(uint16_t addr) {
  uint8_t src = load(addr);
  uint8_t result = src << 1;
  store(addr, result);
  setZeroAndNeg(result);
  if (src & (1 << 7)) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzwl -0xa(%rbp), %esi
callq 0x2dd90
movq -0x18(%rbp), %rdi
movb %al, -0xb(%rbp)
movzbl -0xb(%rbp), %eax
shll %eax
movb %al, -0xc(%rbp)
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xc(%rbp), %edx
callq 0x2ddc0
movq -0x18(%rbp), %rdi
movzbl -0xc(%rbp), %esi
callq 0x2de80
movzbl -0xb(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2e3af
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2e3bd
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::aslInstReg(unsigned short)
void Cpu::aslInstReg(uint16_t addr) {
  if (a & (1 << 7)) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }

  a <<= 1;
  setZeroAndNeg(a);
}

// 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)
movzbl 0x8(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2e409
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2e417
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %ecx
shll %ecx
movb %cl, 0x8(%rax)
movq %rax, %rdi
movzbl 0x8(%rax), %esi
callq 0x2de80
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::bitInst(unsigned short)
void Cpu::bitInst(uint16_t addr) {
  uint8_t v = load(addr);
  bool zero = (a & v) == 0;
  if (zero) {
    setFlag(ZERO);
  } else {
    clearFlag(ZERO);
  }
  if (v & (1 << 7)) {
    setFlag(NEGATIVE);
  } else {
    clearFlag(NEGATIVE);
  }
  if (v & (1 << 6)) {
    setFlag(OVERFL);
  } else {
    clearFlag(OVERFL);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzwl -0xa(%rbp), %esi
callq 0x2dd90
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, -0xb(%rbp)
movzbl 0x8(%rax), %eax
movzbl -0xb(%rbp), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movb %al, -0xc(%rbp)
testb $0x1, -0xc(%rbp)
je 0x2e618
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x2de00
jmp 0x2e626
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x2de20
movzbl -0xb(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2e644
movq -0x18(%rbp), %rdi
movl $0x80, %esi
callq 0x2de00
jmp 0x2e652
movq -0x18(%rbp), %rdi
movl $0x80, %esi
callq 0x2de20
movzbl -0xb(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x2e66e
movq -0x18(%rbp), %rdi
movl $0x40, %esi
callq 0x2de00
jmp 0x2e67c
movq -0x18(%rbp), %rdi
movl $0x40, %esi
callq 0x2de20
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::brkInst(unsigned short)
void Cpu::brkInst(uint16_t) {
  pc++;
  pushStack((uint8_t)(pc >> 8));
  pushStack((uint8_t)pc);
  pushStack(status | BREAK);

  pc = load(irqBaseAddr) | ((uint16_t)load(irqBaseAddr + 1) << 8);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movw 0xc(%rdi), %ax
addw $0x1, %ax
movw %ax, 0xc(%rdi)
movzwl 0xc(%rdi), %eax
sarl $0x8, %eax
movzbl %al, %esi
callq 0x2df00
movq -0x18(%rbp), %rdi
movw 0xc(%rdi), %ax
movzbl %al, %esi
callq 0x2df00
movq -0x18(%rbp), %rdi
movzbl 0x18(%rdi), %eax
orl $0x10, %eax
movzbl %al, %esi
callq 0x2df00
movq -0x18(%rbp), %rdi
movl $0xfffe, %esi           # imm = 0xFFFE
callq 0x2dd90
movq -0x18(%rbp), %rdi
movzbl %al, %eax
movl %eax, -0x1c(%rbp)
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x2dd90
movl -0x1c(%rbp), %ecx
movb %al, %dl
movq -0x18(%rbp), %rax
movzbl %dl, %edx
movzwl %dx, %edx
shll $0x8, %edx
orl %edx, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::cmp(unsigned short, unsigned char)
void Cpu::cmp(uint16_t addr, uint8_t val) {
  uint8_t v = load(addr);
  uint8_t result;
  result = val - v;
  setZeroAndNeg(result);
  if (val >= v) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movb %al, -0xb(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzwl -0xa(%rbp), %esi
callq 0x2dd90
movq -0x18(%rbp), %rdi
movb %al, -0xc(%rbp)
movzbl -0xb(%rbp), %eax
movzbl -0xc(%rbp), %ecx
subl %ecx, %eax
movb %al, -0xd(%rbp)
movzbl -0xd(%rbp), %esi
callq 0x2de80
movzbl -0xb(%rbp), %eax
movzbl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jl 0x2e9d2
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2e9e0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::jsrInst(unsigned short)
void Cpu::jsrInst(uint16_t addr) {
  uint16_t pcm = pc - 1;
  pushStack((uint8_t)(pcm >> 8));
  pushStack((uint8_t)pcm);
  pc = addr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzwl 0xc(%rdi), %eax
subl $0x1, %eax
movw %ax, -0xc(%rbp)
movzwl -0xc(%rbp), %eax
sarl $0x8, %eax
movzbl %al, %esi
callq 0x2df00
movq -0x18(%rbp), %rdi
movw -0xc(%rbp), %ax
movzbl %al, %esi
callq 0x2df00
movq -0x18(%rbp), %rax
movw -0xa(%rbp), %cx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::rtsInst(unsigned short)
void Cpu::rtsInst(uint16_t) {
  uint16_t newpc;
  newpc = popStack();
  newpc |= (uint16_t)popStack() << 8;
  newpc++;
  pc = newpc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x2df50
movq -0x18(%rbp), %rdi
movzbl %al, %eax
movw %ax, -0xc(%rbp)
callq 0x2df50
movb %al, %cl
movq -0x18(%rbp), %rax
movzbl %cl, %ecx
movzwl %cx, %edx
shll $0x8, %edx
movzwl -0xc(%rbp), %ecx
orl %edx, %ecx
movw %cx, -0xc(%rbp)
movw -0xc(%rbp), %cx
addw $0x1, %cx
movw %cx, -0xc(%rbp)
movw -0xc(%rbp), %cx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::lsrInstMem(unsigned short)
void Cpu::lsrInstMem(uint16_t addr) {
  uint8_t t = load(addr);
  uint8_t result = t >> 1;
  setZeroAndNeg(result);
  if (t & 1) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
  store(addr, result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzwl -0xa(%rbp), %esi
callq 0x2dd90
movq -0x18(%rbp), %rdi
movb %al, -0xb(%rbp)
movzbl -0xb(%rbp), %eax
sarl %eax
movb %al, -0xc(%rbp)
movzbl -0xc(%rbp), %esi
callq 0x2de80
movzbl -0xb(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2f639
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2f647
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
movq -0x18(%rbp), %rdi
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xc(%rbp), %edx
callq 0x2ddc0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::lsrInstReg(unsigned short)
void Cpu::lsrInstReg(uint16_t) {
  uint8_t result = a >> 1;
  setZeroAndNeg(result);
  if (a & 1) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
  a = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzbl 0x8(%rdi), %eax
sarl %eax
movb %al, -0xb(%rbp)
movzbl -0xb(%rbp), %esi
callq 0x2de80
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2f6bd
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2f6cb
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
movq -0x18(%rbp), %rax
movb -0xb(%rbp), %cl
movb %cl, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::rolInstReg(unsigned short)
void Cpu::rolInstReg(uint16_t) {
  uint8_t result = a << 1 | (getFlag(CARRY) ? 1 : 0);
  if (a & (1 << 7)) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
  a = result;
  setZeroAndNeg(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzbl 0x8(%rdi), %eax
shll %eax
movl %eax, -0x1c(%rbp)
movl $0x1, %esi
callq 0x2de50
movl -0x1c(%rbp), %ecx
movb %al, %dil
movq -0x18(%rbp), %rax
xorl %edx, %edx
movl $0x1, %esi
testb $0x1, %dil
cmovnel %esi, %edx
orl %edx, %ecx
movb %cl, -0xb(%rbp)
movzbl 0x8(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2f899
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2f8a7
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
movq -0x18(%rbp), %rax
movb -0xb(%rbp), %cl
movb %cl, 0x8(%rax)
movq %rax, %rdi
movzbl 0x8(%rax), %esi
callq 0x2de80
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::rolInstMem(unsigned short)
void Cpu::rolInstMem(uint16_t addr) {
  uint8_t t = load(addr);
  uint8_t result = (t << 1) | (getFlag(CARRY) ? 1 : 0);
  if (t & (1 << 7)) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
  store(addr, result);
  setZeroAndNeg(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzwl -0xa(%rbp), %esi
callq 0x2dd90
movq -0x18(%rbp), %rdi
movb %al, -0xb(%rbp)
movzbl -0xb(%rbp), %eax
shll %eax
movl %eax, -0x10(%rbp)
movl $0x1, %esi
callq 0x2de50
movb %al, %sil
movl -0x10(%rbp), %eax
xorl %ecx, %ecx
movl $0x1, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
orl %ecx, %eax
movb %al, -0xc(%rbp)
movzbl -0xb(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2f945
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2f953
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
movq -0x18(%rbp), %rdi
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xc(%rbp), %edx
callq 0x2ddc0
movq -0x18(%rbp), %rdi
movzbl -0xc(%rbp), %esi
callq 0x2de80
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::rorInstReg(unsigned short)
void Cpu::rorInstReg(uint16_t) {
  uint8_t result = (a >> 1) | (getFlag(CARRY) ? 1u << 7 : 0);
  if (a & 1) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
  a = result;
  setZeroAndNeg(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzbl 0x8(%rdi), %eax
sarl %eax
movl %eax, -0x1c(%rbp)
movl $0x1, %esi
callq 0x2de50
movl -0x1c(%rbp), %ecx
movb %al, %dil
movq -0x18(%rbp), %rax
xorl %edx, %edx
movl $0x80, %esi
testb $0x1, %dil
cmovnel %esi, %edx
orl %edx, %ecx
movb %cl, -0xb(%rbp)
movzbl 0x8(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2f9e7
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2f9f5
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
movq -0x18(%rbp), %rax
movb -0xb(%rbp), %cl
movb %cl, 0x8(%rax)
movq %rax, %rdi
movzbl 0x8(%rax), %esi
callq 0x2de80
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::rorInstMem(unsigned short)
void Cpu::rorInstMem(uint16_t addr) {
  uint8_t t = load(addr);
  uint8_t result = (t >> 1) | (getFlag(CARRY) ? 1u << 7 : 0);
  if (t & 1) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
  store(addr, result);
  setZeroAndNeg(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzwl -0xa(%rbp), %esi
callq 0x2dd90
movq -0x18(%rbp), %rdi
movb %al, -0xb(%rbp)
movzbl -0xb(%rbp), %eax
sarl %eax
movl %eax, -0x10(%rbp)
movl $0x1, %esi
callq 0x2de50
movb %al, %sil
movl -0x10(%rbp), %eax
xorl %ecx, %ecx
movl $0x80, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
orl %ecx, %eax
movb %al, -0xc(%rbp)
movzbl -0xb(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2fa93
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2faa1
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
movq -0x18(%rbp), %rdi
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xc(%rbp), %edx
callq 0x2ddc0
movq -0x18(%rbp), %rdi
movzbl -0xc(%rbp), %esi
callq 0x2de80
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::rtiInst(unsigned short)
void Cpu::rtiInst(uint16_t) {
  uint16_t targetPc;
  status = (popStack() & ~BREAK) | ONE;

  targetPc = popStack();
  targetPc |= ((uint16_t)popStack() << 8);
  pc = targetPc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x2df50
movq -0x18(%rbp), %rdi
movzbl %al, %eax
andl $-0x11, %eax
orl $0x20, %eax
movb %al, 0x18(%rdi)
callq 0x2df50
movq -0x18(%rbp), %rdi
movzbl %al, %eax
movw %ax, -0xc(%rbp)
callq 0x2df50
movb %al, %cl
movq -0x18(%rbp), %rax
movzbl %cl, %ecx
movzwl %cx, %edx
shll $0x8, %edx
movzwl -0xc(%rbp), %ecx
orl %edx, %ecx
movw %cx, -0xc(%rbp)
movw -0xc(%rbp), %cx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::sbcInst(unsigned short)
void Cpu::sbcInst(uint16_t addr) {
  uint8_t v = load(addr);
  int16_t sresult = (int16_t)(int8_t)a - (int16_t)(int8_t)v - (getFlag(CARRY) ? 0 : 1);
  int16_t uresult = (int16_t)a - (int16_t)v - (getFlag(CARRY) ? 0 : 1);

  if (uresult >= 0) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
  if (sresult > 127 || sresult < -128) {
    setFlag(OVERFL);
  } else {
    clearFlag(OVERFL);
  }
  a = (uint8_t)uresult;
  setZeroAndNeg(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movzwl -0xa(%rbp), %esi
callq 0x2dd90
movq -0x20(%rbp), %rdi
movb %al, -0xb(%rbp)
movsbl 0x8(%rdi), %eax
cwtl
movsbl -0xb(%rbp), %ecx
movswl %cx, %ecx
subl %ecx, %eax
movl %eax, -0x18(%rbp)
movl $0x1, %esi
callq 0x2de50
movq -0x20(%rbp), %rdi
movb %al, %sil
movl -0x18(%rbp), %eax
movl $0x1, %ecx
xorl %edx, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
subl %ecx, %eax
movw %ax, -0xe(%rbp)
movzbl 0x8(%rdi), %eax
cwtl
movzbl -0xb(%rbp), %ecx
movswl %cx, %ecx
subl %ecx, %eax
movl %eax, -0x14(%rbp)
movl $0x1, %esi
callq 0x2de50
movb %al, %sil
movl -0x14(%rbp), %eax
movl $0x1, %ecx
xorl %edx, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
subl %ecx, %eax
movw %ax, -0x10(%rbp)
movswl -0x10(%rbp), %eax
cmpl $0x0, %eax
jl 0x2fbf2
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2fc00
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
movswl -0xe(%rbp), %eax
cmpl $0x7f, %eax
jg 0x2fc12
movswl -0xe(%rbp), %eax
cmpl $-0x80, %eax
jge 0x2fc22
movq -0x20(%rbp), %rdi
movl $0x40, %esi
callq 0x2de00
jmp 0x2fc30
movq -0x20(%rbp), %rdi
movl $0x40, %esi
callq 0x2de20
movq -0x20(%rbp), %rax
movw -0x10(%rbp), %cx
movb %cl, 0x8(%rax)
movq %rax, %rdi
movzbl 0x8(%rax), %esi
callq 0x2de80
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::dcpInst(unsigned short)
void Cpu::dcpInst(uint16_t addr) {
  uint8_t result = load(addr) - 1;
  // setZeroAndNeg(result);
  store(addr, result);
  if (x >= result) {
    setFlag(CARRY);
  } else {
    clearFlag(CARRY);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movzwl -0xa(%rbp), %esi
callq 0x2dd90
movq -0x18(%rbp), %rdi
movzbl %al, %eax
subl $0x1, %eax
movb %al, -0xb(%rbp)
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xb(%rbp), %edx
callq 0x2ddc0
movq -0x18(%rbp), %rax
movzbl 0x9(%rax), %eax
movzbl -0xb(%rbp), %ecx
cmpl %ecx, %eax
jl 0x2fcb1
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de00
jmp 0x2fcbf
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2de20
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::runInst()
uint32_t Cpu::runInst() {
  // check for nmi
  if (nmiRequested()) {
    return doNmi();
  }
  // check for lower priority maskable interrupts
  if (intRequested() && !getFlag(INT_DISABLE)) {
    return doInt();
  }

  // load opcode using current pc
  uint8_t opcode = load(pc);

  // look up instruction in the table
  auto itr = instTable.find(opcode);
  if (itr == instTable.end()) {
    assert(0);
    return 0;
  }

  // run the instruction
  const Instruction &ins = itr->second;
  (this->*(ins.func))(ins);

  // update the cycle count
  cycle += ins.cycles;
  return ins.cycles;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x38(%rbp)
callq 0x2e010
testb $0x1, %al
jne 0x2ff1f
jmp 0x2ff30
movq -0x38(%rbp), %rdi
callq 0x2e0e0
movl %eax, -0x4(%rbp)
jmp 0x3004f
movq -0x38(%rbp), %rdi
callq 0x2dff0
testb $0x1, %al
jne 0x2ff3f
jmp 0x2ff62
movq -0x38(%rbp), %rdi
movl $0x4, %esi
callq 0x2de50
testb $0x1, %al
jne 0x2ff62
movq -0x38(%rbp), %rdi
callq 0x2e030
movl %eax, -0x4(%rbp)
jmp 0x3004f
movq -0x38(%rbp), %rax
movq %rax, %rdi
movzwl 0xc(%rax), %esi
callq 0x2dd90
movb %al, -0x11(%rbp)
leaq 0x62aa4(%rip), %rdi     # 0x92a20
leaq -0x11(%rbp), %rsi
callq 0x39b30
movq %rax, -0x20(%rbp)
leaq 0x62a90(%rip), %rdi     # 0x92a20
callq 0x39b90
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x39b60
testb $0x1, %al
jne 0x2ffac
jmp 0x2ffcb
leaq 0x38516(%rip), %rdi     # 0x684c9
leaq 0x3996f(%rip), %rsi     # 0x69929
movl $0x3c7, %edx            # imm = 0x3C7
leaq 0x3996b(%rip), %rcx     # 0x69931
callq 0xe240
leaq -0x20(%rbp), %rdi
callq 0x39bc0
movq -0x38(%rbp), %rcx
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdx
movq 0x28(%rdx), %rax
movq %rax, -0x48(%rbp)
movq 0x30(%rdx), %rdx
addq %rdx, %rcx
movq %rcx, -0x40(%rbp)
andq $0x1, %rax
cmpq $0x0, %rax
je 0x3001a
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x50(%rbp)
jmp 0x30022
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rax
movq -0x30(%rbp), %rsi
callq *%rax
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movzwl 0x20(%rcx), %ecx
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movzwl 0x20(%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::reset()
void Cpu::reset() {
  setFlag(INT_DISABLE);
  setFlag(ONE);
  pc = load16(resetBaseAddr);
  sp = stackPointerStart;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
movl $0x4, %esi
callq 0x2de00
movq -0x10(%rbp), %rdi
movl $0x20, %esi
callq 0x2de00
movq -0x10(%rbp), %rdi
movl $0xfffc, %esi           # imm = 0xFFFC
callq 0x2dd30
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
movb $-0x3, 0xe(%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::dumpRegs()
void Cpu::dumpRegs() {
  using namespace std;
  cerr << setfill('0') << right;
  cerr << "A:" << setw(2) << (int)a << " ";
  cerr << "X:" << setw(2) << (int)x << " ";
  cerr << "Y:" << setw(2) << (int)y << " ";
  cerr << "P:" << setw(2) << (int)status << " ";
  cerr << "SP:" << setw(2) << (int)sp << " ";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, %edi
callq 0x39bf0
movb %al, -0x9(%rbp)
movq 0x61f10(%rip), %rdi     # 0x91fe8
movzbl -0x9(%rbp), %esi
callq 0xe7b0
movq %rax, %rdi
leaq 0x9b25(%rip), %rsi      # 0x39c10
callq 0xed20
movq 0x61ef1(%rip), %rdi     # 0x91fe8
leaq 0x39851(%rip), %rsi     # 0x6994f
callq 0xe680
movq %rax, -0x50(%rbp)
movl $0x2, %edi
callq 0x39c40
movq -0x50(%rbp), %rdi
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
callq 0xe5f0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movzbl 0x8(%rax), %esi
callq 0xe440
movq %rax, %rdi
leaq 0x39824(%rip), %rsi     # 0x6995e
callq 0xe680
movq 0x61ea2(%rip), %rdi     # 0x91fe8
leaq 0x39805(%rip), %rsi     # 0x69952
callq 0xe680
movq %rax, -0x48(%rbp)
movl $0x2, %edi
callq 0x39c40
movq -0x48(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0xe5f0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movzbl 0x9(%rax), %esi
callq 0xe440
movq %rax, %rdi
leaq 0x397d5(%rip), %rsi     # 0x6995e
callq 0xe680
movq 0x61e53(%rip), %rdi     # 0x91fe8
leaq 0x397b9(%rip), %rsi     # 0x69955
callq 0xe680
movq %rax, -0x40(%rbp)
movl $0x2, %edi
callq 0x39c40
movq -0x40(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0xe5f0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movzbl 0xa(%rax), %esi
callq 0xe440
movq %rax, %rdi
leaq 0x39786(%rip), %rsi     # 0x6995e
callq 0xe680
movq 0x61e04(%rip), %rdi     # 0x91fe8
leaq 0x3976e(%rip), %rsi     # 0x69959
callq 0xe680
movq %rax, -0x38(%rbp)
movl $0x2, %edi
callq 0x39c40
movq -0x38(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
callq 0xe5f0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movzbl 0x18(%rax), %esi
callq 0xe440
movq %rax, %rdi
leaq 0x39737(%rip), %rsi     # 0x6995e
callq 0xe680
movq 0x61db5(%rip), %rdi     # 0x91fe8
leaq 0x3971e(%rip), %rsi     # 0x69958
callq 0xe680
movq %rax, -0x30(%rbp)
movl $0x2, %edi
callq 0x39c40
movq -0x30(%rbp), %rdi
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
callq 0xe5f0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movzbl 0xe(%rax), %esi
callq 0xe440
movq %rax, %rdi
leaq 0x396e8(%rip), %rsi     # 0x6995e
callq 0xe680
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::dumpInstructionBytes(int)
void Cpu::dumpInstructionBytes(int bytes) {
  using namespace std;
  cerr << setfill('0') << right;
  for (int i = 0; i < bytes; i++) {
    cerr << setw(2) << uppercase << (int)load(pc + i) << " ";
  }
  for (int i = 0; i < maxInstLength - bytes; i++) {
    cerr << "   ";
  }
  cerr << " ";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, %edi
callq 0x39bf0
movb %al, -0xd(%rbp)
movq 0x61c7d(%rip), %rdi     # 0x91fe8
movzbl -0xd(%rbp), %esi
callq 0xe7b0
movq %rax, %rdi
leaq 0x9892(%rip), %rsi      # 0x39c10
callq 0xed20
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x303fa
movl $0x2, %edi
callq 0x39c40
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
movq 0x61c3f(%rip), %rdi     # 0x91fe8
callq 0xe5f0
movq %rax, %rdi
leaq 0x98d8(%rip), %rsi      # 0x39c90
callq 0xed20
movq -0x28(%rbp), %rdi
movq %rax, -0x30(%rbp)
movzwl 0xc(%rdi), %eax
addl -0x14(%rbp), %eax
movzwl %ax, %esi
callq 0x2dd90
movq -0x30(%rbp), %rdi
movzbl %al, %esi
callq 0xe440
movq %rax, %rdi
leaq 0x39574(%rip), %rsi     # 0x6995e
callq 0xe680
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3038a
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl $0x3, %ecx
subl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jge 0x3042e
movq 0x61bd1(%rip), %rdi     # 0x91fe8
leaq 0x3953e(%rip), %rsi     # 0x6995c
callq 0xe680
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x30401
movq 0x61bb3(%rip), %rdi     # 0x91fe8
leaq 0x39522(%rip), %rsi     # 0x6995e
callq 0xe680
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::save(Rnes::CpuState&)
void Cpu::save(CpuState &pb) {
  // Registers
  pb.set_a(a);
  pb.set_x(x);
  pb.set_y(y);

  // Program counter
  pb.set_pc(pc);

  // stack pointer
  pb.set_sp(sp);

  // cycle count
  pb.set_cycle(cycle);

  // processor status register
  pb.set_status(status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movzbl 0x8(%rax), %esi
callq 0x39cf0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzbl 0x9(%rax), %esi
callq 0x39d20
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzbl 0xa(%rax), %esi
callq 0x39d50
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzwl 0xc(%rax), %esi
callq 0x39d80
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzbl 0xe(%rax), %esi
callq 0x39db0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movq 0x10(%rax), %rsi
callq 0x39de0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movzbl 0x18(%rax), %esi
callq 0x39e10
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::restore(Rnes::CpuState const&)
void Cpu::restore(const CpuState &pb) {
  // Registers
  a = pb.a();
  x = pb.x();
  y = pb.y();

  // Program counter
  pc = pb.pc();

  // stack pointer
  sp = pb.sp();

  // cycle count
  cycle = pb.cycle();

  // processor status register
  status = pb.status();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x39e40
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x39e60
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0x9(%rax)
movq -0x10(%rbp), %rdi
callq 0x39e80
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0xa(%rax)
movq -0x10(%rbp), %rdi
callq 0x39ea0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x39ec0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0xe(%rax)
movq -0x10(%rbp), %rdi
callq 0x39ee0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x39f00
movl %eax, %ecx
movq -0x18(%rbp), %rax
movb %cl, 0x18(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: mindbeast[P]rnes/cpu.cpp
// Function: Rnes::Cpu::Cpu(Rnes::Nes*)
Cpu::Cpu(Nes *system) {
  a = 0;
  x = 0;
  y = 0;
  pc = 0;
  status = 0;
  sp = 0;
  cycle = 0;
  nes = system;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0x8(%rax)
movb $0x0, 0x9(%rax)
movb $0x0, 0xa(%rax)
movw $0x0, 0xc(%rax)
movb $0x0, 0x18(%rax)
movb $0x0, 0xe(%rax)
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: void Rnes::Cpu::zeroPageFormat<&Rnes::Cpu::oraInst(unsigned short)>(Rnes::Cpu::Instruction const&)
void Cpu::zeroPageFormat(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;
    instTrace(str.str(), 2);
  }
  pc += 2;
  (this->*fx)((uint16_t)load(zeroPageAddr));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, -0x12(%rbp)
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
xorl %eax, %eax
testb $0x1, %al
jne 0x323f6
jmp 0x32412
movq -0x20(%rbp), %rax
movq (%rax), %rax
leaq -0x2d04(%rip), %rcx     # 0x2f700
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x28(%rbp)
jmp 0x3241f
leaq -0x2d19(%rip), %rax     # 0x2f700
movq %rax, -0x28(%rbp)
jmp 0x3241f
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movzwl -0x12(%rbp), %esi
callq 0x2dd90
movq -0x20(%rbp), %rdi
movb %al, %cl
movq -0x30(%rbp), %rax
movzbl %cl, %ecx
movzwl %cx, %esi
callq *%rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: void Rnes::Cpu::immediateFormat<&Rnes::Cpu::oraInst(unsigned short)>(Rnes::Cpu::Instruction const&)
void Cpu::immediateFormat(const Instruction &ins) {
  uint16_t immediateAddr = pc + 1;

  if (debug) {
    int immed = load(immediateAddr);
    std::stringstream str;
    str << std::setfill('0') << std::right;
    str << ins.nemonic << " #$" << std::hex << std::uppercase << std::setw(2) << immed;
    instTrace(str.str(), 2);
  }
  pc += 2;
  (this->*fx)(immediateAddr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, -0x12(%rbp)
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
xorl %eax, %eax
testb $0x1, %al
jne 0x32596
jmp 0x325b2
movq -0x20(%rbp), %rax
movq (%rax), %rax
leaq -0x2ea4(%rip), %rcx     # 0x2f700
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x28(%rbp)
jmp 0x325bf
leaq -0x2eb9(%rip), %rax     # 0x2f700
movq %rax, -0x28(%rbp)
jmp 0x325bf
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movzwl -0x12(%rbp), %esi
callq *%rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: mindbeast[P]rnes/cpu.cpp
// Function: void Rnes::Cpu::absoluteFormat<&Rnes::Cpu::oraInst(unsigned short)>(Rnes::Cpu::Instruction const&)
void Cpu::absoluteFormat(const Instruction &ins) {
  uint16_t immediateAddr = pc + 1;
  uint16_t absAddr = load(immediateAddr);
  absAddr |= ((uint16_t)load(immediateAddr + 1)) << 8;

  if (debug) {
    int immed = load16(immediateAddr);
    std::stringstream str;
    str << std::setfill('0') << std::right;
    str << ins.nemonic << " $" << std::hex << std::uppercase << std::setw(4) << immed;
    instTrace(str.str(), 3);
  }
  pc += 3;
  (this->*fx)(absAddr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movzwl 0xc(%rdi), %eax
addl $0x1, %eax
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %esi
callq 0x2dd90
movq -0x20(%rbp), %rdi
movzbl %al, %eax
movw %ax, -0x14(%rbp)
movzwl -0x12(%rbp), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x2dd90
movb %al, %cl
movq -0x20(%rbp), %rax
movzbl %cl, %ecx
movzwl %cx, %edx
shll $0x8, %edx
movzwl -0x14(%rbp), %ecx
orl %edx, %ecx
movw %cx, -0x14(%rbp)
movzwl 0xc(%rax), %ecx
addl $0x3, %ecx
movw %cx, 0xc(%rax)
xorl %eax, %eax
testb $0x1, %al
jne 0x326f2
jmp 0x3270e
movq -0x20(%rbp), %rax
movq (%rax), %rax
leaq -0x3000(%rip), %rcx     # 0x2f700
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x28(%rbp)
jmp 0x3271b
leaq -0x3015(%rip), %rax     # 0x2f700
movq %rax, -0x28(%rbp)
jmp 0x3271b
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movzwl -0x14(%rbp), %esi
callq *%rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: mindbeast[P]rnes/cpu.cpp
// Function: void Rnes::Cpu::relativeFormat<&Rnes::Cpu::bplInst(unsigned short)>(Rnes::Cpu::Instruction const&)
void Cpu::relativeFormat(const Instruction &ins) {
  uint16_t immedAddr = pc + 1;
  int8_t relativeAddr = load(immedAddr);

  if (debug) {
    std::stringstream str;
    str << std::setfill('0') << std::right;
    str << ins.nemonic << " $" << std::hex << std::uppercase << std::setw(4)
        << relativeAddr + pc + 2;
    instTrace(str.str(), 2);
  }
  pc += 2;

  (this->*fx)((int16_t)relativeAddr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movzwl 0xc(%rdi), %eax
addl $0x1, %eax
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %esi
callq 0x2dd90
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x13(%rbp)
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
xorl %eax, %eax
testb $0x1, %al
jne 0x32828
jmp 0x32844
movq -0x20(%rbp), %rax
movq (%rax), %rax
leaq -0x4146(%rip), %rcx     # 0x2e6f0
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x28(%rbp)
jmp 0x32851
leaq -0x415b(%rip), %rax     # 0x2e6f0
movq %rax, -0x28(%rbp)
jmp 0x32851
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movsbl -0x13(%rbp), %ecx
movzwl %cx, %esi
callq *%rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)