LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x19d75
movl %eax, 0x8(%rdi)
addq $0x58, %rdi
movq %rdi, %rax
retq
pushq %rax
movq 0x1d25b(%rip), %rdi     # 0x36fd8
leaq 0xfe83(%rip), %rsi      # 0x29c07
callq 0x4260
movq %rax, %rdi
callq 0x4100
xorl %edi, %edi
callq 0x4290
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Layer.cpp
// Function: operator<<(std::ostream&, LayerType const&)
std::ostream & operator<<(std::ostream &os, const LayerType &t)
{
    if(t == LayerType::fullyConnected)
        os<<"____layer_type=fully_connected____";
    else if(t == LayerType::cnn)
        os<<"____layer_type=cnn____";
    else if(t == LayerType::pooling)
        os<<"____layer_type=pooling____";
    else if(t == LayerType::input)
        os<<"____layer_type=input____";
    else if(t == LayerType::output)
        os<<"____layer_type=output____";
    else if(t == LayerType::Undefined)
        os<<"____layer_type=undefined____";
    return os;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
cmpq $0x5, %rax
ja 0x1a11e
leaq 0xfd39(%rip), %rcx      # 0x29df4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xfd58(%rip), %rsi      # 0x29e23
movl $0x22, %edx
jmp 0x1a116
leaq 0xfdb8(%rip), %rsi      # 0x29e91
movl $0x19, %edx
jmp 0x1a116
leaq 0xfd76(%rip), %rsi      # 0x29e5d
movl $0x1a, %edx
jmp 0x1a116
leaq 0xfd83(%rip), %rsi      # 0x29e78
movl $0x18, %edx
jmp 0x1a116
leaq 0xfd43(%rip), %rsi      # 0x29e46
movl $0x16, %edx
jmp 0x1a116
leaq 0xfd9a(%rip), %rsi      # 0x29eab
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x4280
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Layer.cpp
// Function: operator<<(std::ostream&, ActuationFuncType const&)
std::ostream & operator<<(std::ostream &os, const ActuationFuncType & t)
{
    if(t == ActuationFuncType::Sigmoid)
        os<<"Sigmoid_Actuation_Func";
    else if(t == ActuationFuncType::SoftMax)
        os<<"Softmax_Actuation_Func";
    else if(t == ActuationFuncType::Tanh)
        os<<"Tanh_Actuation_Func";
    else if(t == ActuationFuncType::Relu)
        os<<"Relu_Actuation_Func";
    else 
        os<<"Undefined_Actuation_Func";
    return os;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
cmpq $0x3, %rax
ja 0x1a16d
leaq 0xfcd6(%rip), %rcx      # 0x29e0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xfd82(%rip), %rsi      # 0x29ec8
jmp 0x1a166
leaq 0xfda7(%rip), %rsi      # 0x29ef6
jmp 0x1a158
leaq 0xfdb2(%rip), %rsi      # 0x29f0a
movl $0x13, %edx
jmp 0x1a179
leaq 0xfd79(%rip), %rsi      # 0x29edf
movl $0x16, %edx
jmp 0x1a179
leaq 0xfdaa(%rip), %rsi      # 0x29f1e
movl $0x18, %edx
movq %rbx, %rdi
callq 0x4280
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Layer.cpp
// Function: operator<<(std::ostream&, LayerDimension const&)
std::ostream & operator<<(std::ostream &os, const LayerDimension &dim)
{
    if(dim == LayerDimension::_1D)
        os<<"__LayerDimension=_1D__";
    else if(dim == LayerDimension::_2D)
        os<<"__LayerDimension=_2D__";
    else if(dim == LayerDimension::Undefined)
        os<<"__LayerDimension=Undefined__";
    return os;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
cmpl $0x2, %eax
je 0x1a1b1
cmpl $0x1, %eax
je 0x1a1a3
testl %eax, %eax
jne 0x1a1c5
leaq 0xfd96(%rip), %rsi      # 0x29f37
jmp 0x1a1aa
leaq 0xfda4(%rip), %rsi      # 0x29f4e
movl $0x16, %edx
jmp 0x1a1bd
leaq 0xfdad(%rip), %rsi      # 0x29f65
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x4280
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rdi, %rbx
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x1a32c
movq %rsi, %r14
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorl %edx, %edx
leaq 0x3f(%rcx), %rbp
movq %rdx, (%rsp)
leaq (%rdx,%rdx,4), %rcx
movq 0x10(%rax,%rcx,8), %rdx
movl 0x18(%rax,%rcx,8), %esi
subq (%rax,%rcx,8), %rdx
shlq $0x3, %rdx
addq %rsi, %rdx
je 0x1a2d9
movq (%rsp), %rcx
leaq (,%rcx,8), %rcx
leaq (%rcx,%rcx,4), %r12
xorl %r13d, %r13d
movq (%rbx), %rcx
movq -0x18(%rcx), %rdx
leaq (%rbx,%rdx), %r15
cmpb $0x0, 0xe1(%rbx,%rdx)
jne 0x1a25d
movq %r15, %rdi
movl $0x20, %esi
callq 0x4250
movb $0x1, 0xe1(%r15)
movq (%rbx), %rcx
movq (%r14), %rax
movb $0x20, 0xe0(%r15)
movq -0x18(%rcx), %rcx
movq $0x4, 0x10(%rbx,%rcx)
leaq 0x3f(%r13), %rcx
testq %r13, %r13
cmovnsq %r13, %rcx
sarq $0x6, %rcx
shlq $0x3, %rcx
addq (%rax,%r12), %rcx
movq %r13, %rax
andq %rbp, %rax
xorl %edx, %edx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
cmpq %rsi, %rax
setbe %dl
movq -0x8(%rcx,%rdx,8), %rax
xorl %esi, %esi
btq %r13, %rax
setb %sil
movq %rbx, %rdi
callq 0x4370
incq %r13
movq (%r14), %rax
movq 0x10(%rax,%r12), %rcx
movl 0x18(%rax,%r12), %edx
subq (%rax,%r12), %rcx
leaq (%rdx,%rcx,8), %rcx
cmpq %rcx, %r13
jb 0x1a22d
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq (%rsp), %rdx
incq %rdx
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rsi, %rcx
cmpq %rcx, %rdx
jb 0x1a1f8
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_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movq -0x18(%rax), %rcx
leaq (%rdi,%rcx), %r15
cmpb $0x0, 0xe1(%rdi,%rcx)
jne 0x1a379
movq %r15, %rdi
movl $0x20, %esi
callq 0x4250
movb $0x1, 0xe1(%r15)
movq (%rbx), %rax
movb $0x20, 0xe0(%r15)
movq -0x18(%rax), %rax
movq $0x4, 0x10(%rbx,%rax)
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4180
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
leaq (%r15,%rcx), %r12
cmpb $0x0, 0xe1(%r15,%rcx)
jne 0x1a3cb
movq %r12, %rdi
movl $0x20, %esi
callq 0x4250
movb $0x1, 0xe1(%r12)
movq (%r15), %rax
movb $0x20, 0xe0(%r12)
movq -0x18(%rax), %rax
movq $0x4, 0x10(%r15,%rax)
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x4180
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
leaq (%r15,%rcx), %r12
cmpb $0x0, 0xe1(%r15,%rcx)
jne 0x1a41f
movq %r12, %rdi
movl $0x20, %esi
callq 0x4250
movb $0x1, 0xe1(%r12)
movq (%r15), %rax
movb $0x20, 0xe0(%r12)
movq -0x18(%rax), %rax
movq $0x4, 0x10(%r15,%rax)
movq 0x10(%r14), %rsi
movq %r15, %rdi
callq 0x4180
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xfaed(%rip), %rsi      # 0x29f82
movl $0x33, %edx
callq 0x4280
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq 0x8(%r14), %rax
cmpq (%r14), %rax
je 0x1a599
xorl %r15d, %r15d
movq %rsp, %r12
xorl %r13d, %r13d
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x11421(%rip), %rsi     # 0x2b90c
callq 0x4280
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4180
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %rbp, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq (%r14), %rsi
addq %r15, %rsi
movq %r12, %rdi
callq 0x1aa3e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1ba81
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %rbp, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq %r12, %rdi
callq 0x1abf2
incq %r13
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x18, %r15
cmpq %rax, %r13
jb 0x1a4dc
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 0x1abf2
movq %rbx, %rdi
callq 0x43e0
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: operator<<(std::ostream&, std::pair<unsigned long, unsigned long> const&)
std::ostream &operator<<(std::ostream &os, const std::pair<size_t, size_t> &d)
{
    os<<std::setfill(' ')<<std::setw(6)<<d.first
        <<std::setfill(' ')<<std::setw(6)<<d.second
        <<std::endl;
    return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movq -0x18(%rax), %rcx
leaq (%rdi,%rcx), %r15
cmpb $0x0, 0xe1(%rdi,%rcx)
jne 0x1a635
movq %r15, %rdi
movl $0x20, %esi
callq 0x4250
movb $0x1, 0xe1(%r15)
movq (%rbx), %rax
movb $0x20, 0xe0(%r15)
movq -0x18(%rax), %rax
movq $0x6, 0x10(%rbx,%rax)
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4180
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
leaq (%r15,%rcx), %r12
cmpb $0x0, 0xe1(%r15,%rcx)
jne 0x1a687
movq %r12, %rdi
movl $0x20, %esi
callq 0x4250
movb $0x1, 0xe1(%r12)
movq (%r15), %rax
movb $0x20, 0xe0(%r12)
movq -0x18(%rax), %rax
movq $0x6, 0x10(%r15,%rax)
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x4180
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movq (%rsi), %rbx
movq %rsi, 0x18(%rsp)
movq 0x8(%rsi), %r15
movq (%rbx), %rbp
movq 0x8(%rbx), %r13
movq %r13, %r14
subq %rbp, %r14
movq %r14, 0x30(%rsp)
sarq $0x3, %r14
callq 0x1e8dc
leaq 0x50(%rsp), %rdx
xorl %eax, %eax
movq %rax, (%rdx)
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movq %r14, %rsi
movq %r12, 0x10(%rsp)
callq 0x1e9a2
movq %r15, 0x20(%rsp)
subq %rbx, %r15
movq %r15, 0x28(%rsp)
movq %r15, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r15
leaq 0x38(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x1e91e
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1aae4
callq 0x4230
movq 0x10(%rsp), %r9
movq (%r9), %rax
cmpq %rbx, 0x20(%rsp)
je 0x1ab45
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
cmpq $0x1, %r14
adcq $0x0, %r14
cmpq $0x1, %r15
adcq $0x0, %r15
xorl %edx, %edx
cmpq %rbp, %r13
je 0x1ab3d
leaq (,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rdi
movq (%rcx,%rdi), %rsi
movq (%rax,%rdi), %rdi
xorl %r8d, %r8d
movsd (%rsi,%r8,8), %xmm0
movsd %xmm0, (%rdi,%r8,8)
incq %r8
cmpq %r8, %r14
jne 0x1ab29
incq %rdx
cmpq %r15, %rdx
jne 0x1ab0d
movq 0x8(%r9), %rcx
subq %rax, %rcx
cmpq 0x28(%rsp), %rcx
jne 0x1ab70
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq 0x30(%rsp), %rcx
jne 0x1ab70
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf46d(%rip), %rdi      # 0x29fe4
leaq 0xf479(%rip), %rsi      # 0x29ff7
leaq 0xf481(%rip), %rcx      # 0x2a006
movl $0x85, %edx
callq 0x4160
movq %rax, %r14
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1aba6
callq 0x4230
jmp 0x1aba6
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x14578
movq %r14, %rdi
callq 0x43e0
// File: /workspace/github_cpp_makefile_star2_O3/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 (%rsi), %rcx
movq 0x8(%rsi), %rsi
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
subq %rcx, %rsi
je 0x1ac8b
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
je 0x1ac8b
movq %rdi, %r15
sarq $0x3, %rdx
imulq %r12, %rdx
movq 0x8(%rcx), %rdi
subq (%rcx), %rdi
sarq $0x3, %rdi
cmpq %rdx, %rdi
jne 0x1ace7
sarq $0x3, %rsi
imulq %r12, %rsi
movq 0x8(%rax), %rdx
subq (%rax), %rdx
sarq $0x3, %rdx
movq %r15, %rdi
callq 0x1a76e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1adbe
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1c346(%rip), %r15     # 0x36fd8
leaq 0xf38c(%rip), %rsi      # 0x2a025
movq %r15, %rdi
callq 0x4260
leaq 0xf387(%rip), %rsi      # 0x2a02f
movq %rax, %rdi
callq 0x4260
movq %rax, %rdi
callq 0x4100
leaq 0x10287(%rip), %rsi     # 0x2af46
movq %r15, %rdi
callq 0x4260
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x3, %rsi
imulq %r12, %rsi
movq %rax, %rdi
callq 0x4090
leaq 0xf35c(%rip), %rsi      # 0x2a041
jmp 0x1ad40
movq 0x1c2ea(%rip), %r15     # 0x36fd8
leaq 0xf330(%rip), %rsi      # 0x2a025
movq %r15, %rdi
callq 0x4260
leaq 0xf372(%rip), %rsi      # 0x2a076
movq %rax, %rdi
callq 0x4260
movq %rax, %rdi
callq 0x4100
leaq 0x1022b(%rip), %rsi     # 0x2af46
movq %r15, %rdi
callq 0x4260
movq (%r14), %rcx
movq 0x8(%rcx), %rsi
subq (%rcx), %rsi
sarq $0x3, %rsi
movq %rax, %rdi
callq 0x4090
leaq 0xf350(%rip), %rsi      # 0x2a090
movq %rax, %rdi
callq 0x4260
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
imulq %r12, %rsi
movq %rax, %rdi
callq 0x4090
leaq 0xf2f9(%rip), %rsi      # 0x2a05f
movq %rax, %rdi
callq 0x4260
movq %rax, %rdi
callq 0x4100
xorl %edi, %edi
callq 0x4290
movq %rax, %rbx
movq %r15, %rdi
callq 0x1e8dc
movq %r15, %rdi
callq 0x14578
movq %rbx, %rdi
callq 0x43e0
// File: /workspace/github_cpp_makefile_star2_O3/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), %r8
movq 0x8(%rdx), %rax
subq %r8, %rax
movq 0x8(%rdi), %rcx
subq (%rdi), %rcx
cmpq %rcx, %rax
jne 0x1ae11
movq 0x8(%r8), %rcx
subq (%r8), %rcx
movq (%rsi), %r8
movq 0x8(%r8), %r9
subq (%r8), %r9
cmpq %r9, %rcx
jne 0x1ae11
sarq $0x3, %rcx
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r8 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r8
movq %rcx, (%rsp)
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x1b86e
popq %rax
retq
movq 0x1c1c0(%rip), %rdi     # 0x36fd8
leaq 0xf258(%rip), %rsi      # 0x2a077
callq 0x4260
movq %rax, %rdi
callq 0x4100
xorl %edi, %edi
callq 0x4290
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq (%rdx), %rax
movq 0x8(%rdx), %rsi
subq %rax, %rsi
movq (%r14), %rcx
movq 0x8(%r14), %rdx
subq %rcx, %rdx
cmpq %rdx, %rsi
jne 0x1af13
movq 0x8(%rax), %rdx
subq (%rax), %rdx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
cmpq %rax, %rdx
jne 0x1af13
movq %rdi, %rbx
sarq $0x3, %rdx
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r12, %rsi
callq 0x1a800
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
je 0x1af04
sarq $0x3, %rcx
imulq %r12, %rcx
movq (%rax), %rdx
movq 0x8(%rax), %rsi
movq %rsi, %rdi
subq %rdx, %rdi
sarq $0x3, %rdi
movq (%r14), %r8
movq (%rbx), %r9
xorl %r10d, %r10d
cmpq %rdx, %rsi
je 0x1aefc
leaq (,%r10,8), %r11
leaq (%r11,%r11,2), %r15
movq (%r8,%r15), %r11
movq (%rax,%r15), %r14
movq (%r9,%r15), %r15
xorl %r12d, %r12d
movsd (%r11,%r12,8), %xmm0
addsd (%r14,%r12,8), %xmm0
movsd %xmm0, (%r15,%r12,8)
incq %r12
cmpq %r12, %rdi
jne 0x1aee2
incq %r10
cmpq %rcx, %r10
jne 0x1aec2
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1c0be(%rip), %rdi     # 0x36fd8
leaq 0xf190(%rip), %rsi      # 0x2a0b1
callq 0x4260
movq %rax, %rdi
callq 0x4100
xorl %edi, %edi
callq 0x4290
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movq %r9, 0x10(%rsp)
movq %r8, (%rsp)
cmpq %r9, %r8
jae 0x1b0dc
movq %rdx, %r10
movq 0x78(%rsp), %r8
movq 0x70(%rsp), %rdx
subq %rdx, %r8
leaq (,%rdx,8), %r14
movl %esi, %r12d
leaq 0xf040(%rip), %rbx      # 0x29fb8
movq %rdi, 0x30(%rsp)
movl %esi, 0xc(%rsp)
movq %rcx, 0x28(%rsp)
movq %r10, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq 0x70(%rsp), %rax
cmpq %rax, 0x78(%rsp)
jbe 0x1b0c6
movq (%rsp), %rax
leaq (,%rax,8), %rax
leaq (%rax,%rax,2), %r13
xorl %r15d, %r15d
cmpl $0x3, %esi
ja 0x1b069
movslq (%rbx,%r12,4), %rax
addq %rbx, %rax
jmpq *%rax
movq (%rdi), %rax
movq (%rax,%r13), %rax
addq %r14, %rax
movsd (%rax,%r15,8), %xmm0
movq (%r10), %rax
movq (%rax,%r13), %rax
addq %r14, %rax
addsd (%rax,%r15,8), %xmm0
jmp 0x1b04b
movq (%rdi), %rax
movq (%rax,%r13), %rax
addq %r14, %rax
movsd (%rax,%r15,8), %xmm0
movq (%r10), %rax
movq (%rax,%r13), %rax
addq %r14, %rax
mulsd (%rax,%r15,8), %xmm0
jmp 0x1b04b
movq (%rdi), %rax
movq (%rax,%r13), %rax
addq %r14, %rax
movsd (%rax,%r15,8), %xmm0
movq (%r10), %rax
movq (%rax,%r13), %rax
addq %r14, %rax
divsd (%rax,%r15,8), %xmm0
jmp 0x1b04b
movq (%rdi), %rax
movq (%rax,%r13), %rax
addq %r14, %rax
movsd (%rax,%r15,8), %xmm0
movq (%r10), %rax
movq (%rax,%r13), %rax
addq %r14, %rax
subsd (%rax,%r15,8), %xmm0
movq (%rcx), %rax
movq (%rax,%r13), %rax
addq %r14, %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
cmpq %r15, %r8
jne 0x1afb3
jmp 0x1b0c6
movl $0x28, %edx
movq 0x1bf63(%rip), %rbp     # 0x36fd8
movq %rbp, %rdi
leaq 0xf0ba(%rip), %rsi      # 0x2a139
callq 0x4280
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %rbp, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq 0x18(%rsp), %r8
movq 0x30(%rsp), %rdi
movl 0xc(%rsp), %esi
movq 0x20(%rsp), %r10
movq 0x28(%rsp), %rcx
jmp 0x1b05b
movq (%rsp), %rdx
incq %rdx
movq %rdx, (%rsp)
cmpq 0x10(%rsp), %rdx
jne 0x1af90
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::operator+(double)
Matrix Matrix::operator+(double v)
{
    // scalar plus operation: A+v = C
    Matrix C(this->Dimension());
#ifdef MULTITHREAD_MATRIX
    auto jobs = DivideJobs(this->size(), (*this)[0].size(), NCORES);
    std::vector<std::thread> th;
    for(auto &i: jobs)
    {
        th.push_back( std::thread( [this, v, &C, &i](){
                    _scalar_ComputeSection(HadamardOps::plus, v, C, i.first.first, i.first.second, i.second.first, i.second.second);
                    }
                    ) 
                );
    }
    for(auto &j: th){
        j.join();
    }
#else
    _scalar_ComputeSection(HadamardOps::plus, v, C, 0, (*this).Dimension().first, 0, (*this).Dimension().second);
#endif
    return C;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rsi
subq %rax, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rsi
movq 0x8(%rax), %rdx
subq (%rax), %rdx
sarq $0x3, %rdx
callq 0x1a800
movsd 0x8(%rsp), %xmm1
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
je 0x1b4a0
sarq $0x3, %rcx
imulq %r15, %rcx
movq (%rax), %rdx
movq 0x8(%rax), %rsi
movq %rsi, %rdi
subq %rdx, %rdi
sarq $0x3, %rdi
movq (%rbx), %r8
xorl %r9d, %r9d
cmpq %rdx, %rsi
je 0x1b498
leaq (,%r9,8), %r10
leaq (%r10,%r10,2), %r11
movq (%rax,%r11), %r10
movq (%r8,%r11), %r11
xorl %r14d, %r14d
movsd (%r10,%r14,8), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%r11,%r14,8)
incq %r14
cmpq %r14, %rdi
jne 0x1b480
incq %r9
cmpq %rcx, %r9
jne 0x1b464
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movq %r9, 0x8(%rsp)
movq %r8, 0x30(%rsp)
movq %rcx, (%rsp)
cmpq %r8, %rcx
jae 0x1b640
movl %esi, %ebp
movq 0x70(%rsp), %r14
movq 0x8(%rsp), %rax
subq %rax, %r14
leaq (,%rax,8), %r15
movl %esi, %esi
leaq 0xead5(%rip), %r8       # 0x29fc8
movq %rdx, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x70(%rsp), %rax
cmpq 0x8(%rsp), %rax
jbe 0x1b62a
movq (%rsp), %rax
leaq (,%rax,8), %rax
leaq (%rax,%rax,2), %r13
xorl %ebx, %ebx
cmpl $0x3, %ebp
ja 0x1b5a7
movslq (%r8,%rsi,4), %rax
addq %r8, %rax
jmpq *%rax
movq (%rdi), %rax
movq (%rax,%r13), %rax
addq %r15, %rax
movsd (%rax,%rbx,8), %xmm1
addsd %xmm0, %xmm1
jmp 0x1b596
movq (%rdi), %rax
movq (%rax,%r13), %rax
addq %r15, %rax
movsd (%rax,%rbx,8), %xmm1
mulsd %xmm0, %xmm1
jmp 0x1b596
ucomisd 0xc026(%rip), %xmm0     # 0x27590
jne 0x1b56e
jnp 0x1b5bf
movq (%rdi), %rax
movq (%rax,%r13), %rax
addq %r15, %rax
movsd (%rax,%rbx,8), %xmm1
divsd %xmm0, %xmm1
jmp 0x1b596
movq (%rdi), %rax
movq (%rax,%r13), %rax
addq %r15, %rax
movsd (%rax,%rbx,8), %xmm1
subsd %xmm0, %xmm1
movq (%rdx), %rax
movq (%rax,%r13), %rax
addq %r15, %rax
movsd %xmm1, (%rax,%rbx,8)
jmp 0x1b61e
movl $0x28, %edx
movq 0x1ba25(%rip), %r12     # 0x36fd8
movq %r12, %rdi
leaq 0xeb7c(%rip), %rsi      # 0x2a139
jmp 0x1b5d5
movl $0x1d, %edx
movq 0x1ba0d(%rip), %r12     # 0x36fd8
movq %r12, %rdi
leaq 0xeb8d(%rip), %rsi      # 0x2a162
callq 0x4280
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
leaq 0xe9bf(%rip), %r8       # 0x29fc8
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movq 0x28(%rsp), %rdx
incq %rbx
cmpq %rbx, %r14
jne 0x1b52a
movq (%rsp), %rcx
incq %rcx
movq %rcx, (%rsp)
cmpq 0x30(%rsp), %rcx
jne 0x1b508
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::operator-(double)
Matrix Matrix::operator-(double v)
{
    // scalar subtraction operation: A-v = C
    Matrix C(this->Dimension());
#ifdef MULTITHREAD_MATRIX
    auto jobs = DivideJobs(this->size(), (*this)[0].size(), NCORES);
    std::vector<std::thread> th;
    for(auto &i: jobs)
    {
        th.push_back( std::thread( [this, v, &C, &i](){
                    _scalar_ComputeSection(HadamardOps::subtract, v, C, i.first.first, i.first.second, i.second.first, i.second.second);
                    }
                    ) 
                );
    }
    for(auto &j: th){
        j.join();
    }
#else
    _scalar_ComputeSection(HadamardOps::subtract, v, C, 0, (*this).Dimension().first, 0, (*this).Dimension().second);
#endif
    return C;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rsi
subq %rax, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rsi
movq 0x8(%rax), %rdx
subq (%rax), %rdx
sarq $0x3, %rdx
callq 0x1a800
movsd 0x8(%rsp), %xmm1
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
je 0x1b6fe
sarq $0x3, %rcx
imulq %r15, %rcx
movq (%rax), %rdx
movq 0x8(%rax), %rsi
movq %rsi, %rdi
subq %rdx, %rdi
sarq $0x3, %rdi
movq (%rbx), %r8
xorl %r9d, %r9d
cmpq %rdx, %rsi
je 0x1b6f6
leaq (,%r9,8), %r10
leaq (%r10,%r10,2), %r11
movq (%rax,%r11), %r10
movq (%r8,%r11), %r11
xorl %r14d, %r14d
movsd (%r10,%r14,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%r11,%r14,8)
incq %r14
cmpq %r14, %rdi
jne 0x1b6de
incq %r9
cmpq %rcx, %r9
jne 0x1b6c2
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::operator/(double)
Matrix Matrix::operator/(double v)
{
    // scalar division operation: A/v = C
    Matrix C(this->Dimension());
#ifdef MULTITHREAD_MATRIX
    auto jobs = DivideJobs(this->size(), (*this)[0].size(), NCORES);
    std::vector<std::thread> th;
    for(auto &i: jobs)
    {
        th.push_back( std::thread( [this, v, &C, &i](){
                    _scalar_ComputeSection(HadamardOps::divide, v, C, i.first.first, i.first.second, i.second.first, i.second.second);
                    }
                    ) 
                );
    }
    for(auto &j: th){
        j.join();
    }
#else
    _scalar_ComputeSection(HadamardOps::divide, v, C, 0, (*this).Dimension().first, 0, (*this).Dimension().second);
#endif
    return C;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rsi
subq %rax, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rsi
movq 0x8(%rax), %rdx
subq (%rax), %rdx
sarq $0x3, %rdx
callq 0x1a800
movq (%r14), %rax
movq 0x8(%r14), %r8
subq %rax, %r8
sarq $0x3, %r8
imulq %r15, %r8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
movq %rcx, (%rsp)
movq %r14, %rdi
movl $0x3, %esi
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x1b4ae
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x1e8dc
movq %rbx, %rdi
callq 0x14578
movq %r14, %rdi
callq 0x43e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::_mul_ComputeSection(Matrix&, Matrix&, unsigned long, unsigned long, unsigned long, unsigned long)
void Matrix::_mul_ComputeSection(Matrix &B, Matrix &C, size_t r1, size_t r2, size_t c1, size_t c2)
{
    // compute a section of C
    if(r1 >= r2 || c1 >= c2) {
        return;
    }
    if( (int)r1<0 || r2>this->size() || (int)c1<0 || c2>B[0].size()) {
        std::cout<<"Error: matrix out of range."<<std::endl;
        exit(0);
    }
    if(C.size() != this->size() || C[0].size() != B[0].size() ) {
        std::cout<<"Error: matrix not match."<<std::endl;
        exit(0);
    }

    for(size_t i=r1; i<r2;i++){
        for(size_t j=c1;j<c2;j++){
            C[i][j] = _mul_ComputeElement(B, i, j);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x50(%rsp), %rax
movq %r8, 0x8(%rsp)
cmpq %r8, %rcx
setae %r11b
movq %r9, 0x10(%rsp)
cmpq %rax, %r9
setae %r10b
orb %r11b, %r10b
jne 0x1b99f
testl %ecx, %ecx
js 0x1b9ae
cmpl $0x0, 0x10(%rsp)
js 0x1b9ae
movq (%rdi), %r8
movq 0x8(%rdi), %r11
subq %r8, %r11
movq %r11, %rdi
sarq $0x3, %rdi
movabsq $-0x5555555555555555, %r10 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %r10
cmpq 0x8(%rsp), %r10
jb 0x1b9ae
movq (%rsi), %rsi
movq 0x8(%rsi), %r10
subq (%rsi), %r10
movq %r10, %rdi
sarq $0x3, %rdi
cmpq %rax, %rdi
jb 0x1b9ae
movq (%rdx), %rdi
movq 0x8(%rdx), %rdx
subq %rdi, %rdx
cmpq %r11, %rdx
jne 0x1b9be
movq 0x8(%rdi), %rdx
subq (%rdi), %rdx
cmpq %r10, %rdx
jne 0x1b9be
movq (%r8), %rdx
movq 0x8(%r8), %r11
movq %r11, %rbx
subq %rdx, %rbx
sarq $0x3, %rbx
cmpq $0x1, %rbx
adcq $0x0, %rbx
leaq (,%rcx,8), %r10
leaq (%r10,%r10,2), %r10
leaq (%r8,%r10), %r14
movq (%rdi,%r10), %r15
movq 0x10(%rsp), %r12
cmpq %rdx, %r11
je 0x1b983
movq (%r14), %r13
xorpd %xmm0, %xmm0
movq %rsi, %rbp
xorl %r10d, %r10d
movsd (%r13,%r10,8), %xmm1
movq (%rbp), %r9
mulsd (%r9,%r12,8), %xmm1
addsd %xmm1, %xmm0
incq %r10
addq $0x18, %rbp
cmpq %r10, %rbx
jne 0x1b960
jmp 0x1b987
xorpd %xmm0, %xmm0
movsd %xmm0, (%r15,%r12,8)
incq %r12
cmpq %rax, %r12
jne 0x1b94e
incq %rcx
cmpq 0x8(%rsp), %rcx
jne 0x1b935
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1b623(%rip), %rdi     # 0x36fd8
leaq 0xe7c4(%rip), %rsi      # 0x2a180
jmp 0x1b9cc
movq 0x1b613(%rip), %rdi     # 0x36fd8
leaq 0xe7d0(%rip), %rsi      # 0x2a19c
callq 0x4260
movq %rax, %rdi
callq 0x4100
xorl %edi, %edi
callq 0x4290
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::_mul_ComputeElement(Matrix&, unsigned long, unsigned long)
double Matrix::_mul_ComputeElement(Matrix &B, size_t r, size_t c)
{
    // compute an element in the result matrix, 
    // B is multiplied to this matrix: AxB = C
    double s = 0;
    for(size_t i=0;i<(*this)[0].size();i++){
        s += (*this)[r][i] * B[i][c];
    }
    return s;
}

// Assembly:
movq (%rdi), %rdi
movq 0x8(%rdi), %rax
subq (%rdi), %rax
je 0x1ba28
sarq $0x3, %rax
leaq (%rdx,%rdx,2), %rdx
movq (%rdi,%rdx,8), %rdx
movq (%rsi), %rsi
cmpq $0x1, %rax
adcq $0x0, %rax
xorpd %xmm0, %xmm0
xorl %edi, %edi
movsd (%rdx,%rdi,8), %xmm1
movq (%rsi), %r8
mulsd (%r8,%rcx,8), %xmm1
addsd %xmm1, %xmm0
incq %rdi
addq $0x18, %rsi
cmpq %rdi, %rax
jne 0x1ba09
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: operator<<(std::ostream&, Matrix&)
std::ostream& operator<<(std::ostream &os, Matrix& A)
{
    // overload cout for Matrix
    for(size_t i=0;i<A.size();i++){
        os<<A[i];
    }
    return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
cmpq %rsi, 0x8(%r14)
je 0x1bad2
xorl %r15d, %r15d
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
xorl %r13d, %r13d
addq %r15, %rsi
movq %rbx, %rdi
callq 0x1badf
incq %r13
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x3, %rax
imulq %r12, %rax
addq $0x18, %r15
cmpq %rax, %r13
jb 0x1baa9
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: operator<<(std::ostream&, std::vector<double, std::allocator<double>>&)
std::ostream& operator<<(std::ostream &os, std::vector<double>& A)
{
    // overload cout for vector
    for(size_t i=0;i<A.size();i++){
        os<<std::setfill(' ')<<std::setw(18)<<std::setprecision(6)<<A[i];
    }
    os<<std::endl;
    return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x1bb6f
movq %rsi, %r14
xorl %r12d, %r12d
movq (%rbx), %rcx
movq -0x18(%rcx), %rdx
leaq (%rbx,%rdx), %r15
cmpb $0x0, 0xe1(%rbx,%rdx)
jne 0x1bb29
movq %r15, %rdi
movl $0x20, %esi
callq 0x4250
movb $0x1, 0xe1(%r15)
movq (%rbx), %rcx
movq (%r14), %rax
movb $0x20, 0xe0(%r15)
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rbx,%rdx)
movq -0x18(%rcx), %rcx
movq $0x6, 0x8(%rbx,%rcx)
movsd (%rax,%r12,8), %xmm0
movq %rbx, %rdi
callq 0x4340
incq %r12
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r12
jb 0x1baf9
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::Random()
void Matrix::Random()
{
    // fill with random numbers
    // uniform (0,1) distribution
    //std::cout<<"Filling matrix using flat (0, 1) distribution"<<std::endl;
    std::random_device rd;
    std::mt19937 mt(rd());
    //unsigned int SEED = seed;
    //std::mt19937 mt(SEED);
    //seed = seed + 1;
    std::uniform_real_distribution<double> dist(0, 1.);

    for(size_t i=0;i<__M.size();i++){
        for(size_t j=0;j<__M[0].size();j++){
            __M[i][j] = dist(mt);
        }
    }
    //std::cout<<"Fill finished."<<std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2718, %rsp           # imm = 0x2718
movq %rdi, %rbx
leaq 0x1390(%rsp), %r14
movq %r14, %rdi
callq 0x14082
movq %r14, %rdi
callq 0x42d0
movl %eax, %eax
movq %rax, 0x8(%rsp)
movl $0x1, %ecx
movq %rax, %rdx
shrq $0x1e, %rdx
xorl %eax, %edx
imull $0x6c078965, %edx, %eax # imm = 0x6C078965
addl %ecx, %eax
movq %rax, 0x8(%rsp,%rcx,8)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0x1bbde
movq $0x270, 0x1388(%rsp) # imm = 0x270
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
cmpq %rax, %rdx
je 0x1bc85
movq (%rax), %rcx
xorl %r15d, %r15d
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
leaq 0x8(%rsp), %r14
cmpq %rcx, 0x8(%rax)
je 0x1bc6f
leaq (%r15,%r15,2), %r13
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x1f01b
addsd 0xb947(%rip), %xmm0     # 0x27590
movq (%rbx), %rax
movq (%rax,%r13,8), %rcx
movsd %xmm0, (%rcx,%rbp,8)
incq %rbp
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rdx, %rbp
jb 0x1bc39
movq 0x8(%rbx), %rdx
incq %r15
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
imulq %r12, %rsi
cmpq %rsi, %r15
jb 0x1bc2d
leaq 0x1390(%rsp), %rdi
callq 0x4220
addq $0x2718, %rsp           # imm = 0x2718
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1bcc0
jmp 0x1bca8
movq %rax, %rbx
leaq 0x1390(%rsp), %rdi
callq 0x4220
movq %rbx, %rdi
callq 0x43e0
movq %rax, %rdi
callq 0x14607
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::Random(double, double)
void Matrix::Random(double min, double max)
{
    // fill with random numbers
    // uniform (0,1) distribution
    //std::cout<<"Filling matrix using flat (0, 1) distribution"<<std::endl;
    std::random_device rd;
    std::mt19937 mt(rd());
    //unsigned int SEED = seed;
    //std::mt19937 mt(SEED);
    //seed = seed+1;
    std::uniform_real_distribution<double> dist(min, max);

    for(size_t i=0;i<__M.size();i++){
        for(size_t j=0;j<__M[0].size();j++){
            __M[i][j] = dist(mt);
        }
    }
    //std::cout<<"Fill finished."<<std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2728, %rsp           # imm = 0x2728
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
movq %rdi, %rbx
leaq 0x13a0(%rsp), %r14
movq %r14, %rdi
callq 0x14082
movq %r14, %rdi
callq 0x42d0
movl %eax, %eax
movq %rax, 0x18(%rsp)
movl $0x1, %ecx
movq %rax, %rdx
shrq $0x1e, %rdx
xorl %eax, %edx
imull $0x6c078965, %edx, %eax # imm = 0x6C078965
addl %ecx, %eax
movq %rax, 0x18(%rsp,%rcx,8)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0x1bd0c
movq $0x270, 0x1398(%rsp) # imm = 0x270
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
cmpq %rax, %rdx
je 0x1bdcd
movsd 0x8(%rsp), %xmm0
subsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%rax), %rcx
xorl %r15d, %r15d
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
leaq 0x18(%rsp), %r14
cmpq %rcx, 0x8(%rax)
je 0x1bdb7
leaq (%r15,%r15,2), %r13
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x1f01b
mulsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movq (%rbx), %rax
movq (%rax,%r13,8), %rcx
movsd %xmm0, (%rcx,%rbp,8)
incq %rbp
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rdx, %rbp
jb 0x1bd7d
movq 0x8(%rbx), %rdx
incq %r15
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
imulq %r12, %rsi
cmpq %rsi, %r15
jb 0x1bd71
leaq 0x13a0(%rsp), %rdi
callq 0x4220
addq $0x2728, %rsp           # imm = 0x2728
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1be08
jmp 0x1bdf0
movq %rax, %rbx
leaq 0x13a0(%rsp), %rdi
callq 0x4220
movq %rbx, %rdi
callq 0x43e0
movq %rax, %rdi
callq 0x14607
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::RandomGaus(double, double)
void Matrix::RandomGaus(double mu, double sigma)
{
    // fill with random numbers
    // uniform (0,1) distribution
    //std::cout<<"Filling matrix using flat (0, 1) distribution"<<std::endl;
    //std::random_device rd;
    //std::mt19937 mt(rd());

    unsigned int SEED = seed;
    std::mt19937 mt(SEED);
    seed = seed + 1;

    std::normal_distribution<double> dist(mu, sigma);
    for(size_t i=0;i<__M.size();i++){
        for(size_t j=0;j<__M[0].size();j++){
            __M[i][j] = dist(mt);
        }
    }
    //std::cout<<"Fill finished."<<std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x13a8, %rsp           # imm = 0x13A8
movq %rdi, %rbx
movl 0x1b406(%rip), %eax     # 0x37230
movq %rax, 0x20(%rsp)
movl $0x1, %ecx
movq %rax, %rdx
shrq $0x1e, %rdx
xorl %eax, %edx
imull $0x6c078965, %edx, %eax # imm = 0x6C078965
addl %ecx, %eax
movq %rax, 0x20(%rsp,%rcx,8)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0x1be34
movq $0x270, 0x13a0(%rsp) # imm = 0x270
movl 0x1b3c8(%rip), %eax     # 0x37230
incl %eax
xchgl %eax, 0x1b3c0(%rip)     # 0x37230
movsd %xmm0, (%rsp)
movsd %xmm1, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
cmpq %rax, %rdx
je 0x1bf05
movq (%rax), %rcx
xorl %r12d, %r12d
leaq 0x20(%rsp), %r14
movq %rsp, %r15
cmpq %rcx, 0x8(%rax)
je 0x1bee5
leaq (%r12,%r12,2), %rbp
xorl %r13d, %r13d
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1f140
movq (%rbx), %rax
movq (%rax,%rbp,8), %rcx
movsd %xmm0, (%rcx,%r13,8)
incq %r13
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rdx, %r13
jb 0x1beb0
movq 0x8(%rbx), %rdx
incq %r12
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rsi
cmpq %rsi, %r12
jb 0x1bea3
addq $0x13a8, %rsp           # imm = 0x13A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::operator()(double (*)(double), unsigned long, unsigned long, unsigned long, unsigned long)
void Matrix::operator()(double(*functor)(double), size_t r1, size_t r2, size_t c1, size_t c2)
{
    // pass a functor, apply to a region of the matrix
    if( (int)r1<0 || r2>(*this).size() || r2 <= r1 || c2 <= c1
            || (int)c1<0 || c2 > (*this)[0].size()
      ) 
        return;

    for(size_t i=r1;i<r2;i++){
        for(size_t j=c1;j<c2;j++){
            (*this)[i][j] = (*functor)( (*this)[i][j] );
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r12
testl %r12d, %r12d
js 0x1bfff
cmpq %r12, 0x8(%rsp)
jbe 0x1bfff
movq %rdi, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq 0x8(%rsp), %rdx
jb 0x1bfff
movq %r9, %rbx
movq 0x10(%rsp), %rdx
cmpq %rdx, %r9
setbe %cl
testl %edx, %edx
sets %dl
orb %cl, %dl
jne 0x1bfff
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %rbx, %rcx
jb 0x1bfff
movq %rsi, %r13
leaq (%r12,%r12,2), %r14
movq (%rax,%r14,8), %rcx
movq 0x10(%rsp), %r15
movsd (%rcx,%r15,8), %xmm0
callq *%r13
movq (%rbp), %rax
movq (%rax,%r14,8), %rcx
movsd %xmm0, (%rcx,%r15,8)
incq %r15
cmpq %r15, %rbx
jne 0x1bfd6
incq %r12
cmpq 0x8(%rsp), %r12
jne 0x1bfc9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::Reshape(unsigned long, unsigned long) const
Matrix Matrix::Reshape(size_t m, size_t n) const
{
    // reshape matrix from original (p, q) to (m, n)
    size_t p = this->size();
    size_t q = (*(const_cast<Matrix*>(this)))[0].size();
    size_t T = p*q; // total # of elements

    if(m==0 || n==0 || p==0 || q==0 || T != m*n) {
        std::cout<<"Error: Reshape matrix dimension not match"<<std::endl;
        exit(0);
    }

    Matrix res(m, n);
    for(size_t i=0;i<T;i++){
        size_t new_x = i/n, new_y = i%n;
        size_t old_x = i/q, old_y = i%q;

        res[new_x][new_y] = (*(const_cast<Matrix*>(this)))[old_x][old_y];
    }

    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdx, %rdx
je 0x1c19f
movq %rcx, %rbx
testq %rcx, %rcx
je 0x1c19f
movq %rsi, %r15
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
cmpq %rcx, %rax
je 0x1c19f
movq (%rcx), %rsi
movq 0x8(%rcx), %r12
cmpq %rsi, %r12
je 0x1c19f
subq %rcx, %rax
sarq $0x3, %rax
subq %rsi, %r12
sarq $0x3, %r12
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r13
imulq %r12, %r13
movq %rbx, %rax
imulq %rdx, %rax
cmpq %rax, %r13
jne 0x1c19f
movq %rdi, %r14
movq %rdx, %rsi
movq %rbx, %rdx
callq 0x1a76e
testq %r13, %r13
je 0x1c192
movq (%r15), %r8
movq (%r14), %r9
xorl %ecx, %ecx
movq %rcx, %rax
xorl %edx, %edx
divq %rbx
movq %rdx, %rsi
movq %rax, %rdi
movq %rcx, %rax
xorl %edx, %edx
divq %r12
leaq (%rax,%rax,2), %rax
movq (%r8,%rax,8), %rax
movsd (%rax,%rdx,8), %xmm0
leaq (%rdi,%rdi,2), %rax
movq (%r9,%rax,8), %rax
movsd %xmm0, (%rax,%rsi,8)
incq %rcx
cmpq %rcx, %r13
jne 0x1c15a
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x1ae32(%rip), %rdi     # 0x36fd8
leaq 0xe008(%rip), %rsi      # 0x2a1b5
callq 0x4260
movq %rax, %rdi
callq 0x4100
xorl %edi, %edi
callq 0x4290
nop
// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/Matrix.cpp
// Function: Matrix::MinInSection(unsigned long, unsigned long, unsigned long, unsigned long)
double Matrix::MinInSection(size_t i_start, size_t i_end, size_t j_start, size_t j_end)
{
    // find max element 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: Min in matrix section: exceeded range."<<std::endl;
        exit(0);
    }
    double res = __M[i_start][j_start];
    for(size_t i=i_start;i<i_end;i++){
        for(size_t j=j_start;j<j_end;j++){
            if(res > __M[i][j])
                res = __M[i][j];
        }
    }
    return res;
}

// Assembly:
pushq %rax
cmpq %rcx, %r8
jbe 0x1c51d
cmpq %rsi, %rdx
jbe 0x1c51d
movl %ecx, %eax
orl %esi, %eax
andl $0x80000000, %eax       # imm = 0x80000000
jne 0x1c51d
movq (%rdi), %rax
movq 0x8(%rdi), %rdi
subq %rax, %rdi
sarq $0x3, %rdi
movabsq $-0x5555555555555555, %r9 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %r9
cmpq %rdx, %r9
jb 0x1c51d
movq 0x8(%rax), %rdi
subq (%rax), %rdi
sarq $0x3, %rdi
cmpq %r8, %rdi
jb 0x1c51d
leaq (%rsi,%rsi,2), %rdi
movq (%rax,%rdi,8), %rdi
movsd (%rdi,%rcx,8), %xmm0
leaq (%rsi,%rsi,2), %rdi
movq (%rax,%rdi,8), %rdi
movq %rcx, %r9
movapd %xmm0, %xmm1
movsd (%rdi,%r9,8), %xmm0
minsd %xmm1, %xmm0
incq %r9
cmpq %r9, %r8
jne 0x1c4fd
incq %rsi
cmpq %rdx, %rsi
jne 0x1c4f2
popq %rax
retq
movq 0x1aab4(%rip), %rdi     # 0x36fd8
leaq 0xdf9c(%rip), %rsi      # 0x2a4c7
callq 0x4260
movq %rax, %rdi
callq 0x4100
xorl %edi, %edi
callq 0x4290
nop