LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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 %dl, %al
movb %sil, %cl
movq %rdi, -0x8(%rbp)
movb %cl, -0x9(%rbp)
movb %al, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movb (%rax), %al
movb %al, -0xb(%rbp)
movzbl -0xb(%rbp), %eax
cmpl $0x0, %eax
jne 0x8fe9
movq -0x18(%rbp), %rax
movzbl 0x3(%rax), %ecx
orl $0x1, %ecx
movb %cl, 0x3(%rax)
jmp 0x8ff7
movq -0x18(%rbp), %rax
movzbl 0x3(%rax), %ecx
andl $-0x2, %ecx
movb %cl, 0x3(%rax)
movzbl -0xb(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x9013
movq -0x18(%rbp), %rax
movzbl 0x3(%rax), %ecx
orl $0x2, %ecx
movb %cl, 0x3(%rax)
jmp 0x9021
movq -0x18(%rbp), %rax
movzbl 0x3(%rax), %ecx
andl $-0x3, %ecx
movb %cl, 0x3(%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jne 0x903a
movq -0x18(%rbp), %rax
movzbl 0x3(%rax), %ecx
andl $-0x5, %ecx
movb %cl, 0x3(%rax)
jmp 0x9053
movzbl -0x9(%rbp), %eax
cmpl $0x1, %eax
jne 0x9051
movq -0x18(%rbp), %rax
movzbl 0x3(%rax), %ecx
orl $0x4, %ecx
movb %cl, 0x3(%rax)
jmp 0x9053
movzbl -0xa(%rbp), %eax
cmpl $0x0, %eax
jne 0x906c
movq -0x18(%rbp), %rax
movzbl 0x3(%rax), %ecx
andl $-0x9, %ecx
movb %cl, 0x3(%rax)
jmp 0x9085
movzbl -0xa(%rbp), %eax
cmpl $0x1, %eax
jne 0x9083
movq -0x18(%rbp), %rax
movzbl 0x3(%rax), %ecx
orl $0x8, %ecx
movb %cl, 0x3(%rax)
jmp 0x9085
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movq -0x10(%rbp), %rdi
movzwl 0x6(%rax), %esi
callq 0xe4a0
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x11(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movq -0x10(%rbp), %rdi
movzbl -0x11(%rbp), %eax
movzwl %ax, %esi
callq 0xe4a0
movb %al, -0x12(%rbp)
movzbl -0x12(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x9105
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b00
jmp 0x9110
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b00
movzbl -0x12(%rbp), %eax
sarl %eax
movb %al, -0x12(%rbp)
movzbl -0x12(%rbp), %eax
cmpl $0x0, %eax
jne 0x9132
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b50
jmp 0x913d
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b50
movzbl -0x12(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x915b
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9ba0
jmp 0x9166
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9ba0
movq -0x10(%rbp), %rdi
movzbl -0x11(%rbp), %eax
movzwl %ax, %esi
movzbl -0x12(%rbp), %edx
callq 0xe420
addq $0x20, %rsp
popq %rbp
retq
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movb (%rax), %al
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x91c5
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b00
jmp 0x91d0
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b00
movzbl -0x11(%rbp), %eax
sarl %eax
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x91f2
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b50
jmp 0x91fd
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b50
movzbl -0x11(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x921b
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9ba0
jmp 0x9226
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9ba0
movq -0x20(%rbp), %rax
movb -0x11(%rbp), %cl
movb %cl, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movq -0x10(%rbp), %rdi
movzwl 0x6(%rax), %esi
callq 0xe4a0
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x11(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movq -0x10(%rbp), %rdi
movzwl 0x6(%rax), %esi
callq 0xe4a0
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x12(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movzbl -0x12(%rbp), %eax
shll $0x8, %eax
movzbl -0x11(%rbp), %ecx
orl %ecx, %eax
movw %ax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x14(%rbp), %esi
callq 0xe4a0
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x92e5
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b00
jmp 0x92f0
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b00
movzbl -0x15(%rbp), %eax
sarl %eax
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %eax
cmpl $0x0, %eax
jne 0x9312
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b50
jmp 0x931d
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b50
movzbl -0x15(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x933b
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9ba0
jmp 0x9346
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9ba0
movq -0x10(%rbp), %rdi
movw -0x14(%rbp), %ax
movzwl %ax, %esi
movzbl -0x15(%rbp), %edx
callq 0xe420
addq $0x20, %rsp
popq %rbp
retq
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movq -0x10(%rbp), %rdi
movzwl 0x6(%rax), %esi
callq 0xe4a0
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x11(%rbp)
movb 0x1(%rax), %cl
movb %cl, -0x12(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
addl %ecx, %eax
movb %al, -0x13(%rbp)
movq -0x10(%rbp), %rdi
movzbl -0x13(%rbp), %eax
movzwl %ax, %esi
callq 0xe4a0
movb %al, -0x14(%rbp)
movzbl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x93e8
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b00
jmp 0x93f3
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b00
movzbl -0x14(%rbp), %eax
sarl %eax
movb %al, -0x14(%rbp)
movzbl -0x14(%rbp), %eax
cmpl $0x0, %eax
jne 0x9415
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b50
jmp 0x9420
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b50
movzbl -0x14(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x943e
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9ba0
jmp 0x9449
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9ba0
movq -0x10(%rbp), %rdi
movzbl -0x13(%rbp), %eax
movzwl %ax, %esi
movzbl -0x14(%rbp), %edx
callq 0xe420
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movq -0x10(%rbp), %rdi
movzwl 0x6(%rax), %esi
callq 0xe4a0
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, -0x11(%rbp)
movw 0x6(%rax), %cx
addw $0x1, %cx
movw %cx, 0x6(%rax)
movq -0x10(%rbp), %rdi
movzwl 0x6(%rax), %esi
callq 0xe4a0
movq -0x20(%rbp), %rcx
movb %al, -0x12(%rbp)
movw 0x6(%rcx), %ax
addw $0x1, %ax
movw %ax, 0x6(%rcx)
movzbl -0x12(%rbp), %eax
shll $0x8, %eax
movzbl -0x11(%rbp), %edx
orl %edx, %eax
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
movb %al, -0x13(%rbp)
movq -0x10(%rbp), %rdi
movzbl -0x13(%rbp), %eax
movzwl %ax, %esi
callq 0xe4a0
movb %al, -0x14(%rbp)
movzbl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x951b
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b00
jmp 0x9526
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b00
movzbl -0x14(%rbp), %eax
sarl %eax
movb %al, -0x14(%rbp)
movzbl -0x14(%rbp), %eax
cmpl $0x0, %eax
jne 0x9548
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9b50
jmp 0x9553
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9b50
movzbl -0x14(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x9571
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9ba0
jmp 0x957c
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9ba0
movq -0x10(%rbp), %rdi
movzbl -0x13(%rbp), %eax
movzwl %ax, %esi
movzbl -0x14(%rbp), %edx
callq 0xe420
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movzwl 0x6(%rax), %esi
callq 0xe4a0
movq -0x58(%rbp), %rdi
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %esi
callq 0x8f40
movb %al, -0x49(%rbp)
jmp 0x95dd
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x95e9
jmp 0x96be
movl $0x10, %edi
callq 0x20b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movzbl -0x11(%rbp), %esi
callq 0x9aa0
jmp 0x9608
movq -0x60(%rbp), %rdi
leaq 0xb765(%rip), %rsi      # 0x14d78
leaq 0x4c6(%rip), %rdx       # 0x9ae0
callq 0x21d0
jmp 0x9787
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x9647
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x2100
movl -0x24(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x9776
movq -0x20(%rbp), %rdi
callq 0x2080
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movq %rax, %rsi
movzbl -0x11(%rbp), %edx
leaq 0x5c41(%rip), %rdi      # 0xf2c0
xorl %eax, %eax
callq 0x2040
jmp 0x9688
movl $0x10, %edi
callq 0x20b0
movq %rax, %rdi
movq %rdi, -0x68(%rbp)
movq -0x48(%rbp), %rsi
callq 0x9c90
movq -0x68(%rbp), %rdi
leaq 0xb6cb(%rip), %rsi      # 0x14d78
leaq 0x42c(%rip), %rdx       # 0x9ae0
callq 0x21d0
jmp 0x9787
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
leaq -0x11(%rbp), %rsi
callq 0x9c30
movq %rax, -0x70(%rbp)
jmp 0x96d5
movq -0x70(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9c60
movq -0x58(%rbp), %rcx
movq %rax, %rdx
movq 0x8(%rdx), %rax
movq 0x10(%rdx), %rdx
movq %rdx, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rdx
addq %rdx, %rcx
movq %rcx, -0x78(%rbp)
andq $0x1, %rax
cmpq $0x0, %rax
je 0x9736
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x88(%rbp)
jmp 0x9741
movq -0x80(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rdi
movq -0x88(%rbp), %rax
movq -0x10(%rbp), %rsi
callq *%rax
jmp 0x9754
movb $0x1, %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x21c0
jmp 0x9774
jmp 0x9776
movq -0x20(%rbp), %rdi
callq 0x21e0
movq %rax, %rdi
callq 0x9ce0
nopw (%rax,%rax)
// File: 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
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq %rdx, -0x20(%rbp)
movzwl -0x12(%rbp), %eax
cmpl $0x2000, %eax           # imm = 0x2000
jge 0xe367
movzwl -0x12(%rbp), %eax
movl $0x800, %ecx            # imm = 0x800
cltd
idivl %ecx
movw %dx, %ax
movw %ax, -0x12(%rbp)
movq -0x20(%rbp), %rax
movw $0x0, (%rax)
movw -0x12(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0xe419
movzwl -0x12(%rbp), %ecx
movl $0x2000, %eax           # imm = 0x2000
cmpl %ecx, %eax
jg 0xe3b2
movzwl -0x12(%rbp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jge 0xe3b2
movq -0x20(%rbp), %rax
movw $0x1, (%rax)
movzwl -0x12(%rbp), %eax
subl $0x2000, %eax           # imm = 0x2000
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movw %dx, %ax
movw %ax, -0x12(%rbp)
movw -0x12(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0xe419
movzwl -0x12(%rbp), %ecx
movl $0x4000, %eax           # imm = 0x4000
cmpl %ecx, %eax
jg 0xe3dd
movzwl -0x12(%rbp), %eax
cmpl $0x4018, %eax           # imm = 0x4018
jge 0xe3dd
movq -0x20(%rbp), %rax
movw $0x2, (%rax)
movw -0x12(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0xe419
movzwl -0x12(%rbp), %ecx
movl $0x4018, %eax           # imm = 0x4018
cmpl %ecx, %eax
jg 0xe408
movzwl -0x12(%rbp), %eax
cmpl $0x4020, %eax           # imm = 0x4020
jge 0xe408
movq -0x20(%rbp), %rax
movw $0x3, (%rax)
movw -0x12(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0xe419
movq -0x20(%rbp), %rax
movw $0x4, (%rax)
movw -0x12(%rbp), %ax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
popq %rbp
retq
nop
// File: nimitbhardwaj[P]KapaNes/./src/memory_unit.cpp
// Function: NES::MemoryUnit::setByteAt(unsigned short, unsigned char)
void MemoryUnit::setByteAt(uint16_t pos, uint8_t val) {
    uint16_t type = -1;
    pos = getNormalizedAddr(pos, &type);
    switch (type) {
        case 0:
            // RAM access
            randAccMem->setByteAt(pos, val);
            break;
        case 1:
            // PPU Access
            break;
        case 2:
            // APU and I/O access
            break;
        case 3:
            // APU and IO that is normally disabled
            break;
        case 4:
            // Cartridge Space access
            break;
    }
}

// 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, -0x20(%rbp)
movw $0xffff, -0xe(%rbp)     # imm = 0xFFFF
movzwl -0xa(%rbp), %esi
leaq -0xe(%rbp), %rdx
callq 0xe320
movw %ax, -0xa(%rbp)
movzwl -0xe(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x4, %rax
ja 0xe49a
movq -0x18(%rbp), %rax
leaq 0xe90(%rip), %rcx       # 0xf300
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xb(%rbp), %edx
callq 0xe700
jmp 0xe49a
jmp 0xe49a
jmp 0xe49a
jmp 0xe49a
jmp 0xe49a
addq $0x20, %rsp
popq %rbp
retq
// File: nimitbhardwaj[P]KapaNes/./src/memory_unit.cpp
// Function: NES::MemoryUnit::getByteAt(unsigned short) const
uint8_t MemoryUnit::getByteAt(uint16_t pos) const {
    uint16_t type = -1;
    pos = getNormalizedAddr(pos, &type);
    uint8_t ret = 0xFF;
    switch(type) {
        case 0:
            // RAM access
            ret = randAccMem->getByteAt(pos);
            break;
        case 1:
            // PPU Access
            break;
        case 2:
            // APU and I/O access
            break;
        case 3:
            // APU and IO that is normally disabled
            break;
        case 4:
            // Cartridge Space access
            break;
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movw $0xffff, -0xc(%rbp)     # imm = 0xFFFF
movzwl -0xa(%rbp), %esi
leaq -0xc(%rbp), %rdx
callq 0xe320
movw %ax, -0xa(%rbp)
movb $-0x1, -0xd(%rbp)
movzwl -0xc(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x4, %rax
ja 0xe515
movq -0x18(%rbp), %rax
leaq 0xe25(%rip), %rcx       # 0xf314
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movzwl -0xa(%rbp), %esi
callq 0xe6e0
movb %al, -0xd(%rbp)
jmp 0xe515
jmp 0xe515
jmp 0xe515
jmp 0xe515
jmp 0xe515
movb -0xd(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movl (%rax), %eax
movl %eax, %edi
callq 0x2030
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rsi
movl (%rax), %eax
movl %eax, %edx
shlq $0x0, %rdx
callq 0x2120
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movq %rdi, %rax
movq %rax, -0x50(%rbp)
callq 0x86e0
movq -0x28(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
movq %rdi, -0x48(%rbp)
callq 0xe2d0
movq -0x28(%rbp), %rdi
addq $0x220, %rdi            # imm = 0x220
movq %rdi, -0x40(%rbp)
callq 0xe2f0
movq -0x28(%rbp), %rdi
addq $0x248, %rdi            # imm = 0x248
movq %rdi, -0x38(%rbp)
callq 0xe310
movq -0x28(%rbp), %rdi
addq $0x260, %rdi            # imm = 0x260
movq %rdi, -0x30(%rbp)
callq 0x8870
movq -0x28(%rbp), %rdi
movq $0x0, 0x298(%rdi)
movq $0x0, 0x2a0(%rdi)
movq $0x0, 0x2a8(%rdi)
movq -0x10(%rbp), %rsi
movl $0x8, %edx
callq 0x8390
jmp 0x99b9
movq -0x50(%rbp), %rdi
callq 0x8a00
movb %al, -0x51(%rbp)
jmp 0x99c7
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x9a57
jmp 0x99d4
movq 0x115f5(%rip), %rdi     # 0x1afd0
leaq 0x969a(%rip), %rsi      # 0x1307c
callq 0x85e0
movq %rax, -0x60(%rbp)
jmp 0x99ed
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x85e0
movq %rax, -0x68(%rbp)
jmp 0x9a00
movq -0x68(%rbp), %rdi
movq 0x1158d(%rip), %rsi     # 0x1af98
callq 0x8610
jmp 0x9a12
movl $0x1, %edi
callq 0x8730
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x8370
movq -0x38(%rbp), %rdi
callq 0xe330
movq -0x40(%rbp), %rdi
callq 0xe390
movq -0x48(%rbp), %rdi
callq 0xe3f0
movq -0x28(%rbp), %rdi
callq 0x8160
jmp 0x9a85
movq -0x10(%rbp), %rsi
movq 0x1156e(%rip), %rdi     # 0x1afd0
callq 0x85e0
movq %rax, -0x70(%rbp)
jmp 0x9a6d
movq -0x70(%rbp), %rdi
movq 0x11520(%rip), %rsi     # 0x1af98
callq 0x8610
jmp 0x9a7f
addq $0x70, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x8b40
nop
// File: 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
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, -0x40(%rbp)
callq 0x10bc0
movq -0x38(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, 0x5c(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0x60(%rax)
movl $0x0, 0x58(%rax)
movl $0x3e8, 0x20(%rax)      # imm = 0x3E8
movslq 0x20(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x8030
movq %rax, -0x30(%rbp)
jmp 0x9db5
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x28(%rax)
movslq 0x20(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x8030
movq %rax, -0x48(%rbp)
jmp 0x9de6
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x30(%rax)
movslq 0x20(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x8030
movq %rax, -0x50(%rbp)
jmp 0x9e17
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x38(%rax)
movslq 0x20(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x8030
movq %rax, -0x58(%rbp)
jmp 0x9e48
movq -0x38(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x40(%rax)
addq $0x60, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x10be0
movq -0x20(%rbp), %rdi
callq 0x8b40
nopl (%rax,%rax)
// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movq -0x10(%rbp), %rsi
callq 0x117e0
movq -0x38(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x11a10
movq -0x38(%rbp), %rdi
movl 0x5c(%rdi), %esi
movl 0x60(%rdi), %edx
leaq -0x28(%rbp), %rcx
callq 0x11af0
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpl 0x60(%rcx), %eax
jne 0xa23b
movsd -0x28(%rbp), %xmm0
leaq 0x8e8d(%rip), %rdi      # 0x130c1
movb $0x1, %al
callq 0x8040
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, 0x50(%rax)
movq 0x40(%rax), %rax
movq 0x2a0(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x70(%rbp)
callq 0x8030
movq -0x70(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x68(%rbp)
xorl %esi, %esi
callq 0x82e0
movq -0x68(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq 0x40(%rax), %rax
movq 0x2a0(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x60(%rbp)
callq 0x8030
movq -0x60(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x58(%rbp)
xorl %esi, %esi
callq 0x82e0
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq 0x40(%rax), %rax
movq 0x2a0(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x50(%rbp)
callq 0x8030
movq -0x50(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x48(%rbp)
xorl %esi, %esi
callq 0x82e0
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq 0x40(%rax), %rax
movq 0x2a0(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x40(%rbp)
callq 0x8030
movq -0x40(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x38(%rbp)
xorl %esi, %esi
callq 0x82e0
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq 0x40(%rax), %rax
movq 0x2a0(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x30(%rbp)
callq 0x8030
movq -0x30(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x28(%rbp)
xorl %esi, %esi
callq 0x82e0
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq 0x40(%rax), %rax
movq 0x2a0(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x20(%rbp)
callq 0x8030
movq -0x20(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x18(%rbp)
xorl %esi, %esi
callq 0x82e0
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: poseidon1214[P]logistic-regression-ftrl-mpi/src/ftrl.h
// Function: FTRL::sigmoid(float)
float sigmoid(float x){
            if(x < -30) return 1e-6;
            else if(x > 30) return 1.0;
            else{
                double ex = pow(2.718281828, x);
                return ex / (1.0 + ex);
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
movss 0x192f(%rip), %xmm0     # 0x13008
ucomiss -0x14(%rbp), %xmm0
jbe 0x116ee
movss 0x192d(%rip), %xmm0     # 0x13014
movss %xmm0, -0x4(%rbp)
jmp 0x11745
movss -0x14(%rbp), %xmm0
movss 0x1911(%rip), %xmm1     # 0x1300c
ucomiss %xmm1, %xmm0
jbe 0x1170f
movss 0x1908(%rip), %xmm0     # 0x13010
movss %xmm0, -0x4(%rbp)
jmp 0x11745
movss -0x14(%rbp), %xmm1
movsd 0x1904(%rip), %xmm0     # 0x13020
callq 0x11770
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd 0x18e5(%rip), %xmm1     # 0x13018
addsd -0x20(%rbp), %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x4(%rbp)
movss -0x4(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x38(%rax), %rdi
movslq 0x20(%rax), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x82e0
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rdi
movslq 0x20(%rax), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x82e0
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x12160
movl %eax, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x11ae9
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movslq -0x10(%rbp), %rsi
callq 0x123f0
movq -0x20(%rbp), %rdi
movq 0x8(%rax), %rax
movl %eax, -0x14(%rbp)
addq $0x8, %rdi
movslq -0x10(%rbp), %rsi
callq 0x123f0
movq -0x20(%rbp), %rdi
movss 0x4(%rax), %xmm0
movq 0x38(%rdi), %rax
movslq -0x14(%rbp), %rcx
addss (%rax,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
addq $0x8, %rdi
movslq -0x10(%rbp), %rsi
callq 0x123f0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movss (%rcx), %xmm0
movq 0x40(%rax), %rax
movslq -0x14(%rbp), %rcx
addss (%rax,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x11a65
addq $0x20, %rsp
popq %rbp
retq
nop
// File: poseidon1214[P]logistic-regression-ftrl-mpi/src/predict.h
// Function: Predict::auc_cal(float*, float*, double&)
int auc_cal(float* all_clk, float* all_nclk, double& auc_res){
            double clk_sum = 0.0;
            double nclk_sum = 0.0;
            double old_clk_sum = 0.0;
            double clksum_multi_nclksum = 0.0;
            double auc = 0.0;
            auc_res = 0.0;
            for(int i = 0; i < MAX_ARRAY_SIZE; i++){
                    old_clk_sum = clk_sum;
                    clk_sum += all_clk[i];
                    nclk_sum += all_nclk[i];
                    auc += (old_clk_sum + clk_sum) * all_nclk[i] / 2;
            }
            clksum_multi_nclksum = clk_sum * nclk_sum;
            auc_res = auc/(clksum_multi_nclksum);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x20(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movl $0x0, -0x4c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x4c(%rbp), %eax
cmpl 0x20(%rcx), %eax
jge 0x124f9
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
movsd 0xb4b(%rip), %xmm1      # 0x13028
divsd %xmm1, %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x12466
movsd -0x28(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
divsd -0x40(%rbp), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
ud2
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x60(%rbp), %rdi
movq 0x209c9(%rip), %rsi     # 0x242c8
movl $0x4, %edx
callq 0x3990
leaq -0x60(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
movl $0x8, %edx
callq 0x3990
leaq -0x60(%rbp), %rdi
addq $0x30, %rdi
movq -0x18(%rbp), %rsi
movl $0x4, %edx
callq 0x3990
leaq -0x60(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x39f0
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x4, %edx
callq 0x3ef0
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq -0x60(%rbp), %rsi
addq $0x30, %rsi
movl $0x4, %edx
callq 0x3ef0
leaq -0x60(%rbp), %rdi
movl $0x40, %esi
callq 0x3890
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: occivink[P]pyct/monocypher.cpp
// Function: load32_le(unsigned char const*)
static u32 load32_le(const u8 s[4])
{
    return (u32)s[0]
        | ((u32)s[1] <<  8)
        | ((u32)s[2] << 16)
        | ((u32)s[3] << 24);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
movq -0x8(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
shll $0x18, %ecx
orl %ecx, %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: occivink[P]pyct/monocypher.cpp
// Function: crypto_xchacha20_ctr
u64 crypto_xchacha20_ctr(u8 *cipher_text, const u8 *plain_text,
                         size_t text_size,
                         const u8 key[32], const u8 nonce[24], u64 ctr)
{
    u8 sub_key[32];
    crypto_hchacha20(sub_key, key, nonce);
    ctr = crypto_chacha20_ctr(cipher_text, plain_text, text_size,
                              sub_key, nonce+16, ctr);
    WIPE_BUFFER(sub_key);
    return ctr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x38e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movq -0x28(%rbp), %r8
addq $0x10, %r8
movq -0x30(%rbp), %r9
callq 0x3f50
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
movl $0x20, %esi
callq 0x3890
movq -0x30(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: occivink[P]pyct/monocypher.cpp
// Function: crypto_poly1305_init
void crypto_poly1305_init(crypto_poly1305_ctx *ctx, const u8 key[32])
{
    ZERO(ctx->h, 5); // Initial hash is zero
    ctx->c_idx = 0;
    // load r and pad (r has some of its bits cleared)
    load32_le_buf(ctx->r  , key   , 4);
    load32_le_buf(ctx->pad, key+16, 4);
    FOR (i, 0, 1) { ctx->r[i] &= 0x0fffffff; }
    FOR (i, 1, 4) { ctx->r[i] &= 0x0ffffffc; }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x5, -0x18(%rbp)
jae 0x451d
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movl $0x0, 0x10(%rax,%rcx,4)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x44f8
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x3990
movq -0x8(%rbp), %rdi
addq $0x34, %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movl $0x4, %edx
callq 0x3990
movq $0x0, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jae 0x4586
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %edx
andl $0xfffffff, %edx        # imm = 0xFFFFFFF
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x455d
movq $0x1, -0x28(%rbp)
cmpq $0x4, -0x28(%rbp)
jae 0x45b7
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %edx
andl $0xffffffc, %edx        # imm = 0xFFFFFFC
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x458e
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: occivink[P]pyct/monocypher.cpp
// Function: crypto_poly1305_update
void crypto_poly1305_update(crypto_poly1305_ctx *ctx,
                            const u8 *message, size_t message_size)
{
    // Align ourselves with block boundaries
    size_t aligned = MIN(align(ctx->c_idx, 16), message_size);
    FOR (i, 0, aligned) {
        ctx->c[ctx->c_idx] = *message;
        ctx->c_idx++;
        message++;
        message_size--;
    }

    // If block is complete, process it
    if (ctx->c_idx == 16) {
        poly_block(ctx, ctx->c, 1);
        ctx->c_idx = 0;
    }

    // Process the message block by block
    size_t nb_blocks = message_size >> 4;
    FOR (i, 0, nb_blocks) {
        poly_block(ctx, message, 1);
        message += 16;
    }
    message_size &= 15;

    // remaining bytes (we never complete a block here)
    FOR (i, 0, message_size) {
        ctx->c[ctx->c_idx] = message[i];
        ctx->c_idx++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movl $0x10, %esi
callq 0x4750
cmpq -0x18(%rbp), %rax
ja 0x4604
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movl $0x10, %esi
callq 0x4750
movq %rax, -0x48(%rbp)
jmp 0x460c
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x4672
movq -0x10(%rbp), %rax
movb (%rax), %dl
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rcx
movb %dl, 0x24(%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x461c
movq -0x8(%rbp), %rax
cmpq $0x10, 0x48(%rax)
jne 0x469f
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x24, %rsi
movl $0x1, %edx
callq 0x4780
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x18(%rbp), %rax
shrq $0x4, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x46e9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x4780
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x10(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x46b3
movq -0x18(%rbp), %rax
andq $0xf, %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x4740
movq -0x10(%rbp), %rax
movq -0x40(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rcx
movb %dl, 0x24(%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x48(%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x46fd
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: occivink[P]pyct/monocypher.cpp
// Function: crypto_poly1305_final
void crypto_poly1305_final(crypto_poly1305_ctx *ctx, u8 mac[16])
{
    // Process the last block (if any)
    // We move the final 1 according to remaining input length
    // (this will add less than 2^130 to the last input block)
    if (ctx->c_idx != 0) {
        ZERO(ctx->c + ctx->c_idx, 16 - ctx->c_idx);
        ctx->c[ctx->c_idx] = 1;
        poly_block(ctx, ctx->c, 0);
    }

    // check if we should subtract 2^130-5 by performing the
    // corresponding carry propagation.
    u64 c = 5;
    FOR (i, 0, 4) {
        c  += ctx->h[i];
        c >>= 32;
    }
    c += ctx->h[4];
    c  = (c >> 2) * 5; // shift the carry back to the beginning
    // c now indicates how many times we should subtract 2^130-5 (0 or 1)
    FOR (i, 0, 4) {
        c += (u64)ctx->h[i] + ctx->pad[i];
        store32_le(mac + i*4, (u32)c);
        c = c >> 32;
    }
    WIPE_CTX(ctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x4b63
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdx
movl $0x10, %ecx
subq 0x48(%rdx), %rcx
cmpq %rcx, %rax
jae 0x4b3f
movq -0x8(%rbp), %rax
addq $0x24, %rax
movq -0x8(%rbp), %rcx
addq 0x48(%rcx), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x4b03
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rcx
movb $0x1, 0x24(%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x24, %rsi
xorl %edx, %edx
callq 0x4780
movq $0x5, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x4, -0x28(%rbp)
jae 0x4ba8
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movl 0x10(%rax,%rcx,4), %eax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
shrq $0x20, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x4b73
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
shrq $0x2, %rax
imulq $0x5, %rax, %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x4, -0x30(%rbp)
jae 0x4c2d
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x10(%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movq -0x30(%rbp), %rdx
movl 0x34(%rcx,%rdx,4), %ecx
addq %rcx, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
callq 0x42a0
movq -0x20(%rbp), %rax
shrq $0x20, %rax
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x4bcf
movq -0x8(%rbp), %rdi
movl $0x50, %esi
callq 0x3890
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: occivink[P]pyct/monocypher.cpp
// Function: crypto_blake2b_general_init
void crypto_blake2b_general_init(crypto_blake2b_ctx *ctx, size_t hash_size,
                                 const u8           *key, size_t key_size)
{
    // initial hash
    COPY(ctx->hash, iv, 8);
    ctx->hash[0] ^= 0x01010000 ^ (key_size << 8) ^ hash_size;

    ctx->input_offset[0] = 0;         // beginning of the input, no offset
    ctx->input_offset[1] = 0;         // beginning of the input, no offset
    ctx->hash_size       = hash_size; // remember the hash size we want
    ctx->input_idx       = 0;

    // if there is a key, the first block is that key (padded with zeroes)
    if (key_size > 0) {
        u8 key_block[128] = {0};
        COPY(key_block, key, key_size);
        // same as calling crypto_blake2b_update(ctx, key_block , 128)
        load64_le_buf(ctx->input, key_block, 16);
        ctx->input_idx = 128;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x8, -0x28(%rbp)
jae 0x4cf3
movq -0x28(%rbp), %rcx
leaq 0x173cb(%rip), %rax     # 0x1c0a0
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x4cc3
movq -0x20(%rbp), %rcx
shlq $0x8, %rcx
xorq $0x1010000, %rcx        # imm = 0x1010000
xorq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
xorq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xd0(%rax)
cmpq $0x0, -0x20(%rbp)
jbe 0x4dd4
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x3160
movq $0x0, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x4dac
movq -0x18(%rbp), %rax
movq -0xb8(%rbp), %rcx
movb (%rax,%rcx), %cl
movq -0xb8(%rbp), %rax
movb %cl, -0xb0(%rbp,%rax)
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
jmp 0x4d6f
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
leaq -0xb0(%rbp), %rsi
movl $0x10, %edx
callq 0x4de0
movq -0x8(%rbp), %rax
movq $0x80, 0xd0(%rax)
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)
// File: occivink[P]pyct/monocypher.cpp
// Function: blake2b_set_input(crypto_blake2b_ctx*, unsigned char, unsigned long)
static void blake2b_set_input(crypto_blake2b_ctx *ctx, u8 input, size_t index)
{
    if (index == 0) {
        ZERO(ctx->input, 16);
    }
    size_t word = index >> 3;
    size_t byte = index & 7;
    ctx->input[word] |= (u64)input << (byte << 3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5099
movq $0x0, -0x20(%rbp)
cmpq $0x10, -0x20(%rbp)
jae 0x5097
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq $0x0, 0x50(%rax,%rcx,8)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x5071
jmp 0x5099
movq -0x18(%rbp), %rax
shrq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
andq $0x7, %rax
movq %rax, -0x30(%rbp)
movzbl -0x9(%rbp), %eax
movl %eax, %edx
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
shlq %cl, %rdx
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
orq 0x50(%rax,%rcx,8), %rdx
movq %rdx, 0x50(%rax,%rcx,8)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: occivink[P]pyct/monocypher.cpp
// Function: crypto_blake2b_final
void crypto_blake2b_final(crypto_blake2b_ctx *ctx, u8 *hash)
{
    // Pad the end of the block with zeroes
    FOR (i, ctx->input_idx, 128) {
        blake2b_set_input(ctx, 0, i);
    }
    blake2b_compress(ctx, 1); // compress the last block
    size_t nb_words = ctx->hash_size >> 3;
    store64_le_buf(hash, ctx->hash, nb_words);
    FOR (i, nb_words << 3, ctx->hash_size) {
        hash[i] = (ctx->hash[i >> 3] >> (8 * (i & 7))) & 0xff;
    }
    WIPE_CTX(ctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x80, -0x18(%rbp)
jae 0x9a66
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x5050
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x9a3f
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x50e0
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rax
shrq $0x3, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x9b10
movq -0x20(%rbp), %rax
shlq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0xd8(%rcx), %rax
jae 0x9af5
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
shrq $0x3, %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rcx
andq $0x7, %rcx
shlq $0x3, %rcx
shrq %cl, %rax
andq $0xff, %rax
movb %al, %dl
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x9aa4
movq -0x8(%rbp), %rdi
movl $0xe0, %esi
callq 0x3890
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)