LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::cmp_indirect_y(NES::MemoryUnit&)
void CPU::cmp_indirect_y(MemoryUnit &r) {
    // Compare Accumulator: Zero Page Y indexed
    // PC += 2

    instPtr++;
    uint16_t alpha = regY, beta = r.getByteAt(instPtr);
    instPtr++;
    uint16_t kapa = r.getByteAt(beta), napa = r.getByteAt((beta+1)%256);
    uint16_t addr = kapa|(napa<<8);
    uint8_t val = regAcc-r.getByteAt(addr+alpha);

    setCarryFlag(1);
    if (val == 0) {
        setZeroFlag(1);
    } else {
        setZeroFlag(0);
    }
    if (val >= 0x80) {
        setNegetiveFlag(1);
    } else {
        setNegetiveFlag(0);
    }
    if (regAcc < r.getByteAt(addr+alpha)) {
        setCarryFlag(0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x6(%rdi), %esi
incl %esi
movw %si, 0x6(%rdi)
movzbl 0x2(%rdi), %r13d
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %esi
movq %r14, %rdi
callq 0x5af4
incw 0x6(%rbx)
movzbl %al, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x5af4
movl %eax, %r12d
incb %r15b
movzbl %r15b, %esi
movq %r14, %rdi
callq 0x5af4
movzbl %r12b, %ecx
addl %r13d, %ecx
movzbl %al, %r15d
shll $0x8, %r15d
addl %ecx, %r15d
movb (%rbx), %r12b
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x5af4
movb (%rbx), %r13b
movb 0x3(%rbx), %cl
movl %ecx, %edx
andb $-0x8, %dl
orb $0x4, %dl
orb $0x5, %cl
subb %al, %r12b
movzbl %cl, %eax
movzbl %dl, %ecx
cmovel %eax, %ecx
andb $-0x3, %cl
shrb $0x6, %r12b
andb $0x2, %r12b
orb %cl, %r12b
movb %r12b, 0x3(%rbx)
movq %r14, %rdi
movl %r15d, %esi
callq 0x5af4
cmpb %al, %r13b
jae 0x414a
andb $-0x5, 0x3(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::cmp_zeropg_x(NES::MemoryUnit&)
void CPU::cmp_zeropg_x(MemoryUnit &r) {
    // Compare Accumulator: Zero Page X Indexed
    // PC += 2

    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr), beta = regX;
    instPtr++;
    uint16_t addr = (alpha + regX)%256;
    uint8_t val = regAcc-r.getByteAt(addr);

    setCarryFlag(1);
    if (val == 0) {
        setZeroFlag(1);
    } else {
        setZeroFlag(0);
    }
    if (val >= 0x80) {
        setNegetiveFlag(1);
    } else {
        setNegetiveFlag(0);
    }
    if (regAcc < r.getByteAt(addr)) {
        setCarryFlag(0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x6(%rdi), %eax
incl %eax
movw %ax, 0x6(%rdi)
movzwl %ax, %esi
movq %r14, %rdi
callq 0x5af4
incw 0x6(%rbx)
addb 0x1(%rbx), %al
movb (%rbx), %r12b
movzbl %al, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x5af4
movb (%rbx), %r13b
movb 0x3(%rbx), %cl
movl %ecx, %edx
andb $-0x8, %dl
orb $0x4, %dl
orb $0x5, %cl
subb %al, %r12b
movzbl %cl, %eax
movzbl %dl, %ecx
cmovel %eax, %ecx
andb $-0x3, %cl
shrb $0x6, %r12b
andb $0x2, %r12b
orb %cl, %r12b
movb %r12b, 0x3(%rbx)
movq %r14, %rdi
movl %r15d, %esi
callq 0x5af4
cmpb %al, %r13b
jae 0x41df
andb $-0x5, 0x3(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::cmp_absolute_y(NES::MemoryUnit&)
void CPU::cmp_absolute_y(MemoryUnit &r) {
    // Compare Accumulator: Absolute addressing indexed Y
    // PC += 3
    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr);
    instPtr++;
    uint8_t beta = r.getByteAt(instPtr);
    instPtr++;
    uint16_t addr = (alpha|(beta<<8));
    addr += regY;
    uint8_t val = regAcc-r.getByteAt(addr);

    setCarryFlag(1);
    if (val == 0) {
        setZeroFlag(1);
    } else {
        setZeroFlag(0);
    }
    if (val >= 0x80) {
        setNegetiveFlag(1);
    } else {
        setNegetiveFlag(0);
    }
    if (regAcc < r.getByteAt(addr)) {
        setCarryFlag(0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x6(%rdi), %esi
incl %esi
movw %si, 0x6(%rdi)
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %esi
movq %r14, %rdi
callq 0x5af4
movl %eax, %r15d
movzwl 0x6(%rbx), %esi
incl %esi
movw %si, 0x6(%rbx)
andl %r12d, %esi
movq %r14, %rdi
callq 0x5af4
incw 0x6(%rbx)
movzbl %r15b, %ecx
movzbl %al, %eax
shll $0x8, %eax
orl %ecx, %eax
movzbl 0x2(%rbx), %r15d
addl %eax, %r15d
movb (%rbx), %r13b
andl %r12d, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x5af4
movb (%rbx), %r12b
movb 0x3(%rbx), %cl
movl %ecx, %edx
andb $-0x8, %dl
orb $0x4, %dl
orb $0x5, %cl
subb %al, %r13b
movzbl %cl, %eax
movzbl %dl, %ecx
cmovel %eax, %ecx
andb $-0x3, %cl
shrb $0x6, %r13b
andb $0x2, %r13b
orb %cl, %r13b
movb %r13b, 0x3(%rbx)
movq %r14, %rdi
movl %r15d, %esi
callq 0x5af4
cmpb %al, %r12b
jae 0x42a1
andb $-0x5, 0x3(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::asl_zeropg(NES::MemoryUnit&)
void CPU::asl_zeropg(MemoryUnit &r) {
    // Shifts one bit by left and set the shifted bit to carry flag
    // PC += 2
    instPtr++;
    uint8_t addr = r.getByteAt(instPtr);
    uint8_t val = r.getByteAt(addr);
    instPtr++;
    if (val & 0x80) setCarryFlag(1);
    else setCarryFlag(0);
    val = val << 1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %eax
incl %eax
movw %ax, 0x6(%rdi)
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x5af4
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
incw 0x6(%r14)
movb 0x3(%r14), %cl
andb $-0x8, %cl
movl %eax, %edx
shrb $0x5, %dl
orb %dl, %cl
addb %al, %al
sete %sil
andb $-0x4, %cl
orb %sil, %cl
andb $0x2, %dl
orb %cl, %dl
movb %dl, 0x3(%r14)
movzbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::asl_accumulator(NES::MemoryUnit&)
void CPU::asl_accumulator(MemoryUnit &r) {
    // Shifts one bit by left and set the shifted bit to carry flag
    // PC += 1
    instPtr++;
    uint8_t val = getAccumulator();
    if (val & 0x80) setCarryFlag(1);
    else setCarryFlag(0);
    val = val << 1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    setAccumulator(val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
incw 0x6(%rdi)
movb (%rdi), %al
movb 0x3(%rdi), %cl
andb $-0x8, %cl
movl %eax, %edx
shrb $0x5, %dl
orb %cl, %dl
addb %al, %al
sete %cl
andb $-0x4, %dl
orb %cl, %dl
movb %al, (%rdi)
movb %dl, 0x3(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::asl_absolute(NES::MemoryUnit&)
void CPU::asl_absolute(MemoryUnit &r) {
    // Shifts one bit by left and set the shifted bit to carry flag
    // PC += 3
    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr);
    instPtr++;
    uint8_t beta = r.getByteAt(instPtr);
    instPtr++;
    uint16_t addr = (beta << 8) | alpha;
    uint8_t val = r.getByteAt(addr);
    if (val & 0x80) setCarryFlag(1);
    else setCarryFlag(0);
    val = val << 1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %esi
incl %esi
movw %si, 0x6(%rdi)
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
movzbl %al, %eax
shll $0x8, %eax
movzbl %r15b, %r15d
orl %eax, %r15d
andl %r12d, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
movb 0x3(%r14), %cl
andb $-0x8, %cl
movl %eax, %edx
shrb $0x5, %dl
orb %dl, %cl
addb %al, %al
sete %sil
andb $-0x4, %cl
orb %sil, %cl
andb $0x2, %dl
orb %cl, %dl
movb %dl, 0x3(%r14)
movzbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::asl_zeropg_x(NES::MemoryUnit&)
void CPU::asl_zeropg_x(MemoryUnit &r) {
    // Shifts one bit by left and set the shifted bit to carry flag
    // PC += 2
    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr), beta = regX;
    instPtr++;
    uint8_t addr = alpha+beta;
    uint8_t val = r.getByteAt(addr);

    if (val & 0x80) setCarryFlag(1);
    else setCarryFlag(0);
    val = val << 1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %eax
incl %eax
movw %ax, 0x6(%rdi)
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
addb 0x1(%r14), %al
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
movb 0x3(%r14), %cl
andb $-0x8, %cl
movl %eax, %edx
shrb $0x5, %dl
orb %dl, %cl
addb %al, %al
sete %sil
andb $-0x4, %cl
orb %sil, %cl
andb $0x2, %dl
orb %cl, %dl
movb %dl, 0x3(%r14)
movzbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::asl_absolute_x(NES::MemoryUnit&)
void CPU::asl_absolute_x(MemoryUnit &r) {
    // Shifts one bit by left and set the shifted bit to carry flag
    // PC += 3

    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr);
    instPtr++;
    uint8_t beta = r.getByteAt(instPtr);
    instPtr++;
    uint8_t addr = ((beta<<8)|alpha)+regX;
    uint8_t val = r.getByteAt(addr);

    if (val & 0x80) setCarryFlag(1);
    else setCarryFlag(0);
    val = val << 1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %esi
incl %esi
movw %si, 0x6(%rdi)
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
addb 0x1(%r14), %r15b
movzbl %r15b, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
movb 0x3(%r14), %cl
andb $-0x8, %cl
movl %eax, %edx
shrb $0x5, %dl
orb %dl, %cl
addb %al, %al
sete %sil
andb $-0x4, %cl
orb %sil, %cl
andb $0x2, %dl
orb %cl, %dl
movb %dl, 0x3(%r14)
movzbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::rol_zeropg(NES::MemoryUnit&)
void CPU::rol_zeropg(MemoryUnit &r) {
    // Shifts one bit by left take shifted as carry and
    // set the shifted bit to carry flag 
    // PC += 2
    instPtr++;
    uint8_t addr = r.getByteAt(instPtr);
    uint8_t val = r.getByteAt(addr);
    uint8_t c = val&0x80;
    instPtr++;
    val = val << 1;
    val = val | (getCarryFlag());
    if (c == 0) setCarryFlag(0);
    else setCarryFlag(1);
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %eax
incl %eax
movw %ax, 0x6(%rdi)
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x5af4
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
incw 0x6(%r14)
leal (%rax,%rax), %ecx
movb 0x3(%r14), %dl
movl %edx, %esi
shrb $0x2, %sil
andb $0x1, %sil
orb %cl, %sil
andb $-0x8, %dl
shrb $0x5, %al
movl %eax, %ecx
andb $0x4, %cl
orb %dl, %cl
testb %sil, %sil
sete %dl
orb %cl, %dl
andb $0x2, %al
orb %dl, %al
movb %al, 0x3(%r14)
movzbl %sil, %edx
movq %rbx, %rdi
movl %r15d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::rol_accumulator(NES::MemoryUnit&)
void CPU::rol_accumulator(MemoryUnit &r) {
    // Shifts one bit by left take shifted as carry and
    // set the shifted bit to carry flag 
    // PC += 1
    instPtr++;
    uint8_t val = getAccumulator();
    uint8_t c = val&0x80;
    val = val << 1;
    val = val | (getCarryFlag());
    if (c == 0) setCarryFlag(0);
    else setCarryFlag(1);
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    setAccumulator(val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
incw 0x6(%rdi)
movb (%rdi), %al
movb 0x3(%rdi), %cl
leal (%rax,%rax), %edx
movl %ecx, %esi
shrb $0x2, %sil
andb $0x1, %sil
andb $-0x8, %cl
shrb $0x5, %al
andb $0x4, %al
orb %cl, %al
orb %sil, %dl
sete %cl
movb %dl, (%rdi)
addb %sil, %sil
orb %cl, %sil
orb %al, %sil
movb %sil, 0x3(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::rol_absolute(NES::MemoryUnit&)
void CPU::rol_absolute(MemoryUnit &r) {
    // Shifts one bit by left take shifted as carry and
    // set the shifted bit to carry flag 
    // PC += 3

    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr);
    instPtr++;
    uint8_t beta = r.getByteAt(instPtr);
    instPtr++;
    uint16_t addr = (beta << 8) | alpha;
    uint8_t val = r.getByteAt(addr);
    uint8_t c = val&0x80;
    val = val << 1;
    val = val | (getCarryFlag());
    if (c == 0) setCarryFlag(0);
    else setCarryFlag(1);
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %esi
incl %esi
movw %si, 0x6(%rdi)
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
movzbl %al, %eax
shll $0x8, %eax
movzbl %r15b, %r15d
orl %eax, %r15d
andl %r12d, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
leal (%rax,%rax), %ecx
movb 0x3(%r14), %dl
movl %edx, %esi
shrb $0x2, %sil
andb $0x1, %sil
orb %cl, %sil
andb $-0x8, %dl
shrb $0x5, %al
movl %eax, %ecx
andb $0x4, %cl
orb %dl, %cl
testb %sil, %sil
sete %dl
orb %cl, %dl
andb $0x2, %al
orb %dl, %al
movb %al, 0x3(%r14)
movzbl %sil, %edx
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::rol_zeropg_x(NES::MemoryUnit&)
void CPU::rol_zeropg_x(MemoryUnit &r) {
    // Shifts one bit by left take shifted as carry and
    // set the shifted bit to carry flag 
    // PC += 2
    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr), beta = regX;
    instPtr++;
    uint8_t addr = alpha+beta;
    uint8_t val = r.getByteAt(addr);

    uint8_t c = val&0x80;
    val = val << 1;
    val = val | (getCarryFlag());
    if (c == 0) setCarryFlag(0);
    else setCarryFlag(1);
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %eax
incl %eax
movw %ax, 0x6(%rdi)
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
addb 0x1(%r14), %al
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
leal (%rax,%rax), %ecx
movb 0x3(%r14), %dl
movl %edx, %esi
shrb $0x2, %sil
andb $0x1, %sil
orb %cl, %sil
andb $-0x8, %dl
shrb $0x5, %al
movl %eax, %ecx
andb $0x4, %cl
orb %dl, %cl
testb %sil, %sil
sete %dl
orb %cl, %dl
andb $0x2, %al
orb %dl, %al
movb %al, 0x3(%r14)
movzbl %sil, %edx
movq %rbx, %rdi
movl %r15d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::rol_absolute_x(NES::MemoryUnit&)
void CPU::rol_absolute_x(MemoryUnit &r) {
    // Shifts one bit by left take shifted as carry and
    // set the shifted bit to carry flag 
    // PC += 3
    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr);
    instPtr++;
    uint8_t beta = r.getByteAt(instPtr);
    instPtr++;
    uint8_t addr = ((beta<<8)|alpha)+regX;
    uint8_t val = r.getByteAt(addr);

    uint8_t c = val&0x80;
    val = val << 1;
    val = val | (getCarryFlag());
    if (c == 0) setCarryFlag(0);
    else setCarryFlag(1);
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %esi
incl %esi
movw %si, 0x6(%rdi)
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
addb 0x1(%r14), %r15b
movzbl %r15b, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
leal (%rax,%rax), %ecx
movb 0x3(%r14), %dl
movl %edx, %esi
shrb $0x2, %sil
andb $0x1, %sil
orb %cl, %sil
andb $-0x8, %dl
shrb $0x5, %al
movl %eax, %ecx
andb $0x4, %cl
orb %dl, %cl
testb %sil, %sil
sete %dl
orb %cl, %dl
andb $0x2, %al
orb %dl, %al
movb %al, 0x3(%r14)
movzbl %sil, %edx
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::opcodeNotAvailable(unsigned char)
bool CPU::opcodeNotAvailable(uint8_t opcode) {
    if (opcodeBag.find(opcode) == opcodeBag.end()) {
        return true;
    } else {
        return false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
movq 0x40(%rdi), %r9
movq 0x48(%rdi), %r8
xorl %r10d, %r10d
xorl %edx, %edx
divq %r8
movq %rdx, %rcx
movl %ecx, %eax
movq (%r9,%rax,8), %rax
testq %rax, %rax
je 0x48e8
movq (%rax), %r9
movq %rax, %r10
cmpb %sil, 0x8(%r9)
je 0x48e8
movq %r9, %r11
movq (%r9), %r9
testq %r9, %r9
je 0x48e5
movzbl 0x8(%r9), %edi
movq %rdi, %rax
xorl %edx, %edx
divq %r8
movl $0x0, %r10d
cmpq %rcx, %rdx
jne 0x48e8
movq %r11, %r10
cmpb %sil, %dil
jne 0x48b8
jmp 0x48e8
xorl %r10d, %r10d
testq %r10, %r10
je 0x48f6
cmpq $0x0, (%r10)
sete %al
jmp 0x48f8
movb $0x1, %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::changeFlags(unsigned char, unsigned char)
void CPU::changeFlags(uint8_t carry, uint8_t overflow) {
    const uint8_t x = regAcc;
    // ZeroFlag
    if (x == 0) {
        flags = flags | (1<<0);
    } else {
        flags = flags & (~(1<<0));
    }
    
    // Negetive flag
    if (x & (1<<7) != 0) {
        flags = flags | (1<<1);
    } else {
        flags = flags & (~(1<<1));
    }

    // Carry Flag
    if (carry == 0) {
        flags = flags & (~(1<<2));
    } else if (carry == 1){
        flags = flags | (1<<2);
    }
    //
    if (overflow == 0) {
        flags = flags & (~(1<<3));
    } else if(overflow == 1) {
        flags = flags | (1<<3);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rdi), %al
movb 0x3(%rdi), %cl
testb %al, %al
sete %r8b
andb $-0x4, %cl
orb %r8b, %cl
addb %al, %al
andb $0x2, %al
orb %cl, %al
movb %al, 0x3(%rdi)
cmpl $0x1, %esi
je 0x4927
testl %esi, %esi
jne 0x492b
andb $-0x5, 0x3(%rdi)
jmp 0x492b
orb $0x4, 0x3(%rdi)
cmpb $0x1, %dl
je 0x493d
movzbl %dl, %eax
testl %eax, %eax
jne 0x4941
andb $-0x9, 0x3(%rdi)
jmp 0x4941
orb $0x8, 0x3(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::lsr_zeropg(NES::MemoryUnit&)
void CPU::lsr_zeropg(MemoryUnit &r) {
    // Shift one bit to the right similar to reverse-ASL
    // PC += 2
    instPtr++;
    uint8_t addr = r.getByteAt(instPtr);
    instPtr++;
    uint8_t val = r.getByteAt(addr);
    if (val&1) setCarryFlag(1);
    else setCarryFlag(0);
    val = val>>1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %eax
incl %eax
movw %ax, 0x6(%rdi)
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
movb 0x3(%r14), %cl
andb $-0x8, %cl
leal (,%rax,4), %edx
andb $0x4, %dl
orb %cl, %dl
cmpb $0x2, %al
setb %cl
orb %dl, %cl
movb %cl, 0x3(%r14)
shrb %al
movzbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::lsr_accumulator(NES::MemoryUnit&)
void CPU::lsr_accumulator(MemoryUnit &r) {
    // Shift one bit to the right similar to reverse-ASL
    // PC += 1

    instPtr++;
    uint8_t val = regAcc;

    if (val&1) setCarryFlag(1);
    else setCarryFlag(0);
    val = val>>1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    regAcc = val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
incw 0x6(%rdi)
movb (%rdi), %al
movb 0x3(%rdi), %cl
andb $-0x8, %cl
leal (,%rax,4), %edx
andb $0x4, %dl
orb %cl, %dl
cmpb $0x2, %al
setb %cl
orb %dl, %cl
movb %cl, 0x3(%rdi)
shrb %al
movb %al, (%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::lsr_absolute(NES::MemoryUnit&)
void CPU::lsr_absolute(MemoryUnit &r) {
    // Shift one bit to the right similar to reverse-ASL
    // PC += 3
    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr);
    instPtr++;
    uint8_t beta = r.getByteAt(instPtr);
    instPtr++;
    uint16_t addr = (beta<<8)|alpha;
    uint8_t val = r.getByteAt(addr);

    if (val&1) setCarryFlag(1);
    else setCarryFlag(0);
    val = val>>1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %esi
incl %esi
movw %si, 0x6(%rdi)
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
movzbl %al, %eax
shll $0x8, %eax
movzbl %r15b, %r15d
orl %eax, %r15d
andl %r12d, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
movb 0x3(%r14), %cl
andb $-0x8, %cl
leal (,%rax,4), %edx
andb $0x4, %dl
orb %cl, %dl
cmpb $0x2, %al
setb %cl
orb %dl, %cl
movb %cl, 0x3(%r14)
shrb %al
movzbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::lsr_zeropg_x(NES::MemoryUnit&)
void CPU::lsr_zeropg_x(MemoryUnit &r) {
    // Shift one bit to the right similar to reverse-ASL
    // PC += 2
    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr), beta = regX;
    instPtr++;
    uint8_t addr = alpha+beta;
    uint8_t val = r.getByteAt(addr);

    if (val & 1) setCarryFlag(1);
    else setCarryFlag(0);
    val = val >> 1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %eax
incl %eax
movw %ax, 0x6(%rdi)
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
addb 0x1(%r14), %al
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
movb 0x3(%r14), %cl
andb $-0x8, %cl
leal (,%rax,4), %edx
andb $0x4, %dl
orb %cl, %dl
cmpb $0x2, %al
setb %cl
orb %dl, %cl
movb %cl, 0x3(%r14)
shrb %al
movzbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::lsr_absolute_x(NES::MemoryUnit&)
void CPU::lsr_absolute_x(MemoryUnit &r) {
    // Shift one bit to the right similar to reverse-ASL
    // PC += 3

    instPtr++;
    uint8_t alpha = r.getByteAt(instPtr);
    instPtr++;
    uint8_t beta = r.getByteAt(instPtr);
    instPtr++;
    uint8_t addr = ((beta<<8)|alpha)+regX;
    uint8_t val = r.getByteAt(addr);

    if (val & 1) setCarryFlag(1);
    else setCarryFlag(0);
    val = val >> 1;
    if (val == 0) setZeroFlag(1);
    else setZeroFlag(0);
    if (val & 0x80) setNegetiveFlag(1);
    else setNegetiveFlag(0);
    r.setByteAt(addr, val);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %esi
incl %esi
movw %si, 0x6(%rdi)
movl $0xffff, %r12d          # imm = 0xFFFF
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5af4
incw 0x6(%r14)
addb 0x1(%r14), %r15b
movzbl %r15b, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5af4
movb 0x3(%r14), %cl
andb $-0x8, %cl
leal (,%rax,4), %edx
andb $0x4, %dl
orb %cl, %dl
cmpb $0x2, %al
setb %cl
orb %dl, %cl
movb %cl, 0x3(%r14)
shrb %al
movzbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5ad4
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/cpu.cpp
// Function: NES::CPU::executeInstruction(NES::MemoryUnit&)
bool CPU::executeInstruction(MemoryUnit &r) {
    // Runs the opcode after fetching from RAM
    uint8_t opcode = r.getByteAt(instPtr);
    try {
        if (opcodeNotAvailable(opcode)) throw InvalidOpcodeException(opcode);
        opcodeFun fun = opCodes.find(opcode)->second;
        (this->*fun)(r);
        return true;
    } catch (InvalidOpcodeException &e) {
        printf("Warning: %s: %u\n", e.what(), opcode);
        throw e;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movzwl 0x6(%rdi), %esi
movq %r14, %rdi
callq 0x5af4
movl %eax, %r12d
movzbl %al, %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x4888
testb %al, %al
jne 0x4c07
movq %rbx, %rax
xorl %edx, %edx
divq 0x10(%r15)
movq 0x8(%r15), %rax
movl %edx, %ecx
movq (%rax,%rcx,8), %rax
movq (%rax), %rcx
cmpb 0x8(%rcx), %r12b
je 0x4bdd
movq %rcx, %rax
movq (%rcx), %rcx
jmp 0x4bcf
movq (%rax), %rcx
movq 0x10(%rcx), %rax
addq 0x18(%rcx), %r15
testb $0x1, %al
je 0x4bf4
movq (%r15), %rcx
movq -0x1(%rcx,%rax), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *%rax
movb $0x1, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x1090
leaq 0x5188(%rip), %rcx      # 0x9da0
movq %rcx, (%rax)
movb %r12b, 0x8(%rax)
leaq 0x5152(%rip), %rsi      # 0x9d78
movq 0x53bb(%rip), %rdx      # 0x9fe8
movq %rax, %rdi
callq 0x1150
jmp 0x4c99
jmp 0x4c39
movq %rax, %r14
cmpl $0x1, %edx
jne 0x4ca1
movq %r14, %rdi
callq 0x1080
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
leaq 0x1660(%rip), %rdi      # 0x62bc
movq %rax, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1040
movl $0x10, %edi
callq 0x1090
leaq 0x5127(%rip), %rcx      # 0x9da0
movq %rcx, (%rax)
movb 0x8(%r14), %cl
movb %cl, 0x8(%rax)
leaq 0x50ee(%rip), %rsi      # 0x9d78
movq 0x5357(%rip), %rdx      # 0x9fe8
movq %rax, %rdi
callq 0x1150
movq %rax, %r14
callq 0x1140
movq %r14, %rdi
callq 0x1160
movq %rax, %rdi
callq 0x4cc4
nop
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/memory_unit.cpp
// Function: NES::MemoryUnit::getNormalizedAddr(unsigned short, unsigned short*) const
uint16_t MemoryUnit::getNormalizedAddr(uint16_t addr, uint16_t *caseType) const{
    if (addr < 0x2000) {
        // Ram Access
        addr = addr % 0x0800;
        *caseType = 0;
        return addr;
    } else if (0x2000 <= addr && addr < 0x4000) {
        // PPU Reg Access
        *caseType = 1;
        addr = addr - 0x2000;
        addr = addr % 8;
        return addr;
    } else if (0x4000 <= addr && addr < 0x4018) {
        // APU and I/O registers
        *caseType = 2;
        return addr;
    } else if (0x4018 <= addr && addr < 0x4020) {
        // APU and I/O that is normally disabled
        *caseType = 3;
        return addr;
    } else {
        // Cartridge space address
        *caseType = 4;
        return addr;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
cmpl $0x1fff, %esi           # imm = 0x1FFF
ja 0x5a9a
andl $0x7ff, %eax            # imm = 0x7FF
movw $0x0, (%rdx)
jmp 0x5ad2
movzwl %ax, %ecx
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x5aaf
movw $0x1, (%rdx)
andl $0x7, %eax
jmp 0x5ad2
cmpl $0x4017, %ecx           # imm = 0x4017
ja 0x5abe
movw $0x2, (%rdx)
jmp 0x5ad2
cmpl $0x401f, %ecx           # imm = 0x401F
ja 0x5acd
movw $0x3, (%rdx)
jmp 0x5ad2
movw $0x4, (%rdx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/nimitbhardwaj[P]KapaNes/./src/ram_unit.cpp
// Function: NES::Ram::operator=(NES::Ram const&)
Ram &Ram::operator=(const Ram &r) {
    size = r.size;
    memory = new uint8_t[size];
    memcpy(memory, r.memory, size*sizeof(uint8_t));
    return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %r15d
movl %r15d, (%rdi)
movq %r15, %rdi
callq 0x1030
movq %rax, 0x8(%r14)
movq 0x8(%rbx), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x10d0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/poseidon1214[P]logistic-regression-ftrl-mpi/src/load_data.h
// Function: Load_Data::Load_Data(char const*)
Load_Data(const char *file_name){
        fin_.open(file_name, std::ios::in);
        if(!fin_.is_open()){
            std::cout<<"open file error: "<<file_name << std::endl;
            exit(1);
        } 
        std::cout<<file_name<<std::endl;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
movq %rdi, %rbx
callq 0x2200
leaq 0x208(%rbx), %rax
movq %rax, -0x30(%rbp)
leaq 0x220(%rbx), %r15
leaq 0x248(%rbx), %r12
xorl %eax, %eax
movq %rax, 0x258(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x248(%rbx)
leaq 0x270(%rbx), %r14
movups %xmm0, 0x208(%rbx)
movups %xmm0, 0x218(%rbx)
movups %xmm0, 0x228(%rbx)
movq %r14, 0x260(%rbx)
movq %rax, 0x268(%rbx)
movb $0x0, 0x270(%rbx)
movups %xmm0, 0x298(%rbx)
movq %rax, 0x2a8(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
movl $0x8, %edx
callq 0x2130
leaq 0x78(%rbx), %rdi
callq 0x2080
testb %al, %al
je 0x2a2e
testq %r13, %r13
je 0x29d2
movq %r13, %rdi
callq 0x20e0
movq 0x460b(%rip), %rdi      # 0x6fd0
movq %r13, %rsi
movq %rax, %rdx
callq 0x2210
jmp 0x29f0
movq 0x45f7(%rip), %rax      # 0x6fd0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
orl $0x1, %esi
callq 0x2300
movq 0x45d9(%rip), %rdi      # 0x6fd0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq 0x45be(%rip), %rdi      # 0x6fd0
callq 0x2040
movq %rax, %rdi
callq 0x2140
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x459b(%rip), %rdi      # 0x6fd0
leaq 0x2650(%rip), %rsi      # 0x508c
movl $0x11, %edx
callq 0x2210
movq 0x4583(%rip), %rdi      # 0x6fd0
movq %r13, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
movl $0x1, %edi
callq 0x2230
movq %rax, %r13
movq 0x260(%rbx), %rdi
cmpq %r14, %rdi
je 0x2a7b
callq 0x21a0
movq %r12, %rdi
movq %r15, %rsi
callq 0x2370
movq -0x30(%rbp), %rdi
callq 0x31b2
movq %rbx, %rdi
callq 0x2090
movq %r13, %rdi
callq 0x2330
nop
// File: /workspace/github_cpp_makefile_star2_O1/poseidon1214[P]logistic-regression-ftrl-mpi/src/predict.h
// Function: Predict::Predict(Load_Data*, int, int)
Predict(Load_Data* load_data, int total_num_proc, int my_rank) 
            : data(load_data), nproc(total_num_proc), rank(my_rank){
        pctr = 0.0;
        MAX_ARRAY_SIZE = 1000;
        g_all_non_clk = new float[MAX_ARRAY_SIZE];
        g_all_clk = new float[MAX_ARRAY_SIZE];
        g_nclk = new float[MAX_ARRAY_SIZE];
        g_clk = new float[MAX_ARRAY_SIZE];
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rsi, (%rdi)
leaq 0x8(%rdi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq $0x0, 0x18(%rdi)
movl %edx, 0x5c(%rdi)
movl %ecx, 0x60(%rdi)
movl $0x0, 0x58(%rdi)
movl $0x3e8, 0x20(%rdi)      # imm = 0x3E8
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x2030
movq %rax, 0x28(%rbx)
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x2030
movq %rax, 0x30(%rbx)
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x2030
movq %rax, 0x38(%rbx)
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x2030
movq %rax, 0x40(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq (%r14), %rdi
testq %rdi, %rdi
je 0x2def
callq 0x21a0
movq %rbx, %rdi
callq 0x2330
nop
// File: /workspace/github_cpp_makefile_star2_O1/poseidon1214[P]logistic-regression-ftrl-mpi/src/predict.h
// Function: Predict::run(float*)
void run(float* w){
        predict(w);
        double total_clk = 0.0;
        double total_nclk = 0.0;
        double auc = 0.0;
        double total_auc = 0.0;

        merge_clk();
        mpi_auc(nproc, rank, auc);

        if(MASTER_ID == rank){
            printf("AUC = %lf\n", auc);
        }

    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x3d0a
leaq -0x18(%rbp), %r14
movq $0x0, (%r14)
movq %rbx, %rdi
callq 0x3e90
movl 0x5c(%rbx), %esi
movl 0x60(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x3f16
cmpl $0x0, 0x60(%rbx)
jne 0x30dc
movsd -0x18(%rbp), %xmm0
leaq 0x1ffc(%rip), %rdi      # 0x50d1
movb $0x1, %al
callq 0x2050
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/poseidon1214[P]logistic-regression-ftrl-mpi/src/ftrl.h
// Function: FTRL::init()
void init(){
            row = 0;

            loc_w = new float[data->glo_fea_dim]();
            loc_g = new float[data->glo_fea_dim]();
            glo_g = new float[data->glo_fea_dim]();
            loc_z = new float[data->glo_fea_dim]();
            loc_sigma = new float[data->glo_fea_dim]();
            loc_n = new float[data->glo_fea_dim]();
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x0, 0x50(%rdi)
movq 0x40(%rdi), %r13
movq 0x2a0(%r13), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
xorl %r14d, %r14d
negq %rcx
movl $0x0, %r15d
sbbq %r15, %r15
orq %rax, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2120
movq %r12, (%rbx)
movq 0x2a0(%r13), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
negq %rcx
movl $0x0, %r15d
sbbq %r15, %r15
orq %rax, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2120
movq %r12, 0x58(%rbx)
movq 0x2a0(%r13), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
negq %rcx
movl $0x0, %r15d
sbbq %r15, %r15
orq %rax, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2120
movq %r12, 0x60(%rbx)
movq 0x2a0(%r13), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
negq %rcx
movl $0x0, %r15d
sbbq %r15, %r15
orq %rax, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2120
movq %r12, 0x68(%rbx)
movq 0x2a0(%r13), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
negq %rcx
movl $0x0, %r15d
sbbq %r15, %r15
orq %rax, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2120
movq %r12, 0x70(%rbx)
movq 0x2a0(%r13), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
negq %rcx
sbbq %r14, %r14
orq %rax, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2120
movq %r15, 0x78(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/poseidon1214[P]logistic-regression-ftrl-mpi/src/ftrl.h
// Function: FTRL::batch_gradient_calculate(int&)
void batch_gradient_calculate(int &row){
            int index = 0; float value = 0.0; float pctr = 0;
            for(int line = 0; line < batch_size; line++){
                float wx = bias;
                for(int col = 0; col < data->fea_matrix[row].size(); col++){//for one instance
                    index = data->fea_matrix[row][col].idx;
                    value = data->fea_matrix[row][col].val;
                    wx += loc_w[index] * value;
                }
                pctr = sigmoid(wx);
                for(int col = 0; col < data->fea_matrix[row].size(); col++){
                    index = data->fea_matrix[row][col].idx;
                    value = data->fea_matrix[row][col].val;
                    loc_g[index] += (pctr - data->label[row]) * value;
                }
                row++;
            }//end for
        }

// Assembly:
cmpl $0x0, 0xc(%rdi)
jle 0x3a92
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movss 0x16bf(%rip), %xmm2     # 0x5004
movss 0x16bb(%rip), %xmm3     # 0x5008
movss 0x16b7(%rip), %xmm4     # 0x500c
movss 0x16b3(%rip), %xmm5     # 0x5010
movss 0x10(%r14), %xmm0
movq 0x40(%r14), %rax
movslq (%rbx), %rcx
movq 0x208(%rax), %rdx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rax
movq 0x8(%rdx,%rcx,8), %rcx
subq %rax, %rcx
je 0x39b3
sarq $0x4, %rcx
movq (%r14), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
addq $0x8, %rax
xorps %xmm1, %xmm1
cvtsi2ssl (%rax), %xmm1
movslq -0x8(%rax), %rsi
mulss (%rdx,%rsi,4), %xmm1
addss %xmm1, %xmm0
addq $0x10, %rax
decq %rcx
jne 0x3996
ucomiss %xmm0, %xmm3
movaps %xmm2, %xmm1
ja 0x3a0e
ucomiss %xmm5, %xmm0
movaps %xmm4, %xmm1
ja 0x3a0e
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movsd 0x1646(%rip), %xmm0     # 0x5018
callq 0x2320
movss 0x1631(%rip), %xmm5     # 0x5010
movss 0x1625(%rip), %xmm4     # 0x500c
movss 0x1619(%rip), %xmm3     # 0x5008
movss 0x160d(%rip), %xmm2     # 0x5004
movapd %xmm0, %xmm1
addsd 0x161d(%rip), %xmm1     # 0x5020
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsd2ss %xmm0, %xmm1
movq 0x40(%r14), %rsi
movslq (%rbx), %rax
movq 0x208(%rsi), %rdx
leaq (%rax,%rax,2), %rdi
movq (%rdx,%rdi,8), %rcx
movq 0x8(%rdx,%rdi,8), %rdx
subq %rcx, %rdx
je 0x3a77
movq 0x248(%rsi), %rsi
xorps %xmm0, %xmm0
cvtsi2ssl (%rsi,%rax,4), %xmm0
sarq $0x4, %rdx
subss %xmm0, %xmm1
movq 0x58(%r14), %rsi
cmpq $0x1, %rdx
adcq $0x0, %rdx
addq $0x8, %rcx
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx), %xmm0
movslq -0x8(%rcx), %rdi
mulss %xmm1, %xmm0
addss (%rsi,%rdi,4), %xmm0
movss %xmm0, (%rsi,%rdi,4)
addq $0x10, %rcx
decq %rdx
jne 0x3a55
incl %eax
movl %eax, (%rbx)
incl %r15d
cmpl 0xc(%r14), %r15d
jl 0x395d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/poseidon1214[P]logistic-regression-ftrl-mpi/src/predict.h
// Function: Predict::predict(float*)
void predict(float* glo_w){
        //std::cout<<"glo_w size "<<glo_w.size()<<std::endl;
        for(int i = 0; i < data->fea_matrix.size(); i++) {
	        float x = 0.0;
            for(int j = 0; j < data->fea_matrix[i].size(); j++) {
                long int idx = data->fea_matrix[i][j].idx;
                int val = data->fea_matrix[i][j].val;
                x += glo_w[idx] * val;
            }

            if(x < -30){
                pctr = 1e-6;
            }
            else if(x > 30){
                pctr = 1.0;
            }
            else{
                double ex = pow(2.718281828, x);
                pctr = ex / (1.0 + ex);
            }
            int id = int(pctr*MAX_ARRAY_SIZE);
            clkinfo clickinfo;
            clickinfo.clk = data->label[i];
            clickinfo.nclk = 1 - data->label[i];
            clickinfo.idx = id;
            result_list.push_back(clickinfo);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rdi), %rax
movq 0x208(%rax), %rcx
cmpq %rcx, 0x210(%rax)
je 0x3e81
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r15
xorl %r13d, %r13d
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
leaq (,%r13,2), %rdx
addq %r13, %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
subq %rax, %rcx
je 0x3d94
sarq $0x4, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
addq $0x8, %rax
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl (%rax), %xmm1
movq -0x8(%rax), %rdx
mulss (%rbx,%rdx,4), %xmm1
addss %xmm1, %xmm0
addq $0x10, %rax
decq %rcx
jne 0x3d75
jmp 0x3d97
xorps %xmm0, %xmm0
movss 0x1269(%rip), %xmm1     # 0x5008
ucomiss %xmm0, %xmm1
jbe 0x3dae
movl $0x358637bd, 0x58(%r14) # imm = 0x358637BD
jmp 0x3def
ucomiss 0x125b(%rip), %xmm0     # 0x5010
jbe 0x3dc1
movl $0x3f800000, 0x58(%r14) # imm = 0x3F800000
jmp 0x3def
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movsd 0x1248(%rip), %xmm0     # 0x5018
callq 0x2320
movapd %xmm0, %xmm1
addsd 0x123f(%rip), %xmm1     # 0x5020
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x58(%r14)
xorps %xmm0, %xmm0
cvtsi2ssl 0x20(%r14), %xmm0
mulss 0x58(%r14), %xmm0
cvttss2si %xmm0, %eax
movq (%r14), %rcx
movq 0x248(%rcx), %rcx
movl (%rcx,%r13,4), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movl $0x1, %edx
subl %ecx, %edx
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
movss %xmm0, -0x38(%rbp)
movss %xmm1, -0x34(%rbp)
cltq
movq %rax, -0x30(%rbp)
movq 0x10(%r14), %rsi
cmpq 0x18(%r14), %rsi
je 0x3e4d
movups -0x38(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x10(%r14)
jmp 0x3e59
movq %r15, %rdi
leaq -0x38(%rbp), %rdx
callq 0x401c
incq %r13
movq (%r14), %rax
movq 0x208(%rax), %rcx
movq 0x210(%rax), %rax
subq %rcx, %rax
sarq $0x3, %rax
imulq %r12, %rax
cmpq %r13, %rax
ja 0x3d49
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/poseidon1214[P]logistic-regression-ftrl-mpi/src/predict.h
// Function: Predict::merge_clk()
void merge_clk(){//merge local node`s clk
        memset(g_nclk, 0, MAX_ARRAY_SIZE * sizeof(float));
        memset(g_clk, 0, MAX_ARRAY_SIZE * sizeof(float));
        int cnt = result_list.size();
        for(int i = 0; i < cnt; i++){
            int idx = result_list[i].idx;
            g_nclk[idx] += result_list[i].nclk;
            g_clk[idx] += result_list[i].clk;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
movslq 0x20(%rbx), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x2120
movq 0x40(%rbx), %rdi
movslq 0x20(%rbx), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x2120
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
shrq $0x4, %rcx
testl %ecx, %ecx
jle 0x3f0e
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rsi
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq $0x8, %rax
movslq (%rax), %rdi
movss -0x4(%rax), %xmm0
addss (%rdx,%rdi,4), %xmm0
movss %xmm0, (%rdx,%rdi,4)
movss -0x8(%rax), %xmm0
addss (%rsi,%rdi,4), %xmm0
movss %xmm0, (%rsi,%rdi,4)
addq $0x10, %rax
decq %rcx
jne 0x3ee4
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/poseidon1214[P]logistic-regression-ftrl-mpi/src/predict.h
// Function: Predict::mpi_auc(int, int, double&)
int mpi_auc(int nprocs, int rank, double& auc){
        MPI_Status status;
        if(rank != MASTER_ID){
            MPI_Send(g_nclk, MAX_ARRAY_SIZE, MPI_FLOAT, MASTER_ID, MPI_NON_CLK_TAG, MPI_COMM_WORLD);
            MPI_Send(g_clk, MAX_ARRAY_SIZE, MPI_FLOAT, MASTER_ID, MPI_CLK_TAG, MPI_COMM_WORLD);
        }
        else if(rank == MASTER_ID){
            for(int i = 0; i < MAX_ARRAY_SIZE; i++){
                g_all_non_clk[i] = g_nclk[i];
                g_all_clk[i] = g_clk[i];
            }
            for(int i = 1; i < nprocs; i++){
                MPI_Recv(g_nclk, MAX_ARRAY_SIZE, MPI_FLOAT, i, MPI_NON_CLK_TAG, MPI_COMM_WORLD, &status);
                MPI_Recv(g_clk, MAX_ARRAY_SIZE, MPI_FLOAT, i, MPI_CLK_TAG, MPI_COMM_WORLD, &status);
                for(int i = 0; i < MAX_ARRAY_SIZE; i++){
                    g_all_non_clk[i] += g_nclk[i];
                    g_all_clk[i] += g_clk[i];
                }
            }
            auc_cal(g_all_non_clk, g_all_clk, auc);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
testl %edx, %edx
jne 0x4014
movslq 0x20(%rbx), %rax
testq %rax, %rax
jle 0x3f6e
movq 0x38(%rbx), %rcx
movq 0x28(%rbx), %rdx
movq 0x30(%rbx), %rsi
movq 0x40(%rbx), %rdi
xorl %r8d, %r8d
movss (%rcx,%r8,4), %xmm0
movss %xmm0, (%rdx,%r8,4)
movss (%rdi,%r8,4), %xmm0
movss %xmm0, (%rsi,%r8,4)
incq %r8
cmpq %r8, %rax
jne 0x3f4e
movl $0x1, %r14d
leaq -0x40(%rbp), %r13
movq 0x3041(%rip), %r15      # 0x6fc0
movq 0x302a(%rip), %r12      # 0x6fb0
movq 0x38(%rbx), %rdi
movl 0x20(%rbx), %esi
movq %r13, (%rsp)
movq %r15, %rdx
movl %r14d, %ecx
movl $0x63, %r8d
movq %r12, %r9
callq 0x2180
movq 0x40(%rbx), %rdi
movl 0x20(%rbx), %esi
movq %r13, (%rsp)
movq %r15, %rdx
movl %r14d, %ecx
movl $0xc7, %r8d
movq %r12, %r9
callq 0x2180
movslq 0x20(%rbx), %rax
testq %rax, %rax
jle 0x400c
movq 0x38(%rbx), %rcx
movq 0x28(%rbx), %rdx
movq 0x30(%rbx), %rsi
movq 0x40(%rbx), %rdi
xorl %r8d, %r8d
movss (%rcx,%r8,4), %xmm0
addss (%rdx,%r8,4), %xmm0
movss %xmm0, (%rdx,%r8,4)
movss (%rdi,%r8,4), %xmm0
addss (%rsi,%r8,4), %xmm0
movss %xmm0, (%rsi,%r8,4)
incq %r8
cmpq %r8, %rax
jne 0x3fe0
incl %r14d
jmp 0x3f86
movq %rbx, %rdi
callq 0x23e1
// File: /workspace/github_cpp_makefile_star2_O1/occivink[P]pyct/monocypher.cpp
// Function: crypto_hchacha20
void crypto_hchacha20(u8 out[32], const u8 key[32], const u8 in [16])
{
    u32 block[16];
    load32_le_buf(block     , chacha20_constant, 4);
    load32_le_buf(block +  4, key              , 8);
    load32_le_buf(block + 12, in               , 4);

    chacha20_rounds(block, block);

    // prevent reversal of the rounds by revealing only half of the buffer.
    store32_le_buf(out   , block   , 4); // constant
    store32_le_buf(out+16, block+12, 4); // counter and nonce
    WIPE_BUFFER(block);
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movq 0xfbc2(%rip), %rax      # 0x121e8
xorl %ecx, %ecx
movl (%rax,%rcx,4), %edi
movl %edi, (%rsp,%rcx,4)
incq %rcx
cmpq $0x4, %rcx
jne 0x2628
xorl %eax, %eax
movl (%rsi,%rax,4), %ecx
movl %ecx, 0x10(%rsp,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0x2639
xorl %eax, %eax
movl (%rdx,%rax,4), %ecx
movl %ecx, 0x30(%rsp,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x264b
movq %rsp, %rdi
movq %rdi, %rsi
callq 0x269f
xorl %eax, %eax
movl (%rsp,%rax,4), %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x2668
xorl %eax, %eax
movl 0x30(%rsp,%rax,4), %ecx
movl %ecx, 0x10(%rbx,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x2679
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x268c
addq $0x40, %rsp
popq %rbx
retq