LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::AverageInSection(unsigned long, unsigned long, unsigned long, unsigned long)
double Matrix::AverageInSection(size_t i_start, size_t i_end, size_t j_start, size_t j_end)
{
    // find element average in section [i_start, i_end), and [j_start, j_end)
    // in this code, we all follow the rule: close front and open end
    // and all counters start from 0
    auto dim = Dimension();
    if((int)i_start < 0 || (int)j_start < 0 || i_end <= i_start || j_end <= j_start || i_end > dim.first || j_end > dim.second){
        std::cout<<"Error: Max in matrix section: exceeded range."<<std::endl;
        exit(0);
    }
    double res =  0;
    for(size_t i=i_start;i<i_end;i++){
        for(size_t j=j_start;j<j_end;j++){
            res += __M[i][j];
        }
    }

    res = res /(int)(i_end-i_start)/(int)(j_end - j_start); 
    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x17a6a
cmpq %r14, %rbx
jbe 0x19dc3
cmpq %r12, %r15
jbe 0x19dc3
movl %r14d, %ecx
orl %r12d, %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
jne 0x19dc3
cmpq %r15, %rax
jb 0x19dc3
cmpq %rbx, %rdx
jb 0x19dc3
movq (%r13), %rax
xorpd %xmm0, %xmm0
movq %r12, %rcx
cmpq %r15, %rcx
jae 0x19da2
imulq $0x18, %rcx, %rdx
addq %rax, %rdx
movq %r14, %rsi
cmpq %rbx, %rsi
jae 0x19d9d
movq (%rdx), %rdi
addsd (%rdi,%rsi,8), %xmm0
incq %rsi
jmp 0x19d8b
incq %rcx
jmp 0x19d7c
subl %r12d, %r15d
cvtsi2sd %r15d, %xmm1
divsd %xmm1, %xmm0
subl %r14d, %ebx
cvtsi2sd %ebx, %xmm1
divsd %xmm1, %xmm0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x1920e(%rip), %rdi     # 0x32fd8
leaq 0xa6c8(%rip), %rsi      # 0x24499
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::AverageInSectionWithPadding(unsigned long, unsigned long, unsigned long, unsigned long)
double Matrix::AverageInSectionWithPadding(size_t i_start, size_t i_end, size_t j_start, size_t j_end)
{
    // find element average in section [i_start, i_end), and [j_start, j_end)
    // in this code, we all follow the rule: close front and open end
    // and all counters start from 0
    auto dim = Dimension();
    bool one_hit = false;

    assert((int)i_start >= 0 && i_end > i_start);
    assert((int)j_start >= 0 && j_end > j_start);

    auto in_range = [&](size_t ii, size_t jj) -> bool
    {
        if((int)ii>=0 && ii<dim.first && (int)jj>=0 && jj<dim.second)
            return true;
        return false;
    };

    size_t x_range = i_end < dim.first ? i_end : dim.first;
    size_t y_range = j_end < dim.second? j_end : dim.second;

    double res =  0;
    for(size_t i=i_start;i<x_range;i++){
        for(size_t j=j_start;j<y_range;j++)
        {
            if(!in_range(i, j)) continue;
            one_hit = true;

            res += __M[i][j];
        }
    }

    if(!one_hit)
    {
        std::cout<<"Error: Average in matrix section with padding: all elements exceeded range."<<std::endl;
        exit(0);
    }


    res = res / (int)(x_range-i_start)/(int)(y_range - j_start); 
    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x17a6a
testl %r12d, %r12d
js 0x19e98
cmpq %r12, %r15
jbe 0x19e98
testl %r14d, %r14d
js 0x19eb7
cmpq %r14, %rbx
jbe 0x19eb7
cmpq %r15, %rax
cmovbq %rax, %r15
cmpq %rbx, %rdx
cmovbq %rdx, %rbx
movq (%r13), %rax
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
movq %r12, %rdx
cmpq %r15, %rdx
jae 0x19e72
imulq $0x18, %rdx, %rsi
addq %rax, %rsi
movq %r14, %rdi
cmpq %rbx, %rdi
jae 0x19e6d
movl %edx, %r8d
orl %edi, %r8d
js 0x19e68
movq (%rsi), %rcx
addsd (%rcx,%rdi,8), %xmm0
movb $0x1, %cl
incq %rdi
jmp 0x19e51
incq %rdx
jmp 0x19e42
testb $0x1, %cl
je 0x19ed6
subl %r12d, %r15d
cvtsi2sd %r15d, %xmm1
divsd %xmm1, %xmm0
subl %r14d, %ebx
cvtsi2sd %ebx, %xmm1
divsd %xmm1, %xmm0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xa697(%rip), %rdi      # 0x24536
leaq 0xa0f5(%rip), %rsi      # 0x23f9b
leaq 0xa7cf(%rip), %rcx      # 0x2467c
movl $0x4d7, %edx            # imm = 0x4D7
callq 0x4180
leaq 0xa69d(%rip), %rdi      # 0x2455b
leaq 0xa0d6(%rip), %rsi      # 0x23f9b
leaq 0xa7b0(%rip), %rcx      # 0x2467c
movl $0x4d8, %edx            # imm = 0x4D8
callq 0x4180
movq 0x190fb(%rip), %rdi     # 0x32fd8
leaq 0xa7e3(%rip), %rsi      # 0x246c7
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::Rot_180()
Matrix Matrix::Rot_180()
{
    // rotate matrix by 180 degree
    auto dim = this->Dimension();
    Matrix _m(dim);

    for(size_t i=0;i<dim.first;i++){
        for(size_t j=0;j<dim.second;j++){
            _m[i][j] = (*this)[dim.first - i -1][dim.second - j-1];
        }
    }

    return _m;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x17a6a
movq %rax, %r15
movq %rdx, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1776a
xorl %eax, %eax
imulq $0x18, %r15, %rcx
cmpq %r15, %rax
je 0x19f6c
movq %rax, %rdx
notq %rdx
movq (%r14), %rsi
addq %rcx, %rsi
imulq $0x18, %rdx, %rdx
addq %rsi, %rdx
imulq $0x18, %rax, %rsi
addq (%rbx), %rsi
xorl %edi, %edi
movq %r12, %r8
subq $0x1, %r8
jb 0x19f67
movq (%rdx), %r9
movsd (%r9,%r8,8), %xmm0
movq (%rsi), %r9
movsd %xmm0, (%r9,%rdi)
addq $0x8, %rdi
jmp 0x19f49
incq %rax
jmp 0x19f25
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::GetCorrelationValue(Matrix&, Matrix&, unsigned long, unsigned long)
double Matrix::GetCorrelationValue(Matrix &A, Matrix &B, size_t i, size_t j)
{
    // get the element (i, j) of the correlated matrix, A is input matrix, B is kernel
    // keep in mind this one does not care about matrix dimension, it will fill with 0 value
    // for non-exist matrix elements
    if( (int)i<0 || (int)j<0) {
        std::cout<<"Error: wrong index in get correlation value."<<std::endl;
        exit(0);
    }

    auto dimA = A.Dimension();
    auto dimB = B.Dimension();

    double res = 0;
    for(size_t p = 0; p<dimB.first;p++)
    {
        for(size_t q=0; q<dimB.second;q++){
            int index_i_A = (int)i + (int)p;
            int index_j_A = (int)j + (int)q;

            if(index_i_A < 0 || index_i_A >= (int)dimA.first || index_j_A < 0 || index_j_A >= (int)dimA.second) {
                res += 0.; // 0*B[p][q];
            } else {
                res += A[index_i_A][index_j_A] * B[p][q];
            }
        }
    }
    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %ebx, %eax
movq %rdx, 0x10(%rsp)
orl %edx, %eax
js 0x1a34f
movq %rsi, %r13
movq %rdi, %rbp
callq 0x17a6a
movq %rax, %r15
movq %rdx, %r12
movq %r13, %rdi
callq 0x17a6a
movq (%rbp), %rcx
movq %rcx, 0x8(%rsp)
movq (%r13), %rsi
xorpd %xmm1, %xmm1
xorl %edi, %edi
xorpd %xmm0, %xmm0
cmpq %rax, %rdi
je 0x1a340
movq 0x10(%rsp), %rcx
leal (%rdi,%rcx), %r8d
imulq $0x18, %r8, %r9
addq 0x8(%rsp), %r9
imulq $0x18, %rdi, %r10
addq %rsi, %r10
xorl %r11d, %r11d
cmpq %r11, %rdx
je 0x1a33b
testl %r8d, %r8d
js 0x1a332
leaq (%rbx,%r11), %r13
cmpl %r15d, %r8d
setl %bpl
testl %r13d, %r13d
setns %r14b
cmpl %r12d, %r13d
setl %cl
andb %bpl, %cl
testb %r14b, %cl
je 0x1a332
movl %r13d, %ecx
movq (%r9), %r14
movsd (%r14,%rcx,8), %xmm2
movq (%r10), %rcx
mulsd (%rcx,%r11,8), %xmm2
addsd %xmm2, %xmm0
jmp 0x1a336
addsd %xmm1, %xmm0
incq %r11
jmp 0x1a2ed
incq %rdi
jmp 0x1a2cc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18c82(%rip), %rdi     # 0x32fd8
leaq 0xa3e5(%rip), %rsi      # 0x24742
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::DeleteRow(unsigned long)
void Matrix::DeleteRow(size_t i)
{
    // delete a row
    auto dim = Dimension();
    if(i>= dim.first || (int)i<0) {
        std::cout<<"Warning: deleting matrix row, index out of range."<<std::endl;
        return;
    }

    __M.erase(__M.begin() + i);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x17a6a
testl %r14d, %r14d
js 0x1a643
cmpq %r14, %rax
jbe 0x1a643
imulq $0x18, %r14, %rsi
addq (%rbx), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1a932
movq 0x1898e(%rip), %rdi     # 0x32fd8
leaq 0xa14b(%rip), %rsi      # 0x2479c
callq 0x4240
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4130
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::DeleteCollum(unsigned long)
void Matrix::DeleteCollum(size_t i)
{
    // delete a collum
    auto dim = Dimension();
    if((int)i<0 || i>= dim.second){
        std::cout<<"Warning: deleting matrix collum, index out of range."<<std::endl;
        return;
    }
    for(size_t j=0;j<dim.first;j++){
        __M[j].erase(__M[j].begin()+i);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x17a6a
movq %rax, %r15
testl %ebx, %ebx
setns %al
cmpq %rbx, %rdx
seta %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1a6b3
xorl %r12d, %r12d
shlq $0x3, %rbx
subq $0x1, %r15
jb 0x1a6d9
movq (%r14), %rdi
movq (%rdi,%r12), %rsi
addq %rbx, %rsi
addq %r12, %rdi
callq 0x1a938
addq $0x18, %r12
jmp 0x1a695
movq 0x1891e(%rip), %rdi     # 0x32fd8
leaq 0xa10d(%rip), %rsi      # 0x247ce
callq 0x4240
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4130
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::InsertRow(unsigned long, std::vector<double, std::allocator<double>>*)
void Matrix::InsertRow(size_t i, std::vector<double>* vec)
{
    // insert vec to matrix at position i
    auto dim = Dimension();
    if(vec!=nullptr && vec->size() != dim.second){
        std::cout<<"Error: inserting row to matrix, dimension not match."<<std::endl;
        exit(0);
    }
    if((int)i<0 || i>dim.first){
        std::cout<<"Error: insert row to matrix, wrong position."<<std::endl;
        exit(0);
    }
    if(vec == nullptr){
        std::vector<double> v(dim.second, 0);
        __M.insert(__M.begin()+i, v);
    } else {
        __M.insert(__M.begin()+i, (*vec));
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x17a6a
testq %r15, %r15
je 0x1a716
movq 0x8(%r15), %rcx
subq (%r15), %rcx
sarq $0x3, %rcx
cmpq %rdx, %rcx
jne 0x1a797
testl %r14d, %r14d
js 0x1a787
cmpq %r14, %rax
jb 0x1a787
testq %r15, %r15
je 0x1a740
imulq $0x18, %r14, %rsi
addq (%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1a972
leaq 0x10(%rsp), %rax
andq $0x0, (%rax)
leaq 0x18(%rsp), %r15
leaq 0xf(%rsp), %rcx
movq %r15, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x1a8cc
imulq $0x18, %r14, %rsi
addq (%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1a972
leaq 0x18(%rsp), %rdi
callq 0x127dc
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x1884a(%rip), %rdi     # 0x32fd8
leaq 0xa0a3(%rip), %rsi      # 0x24838
jmp 0x1a7a5
movq 0x1883a(%rip), %rdi     # 0x32fd8
leaq 0xa05e(%rip), %rsi      # 0x24803
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x127dc
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::InsertCollum(unsigned long, std::vector<double, std::allocator<double>>*)
void Matrix::InsertCollum(size_t i, std::vector<double>* vec)
{
    // insert vec to matrix at position i
    auto dim=Dimension();
    if(vec!=nullptr && vec->size() != dim.first){
        std::cout<<"Error: inserting col to matrix, dimension not match."<<std::endl;
        exit(0);
    }
    if((int)i<0 || i>dim.second){
        std::cout<<"Error: insert col to matrix, wrong position."<<std::endl;
        exit(0);
    }
    for(size_t ii=0;ii<dim.first;ii++){
        if(vec == nullptr){
            __M[ii].insert(__M[ii].begin() + i, 0);
        } else {
            __M[ii].insert(__M[ii].begin() + i, (*vec)[ii]);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x17a6a
movq %rax, %r12
testq %rbx, %rbx
je 0x1a7ff
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
cmpq %r12, %rax
jne 0x1a86d
testl %r14d, %r14d
js 0x1a85d
cmpq %r14, %rdx
jb 0x1a85d
xorl %ebp, %ebp
shlq $0x3, %r14
xorl %r13d, %r13d
subq $0x1, %r12
jb 0x1a84e
movq (%r15), %rdi
movq (%rdi,%rbp), %rsi
addq %r14, %rsi
addq %rbp, %rdi
testq %rbx, %rbx
je 0x1a837
movq (%rbx), %rdx
addq %r13, %rdx
callq 0x1aa0a
jmp 0x1a844
andq $0x0, (%rsp)
movq %rsp, %rdx
callq 0x1b0bc
addq $0x8, %r13
addq $0x18, %rbp
jmp 0x1a812
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18774(%rip), %rdi     # 0x32fd8
leaq 0xa02f(%rip), %rsi      # 0x2489a
jmp 0x1a87b
movq 0x18764(%rip), %rdi     # 0x32fd8
leaq 0x9fea(%rip), %rsi      # 0x24865
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Network.cpp
// Function: Network::Train()
void Network::Train()
{
    // construct layers
    TrainingType training_type = TrainingType::NewTraining;
    ConstructLayers(training_type);

    __numberOfEpoch = 50; // test QQQQQQQQQQQQQQQQQQQQQQQQQQQQ
    for(int i=0;i<__numberOfEpoch;i++)
    {
        std::cout<<"[------]Number of epoch: "<<i<<"/"<<__numberOfEpoch<<endl;
        UpdateEpoch();
    }

    // check accuracy track of training
    cout<<"accuracy: "<<endl;
    std::vector<double> & accuracy = __outputLayer->GetAccuracyForBatches();
    for(auto &i: accuracy)
        cout<<i<<",   "<<endl;

    // check cost track of training
    cout<<"cost: "<<endl;
    std::vector<double> &cost = __outputLayer->GetCostForBatches();
    for(auto &i: cost)
        cout<<i<<", "<<endl;

    // after finished training, save all trained weights and bias
    __inputLayer->SaveTrainedWeightsAndBias();
    for(auto &i: __middleAndOutputLayers)
        i->SaveTrainedWeightsAndBias();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1b17e
movl $0x32, 0x30(%rbx)
xorl %ebp, %ebp
pushq $0x32
popq %rax
movq 0x17a8a(%rip), %r14     # 0x32fd8
leaq 0x9492(%rip), %r15      # 0x249e7
leaq 0x94a5(%rip), %r12      # 0x24a01
cmpl %eax, %ebp
jge 0x1b5a2
movq %r14, %rdi
movq %r15, %rsi
callq 0x4240
movq %rax, %rdi
movl %ebp, %esi
callq 0x43a0
movq %rax, %rdi
movq %r12, %rsi
callq 0x4240
movl 0x30(%rbx), %esi
movq %rax, %rdi
callq 0x43a0
movq %rax, %rdi
callq 0x4130
movq %rbx, %rdi
callq 0x1b6a6
incl %ebp
movl 0x30(%rbx), %eax
jmp 0x1b55c
movq 0x17a2f(%rip), %r14     # 0x32fd8
leaq 0x9453(%rip), %rsi      # 0x24a03
movq %r14, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x20(%rbx), %rdi
movq (%rdi), %rax
callq *0x2d8(%rax)
movq (%rax), %r12
movq 0x8(%rax), %r13
leaq 0x9433(%rip), %r15      # 0x24a0e
cmpq %r13, %r12
je 0x1b607
movsd (%r12), %xmm0
movq %r14, %rdi
callq 0x4320
movq %rax, %rdi
movq %r15, %rsi
callq 0x4240
movq %rax, %rdi
callq 0x4130
addq $0x8, %r12
jmp 0x1b5db
movq 0x179ca(%rip), %r14     # 0x32fd8
leaq 0x9458(%rip), %rsi      # 0x24a6d
movq %r14, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x20(%rbx), %rdi
movq (%rdi), %rax
callq *0x2e0(%rax)
movq (%rax), %r12
movq 0x8(%rax), %r13
leaq 0x98c2(%rip), %r15      # 0x24f02
cmpq %r13, %r12
je 0x1b66c
movsd (%r12), %xmm0
movq %r14, %rdi
callq 0x4320
movq %rax, %rdi
movq %r15, %rsi
callq 0x4240
movq %rax, %rdi
callq 0x4130
addq $0x8, %r12
jmp 0x1b640
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x120(%rax)
movq (%rbx), %r14
movq 0x8(%rbx), %rbx
cmpq %rbx, %r14
je 0x1b697
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x120(%rax)
addq $0x8, %r14
jmp 0x1b680
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Network.cpp
// Function: Network::UpdateEpoch()
void Network::UpdateEpoch()
{
    int numberofBatches = __dataInterface -> GetNumberOfBatches();
    cout<<"......Info: "<<numberofBatches<<" batches in this epoch"<<endl;
    numberofBatches = 1; // test QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQqq

    __dataInterface->Reset();
    __dataInterface->Shuffle();

    // initializations for epoch
    for(auto &i: __middleAndOutputLayers)
    {
        i->EpochInit();
    }

    for(int i=0;i<numberofBatches;i++)
    {
        cout<<"......... training for batch: "<<i<<"/"<<numberofBatches<<endl;
        UpdateBatch();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x16b48
movl %eax, %ebp
movq 0x17916(%rip), %rdi     # 0x32fd8
leaq 0x934a(%rip), %rsi      # 0x24a13
callq 0x4240
movq %rax, %rdi
movl %ebp, %esi
callq 0x43a0
leaq 0x9341(%rip), %rsi      # 0x24a20
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x28(%rbx), %rdi
callq 0x17004
movq 0x28(%rbx), %rdi
callq 0x1700a
movq (%rbx), %r14
movq 0x8(%rbx), %r15
cmpq %r15, %r14
je 0x1b71c
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
addq $0x8, %r14
jmp 0x1b708
movq 0x178b5(%rip), %rdi     # 0x32fd8
leaq 0x930d(%rip), %rsi      # 0x24a37
callq 0x4240
movq %rax, %rdi
xorl %esi, %esi
callq 0x43a0
leaq 0x92c1(%rip), %rsi      # 0x24a01
movq %rax, %rdi
callq 0x4240
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x43a0
movq %rax, %rdi
callq 0x4130
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1b76e
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Network.cpp
// Function: Network::UpdateBatch()
void Network::UpdateBatch()
{
    // initializations for batch
    for(auto &i: __middleAndOutputLayers)
        i->BatchInit();

    auto t1 = std::chrono::high_resolution_clock::now();
    ForwardPropagateForBatch();
    //auto t2 = std::chrono::high_resolution_clock::now();
    //auto dt1 = std::chrono::duration_cast<std::chrono::milliseconds>(t2-t1);
    //std::cout<<"forward propagation cost: "<<dt1.count()<<" milliseconds"<<endl;

    BackwardPropagateForBatch();
    //auto t3 = std::chrono::high_resolution_clock::now();
    //auto dt2 = std::chrono::duration_cast<std::chrono::milliseconds>(t3-t2);
    //std::cout<<"backward propagation cost: "<<dt2.count()<<" milliseconds"<<endl;

    UpdateWeightsAndBiasForBatch();
    auto t4 = std::chrono::high_resolution_clock::now();
    auto dt3 = std::chrono::duration_cast<std::chrono::milliseconds>(t4-t1);
    std::cout<<"        batch training cost: "<<dt3.count()<<" milliseconds"<<endl;

    // save training accuracy for batch
    __outputLayer -> SaveAccuracyAndCostForBatch();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%rdi), %r15
cmpq %r15, %r14
je 0x1b794
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x88(%rax)
addq $0x8, %r14
jmp 0x1b77d
callq 0x4040
movq %rax, %r14
movq %rbx, %rdi
callq 0x1b810
movq %rbx, %rdi
callq 0x1b85a
movq %rbx, %rdi
callq 0x1b890
callq 0x4040
subq %r14, %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
movq %rax, %r14
movq 0x17808(%rip), %rdi     # 0x32fd8
leaq 0x927f(%rip), %rsi      # 0x24a56
callq 0x4240
movq %rax, %rdi
movq %r14, %rsi
callq 0x4230
leaq 0x9286(%rip), %rsi      # 0x24a74
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x20(%rbx), %rdi
movq (%rdi), %rax
popq %rbx
popq %r14
popq %r15
jmpq *0x2d0(%rax)
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Network.cpp
// Function: Network::ForwardPropagateForBatch()
void Network::ForwardPropagateForBatch()
{
    // prepare new batch data and label in Datainterface class
    __dataInterface->GetNewBatchData();
    __dataInterface->GetNewBatchLabel();

    // fill data to input layer
    __inputLayer->FillBatchDataToInputLayerA();

    // forward propagation
    for(auto &i: __middleAndOutputLayers)
    {
        i->ForwardPropagateForBatch();
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x16b9a
movq 0x28(%rbx), %rdi
callq 0x16e5e
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x180(%rax)
movq (%rbx), %r14
movq 0x8(%rbx), %rbx
cmpq %rbx, %r14
je 0x1b851
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
addq $0x8, %r14
jmp 0x1b83d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Network.cpp
// Function: Network::BackwardPropagateForBatch()
void Network::BackwardPropagateForBatch() 
{
    // backward
    int NLayers = __middleAndOutputLayers.size();

    for(int nlayer=NLayers-1; nlayer>=0; nlayer--)
        __middleAndOutputLayers[nlayer]->BackwardPropagateForBatch();

    /// no need for input layer
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
subq (%rdi), %rax
shrq $0x3, %rax
movl %eax, %r14d
testl %r14d, %r14d
jle 0x1b887
movq (%rbx), %rax
movq -0x8(%rax,%r14,8), %rdi
decq %r14
movq (%rdi), %rax
callq *0x48(%rax)
jmp 0x1b86f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Network.cpp
// Function: Network::Classify()
std::vector<Matrix> Network::Classify()
{
    std::vector<Matrix> res;
    ConstructLayers(TrainingType::ResumeTraining);

    __numberOfEpoch = 1; // test QQQQQQQQQQQQQQQQQQQQQQQQQQQQ
    for(int i=0;i<__numberOfEpoch;i++)
    {
        std::cout<<"[------]Number of epoch: "<<i<<"/"<<__numberOfEpoch<<endl;
        UpdateEpoch();
    }

    // check accuracy 
    cout<<"accuracy: "<<endl;
    std::vector<double> & accuracy = __outputLayer->GetAccuracyForBatches();
    for(auto &i: accuracy)
        cout<<i<<",   "<<endl;

    // check cost 
    cout<<"cost: "<<endl;
    std::vector<double> &cost = __outputLayer->GetCostForBatches();
    for(auto &i: cost)
        cout<<i<<", "<<endl;

    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x1b17e
movl $0x1, 0x30(%r14)
xorl %ebp, %ebp
pushq $0x1
popq %rax
movq 0x176e8(%rip), %r15     # 0x32fd8
leaq 0x90f0(%rip), %r12      # 0x249e7
leaq 0x9103(%rip), %r13      # 0x24a01
cmpl %eax, %ebp
jge 0x1b946
movq %r15, %rdi
movq %r12, %rsi
callq 0x4240
movq %rax, %rdi
movl %ebp, %esi
callq 0x43a0
movq %rax, %rdi
movq %r13, %rsi
callq 0x4240
movl 0x30(%r14), %esi
movq %rax, %rdi
callq 0x43a0
movq %rax, %rdi
callq 0x4130
movq %r14, %rdi
callq 0x1b6a6
incl %ebp
movl 0x30(%r14), %eax
jmp 0x1b8fe
movq 0x1768b(%rip), %rdi     # 0x32fd8
leaq 0x90af(%rip), %rsi      # 0x24a03
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x20(%r14), %rdi
movq (%rdi), %rax
callq *0x2d8(%rax)
movq (%rax), %r13
movq 0x8(%rax), %rbp
movq 0x1765c(%rip), %r15     # 0x32fd8
leaq 0x908b(%rip), %r12      # 0x24a0e
cmpq %rbp, %r13
je 0x1b9af
movsd (%r13), %xmm0
movq %r15, %rdi
callq 0x4320
movq %rax, %rdi
movq %r12, %rsi
callq 0x4240
movq %rax, %rdi
callq 0x4130
addq $0x8, %r13
jmp 0x1b983
movq 0x17622(%rip), %rdi     # 0x32fd8
leaq 0x90b0(%rip), %rsi      # 0x24a6d
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x20(%r14), %rdi
movq (%rdi), %rax
callq *0x2e0(%rax)
movq (%rax), %r12
movq 0x8(%rax), %r13
movq 0x175f3(%rip), %r14     # 0x32fd8
leaq 0x9516(%rip), %r15      # 0x24f02
cmpq %r13, %r12
je 0x1ba18
movsd (%r12), %xmm0
movq %r14, %rdi
callq 0x4320
movq %rax, %rdi
movq %r15, %rsi
callq 0x4240
movq %rax, %rdi
callq 0x4130
addq $0x8, %r12
jmp 0x1b9ec
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1ba34
jmp 0x1ba34
jmp 0x1ba34
jmp 0x1ba34
jmp 0x1ba34
movq %rax, %r14
movq %rbx, %rdi
callq 0x110e4
movq %r14, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Neuron.cpp
// Function: Neuron::UpdateZ(int)
void Neuron::UpdateZ(int sample_index)
{
    // update z for current layer
    if(__layer->GetType() == LayerType::fullyConnected || __layer->GetType() == LayerType::output)
    {
        //std::cout<<__func__<<" fully connected layer update z"<<std::endl;
        UpdateZFC(sample_index);
    } 
    else if(__layer->GetType() == LayerType::cnn)
    {
        //std::cout<<__func__<<" cnn layer update z"<<std::endl;
        UpdateZCNN(sample_index);
    } 
    else if(__layer->GetType() == LayerType::pooling)
    {
        //std::cout<<__func__<<" pooling layer update z"<<std::endl;
        UpdateZPooling(sample_index);
    } 
    else 
    {
        std::cout<<"Error: unsupported layer type."<<std::endl;
        exit(0);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x78(%rdi), %rdi
movq (%rdi), %rax
callq *0x250(%rax)
testl %eax, %eax
je 0x1bc90
movq 0x78(%r14), %rdi
movq (%rdi), %rax
callq *0x250(%rax)
cmpl $0x4, %eax
jne 0x1bca1
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1c322
movq 0x78(%r14), %rdi
movq (%rdi), %rax
callq *0x250(%rax)
cmpl $0x1, %eax
jne 0x1bcc4
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1c4dc
movq 0x78(%r14), %rdi
movq (%rdi), %rax
callq *0x250(%rax)
cmpl $0x2, %eax
jne 0x1bce7
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1c67c
movq 0x172ea(%rip), %rdi     # 0x32fd8
leaq 0x8e9a(%rip), %rsi      # 0x24b8f
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Neuron.cpp
// Function: Neuron::UpdateA(int)
void Neuron::UpdateA(int sample_index)
{
    // update a for current training sample
    double v = __z[sample_index];
    //cout<<"debug: sample_id: "<<sample_index<<": z = "<<v<<endl;
    double a = -100.; // theorectially, a>=-1
    if(__funcType == ActuationFuncType::Sigmoid)
    {
        a = __sigmoid(v);
        //cout<<"sigmoid"<<endl;
    }
    else if(__funcType == ActuationFuncType::SoftMax)
    {
        auto & images  = __layer->GetImagesActiveZ();
        assert(images[sample_index].OutputImageFromKernel.size() == 1); // make sure it is 1D layer
        Matrix & m_z = images[sample_index].OutputImageFromKernel[0];

        a = __softmax(m_z);
    }
    else if(__funcType == ActuationFuncType::Tanh)
    {
        a = __tanh(v);
        //cout<<"tanh"<<endl;
    }
    else if(__funcType == ActuationFuncType::Relu)
    {
        a = __relu(v);
        //cout<<"relu"<<endl;
    }
    else
        std::cout<<"Error: unsupported actuation function type."<<std::endl;

    if(a < -1) 
    {
        std::cout<<"Error: Neuron::UpdateA(int sample_index), a<-1? something wrong."
            <<endl;
        exit(0);
    }
    //cout<<"debug: sample_id: "<<sample_index<<": a = "<<a<<endl;
    //getchar();
    //__a.push_back(a);
    __a[sample_index] = a;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x84(%rdi), %eax
cmpq $0x3, %rax
ja 0x1bdaa
movq %rdi, %rbx
movslq %esi, %r14
movq 0x48(%rdi), %rcx
movsd (%rcx,%r14,8), %xmm0
leaq 0x8d63(%rip), %rcx      # 0x24a98
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x1c0ec
jmp 0x1bd86
callq 0x1c210
jmp 0x1bd86
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1bd86
jmp 0x1bd98
movq 0x78(%rbx), %rdi
movq (%rdi), %rax
callq *0xd8(%rax)
movq (%rax), %rax
imulq $0x18, %r14, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rax
subq %rsi, %rax
cmpq $0x18, %rax
jne 0x1bde7
movq %rbx, %rdi
callq 0x1c110
movsd 0x57aa(%rip), %xmm1     # 0x21538
ucomisd %xmm0, %xmm1
movapd %xmm0, %xmm1
ja 0x1bdc5
movq 0x18(%rbx), %rax
movsd %xmm1, (%rax,%r14,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x17227(%rip), %rdi     # 0x32fd8
leaq 0x8fb8(%rip), %rsi      # 0x24d70
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x1720c(%rip), %rdi     # 0x32fd8
leaq 0x8fc9(%rip), %rsi      # 0x24d9c
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
leaq 0x8f31(%rip), %rdi      # 0x24d1f
leaq 0x8d11(%rip), %rsi      # 0x24b06
leaq 0x8f5a(%rip), %rcx      # 0x24d56
movl $0x167, %edx            # imm = 0x167
callq 0x4180
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Neuron.cpp
// Function: Neuron::UpdateDelta(int)
void Neuron::UpdateDelta(int sample_index)
{
    // update delta for current layer
    if(__layer->GetType() == LayerType::output)
    {
        UpdateDeltaOutputLayer(sample_index);
    } 
    else if(__layer->GetType() == LayerType::fullyConnected)
    {
        UpdateDeltaFC(sample_index);
    } 
    else if(__layer->GetType() == LayerType::cnn)
    {
        UpdateDeltaCNN(sample_index);
    } 
    else if(__layer->GetType() == LayerType::pooling)
    {
        UpdateDeltaPooling(sample_index);
    } 
    else 
    {
        std::cout<<"Error: unsupported layer type."<<std::endl;
        exit(0);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x78(%rdi), %rdi
movq (%rdi), %rax
callq *0x250(%rax)
cmpl $0x4, %eax
jne 0x1c062
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1c7a8
movq 0x78(%r14), %rdi
movq (%rdi), %rax
callq *0x250(%rax)
testl %eax, %eax
je 0x1c096
movq 0x78(%r14), %rdi
movq (%rdi), %rax
callq *0x250(%rax)
cmpl $0x1, %eax
jne 0x1c0a7
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1cb34
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1c978
movq 0x78(%r14), %rdi
movq (%rdi), %rax
callq *0x250(%rax)
cmpl $0x2, %eax
jne 0x1c0ca
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1d12e
movq 0x16f07(%rip), %rdi     # 0x32fd8
leaq 0x8ab7(%rip), %rsi      # 0x24b8f
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Neuron.cpp
// Function: Neuron::__softmax(Matrix&)
double Neuron::__softmax(Matrix &m_z)
{
    if(__layer->GetType() != LayerType::output)
    {
        // soft max is usually used in output layer, it is rare in hidden layer
        // print a warning if the neuron detected layertype not = output
        std::cout<<__func__<<" Warning: using softmax in hidden layers? please make sure."
            <<std::endl;
    }
    auto dim = m_z.Dimension();
    assert(dim.second == 1);

    size_t i = __coord.i;
    assert(dim.first > i);

    double sum = 0;
    for(size_t k = 0;k<dim.first;k++)
    {
        sum += exp((double)m_z[k][0]);
    }

    return exp(m_z[i][0])/sum;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq 0x78(%rdi), %rdi
movq (%rdi), %rax
callq *0x250(%rax)
cmpl $0x4, %eax
je 0x1c15a
movq 0x16ea1(%rip), %rdi     # 0x32fd8
leaq 0x8982(%rip), %rsi      # 0x24ac0
callq 0x4240
leaq 0x8980(%rip), %rsi      # 0x24aca
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq %rbx, %rdi
callq 0x17a6a
cmpq $0x1, %rdx
jne 0x1c1da
movq %rax, %r14
movq 0x88(%r15), %r15
cmpq %r15, %rax
jbe 0x1c1f3
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x1c1b2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x17c46
movq (%rax), %rax
movsd (%rax), %xmm0
callq 0x43c0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
incq %r12
jmp 0x1c183
movq %rbx, %rdi
movq %r15, %rsi
callq 0x17c46
movq (%rax), %rax
movsd (%rax), %xmm0
callq 0x43c0
divsd (%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5e2a(%rip), %rdi      # 0x2200b
leaq 0x891e(%rip), %rsi      # 0x24b06
leaq 0x8926(%rip), %rcx      # 0x24b15
pushq $0x45
jmp 0x1c20a
leaq 0x893e(%rip), %rdi      # 0x24b38
leaq 0x8905(%rip), %rsi      # 0x24b06
leaq 0x890d(%rip), %rcx      # 0x24b15
pushq $0x48
popq %rdx
callq 0x4180
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Neuron.cpp
// Function: Neuron::Reset()
void Neuron::Reset()
{
    if(__layer == nullptr)
    {
        std::cout<<"Error: Neuron::Reset(): the layer info has not been set for this neuron."
            <<endl;
        exit(0);
    }
    int batch_size = __layer->GetBatchSize();
    // after updateing weights and biase, 
    // namely after one training (one sample or one batch depends on user)
    // reset neurons for next computation
    __a.clear();
    __a.resize(batch_size); // reset a
    __delta.clear();
    __delta.resize(batch_size); // reset delta
    __z.clear();
    __z.resize(batch_size); // reset z
    __sigmaPrime.clear();
    __sigmaPrime.resize(batch_size);

    //__wGradient.clear(); // reset weight gradient
    //__bGradient.clear(); // reset bias gradient
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x78(%rdi), %rdi
testq %rdi, %rdi
je 0x1c2e9
movq (%rdi), %rax
callq *0x2a0(%rax)
leaq 0x18(%rbx), %rdi
movq 0x18(%rbx), %rcx
cmpq %rcx, 0x20(%rbx)
je 0x1c289
movq %rcx, 0x20(%rbx)
movslq %eax, %r14
movq %r14, %rsi
callq 0x111c4
leaq 0x30(%rbx), %rdi
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x1c2a6
movq %rax, 0x38(%rbx)
movq %r14, %rsi
callq 0x111c4
leaq 0x48(%rbx), %rdi
movq 0x48(%rbx), %rax
cmpq %rax, 0x50(%rbx)
je 0x1c2c0
movq %rax, 0x50(%rbx)
movq %r14, %rsi
callq 0x111c4
leaq 0x60(%rbx), %rdi
movq 0x60(%rbx), %rax
cmpq %rax, 0x68(%rbx)
je 0x1c2da
movq %rax, 0x68(%rbx)
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x111c4
movq 0x16ce8(%rip), %rdi     # 0x32fd8
leaq 0x884f(%rip), %rsi      # 0x24b46
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Neuron.cpp
// Function: Neuron::ClearPreviousBatch()
void Neuron::ClearPreviousBatch()
{
    __a.clear();           // necessary, since resize won't overwrite old contents
    __delta.clear();       // 
    __z.clear();           // 
    __sigmaPrime.clear();  // 

    if(__layer == nullptr)
    {
        std::cout<<"Error: Neuron::ClearPreviousBatch(): the layer info has not been set for this neuron."
            <<endl;
        exit(0);
    }
    int batch_size = __layer->GetBatchSize();
    __a.resize(batch_size); // reset a
    __delta.resize(batch_size); // reset delta
    __z.resize(batch_size); // reset z
    __sigmaPrime.resize(batch_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
cmpq %rax, 0x20(%rdi)
je 0x1d600
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x1d60e
movq %rax, 0x38(%rbx)
movq 0x48(%rbx), %rax
cmpq %rax, 0x50(%rbx)
je 0x1d61c
movq %rax, 0x50(%rbx)
movq 0x60(%rbx), %rax
cmpq %rax, 0x68(%rbx)
je 0x1d62a
movq %rax, 0x68(%rbx)
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x1d684
leaq 0x18(%rbx), %r14
leaq 0x30(%rbx), %r15
leaq 0x48(%rbx), %r12
addq $0x60, %rbx
movq (%rdi), %rax
callq *0x2a0(%rax)
movslq %eax, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x111c4
movq %r15, %rdi
movq %r13, %rsi
callq 0x111c4
movq %r12, %rdi
movq %r13, %rsi
callq 0x111c4
movq %rbx, %rdi
movq %r13, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x111c4
movq 0x1594d(%rip), %rdi     # 0x32fd8
leaq 0x7da5(%rip), %rsi      # 0x25437
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Neuron.cpp
// Function: Neuron::Print()
void Neuron::Print()
{
    std::cout<<"--------------------------------------"<<std::endl;
    std::cout<<"neuron id: "<<__neuron_id<<std::endl;
    std::cout<<"active status: "<<__active_status<<std::endl;
    if(!__active_status) return;
    std::cout<<"w matrix: "<<std::endl;
    std::cout<<(*__w);
    std::cout<<"bias: "<<std::endl;
    std::cout<<(*__b);
    std::cout<<"Neruon Coord: "<<endl;
    std::cout<<__coord<<endl;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x15924(%rip), %r14     # 0x32fd8
leaq 0x7dd2(%rip), %rsi      # 0x2548d
movq %r14, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
leaq 0x7de2(%rip), %rsi      # 0x254b4
movq %r14, %rdi
callq 0x4240
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x4230
movq %rax, %rdi
callq 0x4130
leaq 0x7dcc(%rip), %rsi      # 0x254c0
movq %r14, %rdi
callq 0x4240
movzbl 0x80(%rbx), %esi
movq %rax, %rdi
callq 0x4350
movq %rax, %rdi
callq 0x4130
cmpb $0x1, 0x80(%rbx)
jne 0x1d7a5
movq 0x158b1(%rip), %r14     # 0x32fd8
leaq 0x7da2(%rip), %rsi      # 0x254d0
movq %r14, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x18551
leaq 0x7d8a(%rip), %rsi      # 0x254db
movq %r14, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x18551
leaq 0x7d6e(%rip), %rsi      # 0x254e2
movq %r14, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
addq $0x88, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1740e
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4130
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/UnitTest.cpp
// Function: UnitTest::TestFilter2D()
void UnitTest::TestFilter2D()
{
    /*
    Filter2D F(4, 4);
    cout<<F<<endl;

    Filter2D f = F;
    cout<<f<<endl;

    // test default assign
    vector<vector<bool>> b(4, vector<bool>(4, true));
    vector<vector<bool>> c;
    c = b;

    for(auto i: c)
    {
        for(auto j: i)
            cout<<j<<", ";
        cout<<endl;
    }

    // test default assignment
    vector<Filter2D> VF;
    VF.resize(4, Filter2D(3, 3));
    vector<Filter2D> VFC;
    VFC = VF;

    for(auto &i: VFC)
        cout<<i<<endl;


    Filter2D notF = F.Opposite();
    cout<<"-------------------"<<endl;
    cout<<F<<endl;
    cout<<notF<<endl;
    */
    cout<<"++++++++++++++++++++++++++++++++++"<<endl;
    //Filter2D FF(100, 100, true);
    //vector<Filter2D> complete_set = FF.GenerateCompleteDropOutSet(3, 0.4);
    //for(auto &i: complete_set) cout<<i<<endl;

    Filter2D FF(10, 1, true);
    vector<Filter2D> complete_set = FF.GenerateCompleteDropOutSet(20, 0.5);
    for(auto &i: complete_set) 
        cout<<i<<endl;


    //Filter2D FF(500, 500, true);
    //vector<Filter2D> complete_set = FF.GenerateCompleteDropOutSet(4, 0.33333);
    //for(auto &i: complete_set)  cout<<i<<endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq 0x1560c(%rip), %rdi     # 0x32fd8
leaq 0x7b2d(%rip), %rsi      # 0x25500
callq 0x4240
movq %rax, %rdi
callq 0x4130
leaq 0x18(%rsp), %rbx
pushq $0xa
popq %rsi
pushq $0x1
popq %rdx
pushq $0x1
popq %rcx
movq %rbx, %rdi
callq 0x12a86
movq %rsp, %rdi
pushq $0x14
popq %rdx
movsd 0x7af4(%rip), %xmm0     # 0x254f8
movq %rbx, %rsi
callq 0x11488
movq (%rsp), %rbx
movq 0x8(%rsp), %r15
movq 0x155bc(%rip), %r14     # 0x32fd8
cmpq %r15, %rbx
je 0x1da3a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1735e
movq %rax, %rdi
callq 0x4130
addq $0x18, %rbx
jmp 0x1da1c
movq %rsp, %rdi
callq 0x1114a
leaq 0x18(%rsp), %rdi
callq 0x11e36
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x1da66
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1114a
leaq 0x18(%rsp), %rdi
callq 0x11e36
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/main.cpp
// Function: main
int main(int argc, char* argv[])
{
    feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
    Network *net_work = new Network();
    net_work->Init();

    net_work->Train();
    //net_work->Classify();

    // test
    //UnitTest *test = new UnitTest();
    //test->Test();

    cout<<"MAIN TEST SUCCESS!!!"<<endl;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $0xd
popq %rdi
callq 0x40e0
pushq $0x38
popq %rdi
callq 0x4250
movq %rax, %rbx
movq %rax, %rdi
callq 0x1b160
movq %rbx, %rdi
callq 0x1b17c
movq %rbx, %rdi
callq 0x1b528
movq 0x1244e(%rip), %rdi     # 0x32fd8
leaq 0x4fbb(%rip), %rsi      # 0x25b4c
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x4220
movq %r14, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/fuad00[P]wifitool/code.cpp
// Function: progress(int)
bool progress(int progress) {
	system("clear");
	cout << "\n[";
	int pos = progress / 2;
	for (int i = 0; i < 50; ++i) {
		if (i < pos) cout << "=";
		else if (i == pos) cout << ">";
		else cout << " ";
	}
	cout << "] " << int(progress) << " %\r";
	cout.flush();
	current_progress = progress; // Запоминаем значение аргумента полосы прогресса
	cout << endl;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x2298(%rip), %rdi      # 0x4b7d
callq 0x20f0
movq 0x46df(%rip), %r14      # 0x6fd0
leaq 0x2293(%rip), %rsi      # 0x4b8b
movq %r14, %rdi
callq 0x2130
pushq $0x2
popq %rcx
movl %ebx, 0x4(%rsp)
movl %ebx, %eax
cltd
idivl %ecx
movl %eax, %ebp
xorl %r15d, %r15d
leaq 0x2278(%rip), %r12      # 0x4b90
leaq 0x1edd(%rip), %r13      # 0x47fc
leaq 0x2268(%rip), %rbx      # 0x4b8e
cmpl $0x32, %r15d
je 0x2947
cmpl %r15d, %ebp
movq %r13, %rsi
cmoveq %r12, %rsi
cmovgq %rbx, %rsi
movq %r14, %rdi
callq 0x2130
incl %r15d
jmp 0x2926
movq 0x4682(%rip), %r14      # 0x6fd0
leaq 0x223d(%rip), %rsi      # 0x4b92
movq %r14, %rdi
callq 0x2130
movq %rax, %rdi
movl 0x4(%rsp), %ebx
movl %ebx, %esi
callq 0x21b0
leaq 0x2223(%rip), %rsi      # 0x4b95
movq %rax, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x20b0
movl %ebx, 0x47ac(%rip)      # 0x7134
movq %r14, %rdi
callq 0x20a0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/fuad00[P]wifitool/code.cpp
// Function: help_func()
int help_func()	{
	progress(current_progress);    // Выводим АКТУАЛЬНУЮ строку прогресса

	cout << "\n[1] Для проверки и установки необходимых компонентов." << endl;
	cout << "[2] Для перевода сетевой карты в режим монитора." << endl;
	cout << "[3] Для прослушки сетей." << endl;
	cout << "[4] Для перехвата хендшейка." << endl;
	cout << "[5] Для перебора пароля\n" << endl;
	return 0;
}

// Assembly:
pushq %rbx
movl 0x478c(%rip), %edi      # 0x7134
callq 0x28d1
movq 0x461c(%rip), %rbx      # 0x6fd0
leaq 0x198d(%rip), %rsi      # 0x4348
movq %rbx, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
leaq 0x19d8(%rip), %rsi      # 0x43aa
movq %rbx, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
leaq 0x1a17(%rip), %rsi      # 0x4400
movq %rbx, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
leaq 0x1a2a(%rip), %rsi      # 0x442a
movq %rbx, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
leaq 0x1a45(%rip), %rsi      # 0x445c
movq %rbx, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/fuad00[P]wifitool/code.cpp
// Function: check_func()
bool check_func()	{
	progress(5);              // Выводим строку прогресса
	cout << "\nПроверка необходимых компонентов....." << endl;
	if (system("which aircrack-ng > /dev/null 2>&1"))	{      // Если компонент отсутствует в системе
		system("apt-get update && apt-get install -y aircrack-ng");         // Устанавливаем компонент
		check_func();     // Перезапускаем функцию проверки чтобы убедиться, что компонент установился
	}

	else if (system("which xterm > /dev/null 2>&1"))	{
		system("apt-get update && apt-get install -y xterm");
		check_func();
	}
	else	{
	progress(10);             // Выводим строку прогресса
	cout << "\n[!] Все компоненты уже установлены! Можете продолжать работу.\n" << endl;
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $0x5
popq %rbx
movq 0x4590(%rip), %r14      # 0x6fd0
leaq 0x1a3f(%rip), %r15      # 0x4486
leaq 0x1a7d(%rip), %r12      # 0x44cb
leaq 0x1a99(%rip), %rbp      # 0x44ee
leaq 0x1ae0(%rip), %r13      # 0x453c
movl %ebx, %edi
callq 0x28d1
movq %r14, %rdi
movq %r15, %rsi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq %r12, %rdi
callq 0x20f0
movq %rbp, %rdi
testl %eax, %eax
jne 0x2a98
leaq 0x1a93(%rip), %rdi      # 0x451f
callq 0x20f0
movq %r13, %rdi
testl %eax, %eax
je 0x2a9f
callq 0x20f0
jmp 0x2a5c
pushq $0xa
popq %rdi
callq 0x28d1
movq 0x4522(%rip), %rdi      # 0x6fd0
leaq 0x1ab2(%rip), %rsi      # 0x4567
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/fuad00[P]wifitool/code.cpp
// Function: monitor_func()
bool monitor_func()	{
	progress(15);      // Выводим строку прогресса
	system("xterm -title 'Переводим карту в режим монитора...' -e sudo airmon-ng check kill > /dev/null 2>&1"); // Убиваем все процессы (демоны), которые используются на данный момент сетевой картой
	progress(20);      // Выводим строку прогресса
	string monitor_mode = "xterm -title 'Переводим карту в режим монитора...' -e sudo airmon-ng start " + wireless_card + " > /dev/null 2>&1"; //пробуем перевести выбранную? карту в режим монитора
	const char *firing_command_monitor_mode = monitor_mode.c_str();
	system(firing_command_monitor_mode);
	progress(25);      // Выводим строку прогресса
	cout << "\n[+] Готово! Используйте [3] чтобы понюхать WiFi.\n" << endl;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
pushq $0xf
popq %rdi
callq 0x28d1
leaq 0x1af1(%rip), %rdi      # 0x45d8
callq 0x20f0
pushq $0x14
popq %rdi
callq 0x28d1
leaq 0x1b5a(%rip), %rsi      # 0x4655
leaq 0x4646(%rip), %rdx      # 0x7148
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x337f
leaq 0x19c6(%rip), %rdx      # 0x44dc
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3341
leaq 0x20(%rsp), %rdi
callq 0x2228
movq (%rsp), %rdi
callq 0x20f0
pushq $0x19
popq %rdi
callq 0x28d1
movq 0x448d(%rip), %rdi      # 0x6fd0
leaq 0x1b73(%rip), %rsi      # 0x46bd
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2228
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x2b77
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2228
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/fuad00[P]wifitool/code.cpp
// Function: sniff_real_func()
bool sniff_real_func()	{
	string airodump1 = "timeout 9 xterm -title 'Поиск WiFi...' -e sudo airodump-ng " + wireless_card_monitormode + " --output-format=csv -w nets.csv --write-interval 3";
	const char *airodump_init1 = airodump1.c_str();
	system(airodump_init1);
	return 0;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
leaq 0x1f35(%rip), %rsi      # 0x4ac5
leaq 0x45f1(%rip), %rdx      # 0x7188
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x337f
leaq 0x1f5b(%rip), %rdx      # 0x4b06
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3341
leaq 0x20(%rsp), %rdi
callq 0x2228
movq (%rsp), %rdi
callq 0x20f0
movq %rsp, %rdi
callq 0x2228
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
jmp 0x2be9
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2228
movq %rbx, %rdi
callq 0x21d0