LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x452a
andb $-0x2, %al
testb $0x1, %cl
je 0x452c
orb $0x2, %al
jmp 0x452e
orb $0x1, %al
andb $-0x3, %al
movb %al, 0x3(%rdi)
cmpb $0x1, %sil
je 0x4543
movzbl %sil, %ecx
testl %ecx, %ecx
jne 0x4548
andb $-0x5, %al
jmp 0x4545
orb $0x4, %al
movb %al, 0x3(%rdi)
cmpb $0x1, %dl
je 0x4558
movzbl %dl, %ecx
testl %ecx, %ecx
jne 0x455d
andb $-0x9, %al
jmp 0x455a
orb $0x8, %al
movb %al, 0x3(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5834
incw 0x6(%r14)
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5834
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 0x57ea
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5834
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5834
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 0x5834
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 0x57ea
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5834
movl %eax, %r15d
movzwl 0x6(%r14), %esi
incl %esi
movw %si, 0x6(%r14)
andl %r12d, %esi
movq %rbx, %rdi
callq 0x5834
incw 0x6(%r14)
addb 0x1(%r14), %r15b
movzbl %r15b, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5834
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 0x57ea
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5834
movl %eax, %r15d
movb %al, -0x19(%rbp)
movzbl %al, %esi
movq %r14, %rdi
callq 0x44ea
testb %al, %al
jne 0x480c
leaq 0x8(%r14), %rdi
leaq -0x19(%rbp), %rsi
callq 0x56ee
movq 0x10(%rax), %rcx
addq 0x18(%rax), %r14
testb $0x1, %cl
je 0x47f7
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
pushq $0x10
popq %rdi
callq 0x10c0
leaq 0x5585(%rip), %rcx      # 0x9da0
movq %rcx, (%rax)
movb %r15b, 0x8(%rax)
leaq 0x554f(%rip), %rsi      # 0x9d78
movq 0x57b8(%rip), %rdx      # 0x9fe8
movq %rax, %rdi
callq 0x1180
jmp 0x489d
jmp 0x483e
jmp 0x483e
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x48a5
movq %rbx, %rdi
callq 0x1090
movq %rax, %rbx
movq (%rax), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movzbl -0x19(%rbp), %edx
leaq 0x1a57(%rip), %rdi      # 0x62bc
movq %rax, %rsi
xorl %eax, %eax
callq 0x1040
pushq $0x10
popq %rdi
callq 0x10c0
leaq 0x5522(%rip), %rcx      # 0x9da0
movq %rcx, (%rax)
movb 0x8(%rbx), %cl
movb %cl, 0x8(%rax)
leaq 0x54ea(%rip), %rsi      # 0x9d78
movq 0x5753(%rip), %rdx      # 0x9fe8
movq %rax, %rdi
callq 0x1180
movq %rax, %rbx
callq 0x1170
movq %rbx, %rdi
callq 0x1190
movq %rax, %rdi
callq 0x48df
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
leaq -0x1a(%rbp), %r15
orw $-0x1, (%r15)
movq %r15, %rdx
callq 0x57a2
cmpw $0x0, (%r15)
je 0x581c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
movzwl %ax, %esi
movzbl %bl, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x598e
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x12(%rbp), %r14
orw $-0x1, (%r14)
movq %r14, %rdx
callq 0x57a2
cmpw $0x0, (%r14)
je 0x5865
movb $-0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq (%rbx), %rdi
movzwl %ax, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x597e
// File: /workspace/github_cpp_makefile_star2_O2/nimitbhardwaj[P]KapaNes/./src/ram_unit.cpp
// Function: NES::Ram::operator=(NES::Ram const&)
Ram &Ram::operator=(const Ram &r) {
    size = r.size;
    memory = new uint8_t[size];
    memcpy(memory, r.memory, size*sizeof(uint8_t));
    return *this;
}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
movq %rdi, %rbx
callq 0x21d0
leaq 0x208(%rbx), %r14
leaq 0x248(%rbx), %r15
andq $0x0, 0x258(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x248(%rbx)
leaq 0x260(%rbx), %r12
leaq 0x270(%rbx), %rax
movups %xmm0, 0x208(%rbx)
movups %xmm0, 0x218(%rbx)
movups %xmm0, 0x228(%rbx)
movq %rax, 0x260(%rbx)
andq $0x0, 0x268(%rbx)
movb $0x0, 0x270(%rbx)
movups %xmm0, 0x298(%rbx)
andq $0x0, 0x2a8(%rbx)
pushq $0x8
popq %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2120
leaq 0x78(%rbx), %rdi
callq 0x2080
testb %al, %al
je 0x2820
movq 0x37cf(%rip), %rdi      # 0x5fd0
movq %r13, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x20f0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x37a9(%rip), %rdi      # 0x5fd0
leaq 0x185e(%rip), %rsi      # 0x408c
callq 0x21a0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x20f0
pushq $0x1
popq %rdi
callq 0x21f0
movq %rax, -0x30(%rbp)
leaq 0x220(%rbx), %r13
movq %r12, %rdi
callq 0x20e0
movq %r15, %rdi
callq 0x2e6e
movq %r13, %rdi
callq 0x2e82
movq %r14, %rdi
callq 0x2e34
movq %rbx, %rdi
callq 0x2090
movq -0x30(%rbp), %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/poseidon1214[P]logistic-regression-ftrl-mpi/src/predict.h
// Function: Predict::Predict(Load_Data*, int, int)
Predict(Load_Data* load_data, int total_num_proc, int my_rank) 
            : data(load_data), nproc(total_num_proc), rank(my_rank){
        pctr = 0.0;
        MAX_ARRAY_SIZE = 1000;
        g_all_non_clk = new float[MAX_ARRAY_SIZE];
        g_all_clk = new float[MAX_ARRAY_SIZE];
        g_nclk = new float[MAX_ARRAY_SIZE];
        g_clk = new float[MAX_ARRAY_SIZE];
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq %rsi, (%rdi)
leaq 0x8(%rdi), %rbx
andq $0x0, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movl %edx, 0x5c(%rdi)
movl %ecx, 0x60(%rdi)
andl $0x0, 0x58(%rdi)
movl $0x3e8, 0x20(%rdi)      # imm = 0x3E8
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x2030
movq %rax, 0x28(%r14)
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x2030
movq %rax, 0x30(%r14)
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x2030
movq %rax, 0x38(%r14)
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x2030
movq %rax, 0x40(%r14)
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x34cc
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x395c
leaq -0x18(%rbp), %r14
andq $0x0, (%r14)
movq %rbx, %rdi
callq 0x3a9c
movl 0x5c(%rbx), %esi
movl 0x60(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x3b26
cmpl $0x0, 0x60(%rbx)
jne 0x2d89
movsd -0x18(%rbp), %xmm0
leaq 0x134f(%rip), %rdi      # 0x40d1
movb $0x1, %al
callq 0x2040
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
andl $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 0x2110
movq %r15, (%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2110
movq %r15, 0x58(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2110
movq %r15, 0x60(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2110
movq %r15, 0x68(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2110
movq %r15, 0x70(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2110
movq %r15, 0x78(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
cmpl 0xc(%r14), %r15d
jge 0x36a5
movss 0x10(%r14), %xmm0
movq 0x40(%r14), %rax
movslq (%rbx), %rcx
movq 0x208(%rax), %rdx
imulq $0x18, %rcx, %rcx
movq (%rdx,%rcx), %rax
movq 0x8(%rdx,%rcx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
movq (%r14), %rdx
addq $0x8, %rax
subq $0x1, %rcx
jb 0x362f
movslq -0x8(%rax), %rsi
cvtsi2ssl (%rax), %xmm1
mulss (%rdx,%rsi,4), %xmm1
addss %xmm1, %xmm0
addq $0x10, %rax
jmp 0x3612
movq %r14, %rdi
callq 0x3908
movq 0x40(%r14), %rcx
movq 0x58(%r14), %rdx
movslq (%rbx), %rax
movq 0x208(%rcx), %rdi
imulq $0x18, %rax, %r8
movq (%rdi,%r8), %rsi
movq 0x8(%rdi,%r8), %rdi
subq %rsi, %rdi
sarq $0x4, %rdi
addq $0x8, %rsi
subq $0x1, %rdi
jb 0x3699
cvtsi2ssl (%rsi), %xmm1
movq 0x248(%rcx), %r8
cvtsi2ssl (%r8,%rax,4), %xmm2
movslq -0x8(%rsi), %r8
movaps %xmm0, %xmm3
subss %xmm2, %xmm3
mulss %xmm1, %xmm3
addss (%rdx,%r8,4), %xmm3
movss %xmm3, (%rdx,%r8,4)
addq $0x10, %rsi
jmp 0x3661
incl %eax
movl %eax, (%rbx)
incl %r15d
jmp 0x35d9
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
movss 0x724(%rip), %xmm1      # 0x4034
ucomiss %xmm0, %xmm1
jbe 0x391e
movss 0x713(%rip), %xmm0      # 0x4030
retq
ucomiss 0x717(%rip), %xmm0      # 0x403c
jbe 0x3930
movss 0x709(%rip), %xmm0      # 0x4038
retq
pushq %rbp
movq %rsp, %rbp
cvtss2sd %xmm0, %xmm1
movsd 0x700(%rip), %xmm0      # 0x4040
callq 0x22d0
movsd 0x6fb(%rip), %xmm1      # 0x4048
addsd %xmm0, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r15
xorl %r13d, %r13d
leaq -0x38(%rbp), %r12
movq (%r14), %rcx
movq 0x208(%rcx), %rsi
movq 0x210(%rcx), %rax
subq %rsi, %rax
cqto
pushq $0x18
popq %rdi
idivq %rdi
cmpq %r13, %rax
jbe 0x3a8c
imulq $0x18, %r13, %rdx
movq (%rsi,%rdx), %rax
movq 0x8(%rsi,%rdx), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
addq $0x8, %rax
xorps %xmm0, %xmm0
subq $0x1, %rdx
jb 0x39db
movq -0x8(%rax), %rsi
cvtsi2ssl (%rax), %xmm1
mulss (%rbx,%rsi,4), %xmm1
addss %xmm1, %xmm0
addq $0x10, %rax
jmp 0x39be
movss 0x651(%rip), %xmm1      # 0x4034
ucomiss %xmm0, %xmm1
jbe 0x39fa
movl $0x358637bd, 0x58(%r14) # imm = 0x358637BD
movss 0x638(%rip), %xmm0      # 0x4030
jmp 0x3a43
ucomiss 0x63b(%rip), %xmm0      # 0x403c
jbe 0x3a15
movl $0x3f800000, 0x58(%r14) # imm = 0x3F800000
movss 0x625(%rip), %xmm0      # 0x4038
jmp 0x3a43
cvtss2sd %xmm0, %xmm1
movsd 0x61f(%rip), %xmm0      # 0x4040
callq 0x22d0
movapd %xmm0, %xmm1
addsd 0x616(%rip), %xmm1      # 0x4048
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x58(%r14)
movq (%r14), %rcx
cvtsi2ssl 0x20(%r14), %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movq 0x248(%rcx), %rcx
movl (%rcx,%r13,4), %ecx
cvtsi2ss %ecx, %xmm0
pushq $0x1
popq %rdx
subl %ecx, %edx
cvtsi2ss %edx, %xmm1
movss %xmm0, -0x38(%rbp)
movss %xmm1, -0x34(%rbp)
cltq
movq %rax, -0x30(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x3c6a
incq %r13
jmp 0x397e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
movslq 0x20(%rbx), %rdx
shlq $0x2, %rdx
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x2110
movq 0x40(%rbx), %rdi
movslq 0x20(%rbx), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x2110
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
shrq $0x4, %rcx
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rsi
testl %ecx, %ecx
cmovlel %r14d, %ecx
shlq $0x4, %rcx
cmpq %r14, %rcx
je 0x3b21
movslq 0x8(%rax,%r14), %rdi
movss 0x4(%rax,%r14), %xmm0
addss (%rdx,%rdi,4), %xmm0
movss %xmm0, (%rdx,%rdi,4)
movss (%rax,%r14), %xmm0
addss (%rsi,%rdi,4), %xmm0
movss %xmm0, (%rsi,%rdi,4)
addq $0x10, %r14
jmp 0x3af0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3c29
movl 0x20(%rbx), %esi
movq 0x38(%rbx), %rdi
movq 0x28(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x30(%rbx), %rdx
xorl %r8d, %r8d
testl %esi, %esi
movl $0x0, %r9d
cmovgl %esi, %r9d
cmpq %r8, %r9
je 0x3b86
movss (%rdi,%r8,4), %xmm0
movss %xmm0, (%rax,%r8,4)
movss (%rcx,%r8,4), %xmm0
movss %xmm0, (%rdx,%r8,4)
incq %r8
jmp 0x3b64
pushq $0x1
popq %r14
leaq -0x40(%rbp), %r13
movq 0x242b(%rip), %r15      # 0x5fc0
movq 0x2414(%rip), %r12      # 0x5fb0
movq %r13, (%rsp)
movq %r15, %rdx
movl %r14d, %ecx
pushq $0x63
popq %r8
movq %r12, %r9
callq 0x2160
movq 0x40(%rbx), %rdi
movl 0x20(%rbx), %esi
movq %r13, (%rsp)
movq %r15, %rdx
movl %r14d, %ecx
movl $0xc7, %r8d
movq %r12, %r9
callq 0x2160
movl 0x20(%rbx), %esi
movq 0x38(%rbx), %rdi
movq 0x28(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x30(%rbx), %rdx
testl %esi, %esi
movl $0x0, %r8d
cmovgl %esi, %r8d
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x3c21
movss (%rdi,%r9,4), %xmm0
addss (%rax,%r9,4), %xmm0
movss %xmm0, (%rax,%r9,4)
movss (%rcx,%r9,4), %xmm0
addss (%rdx,%r9,4), %xmm0
movss %xmm0, (%rdx,%r9,4)
incq %r9
jmp 0x3bf3
incl %r14d
jmp 0x3b9c
movq 0x38(%rbx), %rdi
movl 0x20(%rbx), %esi
movq 0x2389(%rip), %r14      # 0x5fc0
movq 0x2372(%rip), %r15      # 0x5fb0
pushq $0x63
popq %r8
movq %r14, %rdx
xorl %ecx, %ecx
movq %r15, %r9
callq 0x20b0
movq 0x40(%rbx), %rdi
movl 0x20(%rbx), %esi
movq %r14, %rdx
xorl %ecx, %ecx
movl $0xc7, %r8d
movq %r15, %r9
callq 0x20b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/occivink[P]pyct/monocypher.cpp
// Function: x32(unsigned char const*, 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:
movdqu (%rdi), %xmm0
movdqu 0x10(%rdi), %xmm1
movdqu (%rsi), %xmm2
pxor %xmm0, %xmm2
movdqu 0x10(%rsi), %xmm0
pxor %xmm1, %xmm0
por %xmm2, %xmm0
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
por %xmm0, %xmm1
movq %xmm1, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movq 0xfc1e(%rip), %rsi      # 0x121f0
movq %rsp, %rbx
pushq $0x4
popq %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0x264b
leaq 0x10(%rsp), %rdi
pushq $0x8
popq %rdx
movq %r13, %rsi
callq 0x264b
leaq 0x30(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x264b
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x265e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x287d
addq $0x10, %r14
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x287d
pushq $0x40
popq %rsi
movq %rbx, %rdi
callq 0x25a4
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x25b5
addq $0x10, %r14
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq %r14, %r8
movq %rbx, %r9
callq 0x2890
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %rbp, %rdi
callq 0x25a4
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x4
popq %rax
cmpq $0x9, %rax
je 0x2ab8
andl $0x0, (%rbx,%rax,4)
incq %rax
jmp 0x2aa9
andq $0x0, 0x48(%rbx)
pushq $0x4
popq %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x264b
leaq 0x34(%rbx), %rdi
addq $0x10, %r14
movq %r14, %rsi
movq %r15, %rdx
callq 0x264b
andb $0xf, 0x3(%rbx)
pushq $0x1
popq %rax
cmpq $0x4, %rax
je 0x2afb
andl $0xffffffc, (%rbx,%rax,4) # imm = 0xFFFFFFC
incq %rax
jmp 0x2ae9
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
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
leaq 0x24(%rdi), %rsi
movq %rcx, %rdx
subq $0x1, %rdx
jb 0x2b49
movb (%r14), %dil
movb %dil, 0x24(%r15,%rax)
movq 0x48(%r15), %rax
incq %rax
movq %rax, 0x48(%r15)
incq %r14
jmp 0x2b2b
subq %rcx, %rbx
cmpq $0x10, %rax
jne 0x2b62
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x2bae
andq $0x0, 0x48(%r15)
movq %rbx, %r12
shrq $0x4, %r12
pushq $0x1
popq %rbp
subq $0x1, %r12
jb 0x2b85
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2bae
addq $0x10, %r14
jmp 0x2b6c
andl $0xf, %ebx
xorl %eax, %eax
cmpq %rax, %rbx
je 0x2ba5
movb (%r14,%rax), %cl
movq 0x48(%r15), %rdx
movb %cl, 0x24(%r15,%rdx)
incq 0x48(%r15)
incq %rax
jmp 0x2b8a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2daa
leaq 0x24(%rbx), %rsi
xorl %ecx, %ecx
pushq $0x10
popq %rdx
movq %rdx, %rdi
subq %rax, %rdi
cmpq %rdi, %rcx
jae 0x2d9b
addq %rbx, %rax
movb $0x0, 0x24(%rcx,%rax)
incq %rcx
movq 0x48(%rbx), %rax
jmp 0x2d7f
movb $0x1, 0x24(%rbx,%rax)
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2bae
pushq $0x5
popq %rax
pushq $0x4
popq %rcx
cmpq $0x8, %rcx
je 0x2dc5
movl (%rbx,%rcx,4), %edx
addq %rdx, %rax
shrq $0x20, %rax
incq %rcx
jmp 0x2db0
movl 0x20(%rbx), %ecx
addq %rcx, %rax
shrq $0x2, %rax
leaq (%rax,%rax,4), %rcx
xorl %eax, %eax
cmpq $0x4, %rax
je 0x2df9
movl 0x10(%rbx,%rax,4), %edx
movl 0x34(%rbx,%rax,4), %esi
addq %rdx, %rcx
addq %rcx, %rsi
movl %esi, (%r14,%rax,4)
shrq $0x20, %rsi
incq %rax
movq %rsi, %rcx
jmp 0x2dd5
pushq $0x50
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x25a4
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x80, %rsp
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x9238(%rip), %rdi      # 0xc0a0
cmpq $0x40, %rax
je 0x2e7c
movq (%rax,%rdi), %r8
movq %r8, (%rbx,%rax)
addq $0x8, %rax
jmp 0x2e68
movq %rcx, %rax
shlq $0x8, %rax
xorq (%rbx), %rax
xorq %rsi, %rax
xorq $0x1010000, %rax        # imm = 0x1010000
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq %rsi, 0xd8(%rbx)
andq $0x0, 0xd0(%rbx)
testq %rcx, %rcx
je 0x2f02
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
xorl %eax, %eax
cmpq %rax, %rcx
je 0x2ee8
movb (%rdx,%rax), %sil
movb %sil, (%rsp,%rax)
incq %rax
jmp 0x2ed6
leaq 0x50(%rbx), %rdi
movq %rsp, %rsi
pushq $0x10
popq %rdx
callq 0x2f0b
movq $0x80, 0xd0(%rbx)
addq $0x80, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0xd0(%rdi), %rdx
movl %edx, %r12d
negl %r12d
andl $0x7f, %r12d
cmpq %rbx, %r12
cmovaeq %rbx, %r12
movq %r12, %r13
subq $0x1, %r13
jb 0x2f83
movzbl (%r14), %esi
movq %r15, %rdi
callq 0x3027
movq 0xd0(%r15), %rdx
incq %rdx
movq %rdx, 0xd0(%r15)
incq %r14
jmp 0x2f5b
subq %r12, %rbx
movq %rbx, %rbp
shrq $0x7, %rbp
leaq 0x50(%r15), %r12
pushq $0x10
popq %r13
subq $0x1, %rbp
jb 0x2fcd
cmpq $0x80, %rdx
jne 0x2fae
movq %r15, %rdi
xorl %esi, %esi
callq 0x3057
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2f0b
movl $0x80, %edx
addq %rdx, %r14
movq %rdx, 0xd0(%r15)
jmp 0x2f95
andl $0x7f, %ebx
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x3018
cmpq $0x80, %rdx
jne 0x2ff5
movq %r15, %rdi
xorl %esi, %esi
callq 0x3057
andq $0x0, 0xd0(%r15)
xorl %edx, %edx
movzbl (%r14,%r12), %esi
movq %r15, %rdi
callq 0x3027
movq 0xd0(%r15), %rdx
incq %rdx
movq %rdx, 0xd0(%r15)
incq %r12
jmp 0x2fd3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0xd0(%rdi), %r15
cmpq $0x80, %r15
jae 0x474f
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3027
incq %r15
jmp 0x4734
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x3057
movq 0xd8(%rbx), %r12
movq %r12, %r15
shrq $0x3, %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x47c0
andq $-0x8, %r12
shlq $0x6, %r15
cmpq 0xd8(%rbx), %r12
jae 0x47a8
movq %r12, %rax
andq $-0x8, %rax
movq (%rbx,%rax), %rax
movl %r15d, %ecx
andb $0x38, %cl
shrq %cl, %rax
movb %al, (%r14,%r12)
incq %r12
addq $0x8, %r15
jmp 0x477e
movl $0xe0, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x25a4
// File: /workspace/github_cpp_makefile_star2_O2/occivink[P]pyct/monocypher.cpp
// Function: extended_hash(unsigned char*, unsigned int, unsigned char const*, unsigned int)
static void extended_hash(u8       *digest, u32 digest_size,
                          const u8 *input , u32 input_size)
{
    crypto_blake2b_ctx ctx;
    crypto_blake2b_general_init(&ctx, MIN(digest_size, 64), 0, 0);
    blake_update_32            (&ctx, digest_size);
    crypto_blake2b_update      (&ctx, input, input_size);
    crypto_blake2b_final       (&ctx, digest);

    if (digest_size > 64) {
        // the conversion to u64 avoids integer overflow on
        // ludicrously big hash sizes.
        u32 r   = (u32)(((u64)digest_size + 31) >> 5) - 2;
        u32 i   =  1;
        u32 in  =  0;
        u32 out = 32;
        while (i < r) {
            // Input and output overlap. This is intentional
            crypto_blake2b(digest + out, digest + in, 64);
            i   +=  1;
            in  += 32;
            out += 32;
        }
        crypto_blake2b_general(digest + out, digest_size - (32 * r),
                               0, 0, // no key
                               digest + in , 64);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
cmpl $0x40, %esi
pushq $0x40
popq %rsi
cmovbl %ebx, %esi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2e54
movq %r12, %rdi
movl %ebx, %esi
callq 0x4c81
movl %ebp, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2f2c
movq %r12, %rdi
movq %r14, %rsi
callq 0x471f
cmpl $0x41, %ebx
jb 0x4d5a
movl %ebx, %r13d
addq $0x1f, %r13
shrq $0x5, %r13
leal -0x2(%r13), %ebp
addl $-0x3, %r13d
pushq $0x40
popq %r15
subl $0x1, %r13d
jb 0x4d3e
leaq 0x20(%r14), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4846
movq %r12, %r14
jmp 0x4d21
shll $0x5, %ebp
subl %ebp, %ebx
leaq 0x20(%r14), %rdi
pushq $0x40
popq %r9
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x47fa
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbx
subq $0x20, %rsp
xorl %eax, %eax
cmpq $0x20, %rax
je 0x577f
movb (%rsi,%rax), %cl
movb %cl, (%rsp,%rax)
incq %rax
jmp 0x576e
movq %rsp, %rbx
andb $-0x8, (%rbx)
movb 0x1f(%rbx), %al
andb $0x3f, %al
orb $0x40, %al
movb %al, 0x1f(%rbx)
movq %rbx, %rsi
movl $0xff, %ecx
callq 0x57ad
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x25a4
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x20
popq %rdx
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 0x5acf
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5c42
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x25a4
movl $0xa0, %esi
movq %r15, %rdi
callq 0x25a4
addq $0xe0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x90, %rsp
movq %rsi, %r13
movq %rdi, %rbx
addq $0x50, %rsi
leaq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x6552
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x65a5
addq $0x28, %r13
movq %rsp, %r12
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x65a5
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6d90
movq %r15, %rdi
callq 0x81bf
shlb $0x7, %al
xorb %al, 0x1f(%rbx)
pushq $0x28
popq %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x25a4
movq %r15, %rdi
movq %rbx, %rsi
callq 0x25a4
movq %r12, %rdi
movq %rbx, %rsi
callq 0x25a4
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x20
popq %rdx
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 0x5d30
xorl %eax, %eax
cmpq $0x20, %rax
je 0x5d3b
movb (%r14,%rax), %cl
movb %cl, (%rdi,%rax)
incq %rax
jmp 0x5d1e
movq (%rbx), %rdx
movq %r15, %rsi
callq 0x5a62
leaq 0x28(%rbx), %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq (%rbx), %rax
movq 0x10(%rax), %rax
pushq $0x20
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O2/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), %r15
leaq 0x48(%rdi), %r14
movq (%rdi), %rax
movq %r15, %rsi
callq *0x18(%rax)
movq %r15, %rdi
callq 0x5e01
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x5acf
movq %r14, %rdi
movq %r12, %rsi
callq 0x5c42
movl $0xa0, %esi
movq %r12, %rdi
callq 0x25a4
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq (%rbx), %rax
pushq $0x20
popq %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x10(%rax)
movq (%rbx), %rax
leaq 0x68(%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq *0x10(%rax)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movq %rsp, %r15
movq %r15, %rsi
callq *0x18(%rax)
movq %r15, %rdi
callq 0x5e01
xorl %eax, %eax
cmpq $0x20, %rax
je 0x5e72
movb 0x48(%rbx,%rax), %cl
movb %cl, (%r14,%rax)
incq %rax
jmp 0x5e5f
leaq 0x8(%rbx), %rdx
leaq 0x28(%rbx), %rcx
addq $0x20, %r14
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x5eb0
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x25a4
movq (%rbx), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x25a4
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq