// File: xbai0624[P]dnn/src/ConstructLayer.cpp
// Function: ConstructLayer::BatchNormalization_GetGradientOnParameters_2DLayer()
void ConstructLayer::BatchNormalization_GetGradientOnParameters_2DLayer() // TO-DO: need to parallelize
{
    // gradients of cost function on \sigma_B^2, \mu_B, \gamma, \beta
    size_t nK = __n_kernels_cnn; // cnn layer = nKernels
    double epsilon = 1e-8;
    size_t batch_size = __p_data_interface->GetBatchSize();

    // for cnn layer, each kernel has one \mu_B, \sigma_B^2, \gamma, \beta, all of these are one number
    // so the gradients on these parameters are all numbers, not matrices

    for(size_t k=0;k<nK;k++)
    {
        // mu_B
        // both cnn and fc have one average and variance
        Matrix & mu_B = __imageAverage_BN[0].OutputImageFromKernel[k];
        // sigma_B^2
        Matrix & sigma_B = __imageVariance_BN[0].OutputImageFromKernel[k];

        Matrix Var_inverse_half_cubic = sigma_B + epsilon;
        Var_inverse_half_cubic(inverse_half_cubic);
        Var_inverse_half_cubic = Var_inverse_half_cubic * (-1./2.);

        Matrix Var_inverse_square_root = sigma_B + epsilon;
        Var_inverse_square_root(inverse_square_root);
        Var_inverse_square_root = Var_inverse_square_root * (-1.);

        // 1) \partial{C}/\partial{\sigma_B^2}
        Matrix partial_C_over_partial_sigma_B2(__imageZ[0].OutputImageFromKernel[k].Dimension(), 0.);
        for(size_t i=0;i<batch_size;i++)
        {
            Matrix partial_C_over_partial_hat_x = __imageDelta[i].OutputImageFromKernel[k] * (__gamma_BN[k])[0][0];

            Matrix tmp = __imageZ[i].OutputImageFromKernel[k] - mu_B[0][0];
            tmp = tmp ^ partial_C_over_partial_hat_x;

            partial_C_over_partial_sigma_B2 = partial_C_over_partial_sigma_B2 + tmp;
        }
        auto dim = partial_C_over_partial_sigma_B2.Dimension();
        double sum = partial_C_over_partial_sigma_B2.SumInSection(0, dim.first, 0, dim.second);
        sum *= Var_inverse_half_cubic[0][0]; 
        Matrix res(1, 1, sum); // for cnn layer, result should be in DIM(1,1) matrix form

        // \partial{C}/\partial{\sigma_B^2}  result
        __v_partial_C_over_partial_sigma_square.push_back(res);

        // 2) \partial{C}/\partial{mu_B}
        Matrix part1(__imageZ[0].OutputImageFromKernel[k].Dimension(), 0.);
        Matrix part2(__imageZ[0].OutputImageFromKernel[k].Dimension(), 0.);
        for(size_t i=0;i<batch_size;i++)
        {
            Matrix partial_C_over_partial_hat_x = __imageDelta[i].OutputImageFromKernel[k] * (__gamma_BN[k])[0][0];
            part1 = part1 + partial_C_over_partial_hat_x;

            part2 = part2 + __imageZ[i].OutputImageFromKernel[k];
            part2 = part2 - mu_B[0][0];
        }
        double sum1 = part1.SumInSection(0, dim.first, 0, dim.second);
        sum1 = sum1 * Var_inverse_square_root[0][0];

        double sum2 = part2.SumInSection(0, dim.first, 0, dim.second);
        sum2 = sum2 * (-2./(double)batch_size/(double)dim.first/(double)dim.second);
        sum2 = sum2 * res[0][0];

        double tmp = sum1 + sum2;
        res[0][0] = tmp;
        // \partial{C}/\partial{mu_B}   result
        __v_partial_C_over_partial_mu.push_back(res);

        // 3) \partial{C}/\partial{\gamma} and \partial{C}/\partial{beta}
        Matrix partial_C_over_partial_gamma(__imageZ[0].OutputImageFromKernel[k].Dimension(), 0.);
        Matrix partial_C_over_partial_beta(__imageZ[0].OutputImageFromKernel[k].Dimension(), 0.);
        for(size_t i=0;i<batch_size;i++)
        {
            Matrix tmp = __imageDelta[i].OutputImageFromKernel[k] ^ __imageZ_BN[i].OutputImageFromKernel[k];
            partial_C_over_partial_gamma = partial_C_over_partial_gamma +  tmp;

            partial_C_over_partial_beta = partial_C_over_partial_beta + __imageDelta[i].OutputImageFromKernel[k];
        }

        sum1 = partial_C_over_partial_gamma.SumInSection(0, dim.first, 0, dim.second);
        sum2 = partial_C_over_partial_beta.SumInSection(0, dim.first, 0, dim.second);
        res[0][0] = sum1;
        __v_partial_C_over_partial_gamma.push_back(res);
        res[0][0] = sum2;
        __v_partial_C_over_partial_beta.push_back(res);
    }
}

