LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: sc0ty[P]CODExtract/src/codfile/codfile.cpp
// Function: CODFile::getDescription[abi:cxx11]()
string CODFile::getDescription()
{
    if (!isOpen) throw "Load file first";

    // find resource with name
    CODResource *r = FindResource(CODRESTDescription);

    // can't find
    if (r == NULL) throw "No Description in resources";

    return *( new string(r->getData()+2, r->getReversedU16(0)) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
testb $0x1, 0x48(%rax)
jne 0x5050
movl $0x8, %edi
callq 0x3110
movq %rax, %rdi
leaq 0x2177(%rip), %rax      # 0x71b4
movq %rax, (%rdi)
movq 0x4f81(%rip), %rsi      # 0x9fc8
xorl %eax, %eax
movl %eax, %edx
callq 0x33e0
movq -0x30(%rbp), %rdi
movl $0x3, %esi
callq 0x4b50
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5090
movl $0x8, %edi
callq 0x3110
movq %rax, %rdi
leaq 0x2183(%rip), %rax      # 0x7200
movq %rax, (%rdi)
movq 0x4f41(%rip), %rsi      # 0x9fc8
xorl %eax, %eax
movl %eax, %edx
callq 0x33e0
movl $0x20, %edi
callq 0x3210
movq %rax, -0x50(%rbp)
movb $0x1, -0x26(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6240
movq %rax, -0x48(%rbp)
jmp 0x50b1
movq -0x48(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x6280
movw %ax, -0x52(%rbp)
jmp 0x50ce
movw -0x52(%rbp), %ax
movzwl %ax, %eax
movq %rax, -0x70(%rbp)
leaq -0x25(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x3400
movq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
callq 0x32a0
jmp 0x50fd
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %rdi
movb $0x0, -0x26(%rbp)
callq 0x30d0
jmp 0x5110
leaq -0x25(%rbp), %rdi
callq 0x3260
movq -0x38(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x5146
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x25(%rbp), %rdi
callq 0x3260
testb $0x1, -0x26(%rbp)
jne 0x514e
jmp 0x515c
movq -0x50(%rbp), %rdi
movl $0x20, %esi
callq 0x3220
jmp 0x515e
movq -0x20(%rbp), %rdi
callq 0x33f0
nopw (%rax,%rax)
// File: sc0ty[P]CODExtract/src/codfile/codfile.cpp
// Function: CODFile::getVendor[abi:cxx11]()
string CODFile::getVendor()
{
    if (!isOpen) throw "Load file first";

    // find resource with name
    CODResource *r = FindResource(CODRESTVendor);

    // can't find
    if (r == NULL) throw "No Vendor in resources";

    return *( new string(r->getData()+2, r->getReversedU16(0)) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
testb $0x1, 0x48(%rax)
jne 0x51c0
movl $0x8, %edi
callq 0x3110
movq %rax, %rdi
leaq 0x2007(%rip), %rax      # 0x71b4
movq %rax, (%rdi)
movq 0x4e11(%rip), %rsi      # 0x9fc8
xorl %eax, %eax
movl %eax, %edx
callq 0x33e0
movq -0x30(%rbp), %rdi
movl $0x4, %esi
callq 0x4b50
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5200
movl $0x8, %edi
callq 0x3110
movq %rax, %rdi
leaq 0x202f(%rip), %rax      # 0x721c
movq %rax, (%rdi)
movq 0x4dd1(%rip), %rsi      # 0x9fc8
xorl %eax, %eax
movl %eax, %edx
callq 0x33e0
movl $0x20, %edi
callq 0x3210
movq %rax, -0x50(%rbp)
movb $0x1, -0x26(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6240
movq %rax, -0x48(%rbp)
jmp 0x5221
movq -0x48(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x6280
movw %ax, -0x52(%rbp)
jmp 0x523e
movw -0x52(%rbp), %ax
movzwl %ax, %eax
movq %rax, -0x70(%rbp)
leaq -0x25(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x3400
movq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
callq 0x32a0
jmp 0x526d
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %rdi
movb $0x0, -0x26(%rbp)
callq 0x30d0
jmp 0x5280
leaq -0x25(%rbp), %rdi
callq 0x3260
movq -0x38(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x52b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x25(%rbp), %rdi
callq 0x3260
testb $0x1, -0x26(%rbp)
jne 0x52be
jmp 0x52cc
movq -0x50(%rbp), %rdi
movl $0x20, %esi
callq 0x3220
jmp 0x52ce
movq -0x20(%rbp), %rdi
callq 0x33f0
nopw (%rax,%rax)
// File: sc0ty[P]CODExtract/src/codfile/codfile.cpp
// Function: CODFile::getIcon(unsigned short&)
char *CODFile::getIcon(u16 &size)
{
    if (!isOpen) throw "Load file first";

    // find resource with icon
    CODResource *r = FindResource(CODRESTIcon);

    // can't find
    if (r == NULL) return NULL;

    size = r->getReversedU16(2);
    return r->getData() + 4;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
testb $0x1, 0x48(%rax)
jne 0x5325
movl $0x8, %edi
callq 0x3110
movq %rax, %rdi
leaq 0x1ea2(%rip), %rax      # 0x71b4
movq %rax, (%rdi)
movq 0x4cac(%rip), %rsi      # 0x9fc8
xorl %eax, %eax
movl %eax, %edx
callq 0x33e0
movq -0x28(%rbp), %rdi
movl $0x5, %esi
callq 0x4b50
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5348
movq $0x0, -0x8(%rbp)
jmp 0x5371
movq -0x20(%rbp), %rdi
movl $0x2, %esi
callq 0x6280
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
movq -0x20(%rbp), %rdi
callq 0x6240
addq $0x4, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sc0ty[P]CODExtract/src/codfile/codresource.cpp
// Function: CODResource::getReversedU16(unsigned short)
u16 CODResource::getReversedU16(u16 offset)
{
    // sanity check
    if (offset+1 >= size) throw "Exceeded end of resource data";

    // get two bytes from data
    u8 b1 = data[offset];
    u8 b2 = data[offset + 1];

    // revers byte order and return
    return (u16)(b1 * 256 + b2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
addl $0x1, %eax
movzwl 0x8(%rcx), %ecx
cmpl %ecx, %eax
jl 0x62d1
movl $0x8, %edi
callq 0x3110
movq %rax, %rdi
leaq 0xfa8(%rip), %rax       # 0x7266
movq %rax, (%rdi)
movq 0x3d00(%rip), %rsi      # 0x9fc8
xorl %eax, %eax
movl %eax, %edx
callq 0x33e0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movzwl -0xa(%rbp), %edx
movb (%rcx,%rdx), %cl
movb %cl, -0xb(%rbp)
movq 0x10(%rax), %rax
movzwl -0xa(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0xc(%rbp)
movzbl -0xb(%rbp), %eax
shll $0x8, %eax
movzbl -0xc(%rbp), %ecx
addl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
// File: mikeakohn[P]cloudtari/build/../src/DebugTimer.h
// Function: DebugTimer::DebugTimer()
DebugTimer() :
    start_address{-1},
    end_address{-1},
    cycles{0},
    running{0}
  {
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movl $0x0, 0x8(%rax)
movb $0x0, 0xc(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/GifCompressor.cxx
// Function: GifCompressor::GifCompressor()
GifCompressor::GifCompressor() : gif_length{0}
{
  data_length = 65536;
  data = (uint8_t *)malloc(data_length);

  memset(data, 0, data_length);

  memset(&gif_header, 0, sizeof(gif_header));
  memcpy(gif_header.version, "GIF87a", 6);
  memcpy(data, "GIF87a", 6);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, 0x1c(%rax)
movl $0x10000, 0x18(%rax)    # imm = 0x10000
movslq 0x18(%rax), %rdi
callq 0x4320
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rax), %rdi
movslq 0x18(%rax), %rdx
xorl %esi, %esi
callq 0x4170
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0xe, %edx
callq 0x4170
movq -0x10(%rbp), %rax
movl 0x9b04(%rip), %ecx      # 0xf443
movl %ecx, (%rax)
movw 0x9aff(%rip), %cx       # 0xf447
movw %cx, 0x4(%rax)
movq 0x10(%rax), %rax
movl 0x9aed(%rip), %ecx      # 0xf443
movl %ecx, (%rax)
movw 0x9ae8(%rip), %cx       # 0xf447
movw %cx, 0x4(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: mikeakohn[P]cloudtari/build/../src/GifCompressor.cxx
// Function: GifCompressor::compute_bits_per_pixel(int)
int GifCompressor::compute_bits_per_pixel(int max_colors)
{
  uint8_t counts[16] =
  {
    0, 1, 2, 2, 3, 3, 3, 3,
    4, 4, 4, 4, 4, 4, 4, 4,
  };

  max_colors -= 1;

  int upper = counts[max_colors >> 4];
  int lower = counts[max_colors & 0xf];

  if (upper != 0) { return upper + 4; }
  if (lower == 0) { lower = 1; }

  return lower;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq 0x914e(%rip), %rax      # 0xf450
movq %rax, -0x30(%rbp)
movq 0x914b(%rip), %rax      # 0xf458
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
sarl $0x4, %eax
cltq
movzbl -0x30(%rbp,%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %eax
andl $0xf, %eax
cltq
movzbl -0x30(%rbp,%rax), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x634b
movl -0x34(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x4(%rbp)
jmp 0x635e
cmpl $0x0, -0x38(%rbp)
jne 0x6358
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: mikeakohn[P]cloudtari/build/../src/GifCompressor.h
// Function: GifCompressor::BitStream::get_byte()
uint8_t get_byte()
    {
      uint8_t next = data & 0xff;
      data = data >> 8;
      bitptr -= 8;
      return next;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
andl $0xff, %ecx
movb %cl, -0x9(%rbp)
movl (%rax), %ecx
shrl $0x8, %ecx
movl %ecx, (%rax)
movl 0x4(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x4(%rax)
movb -0x9(%rbp), %al
popq %rbp
retq
nopl (%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.cxx
// Function: M6502::M6502()
M6502::M6502() :
  running{true},
  reg_a{0},
  reg_x{0},
  reg_y{0},
  total_cycles{0},
  total_instructions{0},
  breakpoint{0xffff},
  debug{false}
{
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movb $0x1, 0x8(%rdi)
movl $0x0, 0xc(%rdi)
movl $0x0, 0x10(%rdi)
movl $0x0, 0x14(%rdi)
movl $0x0, 0x1c(%rdi)
movl $0x0, 0x20(%rdi)
movl $0xffff, 0x24(%rdi)     # imm = 0xFFFF
movb $0x0, 0x28(%rdi)
addq $0x29, %rdi
callq 0x83b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.cxx
// Function: M6502::reset()
void M6502::reset()
{
  reg_a = 0;
  reg_x = 0;
  reg_y = 0;

  pc = memory_bus->read16(0xfffc);
  sp = 0xff;
  total_cycles = 0;
  total_instructions = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, 0xc(%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x14(%rax)
movq (%rax), %rdi
movl $0xfffc, %esi           # imm = 0xFFFC
callq 0x83d0
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x18(%rax)
movw $0xff, 0x1a(%rax)
movl $0x0, 0x1c(%rax)
movl $0x0, 0x20(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.cxx
// Function: M6502::dump()
void M6502::dump()
{
  printf(" PC: 0x%04x, SP: 0x%04x, A: 0x%02x, X: 0x%02x, Y: 0x%02x\n",
    pc, sp, reg_a, reg_x, reg_y);
  printf(" N V B * D I Z C\n");
  printf(" %d %d %d %d %d %d %d %d\n",
    status.n,
    status.v,
    status.b,
    status.one,
    status.d,
    status.i,
    status.z,
    status.c);
  printf(" total_instructions=%d\n", total_instructions);
  printf(" total_cycles=%d\n", total_cycles);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movzwl 0x18(%rax), %esi
movzwl 0x1a(%rax), %edx
movl 0xc(%rax), %ecx
movl 0x10(%rax), %r8d
movl 0x14(%rax), %r9d
leaq 0x92fe(%rip), %rdi      # 0xf85c
movb $0x0, %al
callq 0x4050
leaq 0x932a(%rip), %rdi      # 0xf896
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movb 0x29(%rax), %cl
shrb $0x7, %cl
movzbl %cl, %esi
movb 0x29(%rax), %cl
shrb $0x6, %cl
andb $0x1, %cl
movzbl %cl, %edx
movb 0x29(%rax), %cl
shrb $0x4, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movb 0x29(%rax), %dil
shrb $0x5, %dil
andb $0x1, %dil
movzbl %dil, %r8d
movb 0x29(%rax), %dil
shrb $0x3, %dil
andb $0x1, %dil
movzbl %dil, %r9d
movb 0x29(%rax), %dil
shrb $0x2, %dil
andb $0x1, %dil
movzbl %dil, %r11d
movb 0x29(%rax), %dil
shrb %dil
andb $0x1, %dil
movzbl %dil, %r10d
movb 0x29(%rax), %al
andb $0x1, %al
movzbl %al, %eax
leaq 0x92c2(%rip), %rdi      # 0xf8a8
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movl 0x20(%rax), %esi
leaq 0x92ba(%rip), %rdi      # 0xf8c2
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %esi
leaq 0x92bd(%rip), %rdi      # 0xf8da
movb $0x0, %al
callq 0x4050
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.cxx
// Function: M6502::step()
int M6502::step()
{
  int cycles = execute_instruction();

  total_cycles += cycles;
  total_instructions++;

  return cycles;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x66b0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, -0xc(%rbp)
movl -0xc(%rbp), %ecx
addl 0x1c(%rax), %ecx
movl %ecx, 0x1c(%rax)
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::read_indirect_x(int&)
int read_indirect_x(int &address)
  {
    int m;
    m = memory_bus->read(pc++) + reg_x;
    m = memory_bus->read16(m & 0xff);
    address = m;
    return memory_bus->read(m);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq (%rcx), %rdi
movw 0x18(%rcx), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, 0x18(%rcx)
movzwl %ax, %esi
callq 0x9710
movb %al, %cl
movq -0x20(%rbp), %rax
movzbl %cl, %ecx
addl 0x10(%rax), %ecx
movl %ecx, -0x14(%rbp)
movq (%rax), %rdi
movl -0x14(%rbp), %esi
andl $0xff, %esi
callq 0x83d0
movw %ax, %cx
movq -0x20(%rbp), %rax
movzwl %cx, %ecx
movl %ecx, -0x14(%rbp)
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rcx
movl %edx, (%rcx)
movq (%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x9710
movzbl %al, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::set_flags(int&)
void set_flags(int &data)
  {
    status.c = (data & 0x100) != 0;
    data &= 0xff;

    status.z = data == 0;
    status.n = (data & 0x80) != 0;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x100, %ecx            # imm = 0x100
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movq -0x10(%rbp), %rcx
movl (%rcx), %edx
andl $0xff, %edx
movl %edx, (%rcx)
movq -0x10(%rbp), %rcx
cmpl $0x0, (%rcx)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x80, %ecx
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x7, %dl
andb $0x7f, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::read_absolute(int&)
int read_absolute(int &address)
  {
    int m = memory_bus->read16(pc);
    address = m;
    pc += 2;
    return memory_bus->read(m);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq (%rax), %rdi
movzwl 0x18(%rax), %esi
callq 0x83d0
movw %ax, %cx
movq -0x20(%rbp), %rax
movzwl %cx, %ecx
movl %ecx, -0x14(%rbp)
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rcx
movl %edx, (%rcx)
movzwl 0x18(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x18(%rax)
movq (%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x9710
movzbl %al, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::read_indirect_y(int&, int&)
int read_indirect_y(int &address, int &address_before)
  {
    int m;
    m = memory_bus->read(pc++);
    m = memory_bus->read16(m);
    address_before = m;
    m += reg_y;
    m = m & 0xffff;
    address = m;
    return memory_bus->read(m);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movq (%rcx), %rdi
movw 0x18(%rcx), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, 0x18(%rcx)
movzwl %ax, %esi
callq 0x9710
movb %al, %cl
movq -0x28(%rbp), %rax
movzbl %cl, %ecx
movl %ecx, -0x1c(%rbp)
movq (%rax), %rdi
movl -0x1c(%rbp), %esi
callq 0x83d0
movw %ax, %cx
movq -0x28(%rbp), %rax
movzwl %cx, %ecx
movl %ecx, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
movq -0x18(%rbp), %rcx
movl %edx, (%rcx)
movl 0x14(%rax), %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
movl %ecx, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
movq -0x10(%rbp), %rcx
movl %edx, (%rcx)
movq (%rax), %rdi
movl -0x1c(%rbp), %esi
callq 0x9710
movzbl %al, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::read_zero_page_x(int&)
int read_zero_page_x(int &address)
  {
    int m;
    m = memory_bus->read(pc++) + reg_x;
    m = m & 0xff;
    address = m;
    return memory_bus->read(m);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq (%rcx), %rdi
movw 0x18(%rcx), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, 0x18(%rcx)
movzwl %ax, %esi
callq 0x9710
movb %al, %cl
movq -0x20(%rbp), %rax
movzbl %cl, %ecx
addl 0x10(%rax), %ecx
movl %ecx, -0x14(%rbp)
movl -0x14(%rbp), %ecx
andl $0xff, %ecx
movl %ecx, -0x14(%rbp)
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rcx
movl %edx, (%rcx)
movq (%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x9710
movzbl %al, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::read_absolute_y(int&, int&)
int read_absolute_y(int &address, int &address_before)
  {
    int m = memory_bus->read16(pc);
    address_before = m;
    m += reg_y;
    address = m;
    pc += 2;
    return memory_bus->read(m);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq (%rax), %rdi
movzwl 0x18(%rax), %esi
callq 0x83d0
movw %ax, %cx
movq -0x28(%rbp), %rax
movzwl %cx, %ecx
movl %ecx, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
movq -0x18(%rbp), %rcx
movl %edx, (%rcx)
movl 0x14(%rax), %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
movq -0x10(%rbp), %rcx
movl %edx, (%rcx)
movzwl 0x18(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x18(%rax)
movq (%rax), %rdi
movl -0x1c(%rbp), %esi
callq 0x9710
movzbl %al, %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::run_bit(int)
void run_bit(int data)
  {
    data = data & reg_a;
    status.z = data == 0;
    status.n = (data & 0x80) != 0;
    status.v = (data & 0x40) != 0;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
andl 0xc(%rax), %ecx
movl %ecx, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0xc(%rbp), %ecx
andl $0x80, %ecx
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x7, %dl
andb $0x7f, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0xc(%rbp), %ecx
andl $0x40, %ecx
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x6, %dl
andb $-0x41, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::run_rol_memory(int, int)
void run_rol_memory(int address, int data)
  {
    int c = status.c;
    data = data << 1;
    set_flags(data);
    data |= c;
    status.z = data == 0;
    memory_bus->write(address, data);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movb 0x29(%rdi), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
shll %eax
movl %eax, -0x10(%rbp)
leaq -0x10(%rbp), %rsi
callq 0x8620
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
orl -0x10(%rbp), %ecx
movl %ecx, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %eax
movzbl %al, %edx
callq 0x97e0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::run_ror_memory(int, int)
void run_ror_memory(int address, int data)
  {
    int c = status.c;
    status.c = data & 1;
    data = data >> 1;
    data |= c << 7;
    status.z = data == 0;
    status.n = (data & 0x80) != 0;
    memory_bus->write(address, data);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb 0x29(%rax), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, -0x14(%rbp)
movl -0x10(%rbp), %ecx
andl $0x1, %ecx
movb %cl, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0x10(%rbp), %ecx
sarl %ecx
movl %ecx, -0x10(%rbp)
movl -0x14(%rbp), %ecx
shll $0x7, %ecx
orl -0x10(%rbp), %ecx
movl %ecx, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0x10(%rbp), %ecx
andl $0x80, %ecx
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x7, %dl
andb $0x7f, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %eax
movzbl %al, %edx
callq 0x97e0
addq $0x20, %rsp
popq %rbp
retq
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::run_lsr_memory(int, int)
void run_lsr_memory(int address, int data)
  {
    status.c = data & 1;
    data = (data >> 1) & 0xff;
    status.z = data == 0;
    status.n = (data & 0x80) != 0;
    memory_bus->write(address, data);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
andl $0x1, %ecx
movb %cl, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0x10(%rbp), %ecx
sarl %ecx
andl $0xff, %ecx
movl %ecx, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0x10(%rbp), %ecx
andl $0x80, %ecx
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x7, %dl
andb $0x7f, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %eax
movzbl %al, %edx
callq 0x97e0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::run_adc(int)
void run_adc(int data)
  {
    if (status.d == 0)
    {
      reg_a = reg_a + data + status.c;

      status.c = reg_a > 0xff;
      reg_a &= 0xff;
      status.z = reg_a == 0;
      status.n = (reg_a & 0x80) != 0;
      status.v = status.c ^ status.n;
    }
      else
    {
      int d0 = data & 0xf;
      int d1 = data >> 4;
      int a0 = reg_a & 0xf;
      int a1 = reg_a >> 4;

      a0 = a0 + d0 + status.c;

      if (a0 > 10)
      {
        a1 += a0 / 10;
        a0 = a0 % 10;
      }

      a1 = a1 + d1;

      status.c = a1 / 10 > 0;
      a1 = a1 % 10;

      reg_a = ((a1 << 4) | a0) & 0xff;
      status.z = reg_a == 0;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movb 0x29(%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x8d3f
movq -0x28(%rbp), %rax
movl 0xc(%rax), %ecx
addl -0xc(%rbp), %ecx
movb 0x29(%rax), %dl
andb $0x1, %dl
movzbl %dl, %edx
addl %edx, %ecx
movl %ecx, 0xc(%rax)
cmpl $0xff, 0xc(%rax)
setg %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl 0xc(%rax), %ecx
andl $0xff, %ecx
movl %ecx, 0xc(%rax)
cmpl $0x0, 0xc(%rax)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl 0xc(%rax), %ecx
andl $0x80, %ecx
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x7, %dl
andb $0x7f, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movb 0x29(%rax), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movb 0x29(%rax), %dl
shrb $0x7, %dl
movzbl %dl, %edx
xorl %edx, %ecx
movb %cl, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x6, %dl
andb $-0x41, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
jmp 0x8e0f
movq -0x28(%rbp), %rcx
movl -0xc(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
sarl $0x4, %eax
movl %eax, -0x14(%rbp)
movl 0xc(%rcx), %eax
andl $0xf, %eax
movl %eax, -0x18(%rbp)
movl 0xc(%rcx), %eax
sarl $0x4, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
addl -0x10(%rbp), %eax
movb 0x29(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
cmpl $0xa, -0x18(%rbp)
jle 0x8da0
movl -0x18(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %edx, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x28(%rbp), %rax
cmpl $0x0, %ecx
setg %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movq -0x28(%rbp), %rax
movl %edx, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
shll $0x4, %ecx
orl -0x18(%rbp), %ecx
andl $0xff, %ecx
movl %ecx, 0xc(%rax)
cmpl $0x0, 0xc(%rax)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::run_ror()
void run_ror()
  {
    int c = status.c;
    status.c = reg_a & 1;
    reg_a = reg_a >> 1;
    reg_a |= c << 7;
    status.z = reg_a == 0;
    status.n = (reg_a & 0x80) != 0;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb 0x29(%rax), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, -0xc(%rbp)
movl 0xc(%rax), %ecx
andl $0x1, %ecx
movb %cl, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl 0xc(%rax), %ecx
sarl %ecx
movl %ecx, 0xc(%rax)
movl -0xc(%rbp), %ecx
shll $0x7, %ecx
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
cmpl $0x0, 0xc(%rax)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl 0xc(%rax), %ecx
andl $0x80, %ecx
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x7, %dl
andb $0x7f, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::store_absolute_y(int, int&)
void store_absolute_y(int data, int &cycles)
  {
    int a = memory_bus->read16(pc);
    cycles = 5;
    int address = a + reg_y;
    //if (!same_page(address, a)) { cycles++; }
    pc += 2;
    memory_bus->write(address, data);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq (%rax), %rdi
movzwl 0x18(%rax), %esi
callq 0x83d0
movw %ax, %cx
movq -0x28(%rbp), %rax
movzwl %cx, %ecx
movl %ecx, -0x1c(%rbp)
movq -0x18(%rbp), %rcx
movl $0x5, (%rcx)
movl -0x1c(%rbp), %ecx
addl 0x14(%rax), %ecx
movl %ecx, -0x20(%rbp)
movzwl 0x18(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x18(%rax)
movq (%rax), %rdi
movl -0x20(%rbp), %esi
movl -0xc(%rbp), %eax
movzbl %al, %edx
callq 0x97e0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::run_compare(int, int)
void run_compare(int reg, int data)
  {
    status.c = reg >= data;
    reg = reg - data;

    status.z = reg == 0;
    status.n = (reg & 0x80) != 0;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpl -0x10(%rbp), %ecx
setge %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0xc(%rbp), %ecx
subl -0x10(%rbp), %ecx
movl %ecx, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0xc(%rbp), %ecx
andl $0x80, %ecx
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x7, %dl
andb $0x7f, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::run_dec_memory(int, int)
void run_dec_memory(int address, int data)
  {
    data--;
    data &= 0xff;
    set_load_flags(data);
    memory_bus->write(address, data);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x10(%rbp)
leaq -0x10(%rbp), %rsi
callq 0x8f90
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %eax
movzbl %al, %edx
callq 0x97e0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: mikeakohn[P]cloudtari/build/../src/M6502.h
// Function: M6502::run_sbc(int)
void run_sbc(int data)
  {
    if (status.d == 0)
    {
      reg_a = ((status.c << 8) | reg_a) - data;
      status.c = reg_a > 0xff;
      reg_a &= 0xff;
      status.z = reg_a == 0;
      status.n = (reg_a & 0x80) != 0;
      status.v = status.c ^ status.n;
    }
      else
    {
      int d0 = data & 0xf;
      int d1 = data >> 4;
      int a0 = reg_a & 0xf;
      int a1 = reg_a >> 4;

      a0 = a0 - d0 - (status.c ^ 1);

      if (a0 < 0)
      {
        a1--;
        a0 += 1;
      }

      a1 = a1 - d1;

      status.c = a1 / 10 > 0;
      a1 = a1 % 10;

      reg_a = ((a1 << 4) | a0) & 0xff;
      status.z = reg_a == 0;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movb 0x29(%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x9470
movq -0x28(%rbp), %rax
movb 0x29(%rax), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x8, %ecx
orl 0xc(%rax), %ecx
subl -0xc(%rbp), %ecx
movl %ecx, 0xc(%rax)
cmpl $0xff, 0xc(%rax)
setg %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl 0xc(%rax), %ecx
andl $0xff, %ecx
movl %ecx, 0xc(%rax)
cmpl $0x0, 0xc(%rax)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl 0xc(%rax), %ecx
andl $0x80, %ecx
cmpl $0x0, %ecx
setne %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x7, %dl
andb $0x7f, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movb 0x29(%rax), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movb 0x29(%rax), %dl
shrb $0x7, %dl
movzbl %dl, %edx
xorl %edx, %ecx
movb %cl, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb $0x6, %dl
andb $-0x41, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
jmp 0x9536
movq -0x28(%rbp), %rcx
movl -0xc(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
sarl $0x4, %eax
movl %eax, -0x14(%rbp)
movl 0xc(%rcx), %eax
andl $0xf, %eax
movl %eax, -0x18(%rbp)
movl 0xc(%rcx), %eax
sarl $0x4, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
subl -0x10(%rbp), %eax
movb 0x29(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
xorl $0x1, %ecx
subl %ecx, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x94c7
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
subl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x28(%rbp), %rax
cmpl $0x0, %ecx
setg %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movq -0x28(%rbp), %rax
movl %edx, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
shll $0x4, %ecx
orl -0x18(%rbp), %ecx
andl $0xff, %ecx
movl %ecx, 0xc(%rax)
cmpl $0x0, 0xc(%rax)
sete %dl
andb $0x1, %dl
movb 0x29(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x29(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/MemoryBus.cxx
// Function: MemoryBus::read(int)
uint8_t MemoryBus::read(int address)
{
  // Takes care of mirrored memory.
  if ((address & 0x1000) == 0x1000)
  {
    if (address == 0x1ff9)
    {
      if (rom->set_bank(1)) { return 0; }
    }
      else
    if (address == 0x1ff8)
    {
      if (rom->set_bank(0)) { return 0; }
    }

    return rom->read_int8(address & 0x0fff);
  }

  if (address <= 0x3f)
  {
    return tia->read_memory(address & 0x3f);
  }

  return riot->read_memory(address);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x979f
cmpl $0x1ff9, -0x14(%rbp)    # imm = 0x1FF9
jne 0x975e
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0xa630
testb $0x1, %al
jne 0x9756
jmp 0x975c
movb $0x0, -0x1(%rbp)
jmp 0x97d0
jmp 0x9785
cmpl $0x1ff8, -0x14(%rbp)    # imm = 0x1FF8
jne 0x9783
movq -0x20(%rbp), %rax
movq (%rax), %rdi
xorl %esi, %esi
callq 0xa630
testb $0x1, %al
jne 0x977b
jmp 0x9781
movb $0x0, -0x1(%rbp)
jmp 0x97d0
jmp 0x9783
jmp 0x9785
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
andl $0xfff, %esi            # imm = 0xFFF
callq 0x9980
movb %al, -0x1(%rbp)
jmp 0x97d0
cmpl $0x3f, -0x14(%rbp)
jg 0x97bd
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x14(%rbp), %esi
andl $0x3f, %esi
callq 0xa860
movb %al, -0x1(%rbp)
jmp 0x97d0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x14(%rbp), %esi
callq 0xa290
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: mikeakohn[P]cloudtari/build/../src/MemoryBus.cxx
// Function: MemoryBus::write(int, unsigned char)
void MemoryBus::write(int address, uint8_t value)
{
  if ((address & 0x1000) == 0x1000)
  {
  }
    else
  if (address <= 0x3f)
  { 
    tia->write_memory(address & 0x3f, value);
  } 
    else
  if ((address & 0x1000) == 0x0000)
  { 
    riot->write_memory(address, value);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movb %al, -0xd(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x980d
jmp 0x9851
cmpl $0x3f, -0xc(%rbp)
jg 0x982c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0xc(%rbp), %esi
andl $0x3f, %esi
movzbl -0xd(%rbp), %edx
callq 0xa8a0
jmp 0x984f
movl -0xc(%rbp), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x984d
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc(%rbp), %esi
movzbl -0xd(%rbp), %edx
callq 0xa2e0
jmp 0x984f
jmp 0x9851
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/MemoryBus.cxx
// Function: MemoryBus::dump(int, int)
void MemoryBus::dump(int start, int end)
{
  start &= 0xfff0;

  for (int n = start; n <= end; n++)
  {
    if ((n % 16) == 0)
    {
      printf("%04x:", n);
    }

    if ((n % 8) == 0)
    {
      printf(" " );
    }

    printf(" %02x", read(n));

    if ((n % 16) == 15)
    {
      printf("\n");
    }
  }

  printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
andl $0xfff0, %eax           # imm = 0xFFF0
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x10(%rbp), %eax
jg 0x9921
movl -0x14(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x98b8
movl -0x14(%rbp), %esi
leaq 0x6074(%rip), %rdi      # 0xf925
movb $0x0, %al
callq 0x4050
movl -0x14(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x98d6
leaq 0x6297(%rip), %rdi      # 0xfb66
movb $0x0, %al
callq 0x4050
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x9710
movzbl %al, %esi
leaq 0x603f(%rip), %rdi      # 0xf92b
movb $0x0, %al
callq 0x4050
movl -0x14(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
cmpl $0xf, %edx
jne 0x9911
leaq 0x6882(%rip), %rdi      # 0x1018c
movb $0x0, %al
callq 0x4050
jmp 0x9913
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x988b
leaq 0x6864(%rip), %rdi      # 0x1018c
movb $0x0, %al
callq 0x4050
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/Network.cxx
// Function: Network::net_close()
void Network::net_close()
{
  if (client != -1)
  {
    close(client);
    client = -1;
  }

  if (socket_id != -1)
  {
    close(socket_id);
    socket_id = -1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpl $-0x1, 0x4(%rax)
je 0x9a31
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x4400
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x9a4f
movq -0x10(%rbp), %rax
movl (%rax), %edi
callq 0x4400
movq -0x10(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/Network.cxx
// Function: Network::net_open(int)
int Network::net_open(int port)
{
  struct sockaddr_in server_addr;
  struct sockaddr_in client_addr;

  socket_id = socket(AF_INET, SOCK_STREAM, 0);

  if (socket_id < 0)
  {
    printf("Can't open socket.\n");
    return -1;
  }

  memset((char*)&server_addr, 0, sizeof(server_addr));
  server_addr.sin_family = AF_INET;
  server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
  server_addr.sin_port = htons(port);

  if (bind(socket_id, (const sockaddr *)&server_addr, sizeof(server_addr)) < 0)
  {
    printf("Server can't bind.\n");
    return -1;
  }

  if (listen(socket_id, 1) != 0)
  {
    printf("Listen failed.\n");
    return -1;
  }

  socklen_t n = sizeof(client_addr);

  client = accept(socket_id, (struct sockaddr *)&client_addr, &n);

  if (client == -1) { return -1; }

  fcntl(client, F_SETFL, O_NONBLOCK);

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x40c0
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x0, (%rax)
jge 0x9aaf
leaq 0x5e95(%rip), %rdi      # 0xf931
movb $0x0, %al
callq 0x4050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9b8e
leaq -0x24(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x4170
movw $0x2, -0x24(%rbp)
xorl %edi, %edi
callq 0x41d0
movl %eax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movzwl %ax, %edi
callq 0x4070
movw %ax, %cx
movq -0x40(%rbp), %rax
movw %cx, -0x22(%rbp)
movl (%rax), %edi
leaq -0x24(%rbp), %rsi
movl $0x10, %edx
callq 0x4090
cmpl $0x0, %eax
jge 0x9b11
leaq 0x5e44(%rip), %rdi      # 0xf945
movb $0x0, %al
callq 0x4050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9b8e
movq -0x40(%rbp), %rax
movl (%rax), %edi
movl $0x1, %esi
callq 0x42b0
cmpl $0x0, %eax
je 0x9b3d
leaq 0x5e2c(%rip), %rdi      # 0xf959
movb $0x0, %al
callq 0x4050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9b8e
movq -0x40(%rbp), %rax
movl $0x10, -0x38(%rbp)
movl (%rax), %edi
leaq -0x34(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x40f0
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpl $-0x1, 0x4(%rax)
jne 0x9b6f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9b8e
movq -0x40(%rbp), %rax
movl 0x4(%rax), %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
movb $0x0, %al
callq 0x4180
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/Network.cxx
// Function: Network::net_send(unsigned char const*, int)
int Network::net_send(const uint8_t *buffer, int length)
{
  struct timeval tv;
  fd_set writeset;

  int bytes_sent = 0;

  while (bytes_sent < length)
  {
    FD_ZERO(&writeset);
    FD_SET(client, &writeset);

    tv.tv_sec = 10;
    tv.tv_usec = 0;

    int n = select(client + 1, NULL, &writeset, NULL, &tv);

    if (n == -1)
    {
      if (errno == EINTR) { continue; }

      perror("Problem with select in net_send");
      return -1;
    }

    if (n == 0) { return -3; }

    n = send(client, buffer + bytes_sent, length - bytes_sent, 0);
    if (n < 0) { return -4; }

    bytes_sent += n;
  }

  return bytes_sent;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x9d4c
jmp 0x9bdc
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movl $0x0, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
cmpq $0x10, %rax
jae 0x9c26
movq -0xc0(%rbp), %rax
movl -0xb8(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x9bf4
jmp 0x9c28
movq -0xd0(%rbp), %rax
movl 0x4(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0xd0(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, -0xd8(%rbp)
movl 0x4(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0xd8(%rbp), %rdx
movl %eax, %ecx
movq -0xd0(%rbp), %rax
movslq %ecx, %rcx
orq -0xb0(%rbp,%rcx,8), %rdx
movq %rdx, -0xb0(%rbp,%rcx,8)
movq $0xa, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movl 0x4(%rax), %edi
addl $0x1, %edi
xorl %eax, %eax
movl %eax, %ecx
leaq -0xb0(%rbp), %rdx
leaq -0x30(%rbp), %r8
movq %rcx, %rsi
callq 0x4240
movl %eax, -0xc4(%rbp)
cmpl $-0x1, -0xc4(%rbp)
jne 0x9ce0
callq 0x4040
cmpl $0x4, (%rax)
jne 0x9ccb
jmp 0x9bcb
leaq 0x5c97(%rip), %rdi      # 0xf969
callq 0x4200
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9d55
cmpl $0x0, -0xc4(%rbp)
jne 0x9cf2
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x9d55
movq -0xd0(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x18(%rbp), %rsi
movslq -0xb4(%rbp), %rax
addq %rax, %rsi
movl -0x1c(%rbp), %eax
subl -0xb4(%rbp), %eax
movslq %eax, %rdx
xorl %ecx, %ecx
callq 0x4160
movl %eax, -0xc4(%rbp)
cmpl $0x0, -0xc4(%rbp)
jge 0x9d35
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x9d55
movl -0xc4(%rbp), %eax
addl -0xb4(%rbp), %eax
movl %eax, -0xb4(%rbp)
jmp 0x9bcb
movl -0xb4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/Network.cxx
// Function: Network::net_has_data()
bool Network::net_has_data()
{
  struct timeval tv;
  fd_set readset;

  FD_ZERO(&readset);
  FD_SET(client, &readset);

  tv.tv_sec = 0;
  tv.tv_usec = 0;

  int n = select(client + 1, &readset, NULL, NULL, &tv);

  if (n == -1)
  {
    if (errno == EINTR) { return false; }

    perror("Problem with select in Network");
    net_close();
    return false;
  }

  return FD_ISSET(client, &readset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl $0x0, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpq $0x10, %rax
jae 0xa044
movq -0xb0(%rbp), %rax
movl -0xa4(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0xa012
jmp 0xa046
movq -0xc0(%rbp), %rax
movl 0x4(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0xc0(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, -0xc8(%rbp)
movl 0x4(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0xc8(%rbp), %rdx
movl %eax, %ecx
movq -0xc0(%rbp), %rax
movslq %ecx, %rcx
orq -0xa0(%rbp,%rcx,8), %rdx
movq %rdx, -0xa0(%rbp,%rcx,8)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movl 0x4(%rax), %edi
addl $0x1, %edi
leaq -0xa0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x20(%rbp), %r8
movq %rcx, %rdx
callq 0x4240
movl %eax, -0xb4(%rbp)
cmpl $-0x1, -0xb4(%rbp)
jne 0xa108
callq 0x4040
cmpl $0x4, (%rax)
jne 0xa0ea
movb $0x0, -0x1(%rbp)
jmp 0xa163
leaq 0x58b8(%rip), %rdi      # 0xf9a9
callq 0x4200
movq -0xc0(%rbp), %rdi
callq 0x9a00
movb $0x0, -0x1(%rbp)
jmp 0xa163
movq -0xc0(%rbp), %rax
movl 0x4(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0xc0(%rbp), %rax
movslq %ecx, %rcx
movq -0xa0(%rbp,%rcx,8), %rcx
movq %rcx, -0xd0(%rbp)
movl 0x4(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0xd0(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: mikeakohn[P]cloudtari/build/../src/RIOT.cxx
// Function: RIOT::reset()
void RIOT::reset()
{
  memset(ram, 0, sizeof(ram));
  memset(riot, 0, sizeof(riot));

  riot[SWCHA & 0x07] = 0xff;
  riot[SWACNT & 0x07] = 0xff;
  riot[SWCHB & 0x07] = 0x0b;

  prescale = TIM1T;
  prescale_shift = TIM1T_SHIFT;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
addq $0x40, %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x4170
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x4170
movq -0x10(%rbp), %rax
movl 0x20(%rax), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movb $-0x1, 0x38(%rax,%rcx)
movl 0x24(%rax), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movb $-0x1, 0x38(%rax,%rcx)
movl 0x28(%rax), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movb $0xb, 0x38(%rax,%rcx)
movl (%rax), %ecx
movl %ecx, 0x2c(%rax)
movl 0x10(%rax), %ecx
movl %ecx, 0x30(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)