LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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
subq $0x10, %rsp
leaq -0x1(%rbp), %rax
movb %sil, (%rax)
addq $0x40, %rdi
movq %rax, %rsi
callq 0x59f0
testq %rax, %rax
sete %al
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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), %cl
movb 0x3(%rdi), %al
testb %cl, %cl
je 0x49c2
andb $-0x2, %al
testb $0x1, %cl
je 0x49c4
orb $0x2, %al
jmp 0x49c6
orb $0x1, %al
andb $-0x3, %al
movb %al, 0x3(%rdi)
cmpb $0x1, %sil
je 0x49db
movzbl %sil, %ecx
testl %ecx, %ecx
jne 0x49e0
andb $-0x5, %al
jmp 0x49dd
orb $0x4, %al
movb %al, 0x3(%rdi)
cmpb $0x1, %dl
je 0x49f0
movzbl %dl, %ecx
testl %ecx, %ecx
jne 0x49f5
andb $-0x9, %al
jmp 0x49f2
orb $0x8, %al
movb %al, 0x3(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5bd4
incw 0x6(%r14)
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5bd4
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 0x5bb4
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5bd4
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5bd4
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 0x5bd4
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 0x5bb4
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5bd4
incw 0x6(%r14)
addb 0x1(%r14), %al
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5bd4
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 0x5bb4
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5bd4
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5bd4
incw 0x6(%r14)
addb 0x1(%r14), %r15b
movzbl %r15b, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5bd4
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 0x5bb4
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rdi), %esi
movq %rbx, %rdi
callq 0x5bd4
movl %eax, %r15d
movb %al, -0x19(%rbp)
leaq -0x1a(%rbp), %rsi
movb %al, (%rsi)
leaq 0x40(%r14), %rdi
callq 0x59f0
testq %rax, %rax
je 0x4ca9
leaq 0x8(%r14), %rdi
leaq -0x19(%rbp), %rsi
callq 0x5a54
movq 0x10(%rax), %rcx
addq 0x18(%rax), %r14
testb $0x1, %cl
je 0x4c94
movq (%r14), %rax
movq -0x1(%rax,%rcx), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq *%rcx
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x1090
leaq 0x50e6(%rip), %rcx      # 0x9da0
movq %rcx, (%rax)
movb %r15b, 0x8(%rax)
leaq 0x50b0(%rip), %rsi      # 0x9d78
movq 0x5319(%rip), %rdx      # 0x9fe8
movq %rax, %rdi
callq 0x1150
jmp 0x4d3e
jmp 0x4cdd
jmp 0x4cdd
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x4d46
movq %rbx, %rdi
callq 0x1080
movq %rax, %rbx
movq (%rax), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movzbl -0x19(%rbp), %edx
leaq 0x15b8(%rip), %rdi      # 0x62bc
movq %rax, %rsi
xorl %eax, %eax
callq 0x1040
movl $0x10, %edi
callq 0x1090
leaq 0x5081(%rip), %rcx      # 0x9da0
movq %rcx, (%rax)
movb 0x8(%rbx), %cl
movb %cl, 0x8(%rax)
leaq 0x5049(%rip), %rsi      # 0x9d78
movq 0x52b2(%rip), %rdx      # 0x9fe8
movq %rax, %rdi
callq 0x1150
movq %rax, %rbx
callq 0x1140
movq %rbx, %rdi
callq 0x1160
movq %rax, %rdi
callq 0x4d68
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5b7a
andl $0x7ff, %eax            # imm = 0x7FF
movw $0x0, (%rdx)
jmp 0x5bb2
movzwl %ax, %ecx
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x5b8f
movw $0x1, (%rdx)
andl $0x7, %eax
jmp 0x5bb2
cmpl $0x4017, %ecx           # imm = 0x4017
ja 0x5b9e
movw $0x2, (%rdx)
jmp 0x5bb2
cmpl $0x401f, %ecx           # imm = 0x401F
ja 0x5bad
movw $0x3, (%rdx)
jmp 0x5bb2
movw $0x4, (%rdx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, (%rdi)
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)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3c62
leaq -0x18(%rbp), %r14
movq $0x0, (%r14)
movq %rbx, %rdi
callq 0x3df8
movl 0x5c(%rbx), %esi
movl 0x60(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x3e7e
cmpl $0x0, 0x60(%rbx)
jne 0x30e2
movsd -0x18(%rbp), %xmm0
leaq 0x1ff6(%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_O3/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 %rbx
pushq %rax
movq %rdi, %rbx
movl $0x0, 0x50(%rdi)
movq 0x40(%rdi), %rax
movq 0x2a0(%rax), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
xorl %r14d, %r14d
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, (%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2120
movq %r15, 0x58(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2120
movq %r15, 0x60(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2120
movq %r15, 0x68(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2120
movq %r15, 0x70(%rbx)
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 %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a04
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x40(%rdi), %rax
movl (%rsi), %ecx
movq 0x208(%rax), %rdx
xorl %r15d, %r15d
movss 0x175a(%rip), %xmm2     # 0x5004
movss 0x1756(%rip), %xmm3     # 0x5008
movss 0x1752(%rip), %xmm4     # 0x500c
movss 0x174e(%rip), %xmm5     # 0x5010
movslq %ecx, %r8
leaq (%r8,%r8,2), %rdi
movq (%rdx,%rdi,8), %rsi
movq 0x8(%rdx,%rdi,8), %r9
movq %r9, %rdi
subq %rsi, %rdi
sarq $0x4, %rdi
movss 0x10(%r14), %xmm1
cmpq %rsi, %r9
je 0x391a
movq (%r14), %r10
cmpq $0x1, %rdi
movq %rdi, %r11
adcq $0x0, %r11
leaq 0x8(%rsi), %r12
xorps %xmm0, %xmm0
cvtsi2ssl (%r12), %xmm0
movslq -0x8(%r12), %r13
mulss (%r10,%r13,4), %xmm0
addss %xmm0, %xmm1
addq $0x10, %r12
decq %r11
jne 0x38f9
ucomiss %xmm1, %xmm3
jbe 0x3924
movaps %xmm2, %xmm0
jmp 0x3998
ucomiss %xmm5, %xmm1
movaps %xmm4, %xmm0
ja 0x3998
cvtss2sd %xmm1, %xmm1
movsd 0x16e0(%rip), %xmm0     # 0x5018
callq 0x2320
movss 0x16cb(%rip), %xmm5     # 0x5010
movss 0x16bf(%rip), %xmm4     # 0x500c
movss 0x16b3(%rip), %xmm3     # 0x5008
movss 0x16a7(%rip), %xmm2     # 0x5004
movapd %xmm0, %xmm1
addsd 0x16b7(%rip), %xmm1     # 0x5020
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x40(%r14), %rax
movl (%rbx), %ecx
movq 0x208(%rax), %rdx
movslq %ecx, %r8
leaq (%r8,%r8,2), %rdi
movq (%rdx,%rdi,8), %rsi
movq 0x8(%rdx,%rdi,8), %r9
movq %r9, %rdi
subq %rsi, %rdi
sarq $0x4, %rdi
cmpq %rsi, %r9
je 0x39e5
movq 0x248(%rax), %r9
xorps %xmm1, %xmm1
cvtsi2ssl (%r9,%r8,4), %xmm1
subss %xmm1, %xmm0
movq 0x58(%r14), %r8
cmpq $0x1, %rdi
adcq $0x0, %rdi
addq $0x8, %rsi
xorps %xmm1, %xmm1
cvtsi2ssl (%rsi), %xmm1
movslq -0x8(%rsi), %r9
mulss %xmm0, %xmm1
addss (%r8,%r9,4), %xmm1
movss %xmm1, (%r8,%r9,4)
addq $0x10, %rsi
decq %rdi
jne 0x39c1
incl %ecx
movl %ecx, (%rbx)
incl %r15d
cmpl 0xc(%r14), %r15d
jl 0x38c2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3de8
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r15
xorl %r13d, %r13d
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
leaq (,%r13,2), %rsi
addq %r13, %rsi
movq (%rcx,%rsi,8), %rdx
movq 0x8(%rcx,%rsi,8), %rcx
subq %rdx, %rcx
je 0x3d09
sarq $0x4, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
addq $0x8, %rdx
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl (%rdx), %xmm1
movq -0x8(%rdx), %rsi
mulss (%rbx,%rsi,4), %xmm1
addss %xmm1, %xmm0
addq $0x10, %rdx
decq %rcx
jne 0x3ccd
movss 0x1316(%rip), %xmm1     # 0x5008
ucomiss %xmm0, %xmm1
jbe 0x3d0e
movl $0x358637bd, 0x58(%r14) # imm = 0x358637BD
movss 0x12fd(%rip), %xmm0     # 0x5004
jmp 0x3d5a
xorps %xmm0, %xmm0
jmp 0x3d29
ucomiss 0x12fb(%rip), %xmm0     # 0x5010
jbe 0x3d29
movl $0x3f800000, 0x58(%r14) # imm = 0x3F800000
movss 0x12e5(%rip), %xmm0     # 0x500c
jmp 0x3d5a
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movsd 0x12e0(%rip), %xmm0     # 0x5018
callq 0x2320
movapd %xmm0, %xmm1
addsd 0x12d7(%rip), %xmm1     # 0x5020
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x58(%r14)
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtsi2ssl 0x20(%r14), %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movq 0x248(%rax), %rax
movl (%rax,%r13,4), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movl $0x1, %edx
subl %eax, %edx
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
movss %xmm0, -0x38(%rbp)
movss %xmm1, -0x34(%rbp)
movslq %ecx, %rax
movq %rax, -0x30(%rbp)
movq 0x10(%r14), %rsi
cmpq 0x18(%r14), %rsi
je 0x3db4
movups -0x38(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x10(%r14)
jmp 0x3dc0
movq %r15, %rdi
leaq -0x38(%rbp), %rdx
callq 0x3f82
incq %r13
movq (%r14), %rax
movq 0x208(%rax), %rcx
movq 0x210(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %r12, %rdx
cmpq %r13, %rdx
ja 0x3ca1
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3e76
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 0x3e4c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3f79
movslq 0x20(%rbx), %rsi
testq %rsi, %rsi
jle 0x3ed6
movq 0x38(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
movq 0x40(%rbx), %rdi
xorl %r8d, %r8d
movss (%rax,%r8,4), %xmm0
movss %xmm0, (%rcx,%r8,4)
movss (%rdi,%r8,4), %xmm0
movss %xmm0, (%rdx,%r8,4)
incq %r8
cmpq %r8, %rsi
jne 0x3eb6
movl $0x1, %r14d
leaq -0x40(%rbp), %r13
movq 0x30d9(%rip), %r15      # 0x6fc0
movq 0x30c2(%rip), %r12      # 0x6fb0
movq 0x38(%rbx), %rdi
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), %rsi
testq %rsi, %rsi
jle 0x3f71
movq 0x38(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
movq 0x40(%rbx), %rdi
xorl %r8d, %r8d
movss (%rax,%r8,4), %xmm0
addss (%rcx,%r8,4), %xmm0
movss %xmm0, (%rcx,%r8,4)
movss (%rdi,%r8,4), %xmm0
addss (%rdx,%r8,4), %xmm0
movss %xmm0, (%rdx,%r8,4)
incq %r8
cmpq %r8, %rsi
jne 0x3f45
incl %r14d
jmp 0x3eee
movq %rbx, %rdi
callq 0x23e1
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xfc17(%rip), %rax      # 0x121e8
xorl %ecx, %ecx
movl (%rax,%rcx,4), %edi
movl %edi, (%rsp,%rcx,4)
incq %rcx
cmpq $0x4, %rcx
jne 0x25d3
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movq %rsp, %rdi
movaps %xmm1, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movups (%rdx), %xmm0
movaps %xmm0, 0x30(%rdi)
movq %rdi, %rsi
callq 0x263c
xorl %eax, %eax
movl (%rsp,%rax,4), %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x2605
xorl %eax, %eax
movl 0x30(%rsp,%rax,4), %ecx
movl %ecx, 0x10(%rbx,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x2616
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x2629
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq %rsp, %rbp
movq %rbp, %rdi
movq %rcx, %rsi
movq %r8, %rdx
callq 0x25c2
addq $0x10, %r14
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq %r14, %r8
movq %rbx, %r9
callq 0x2865
xorl %ecx, %ecx
movb $0x0, (%rsp,%rcx)
incq %rcx
cmpq $0x20, %rcx
jne 0x2a3c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movl $0x0, 0x20(%rdi)
movq $0x0, 0x48(%rdi)
xorl %eax, %eax
movl (%rsi,%rax,4), %ecx
movl %ecx, (%rdi,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x2a90
xorl %eax, %eax
movl 0x10(%rsi,%rax,4), %ecx
movl %ecx, 0x34(%rdi,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x2aa1
andb $0xf, 0x3(%rdi)
movl $0x1, %eax
andl $0xffffffc, (%rdi,%rax,4) # imm = 0xFFFFFFC
incq %rax
cmpq $0x4, %rax
jne 0x2abb
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x48(%rdi), %rax
movl %eax, %ecx
negl %ecx
andl $0xf, %ecx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
testq %rcx, %rcx
je 0x2b15
movq %rcx, %rdx
movb (%r14), %sil
movb %sil, 0x24(%r15,%rax)
movq 0x48(%r15), %rax
incq %rax
movq %rax, 0x48(%r15)
incq %r14
decq %rdx
jne 0x2af7
subq %rcx, %rbx
cmpq $0x10, %rax
jne 0x2b34
leaq 0x24(%r15), %rsi
movq %r15, %rdi
movl $0x1, %edx
callq 0x2b8e
movq $0x0, 0x48(%r15)
cmpq $0x10, %rbx
jb 0x2b5a
movq %rbx, %r12
shrq $0x4, %r12
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x2b8e
addq $0x10, %r14
decq %r12
jne 0x2b41
andq $0xf, %rbx
je 0x2b82
movq 0x48(%r15), %rax
xorl %ecx, %ecx
movb (%r14,%rcx), %dl
movb %dl, 0x24(%r15,%rax)
movq 0x48(%r15), %rax
incq %rax
movq %rax, 0x48(%r15)
incq %rcx
cmpq %rcx, %rbx
jne 0x2b66
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x2d77
cmpq $0x10, %rax
je 0x2d64
leaq 0x24(%rbx), %rcx
xorl %edx, %edx
addq %rcx, %rax
movb $0x0, (%rdx,%rax)
incq %rdx
movq 0x48(%rbx), %rax
movl $0x10, %esi
subq %rax, %rsi
cmpq %rsi, %rdx
jb 0x2d49
leaq 0x24(%rbx), %rsi
movb $0x1, 0x24(%rbx,%rax)
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2b8e
movl $0x5, %eax
xorl %ecx, %ecx
movl 0x10(%rbx,%rcx,4), %edx
addq %rdx, %rax
shrq $0x20, %rax
incq %rcx
cmpq $0x4, %rcx
jne 0x2d7e
movl 0x20(%rbx), %ecx
addq %rcx, %rax
shrq $0x2, %rax
leaq (%rax,%rax,4), %rcx
xorl %eax, %eax
movl 0x10(%rbx,%rax,4), %edx
addq %rcx, %rdx
movl 0x34(%rbx,%rax,4), %ecx
addq %rdx, %rcx
movl %ecx, (%r14,%rax,4)
shrq $0x20, %rcx
incq %rax
cmpq $0x4, %rax
jne 0x2da2
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
incq %rax
cmpq $0x50, %rax
jne 0x2dc3
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rcx, %r14
movaps 0xa285(%rip), %xmm0     # 0xd0c0
movups %xmm0, (%rdi)
movaps 0xa2ab(%rip), %xmm0     # 0xd0f0
movups %xmm0, 0x30(%rdi)
movaps 0xa290(%rip), %xmm0     # 0xd0e0
movups %xmm0, 0x20(%rdi)
movaps 0xa275(%rip), %xmm0     # 0xd0d0
movups %xmm0, 0x10(%rdi)
movq %rcx, %rax
shlq $0x8, %rax
xorq %rsi, %rax
movabsq $0x6a09e667f2bdc908, %rcx # imm = 0x6A09E667F2BDC908
xorq %rax, %rcx
movq %rcx, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movq %rsi, 0xd8(%rdi)
movq $0x0, 0xd0(%rdi)
testq %r14, %r14
je 0x2ee7
movq %rdx, %r15
movq %rdi, %rbx
movl $0x80, %r13d
movl $0x80, %eax
subq %r14, %rax
xorl %edx, %edx
cmpq $0x7f, %r14
cmovbeq %rax, %rdx
leaq (%rsp,%r14), %rdi
xorl %esi, %esi
callq 0x2120
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2170
leaq 0x50(%rbx), %rdi
movl $0x10, %ecx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r13, 0xd0(%rbx)
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/occivink[P]pyct/monocypher.cpp
// Function: crypto_blake2b_update
void crypto_blake2b_update(crypto_blake2b_ctx *ctx,
                           const u8 *message, size_t message_size)
{
    // Align ourselves with block boundaries
    // The block that may result is not compressed yet
    size_t aligned = MIN(align(ctx->input_idx, 128), message_size);
    FOR (i, 0, aligned) {
        blake2b_set_input(ctx, *message, ctx->input_idx);
        ctx->input_idx++;
        message++;
        message_size--;
    }

    // Process the message block by block
    // The last block is not compressed yet.
    size_t nb_blocks = message_size >> 7;
    FOR (i, 0, nb_blocks) {
        if (ctx->input_idx == 128) {
            blake2b_compress(ctx, 0);
        }
        load64_le_buf(ctx->input, message, 16);
        message += 128;
        ctx->input_idx = 128;
    }
    message_size &= 127;

    // Fill remaining bytes (not the whole buffer)
    // The last block is never fully filled
    FOR (i, 0, message_size) {
        if (ctx->input_idx == 128) {
            blake2b_compress(ctx, 0);
            ctx->input_idx = 0;
        }
        blake2b_set_input(ctx, message[i], ctx->input_idx);
        ctx->input_idx++;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0xd0(%rdi), %rax
movl %eax, %edx
negl %edx
andl $0x7f, %edx
cmpq %rbx, %rdx
cmovaeq %rbx, %rdx
testq %rdx, %rdx
je 0x2fdb
leaq 0x50(%r15), %rsi
xorps %xmm0, %xmm0
movq %rdx, %rdi
movzbl (%r14), %r8d
testq %rax, %rax
jne 0x2fac
movups %xmm0, 0x70(%rsi)
movups %xmm0, 0x60(%rsi)
movups %xmm0, 0x50(%rsi)
movups %xmm0, 0x40(%rsi)
movups %xmm0, 0x30(%rsi)
movups %xmm0, 0x20(%rsi)
movups %xmm0, 0x10(%rsi)
movups %xmm0, (%rsi)
leal (,%rax,8), %ecx
shlq %cl, %r8
andq $-0x8, %rax
orq %r8, 0x50(%r15,%rax)
movq 0xd0(%r15), %rax
incq %rax
movq %rax, 0xd0(%r15)
incq %r14
decq %rdi
jne 0x2f84
subq %rdx, %rbx
cmpq $0x80, %rbx
jb 0x3033
movq %rbx, %r12
shrq $0x7, %r12
cmpq $0x80, %rax
sete %cl
xorl %r13d, %r13d
testb $0x1, %cl
je 0x3006
movq %r15, %rdi
xorl %esi, %esi
callq 0x30e1
xorl %eax, %eax
movq (%r14,%rax,8), %rcx
movq %rcx, 0x50(%r15,%rax,8)
incq %rax
cmpq $0x10, %rax
jne 0x3008
movl $0x80, %eax
addq %rax, %r14
movq %rax, 0xd0(%r15)
incq %r13
movb $0x1, %cl
cmpq %r12, %r13
jne 0x2ff7
andq $0x7f, %rbx
je 0x30d7
leaq 0x50(%r15), %r12
xorl %r13d, %r13d
cmpq $0x80, %rax
jne 0x3067
movq %r15, %rdi
xorl %esi, %esi
callq 0x30e1
movq $0x0, 0xd0(%r15)
movb (%r14,%r13), %cl
jmp 0x3070
movb (%r14,%r13), %cl
testq %rax, %rax
jne 0x30a4
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%r12)
movups %xmm0, 0x60(%r12)
movups %xmm0, 0x50(%r12)
movups %xmm0, 0x40(%r12)
movups %xmm0, 0x30(%r12)
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
xorl %eax, %eax
movzbl %cl, %edx
leal (,%rax,8), %ecx
shlq %cl, %rdx
andq $-0x8, %rax
orq %rdx, 0x50(%r15,%rax)
movq 0xd0(%r15), %rax
incq %rax
movq %rax, 0xd0(%r15)
incq %r13
cmpq %r13, %rbx
jne 0x3044
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0xd0(%rdi), %rax
cmpq $0x7f, %rax
ja 0x47f7
leaq 0x50(%rbx), %rcx
xorps %xmm0, %xmm0
testq %rax, %rax
jne 0x47ec
movups %xmm0, 0x70(%rcx)
movups %xmm0, 0x60(%rcx)
movups %xmm0, 0x50(%rcx)
movups %xmm0, 0x40(%rcx)
movups %xmm0, 0x30(%rcx)
movups %xmm0, 0x20(%rcx)
movups %xmm0, 0x10(%rcx)
movups %xmm0, (%rcx)
incq %rax
cmpq $0x80, %rax
jne 0x47c8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x30e1
movq 0xd8(%rbx), %r15
movq %r15, %rdx
shrq $0x3, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4874
movq %r15, %rax
andq $-0x8, %rax
cmpq 0xd8(%rbx), %rax
jae 0x485d
shlq $0x3, %r15
andq $-0x40, %r15
movq %rax, %rcx
andq $-0x8, %rcx
movq (%rbx,%rcx), %rdx
movl %r15d, %ecx
andb $0x38, %cl
shrq %cl, %rdx
movb %dl, (%r14,%rax)
incq %rax
addq $0x8, %r15
cmpq 0xd8(%rbx), %rax
jb 0x4835
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
incq %rax
cmpq $0xe0, %rax
jne 0x485f
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/occivink[P]pyct/monocypher.cpp
// Function: crypto_blake2b_general
void crypto_blake2b_general(u8       *hash   , size_t hash_size,
                            const u8 *key    , size_t key_size,
                            const u8 *message, size_t message_size)
{
    crypto_blake2b_ctx ctx;
    crypto_blake2b_general_init(&ctx, hash_size, key, key_size);
    crypto_blake2b_update(&ctx, message, message_size);
    crypto_blake2b_final(&ctx, hash);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdi, %rbx
movaps 0x8810(%rip), %xmm0     # 0xd0c0
movaps %xmm0, (%rsp)
movaps 0x8835(%rip), %xmm0     # 0xd0f0
movaps %xmm0, 0x30(%rsp)
movaps 0x8819(%rip), %xmm0     # 0xd0e0
movaps %xmm0, 0x20(%rsp)
movaps 0x87fd(%rip), %xmm0     # 0xd0d0
movaps %xmm0, 0x10(%rsp)
movq %rcx, %rax
shlq $0x8, %rax
xorq %rsi, %rax
movabsq $0x6a09e667f2bdc908, %rcx # imm = 0x6A09E667F2BDC908
xorq %rax, %rcx
movq %rcx, (%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq %rsi, 0xd8(%rsp)
movq $0x0, 0xd0(%rsp)
testq %r12, %r12
je 0x4970
movq %rdx, %r13
movl $0x80, %eax
subq %r12, %rax
xorl %edx, %edx
cmpq $0x7f, %r12
cmovbeq %rax, %rdx
leaq (%rsp,%r12), %rdi
addq $0xe0, %rdi
xorl %esi, %esi
callq 0x2120
leaq 0xe0(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x2170
leaq 0x50(%rsp), %rax
movl $0x10, %ecx
movq %rax, %rdi
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x80, %ecx
movq %rcx, 0x80(%rax)
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2f4e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x47a9
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/occivink[P]pyct/monocypher.cpp
// Function: crypto_x25519
void crypto_x25519(u8       raw_shared_secret[32],
                   const u8 your_secret_key  [32],
                   const u8 their_public_key [32])
{
    // restrict the possible scalar values
    u8 e[32];
    COPY(e, your_secret_key, 32);
    trim_scalar(e);
    scalarmult(raw_shared_secret, e, their_public_key, 255);
    WIPE_BUFFER(e);
}

// Assembly:
subq $0x28, %rsp
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movaps %xmm1, 0x10(%rsi)
andb $-0x8, (%rsi)
movb 0x1f(%rsi), %al
andb $0x3f, %al
orb $0x40, %al
movb %al, 0x1f(%rsi)
movl $0xff, %ecx
callq 0x5e4e
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x5e3c
addq $0x28, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/occivink[P]pyct/monocypher.cpp
// Function: crypto_sign_public_key_custom_hash
void crypto_sign_public_key_custom_hash(u8       public_key[32],
                                        const u8 secret_key[32],
                                        const crypto_sign_vtable *hash)
{
    u8 a[64];
    hash->hash(a, secret_key, 32);
    trim_scalar(a);
    ge A;
    ge_scalarmult_base(&A, a);
    ge_tobytes(public_key, &A);
    WIPE_BUFFER(a);
    WIPE_CTX(&A);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xe0, %rsp
movq %rdx, %rax
movq %rdi, %rbx
movq %rsp, %r14
movl $0x20, %edx
movq %r14, %rdi
callq *(%rax)
andb $-0x8, (%r14)
movb 0x1f(%r14), %al
andb $0x3f, %al
orb $0x40, %al
movb %al, 0x1f(%r14)
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x62ae
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6475
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x6282
xorl %eax, %eax
movb $0x0, 0x40(%rsp,%rax)
incq %rax
cmpq $0xa0, %rax
jne 0x6291
addq $0xe0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/occivink[P]pyct/monocypher.cpp
// Function: ge_tobytes(unsigned char*, ge const*)
static void ge_tobytes(u8 s[32], const ge *h)
{
    fe recip, x, y;
    fe_invert(recip, h->Z);
    fe_mul(x, h->X, recip);
    fe_mul(y, h->Y, recip);
    fe_tobytes(s, y);
    s[31] ^= fe_isodd(x) << 7;

    WIPE_BUFFER(recip);
    WIPE_BUFFER(x);
    WIPE_BUFFER(y);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x50, %rsi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0x701e
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x7075
addq $0x28, %r14
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x7075
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7887
movq %rsp, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x7887
xorl %ecx, %ecx
movb (%r14), %al
movb $0x0, (%rsp,%rcx)
incq %rcx
cmpq $0x20, %rcx
jne 0x64e7
shlb $0x7, %al
xorb %al, 0x1f(%rbx)
xorl %eax, %eax
movb $0x0, 0x80(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x64fc
xorl %eax, %eax
movb $0x0, 0x50(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x650f
xorl %eax, %eax
movb $0x0, 0x20(%rsp,%rax)
incq %rax
cmpq $0x28, %rax
jne 0x651f
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/occivink[P]pyct/monocypher.cpp
// Function: crypto_sign_init_first_pass_custom_hash
void crypto_sign_init_first_pass_custom_hash(crypto_sign_ctx_abstract *ctx,
                                             const u8 secret_key[32],
                                             const u8 public_key[32],
                                             const crypto_sign_vtable *hash)
{
    ctx->hash  = hash; // set vtable
    u8 *a      = ctx->buf;
    u8 *prefix = ctx->buf + 32;
    ctx->hash->hash(a, secret_key, 32);
    trim_scalar(a);

    if (public_key == 0) {
        crypto_sign_public_key_custom_hash(ctx->pk, secret_key, ctx->hash);
    } else {
        COPY(ctx->pk, public_key, 32);
    }

    // Deterministic part of EdDSA: Construct a nonce by hashing the message
    // instead of generating a random number.
    // An actual random number would work just fine, and would save us
    // the trouble of hashing the message twice.  If we did that
    // however, the user could fuck it up and reuse the nonce.
    ctx->hash->init  (ctx);
    ctx->hash->update(ctx, prefix , 32);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rcx, (%rdi)
addq $0x8, %rdi
movl $0x20, %edx
callq *(%rcx)
andb $-0x8, 0x8(%rbx)
movb 0x27(%rbx), %al
andb $0x3f, %al
orb $0x40, %al
movb %al, 0x27(%rbx)
leaq 0x68(%rbx), %rdi
testq %r14, %r14
je 0x6591
xorl %eax, %eax
movb (%r14,%rax), %cl
movb %cl, (%rdi,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x657f
jmp 0x659c
movq (%rbx), %rdx
movq %r15, %rsi
callq 0x6236
leaq 0x28(%rbx), %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq (%rbx), %rax
movq 0x10(%rax), %rax
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O3/occivink[P]pyct/monocypher.cpp
// Function: crypto_sign_init_second_pass
void crypto_sign_init_second_pass(crypto_sign_ctx_abstract *ctx)
{
    u8 *r        = ctx->buf + 32;
    u8 *half_sig = ctx->buf + 64;
    ctx->hash->final(ctx, r);
    reduce(r);

    // first half of the signature = "random" nonce times the base point
    ge R;
    ge_scalarmult_base(&R, r);
    ge_tobytes(half_sig, &R);
    WIPE_CTX(&R);

    // Hash R, the public key, and the message together.
    // It cannot be done in parallel with the first hash.
    ctx->hash->init  (ctx);
    ctx->hash->update(ctx, half_sig, 32);
    ctx->hash->update(ctx, ctx->pk , 32);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
movups 0x28(%rbx), %xmm0
movups 0x38(%rbx), %xmm1
movups 0x48(%rbx), %xmm2
movups 0x58(%rbx), %xmm3
movq %rsp, %rsi
movaps %xmm3, 0x30(%rsi)
movaps %xmm2, 0x20(%rsi)
movaps %xmm1, 0x10(%rsi)
movaps %xmm0, (%rsi)
movq %r14, %rdi
callq 0x91a1
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x6621
leaq 0x48(%rbx), %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x62ae
movq %r15, %rdi
movq %r12, %rsi
callq 0x6475
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0xa0, %rax
jne 0x664d
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq (%rbx), %rax
movl $0x20, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq *0x10(%rax)
movq (%rbx), %rax
movq 0x10(%rax), %rax
leaq 0x68(%rbx), %rsi
movl $0x20, %edx
movq %rbx, %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O3/occivink[P]pyct/monocypher.cpp
// Function: crypto_sign_final
void crypto_sign_final(crypto_sign_ctx_abstract *ctx, u8 signature[64])
{
    u8 *a        = ctx->buf;
    u8 *r        = ctx->buf + 32;
    u8 *half_sig = ctx->buf + 64;
    u8  h_ram[64];
    ctx->hash->final(ctx, h_ram);
    reduce(h_ram);
    COPY(signature, half_sig, 32);
    mul_add(signature + 32, h_ram, a, r); // s = h_ram * a + r
    WIPE_BUFFER(h_ram);
    crypto_wipe(ctx, ctx->hash->ctx_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movq %rsp, %r15
movq %r15, %rsi
callq *0x18(%rax)
movaps (%r15), %xmm0
movaps 0x10(%r15), %xmm1
movaps 0x20(%r15), %xmm2
movaps 0x30(%r15), %xmm3
leaq 0x40(%rsp), %rsi
movaps %xmm3, 0x30(%rsi)
movaps %xmm2, 0x20(%rsi)
movaps %xmm1, 0x10(%rsi)
movaps %xmm0, (%rsi)
movq %r15, %rdi
callq 0x91a1
xorl %eax, %eax
movb $0x0, 0x40(%rsp,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x66e8
xorl %eax, %eax
movb 0x48(%rbx,%rax), %cl
movb %cl, (%r14,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x66f8
leaq 0x8(%rbx), %rdx
leaq 0x28(%rbx), %rcx
addq $0x20, %r14
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6756
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
incq %rax
cmpq $0x40, %rax
jne 0x6722
movq (%rbx), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x6749
xorl %ecx, %ecx
movb $0x0, (%rbx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x673d
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq