// File: /workspace/github_cpp_makefile_star2_O3/xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::ConstructLayer(LayerParameterList)
ConstructLayer::ConstructLayer(LayerParameterList p_list)
{
    // common parameters
    __type = p_list._gLayerType;

    // drop out
    if(p_list._gUseDropout)
    {
        EnableDropOut();
        __dropOutBranches = p_list._gdropoutBranches;
        SetDropOutFactor(p_list._gDropoutFactor);
    }
    else
    {
        DisableDropOut();
    }

    SetLearningRate(p_list._gLearningRate);
    __layerDimension = p_list._gLayerDimension;
    __p_data_interface = p_list._pDataInterface;
    __regularizationMethod = p_list._gRegularization;
    __regularizationParameter = p_list._gRegularizationParameter;
    __neuron_actuation_func_type = p_list._gActuationFuncType;
    __trainingType = p_list._gTrainingType;
    __use_batch_normalization = p_list._gUseBatchNormalization;

    // parameters dependent on layer type
    if(__type == LayerType::input)
    {
        __layerDimension = p_list._gLayerDimension;
    }
    else if(__type == LayerType::fullyConnected)
    {
        SetNumberOfNeuronsFC(p_list._nNeuronsFC);
    }
    else if(__type == LayerType::cnn)
    {
        SetNumberOfKernelsCNN(p_list._nKernels);
        SetKernelSizeCNN(p_list._gDimKernel);
    }
    else if(__type == LayerType::pooling)
    {
        SetNumberOfKernelsCNN(p_list._nKernels);
        SetKernelSizeCNN(p_list._gDimKernel);
    }
    else if(__type == LayerType::output)
    {
        SetNumberOfNeuronsFC(p_list._nNeuronsFC);
    }
    else
    {
        std::cout<<__func__<<" Error: trying to construct unsupported layer."
            <<std::endl;
        exit(0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0xc0(%rsp), %r15
callq 0x1a5be
leaq 0x31ac4(%rip), %rax     # 0x36540
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x4c(%rbx)
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x70(%rbx)
movups %xmm0, 0x80(%rbx)
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0xb0(%rbx)
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, 0xc0(%rbx)
xorl %r14d, %r14d
movl %r14d, 0xc8(%rbx)
leaq 0xd0(%rbx), %rdi
leaq 0x218(%rbx), %r12
movl $0x141, %edx            # imm = 0x141
xorl %esi, %esi
callq 0x4140
movl $0x1b1, %edx            # imm = 0x1B1
movq %r12, 0x50(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x4140
movl $0x2, %eax
movl %eax, 0x3cc(%rbx)
movq %r14, 0x3d0(%rbx)
movabsq $0x3fe0000000000000, %rcx # imm = 0x3FE0000000000000
movq %rcx, 0x3d8(%rbx)
movq $0x1, 0x3e0(%rbx)
movl %r14d, 0x3e8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x3f0(%rbx)
movq %r14, 0x400(%rbx)
movl %eax, 0x408(%rbx)
movups %xmm0, 0x40c(%rbx)
movups %xmm0, 0x41c(%rbx)
movups %xmm0, 0x42c(%rbx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x43c(%rbx)
movups %xmm0, 0x448(%rbx)
movups %xmm0, 0x458(%rbx)
movups %xmm0, 0x468(%rbx)
movaps 0x2247f(%rip), %xmm0    # 0x27010
movups %xmm0, 0x478(%rbx)
movb $0x1, 0x488(%rbx)
movl (%r15), %eax
movl %eax, 0xc(%rbx)
cmpb $0x1, 0x38(%r15)
jne 0x4bc7
movl 0x3c(%r15), %ecx
movl %ecx, 0x3cc(%rbx)
movsd 0x40(%r15), %xmm0
movsd %xmm0, 0x3d8(%rbx)
movb $0x1, %r14b
leaq 0x60(%rbx), %rcx
movq %rcx, 0x80(%rsp)
leaq 0x230(%rbx), %rcx
movq %rcx, 0x48(%rsp)
leaq 0x248(%rbx), %rcx
movq %rcx, 0x40(%rsp)
leaq 0x260(%rbx), %rcx
movq %rcx, 0x38(%rsp)
leaq 0x278(%rbx), %rcx
movq %rcx, 0x30(%rsp)
leaq 0x290(%rbx), %rcx
movq %rcx, 0x28(%rsp)
leaq 0x2a8(%rbx), %rcx
movq %rcx, 0x20(%rsp)
leaq 0x2c0(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x2d8(%rbx), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x2f0(%rbx), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x308(%rbx), %rcx
movq %rcx, 0x78(%rsp)
leaq 0x320(%rbx), %rcx
movq %rcx, 0x70(%rsp)
leaq 0x338(%rbx), %rcx
movq %rcx, 0x68(%rsp)
movb %r14b, 0x3c8(%rbx)
movsd 0x30(%r15), %xmm0
movsd %xmm0, 0xc0(%rbx)
movl 0x4(%r15), %ecx
movl %ecx, 0x408(%rbx)
movq 0x8(%r15), %rdx
movq %rdx, 0x400(%rbx)
movl 0x48(%r15), %edx
movl %edx, 0xc8(%rbx)
movsd 0x50(%r15), %xmm0
movsd %xmm0, 0xd0(%rbx)
movl 0x58(%r15), %edx
movl %edx, 0x58(%rbx)
movl 0x5c(%r15), %edx
movl %edx, 0x40c(%rbx)
movb 0x60(%r15), %dl
movb %dl, 0x210(%rbx)
leaq 0x350(%rbx), %rdx
movq %rdx, 0x60(%rsp)
leaq 0x368(%rbx), %r13
leaq 0x380(%rbx), %rbp
leaq 0x448(%rbx), %r14
leaq 0x460(%rbx), %r12
cmpl $0x4, %eax
ja 0x4d47
movl %eax, %eax
leaq 0x223fa(%rip), %rdx     # 0x270f0
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x61da
jmp 0x4d35
movq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x620c
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq (%rbx), %rax
movq %rbx, %rdi
callq *0xb0(%rax)
jmp 0x4d35
movl %ecx, 0x408(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3228a(%rip), %rdi     # 0x36fd8
leaq 0x228a3(%rip), %rsi     # 0x275f8
movl $0xe, %edx
callq 0x4280
movq 0x32272(%rip), %rdi     # 0x36fd8
leaq 0x2289a(%rip), %rsi     # 0x27607
movl $0x2e, %edx
callq 0x4280
movq 0x3225a(%rip), %rdi     # 0x36fd8
callq 0x4100
xorl %edi, %edi
callq 0x4290
movq %rax, 0x58(%rsp)
movq %r12, %rdi
callq 0x1353a
movq %r14, %rdi
callq 0x1353a
movq 0x428(%rbx), %rdi
testq %rdi, %rdi
je 0x4db0
callq 0x4230
movq 0x410(%rbx), %rdi
testq %rdi, %rdi
je 0x4dc1
callq 0x4230
movq %rbp, %rdi
callq 0x1353a
movq %r13, %rdi
callq 0x1353a
movq 0x60(%rsp), %rdi
callq 0x1353a
movq 0x68(%rsp), %rdi
callq 0x1353a
movq 0x70(%rsp), %rdi
callq 0x1353a
movq 0x78(%rsp), %rdi
callq 0x1353a
movq 0x8(%rsp), %rdi
callq 0x1357a
movq 0x10(%rsp), %rdi
callq 0x1357a
movq 0x18(%rsp), %rdi
callq 0x1357a
movq 0x20(%rsp), %rdi
callq 0x1357a
movq 0x28(%rsp), %rdi
callq 0x1357a
movq 0x30(%rsp), %rdi
callq 0x1357a
movq 0x38(%rsp), %rdi
callq 0x1357a
movq 0x40(%rsp), %rdi
callq 0x1357a
movq 0x48(%rsp), %rdi
callq 0x1357a
movq 0x50(%rsp), %rdi
callq 0x1357a
movq 0x1f8(%rbx), %rdi
testq %rdi, %rdi
je 0x4e6e
callq 0x4230
leaq 0x1e0(%rbx), %rdi
leaq 0x1c8(%rbx), %r15
leaq 0x1b0(%rbx), %r12
leaq 0x198(%rbx), %r13
leaq 0x180(%rbx), %rbp
leaq 0x168(%rbx), %r14
leaq 0x150(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x138(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x120(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x108(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0xf0(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0xd8(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0xa8(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x90(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0x78(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x40(%rbx), %rax
movq %rax, 0x50(%rsp)
callq 0x1357a
movq %r15, %rdi
callq 0x1357a
movq %r12, %rdi
callq 0x1357a
movq %r13, %rdi
callq 0x1357a
movq %rbp, %rdi
callq 0x1357a
movq %r14, %rdi
callq 0x1357a
movq 0x8(%rsp), %rdi
callq 0x1357a
movq 0x10(%rsp), %rdi
callq 0x1357a
movq 0x18(%rsp), %rdi
callq 0x135ba
movq 0x20(%rsp), %rdi
callq 0x135fa
movq 0x28(%rsp), %rdi
callq 0x1353a
movq 0x30(%rsp), %rdi
callq 0x1353a
movq 0x38(%rsp), %rdi
callq 0x1357a
movq 0x40(%rsp), %rdi
callq 0x1357a
movq 0x48(%rsp), %rdi
callq 0x1353a
movq 0x80(%rsp), %rdi
callq 0x1353a
movq 0x50(%rsp), %rdi
callq 0x1363a
movq %rbx, %rdi
callq 0x1a5da
movq 0x58(%rsp), %rdi
callq 0x43e0