LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::LDY_execute(unsigned char)
void Cpu::LDY_execute(uint8_t operand) {
    //Load Y register
    //Y,Z,N = M

    regY = operand;

    regP.Z = regY == 0;
    regP.N = regY >> 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movb -0x9(%rbp), %cl
movb %cl, 0x10022(%rax)
movzbl 0x10022(%rax), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl 0x10022(%rax), %ecx
sarl $0x7, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::LSR_mem_execute(unsigned short, unsigned char)
void Cpu::LSR_mem_execute(uint16_t address, uint8_t operand) {
    // Logical shift right (Memory content)
    // M,Z,C,N = M/2

    uint8_t result = (operand >> 1) & 0x7f;

    mem.write_byte(address, result);

    regP.Z = result == 0;
    regP.C = operand & 1;
    regP.N = (result >> 7) & 1;
}

// 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)
movzbl -0xb(%rbp), %eax
sarl %eax
andl $0x7f, %eax
movb %al, -0xc(%rbp)
addq $0x8, %rdi
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xc(%rbp), %edx
callq 0x4c90
movq -0x18(%rbp), %rax
movzbl -0xc(%rbp), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl -0xb(%rbp), %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x10028(%rax)
movzbl -0xc(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::LSR_A_execute()
void Cpu::LSR_A_execute() {
    // Logical shift right (Accumulator content)
    // A,Z,C,N = A/2

    uint8_t result = (regA >> 1) & 0x7f;

    regP.Z = result == 0;
    regP.C = regA & 1;
    regP.N = (result >> 7) & 1;

    regA = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x10020(%rax), %ecx
sarl %ecx
andl $0x7f, %ecx
movb %cl, -0x9(%rbp)
movzbl -0x9(%rbp), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl 0x10020(%rax), %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x10028(%rax)
movzbl -0x9(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
movb -0x9(%rbp), %cl
movb %cl, 0x10020(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::PHP_execute()
void Cpu::PHP_execute() {
    // Push processor status
    
    uint8_t procStat;
    procStat =  (regP.N) << 6 |
		(regP.V) << 5 |
		(regP.B) << 4 |
		(regP.D) << 3 |
		(regP.I) << 2 |
		(regP.Z) << 1 |
		(regP.C);
    pushStack(procStat);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movb 0x1002e(%rdi), %al
andb $0x1, %al
movzbl %al, %eax
shll $0x6, %eax
movb 0x1002d(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x5, %ecx
orl %ecx, %eax
movb 0x1002c(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x4, %ecx
orl %ecx, %eax
movb 0x1002b(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x3, %ecx
orl %ecx, %eax
movb 0x1002a(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x2, %ecx
orl %ecx, %eax
movb 0x10029(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll %ecx
orl %ecx, %eax
movb 0x10028(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
orl %ecx, %eax
movb %al, -0x9(%rbp)
movzbl -0x9(%rbp), %esi
callq 0x42b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::PLA_execute()
void Cpu::PLA_execute() {
    // Pull accumulator

    regA = pullStack();

    regP.Z = regA == 0;
    regP.N = regA >> 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
callq 0x4300
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x10020(%rax)
movzbl 0x10020(%rax), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl 0x10020(%rax), %ecx
sarl $0x7, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::PLP_execute()
void Cpu::PLP_execute() {
    // Pull processor status

    uint8_t procStat = pullStack();
    regP.N = (procStat >> 6) & 1;
    regP.V = (procStat >> 5) & 1;
    regP.B = (procStat >> 4) & 1;
    regP.D = (procStat >> 3) & 1;
    regP.I = (procStat >> 2) & 1;
    regP.Z = (procStat >> 1) & 1;
    regP.C = procStat & 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x4300
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, -0x9(%rbp)
movzbl -0x9(%rbp), %ecx
sarl $0x6, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
movzbl -0x9(%rbp), %ecx
sarl $0x5, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002d(%rax)
movzbl -0x9(%rbp), %ecx
sarl $0x4, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002c(%rax)
movzbl -0x9(%rbp), %ecx
sarl $0x3, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002b(%rax)
movzbl -0x9(%rbp), %ecx
sarl $0x2, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002a(%rax)
movzbl -0x9(%rbp), %ecx
sarl %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl -0x9(%rbp), %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x10028(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::ROL_mem_execute(unsigned short, unsigned char)
void Cpu::ROL_mem_execute(uint16_t address, uint8_t operand) {
    // Rotate left (memory contents)

    uint8_t result = (operand << 1) | regP.C;
    mem.write_byte(address, result);

    regP.C = (operand >> 7) & 1;
    regP.Z = result == 0;
    regP.N = (result >> 7) & 1;
}

// 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)
movzbl -0xb(%rbp), %eax
shll %eax
movb 0x10028(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
orl %ecx, %eax
movb %al, -0xc(%rbp)
addq $0x8, %rdi
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xc(%rbp), %edx
callq 0x4c90
movq -0x18(%rbp), %rax
movzbl -0xb(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x10028(%rax)
movzbl -0xc(%rbp), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl -0xc(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::ROL_A_execute()
void Cpu::ROL_A_execute() {
    // Rotate Left (accumulator)

    uint8_t result = (regA << 1) | regP.C;

    regP.C = (regA >> 7) & 1;
    regP.Z = result == 0;
    regP.N = (result >> 7) & 1;
    
    regA = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x10020(%rax), %ecx
shll %ecx
movb 0x10028(%rax), %dl
andb $0x1, %dl
movzbl %dl, %edx
orl %edx, %ecx
movb %cl, -0x9(%rbp)
movzbl 0x10020(%rax), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x10028(%rax)
movzbl -0x9(%rbp), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl -0x9(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
movb -0x9(%rbp), %cl
movb %cl, 0x10020(%rax)
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::ROR_mem_execute(unsigned short, unsigned char)
void Cpu::ROR_mem_execute(uint16_t address, uint8_t operand) {
    // Rotate right (memory contents)

    uint8_t result = ((operand >> 1) & 0x7f) | (regP.C << 7);
    mem.write_byte(address, result);

    regP.C = operand & 1;
    regP.Z = result == 0;
    regP.N = (result >> 7) & 1;
}

// 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)
movzbl -0xb(%rbp), %eax
sarl %eax
andl $0x7f, %eax
movb 0x10028(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x7, %ecx
orl %ecx, %eax
movb %al, -0xc(%rbp)
addq $0x8, %rdi
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xc(%rbp), %edx
callq 0x4c90
movq -0x18(%rbp), %rax
movzbl -0xb(%rbp), %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x10028(%rax)
movzbl -0xc(%rbp), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl -0xc(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::ROR_A_execute()
void Cpu::ROR_A_execute() {
    // Rotate right (accumulator)

    uint8_t result = ((regA >> 1) & 0x7f) | (regP.C << 7);

    regP.C = regA & 1;
    regP.Z = result == 0;
    regP.N = (result >> 7) & 1;

    regA = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x10020(%rax), %ecx
sarl %ecx
andl $0x7f, %ecx
movb 0x10028(%rax), %dl
andb $0x1, %dl
movzbl %dl, %edx
shll $0x7, %edx
orl %edx, %ecx
movb %cl, -0x9(%rbp)
movzbl 0x10020(%rax), %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x10028(%rax)
movzbl -0x9(%rbp), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl -0x9(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
movb -0x9(%rbp), %cl
movb %cl, 0x10020(%rax)
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::RTI_execute()
void Cpu::RTI_execute() {
    // Return from interrupt

    uint8_t procStat = pullStack();
    regP.N = (procStat >> 6) & 1;
    regP.V = (procStat >> 5) & 1;
    regP.B = (procStat >> 4) & 1;
    regP.D = (procStat >> 3) & 1;
    regP.I = (procStat >> 2) & 1;
    regP.Z = (procStat >> 1) & 1;
    regP.C = procStat & 1;

    uint8_t PC_low = pullStack();
    uint8_t PC_high = pullStack();
    regPC = (PC_high << 8) | PC_low;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x4300
movq -0x18(%rbp), %rdi
movb %al, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
sarl $0x6, %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x1002e(%rdi)
movzbl -0x9(%rbp), %eax
sarl $0x5, %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x1002d(%rdi)
movzbl -0x9(%rbp), %eax
sarl $0x4, %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x1002c(%rdi)
movzbl -0x9(%rbp), %eax
sarl $0x3, %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x1002b(%rdi)
movzbl -0x9(%rbp), %eax
sarl $0x2, %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x1002a(%rdi)
movzbl -0x9(%rbp), %eax
sarl %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x10029(%rdi)
movzbl -0x9(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x10028(%rdi)
callq 0x4300
movq -0x18(%rbp), %rdi
movb %al, -0xa(%rbp)
callq 0x4300
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, -0xb(%rbp)
movzbl -0xb(%rbp), %ecx
shll $0x8, %ecx
movzbl -0xa(%rbp), %edx
orl %edx, %ecx
movw %cx, 0x10024(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::RTS_execute()
void Cpu::RTS_execute() {
    // Return from subroutine

    uint8_t PC_low = pullStack();
    uint8_t PC_high = pullStack();
    uint16_t PC = (PC_high << 8) | PC_low;
    regPC = PC + 1; //It had the last byte of the last instr
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x4300
movq -0x18(%rbp), %rdi
movb %al, -0x9(%rbp)
callq 0x4300
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, -0xa(%rbp)
movzbl -0xa(%rbp), %ecx
shll $0x8, %ecx
movzbl -0x9(%rbp), %edx
orl %edx, %ecx
movw %cx, -0xc(%rbp)
movzwl -0xc(%rbp), %ecx
addl $0x1, %ecx
movw %cx, 0x10024(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::SBC_execute(unsigned char)
void Cpu::SBC_execute(uint8_t operand) {
    // Subtract with carry
    // A,Z,C,N = A-M-(1-C)

    uint8_t noperand = ~operand;
    uint8_t part_result = regA + noperand;

    bool signResult, signRegA, signOperand;
    bool isCarry = false;

    if (part_result < regA) isCarry = true;

    uint8_t result = part_result + regP.C;

    if (result < part_result) isCarry = true;

    signResult = (result >> 7) & 1; //Mask to eliminate the carry
    signRegA = (regA >> 7) & 1;
    signOperand = (noperand >> 7) & 1;

    //regP.C = regA >= operand;
    regP.C = isCarry;
    regP.Z = result == 0;
    regP.V = ((signRegA == signOperand) && (signResult != signRegA));
    regP.N = signResult;

    regA = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movzbl -0x9(%rbp), %eax
xorl $-0x1, %eax
movb %al, -0xa(%rbp)
movzbl 0x10020(%rcx), %eax
movzbl -0xa(%rbp), %edx
addl %edx, %eax
movb %al, -0xb(%rbp)
movb $0x0, -0xf(%rbp)
movzbl -0xb(%rbp), %eax
movzbl 0x10020(%rcx), %ecx
cmpl %ecx, %eax
jge 0x2f27
movb $0x1, -0xf(%rbp)
movq -0x18(%rbp), %rcx
movzbl -0xb(%rbp), %eax
movb 0x10028(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movb %al, -0x10(%rbp)
movzbl -0x10(%rbp), %eax
movzbl -0xb(%rbp), %ecx
cmpl %ecx, %eax
jge 0x2f50
movb $0x1, -0xf(%rbp)
movq -0x18(%rbp), %rax
movzbl -0x10(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, -0xc(%rbp)
movzbl 0x10020(%rax), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, -0xd(%rbp)
movzbl -0xa(%rbp), %ecx
sarl $0x7, %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, -0xe(%rbp)
movb -0xf(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x10028(%rax)
movzbl -0x10(%rbp), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movb -0xd(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
movb -0xe(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x19(%rbp)
jne 0x2fea
movb -0xc(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb -0xd(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
setne %al
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
movb -0x19(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x1002d(%rax)
movb -0xc(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
movb -0x10(%rbp), %cl
movb %cl, 0x10020(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::TAX_execute()
void Cpu::TAX_execute() {
    // Transfer accumulator to X
    // X=A

    regX = regA;

    regP.Z = regX == 0;
    regP.N = regX >> 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb 0x10020(%rax), %cl
movb %cl, 0x10021(%rax)
movzbl 0x10021(%rax), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl 0x10021(%rax), %ecx
sarl $0x7, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::TAY_execute()
void Cpu::TAY_execute() {
    // Transfer accumulator to Y
    // Y=A

    regY = regA;

    regP.Z = regY == 0;
    regP.N = regY >> 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb 0x10020(%rax), %cl
movb %cl, 0x10022(%rax)
movzbl 0x10022(%rax), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl 0x10022(%rax), %ecx
sarl $0x7, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::TSX_execute()
void Cpu::TSX_execute() {
    // Transfer stack pointer to X
    // X=SP

    regX = regSP; //Only lower byte

    regP.Z = regX == 0;
    regP.N = regX >> 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw 0x10026(%rax), %cx
movb %cl, 0x10021(%rax)
movzbl 0x10021(%rax), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl 0x10021(%rax), %ecx
sarl $0x7, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::TXA_execute()
void Cpu::TXA_execute() {
    // Transfer X to accumulator
    // A=X

    regA = regX;

    regP.Z = regA == 0;
    regP.N = regA >> 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb 0x10021(%rax), %cl
movb %cl, 0x10020(%rax)
movzbl 0x10020(%rax), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl 0x10020(%rax), %ecx
sarl $0x7, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::TYA_execute()
void Cpu::TYA_execute() {
    // Transfer Y to accumulator
    // A = Y

    regA = regY;

    regP.Z = regA == 0;
    regP.N = regA >> 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb 0x10022(%rax), %cl
movb %cl, 0x10020(%rax)
movzbl 0x10020(%rax), %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x10029(%rax)
movzbl 0x10020(%rax), %ecx
sarl $0x7, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x1002e(%rax)
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::read_operand_absolute(addr_mode_t*, unsigned char)
uint32_t Cpu::read_operand_absolute(addr_mode_t *addr_mode, uint8_t opcode) {
    uint8_t operand;
    uint8_t high, low;
    low = mem.read_byte(regPC + 0x0001);
    high = mem.read_byte(regPC + 0x0002);
    uint16_t address = (high << 8) | low;
    regPC += 0x03;
    *addr_mode = ABSOLUTE;
    //These opcodes don't need an operand
    //We avoid lateral effects on ppu regs reads
    if (!(opcode == 0x20 || opcode == 0x8c || opcode == 0x4c || opcode == 0x0c || opcode ==
	0x8d || opcode == 0x8e))
	operand = mem.read_byte(address);
    else
	operand = 0;
    return (address << 16) | operand;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x14(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x2, %eax
movzwl %ax, %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x13(%rbp)
movzbl -0x13(%rbp), %ecx
shll $0x8, %ecx
movzbl -0x14(%rbp), %edx
orl %edx, %ecx
movw %cx, -0x16(%rbp)
movzwl 0x10024(%rax), %ecx
addl $0x3, %ecx
movw %cx, 0x10024(%rax)
movq -0x10(%rbp), %rax
movl $0x3, (%rax)
movzbl -0x11(%rbp), %eax
cmpl $0x20, %eax
je 0x3caf
movzbl -0x11(%rbp), %eax
cmpl $0x8c, %eax
je 0x3caf
movzbl -0x11(%rbp), %eax
cmpl $0x4c, %eax
je 0x3caf
movzbl -0x11(%rbp), %eax
cmpl $0xc, %eax
je 0x3caf
movzbl -0x11(%rbp), %eax
cmpl $0x8d, %eax
je 0x3caf
movzbl -0x11(%rbp), %eax
cmpl $0x8e, %eax
je 0x3caf
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movzwl -0x16(%rbp), %esi
callq 0x4a20
movb %al, -0x12(%rbp)
jmp 0x3cb3
movb $0x0, -0x12(%rbp)
movzwl -0x16(%rbp), %eax
shll $0x10, %eax
movzbl -0x12(%rbp), %ecx
orl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::read_operand_imm(addr_mode_t*)
uint32_t Cpu::read_operand_imm(addr_mode_t *addr_mode) {
    uint8_t operand;
    operand = mem.read_byte(regPC + 0x0001);
    regPC += 0x02;
    *addr_mode = IMMEDIATE;
    return operand;
}

// 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
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x11(%rbp)
movzwl 0x10024(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x10024(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movzbl -0x11(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::read_operand_indexed_indirect(addr_mode_t*)
uint32_t Cpu::read_operand_indexed_indirect(addr_mode_t *addr_mode) {
    uint8_t operand;
    uint16_t address;
    uint8_t d = mem.read_byte(regPC + 0x0001);
    address = mem.read_word(uint16_t (0x00FF & (d+regX)));
    operand = mem.read_byte(address);
    regPC += 0x02;
    *addr_mode = INDIRECT_X;
    return (d << 16) | operand;
}

// 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
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x4a20
movq -0x20(%rbp), %rcx
movb %al, -0x15(%rbp)
movq %rcx, %rdi
addq $0x8, %rdi
movzbl -0x15(%rbp), %eax
movzbl 0x10021(%rcx), %ecx
addl %ecx, %eax
andl $0xff, %eax
movzwl %ax, %esi
callq 0x4bb0
movq -0x20(%rbp), %rdi
movw %ax, -0x14(%rbp)
addq $0x8, %rdi
movzwl -0x14(%rbp), %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x11(%rbp)
movzwl 0x10024(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x10024(%rax)
movq -0x10(%rbp), %rax
movl $0x6, (%rax)
movzbl -0x15(%rbp), %eax
shll $0x10, %eax
movzbl -0x11(%rbp), %ecx
orl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::read_operand_zero_page(addr_mode_t*)
uint32_t Cpu::read_operand_zero_page(addr_mode_t *addr_mode) {
    uint8_t operand;
    uint16_t address = 0;
    uint8_t d = mem.read_byte(regPC + 0x0001);
    address = address | (0x00ff & d);
    operand = mem.read_byte(address);
    regPC += 0x02;
    *addr_mode = ZERO_PAGE;
    return (address << 16) | operand;
}

// 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)
movw $0x0, -0x14(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x4a20
movq -0x20(%rbp), %rdi
movb %al, -0x15(%rbp)
movzwl -0x14(%rbp), %eax
movzbl -0x15(%rbp), %ecx
andl $0xff, %ecx
orl %ecx, %eax
movw %ax, -0x14(%rbp)
addq $0x8, %rdi
movzwl -0x14(%rbp), %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x11(%rbp)
movzwl 0x10024(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x10024(%rax)
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movzwl -0x14(%rbp), %eax
shll $0x10, %eax
movzbl -0x11(%rbp), %ecx
orl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::read_operand_indirect(addr_mode_t*)
uint32_t Cpu::read_operand_indirect(addr_mode_t *addr_mode) {
    uint16_t pointer;
    uint16_t address;
    uint8_t high, low, operand;
    operand = 0;
    low = mem.read_byte(regPC + 0x0001);
    high = mem.read_byte(regPC + 0x0002);
    pointer = (high << 8) | low;
    address = mem.read_word(pointer);
    regPC += 0x03;
    *addr_mode = INDIRECT;
    return (address << 16) | operand;
}

// 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)
movb $0x0, -0x17(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x16(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x2, %eax
movzwl %ax, %esi
callq 0x4a20
movq -0x20(%rbp), %rdi
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %eax
shll $0x8, %eax
movzbl -0x16(%rbp), %ecx
orl %ecx, %eax
movw %ax, -0x12(%rbp)
addq $0x8, %rdi
movzwl -0x12(%rbp), %esi
callq 0x4bb0
movw %ax, %cx
movq -0x20(%rbp), %rax
movw %cx, -0x14(%rbp)
movzwl 0x10024(%rax), %ecx
addl $0x3, %ecx
movw %cx, 0x10024(%rax)
movq -0x10(%rbp), %rax
movl $0x9, (%rax)
movzwl -0x14(%rbp), %eax
shll $0x10, %eax
movzbl -0x17(%rbp), %ecx
orl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::read_operand_relative(addr_mode_t*)
uint32_t Cpu::read_operand_relative(addr_mode_t *addr_mode) {
    int8_t operand;
    operand = mem.read_byte(regPC+ 0x0001);
    int16_t signExtOperand = (operand << 8) >> 8;
    regPC += 0x02;
    signExtOperand += regPC;
    *addr_mode = RELATIVE;
    return signExtOperand << 16;
}

// 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
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x11(%rbp)
movsbl -0x11(%rbp), %ecx
shll $0x8, %ecx
sarl $0x8, %ecx
movw %cx, -0x14(%rbp)
movzwl 0x10024(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x10024(%rax)
movzwl 0x10024(%rax), %ecx
movswl -0x14(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl $0x8, (%rax)
movswl -0x14(%rbp), %eax
shll $0x10, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::read_operand_indirect_indexed(addr_mode_t*)
uint32_t Cpu::read_operand_indirect_indexed(addr_mode_t *addr_mode) {
    uint16_t address;
    uint8_t operand;
    uint8_t high, low;
    low = mem.read_byte(regPC + 0x0001);
    high = 0x00;
    address = mem.read_word((high << 8) | low);
    address += (uint16_t) regY;
    operand = mem.read_byte(address);
    regPC += 0x02;
    *addr_mode = INDIRECT_Y;
    return (address << 16) | operand;
}

// 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
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x4a20
movq -0x20(%rbp), %rdi
movb %al, -0x15(%rbp)
movb $0x0, -0x14(%rbp)
addq $0x8, %rdi
movzbl -0x14(%rbp), %eax
shll $0x8, %eax
movzbl -0x15(%rbp), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x4bb0
movq -0x20(%rbp), %rdi
movw %ax, -0x12(%rbp)
movzbl 0x10022(%rdi), %eax
movzwl %ax, %ecx
movzwl -0x12(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x12(%rbp)
addq $0x8, %rdi
movzwl -0x12(%rbp), %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x13(%rbp)
movzwl 0x10024(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x10024(%rax)
movq -0x10(%rbp), %rax
movl $0x7, (%rax)
movzwl -0x12(%rbp), %eax
shll $0x10, %eax
movzbl -0x13(%rbp), %ecx
orl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::read_operand_zero_page_indexed_x(addr_mode_t*)
uint32_t Cpu::read_operand_zero_page_indexed_x(addr_mode_t *addr_mode) {
    uint8_t operand;
    uint16_t address;
    uint8_t d = mem.read_byte(regPC + 0x0001);
    address = (0x0FF & (d+regX));
    operand = mem.read_byte(address);
    regPC += 0x02;
    *addr_mode = ZERO_PAGE_X;
    return (address << 16) | operand;
}

// 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
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x4a20
movq -0x20(%rbp), %rdi
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %eax
movzbl 0x10021(%rdi), %ecx
addl %ecx, %eax
andl $0xff, %eax
movw %ax, -0x14(%rbp)
addq $0x8, %rdi
movzwl -0x14(%rbp), %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x11(%rbp)
movzwl 0x10024(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x10024(%rax)
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
movzwl -0x14(%rbp), %eax
shll $0x10, %eax
movzbl -0x11(%rbp), %ecx
orl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::read_operand_absolute_indexed_y(addr_mode_t*)
uint32_t Cpu::read_operand_absolute_indexed_y(addr_mode_t *addr_mode) {
    uint16_t address;
    uint8_t operand;
    uint8_t high, low;
    low = mem.read_byte(regPC + 0x0001);
    high = mem.read_byte(regPC + 0x0002);
    address = (high << 8) | low;
    address += regY;
    operand = mem.read_byte(address);
    regPC += 0x03;
    *addr_mode = ABSOLUTE_Y;
    return (address << 16) | operand;
}

// 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
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x15(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movzwl 0x10024(%rax), %eax
addl $0x2, %eax
movzwl %ax, %esi
callq 0x4a20
movq -0x20(%rbp), %rdi
movb %al, -0x14(%rbp)
movzbl -0x14(%rbp), %eax
shll $0x8, %eax
movzbl -0x15(%rbp), %ecx
orl %ecx, %eax
movw %ax, -0x12(%rbp)
movzbl 0x10022(%rdi), %ecx
movzwl -0x12(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x12(%rbp)
addq $0x8, %rdi
movzwl -0x12(%rbp), %esi
callq 0x4a20
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x13(%rbp)
movzwl 0x10024(%rax), %ecx
addl $0x3, %ecx
movw %cx, 0x10024(%rax)
movq -0x10(%rbp), %rax
movl $0x5, (%rax)
movzwl -0x12(%rbp), %eax
shll $0x10, %eax
movzbl -0x13(%rbp), %ecx
orl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
// File: NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::NMI_execute()
void Cpu::NMI_execute() {
    // Non-Maskable interrupt

    uint8_t lowPC, highPC;
    lowPC = regPC;
    highPC = (regPC >> 8);
    
    uint8_t procStat;
    procStat =  (regP.N) << 6 |
		(regP.V) << 5 |
		(regP.B) << 4 |
		(regP.D) << 3 |
		(regP.I) << 2 |
		(regP.Z) << 1 |
		(regP.C);
    
    //We push the PC and Processor Status into the stack
    pushStack(highPC);
    pushStack(lowPC);
    pushStack(procStat);

    //We set the PC to the interrupt vector
    regPC = mem.read_word(NMI_INT_VECTOR_ADDR);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movw 0x10024(%rdi), %ax
movb %al, -0x9(%rbp)
movzwl 0x10024(%rdi), %eax
sarl $0x8, %eax
movb %al, -0xa(%rbp)
movb 0x1002e(%rdi), %al
andb $0x1, %al
movzbl %al, %eax
shll $0x6, %eax
movb 0x1002d(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x5, %ecx
orl %ecx, %eax
movb 0x1002c(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x4, %ecx
orl %ecx, %eax
movb 0x1002b(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x3, %ecx
orl %ecx, %eax
movb 0x1002a(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x2, %ecx
orl %ecx, %eax
movb 0x10029(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll %ecx
orl %ecx, %eax
movb 0x10028(%rdi), %cl
andb $0x1, %cl
movzbl %cl, %ecx
orl %ecx, %eax
movb %al, -0xb(%rbp)
movzbl -0xa(%rbp), %esi
callq 0x42b0
movq -0x18(%rbp), %rdi
movzbl -0x9(%rbp), %esi
callq 0x42b0
movq -0x18(%rbp), %rdi
movzbl -0xb(%rbp), %esi
callq 0x42b0
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movl $0xfffa, %esi           # imm = 0xFFFA
callq 0x4bb0
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x10024(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/mem.cpp
// Function: Mem::Mem()
Mem::Mem() {
    //Mem init with 0s
    for (int i = 0; i<=RAM_SIZE; ++i) {
	ram[i] = 0x00;
    }
    
    load_rom("smb.nes");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x10000, -0xc(%rbp)    # imm = 0x10000
jg 0x48fb
movq -0x18(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x48db
movq -0x18(%rbp), %rdi
leaq 0x2c3f(%rip), %rsi      # 0x7545
callq 0x4920
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/mem.cpp
// Function: Mem::load_rom(char*)
void Mem::load_rom(char *name) {

    /*This rom loads .nes roms in iNES file format
    The iNES file format follows the following sections:
    
    1. Header (16 bytes)
    2. Trainer, if present(0 or 512 bytes)
    3. PRG ROM data (16384 * x bytes)
    4. CHR ROM data, if present (8192 * y bytes)
    5. PlayChoice INST-ROM, if present (0 or 8192 bytes)
    6. PlayChoice PROM, if present (16 bytes Data, 16 CounterOut)
    */

    ifstream rom;
    rom.open((char *)name, std::ios_base::binary);

    /* 1. HEADER
    The header format is as follows:
    0-3: Constant $4E $45 $53 $1A
    4:  Size of PRG ROM in 16KB units (x)
    5:  Size of CHR ROM in 8KB units (y)
    6:  Flags 6  - Mapper, mirroring, battery, trainer
    7:  Flags 7  - Mapper, VS/Playchoice, NES 2.0
    8:  Flags 8  - PRG-RAM size
    9:  Flags 9  - TV system
    10: Flags 10 - TV system, PRG-RAM presence
    11-15: unused padding
    */
    rom.read((char *)ram, HEADER_SIZE);
    
    int x = ram[4];
    //int y = ram[5];

    /* 3. PRG ROM data */
    rom.read((char *)ram+0x8000, PRG_ROM_SIZE*x);

    ram[0xfffc] = 0x00;
    ram[0xfffd] = 0x80;

    rom.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x238(%rbp)
leaq -0x218(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x1130
movq -0x230(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x10b0
jmp 0x4968
movq -0x238(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x10, %edx
callq 0x1150
jmp 0x4982
movq -0x238(%rbp), %rsi
movzbl 0x4(%rsi), %eax
movl %eax, -0x228(%rbp)
addq $0x8000, %rsi           # imm = 0x8000
movl -0x228(%rbp), %eax
shll $0xe, %eax
movslq %eax, %rdx
leaq -0x218(%rbp), %rdi
callq 0x1150
jmp 0x49b4
movq -0x238(%rbp), %rax
movb $0x0, 0xfffc(%rax)
movb $-0x80, 0xfffd(%rax)
leaq -0x218(%rbp), %rdi
callq 0x1030
jmp 0x49d7
leaq -0x218(%rbp), %rdi
callq 0x1050
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x1050
movq -0x220(%rbp), %rdi
callq 0x11c0
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/mem.cpp
// Function: Mem::read_byte(unsigned short)
uint8_t Mem::read_byte(uint16_t addr) {
    //Mirroring
    if (addr > 0x07FF) {
	if (addr < 0x1000)
	    addr -= 0x0800;
	else if (addr < 0x1800)
	    addr -= 0x1000;
	else if (addr < 0x2000)
	    addr -= 0x1800;
    }
    //PPU regs mirroring
    if (addr > 0x2007 && addr < 0x4000) {
	addr = (addr & 7) + 0x2000;
    }

    if (addr == 0x2000)
	return mem_ppu->read_PPUCTRL();
    else if (addr == 0x2001)
	return mem_ppu->read_PPUMASK();
    else if (addr == 0x2002)
	return mem_ppu->read_PPUSTATUS();
    else if (addr == 0x2007)
        return mem_ppu->read_PPUDATA();
    else if (addr == 0x4016) {
	uint8_t result = controller_latch & 1;
	controller_latch = controller_latch >> 1;
	controller_latch |= 0x80;
	return result;
    }
    else
        return ram[addr];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movzwl -0x12(%rbp), %eax
cmpl $0x7ff, %eax            # imm = 0x7FF
jle 0x4a98
movzwl -0x12(%rbp), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jge 0x4a60
movzwl -0x12(%rbp), %eax
subl $0x800, %eax            # imm = 0x800
movw %ax, -0x12(%rbp)
jmp 0x4a96
movzwl -0x12(%rbp), %eax
cmpl $0x1800, %eax           # imm = 0x1800
jge 0x4a7a
movzwl -0x12(%rbp), %eax
subl $0x1000, %eax           # imm = 0x1000
movw %ax, -0x12(%rbp)
jmp 0x4a94
movzwl -0x12(%rbp), %eax
cmpl $0x2000, %eax           # imm = 0x2000
jge 0x4a92
movzwl -0x12(%rbp), %eax
subl $0x1800, %eax           # imm = 0x1800
movw %ax, -0x12(%rbp)
jmp 0x4a94
jmp 0x4a96
jmp 0x4a98
movzwl -0x12(%rbp), %eax
cmpl $0x2007, %eax           # imm = 0x2007
jle 0x4abe
movzwl -0x12(%rbp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jge 0x4abe
movzwl -0x12(%rbp), %eax
andl $0x7, %eax
addl $0x2000, %eax           # imm = 0x2000
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
cmpl $0x2000, %eax           # imm = 0x2000
jne 0x4ae1
movq -0x20(%rbp), %rax
movq 0x10000(%rax), %rdi
callq 0x5690
movb %al, -0x1(%rbp)
jmp 0x4b98
movzwl -0x12(%rbp), %eax
cmpl $0x2001, %eax           # imm = 0x2001
jne 0x4b04
movq -0x20(%rbp), %rax
movq 0x10000(%rax), %rdi
callq 0x5ad0
movb %al, -0x1(%rbp)
jmp 0x4b98
movzwl -0x12(%rbp), %eax
cmpl $0x2002, %eax           # imm = 0x2002
jne 0x4b24
movq -0x20(%rbp), %rax
movq 0x10000(%rax), %rdi
callq 0x5790
movb %al, -0x1(%rbp)
jmp 0x4b98
movzwl -0x12(%rbp), %eax
cmpl $0x2007, %eax           # imm = 0x2007
jne 0x4b44
movq -0x20(%rbp), %rax
movq 0x10000(%rax), %rdi
callq 0x57f0
movb %al, -0x1(%rbp)
jmp 0x4b98
movzwl -0x12(%rbp), %eax
cmpl $0x4016, %eax           # imm = 0x4016
jne 0x4b8a
movq -0x20(%rbp), %rax
movzbl 0x10008(%rax), %ecx
andl $0x1, %ecx
movb %cl, -0x13(%rbp)
movzbl 0x10008(%rax), %ecx
sarl %ecx
movb %cl, 0x10008(%rax)
movzbl 0x10008(%rax), %ecx
orl $0x80, %ecx
movb %cl, 0x10008(%rax)
movb -0x13(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x4b98
movq -0x20(%rbp), %rax
movzwl -0x12(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/mem.cpp
// Function: Mem::read_word(unsigned short)
uint16_t Mem::read_word(uint16_t addr) {
    //Mirroring
    if (addr > 0x07FF) {
	if (addr < 0x1000)
	    addr -= 0x0800;
	else if (addr < 0x1800)
	    addr -= 0x1000;
	else if (addr < 0x2000)
	    addr -= 0x1800;
    }
    //PPU regs mirroring
    if (addr > 0x2007 && addr < 0x4000) {
	addr = (addr & 7) + 0x2000;
    }
    uint16_t result;
    uint8_t lower, upper;
    lower = ram[addr];
    upper = ram[addr+1];
    result = ((uint16_t) upper << 8) | (uint16_t) lower; //$HHLL
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0x7ff, %eax            # imm = 0x7FF
jle 0x4c24
movzwl -0xa(%rbp), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jge 0x4bec
movzwl -0xa(%rbp), %eax
subl $0x800, %eax            # imm = 0x800
movw %ax, -0xa(%rbp)
jmp 0x4c22
movzwl -0xa(%rbp), %eax
cmpl $0x1800, %eax           # imm = 0x1800
jge 0x4c06
movzwl -0xa(%rbp), %eax
subl $0x1000, %eax           # imm = 0x1000
movw %ax, -0xa(%rbp)
jmp 0x4c20
movzwl -0xa(%rbp), %eax
cmpl $0x2000, %eax           # imm = 0x2000
jge 0x4c1e
movzwl -0xa(%rbp), %eax
subl $0x1800, %eax           # imm = 0x1800
movw %ax, -0xa(%rbp)
jmp 0x4c20
jmp 0x4c22
jmp 0x4c24
movzwl -0xa(%rbp), %eax
cmpl $0x2007, %eax           # imm = 0x2007
jle 0x4c4a
movzwl -0xa(%rbp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jge 0x4c4a
movzwl -0xa(%rbp), %eax
andl $0x7, %eax
addl $0x2000, %eax           # imm = 0x2000
movw %ax, -0xa(%rbp)
movq -0x18(%rbp), %rax
movzwl -0xa(%rbp), %ecx
movb (%rax,%rcx), %cl
movb %cl, -0xd(%rbp)
movzwl -0xa(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0xe(%rbp)
movzbl -0xe(%rbp), %eax
movzwl %ax, %eax
shll $0x8, %eax
movzbl -0xd(%rbp), %ecx
movzwl %cx, %ecx
orl %ecx, %eax
movw %ax, -0xc(%rbp)
movw -0xc(%rbp), %ax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: NGageMegaman[P]NEScutre/src/mem_ppu.cpp
// Function: Mem_ppu::Mem_ppu()
Mem_ppu::Mem_ppu() {
    PPUCTRL = 0;
    PPUADDR = 0;
    PPUDATA = 0;
    PPUSTATUS = 0;
    OAMADDR = 0;
    OAMDATA = 0;
    ram = (unsigned char*) malloc(PPU_RAM_SIZE);
    oam = (unsigned char*) malloc(256);
    ppuaddr_ptr_hl = 0;
    oamaddr_ptr_hl = 0;
    ppuscroll_ptr_hl = 0;
    in_vblank = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movb $0x0, 0x3c010(%rax)
movw $0x0, 0x3c012(%rax)
movb $0x0, 0x3c014(%rax)
movb $0x0, 0x3c015(%rax)
movw $0x0, 0x3c016(%rax)
movb $0x0, 0x3c018(%rax)
movl $0x4000, %edi           # imm = 0x4000
callq 0x1160
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x100, %edi            # imm = 0x100
callq 0x1160
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movb $0x0, 0x3c01c(%rax)
movb $0x0, 0x3c01d(%rax)
movb $0x0, 0x3c01e(%rax)
movb $0x0, 0x3c01f(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/mem_ppu.cpp
// Function: Mem_ppu::read_byte(unsigned short)
uint8_t Mem_ppu::read_byte(uint16_t addr) {
    //Mirroring
    if (addr > 0x2fff && addr < 0x3f00)
	addr = addr - 0x1000;
    else if (addr > 0x3f1f && addr < 0x4000)
	addr = addr - 0x0020;
    //Pallette mirroring
    if (addr == 0x3f10)
	addr = 0x3f00;
    else if (addr == 0x3f14)
	addr = 0x3f04;
    else if (addr == 0x3f18)
	addr = 0x3f08;
    else if (addr == 0x3f1c)
	addr = 0x3f1c;

    return ram[addr];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0x2fff, %eax           # imm = 0x2FFF
jle 0x530c
movzwl -0xa(%rbp), %eax
cmpl $0x3f00, %eax           # imm = 0x3F00
jge 0x530c
movzwl -0xa(%rbp), %eax
subl $0x1000, %eax           # imm = 0x1000
movw %ax, -0xa(%rbp)
jmp 0x532f
movzwl -0xa(%rbp), %eax
cmpl $0x3f1f, %eax           # imm = 0x3F1F
jle 0x532d
movzwl -0xa(%rbp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jge 0x532d
movzwl -0xa(%rbp), %eax
subl $0x20, %eax
movw %ax, -0xa(%rbp)
jmp 0x532f
movzwl -0xa(%rbp), %eax
cmpl $0x3f10, %eax           # imm = 0x3F10
jne 0x5342
movw $0x3f00, -0xa(%rbp)     # imm = 0x3F00
jmp 0x537f
movzwl -0xa(%rbp), %eax
cmpl $0x3f14, %eax           # imm = 0x3F14
jne 0x5355
movw $0x3f04, -0xa(%rbp)     # imm = 0x3F04
jmp 0x537d
movzwl -0xa(%rbp), %eax
cmpl $0x3f18, %eax           # imm = 0x3F18
jne 0x5368
movw $0x3f08, -0xa(%rbp)     # imm = 0x3F08
jmp 0x537b
movzwl -0xa(%rbp), %eax
cmpl $0x3f1c, %eax           # imm = 0x3F1C
jne 0x5379
movw $0x3f1c, -0xa(%rbp)     # imm = 0x3F1C
jmp 0x537b
jmp 0x537d
jmp 0x537f
movq -0x18(%rbp), %rax
movq (%rax), %rax
movzwl -0xa(%rbp), %ecx
movb (%rax,%rcx), %al
popq %rbp
retq
nop
// File: NGageMegaman[P]NEScutre/src/mem_ppu.cpp
// Function: Mem_ppu::read_word(unsigned short)
uint16_t Mem_ppu::read_word(uint16_t addr) {
    //Mirroring
    if (addr > 0x2fff && addr < 0x3f00)
	addr = addr - 0x1000;
    else if (addr > 0x3f1f && addr < 0x4000)
	addr = addr - 0x0020;
    //Pallette mirroring
    if (addr == 0x3f10)
	addr = 0x3f00;
    else if (addr == 0x3f14)
	addr = 0x3f04;
    else if (addr == 0x3f18)
	addr = 0x3f08;
    else if (addr == 0x3f1c)
	addr = 0x3f1c;
    uint16_t result;
    uint8_t lower, upper;
    lower = ram[addr&0xFFFE];
    upper = ram[addr|0x0001];
    result = ((uint16_t) upper << 8) | (uint16_t) lower; //$HHLL
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0x2fff, %eax           # imm = 0x2FFF
jle 0x53cc
movzwl -0xa(%rbp), %eax
cmpl $0x3f00, %eax           # imm = 0x3F00
jge 0x53cc
movzwl -0xa(%rbp), %eax
subl $0x1000, %eax           # imm = 0x1000
movw %ax, -0xa(%rbp)
jmp 0x53ef
movzwl -0xa(%rbp), %eax
cmpl $0x3f1f, %eax           # imm = 0x3F1F
jle 0x53ed
movzwl -0xa(%rbp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jge 0x53ed
movzwl -0xa(%rbp), %eax
subl $0x20, %eax
movw %ax, -0xa(%rbp)
jmp 0x53ef
movzwl -0xa(%rbp), %eax
cmpl $0x3f10, %eax           # imm = 0x3F10
jne 0x5402
movw $0x3f00, -0xa(%rbp)     # imm = 0x3F00
jmp 0x543f
movzwl -0xa(%rbp), %eax
cmpl $0x3f14, %eax           # imm = 0x3F14
jne 0x5415
movw $0x3f04, -0xa(%rbp)     # imm = 0x3F04
jmp 0x543d
movzwl -0xa(%rbp), %eax
cmpl $0x3f18, %eax           # imm = 0x3F18
jne 0x5428
movw $0x3f08, -0xa(%rbp)     # imm = 0x3F08
jmp 0x543b
movzwl -0xa(%rbp), %eax
cmpl $0x3f1c, %eax           # imm = 0x3F1C
jne 0x5439
movw $0x3f1c, -0xa(%rbp)     # imm = 0x3F1C
jmp 0x543b
jmp 0x543d
jmp 0x543f
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movzwl -0xa(%rbp), %edx
andl $0xfffe, %edx           # imm = 0xFFFE
movslq %edx, %rdx
movb (%rcx,%rdx), %cl
movb %cl, -0xd(%rbp)
movq (%rax), %rax
movzwl -0xa(%rbp), %ecx
orl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0xe(%rbp)
movzbl -0xe(%rbp), %eax
movzwl %ax, %eax
shll $0x8, %eax
movzbl -0xd(%rbp), %ecx
movzwl %cx, %ecx
orl %ecx, %eax
movw %ax, -0xc(%rbp)
movw -0xc(%rbp), %ax
popq %rbp
retq
nopl (%rax)
// File: NGageMegaman[P]NEScutre/src/mem_ppu.cpp
// Function: Mem_ppu::write_byte(unsigned short, unsigned char)
void Mem_ppu::write_byte(uint16_t addr, uint8_t data) {
    //Mirroring
    if (addr > 0x2fff && addr < 0x3f00)
	addr = addr - 0x1000;
    else if (addr > 0x3f1f && addr < 0x4000)
	addr = addr - 0x0020;
    //Pallette mirroring
    if (addr == 0x3f10)
	addr = 0x3f00;
    else if (addr == 0x3f14)
	addr = 0x3f04;
    else if (addr == 0x3f18)
	addr = 0x3f08;
    else if (addr == 0x3f1c)
	addr = 0x3f1c;
    ram[addr] = data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dl, %al
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movb %al, -0xb(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0x2fff, %eax           # imm = 0x2FFF
jle 0x54d1
movzwl -0xa(%rbp), %eax
cmpl $0x3f00, %eax           # imm = 0x3F00
jge 0x54d1
movzwl -0xa(%rbp), %eax
subl $0x1000, %eax           # imm = 0x1000
movw %ax, -0xa(%rbp)
jmp 0x54f4
movzwl -0xa(%rbp), %eax
cmpl $0x3f1f, %eax           # imm = 0x3F1F
jle 0x54f2
movzwl -0xa(%rbp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jge 0x54f2
movzwl -0xa(%rbp), %eax
subl $0x20, %eax
movw %ax, -0xa(%rbp)
jmp 0x54f4
movzwl -0xa(%rbp), %eax
cmpl $0x3f10, %eax           # imm = 0x3F10
jne 0x5507
movw $0x3f00, -0xa(%rbp)     # imm = 0x3F00
jmp 0x5544
movzwl -0xa(%rbp), %eax
cmpl $0x3f14, %eax           # imm = 0x3F14
jne 0x551a
movw $0x3f04, -0xa(%rbp)     # imm = 0x3F04
jmp 0x5542
movzwl -0xa(%rbp), %eax
cmpl $0x3f18, %eax           # imm = 0x3F18
jne 0x552d
movw $0x3f08, -0xa(%rbp)     # imm = 0x3F08
jmp 0x5540
movzwl -0xa(%rbp), %eax
cmpl $0x3f1c, %eax           # imm = 0x3F1C
jne 0x553e
movw $0x3f1c, -0xa(%rbp)     # imm = 0x3F1C
jmp 0x5540
jmp 0x5542
jmp 0x5544
movq -0x18(%rbp), %rax
movb -0xb(%rbp), %dl
movq (%rax), %rax
movzwl -0xa(%rbp), %ecx
movb %dl, (%rax,%rcx)
popq %rbp
retq
nopw (%rax,%rax)