LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::BatchNormalization_UpdateZ()
void ConstructLayer::BatchNormalization_UpdateZ()
{
    // Refer to : https://arxiv.org/pdf/1502.03167v3.pdf
    // for detailed algorithm

    // only apply for cnn, fc and output layer, no need for pooling and input layers
    if( (GetType() != LayerType::cnn) &&
            ( GetType() != LayerType::fullyConnected) &&
            (GetType() != LayerType::output))
    {
        return; 
    }

    // 1D layers
    if(GetLayerDimension() == LayerDimension::_1D)
        BatchNormalization_UpdateZ_1DLayer();

    // 2D layers
    else if(GetLayerDimension() == LayerDimension::_2D)
        BatchNormalization_UpdateZ_2DLayer();

    // unsupported layers
    else
    {
        std::cout<<"Error in batch normalization: Unsupported layer dimension."<<std::endl;
        std::cout<<"         only 1D and 2D layers are supported."<<std::endl;
        exit(0);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x250(%rax)
cmpl $0x1, %eax
je 0xba51
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x250(%rax)
testl %eax, %eax
je 0xba51
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x250(%rax)
cmpl $0x4, %eax
jne 0xba89
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x258(%rax)
movq (%rbx), %rcx
testl %eax, %eax
je 0xba7c
movq %rbx, %rdi
callq *0x258(%rcx)
cmpl $0x1, %eax
jne 0xba8b
movl $0x1a0, %ecx            # imm = 0x1A0
addq (%rbx), %rcx
jmp 0xba83
addq $0x198, %rcx            # imm = 0x198
movq %rbx, %rdi
popq %rbx
jmpq *(%rcx)
popq %rbx
retq
movq 0x27546(%rip), %rbx     # 0x32fd8
leaq 0x1669a(%rip), %rsi     # 0x22133
movq %rbx, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
leaq 0x166be(%rip), %rsi     # 0x2216e
movq %rbx, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::UpdateCoordsForActiveNeuronFC()
void ConstructLayer::UpdateCoordsForActiveNeuronFC()
{
    // enable/disable neuron; and
    // update coords for active neuron
    assert(__neurons.size() == 1); 
    auto dim = __neurons[0].Dimension();
    //cout<<"Neuron dimension in FC layer: "<<dim<<endl;
    assert(dim.second == 1);

    // get filter
    assert(__activeFlag.size() == 1);

    size_t active_i = 0;
    for(size_t i=0;i<dim.first;i++)
    {
        // first reset coords back
        //__neurons[0][i][0]->SetCoord(0, i, 0); //SetCoord(i, j, k), please note the sequence of the coordinates
        __neurons[0][i][0]->SetCoord(i, 0, 0);   //SetCoord(i, j, k), 

        // then set coord according to filter mask
        if(!__activeFlag[0][i][0]){
            __neurons[0][i][0]->Disable();
            continue;
        }
        __neurons[0][i][0]->Enable();
        //__neurons[0][i][0]->SetCoord(0, active_i, 0);
        __neurons[0][i][0]->SetCoord(active_i, 0, 0); // SetCoord(i, j, k)
        active_i++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
movq 0x48(%rbx), %rax
subq %rdi, %rax
cmpq $0x18, %rax
jne 0xbdb9
callq 0x111fe
cmpq $0x1, %rdx
jne 0xbdd8
movq %rax, %r14
movq 0x110(%rbx), %rax
subq 0x108(%rbx), %rax
cmpq $0x18, %rax
jne 0xbdf7
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq %r12, %r14
je 0xbdaa
movq 0x40(%rbx), %rax
movq (%rax), %rax
movq (%rax,%rbp), %rax
movq (%rax), %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1d56c
movq 0x108(%rbx), %rax
movq (%rax), %rdi
addq %r13, %rdi
xorl %esi, %esi
callq 0x11440
movq 0x40(%rbx), %rcx
movq (%rcx), %rcx
movq (%rcx,%rbp), %rcx
movq (%rcx), %rdi
testq %rdx, (%rax)
je 0xbd98
callq 0x1c24e
movq 0x40(%rbx), %rax
movq (%rax), %rax
movq (%rax,%rbp), %rax
movq (%rax), %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1d56c
incq %r15
jmp 0xbd9d
callq 0x1c246
incq %r12
addq $0x18, %rbp
addq $0x28, %r13
jmp 0xbd2e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15ad0(%rip), %rdi     # 0x21890
leaq 0x15913(%rip), %rsi     # 0x216da
leaq 0x164ac(%rip), %rcx     # 0x2227a
movl $0xa04, %edx            # imm = 0xA04
callq 0x4180
leaq 0x1622c(%rip), %rdi     # 0x2200b
leaq 0x158f4(%rip), %rsi     # 0x216da
leaq 0x1648d(%rip), %rcx     # 0x2227a
movl $0xa07, %edx            # imm = 0xA07
callq 0x4180
leaq 0x164b9(%rip), %rdi     # 0x222b7
leaq 0x158d5(%rip), %rsi     # 0x216da
leaq 0x1646e(%rip), %rcx     # 0x2227a
movl $0xa0a, %edx            # imm = 0xA0A
callq 0x4180
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::DropOut()
void ConstructLayer::DropOut()
{
    if(__type == LayerType::fullyConnected)
        __UpdateActiveFlagFC();
    else if(__type == LayerType::cnn || __type == LayerType::pooling)
        __UpdateActiveFlagCNN();
    else 
    {
        std::cout<<"Error: drop out, un-recongnized layer type."<<std::endl;
        exit(0);
    }
}

// Assembly:
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0xc0dc
testl %eax, %eax
jne 0xc060
jmp 0xc084
pushq %rax
movq 0x26f70(%rip), %rdi     # 0x32fd8
leaq 0x162ef(%rip), %rsi     # 0x2235e
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::__UpdateActiveFlagFC_Obsolete()
void ConstructLayer::__UpdateActiveFlagFC_Obsolete() // this function has been made obsolete
{
    // for drop out
    // randomly mask out a few neurons
    assert(__activeFlag.size() == 1);
    auto dim = __activeFlag[0].Dimension();
    assert(dim.second == 1);
    // number of neurons to make inactive
    int n_dead = (int)dim.first * __dropOut;

    // generate a filter vector
    std::vector<bool> tmp(dim.first, true);
    for(int i=0;i<n_dead;i++)
        tmp[i] = false;
    TOOLS::Shuffle(tmp);

    // mask out filters
    for(size_t i=0;i<dim.first;i++)
    {
        __activeFlag[0][i][0] = tmp[i];
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x108(%rdi), %rdi
movq 0x110(%rbx), %rax
subq %rdi, %rax
cmpq $0x18, %rax
jne 0xc447
callq 0x1145e
cmpq $0x1, %rdx
jne 0xc466
movq %rax, %r14
cvtsi2sd %r14d, %xmm0
mulsd 0x3d8(%rbx), %xmm0
cvttsd2si %xmm0, %r13d
leaq 0x10(%rsp), %rdx
movb $0x1, (%rdx)
leaq 0x20(%rsp), %r15
movq %rsp, %rcx
movq %r15, %rdi
movq %rax, %rsi
callq 0x11926
xorl %r12d, %r12d
testl %r13d, %r13d
cmovlel %r12d, %r13d
cmpq %r12, %r13
je 0xc3ca
movq %r15, %rdi
movq %r12, %rsi
callq 0x11440
notq %rdx
andq %rdx, (%rax)
incq %r12
jmp 0xc3af
leaq 0x20(%rsp), %rdi
callq 0x119a6
xorl %r15d, %r15d
movq %rsp, %r12
leaq 0x10(%rsp), %r13
xorl %ebp, %ebp
cmpq %rbp, %r14
je 0xc42e
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x11440
movq %rax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x108(%rbx), %rax
movq (%rax), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x11440
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x119e4
incq %rbp
addq $0x28, %r15
jmp 0xc3e1
leaq 0x20(%rsp), %rdi
callq 0x119fa
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15e69(%rip), %rdi     # 0x222b7
leaq 0x15285(%rip), %rsi     # 0x216da
leaq 0x16095(%rip), %rcx     # 0x224f1
movl $0xaab, %edx            # imm = 0xAAB
callq 0x4180
leaq 0x15b9e(%rip), %rdi     # 0x2200b
leaq 0x15266(%rip), %rsi     # 0x216da
leaq 0x16076(%rip), %rcx     # 0x224f1
movl $0xaad, %edx            # imm = 0xAAD
callq 0x4180
jmp 0xc48b
jmp 0xc48b
jmp 0xc48b
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x119fa
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::ClearImage()
void ConstructLayer::ClearImage()
{
    // members in this routine needs to be cleared for each batch
    // because contents are different for each batch
    // and to avoid memory leak

    __imageA.clear();
    __imageZ.clear();
    __imageSigmaPrime.clear();
    __imageDelta.clear();

    __imageAFull.clear();
    __imageZFull.clear();
    __imageSigmaPrimeFull.clear();
    __imageDeltaFull.clear();

    __outputLayerCost.clear();

    __wGradient.clear();
    __bGradient.clear();

    // batch normalization
    __imageZ_BN.clear();
    __imageZFull_BN.clear();
    __imageY_BN.clear();
    __imageYFull_BN.clear();
    __imageAverage_BN.clear();
    __imageAverageFull_BN.clear();
    __imageVariance_BN.clear();
    __imageVarianceFull_BN.clear();
    __imageDelta_BN.clear();
    __imageDeltaFull_BN.clear();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x138, %rdi            # imm = 0x138
callq 0x111f6
leaq 0x150(%rbx), %rdi
callq 0x111f6
leaq 0x168(%rbx), %rdi
callq 0x111f6
leaq 0x180(%rbx), %rdi
callq 0x111f6
leaq 0x198(%rbx), %rdi
callq 0x111f6
leaq 0x1b0(%rbx), %rdi
callq 0x111f6
leaq 0x1c8(%rbx), %rdi
callq 0x111f6
leaq 0x1e0(%rbx), %rdi
callq 0x111f6
movq 0x1f8(%rbx), %rax
cmpq %rax, 0x200(%rbx)
je 0xd1eb
movq %rax, 0x200(%rbx)
leaq 0x90(%rbx), %rdi
callq 0x111f6
leaq 0xa8(%rbx), %rdi
callq 0x111f6
leaq 0x218(%rbx), %rdi
callq 0x111f6
leaq 0x230(%rbx), %rdi
callq 0x111f6
leaq 0x248(%rbx), %rdi
callq 0x111f6
leaq 0x260(%rbx), %rdi
callq 0x111f6
leaq 0x278(%rbx), %rdi
callq 0x111f6
leaq 0x290(%rbx), %rdi
callq 0x111f6
leaq 0x2a8(%rbx), %rdi
callq 0x111f6
leaq 0x2c0(%rbx), %rdi
callq 0x111f6
leaq 0x2d8(%rbx), %rdi
callq 0x111f6
addq $0x2f0, %rbx            # imm = 0x2F0
movq %rbx, %rdi
popq %rbx
jmp 0x111f6
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::GetBatchSize()
int ConstructLayer::GetBatchSize()
{
    if( __p_data_interface == nullptr)
    {
        std::cout<<"Error: ConstructLayer::GetBatchSize() data interface is nullptr."
            <<std::endl;
        exit(0);
    }

    int batch_size = __p_data_interface -> GetBatchSize();
    if(batch_size <= 0)
    {
        std::cout<<"Error: ConstructLayer::GetBatchSize() batch size is 0, seems data interface is not implemented."
            <<std::endl;
        exit(0);
    }
    return batch_size;
}

// Assembly:
pushq %rax
movq 0x400(%rdi), %rax
testq %rax, %rax
je 0xd30b
movl (%rax), %eax
testl %eax, %eax
jle 0xd31b
popq %rcx
retq
movq 0x25cc6(%rip), %rdi     # 0x32fd8
leaq 0x15365(%rip), %rsi     # 0x2267e
jmp 0xd329
movq 0x25cb6(%rip), %rdi     # 0x32fd8
leaq 0x15396(%rip), %rsi     # 0x226bf
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::GetCostFuncType()
CostFuncType ConstructLayer::GetCostFuncType()
{
    if(__type != LayerType::output)
    {
        std::cout<<"Error: ConstructLayer::GetCostFuncType() only works for output layer"
            <<std::endl;
        exit(0);
    }
    return __cost_func_type;
}

// Assembly:
cmpl $0x4, 0xc(%rdi)
jne 0xd34b
movl 0x3e8(%rdi), %eax
retq
pushq %rax
movq 0x25c85(%rip), %rdi     # 0x32fd8
leaq 0x153c5(%rip), %rsi     # 0x2271f
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::GetDataInterface()
DataInterface * ConstructLayer::GetDataInterface()
{
    if(__p_data_interface == nullptr)
    {
        std::cout<<"Error: ConstructLayer::GetDataInterface() data interface is nullptr."
            <<std::endl;
        exit(0);
    }
    return __p_data_interface;
}

// Assembly:
movq 0x400(%rdi), %rax
testq %rax, %rax
je 0xd37f
retq
pushq %rax
movq 0x25c51(%rip), %rdi     # 0x32fd8
leaq 0x153d6(%rip), %rsi     # 0x22764
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::GetNextLayer()
Layer* ConstructLayer::GetNextLayer()
{
    if(__nextLayer == nullptr)
    {
        std::cout<<"Error: ConstructLayer::GetNextLayer(): __nextLayer is not setup"
            <<std::endl;
        exit(0);
    }
    return __nextLayer;
}

// Assembly:
movq 0x3f8(%rdi), %rax
testq %rax, %rax
je 0xd3af
retq
pushq %rax
movq 0x25c21(%rip), %rdi     # 0x32fd8
leaq 0x153eb(%rip), %rsi     # 0x227a9
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::GetPrevLayer()
Layer* ConstructLayer::GetPrevLayer()
{
    if(__prevLayer == nullptr)
    {
        std::cout<<"Error: ConstructLayer::GetNextLayer(): __prevLayer is not setup"
            <<std::endl;
        exit(0);
    }

    return __prevLayer;
}

// Assembly:
movq 0x3f0(%rdi), %rax
testq %rax, %rax
je 0xd3df
retq
pushq %rax
movq 0x25bf1(%rip), %rdi     # 0x32fd8
leaq 0x153fb(%rip), %rsi     # 0x227e9
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::UpdateWeightsAndBias()
void ConstructLayer::UpdateWeightsAndBias()
{
    // after finishing one training batch, update weights and bias

    // 1) first update w&b graidents
    UpdateWeightsAndBiasGradients();

    // 2) then update weights and bias
    auto layerType = this->GetType();

    if(layerType == LayerType::fullyConnected || layerType == LayerType::output)  // output is also a fc layer
    {
        UpdateWeightsAndBiasFC();
    }
    else if(layerType == LayerType::cnn) 
    {
        UpdateWeightsAndBiasCNN();
    }
    else if(layerType == LayerType::pooling) 
    {
        UpdateWeightsAndBiasPooling();
    }
    else 
    {
        std::cout<<__func__<<" Error: update weights and bias, unsupported layer type."<<std::endl;
        exit(0);
    }

    // 3) if use batch normalization, update \gamma and \beta
    if(__use_batch_normalization)
        BatchNormalization_UpdateGammaBeta();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xd480
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x250(%rax)
testl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
je 0xd432
cmpl $0x2, %eax
je 0xd43a
cmpl $0x1, %eax
jne 0xd44e
movq %rbx, %rdi
callq 0xde10
jmp 0xd43a
movq %rbx, %rdi
callq 0xd4e4
cmpb $0x1, 0x210(%rbx)
jne 0xd44c
movq %rbx, %rdi
popq %rbx
jmp 0xe4de
popq %rbx
retq
movq 0x25b83(%rip), %rdi     # 0x32fd8
leaq 0x153cd(%rip), %rsi     # 0x22829
callq 0x4240
leaq 0x153d6(%rip), %rsi     # 0x2283e
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::UpdateWeightsAndBiasGradients()
void ConstructLayer::UpdateWeightsAndBiasGradients()
{
    // after finishing one training batch, update weights and bias gradients
    auto layerType = this->GetType();

    if(layerType == LayerType::fullyConnected || layerType == LayerType::output)  // output is also a fully connected layer
    {
        UpdateWeightsAndBiasGradientsFC();
    }
    else if(layerType == LayerType::cnn) 
    {
        UpdateWeightsAndBiasGradientsCNN();
    }
    else if(layerType == LayerType::pooling) 
    {
        UpdateWeightsAndBiasGradientsPooling();
    }
    else 
    {
        std::cout<<__func__<<" Error: update weights and bias gradients, unsupported layer type."<<std::endl;
        exit(0);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x250(%rax)
testl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
je 0xd4a7
cmpl $0x2, %eax
je 0xd4b0
cmpl $0x1, %eax
jne 0xd4b2
movq %rbx, %rdi
popq %rbx
jmp 0xeb98
movq %rbx, %rdi
popq %rbx
jmp 0xe732
popq %rbx
retq
movq 0x25b1f(%rip), %rdi     # 0x32fd8
leaq 0x153b7(%rip), %rsi     # 0x22877
callq 0x4240
leaq 0x153c9(%rip), %rsi     # 0x22895
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::GetNumberOfNeurons()
int ConstructLayer::GetNumberOfNeurons()
{
    if(__type == LayerType::fullyConnected || __type == LayerType::output ) // output layer is also a fully connected layer
    {
        // used for setup fc layer
        return __n_neurons_fc;
    }
    else if(__type == LayerType::input)
    {
        auto dim = __neurons[0].Dimension();
        return static_cast<int>((dim.first * dim.second));
    }
    else if(__type == LayerType::cnn || __type == LayerType::pooling)
    {
        auto dim = GetOutputImageSize();
        return static_cast<int>((dim.first * dim.second * __n_kernels_cnn));
    }
    else
    {
        std::cout<<"Warning: GetNumberOfNeurons only work for fc and input layer."<<std::endl;
        return 0;
    }
}

// Assembly:
pushq %rbx
movl 0xc(%rdi), %eax
cmpq $0x4, %rax
ja 0xf591
movq %rdi, %rbx
leaq 0x11b70(%rip), %rcx     # 0x210d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x10(%rbx), %eax
jmp 0xf5ae
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x270(%rax)
imull %edx, %eax
imull 0x18(%rbx), %eax
jmp 0xf5ae
movq 0x40(%rbx), %rdi
callq 0x111fe
imull %edx, %eax
jmp 0xf5ae
movq 0x23a40(%rip), %rdi     # 0x32fd8
leaq 0x139cc(%rip), %rsi     # 0x22f6b
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/./include/Layer.h
// Function: Images::Vectorization() const
Images Vectorization() const
    {
        // combine outputs from all kernels into a one-collum matrix
        // this is for feedforward from 2D layer to 1D layer 
        //     (2D layer can have multiple kernels, 1D layer should only have 1 "kernel");
        assert(OutputImageFromKernel.size() > 0);
        auto dim = OutputImageFromKernel[0].Dimension();

        Images tmp = ReshapeKernels(dim.first*dim.second, 1);
        Matrix large_vector = Matrix::ConcatenateMatrixByI(tmp.OutputImageFromKernel);

        tmp.OutputImageFromKernel.clear();
        tmp.OutputImageFromKernel.push_back(large_vector);
        return tmp;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rsi), %rdi
cmpq %rdi, 0x8(%rsi)
je 0x11bc4
movq %rsi, %r14
callq 0x17a6a
imulq %rax, %rdx
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13098
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x195de
movq %rbx, %rdi
callq 0x11394
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x1139c
movq %rsp, %rdi
callq 0x17a9a
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x11db6(%rip), %rdi     # 0x23981
leaq 0x11a13(%rip), %rsi     # 0x235e5
leaq 0x11dc9(%rip), %rcx     # 0x239a2
movl $0x159, %edx            # imm = 0x159
callq 0x4180
movq %rax, %r14
movq %rsp, %rdi
callq 0x17a9a
jmp 0x11bf3
movq %rax, %r14
movq %rbx, %rdi
callq 0x110e4
movq %r14, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/./include/Layer.h
// Function: Filter2D::GetNumberOfTrueElements()
int GetNumberOfTrueElements()
    {
        int count = 0;
        auto dim = Dimension();
        for(size_t i=0;i<dim.first;i++)
            for(size_t j=0;j<dim.second;j++)
                if(__filter[i][j]) count++;
        return count;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1145e
movq %rax, (%rsp)
movq %rdx, %r12
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpq (%rsp), %rbp
je 0x13086
imulq $0x28, %rbp, %r14
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x13081
movq (%rbx), %rdi
addq %r14, %rdi
movq %r13, %rsi
callq 0x11440
andq (%rax), %rdx
cmpq $0x1, %rdx
sbbl $-0x1, %r15d
incq %r13
jmp 0x1305e
incq %rbp
jmp 0x13051
movl %r15d, %eax
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/DataInterface.cpp
// Function: DataInterface::DataInterface(LayerDimension)
DataInterface::DataInterface(LayerDimension ld)
{
    // 1)
    __gLayerDimension = ld;
    // place holder
    // currently only accepts 2D image format
    test();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movq $0x64, (%rdi)
andl $0x0, 0x8(%rdi)
leaq 0x10(%rdi), %rbx
movl $0xb0, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4160
movl %ebp, 0xc0(%r14)
movq %r14, %rdi
callq 0x1649a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq 0xa8(%r14), %rdi
leaq 0x90(%r14), %r12
leaq 0x58(%r14), %r13
leaq 0x40(%r14), %rbp
addq $0x28, %r14
callq 0x110e4
movq %r12, %rdi
callq 0x110e4
movq %r13, %rdi
callq 0x11106
movq %rbp, %rdi
callq 0x11106
movq %r14, %rdi
callq 0x110e4
movq %rbx, %rdi
callq 0x110e4
movq %r15, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/DataInterface.cpp
// Function: DataInterface::test()
void DataInterface::test()
{
    // only one image
    Matrix image(std::pair<int, int>(10, 10), 1);
    //std::cout<<"input image: "<<std::endl<<image<<std::endl;

    Matrix image2 = image.Reshape(100, 1);
    //std::cout<<"input image: "<<std::endl<<image2<<std::endl;


    __data.push_back(image2);

    // label for this image
    Matrix label1(std::pair<int, int>(10, 1), 0);
    label1[0][0] = 1.;
    __label.push_back(label1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
pushq $0xa
popq %rdx
movsd 0xb05c(%rip), %xmm0     # 0x21510
movq %r14, %rdi
movq %rdx, %rsi
callq 0x1787a
leaq 0x18(%rsp), %rdi
pushq $0x64
popq %rdx
pushq $0x1
popq %rcx
movq %r14, %rsi
callq 0x18a0c
leaq 0x10(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0x1139c
movq %rsp, %rdi
pushq $0xa
popq %rsi
pushq $0x1
popq %rdx
xorps %xmm0, %xmm0
callq 0x1787a
movq %rsp, %rdi
xorl %esi, %esi
callq 0x17c46
movq (%rax), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
addq $0x28, %rbx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x1139c
movq %rsp, %rdi
callq 0x17a9a
leaq 0x18(%rsp), %rdi
callq 0x17a9a
leaq 0x30(%rsp), %rdi
callq 0x17a9a
addq $0x48, %rsp
popq %rbx
popq %r14
retq
jmp 0x16540
movq %rax, %rbx
jmp 0x16555
movq %rax, %rbx
jmp 0x1655f
movq %rax, %rbx
movq %rsp, %rdi
callq 0x17a9a
leaq 0x18(%rsp), %rdi
callq 0x17a9a
leaq 0x30(%rsp), %rdi
callq 0x17a9a
movq %rbx, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/DataInterface.cpp
// Function: DataInterface::DataInterface(char const*, char const*, LayerDimension)
DataInterface::DataInterface(const char* p_signal, const char* p_cosmic, LayerDimension ld)
{
    // 1) first need to set layer dimension
    __gLayerDimension = ld;

    // 2) then load data to memory
    // for code development
    loadFile(p_signal, test_training_signal);
    loadFile(p_cosmic, test_training_cosmic);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r13
movq %rdi, %r14
movq $0x64, (%rdi)
andl $0x0, 0x8(%rdi)
movq %rsi, %rbx
addq $0x10, %rdi
leaq 0x90(%r14), %r15
leaq 0xa8(%r14), %r12
movl $0xb0, %edx
movq %rdi, (%rsp)
xorl %esi, %esi
callq 0x4160
movl %ebp, 0xc0(%r14)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x16630
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x16630
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%r14), %r13
leaq 0x40(%r14), %rbp
addq $0x28, %r14
movq %r12, %rdi
callq 0x110e4
movq %r15, %rdi
callq 0x110e4
movq %r13, %rdi
callq 0x11106
movq %rbp, %rdi
callq 0x11106
movq %r14, %rdi
callq 0x110e4
movq (%rsp), %rdi
callq 0x110e4
movq %rbx, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/DataInterface.cpp
// Function: DataInterface::DataInterface(char const*, char const*, LayerDimension, std::pair<int, int>, int)
DataInterface::DataInterface(const char* p_signal, const char* p_cosmic, LayerDimension ld, std::pair<int, int> dim, int batch_size)
{
    // 1) first need to set layer dimension
    __gLayerDimension = ld;

    // set data dimension
    gBatchSize = batch_size;
    __dataDimensionFromParameter.first = dim.first;
    __dataDimensionFromParameter.second = dim.second;

    // 2) then load data to memory
    // for code development
    loadFile(p_signal, test_training_signal);
    loadFile(p_cosmic, test_training_cosmic);

    //cout<<"data dimension from parameter: "<<__dataDimensionFromParameter<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r12d
movq %r8, %rbx
movl %ecx, %r15d
movq %rdx, 0x8(%rsp)
movq %rdi, %r14
andq $0x0, 0x4(%rdi)
movq %rsi, 0x10(%rsp)
addq $0x10, %rdi
leaq 0x90(%r14), %rbp
leaq 0xa8(%r14), %r13
movl $0xb0, %edx
movq %rdi, (%rsp)
xorl %esi, %esi
callq 0x4160
movl %r15d, 0xc0(%r14)
movl %r12d, (%r14)
movslq %ebx, %rax
movq %rax, 0x80(%r14)
sarq $0x20, %rbx
movq %rbx, 0x88(%r14)
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq 0x16630
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq 0x16630
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%r14), %r15
leaq 0x40(%r14), %r12
addq $0x28, %r14
movq %r13, %rdi
callq 0x110e4
movq %rbp, %rdi
callq 0x110e4
movq %r15, %rdi
callq 0x11106
movq %r12, %rdi
callq 0x11106
movq %r14, %rdi
callq 0x110e4
movq (%rsp), %rdi
callq 0x110e4
movq %rbx, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/DataInterface.cpp
// Function: DataInterface::GetNewBatchLabel()
std::vector<Matrix>& DataInterface::GetNewBatchLabel()
{
    if(gLabelIndex + 1 != gDataIndex) // this is to make sure one access data first, then label
    {
        cout<<"Error: DataInterface data & label are not aligned."<<endl;
        exit(0);
    }
    gLabelIndex++;

    return __label;
}

// Assembly:
movl 0x8(%rdi), %eax
incl %eax
cmpl 0x4(%rdi), %eax
jne 0x16e73
movl %eax, 0x8(%rdi)
addq $0x28, %rdi
movq %rdi, %rax
retq
pushq %rax
movq 0x1c15d(%rip), %rdi     # 0x32fd8
leaq 0xcd1d(%rip), %rsi      # 0x23b9f
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/DataInterface.cpp
// Function: DataInterface::GetNewBatchDataImage()
std::vector<Images>& DataInterface::GetNewBatchDataImage()
{
    // return data in Images form

    // 1) update batch
    UpdateBatch(__data, __label);
    assert(__data.size() == __label.size());

    // 2) reform
    for(size_t i=0;i<__data.size();i++)
    {
        // reform it in Images format
        Images _image;
        _image.OutputImageFromKernel.push_back(__data[i]);
        __data_image.push_back(_image);

        Images _image_label;
        _image_label.OutputImageFromKernel.push_back(__label[i]);
        __label_image.push_back(_image_label);
    }

    return __data_image;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rsi
leaq 0x28(%rdi), %rdx
movq %rdx, 0x8(%rsp)
callq 0x16bb0
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rax
movq %rax, %rcx
subq %rsi, %rcx
movq 0x30(%rbx), %rdx
subq 0x28(%rbx), %rdx
cmpq %rdx, %rcx
jne 0x16f8b
leaq 0x40(%rbx), %r15
leaq 0x58(%rbx), %rcx
movq %rcx, (%rsp)
xorl %r14d, %r14d
leaq 0x30(%rsp), %r13
leaq 0x10(%rsp), %rbp
xorl %r12d, %r12d
subq %rsi, %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %rax, %r12
jae 0x16f79
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
addq %r14, %rsi
movq %r13, %rdi
callq 0x1139c
movq %r15, %rdi
movq %r13, %rsi
callq 0x11400
andq $0x0, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
addq %r14, %rsi
movq %rbp, %rdi
callq 0x1139c
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x11400
movq %rbp, %rdi
callq 0x110e4
movq %r13, %rdi
callq 0x110e4
incq %r12
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rax
addq $0x18, %r14
jmp 0x16ef4
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcc40(%rip), %rdi      # 0x23bd2
leaq 0xcbc8(%rip), %rsi      # 0x23b61
leaq 0xcc52(%rip), %rcx      # 0x23bf2
pushq $0x76
popq %rdx
callq 0x4180
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x110e4
jmp 0x16fba
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x110e4
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/DataInterface.cpp
// Function: DataInterface::GetNewBatchLabelImage()
std::vector<Images>& DataInterface::GetNewBatchLabelImage()
{
    if(gLabelIndex + 1 != gDataIndex) // this is to make sure one access data first, then label
    {
        cout<<"Error: DataInterface data & label are not aligned."<<endl;
        exit(0);
    }
    gLabelIndex++;

    return __label_image;
}

// Assembly:
movl 0x8(%rdi), %eax
incl %eax
cmpl 0x4(%rdi), %eax
jne 0x16fe1
movl %eax, 0x8(%rdi)
addq $0x58, %rdi
movq %rdi, %rax
retq
pushq %rax
movq 0x1bfef(%rip), %rdi     # 0x32fd8
leaq 0xcbaf(%rip), %rsi      # 0x23b9f
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Layer.cpp
// Function: operator<<(std::ostream&, Filter2D const&)
std::ostream & operator<<(std::ostream &os, const Filter2D &t)
{
    for(size_t i=0;i<t.__filter.size();i++)
    {
        for(size_t j=0;j<t.__filter[i].size();j++)
        {
            os<<std::setfill(' ')<<std::setw(4)<<t.__filter[i][j];
        }
        os<<std::endl;
    }
    return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
pushq $0x20
popq %rbp
movq (%r14), %rcx
movq 0x8(%r14), %rax
subq %rcx, %rax
cqto
pushq $0x28
popq %rdi
idivq %rdi
cmpq %rax, %rsi
jae 0x173fc
movq %rsi, (%rsp)
imulq $0x28, %rsi, %r13
xorl %r15d, %r15d
movq 0x10(%rcx,%r13), %rax
movl 0x18(%rcx,%r13), %edx
subq (%rcx,%r13), %rax
leaq (%rdx,%rax,8), %rax
movq %rbx, %rdi
cmpq %rax, %r15
jae 0x173eb
movl %ebp, %esi
callq 0x4300
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rax
movq $0x4, 0x10(%r12,%rax)
movq (%r14), %rdi
addq %r13, %rdi
movq %r15, %rsi
callq 0x17578
movzbl %al, %esi
movq %r12, %rdi
callq 0x4350
incq %r15
movq (%r14), %rcx
jmp 0x17396
callq 0x4130
movq (%rsp), %rsi
incq %rsi
jmp 0x17374
movq %rbx, %rax
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/Layer.cpp
// Function: operator<<(std::ostream&, NeuronCoord const&)
std::ostream & operator<<(std::ostream& os, const NeuronCoord &c)
{
    os<<std::setfill(' ')<<std::setw(4)<<c.i
        <<std::setfill(' ')<<std::setw(4)<<c.j
        <<std::setfill(' ')<<std::setw(4)<<c.k
        <<std::endl;
    return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
pushq $0x4
popq %r15
movq %r15, 0x10(%rax,%rcx)
movq (%r14), %rsi
movq %rax, %rdi
callq 0x41a0
movq %rax, %rdi
movl %ebp, %esi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x41a0
movq %rax, %rdi
movl %ebp, %esi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq 0x10(%r14), %rsi
movq %rax, %rdi
callq 0x41a0
movq %rax, %rdi
callq 0x4130
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Layer.cpp
// Function: operator<<(std::ostream&, Images const&)
std::ostream & operator<<(std::ostream &os, const Images & images)
{
    os<<"images from all kernels during one training sample:"<<std::endl;
    for(size_t i=0;i<images.OutputImageFromKernel.size();i++)
    {
        os<<"kernel: "<<i<<std::endl;
        Matrix m = (images.OutputImageFromKernel)[i];
        os<<m<<std::endl;
    }
    return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xca35(%rip), %rsi      # 0x23eea
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %ebp, %ebp
pushq $0x18
popq %r15
movq %rsp, %r12
xorl %r13d, %r13d
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
idivq %r15
cmpq %rax, %r13
jae 0x17533
movq %rbx, %rdi
leaq 0xe3d3(%rip), %rsi      # 0x258bc
callq 0x4240
movq %rax, %rdi
movq %r13, %rsi
callq 0x41a0
movq %rax, %rdi
callq 0x4130
movq (%r14), %rsi
addq %rbp, %rsi
movq %r12, %rdi
callq 0x1796e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18551
movq %rax, %rdi
callq 0x4130
movq %r12, %rdi
callq 0x17a9a
incq %r13
addq $0x18, %rbp
jmp 0x174ce
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x17a9a
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::Matrix(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&)
Matrix::Matrix(std::vector<std::vector<double>> &vv)
{
    // constructor and initilize matrix with a 2D vector vv
    size_t nRow = vv.size();
    for(size_t i=0;i<nRow;i++)
        __M.push_back(vv[i]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movq %rax, %r15
xorl %r12d, %r12d
subq $0x1, %r15
jb 0x1794e
movq (%r14), %rsi
addq %r12, %rsi
movq %rbx, %rdi
callq 0x11d32
addq $0x18, %r12
jmp 0x17934
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x11d5e
movq %r14, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::Matrix(Matrix const&)
Matrix::Matrix(const Matrix &m)
{
    // copy constructor
    auto dim = m.Dimension();
    __M.clear();
    __M.resize(dim.first, std::vector<double>(dim.second, 0));
    for(size_t i=0;i<dim.first;i++){
        for(size_t j=0;j<dim.second;j++)
        {
            __M[i][j] = m.GetElement(i, j);
        }
    }

    assert(Dimension() == dim); // make sure copy is correct
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x17a6a
movq %rax, %r12
movq %rdx, %r14
movq %rbx, %rdi
callq 0x11d2a
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rcx
movq %r14, %rsi
callq 0x1a8cc
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1a890
leaq 0x8(%rsp), %rdi
callq 0x127dc
xorl %eax, %eax
cmpq %r12, %rax
je 0x17a0a
imulq $0x18, %rax, %rcx
movq (%r15), %rdx
addq %rcx, %rdx
addq (%rbx), %rcx
xorl %esi, %esi
cmpq %rsi, %r14
je 0x17a05
movq (%rdx), %rdi
movsd (%rdi,%rsi,8), %xmm0
movq (%rcx), %rdi
movsd %xmm0, (%rdi,%rsi,8)
incq %rsi
jmp 0x179eb
incq %rax
jmp 0x179d7
movq %rbx, %rdi
callq 0x17a6a
cmpq %r12, %rax
jne 0x17a28
cmpq %r14, %rdx
jne 0x17a28
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xc559(%rip), %rdi      # 0x23f88
leaq 0xc565(%rip), %rsi      # 0x23f9b
leaq 0xc56d(%rip), %rcx      # 0x23faa
movl $0x85, %edx
callq 0x4180
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x127dc
jmp 0x17a59
movq %rax, %r14
movq %rbx, %rdi
callq 0x11d5e
movq %r14, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::operator*(Matrix&)
Matrix Matrix::operator*(Matrix &B)
{
    // matrix multiply operation *: A*B = C
    if(this->size() == 0 || B.size() == 0) {
        std::cout<<__func__<<" Error: 0 Matrix."<<std::endl;
        std::cout<<"    "<<this->size()<<" rows in left Matrix [times] "<<B.size()<<" rows in right Matrix."<<std::endl;
        exit(0);
    }

    if((*this)[0].size() != B.size() ) {
        std::cout<<__func__<<" Error: Matrix not match."<<std::endl;
        std::cout<<"    "<<(*this)[0].size()<<" collums in left Matrix [times] "<<B.size()<<" rows in right Matrix."<<std::endl;
        exit(0);
    }

    Matrix _r((*this).size(), B[0].size());

    _mul_Multiply(B, _r);

    return _r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rcx
movq 0x8(%rsi), %rdi
movq %rdi, %rax
subq %rcx, %rax
pushq $0x18
popq %r12
cqto
idivq %r12
cmpq %rcx, %rdi
je 0x17b30
movq %rax, %rsi
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
subq %rdi, %rax
je 0x17b30
cqto
idivq %r12
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jne 0x17b8c
movq 0x8(%rdi), %rdx
subq (%rdi), %rdx
sarq $0x3, %rdx
movq %r15, %rdi
callq 0x176e6
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x17c4e
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1b4a1(%rip), %r15     # 0x32fd8
leaq 0xc48b(%rip), %rsi      # 0x23fc9
movq %r15, %rdi
callq 0x4240
leaq 0xc486(%rip), %rsi      # 0x23fd3
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
leaq 0xd392(%rip), %rsi      # 0x24ef6
movq %r15, %rdi
callq 0x4240
movq %rax, %rdi
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
idivq %r12
movq %rax, %rsi
callq 0x4090
leaq 0xc45b(%rip), %rsi      # 0x23fe5
jmp 0x17be5
movq 0x1b445(%rip), %r15     # 0x32fd8
leaq 0xc42f(%rip), %rsi      # 0x23fc9
movq %r15, %rdi
callq 0x4240
leaq 0xc471(%rip), %rsi      # 0x2401a
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
leaq 0xd336(%rip), %rsi      # 0x24ef6
movq %r15, %rdi
callq 0x4240
movq (%r14), %rcx
movq 0x8(%rcx), %rsi
subq (%rcx), %rsi
sarq $0x3, %rsi
movq %rax, %rdi
callq 0x4090
leaq 0xc44f(%rip), %rsi      # 0x24034
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cqto
idivq %r12
movq %rax, %rsi
callq 0x4090
leaq 0xc3f8(%rip), %rsi      # 0x24003
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
movq %rax, %rbx
movq %r15, %rdi
callq 0x17a9a
movq %rbx, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::_mul_Multiply(Matrix&, Matrix&)
void Matrix::_mul_Multiply(Matrix &B, Matrix &C)
{
    // AxB = C; A is this matrix
    if(C.size() != this->size() || C[0].size() != B[0].size()) {
        std::cout<<"Error: Matrix not match."<<std::endl;
        exit(0);
    }
#ifdef MULTITHREAD_MATRIX
    auto jobs = DivideJobs(this->size(), B[0].size(), NCORES);
    std::vector<std::thread> th;
    for(auto &i: jobs)
    {
        //std::cout<<"("<<i.first.first<<", "<<i.first.second<<"), ";
        //std::cout<<"("<<i.second.first<<", "<<i.second.second<<"), "<<std::endl;
        th.push_back( std::thread( [this, &B, &C, &i](){
                    _mul_ComputeSection(B, C, i.first.first, i.first.second, i.second.first, i.second.second);
                    }
                    ) 
                );
    }
    for(auto &j: th){
        j.join();
    }
#else
    _mul_ComputeSection(B, C, 0, this->size(), 0, B[0].size());
#endif
}

// Assembly:
pushq %rax
movq %rdx, %rcx
movq (%rdx), %rdx
movq 0x8(%rcx), %rax
subq %rdx, %rax
movq 0x8(%rdi), %r8
subq (%rdi), %r8
cmpq %r8, %rax
jne 0x17ca1
movq 0x8(%rdx), %r8
subq (%rdx), %r8
movq (%rsi), %rdx
movq 0x8(%rdx), %r9
subq (%rdx), %r9
cmpq %r9, %r8
jne 0x17ca1
sarq $0x3, %r8
pushq $0x18
popq %r9
cqto
idivq %r9
movq %r8, (%rsp)
movq %rcx, %rdx
xorl %ecx, %ecx
movq %rax, %r8
xorl %r9d, %r9d
callq 0x183b4
popq %rax
retq
movq 0x1b330(%rip), %rdi     # 0x32fd8
leaq 0xc36c(%rip), %rsi      # 0x2401b
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::operator+(Matrix&)
Matrix Matrix::operator+(Matrix &B)
{
    // matrix plus operation +: A+B = C
    if(B.Dimension() != this->Dimension()){
        std::cout<<"Error: Matrix not match in + ops."<<std::endl;
        exit(0);
    }

    Matrix C(B.Dimension());
#ifdef MULTITHREAD_MATRIX
    auto jobs = DivideJobs(this->size(), B[0].size(), NCORES);
    std::vector<std::thread> th;
    for(auto &i: jobs)
    {
        th.push_back( std::thread( [this, &B, &C, &i](){
                    _hadamard_ComputeSection(HadamardOps::plus, B, C, i.first.first, i.first.second, i.second.first, i.second.second);
                    }
                    ) 
                );
    }
    for(auto &j: th){
        j.join();
    }
#else
    _hadamard_ComputeSection(HadamardOps::plus, B, C, 0, B.Dimension().first, 0, B.Dimension().second);
#endif
    return C;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x17a6a
movq %rax, %r12
movq %rdx, %r13
movq %r15, %rdi
callq 0x17a6a
cmpq %rax, %r12
jne 0x17d41
cmpq %rdx, %r13
jne 0x17d41
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1776a
movq %r14, %rdi
callq 0x17a6a
andq $0x0, (%rsp)
movq %rdx, 0x8(%rsp)
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x17d76
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x1b290(%rip), %rdi     # 0x32fd8
leaq 0xc306(%rip), %rsi      # 0x24055
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
movq %rax, %r14
movq %rbx, %rdi
callq 0x17a9a
movq %r14, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::_hadamard_ComputeSection(HadamardOps, Matrix&, Matrix&, unsigned long, unsigned long, unsigned long, unsigned long)
void Matrix::_hadamard_ComputeSection(HadamardOps op, Matrix &B, Matrix &C, size_t r1, size_t r2, size_t c1, size_t c2)
{
    // compute a region inside C for hadamard operation
    for(size_t i=r1; i<r2; i++)
    {
        for(size_t j=c1; j<c2; j++){
            if(op == HadamardOps::plus)
                C[i][j] = (*this)[i][j] + B[i][j];
            else if (op == HadamardOps::subtract)
                C[i][j] = (*this)[i][j] - B[i][j];
            else if (op == HadamardOps::multiply)
                C[i][j] = (*this)[i][j] * B[i][j];
            else if (op == HadamardOps::divide)
                C[i][j] = (*this)[i][j] / B[i][j];
            else
                std::cout<<"Error: not supported hadamard operation."<<std::endl;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x8(%rsp)
movq %r8, %rbp
movl %esi, %r15d
movq 0x68(%rsp), %r14
movl %esi, %r13d
leaq 0xc1be(%rip), %rbx      # 0x23f5c
movq %rdi, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x60(%rsp), %r12
cmpq 0x8(%rsp), %rbp
jae 0x17ea0
cmpq %r14, %r12
jae 0x17e98
cmpl $0x3, %r15d
ja 0x17e6c
movslq (%rbx,%r13,4), %rax
addq %rbx, %rax
jmpq *%rax
movq (%rdi), %rax
imulq $0x18, %rbp, %rsi
movq (%rax,%rsi), %rax
movsd (%rax,%r12,8), %xmm0
movq (%rdx), %rax
movq (%rax,%rsi), %rax
addsd (%rax,%r12,8), %xmm0
jmp 0x17e57
movq (%rdi), %rax
imulq $0x18, %rbp, %rsi
movq (%rax,%rsi), %rax
movsd (%rax,%r12,8), %xmm0
movq (%rdx), %rax
movq (%rax,%rsi), %rax
mulsd (%rax,%r12,8), %xmm0
jmp 0x17e57
movq (%rdi), %rax
imulq $0x18, %rbp, %rsi
movq (%rax,%rsi), %rax
movsd (%rax,%r12,8), %xmm0
movq (%rdx), %rax
movq (%rax,%rsi), %rax
divsd (%rax,%r12,8), %xmm0
jmp 0x17e57
movq (%rdi), %rax
imulq $0x18, %rbp, %rsi
movq (%rax,%rsi), %rax
movsd (%rax,%r12,8), %xmm0
movq (%rdx), %rax
movq (%rax,%rsi), %rax
subsd (%rax,%r12,8), %xmm0
movq (%rcx), %rax
movq (%rax,%rsi), %rax
movsd %xmm0, (%rax,%r12,8)
incq %r12
jmp 0x17dbd
movq 0x1b165(%rip), %rdi     # 0x32fd8
leaq 0xc263(%rip), %rsi      # 0x240dd
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
jmp 0x17e64
incq %rbp
jmp 0x17dad
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::_scalar_ComputeSection(HadamardOps, double, Matrix&, unsigned long, unsigned long, unsigned long, unsigned long)
void Matrix::_scalar_ComputeSection(HadamardOps op, const double v, Matrix &C, size_t r1, size_t r2, size_t c1, size_t c2)
{
    // compute a region inside C for scalar operation
    for(size_t i=r1; i<r2; i++)
    {
        for(size_t j=c1; j<c2; j++){
            if(op == HadamardOps::plus)
                C[i][j] = (*this)[i][j] + v;
            else if (op == HadamardOps::subtract)
                C[i][j] = (*this)[i][j] - v;
            else if (op == HadamardOps::multiply)
                C[i][j] = (*this)[i][j] * v;
            else if (op == HadamardOps::divide)
                if( v != 0)
                    C[i][j] = (*this)[i][j] / v;
                else {
                    std::cout<<"Error: dividing a Matrix by 0"<<std::endl;
                }
            else
                std::cout<<"Error: not supported hadamard operation."<<std::endl;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq %rcx, %r15
movl %esi, %ebp
movq %rdi, %r13
movq 0x60(%rsp), %rsi
movl %ebp, %ebx
leaq 0xbe06(%rip), %r14      # 0x23f6c
movq %rdx, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %r12
cmpq 0x18(%rsp), %r15
jb 0x1824f
jmp 0x18260
cmpl $0x3, %ebp
ja 0x18211
movslq (%r14,%rbx,4), %rax
addq %r14, %rax
jmpq *%rax
movq (%r13), %rax
imulq $0x18, %r15, %rcx
movq (%rax,%rcx), %rax
movsd (%rax,%r12,8), %xmm1
addsd %xmm0, %xmm1
jmp 0x18202
movq (%r13), %rax
imulq $0x18, %r15, %rcx
movq (%rax,%rcx), %rax
movsd (%rax,%r12,8), %xmm1
mulsd %xmm0, %xmm1
jmp 0x18202
ucomisd 0x9350(%rip), %xmm0     # 0x21520
jne 0x181d4
jnp 0x18221
movq (%r13), %rax
imulq $0x18, %r15, %rcx
movq (%rax,%rcx), %rax
movsd (%rax,%r12,8), %xmm1
divsd %xmm0, %xmm1
jmp 0x18202
movq (%r13), %rax
imulq $0x18, %r15, %rcx
movq (%rax,%rcx), %rax
movsd (%rax,%r12,8), %xmm1
subsd %xmm0, %xmm1
movq (%rdx), %rax
movq (%rax,%rcx), %rax
movsd %xmm1, (%rax,%r12,8)
jmp 0x1824c
movq 0x1adc0(%rip), %rdi     # 0x32fd8
leaq 0xbebe(%rip), %rsi      # 0x240dd
jmp 0x1822f
movq 0x1adb0(%rip), %rdi     # 0x32fd8
leaq 0xbed7(%rip), %rsi      # 0x24106
callq 0x4240
movq %rax, %rdi
callq 0x4130
movq 0x60(%rsp), %rsi
movsd 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rdx
incq %r12
cmpq %rsi, %r12
jb 0x18186
incq %r15
jmp 0x18171
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop