LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/utils/ParallelOperator.h
// Function: abcdl::utils::ParallelOperator<int>::parallel_mul2one_copy(int*, int const*, unsigned long, int const&, std::function<void (int*, int const&, int const&)> const&) const
void parallel_mul2one_copy(T* result_data,
                               const T* op1,
                               const size_t num_op1,
                               const T& op2,
                               const std::function<void(T*, const T&, const T&)> &f) const{
        size_t block_size = get_block_size(num_op1);
        size_t num_thread = get_num_thread(num_op1, block_size);
        std::vector<std::thread> threads(num_thread);

        for(size_t i = 0; i != num_thread; i++){
            threads[i] = std::thread(
                [&result_data, &op1, &f, &op2](size_t start_idx, size_t end_idx){
                    for(size_t ti = start_idx; ti != end_idx; ti++){
                        f(&result_data[ti], op1[ti], op2);
                    }
                }, i * block_size, std::min(num_op1, (i + 1) * block_size)
            );
        }

        for(auto& thread : threads){
            thread.join();
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rcx, (%rsp)
movq (%rdi), %r15
movq 0x8(%rdi), %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %r15
cmpq $0x1, %rdx
sbbq $-0x1, %rax
cmpq %rcx, %rsi
movq %rcx, %r12
cmovbq %rsi, %r12
cmpq %rsi, %rax
cmovaeq %rax, %r12
cmpq %r12, %rsi
jb 0xa9d6
movq %rcx, %rax
xorl %edx, %edx
divq %r12
movq %rax, %r15
cmpq $0x1, %rdx
sbbq $-0x1, %r15
leaq 0x20(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %r15, %rsi
callq 0xa482
testq %r15, %r15
je 0xaa5c
xorl %r13d, %r13d
xorl %ebp, %ebp
leaq 0x40(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x38(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %rbx, 0x58(%rsp)
movq %r14, 0x60(%rsp)
movq %r13, 0x10(%rsp)
addq %r12, %r13
movq %r13, 0x8(%rsp)
leaq 0x8(%rsp), %rcx
cmpq (%rsp), %r13
jb 0xaa2b
movq %rsp, %rcx
leaq 0x18(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0xaaae
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax,%rbp,8)
jne 0xaa92
movq 0x18(%rsp), %rcx
movq %rcx, (%rax,%rbp,8)
incq %rbp
cmpq %rbp, %r15
jne 0xa9f2
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %r14
cmpq %r14, %rbx
je 0xaa79
movq %rbx, %rdi
callq 0x95a0
addq $0x8, %rbx
jmp 0xaa66
leaq 0x20(%rsp), %rdi
callq 0xa594
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x90c0
jmp 0xaa99
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa594
movq %rbx, %rdi
callq 0x95d0
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/utils/ParallelOperator.h
// Function: abcdl::utils::ParallelOperator<int>::parallel_mul2mul(int*, unsigned long, int const*, unsigned long, std::function<void (int*, int const&)> const&) const
void parallel_mul2mul(T* op1,
                          const size_t num_op1,
                          const T* op2,
                          const size_t num_op2,
                          const std::function<void(T*, const T&)> &f) const{
        CHECK(num_op1 == num_op2);
        size_t block_size = get_block_size(num_op1);
        size_t num_thread = get_num_thread(num_op1, block_size);
        std::vector<std::thread> threads(num_thread);

        for(size_t i = 0; i != num_thread; i++){
            threads[i] = std::thread(
                [&op1, &op2, &f](size_t start_idx, size_t end_idx){
                    for(size_t ti = start_idx; ti != end_idx; ti++){
                        f(&op1[ti], op2[ti]);
                    }
                }, i * block_size, std::min(num_op1, (i + 1) * block_size)
            );
        }

        for(auto& thread : threads){
            thread.join();
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %r9, 0x8(%rsp)
movq %rdi, %r15
movq %rsi, 0x30(%rsp)
movq %rdx, (%rsp)
movq %rcx, 0x28(%rsp)
cmpq %r8, %rdx
jne 0xac8f
movq (%rsp), %rcx
movq (%r15), %r14
movq 0x8(%r15), %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %r14
cmpq $0x1, %rdx
sbbq $-0x1, %rax
cmpq %rcx, %rsi
movq %rcx, %rbp
cmovbq %rsi, %rbp
cmpq %rsi, %rax
cmovaeq %rax, %rbp
cmpq %rbp, %rsi
jb 0xabc6
movq %rcx, %rax
xorl %edx, %edx
divq %rbp
movq %rax, %r14
cmpq $0x1, %rdx
sbbq $-0x1, %r14
leaq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rdx
movq %r14, %rsi
callq 0xa482
testq %r14, %r14
je 0xac56
xorl %ebx, %ebx
leaq 0x38(%rsp), %r12
leaq 0x18(%rsp), %r13
xorl %r15d, %r15d
leaq 0x30(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %rbx, 0x18(%rsp)
addq %rbp, %rbx
movq %rbx, 0x10(%rsp)
leaq 0x10(%rsp), %rcx
cmpq (%rsp), %rbx
jb 0xac25
movq %rsp, %rcx
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xad00
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax,%r15,8)
jne 0xacd0
movq 0x20(%rsp), %rcx
movq %rcx, (%rax,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0xabec
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %r14
cmpq %r14, %rbx
je 0xac73
movq %rbx, %rdi
callq 0x95a0
addq $0x8, %rbx
jmp 0xac60
leaq 0x50(%rsp), %rdi
callq 0xa594
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f38a(%rip), %rsi     # 0x3a020
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl $0x83, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x2f38d(%rip), %rsi     # 0x3a041
movl $0x20, %edx
movq %r14, %rdi
callq 0x93b0
leaq 0x50(%rsp), %rdi
callq 0x38b76
jmp 0xab82
callq 0x90c0
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x38b76
jmp 0xacf8
movq %rax, %rbx
jmp 0xacf8
jmp 0xaceb
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xa594
movq %rbx, %rdi
callq 0x95d0
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/utils/ParallelOperator.h
// Function: abcdl::utils::ParallelOperator<int>::parallel_reduce_mul2one(int*, int const*, unsigned long, std::function<void (int*, int const&)> const&) const
void parallel_reduce_mul2one(T* result_value,
                                 const T* op1,
                         		 const size_t num_op1,
                         		 const std::function<void(T*, const T&)> &f) const{
        size_t block_size = get_block_size(num_op1);
        size_t num_thread = get_num_thread(num_op1, block_size);
        std::vector<std::thread> threads(num_thread);
		T* data = new T[num_thread];

        for(size_t i = 0; i != num_thread; i++){
            threads[i] = std::thread(
                [&op1, &result_value, &data, i, &f](size_t start_idx, size_t end_idx){
					for(size_t ti = start_idx; ti != end_idx; ti++){
            			if(ti == start_idx){
							data[i] = op1[ti];
						}else{
    						f(&data[i], op1[ti]);
                        }
                    }
					f(result_value, data[i]);
                }, i * block_size, std::min(num_op1, (i + 1) * block_size)
            );
        }

        for(auto& thread : threads){
            thread.join();
        }
		delete[] data;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, 0x18(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x10(%rsp)
movq (%rdi), %r14
movq 0x8(%rdi), %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %r14
cmpq $0x1, %rdx
sbbq $-0x1, %rax
cmpq %rcx, %rsi
movq %rcx, %rbp
cmovbq %rsi, %rbp
cmpq %rsi, %rax
cmovaeq %rax, %rbp
cmpq %rbp, %rsi
jb 0xb319
movq %rcx, %rax
xorl %edx, %edx
divq %rbp
movq %rax, %r14
cmpq $0x1, %rdx
sbbq $-0x1, %r14
leaq 0x38(%rsp), %rdi
leaq 0x60(%rsp), %rdx
movq %r14, %rsi
callq 0xa482
movq %r14, %rax
shrq $0x3e, %rax
leaq (,%r14,4), %rcx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x9030
movq %rax, 0x8(%rsp)
testq %r14, %r14
je 0xb3e2
xorl %ebx, %ebx
leaq 0x60(%rsp), %r12
leaq 0x28(%rsp), %r13
xorl %r15d, %r15d
leaq 0x50(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x8(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %r15, 0x78(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x80(%rsp)
movq %rbx, 0x28(%rsp)
addq %rbp, %rbx
movq %rbx, 0x20(%rsp)
leaq 0x20(%rsp), %rcx
cmpq 0x10(%rsp), %rbx
jb 0xb3b5
leaq 0x10(%rsp), %rcx
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xb448
movq 0x38(%rsp), %rax
cmpq $0x0, (%rax,%r15,8)
jne 0xb42a
movq 0x30(%rsp), %rcx
movq %rcx, (%rax,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0xb367
movq 0x38(%rsp), %rbx
movq 0x40(%rsp), %r14
cmpq %r14, %rbx
je 0xb3ff
movq %rbx, %rdi
callq 0x95a0
addq $0x8, %rbx
jmp 0xb3ec
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xb40e
callq 0x9420
leaq 0x38(%rsp), %rdi
callq 0xa594
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x90c0
jmp 0xb433
jmp 0xb433
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xa594
movq %rbx, %rdi
callq 0x95d0
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/fnn/Layer.h
// Function: abcdl::fnn::OutputLayer::OutputLayer(unsigned long, unsigned long, abcdl::framework::ActivateFunc*, abcdl::framework::Cost*, float const&, float const&)
OutputLayer(const size_t input_dim,
                const size_t output_dim,
                abcdl::framework::ActivateFunc* activate_func,
                abcdl::framework::Cost* cost,
                const real& mean_value = 0.0f,
                const real& stddev = 0.5f) : Layer(input_dim, output_dim, abcdl::framework::OUTPUT){
        _cost           = cost;
        _activate_func  = activate_func;

        this->_weight.reset(_input_dim, _output_dim, mean_value, stddev);
        this->_bias.reset(1, _output_dim, mean_value, stddev);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %rbp
movq %rcx, %r13
movq %rdi, %rbx
movl $0x4, %ecx
callq 0x1135a
leaq 0x46493(%rip), %rax     # 0x56d08
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x178(%rbx), %r14
movq %r14, %rdi
callq 0x19a38
movq 0x50(%rsp), %r12
movq %rbp, 0x170(%rbx)
movq %r13, 0x168(%rbx)
leaq 0x30(%rbx), %rdi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
xorl %ebp, %ebp
leaq 0x14(%rsp), %r9
movl %ebp, (%r9)
leaq 0x10(%rsp), %r13
movl %ebp, (%r13)
movq %r13, (%rsp)
movq %r15, %rcx
movq %r12, %r8
callq 0x1de94
leaq 0x68(%rbx), %rdi
movq 0x10(%rbx), %rdx
leaq 0x14(%rsp), %r9
movl %ebp, (%r9)
movl %ebp, 0x10(%rsp)
movq %r13, (%rsp)
movl $0x1, %esi
movq %r15, %rcx
movq %r12, %r8
callq 0x1de94
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10905
movq %rax, %r15
movq %r14, %rdi
callq 0x19c8e
jmp 0x10915
movq %rax, %r15
movq %rbx, %rdi
callq 0x1148a
movq %r15, %rdi
callq 0x95d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/fnn/FNN.h
// Function: abcdl::fnn::FNN::set_layers(std::vector<abcdl::fnn::Layer*, std::allocator<abcdl::fnn::Layer*>>&)
void set_layers(std::vector<abcdl::fnn::Layer*>& layers){
        size_t layer_size = layers.size();
        CHECK(layer_size > 1 && layers[0]->get_layer_type() == abcdl::framework::INPUT);
        size_t output_dim = layers[0]->get_output_dim();
        for(size_t i = 1; i != layer_size; i++){
            CHECK(layers[i]->get_layer_type() == ((i == layer_size - 1) ? abcdl::framework::OUTPUT : abcdl::framework::FULL_CONN));
            CHECK(output_dim == layers[i]->get_input_dim());
            output_dim = layers[i]->get_output_dim();
        }
        _layers = layers;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %r13
subq %rax, %r13
movq %r13, %r15
sarq $0x3, %r15
cmpq $0x2, %r15
jb 0x10a83
movq (%rax), %rax
cmpl $0x0, 0x18(%rax)
jne 0x10a83
cmpq $0x8, %r13
jne 0x10986
addq $0x30, %rdi
movq %rbx, %rsi
callq 0x11588
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rax
leaq -0x1(%r15), %r13
addq $-0x2, %r15
movl $0x1, %ebp
xorl %r12d, %r12d
leaq 0x2974a(%rip), %rsi     # 0x3a0ea
leaq 0x10(%rsp), %rdx
movq (%rax), %rax
movq 0x10(%rax), %r14
movq (%rbx), %rax
movq 0x8(%rax,%r12,8), %rax
xorl %ecx, %ecx
cmpq %r12, %r15
sete %cl
leal (%rcx,%rcx,2), %ecx
incl %ecx
cmpl %ecx, 0x18(%rax)
jne 0x109ef
movq (%rbx), %rax
movq 0x8(%rax,%r12,8), %rax
cmpq 0x8(%rax), %r14
jne 0x10a39
leaq (,%rbp,8), %rax
addq (%rbx), %rax
incq %rbp
incq %r12
cmpq %r12, %r13
jne 0x109a5
jmp 0x10968
movq %rdi, 0x8(%rsp)
movq %rdx, %rdi
movl $0x39, %edx
movl $0x3, %ecx
callq 0x3894e
movl $0x7d, %edx
leaq 0x10(%rsp), %rdi
leaq 0x2973c(%rip), %rsi     # 0x3a153
callq 0x93b0
leaq 0x10(%rsp), %rdi
callq 0x38b76
movq 0x8(%rsp), %rdi
leaq 0x296b8(%rip), %rsi     # 0x3a0ea
leaq 0x10(%rsp), %rdx
jmp 0x109c6
movq %rdi, 0x8(%rsp)
movq %rdx, %rdi
movq %rdx, %r14
movl $0x3a, %edx
movl $0x3, %ecx
callq 0x3894e
movl $0x36, %edx
movq %r14, %rdi
leaq 0x2976f(%rip), %rsi     # 0x3a1d1
callq 0x93b0
movq %r14, %rdi
callq 0x38b76
movq 0x8(%rsp), %rdi
leaq 0x2966f(%rip), %rsi     # 0x3a0ea
movq %r14, %rdx
jmp 0x109d4
movq %rdi, %r14
leaq 0x2965d(%rip), %rsi     # 0x3a0ea
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movl $0x36, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x29651(%rip), %rsi     # 0x3a0fc
movl $0x56, %edx
movq %r12, %rdi
callq 0x93b0
leaq 0x10(%rsp), %rdi
callq 0x38b76
movq %r14, %rdi
jmp 0x10962
jmp 0x10ace
jmp 0x10ace
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x38b76
movq %rbx, %rdi
callq 0x95d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/fnn/FNN.h
// Function: abcdl::fnn::FNN::~FNN()
~FNN(){
        for(auto& layer : _layers){
            delete layer;
			layer = nullptr;
        }
        _layers.clear();

        if(_loss != nullptr){
            delete _loss;
            _loss = nullptr;
        }

    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %r14
movq 0x38(%rdi), %r15
cmpq %r15, %r14
je 0x11266
movq (%r14), %rdi
testq %rdi, %rdi
je 0x11259
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, (%r14)
addq $0x8, %r14
jmp 0x11246
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x11274
movq %rax, 0x38(%rbx)
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x1128b
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x48(%rbx)
movq 0x50(%rbx), %rdi
leaq 0x60(%rbx), %rax
cmpq %rax, %rdi
je 0x1129d
callq 0x9350
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x112ab
callq 0x9350
movq 0x10(%rbx), %rdi
addq $0x20, %rbx
cmpq %rbx, %rdi
je 0x112c2
popq %rbx
popq %r14
popq %r15
jmp 0x9350
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/utils/MnistHelper.h
// Function: abcdl::utils::MnistHelper<float>::read_label(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, abcdl::algebra::Matrix<float>*, int)
bool MnistHelper<T>::read_label(const std::string& label_file,
                                abcdl::algebra::Matrix<T>* out_mat,
                                const int limit){
    size_t count = 0;
    auto label_buffer = read_mnist_file(label_file, 0x801, &count);
    if(!label_buffer || count == 0){
        return false;
    }

    if( limit > 0 && limit < (int)count){
        count = limit;
    }

    //read label data
    auto label_data_buffer = reinterpret_cast<unsigned char*>(label_buffer.get() + 8);

    T* labels = new T[count];
    for(size_t i = 0; i < count; i++){
        labels[i] = static_cast<T>(*label_data_buffer++);
    }

    out_mat->set_shallow_data(labels, count, 1);

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %rsi
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
movq %rsp, %r12
movq %r12, %rdi
movl $0x801, %ecx            # imm = 0x801
movq %r15, %r8
callq 0x12272
movq (%r12), %r12
testq %r12, %r12
setne %cl
movq (%r15), %rax
testq %rax, %rax
setne %bpl
andb %cl, %bpl
cmpb $0x1, %bpl
jne 0x12a38
testl %r14d, %r14d
setg %cl
cmpl %r14d, %eax
setg %al
andb %cl, %al
cmpb $0x1, %al
jne 0x129e0
movl %r14d, %eax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %r14
movq %r14, %rax
shrq $0x3e, %rax
leaq (,%r14,4), %rcx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x9030
testq %r14, %r14
je 0x12a25
xorl %ecx, %ecx
movzbl 0x8(%r12,%rcx), %edx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movss %xmm0, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r14
jne 0x12a0b
movl $0x1, %ecx
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x1a00a
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x12a46
callq 0x9420
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x12a66
callq 0x9420
movq %rbx, %rdi
callq 0x95d0
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/utils/MnistHelper.h
// Function: abcdl::utils::MnistHelper<float>::read_vec_labels(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, abcdl::algebra::MatrixSet<float>&, int, unsigned long)
bool MnistHelper<T>::read_vec_labels(const std::string& label_file,
                                     abcdl::algebra::MatrixSet<T>& out_matrix_set,
                                     const int limit,
                                     const size_t vec_size){
    size_t count = 0;
    auto label_buffer = read_mnist_file(label_file, 0x801, &count);
    if(!label_buffer || count == 0){
        return false;
    }

    if( limit > 0 && limit < (int)count){
        count = limit;
    }

    //read label data
    auto label_data_buffer = reinterpret_cast<unsigned char*>(label_buffer.get() + 8);

    T* labels = new T[vec_size];
    for(size_t i = 0; i < count; i++){
        memset(labels, 0, sizeof(T) * vec_size);
        auto label = static_cast<size_t>(*label_data_buffer++);
        labels[label] = 1;
        out_matrix_set.push_back(abcdl::algebra::Matrix<T>(labels, 1, vec_size));
    }
    delete[] labels;

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %rbx
movl %ecx, %r15d
movq %rdx, 0x18(%rsp)
movq %rsi, %rdx
movq %rdi, %rsi
leaq 0x8(%rsp), %r12
movq $0x0, (%r12)
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl $0x801, %ecx            # imm = 0x801
movq %r12, %r8
callq 0x12272
movq (%r13), %rbp
testq %rbp, %rbp
setne %cl
movq (%r12), %rax
testq %rax, %rax
setne %r14b
andb %cl, %r14b
cmpb $0x1, %r14b
jne 0x12b7c
testl %r15d, %r15d
setg %cl
cmpl %r15d, %eax
setg %al
andb %cl, %al
cmpb $0x1, %al
jne 0x12aeb
movl %r15d, %eax
movq %rax, 0x8(%rsp)
movb %r14b, 0x7(%rsp)
movq %rbx, %rax
shrq $0x3e, %rax
leaq (,%rbx,4), %r15
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %r15, %rdi
callq 0x9030
movq %rax, %r12
cmpq $0x0, 0x8(%rsp)
je 0x12b6f
xorl %r14d, %r14d
leaq 0x20(%rsp), %r13
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x91d0
movzbl 0x8(%rbp,%r14), %eax
movl $0x3f800000, (%r12,%rax,4) # imm = 0x3F800000
movl $0x1, %edx
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x19bc0
movq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0x12532
movq %r13, %rdi
callq 0x19c8e
incq %r14
cmpq 0x8(%rsp), %r14
jb 0x12b22
movq %r12, %rdi
callq 0x9420
movb 0x7(%rsp), %r14b
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12b8b
callq 0x9420
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12b9f
movq %rax, %rbx
jmp 0x12bb1
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x19c8e
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12bc0
callq 0x9420
movq %rbx, %rdi
callq 0x95d0
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/utils/MnistHelper.h
// Function: abcdl::utils::MnistHelper<float>::read_vec_label(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, abcdl::algebra::Matrix<float>*, int, unsigned long)
bool MnistHelper<T>::read_vec_label(const std::string& label_file,
                                    abcdl::algebra::Matrix<T>* out_mat,
                                    const int limit,
                                    const size_t vec_size){
    size_t count = 0;
    auto label_buffer = read_mnist_file(label_file, 0x801, &count);
    if(!label_buffer || count == 0){
        return false;
    }

    if( limit > 0 && limit < (int)count){
        count = limit;
    }

    //read label data
    auto label_data_buffer = reinterpret_cast<unsigned char*>(label_buffer.get() + 8);

    T* labels = new T[count * vec_size];
    memset(labels, 0, sizeof(T) * count * vec_size);

    for(size_t i = 0; i < count; i++){
        auto label = static_cast<size_t>(*label_data_buffer++);
        labels[i * vec_size + label] = 1;
    }

    out_mat->set_shallow_data(labels, count, vec_size);

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movl %ecx, %r15d
movq %rdx, 0x10(%rsp)
movq %rsi, %rdx
movq %rdi, %rsi
leaq 0x8(%rsp), %r12
movq $0x0, (%r12)
movq %rsp, %r13
movq %r13, %rdi
movl $0x801, %ecx            # imm = 0x801
movq %r12, %r8
callq 0x12272
movq (%r13), %r14
testq %r14, %r14
setne %cl
movq (%r12), %rax
testq %rax, %rax
setne %bpl
andb %cl, %bpl
cmpb $0x1, %bpl
jne 0x14cdf
testl %r15d, %r15d
setg %cl
cmpl %r15d, %eax
setg %al
andb %cl, %al
cmpb $0x1, %al
jne 0x14c6b
movl %r15d, %eax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %r15
movq %r15, %r13
imulq %rbx, %r13
movq %r13, %rax
shrq $0x3e, %rax
shlq $0x2, %r13
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %r13, %rdi
callq 0x9030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x91d0
testq %r15, %r15
je 0x14ccc
leaq (,%rbx,4), %rax
xorl %ecx, %ecx
movq %r12, %rdx
movzbl 0x8(%r14,%rcx), %esi
movl $0x3f800000, (%rdx,%rsi,4) # imm = 0x3F800000
incq %rcx
addq %rax, %rdx
cmpq %rcx, %r15
jne 0x14cb4
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x1a00a
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x14ced
callq 0x9420
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x14d0f
callq 0x9420
movq %rbx, %rdi
callq 0x95d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/fnn/Layer.cpp
// Function: abcdl::fnn::FullConnLayer::backward(abcdl::fnn::Layer*, abcdl::fnn::Layer*)
void FullConnLayer::backward(Layer* pre_layer, Layer* next_layer){
    //δ_l = ( (w_l+1).T .* δ_l+1 ) * Derivative(a_l)
    abcdl::algebra::Mat activate_derivative;
    _activate_func->derivative(activate_derivative, this->_activate_data);
    _delta_bias   = _helper.dot(next_layer->get_delta_bias(), next_layer->get_weight().Ts()) * activate_derivative;

    /*
     * Derivative(Cw) = a_in * δ_out
     * a_in = a_l-1, δ_out = mat
     * activations include input layer, so l-1 is i.
     */
    this->_delta_weight   = _helper.dot(pre_layer->get_activate_data().Ts(), this->_delta_bias);

    this->_batch_bias     += this->_delta_bias;
    this->_batch_weight   += this->_delta_weight;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x80(%rsp), %r12
movq %r12, %rdi
callq 0x19a38
movq 0x168(%rbx), %rdi
leaq 0xa0(%rbx), %rdx
movq (%rdi), %rax
movq %r12, %rsi
callq *0x18(%rax)
leaq 0x30(%r15), %rsi
leaq 0x58(%rsp), %rdi
callq 0x1ad28
leaq 0x20(%rbx), %r12
addq $0xf0, %r15
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rcx
movq %r12, %rsi
movq %r15, %rdx
callq 0x30636
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x226fc
leaq 0xf0(%rbx), %r15
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
callq 0x216ea
leaq 0x30(%rsp), %rdi
callq 0x19c8e
leaq 0x8(%rsp), %rdi
callq 0x19c8e
leaq 0x58(%rsp), %rdi
callq 0x19c8e
addq $0xa0, %r14
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x1ad28
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %r12, %rsi
movq %r15, %rcx
callq 0x30636
leaq 0xc8(%rbx), %r14
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x216ea
leaq 0x30(%rsp), %rdi
callq 0x19c8e
leaq 0x8(%rsp), %rdi
callq 0x19c8e
leaq 0x140(%rbx), %rdi
movq %r15, %rsi
callq 0x21bd8
addq $0x118, %rbx            # imm = 0x118
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21bd8
leaq 0x80(%rsp), %rdi
callq 0x19c8e
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x19c8e
jmp 0x14f91
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x14fc0
jmp 0x14fc9
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x19c8e
jmp 0x14fac
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x19c8e
jmp 0x14fbb
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x19c8e
jmp 0x14fcc
jmp 0x14fc9
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x19c8e
movq %rbx, %rdi
callq 0x95d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/fnn/Layer.cpp
// Function: abcdl::fnn::OutputLayer::backward(abcdl::fnn::Layer*, abcdl::fnn::Layer*)
void OutputLayer::backward(Layer* pre_layer, Layer* next_layer){
    /*
     * L layer(last layer) Error
     * Error δL = cost->delta
     */
    _cost->delta(this->_delta_bias, this->_activate_data, this->_y);
    /*
     * Derivative(Cw) = a_in * δ_out
     * a_in = a_L-1, δ_out = delta
     */
    this->_delta_weight   = _helper.dot(pre_layer->get_activate_data().Ts(), this->_delta_bias);

    this->_batch_weight   += this->_delta_weight;
    this->_batch_bias     += this->_delta_bias;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x170(%rdi), %rdi
leaq 0xf0(%rbx), %r14
movl $0xa0, %r12d
leaq (%rbx,%r12), %rdx
leaq 0x178(%rbx), %rcx
movq (%rdi), %rax
movq %r14, %rsi
callq *0x10(%rax)
leaq 0x20(%rbx), %r13
addq %r15, %r12
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x1ad28
movq %rsp, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x30636
leaq 0xc8(%rbx), %r15
movq %rsp, %rsi
movq %r15, %rdi
callq 0x216ea
movq %rsp, %rdi
callq 0x19c8e
leaq 0x28(%rsp), %rdi
callq 0x19c8e
leaq 0x118(%rbx), %rdi
movq %r15, %rsi
callq 0x21bd8
addq $0x140, %rbx            # imm = 0x140
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21bd8
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x19c8e
jmp 0x1513e
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x19c8e
movq %rbx, %rdi
callq 0x95d0
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/utils/Shuffler.h
// Function: abcdl::utils::Shuffler::shuffle()
void Shuffler::shuffle(){

    std::random_device rd;
    size_t random_idx, value;

    for(size_t i = _size - 1; i != 0 ; i--){
        random_idx = rd() % i;
        value =  _shuffler_idx[random_idx];

        _shuffler_idx[random_idx] = _shuffler_idx[i];
        _shuffler_idx[i] = value;
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1390, %rsp           # imm = 0x1390
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x16f56
movq (%rbx), %r15
decq %r15
je 0x1565a
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x9460
movl %eax, %eax
xorl %edx, %edx
divq %r15
movq 0x8(%rbx), %rax
movq (%rax,%rdx,8), %rcx
movq (%rax,%r15,8), %rsi
movq %rsi, (%rax,%rdx,8)
movq %rcx, (%rax,%r15,8)
decq %r15
jne 0x15632
leaq 0x8(%rsp), %rdi
callq 0x9340
addq $0x1390, %rsp           # imm = 0x1390
popq %rbx
popq %r14
popq %r15
retq
jmp 0x15688
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x9340
movq %rbx, %rdi
callq 0x95d0
movq %rax, %rdi
callq 0x112c8
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/fnn/FNN.cpp
// Function: abcdl::fnn::FNN::predict(abcdl::algebra::Matrix<float>&, abcdl::algebra::Matrix<float> const&)
void FNN::predict(abcdl::algebra::Mat& result, const abcdl::algebra::Mat& predict_data){
    CHECK(predict_data.cols() == _layers[0]->get_input_dim());
    size_t layer_size = _layers.size();
    for(size_t k = 0; k < layer_size; k++){
        if(k == 0){
            ((InputLayer*)_layers[k])->set_x(predict_data);
        }
        _layers[k]->forward(_layers[k-1]);
        if(k > 0){
            //_layers[k]->get_activate_data().display("|");
        }
    }
    //predict_data.display("^");
    //_layers[layer_size - 1]->get_activate_data().display("|");
    result = _layers[layer_size - 1]->get_activate_data();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x8(%rdx), %rax
movq 0x30(%rdi), %rcx
movq (%rcx), %rcx
cmpq 0x8(%rcx), %rax
jne 0x165a1
movq 0x38(%r15), %r12
subq 0x30(%r15), %r12
je 0x16579
movq %r12, %r13
sarq $0x3, %r13
cmpq $0x1, %r13
adcq $0x0, %r13
xorl %ebp, %ebp
testq %rbp, %rbp
jne 0x1655e
movq 0x30(%r15), %rax
movq (%rax), %rdi
movq %r14, %rsi
callq 0x14d18
movq 0x30(%r15), %rax
movq -0x8(%rax,%rbp,8), %rsi
movq (%rax,%rbp,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
incq %rbp
cmpq %rbp, %r13
jne 0x1654a
movq 0x30(%r15), %rax
movl $0xa0, %esi
addq -0x8(%rax,%r12), %rsi
movq %rbx, %rdi
callq 0x216ea
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25a48(%rip), %rsi     # 0x3bff0
movq %rsp, %r12
movq %r12, %rdi
movl $0x86, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x25cbf(%rip), %rsi     # 0x3c283
movl $0x40, %edx
movq %r12, %rdi
callq 0x93b0
movq %rsp, %rdi
callq 0x38b76
jmp 0x1652f
movq %rax, %rbx
movq %rsp, %rdi
callq 0x38b76
movq %rbx, %rdi
callq 0x95d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/fnn/FNN.cpp
// Function: abcdl::fnn::FNN::write_model(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool FNN::write_model(const std::string& path){
    std::vector<abcdl::algebra::Mat*> params;
    for(size_t i = 1; i != _layers.size(); i++){
        params.push_back(&_layers[i]->get_weight());
        params.push_back(&_layers[i]->get_bias());
    }
    return _model_loader.write<real>(params, path, "FNNMODEL", false);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x30(%rdi), %rax
movq 0x38(%rdi), %rcx
subq %rax, %rcx
cmpq $0x8, %rcx
je 0x16b2b
movl $0x1, %r13d
movq %rsp, %r15
leaq 0x18(%rsp), %r12
movq (%rax,%r13,8), %rax
addq $0x30, %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x16ad6
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x16ae1
movq %r15, %rdi
movq %r12, %rdx
callq 0x18328
movq 0x30(%r14), %rax
movq (%rax,%r13,8), %rax
addq $0x68, %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x16b09
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x16b14
movq %r15, %rdi
movq %r12, %rdx
callq 0x18328
incq %r13
movq 0x30(%r14), %rax
movq 0x38(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
jne 0x16ab2
leaq 0x38(%rsp), %rdi
movq %rsp, %rsi
callq 0x17c90
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x25790(%rip), %rsi     # 0x3c2d8
leaq 0x25791(%rip), %rdx     # 0x3c2e0
leaq 0x18(%rsp), %rdi
callq 0x148b8
addq $0x50, %r14
leaq 0x38(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0x17702
movl %eax, %ebx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x16b86
callq 0x9350
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x16b95
callq 0x9350
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16ba3
callq 0x9350
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x16bca
callq 0x9350
jmp 0x16bca
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x16be2
callq 0x9350
jmp 0x16be2
jmp 0x16bdf
jmp 0x16bdf
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16bf0
callq 0x9350
movq %rbx, %rdi
callq 0x95d0
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/fnn/Layer.h
// Function: abcdl::fnn::Layer::update_gradient(unsigned long, float)
void update_gradient(const size_t batch_size,
                         const real learning_rate){
		real lr = learning_rate / batch_size;
        _weight -= _batch_weight * lr;
        _bias   -= _batch_bias * lr;
        
		_batch_weight.reset(0);
        _batch_bias.reset(0);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
testq %rsi, %rsi
js 0x16fdb
cvtsi2ss %rsi, %xmm1
jmp 0x16ff0
movq %rsi, %rax
shrq %rax
andl $0x1, %esi
orq %rax, %rsi
cvtsi2ss %rsi, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm0
leaq 0x4(%rsp), %rdx
movss %xmm0, (%rdx)
leaq 0x118(%rbx), %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x22652
leaq 0x30(%rbx), %rdi
movq %r15, %rsi
callq 0x22374
leaq 0x8(%rsp), %rdi
callq 0x19c8e
leaq 0x140(%rbx), %r15
leaq 0x8(%rsp), %r12
leaq 0x4(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x22652
addq $0x68, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22374
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x19c8e
xorl %ebp, %ebp
movl %ebp, (%rbx)
leaq 0x8(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1abc4
movl %ebp, (%rbx)
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x1abc4
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17094
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x19c8e
movq %rbx, %rdi
callq 0x95d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/fnn/Layer.h
// Function: abcdl::fnn::Layer::set_weight(abcdl::algebra::Matrix<float> const&)
bool set_weight(const abcdl::algebra::Mat& weight){
        if(weight.rows() != _weight.rows()){
            LOG(FATAL) << "set weight rows error:" << weight.rows() << " must be:" << _weight.rows();
            return false;
        }
        if(weight.cols() != _weight.cols()){
            LOG(FATAL) << "set weight cols error:" << weight.cols() << " must be:" << _weight.cols();
            return false;
        }
        _weight = weight;
        return true;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %rbx
movq (%rsi), %rax
leaq 0x30(%rdi), %r14
cmpq 0x30(%rdi), %rax
jne 0x174c5
movq %rdi, %r15
movq 0x8(%rbx), %rax
cmpq 0x38(%rdi), %rax
jne 0x17529
movq %r14, %rdi
movq %rbx, %rsi
callq 0x17d10
movb $0x1, %al
jmp 0x17599
leaq 0x24eb5(%rip), %rsi     # 0x3c381
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x31, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x24eab(%rip), %rsi     # 0x3c395
movl $0x16, %edx
movq %r15, %rdi
callq 0x93b0
movq (%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x9200
leaq 0x24dfd(%rip), %rsi     # 0x3c308
leaq 0x8(%rsp), %rdi
movl $0x9, %edx
callq 0x93b0
movq (%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x9200
jmp 0x1758d
leaq 0x24e51(%rip), %rsi     # 0x3c381
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x35, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x24e5e(%rip), %rsi     # 0x3c3ac
movl $0x16, %edx
movq %r14, %rdi
callq 0x93b0
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x9200
leaq 0x24d98(%rip), %rsi     # 0x3c308
leaq 0x8(%rsp), %rdi
movl $0x9, %edx
callq 0x93b0
movq 0x38(%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x9200
leaq 0x8(%rsp), %rdi
callq 0x38b76
xorl %eax, %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
jmp 0x175b0
jmp 0x175b0
jmp 0x175b0
jmp 0x175b0
jmp 0x175b0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x38b76
movq %rbx, %rdi
callq 0x95d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/fnn/Layer.h
// Function: abcdl::fnn::Layer::set_bias(abcdl::algebra::Matrix<float> const&)
bool set_bias(const abcdl::algebra::Mat& bias){
        if(bias.rows() != _bias.rows()){
            LOG(FATAL) << "set bias rows error:" << bias.rows() << " must be:" << _bias.rows();
            return false;
        }
        if(bias.cols() != _bias.cols()){
            LOG(FATAL) << "set bias cols error:" << bias.cols() << " must be:" << _bias.cols();
            return false;
        }
        _bias = bias;
        return true;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %rbx
movq (%rsi), %rax
leaq 0x68(%rdi), %r14
cmpq 0x68(%rdi), %rax
jne 0x17601
movq %rdi, %r15
movq 0x8(%rbx), %rax
cmpq 0x70(%rdi), %rax
jne 0x17665
movq %r14, %rdi
movq %rbx, %rsi
callq 0x17d10
movb $0x1, %al
jmp 0x176d5
leaq 0x24d79(%rip), %rsi     # 0x3c381
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x3f, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x24d9d(%rip), %rsi     # 0x3c3c3
movl $0x14, %edx
movq %r15, %rdi
callq 0x93b0
movq (%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x9200
leaq 0x24cc1(%rip), %rsi     # 0x3c308
leaq 0x8(%rsp), %rdi
movl $0x9, %edx
callq 0x93b0
movq (%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x9200
jmp 0x176c9
leaq 0x24d15(%rip), %rsi     # 0x3c381
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x43, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x24d4e(%rip), %rsi     # 0x3c3d8
movl $0x14, %edx
movq %r14, %rdi
callq 0x93b0
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x9200
leaq 0x24c5c(%rip), %rsi     # 0x3c308
leaq 0x8(%rsp), %rdi
movl $0x9, %edx
callq 0x93b0
movq 0x70(%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x9200
leaq 0x8(%rsp), %rdi
callq 0x38b76
xorl %eax, %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
jmp 0x176ec
jmp 0x176ec
jmp 0x176ec
jmp 0x176ec
jmp 0x176ec
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x38b76
movq %rbx, %rdi
callq 0x95d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/algebra/Matrix.h
// Function: abcdl::algebra::RandomMatrix<float>::operator=(abcdl::algebra::Matrix<float> const&)
RandomMatrix<T>& operator = (const Matrix<T>& mat){
        if(this->get_size() != mat.get_size()){
            if(this->_data != nullptr){
                delete[] this->_data;
            }
            this->_data = new T[mat.get_size()];
        }
        this->_rows = mat.rows();
        this->_cols = mat.cols();
        memcpy(this->_data, mat.data(), sizeof(T) * mat.get_size());

        return *this;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
imulq (%rdi), %rax
movq 0x8(%rsi), %rcx
imulq (%rsi), %rcx
cmpq %rcx, %rax
je 0x17d64
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x17d3d
callq 0x9420
movq 0x8(%r14), %rax
imulq (%r14), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
xorl %edi, %edi
negq %rcx
sbbq %rdi, %rdi
orq %rax, %rdi
callq 0x9030
movq %rax, 0x10(%rbx)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rbx), %rdi
movq (%r14), %rdx
movq 0x10(%r14), %rsi
imulq 0x8(%r14), %rdx
shlq $0x2, %rdx
callq 0x92b0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/algebra/MatrixBase.cpp
// Function: abcdl::algebra::Matrix<int>::Matrix(unsigned long, unsigned long)
Matrix<T>::Matrix(const size_t rows, const size_t cols){
    _rows = rows;
    _cols = cols;
    _data = new T[_rows * _cols];
    memset(_data, 0, sizeof(T) * _rows * _cols);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
addq $0x18, %rdi
callq 0xa2f2
movq %r14, (%r15)
movq %rbx, 0x8(%r15)
imulq %r14, %rbx
movq %rbx, %rax
shrq $0x3e, %rax
shlq $0x2, %rbx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rbx, %rdi
callq 0x9030
movq %rax, 0x10(%r15)
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x91d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/algebra/MatrixBase.cpp
// Function: abcdl::algebra::Matrix<int>::Matrix(int const&, unsigned long, unsigned long)
Matrix<T>::Matrix(const T& value,
                  const size_t rows,
                  const size_t cols){
    _rows = rows;
    _cols = cols;
    _data = new T[_rows * _cols];
    if(value == 0 || value == static_cast<T>(-1)){
        memset(_data, value, sizeof(T) * _rows * _cols);
    }else{
        auto lambda = [](T* a, const T& b){ *a = b; };
        _po.parallel_mul2one(_data, get_size(), value, lambda);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r13
leaq 0x18(%rdi), %r15
movq %r15, %rdi
callq 0xa2f2
movq %r12, (%r13)
movq %rbx, 0x8(%r13)
imulq %r12, %rbx
movq %rbx, %rax
shrq $0x3e, %rax
leaq (,%rbx,4), %r12
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %r12, %rdi
callq 0x9030
movq %rax, 0x10(%r13)
movl (%r14), %esi
leal 0x1(%rsi), %ecx
cmpl $0x1, %ecx
ja 0x18591
movq %rax, %rdi
movq %r12, %rdx
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x91d0
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, (%r8)
leaq 0x63e8(%rip), %rcx      # 0x1e98a
movq %rcx, 0x18(%r8)
leaq 0x63e5(%rip), %rcx      # 0x1e992
movq %rcx, 0x10(%r8)
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xa5c8
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x185d9
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1860b
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x18603
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x95d0
movq %rax, %rdi
callq 0x112c8
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/algebra/MatrixBase.cpp
// Function: abcdl::algebra::Matrix<int>::Matrix(int const*, unsigned long, unsigned long)
Matrix<T>::Matrix(const T* data,
                  const size_t rows,
                  const size_t cols){
    _rows = rows;
    _cols = cols;
    _data = new T[_rows * _cols];
    memcpy(_data, data, sizeof(T) * _rows * _cols);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
addq $0x18, %rdi
callq 0xa2f2
movq %r14, (%r12)
movq %rbx, 0x8(%r12)
imulq %r14, %rbx
movq %rbx, %rax
shrq $0x3e, %rax
shlq $0x2, %rbx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rbx, %rdi
callq 0x9030
movq %rax, 0x10(%r12)
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x92b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/algebra/Matrix.h
// Function: abcdl::algebra::Matrix<int>::Matrix(abcdl::algebra::Matrix<int> const&)
Matrix(const Matrix<T>& mat){
        _rows = mat.rows();
        _cols = mat.cols();
        _data = new T[_rows * _cols];
        memcpy(_data, mat.data(), sizeof(T) * _rows * _cols);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x18, %rdi
callq 0xa2f2
movq (%rbx), %rax
movq %rax, (%r14)
movq 0x8(%rbx), %r15
movq %r15, 0x8(%r14)
imulq %rax, %r15
movq %r15, %rax
shrq $0x3e, %rax
shlq $0x2, %r15
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %r15, %rdi
callq 0x9030
movq %rax, 0x10(%r14)
movq 0x10(%rbx), %rsi
movq %rax, %rdi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x92b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/algebra/Matrix.h
// Function: abcdl::algebra::Matrix<int>::clear()
inline void clear(){
        _rows = 0;
        _cols = 0;
        if (_data!= nullptr){
            delete[] _data;
            _data = nullptr;
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x18728
callq 0x9420
movq $0x0, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/algebra/Matrix.h
// Function: abcdl::algebra::Matrix<int>::set_data(int const*, unsigned long, unsigned long)
inline void set_data(const T* data,
                         const size_t rows,
                         const size_t cols){
        if(_rows * _cols != rows * cols){
            if(_data != nullptr){
                delete[] _data;
            }
            _data = new T[rows * cols];
        }
        _rows = rows;
        _cols = cols;
        memcpy(_data, data, sizeof(T) * rows * cols);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r12
movq %rdi, %r14
movq 0x8(%rdi), %rax
imulq (%rdi), %rax
movq %rsi, %r15
movq %rcx, %r13
imulq %rdx, %r13
cmpq %r13, %rax
je 0x189bc
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x18999
callq 0x9420
movq %r13, %rax
shrq $0x3e, %rax
leaq (,%r13,4), %rcx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x9030
movq %rax, 0x10(%r14)
movq %r12, (%r14)
movq %rbx, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x2, %r13
movq %r15, %rsi
movq %r13, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x92b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/algebra/MatrixBase.cpp
// Function: abcdl::algebra::Matrix<int>::set_shallow_data(int*, unsigned long, unsigned long)
void Matrix<T>::set_shallow_data(T* data,
                                 const size_t rows,
                                 const size_t cols){
    if(_data != nullptr){
        delete[] _data;
    }
    _data = data;
    _rows = rows;
    _cols = cols;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x18a82
callq 0x9420
movq %r12, 0x10(%r15)
movq %r14, (%r15)
movq %rbx, 0x8(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/algebra/MatrixBase.cpp
// Function: abcdl::algebra::Matrix<int>::get_row(abcdl::algebra::Matrix<int>*, unsigned long, unsigned long) const
void Matrix<T>::get_row(Matrix<T>* mat,
                        const size_t row_id,
                        const size_t row_size) const{
    CHECK(row_id + row_size <= _rows);
	T* data = new T[row_size * _cols];
	memcpy(data, &_data[row_id * _cols], sizeof(T) * row_size * _cols);
	mat->set_shallow_data(data, row_size, _cols);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
leaq (%rcx,%rdx), %rax
cmpq (%rdi), %rax
ja 0x18b83
movq 0x8(%r12), %rbx
movq %rbx, %rbp
movq %rcx, 0x8(%rsp)
imulq %rcx, %rbp
movq %rbp, %rax
shrq $0x3e, %rax
shlq $0x2, %rbp
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rbp, %rdi
callq 0x9030
movq %rax, %r13
imulq %rbx, %r15
shlq $0x2, %r15
addq 0x10(%r12), %r15
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x92b0
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x18b61
callq 0x9420
movq %r13, 0x10(%r14)
movq 0x8(%rsp), %rax
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, %rbx
leaq 0x239b3(%rip), %rsi     # 0x3c540
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl $0x5a, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x239b0(%rip), %rsi     # 0x3c55b
movl $0x28, %edx
movq %r13, %rdi
callq 0x93b0
leaq 0x10(%rsp), %rdi
callq 0x38b76
movq %rbx, %rcx
jmp 0x18b09
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x38b76
movq %rbx, %rdi
callq 0x95d0
nop