// File: /workspace/github_cpp_makefile_star2_O2/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 $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
leaq 0x140(%rsp), %r12
callq 0x17558
leaq 0x2ddbe(%rip), %rax     # 0x32548
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)
andl $0x0, 0xc8(%rbx)
leaq 0xd0(%rbx), %rdi
leaq 0x218(%rbx), %r15
xorl %ebp, %ebp
movl $0x141, %edx            # imm = 0x141
xorl %esi, %esi
callq 0x4160
movl $0x1b1, %edx            # imm = 0x1B1
movq %r15, %rdi
xorl %esi, %esi
callq 0x4160
pushq $0x2
popq %rax
movl %eax, 0x3cc(%rbx)
andq $0x0, 0x3d0(%rbx)
movabsq $0x3fe0000000000000, %rcx # imm = 0x3FE0000000000000
movq %rcx, 0x3d8(%rbx)
movq $0x1, 0x3e0(%rbx)
andl $0x0, 0x3e8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x3f0(%rbx)
andq $0x0, 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 0x1c777(%rip), %xmm0    # 0x21010
movups %xmm0, 0x478(%rbx)
movb $0x1, 0x488(%rbx)
movl (%r12), %eax
movl %eax, 0xc(%rbx)
cmpb $0x1, 0x38(%r12)
jne 0x48d3
movl 0x3c(%r12), %ecx
movl %ecx, 0x3cc(%rbx)
movsd 0x40(%r12), %xmm0
movsd %xmm0, 0x3d8(%rbx)
movb $0x1, %bpl
leaq 0x60(%rbx), %r14
leaq 0x448(%rbx), %r13
movb %bpl, 0x3c8(%rbx)
movsd 0x30(%r12), %xmm0
movsd %xmm0, 0xc0(%rbx)
movl 0x4(%r12), %ecx
movl %ecx, 0x408(%rbx)
movq 0x8(%r12), %rdx
movq %rdx, 0x400(%rbx)
movl 0x48(%r12), %edx
movl %edx, 0xc8(%rbx)
movsd 0x50(%r12), %xmm0
movsd %xmm0, 0xd0(%rbx)
movl 0x58(%r12), %edx
movl %edx, 0x58(%rbx)
movl 0x5c(%r12), %edx
movl %edx, 0x40c(%rbx)
movb 0x60(%r12), %dl
movb %dl, 0x210(%rbx)
cmpl $0x4, %eax
ja 0x49a6
movl %eax, %eax
leaq 0x1c72f(%rip), %rdx     # 0x21080
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0x5f96
jmp 0x4994
movq 0x18(%r12), %rsi
movq %rbx, %rdi
callq 0x5fc8
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
movq (%rbx), %rax
movq %rbx, %rdi
callq *0xb0(%rax)
jmp 0x4994
movl %ecx, 0x408(%rbx)
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e62b(%rip), %rdi     # 0x32fd8
leaq 0x1cbd4(%rip), %rsi     # 0x21588
callq 0x4240
leaq 0x1cbd7(%rip), %rsi     # 0x21597
movq %rax, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x4130
xorl %edi, %edi
callq 0x4260
movq %rax, 0x100(%rsp)
leaq 0x460(%rbx), %rdi
leaq 0x428(%rbx), %rbp
leaq 0x410(%rbx), %r12
leaq 0x380(%rbx), %rax
movq %rax, (%rsp)
leaq 0x368(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x350(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x338(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x320(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x308(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0x2f0(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x2d8(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x2c0(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0x2a8(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x290(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq 0x278(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0x260(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0x248(%rbx), %rax
movq %rax, 0x68(%rsp)
leaq 0x230(%rbx), %rax
movq %rax, 0x70(%rsp)
leaq 0x1f8(%rbx), %rax
movq %rax, 0x78(%rsp)
leaq 0x1e0(%rbx), %rax
movq %rax, 0x80(%rsp)
leaq 0x1c8(%rbx), %rax
movq %rax, 0x88(%rsp)
leaq 0x1b0(%rbx), %rax
movq %rax, 0x90(%rsp)
leaq 0x198(%rbx), %rax
movq %rax, 0x98(%rsp)
leaq 0x180(%rbx), %rax
movq %rax, 0xa0(%rsp)
leaq 0x168(%rbx), %rax
movq %rax, 0xa8(%rsp)
leaq 0x150(%rbx), %rax
movq %rax, 0xb0(%rsp)
leaq 0x138(%rbx), %rax
movq %rax, 0xb8(%rsp)
leaq 0x120(%rbx), %rax
movq %rax, 0xc0(%rsp)
leaq 0x108(%rbx), %rax
movq %rax, 0xc8(%rsp)
leaq 0xf0(%rbx), %rax
movq %rax, 0xd0(%rsp)
leaq 0xd8(%rbx), %rax
movq %rax, 0xd8(%rsp)
leaq 0xa8(%rbx), %rax
movq %rax, 0xe0(%rsp)
leaq 0x90(%rbx), %rax
movq %rax, 0xe8(%rsp)
leaq 0x78(%rbx), %rax
movq %rax, 0xf0(%rsp)
leaq 0x40(%rbx), %rax
movq %rax, 0xf8(%rsp)
callq 0x110e4
movq %r13, %rdi
callq 0x110e4
movq %rbp, %rdi
callq 0x127dc
movq %r12, %rdi
callq 0x127dc
movq (%rsp), %rdi
callq 0x110e4
movq 0x8(%rsp), %rdi
callq 0x110e4
movq 0x10(%rsp), %rdi
callq 0x110e4
movq 0x18(%rsp), %rdi
callq 0x110e4
movq 0x20(%rsp), %rdi
callq 0x110e4
movq 0x28(%rsp), %rdi
callq 0x110e4
movq 0x30(%rsp), %rdi
callq 0x11106
movq 0x38(%rsp), %rdi
callq 0x11106
movq 0x40(%rsp), %rdi
callq 0x11106
movq 0x48(%rsp), %rdi
callq 0x11106
movq 0x50(%rsp), %rdi
callq 0x11106
movq 0x58(%rsp), %rdi
callq 0x11106
movq 0x60(%rsp), %rdi
callq 0x11106
movq 0x68(%rsp), %rdi
callq 0x11106
movq 0x70(%rsp), %rdi
callq 0x11106
movq %r15, %rdi
callq 0x11106
movq 0x78(%rsp), %rdi
callq 0x127dc
movq 0x80(%rsp), %rdi
callq 0x11106
movq 0x88(%rsp), %rdi
callq 0x11106
movq 0x90(%rsp), %rdi
callq 0x11106
movq 0x98(%rsp), %rdi
callq 0x11106
movq 0xa0(%rsp), %rdi
callq 0x11106
movq 0xa8(%rsp), %rdi
callq 0x11106
movq 0xb0(%rsp), %rdi
callq 0x11106
movq 0xb8(%rsp), %rdi
callq 0x11106
movq 0xc0(%rsp), %rdi
callq 0x11128
movq 0xc8(%rsp), %rdi
callq 0x1114a
movq 0xd0(%rsp), %rdi
callq 0x110e4
movq 0xd8(%rsp), %rdi
callq 0x110e4
movq 0xe0(%rsp), %rdi
callq 0x11106
movq 0xe8(%rsp), %rdi
callq 0x11106
movq 0xf0(%rsp), %rdi
callq 0x110e4
movq %r14, %rdi
callq 0x110e4
movq 0xf8(%rsp), %rdi
callq 0x1116c
movq %rbx, %rdi
callq 0x17574
movq 0x100(%rsp), %rdi
callq 0x43b0