// File: /workspace/github_cpp_makefile_star2_O1/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), %r13
callq 0x1a658
leaq 0x31a34(%rip), %rax     # 0x36540
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rbx)
movups %xmm0, 0x1c(%rbx)
movups %xmm0, 0x2c(%rbx)
movups %xmm0, 0x3c(%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), %r15
movl $0x141, %edx            # imm = 0x141
xorl %esi, %esi
callq 0x4140
movl $0x1b1, %edx            # imm = 0x1B1
movq %r15, %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 0x223f4(%rip), %xmm0    # 0x27010
movups %xmm0, 0x478(%rbx)
movb $0x1, 0x488(%rbx)
movl (%r13), %eax
movl %eax, 0xc(%rbx)
cmpb $0x1, 0x38(%r13)
jne 0x4c59
movb $0x1, 0x3c8(%rbx)
movl 0x3c(%r13), %ecx
movl %ecx, 0x3cc(%rbx)
movsd 0x40(%r13), %xmm0
movsd %xmm0, 0x3d8(%rbx)
jmp 0x4c60
movb $0x0, 0x3c8(%rbx)
leaq 0x60(%rbx), %rcx
movq %rcx, 0x80(%rsp)
leaq 0x230(%rbx), %rcx
movq %rcx, 0x50(%rsp)
leaq 0x248(%rbx), %rcx
movq %rcx, 0x48(%rsp)
leaq 0x260(%rbx), %rcx
movq %rcx, 0x40(%rsp)
leaq 0x278(%rbx), %rcx
movq %rcx, 0x38(%rsp)
leaq 0x290(%rbx), %rcx
movq %rcx, 0x30(%rsp)
leaq 0x2a8(%rbx), %rcx
movq %rcx, 0x28(%rsp)
leaq 0x2c0(%rbx), %rcx
movq %rcx, 0x20(%rsp)
leaq 0x2d8(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x2f0(%rbx), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x308(%rbx), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x320(%rbx), %rcx
movq %rcx, 0x78(%rsp)
leaq 0x338(%rbx), %rcx
movq %rcx, 0x70(%rsp)
movsd 0x30(%r13), %xmm0
movsd %xmm0, 0xc0(%rbx)
movl 0x4(%r13), %ecx
movl %ecx, 0x408(%rbx)
movq 0x8(%r13), %rdx
movq %rdx, 0x400(%rbx)
movl 0x48(%r13), %edx
movl %edx, 0xc8(%rbx)
movsd 0x50(%r13), %xmm0
movsd %xmm0, 0xd0(%rbx)
movl 0x58(%r13), %edx
movl %edx, 0x58(%rbx)
movl 0x5c(%r13), %edx
movl %edx, 0x40c(%rbx)
movb 0x60(%r13), %dl
movb %dl, 0x210(%rbx)
leaq 0x350(%rbx), %rdx
movq %rdx, 0x68(%rsp)
leaq 0x368(%rbx), %rdx
movq %rdx, 0x60(%rsp)
leaq 0x380(%rbx), %rbp
leaq 0x448(%rbx), %r14
leaq 0x460(%rbx), %r12
cmpl $0x4, %eax
ja 0x4dde
movl %eax, %eax
leaq 0x22363(%rip), %rdx     # 0x270f0
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x10(%r13), %rsi
movq %rbx, %rdi
callq 0x6256
jmp 0x4dcc
movq 0x18(%r13), %rsi
movq %rbx, %rdi
callq 0x6288
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
movq (%rbx), %rax
movq %rbx, %rdi
callq *0xb0(%rax)
jmp 0x4dcc
movl %ecx, 0x408(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x321f3(%rip), %rdi     # 0x36fd8
leaq 0x2280c(%rip), %rsi     # 0x275f8
movl $0xe, %edx
callq 0x4280
movq 0x321db(%rip), %rdi     # 0x36fd8
leaq 0x22803(%rip), %rsi     # 0x27607
movl $0x2e, %edx
callq 0x4280
movq 0x321c3(%rip), %rdi     # 0x36fd8
callq 0x4100
xorl %edi, %edi
callq 0x4290
movq %rax, 0x58(%rsp)
movq %r12, %rdi
callq 0x136aa
movq %r14, %rdi
callq 0x136aa
movq 0x428(%rbx), %rdi
testq %rdi, %rdi
je 0x4e47
callq 0x4230
movq 0x410(%rbx), %rdi
testq %rdi, %rdi
je 0x4e58
callq 0x4230
movq %rbp, %rdi
callq 0x136aa
movq 0x60(%rsp), %rdi
callq 0x136aa
movq 0x68(%rsp), %rdi
callq 0x136aa
movq 0x70(%rsp), %rdi
callq 0x136aa
movq 0x78(%rsp), %rdi
callq 0x136aa
movq 0x8(%rsp), %rdi
callq 0x136aa
movq 0x10(%rsp), %rdi
callq 0x136e4
movq 0x18(%rsp), %rdi
callq 0x136e4
movq 0x20(%rsp), %rdi
callq 0x136e4
movq 0x28(%rsp), %rdi
callq 0x136e4
movq 0x30(%rsp), %rdi
callq 0x136e4
movq 0x38(%rsp), %rdi
callq 0x136e4
movq 0x40(%rsp), %rdi
callq 0x136e4
movq 0x48(%rsp), %rdi
callq 0x136e4
movq 0x50(%rsp), %rdi
callq 0x136e4
movq %r15, %rdi
callq 0x136e4
movq 0x1f8(%rbx), %rdi
testq %rdi, %rdi
je 0x4f05
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 0x136e4
movq %r15, %rdi
callq 0x136e4
movq %r12, %rdi
callq 0x136e4
movq %r13, %rdi
callq 0x136e4
movq %rbp, %rdi
callq 0x136e4
movq %r14, %rdi
callq 0x136e4
movq 0x8(%rsp), %rdi
callq 0x136e4
movq 0x10(%rsp), %rdi
callq 0x136e4
movq 0x18(%rsp), %rdi
callq 0x1371e
movq 0x20(%rsp), %rdi
callq 0x13758
movq 0x28(%rsp), %rdi
callq 0x136aa
movq 0x30(%rsp), %rdi
callq 0x136aa
movq 0x38(%rsp), %rdi
callq 0x136e4
movq 0x40(%rsp), %rdi
callq 0x136e4
movq 0x48(%rsp), %rdi
callq 0x136aa
movq 0x80(%rsp), %rdi
callq 0x136aa
movq 0x50(%rsp), %rdi
callq 0x13792
movq %rbx, %rdi
callq 0x1a67c
movq 0x58(%rsp), %rdi
callq 0x43e0
nop