// Assembly:
subq $0x428, %rsp            # imm = 0x428
movq %rdi, 0x420(%rsp)
movq 0x420(%rsp), %rax
movq %rax, 0x148(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0x418(%rsp)
movsd 0x44295(%rip), %xmm0    # 0x52038
movsd %xmm0, 0x410(%rsp)
movq 0x400(%rax), %rdi
callq 0x1f310
cltq
movq %rax, 0x408(%rsp)
movq $0x0, 0x400(%rsp)
movq 0x400(%rsp), %rax
cmpq 0x418(%rsp), %rax
jae 0xef0b
movq 0x148(%rsp), %rdi
addq $0x278, %rdi            # imm = 0x278
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0x138(%rsp)
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq 0x148(%rsp), %rdi
movq 0x138(%rsp), %rsi
movq %rax, 0x3f8(%rsp)
addq $0x2a8, %rdi            # imm = 0x2A8
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, 0x3f0(%rsp)
movq 0x3f0(%rsp), %rsi
movsd 0x410(%rsp), %xmm0
leaq 0x3d8(%rsp), %rdi
movq %rdi, 0x140(%rsp)
callq 0x3ca80
movq 0x140(%rsp), %rdi
leaq 0x109b(%rip), %rsi      # 0xef20
callq 0x3dc20
jmp 0xde8c
leaq 0x3b0(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
movsd 0x4417c(%rip), %xmm0    # 0x52020
callq 0x3cfd0
jmp 0xdeab
leaq 0x3d8(%rsp), %rdi
leaq 0x3b0(%rsp), %rsi
callq 0x1fa20
jmp 0xdec2
leaq 0x3b0(%rsp), %rdi
callq 0x3bb80
movq 0x3f0(%rsp), %rsi
movsd 0x410(%rsp), %xmm0
leaq 0x398(%rsp), %rdi
callq 0x3ca80
jmp 0xdeef
leaq 0x109a(%rip), %rsi      # 0xef90
leaq 0x398(%rsp), %rdi
callq 0x3dc20
jmp 0xdf05
leaq 0x380(%rsp), %rdi
leaq 0x398(%rsp), %rsi
movsd 0x4410b(%rip), %xmm0    # 0x52028
callq 0x3cfd0
jmp 0xdf24
leaq 0x398(%rsp), %rdi
leaq 0x380(%rsp), %rsi
callq 0x1fa20
jmp 0xdf3b
leaq 0x380(%rsp), %rdi
callq 0x3bb80
movq 0x148(%rsp), %rdi
addq $0x150, %rdi            # imm = 0x150
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, %rdi
callq 0x3bae0
movq %rdx, 0x128(%rsp)
movq %rax, 0x130(%rsp)
jmp 0xdf8a
movq 0x128(%rsp), %rax
movq 0x130(%rsp), %rcx
movq %rcx, 0x358(%rsp)
movq %rax, 0x360(%rsp)
movq 0x358(%rsp), %rsi
movq 0x360(%rsp), %rdx
leaq 0x368(%rsp), %rdi
xorps %xmm0, %xmm0
callq 0x3b680
jmp 0xdfcc
movq $0x0, 0x350(%rsp)
movq 0x350(%rsp), %rax
cmpq 0x408(%rsp), %rax
jae 0xe2da
movq 0x148(%rsp), %rdi
addq $0x180, %rdi            # imm = 0x180
movq 0x350(%rsp), %rsi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq 0x148(%rsp), %rdi
movq %rax, 0x118(%rsp)
addq $0x308, %rdi            # imm = 0x308
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3be50
movq %rax, 0x120(%rsp)
jmp 0xe054
movq 0x120(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd60
movq 0x118(%rsp), %rsi
movsd (%rax), %xmm0
leaq 0x338(%rsp), %rdi
callq 0x3cfd0
jmp 0xe080
movq 0x148(%rsp), %rdi
addq $0x150, %rdi            # imm = 0x150
movq 0x350(%rsp), %rsi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, 0x108(%rsp)
movq 0x3f8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3be50
movq %rax, 0x110(%rsp)
jmp 0xe0cf
movq 0x110(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd60
movq 0x108(%rsp), %rsi
movsd (%rax), %xmm0
leaq 0x320(%rsp), %rdi
callq 0x3ce60
jmp 0xe0fb
leaq 0x308(%rsp), %rdi
leaq 0x320(%rsp), %rsi
leaq 0x338(%rsp), %rdx
callq 0x3c680
jmp 0xe11a
leaq 0x320(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x1fa20
jmp 0xe131
leaq 0x308(%rsp), %rdi
callq 0x3bb80
leaq 0x2f0(%rsp), %rdi
leaq 0x368(%rsp), %rsi
leaq 0x320(%rsp), %rdx
callq 0x3bf90
jmp 0xe15d
leaq 0x368(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0x1fa20
jmp 0xe174
leaq 0x2f0(%rsp), %rdi
callq 0x3bb80
leaq 0x320(%rsp), %rdi
callq 0x3bb80
leaq 0x338(%rsp), %rdi
callq 0x3bb80
movq 0x350(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x350(%rsp)
jmp 0xdfd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xeefc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
leaq 0x3b0(%rsp), %rdi
callq 0x3bb80
jmp 0xeefc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xeeef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
leaq 0x380(%rsp), %rdi
callq 0x3bb80
jmp 0xeeef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xeee2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xe2c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xe2bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
leaq 0x308(%rsp), %rdi
callq 0x3bb80
jmp 0xe2bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
leaq 0x2f0(%rsp), %rdi
callq 0x3bb80
leaq 0x320(%rsp), %rdi
callq 0x3bb80
leaq 0x338(%rsp), %rdi
callq 0x3bb80
jmp 0xeee2
leaq 0x368(%rsp), %rdi
callq 0x3bae0
movq %rdx, 0xf8(%rsp)
movq %rax, 0x100(%rsp)
jmp 0xe2f9
movq 0xf8(%rsp), %rax
movq 0x100(%rsp), %rcx
movq %rcx, 0x2e0(%rsp)
movq %rax, 0x2e8(%rsp)
movq 0x2e0(%rsp), %rdx
movq 0x2e8(%rsp), %r8
xorl %eax, %eax
movl %eax, %ecx
leaq 0x368(%rsp), %rdi
movq %rcx, %rsi
callq 0x407f0
movsd %xmm0, 0xf0(%rsp)
jmp 0xe348
movsd 0xf0(%rsp), %xmm0
movsd %xmm0, 0x2d8(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x3d8(%rsp), %rdi
callq 0x3be50
movq %rax, 0xe8(%rsp)
jmp 0xe375
movq 0xe8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd60
movsd (%rax), %xmm1
movsd 0x2d8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x2d8(%rsp)
movsd 0x2d8(%rsp), %xmm0
leaq 0x2c0(%rsp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x3b590
jmp 0xe3c0
movq 0x148(%rsp), %rdi
addq $0x338, %rdi            # imm = 0x338
leaq 0x2c0(%rsp), %rsi
callq 0x1fa50
jmp 0xe3de
movq 0x148(%rsp), %rdi
addq $0x150, %rdi            # imm = 0x150
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, %rdi
callq 0x3bae0
movq %rdx, 0xd8(%rsp)
movq %rax, 0xe0(%rsp)
jmp 0xe420
movq 0xd8(%rsp), %rax
movq 0xe0(%rsp), %rcx
movq %rcx, 0x298(%rsp)
movq %rax, 0x2a0(%rsp)
movq 0x298(%rsp), %rsi
movq 0x2a0(%rsp), %rdx
leaq 0x2a8(%rsp), %rdi
xorps %xmm0, %xmm0
callq 0x3b680
jmp 0xe462
movq 0x148(%rsp), %rdi
addq $0x150, %rdi            # imm = 0x150
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, %rdi
callq 0x3bae0
movq %rdx, 0xc8(%rsp)
movq %rax, 0xd0(%rsp)
jmp 0xe4a4
movq 0xc8(%rsp), %rax
movq 0xd0(%rsp), %rcx
movq %rcx, 0x270(%rsp)
movq %rax, 0x278(%rsp)
movq 0x270(%rsp), %rsi
movq 0x278(%rsp), %rdx
leaq 0x280(%rsp), %rdi
xorps %xmm0, %xmm0
callq 0x3b680
jmp 0xe4e6
movq $0x0, 0x268(%rsp)
movq 0x268(%rsp), %rax
cmpq 0x408(%rsp), %rax
jae 0xe7b2
movq 0x148(%rsp), %rdi
addq $0x180, %rdi            # imm = 0x180
movq 0x268(%rsp), %rsi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq 0x148(%rsp), %rdi
movq %rax, 0xb8(%rsp)
addq $0x308, %rdi            # imm = 0x308
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3be50
movq %rax, 0xc0(%rsp)
jmp 0xe56e
movq 0xc0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd60
movq 0xb8(%rsp), %rsi
movsd (%rax), %xmm0
leaq 0x250(%rsp), %rdi
callq 0x3cfd0
jmp 0xe59a
leaq 0x238(%rsp), %rdi
leaq 0x2a8(%rsp), %rsi
leaq 0x250(%rsp), %rdx
callq 0x3bf90
jmp 0xe5b9
leaq 0x2a8(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x1fa20
jmp 0xe5d0
leaq 0x238(%rsp), %rdi
callq 0x3bb80
movq 0x148(%rsp), %rdi
addq $0x150, %rdi            # imm = 0x150
movq 0x268(%rsp), %rsi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, %rdx
leaq 0x220(%rsp), %rdi
leaq 0x280(%rsp), %rsi
callq 0x3bf90
jmp 0xe623
leaq 0x280(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x1fa20
jmp 0xe63a
leaq 0x220(%rsp), %rdi
callq 0x3bb80
movq 0x3f8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3be50
movq %rax, 0xb0(%rsp)
jmp 0xe662
movq 0xb0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd60
movsd (%rax), %xmm0
leaq 0x208(%rsp), %rdi
leaq 0x280(%rsp), %rsi
callq 0x3ce60
jmp 0xe68e
leaq 0x280(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x1fa20
jmp 0xe6a5
leaq 0x208(%rsp), %rdi
callq 0x3bb80
leaq 0x250(%rsp), %rdi
callq 0x3bb80
movq 0x268(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x268(%rsp)
jmp 0xe4f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xeed5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xeec8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xeebb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xe7a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x3bb80
jmp 0xe7a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x3bb80
jmp 0xe7a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
leaq 0x208(%rsp), %rdi
callq 0x3bb80
leaq 0x250(%rsp), %rdi
callq 0x3bb80
jmp 0xeebb
movq 0x2e0(%rsp), %rdx
movq 0x2e8(%rsp), %r8
xorl %eax, %eax
movl %eax, %ecx
leaq 0x2a8(%rsp), %rdi
movq %rcx, %rsi
callq 0x407f0
movsd %xmm0, 0xa8(%rsp)
jmp 0xe7e1
movsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0x200(%rsp)
movsd 0x200(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x398(%rsp), %rdi
callq 0x3be50
movq %rax, 0xa0(%rsp)
jmp 0xe820
movq 0xa0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0x88(%rsp)
callq 0x1fd60
movsd 0x98(%rsp), %xmm0
movq 0x88(%rsp), %rcx
movsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x200(%rsp)
movq 0x2e0(%rsp), %rdx
movq 0x2e8(%rsp), %r8
leaq 0x280(%rsp), %rdi
movq %rcx, %rsi
callq 0x407f0
movsd %xmm0, 0x90(%rsp)
jmp 0xe886
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x1f8(%rsp)
movsd 0x1f8(%rsp), %xmm0
movaps 0x437b8(%rip), %xmm4    # 0x52060
movq 0x408(%rsp), %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
movapd 0x437b3(%rip), %xmm3    # 0x52070
subpd %xmm3, %xmm2
movaps %xmm2, %xmm1
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm1, %xmm2
movsd 0x4375c(%rip), %xmm1    # 0x52030
divsd %xmm2, %xmm1
movq 0x2e0(%rsp), %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm5
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm5, %xmm2
divsd %xmm2, %xmm1
movq 0x2e8(%rsp), %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x1f8(%rsp)
movsd 0x1f8(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x2c0(%rsp), %rdi
callq 0x3be50
movq %rax, 0x80(%rsp)
jmp 0xe94f
movq 0x80(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0x60(%rsp)
callq 0x1fd60
movsd 0x78(%rsp), %xmm0
movq 0x60(%rsp), %rsi
movsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x1f8(%rsp)
movsd 0x200(%rsp), %xmm0
movsd 0x1f8(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x1f0(%rsp)
movsd 0x1f0(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
leaq 0x2c0(%rsp), %rdi
callq 0x3be50
movq %rax, 0x70(%rsp)
jmp 0xe9c3
movq 0x70(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd60
movsd 0x68(%rsp), %xmm0
movq 0x148(%rsp), %rdi
movsd %xmm0, (%rax)
addq $0x350, %rdi            # imm = 0x350
leaq 0x2c0(%rsp), %rsi
callq 0x1fa50
jmp 0xe9f9
movq 0x148(%rsp), %rdi
addq $0x150, %rdi            # imm = 0x150
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, %rdi
callq 0x3bae0
movq %rdx, 0x50(%rsp)
movq %rax, 0x58(%rsp)
jmp 0xea35
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
movq %rcx, 0x1c8(%rsp)
movq %rax, 0x1d0(%rsp)
movq 0x1c8(%rsp), %rsi
movq 0x1d0(%rsp), %rdx
leaq 0x1d8(%rsp), %rdi
xorps %xmm0, %xmm0
callq 0x3b680
jmp 0xea71
movq 0x148(%rsp), %rdi
addq $0x150, %rdi            # imm = 0x150
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, %rdi
callq 0x3bae0
movq %rdx, 0x40(%rsp)
movq %rax, 0x48(%rsp)
jmp 0xeaad
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rcx, 0x1a0(%rsp)
movq %rax, 0x1a8(%rsp)
movq 0x1a0(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
leaq 0x1b0(%rsp), %rdi
xorps %xmm0, %xmm0
callq 0x3b680
jmp 0xeae9
movq $0x0, 0x198(%rsp)
movq 0x198(%rsp), %rax
cmpq 0x408(%rsp), %rax
jae 0xecf0
movq 0x148(%rsp), %rdi
addq $0x180, %rdi            # imm = 0x180
movq 0x198(%rsp), %rsi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq 0x148(%rsp), %rdi
movq %rax, 0x38(%rsp)
addq $0x218, %rdi            # imm = 0x218
movq 0x198(%rsp), %rsi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq 0x38(%rsp), %rsi
movq %rax, %rdx
leaq 0x180(%rsp), %rdi
callq 0x3c680
jmp 0xeb7f
leaq 0x168(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
leaq 0x180(%rsp), %rdx
callq 0x3bf90
jmp 0xeb9e
leaq 0x1d8(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x1fa20
jmp 0xebb5
leaq 0x168(%rsp), %rdi
callq 0x3bb80
movq 0x148(%rsp), %rdi
addq $0x180, %rdi            # imm = 0x180
movq 0x198(%rsp), %rsi
callq 0x1fd40
movq %rax, %rdi
movq 0x400(%rsp), %rsi
callq 0x1f9e0
movq %rax, %rdx
leaq 0x150(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x3bf90
jmp 0xec08
leaq 0x1b0(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x1fa20
jmp 0xec1f
leaq 0x150(%rsp), %rdi
callq 0x3bb80
leaq 0x180(%rsp), %rdi
callq 0x3bb80
movq 0x198(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x198(%rsp)
jmp 0xeaf5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xeeae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xeea1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
jmp 0xecde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x3bb80
jmp 0xecde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d0(%rsp)
movl %eax, 0x3cc(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x3bb80
leaq 0x180(%rsp), %rdi
callq 0x3bb80
jmp 0xeea1
movq 0x2e0(%rsp), %rdx
movq 0x2e8(%rsp), %r8
xorl %eax, %eax
movl %eax, %ecx
leaq 0x1d8(%rsp), %rdi
movq %rcx, %rsi
callq 0x407f0
movsd %xmm0, 0x30(%rsp)
jmp 0xed1c
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x200(%rsp)
movq 0x2e0(%rsp), %rdx
movq 0x2e8(%rsp), %r8
xorl %eax, %eax
movl %eax, %ecx
leaq 0x1b0(%rsp), %rdi
movq %rcx, %rsi
callq 0x407f0
movsd %xmm0, 0x28(%rsp)
jmp 0xed57
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x1f8(%rsp)
movsd 0x200(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x2c0(%rsp), %rdi
callq 0x3be50
movq %rax, 0x20(%rsp)
jmp 0xed8d
movq 0x20(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd60
movsd 0x18(%rsp), %xmm0
movq 0x148(%rsp), %rdi
movsd %xmm0, (%rax)
addq $0x368, %rdi            # imm = 0x368
leaq 0x2c0(%rsp), %rsi
callq 0x1fa50
jmp 0xedc3
movsd 0x1f8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x2c0(%rsp), %rdi
callq 0x3be50
movq %rax, 0x10(%rsp)
jmp 0xedea
movq 0x10(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fd60
movsd 0x8(%rsp), %xmm0
movq 0x148(%rsp), %rdi
movsd %xmm0, (%rax)
addq $0x380, %rdi            # imm = 0x380
leaq 0x2c0(%rsp), %rsi
callq 0x1fa50
jmp 0xee20
leaq 0x1b0(%rsp), %rdi
callq 0x3bb80
leaq 0x1d8(%rsp), %rdi
callq 0x3bb80
leaq 0x280(%rsp), %rdi
callq 0x3bb80
leaq 0x2a8(%rsp), %rdi
callq 0x3bb80
leaq 0x2c0(%rsp), %rdi
callq 0x3bb80
leaq 0x368(%rsp), %rdi
callq 0x3bb80
leaq 0x398(%rsp), %rdi
callq 0x3bb80
leaq 0x3d8(%rsp), %rdi
callq 0x3bb80
movq 0x400(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x400(%rsp)
jmp 0xddce
leaq 0x1b0(%rsp), %rdi
callq 0x3bb80
leaq 0x1d8(%rsp), %rdi
callq 0x3bb80
leaq 0x280(%rsp), %rdi
callq 0x3bb80
leaq 0x2a8(%rsp), %rdi
callq 0x3bb80
leaq 0x2c0(%rsp), %rdi
callq 0x3bb80
leaq 0x368(%rsp), %rdi
callq 0x3bb80
leaq 0x398(%rsp), %rdi
callq 0x3bb80
leaq 0x3d8(%rsp), %rdi
callq 0x3bb80
jmp 0xef13
addq $0x428, %rsp            # imm = 0x428
retq
movq 0x3d0(%rsp), %rdi
callq 0x43f0