// File: xbai0624[P]dnn/src/UnitTest.cpp
// Function: UnitTest::TestCNN()
void UnitTest::TestCNN()
{
    // step1: setup all layers.............................................................................................................
    // 1) Data interface, this is a tool class, for data prepare
    DataInterface *data_interface = new DataInterface("unit_test_data/data_signal.dat", "unit_test_data/data_cosmic.dat", LayerDimension::_2D);

    // 3) input layer   ID=0
    LayerParameterList p_list0(LayerType::input, LayerDimension::_2D, data_interface, 0, 0, 
            std::pair<size_t, size_t>(0, 0), 0, false, 0, 0, Regularization::Undefined, 0, ActuationFuncType::Undefined, TrainingType::NewTraining, false);
    Layer* layer_input = new ConstructLayer(p_list0);
    layer_input->Init();

    // 4) middle layer 1 : cnn layer ID=1
    LayerParameterList p_list1(LayerType::cnn, LayerDimension::_2D, data_interface, 0, 2, 
            std::pair<size_t, size_t>(2, 2), 0.1, false, 0, 0.5, Regularization::L2, 0.1, ActuationFuncType::Relu, TrainingType::NewTraining, false);
    Layer *l1 = new ConstructLayer(p_list1);
    l1->SetPrevLayer(layer_input);
    l1->Init();

    // 4) middle layer 1 : fc layer ID=6
    LayerParameterList p_list6(LayerType::fullyConnected, LayerDimension::_1D, data_interface, 10, 0, 
            std::pair<size_t, size_t>(0, 0), 0.1, false, 0, 0.5, Regularization::L2, 0.1, ActuationFuncType::Relu, TrainingType::NewTraining, false);
    Layer *l6 = new ConstructLayer(p_list6);
    l6->SetPrevLayer(l1);
    l6->Init();

    // 5) output layer ID = 7
    LayerParameterList p_list_output(LayerType::output, LayerDimension::_1D, data_interface, 2, 0, 
            std::pair<size_t, size_t>(0, 0), 0.1, false, 0, 0., Regularization::L2, 0.1, ActuationFuncType::SoftMax, TrainingType::NewTraining, false);
    Layer* layer_output = new ConstructLayer(p_list_output);
    layer_output -> SetPrevLayer(l6);
    layer_output -> Init();

    // 6) connect all layers; SetNextLayer must be after all layers have finished initialization
    //                        input layer not needed to set, input layer has no update on w & b
    //                        input layer is just for data transfer (prepare)
    l1->SetNextLayer(l6);
    //l2->SetNextLayer(l3);
    l6->SetNextLayer(layer_output); // This line is ugly, to be improved


    // step 2: forward propagate
    data_interface -> Reset();
    layer_input->EpochInit();
    l1->EpochInit();
    l6->EpochInit();
    layer_output->EpochInit();

    //layer_input->BatchInit();
    l1->BatchInit();
    l6->BatchInit();
    layer_output->BatchInit();


    data_interface->GetNewBatchData();
    data_interface->GetNewBatchLabel();
    layer_input -> FillBatchDataToInputLayerA();


    int sample_size = data_interface->GetBatchSize();
    for(int i=0;i<sample_size;i++)
    {
        l1->ForwardPropagate_Z_ForSample(i);
        l1->ForwardPropagate_SigmaPrimeAndA_ForSample(i);
        l6->ForwardPropagate_Z_ForSample(i);
        l6->ForwardPropagate_SigmaPrimeAndA_ForSample(i);
        layer_output->ForwardPropagate_Z_ForSample(i);
        layer_output->ForwardPropagate_SigmaPrimeAndA_ForSample(i);
    }

    // helper functions
    auto print_a_images = [&](Layer *l)
    {
        // print a images
        cout<<"XXXXXX::'A' images from layer: "<<l->GetID()<<endl;
        auto & images = l->GetImagesFullA();
        int sample_IIID = 0;
        for(auto &i: images)
        {
            cout<<"---------------------- sample id: "<<sample_IIID<<endl;
            int kernel_id = 0;
            for(auto &j: i.OutputImageFromKernel)
            {
                cout<<"----kernel id: "<<kernel_id<<endl;
                cout<<j<<endl;
                kernel_id++;
            }
            sample_IIID++;
        }
    };
    auto print_z_images = [&](Layer *l)
    {
        // print a images
        cout<<"XXXXXX::'Z' images from layer: "<<l->GetID()<<endl;
        auto & images = l->GetImagesFullZ();
        int sample_IIID = 0;
        for(auto &i: images)
        {
            cout<<"---------------------- sample id: "<<sample_IIID<<endl;
            int kernel_id = 0;
            for(auto &j: i.OutputImageFromKernel)
            {
                cout<<"----kernel id: "<<kernel_id<<endl;
                cout<<j<<endl;
                kernel_id++;
            }
            sample_IIID++;
        }
    };


    auto print_W_B_images = [&](Layer *l)
    {
        // print a images
        cout<<"XXXXXX::W&B matrix from layer: "<<l->GetID()<<endl;
        auto w_images = l->GetWeightMatrixOriginal();
        auto b_images = l->GetBiasVectorOriginal();
        assert((*w_images).size() == (*b_images).size());

        for(size_t kernel = 0;kernel<(*w_images).size();kernel++)
        {
            cout<<"----kernel id: "<<kernel<<endl;
            cout<<"w"<<kernel<<":"<<endl;
            cout<<(*w_images)[kernel]<<endl;
            cout<<"b"<<kernel<<":"<<endl;
            cout<<(*b_images)[kernel]<<endl;
        }
    };

    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    print_W_B_images(layer_input);
    print_z_images(layer_input);
    print_a_images(layer_input);

    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    //print_W_B_images(l1);
    //print_z_images(l1);
    //print_a_images(l1);

    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    //print_W_B_images(l6);
    //print_z_images(l6);
    //print_a_images(l6);

    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    //print_W_B_images(layer_output);
    //print_z_images(layer_output);
    //print_a_images(layer_output);


    // backward propagation
    for(int i=0;i<sample_size;i++)
    {
        // must inverse order
        layer_output->BackwardPropagateForSample(i);
        l6->BackwardPropagateForSample(i);
        l1->BackwardPropagateForSample(i);
    }


    auto print_sigmaPrime_images = [&](Layer *l)
    {
        // print a images
        cout<<"XXXXXX::'SigmaPrime' images from layer: "<<l->GetID()<<endl;
        auto & images = l->GetImagesFullSigmaPrime();
        int sample_IIID = 0;
        for(auto &i: images)
        {
            cout<<"---------------------- sample id: "<<sample_IIID<<endl;
            int kernel_id = 0;
            for(auto &j: i.OutputImageFromKernel)
            {
                cout<<"----kernel id: "<<kernel_id<<endl;
                cout<<j<<endl;
                kernel_id++;
            }
            sample_IIID++;
        }
    };

    auto print_delta_images = [&](Layer *l)
    {
        // print a images
        cout<<"XXXXXX::'Delta' images from layer: "<<l->GetID()<<endl;
        auto & images = l->GetImagesFullDelta();
        int sample_IIID = 0;
        for(auto &i: images)
        {
            cout<<"---------------------- sample id: "<<sample_IIID<<endl;
            int kernel_id = 0;
            for(auto &j: i.OutputImageFromKernel)
            {
                cout<<"----kernel id: "<<kernel_id<<endl;
                cout<<j<<endl;
                kernel_id++;
            }
            sample_IIID++;
        }
    };

    auto print_w_b_gradients = [&](Layer *l)
    {
        // print a images
        cout<<"XXXXXX::'w & b' gradients from layer: "<<l->GetID()<<endl;
        auto w_images = l->GetWeightGradients();
        auto b_images = l->GetBiasGradients();
        assert(w_images.size() == b_images.size());
        for(size_t i=0;i<w_images.size();i++)
        {
            cout<<"---------------------- sample id: "<<i<<endl;
            int kernel_id = 0;
            for(auto &j: w_images[i].OutputImageFromKernel)
            {
                cout<<"----kernel id: "<<kernel_id<<endl;
                cout<<j<<endl;
                kernel_id++;
            }
            kernel_id = 0;
            for(auto &j: b_images[i].OutputImageFromKernel)
            {
                cout<<"----kernel id: "<<kernel_id<<endl;
                cout<<j<<endl;
                kernel_id++;
            }
        }
    };

    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    print_a_images(layer_output);
    print_sigmaPrime_images(layer_output); 
    print_delta_images(layer_output);
    print_W_B_images(layer_output);

    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    //print_a_images(l6);
    //print_sigmaPrime_images(l6); 
    //print_delta_images(l6);
    //print_W_B_images(l6);


    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    //print_a_images(l1);
    //print_sigmaPrime_images(l1); 
    //print_delta_images(l1);
    //print_W_B_images(l1);

    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    //print_a_images(layer_input); 

    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    print_w_b_gradients(l1); 

    // update weights and gradients
    layer_output->UpdateWeightsAndBias();
    l6->UpdateWeightsAndBias();
    //cout<<"?????????????????"<<endl;
    l1->UpdateWeightsAndBias();

    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    //print_w_b_gradients(l1); 
    cout<<"ooooooooo000000000oooooooooo000000000ooooooooooo00000000oooooooooo0000000000000ooooooooooooo"<<endl;
    //print_W_B_images(l1);


}

// Assembly:
subq $0x4b8, %rsp            # imm = 0x4B8
movq %rdi, 0x4b0(%rsp)
movl $0xc8, %edi
callq 0x4240
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0xb0(%rsp)
leaq 0x9b52(%rip), %rsi      # 0x56430
leaq 0x9b6a(%rip), %rdx      # 0x5644f
movl $0x1, %ecx
callq 0x38ff0
jmp 0x4c8f1
movq 0xb0(%rsp), %rax
movq %rax, 0x4a8(%rsp)
movq 0x4a8(%rsp), %rax
movq %rax, 0xa0(%rsp)
movl $0x0, 0x41c(%rsp)
movl $0x0, 0x418(%rsp)
leaq 0x420(%rsp), %rdi
leaq 0x41c(%rsp), %rsi
leaq 0x418(%rsp), %rdx
callq 0x279d0
movq 0xa0(%rsp), %rcx
movups 0x420(%rsp), %xmm0
movq %rsp, %rax
movups %xmm0, (%rax)
movl $0x0, 0x38(%rax)
movl $0x0, 0x30(%rax)
movl $0x4, 0x28(%rax)
movl $0x2, 0x20(%rax)
movl $0x0, 0x18(%rax)
movl $0x0, 0x10(%rax)
xorl %eax, %eax
movl %eax, %r9d
leaq 0x430(%rsp), %rdi
movl $0x3, %esi
movl $0x1, %edx
xorps %xmm2, %xmm2
movq %r9, %r8
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x46830
movl $0x490, %edi            # imm = 0x490
callq 0x4240
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0xa8(%rsp)
movq 0x490(%rsp), %rax
movq %rax, 0x400(%rsp)
movups 0x480(%rsp), %xmm0
movaps %xmm0, 0x3f0(%rsp)
movups 0x470(%rsp), %xmm0
movaps %xmm0, 0x3e0(%rsp)
movups 0x430(%rsp), %xmm0
movups 0x440(%rsp), %xmm1
movups 0x450(%rsp), %xmm2
movups 0x460(%rsp), %xmm3
movaps %xmm3, 0x3d0(%rsp)
movaps %xmm2, 0x3c0(%rsp)
movaps %xmm1, 0x3b0(%rsp)
movaps %xmm0, 0x3a0(%rsp)
movq 0x400(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x60(%rax)
movaps 0x3f0(%rsp), %xmm0
movups %xmm0, 0x50(%rax)
movaps 0x3e0(%rsp), %xmm0
movups %xmm0, 0x40(%rax)
movaps 0x3a0(%rsp), %xmm0
movaps 0x3b0(%rsp), %xmm1
movaps 0x3c0(%rsp), %xmm2
movaps 0x3d0(%rsp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4ea0
jmp 0x4ca91
movq 0xa8(%rsp), %rax
movq %rax, 0x410(%rsp)
movq 0x410(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq 0x4a8(%rsp), %rax
movq %rax, 0x90(%rsp)
movl $0x2, 0x324(%rsp)
movl $0x2, 0x320(%rsp)
leaq 0x328(%rsp), %rdi
leaq 0x324(%rsp), %rsi
leaq 0x320(%rsp), %rdx
callq 0x279d0
movq 0x90(%rsp), %rcx
movups 0x328(%rsp), %xmm0
movq %rsp, %rax
movups %xmm0, (%rax)
movl $0x0, 0x38(%rax)
movl $0x0, 0x30(%rax)
movl $0x3, 0x28(%rax)
movl $0x0, 0x20(%rax)
movl $0x0, 0x18(%rax)
movl $0x0, 0x10(%rax)
xorl %eax, %eax
movl %eax, %r8d
leaq 0x338(%rsp), %rdi
movl $0x1, %edx
movl $0x2, %r9d
movsd 0x54bb(%rip), %xmm1     # 0x52010
movsd 0x8d33(%rip), %xmm2     # 0x55890
movl %edx, %esi
movaps %xmm2, %xmm0
callq 0x46830
movl $0x490, %edi            # imm = 0x490
callq 0x4240
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x98(%rsp)
movq 0x398(%rsp), %rax
movq %rax, 0x310(%rsp)
movups 0x388(%rsp), %xmm0
movaps %xmm0, 0x300(%rsp)
movups 0x378(%rsp), %xmm0
movaps %xmm0, 0x2f0(%rsp)
movups 0x338(%rsp), %xmm0
movups 0x348(%rsp), %xmm1
movups 0x358(%rsp), %xmm2
movups 0x368(%rsp), %xmm3
movaps %xmm3, 0x2e0(%rsp)
movaps %xmm2, 0x2d0(%rsp)
movaps %xmm1, 0x2c0(%rsp)
movaps %xmm0, 0x2b0(%rsp)
movq 0x310(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x60(%rax)
movaps 0x300(%rsp), %xmm0
movups %xmm0, 0x50(%rax)
movaps 0x2f0(%rsp), %xmm0
movups %xmm0, 0x40(%rax)
movaps 0x2b0(%rsp), %xmm0
movaps 0x2c0(%rsp), %xmm1
movaps 0x2d0(%rsp), %xmm2
movaps 0x2e0(%rsp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4ea0
jmp 0x4cc4c
movq 0x98(%rsp), %rax
movq %rax, 0x318(%rsp)
movq 0x318(%rsp), %rdi
movq 0x410(%rsp), %rsi
movq (%rdi), %rax
movq 0x1e8(%rax), %rax
callq *%rax
movq 0x318(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq 0x4a8(%rsp), %rax
movq %rax, 0x80(%rsp)
movl $0x0, 0x234(%rsp)
movl $0x0, 0x230(%rsp)
leaq 0x238(%rsp), %rdi
leaq 0x234(%rsp), %rsi
leaq 0x230(%rsp), %rdx
callq 0x279d0
movq 0x80(%rsp), %rcx
movups 0x238(%rsp), %xmm0
movq %rsp, %rax
movups %xmm0, (%rax)
movl $0x0, 0x38(%rax)
movl $0x0, 0x30(%rax)
movl $0x3, 0x28(%rax)
movl $0x0, 0x20(%rax)
movl $0x0, 0x18(%rax)
movl $0x0, 0x10(%rax)
xorl %edx, %edx
movl %edx, %r9d
leaq 0x248(%rsp), %rdi
movl $0xa, %r8d
movsd 0x52e9(%rip), %xmm1     # 0x52010
movsd 0x8b61(%rip), %xmm2     # 0x55890
movl %edx, %esi
movaps %xmm2, %xmm0
callq 0x46830
movl $0x490, %edi            # imm = 0x490
callq 0x4240
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x88(%rsp)
movq 0x2a8(%rsp), %rax
movq %rax, 0x220(%rsp)
movups 0x298(%rsp), %xmm0
movaps %xmm0, 0x210(%rsp)
movups 0x288(%rsp), %xmm0
movaps %xmm0, 0x200(%rsp)
movups 0x248(%rsp), %xmm0
movups 0x258(%rsp), %xmm1
movups 0x268(%rsp), %xmm2
movups 0x278(%rsp), %xmm3
movaps %xmm3, 0x1f0(%rsp)
movaps %xmm2, 0x1e0(%rsp)
movaps %xmm1, 0x1d0(%rsp)
movaps %xmm0, 0x1c0(%rsp)
movq 0x220(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x60(%rax)
movaps 0x210(%rsp), %xmm0
movups %xmm0, 0x50(%rax)
movaps 0x200(%rsp), %xmm0
movups %xmm0, 0x40(%rax)
movaps 0x1c0(%rsp), %xmm0
movaps 0x1d0(%rsp), %xmm1
movaps 0x1e0(%rsp), %xmm2
movaps 0x1f0(%rsp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4ea0
jmp 0x4ce1e
movq 0x88(%rsp), %rax
movq %rax, 0x228(%rsp)
movq 0x228(%rsp), %rdi
movq 0x318(%rsp), %rsi
movq (%rdi), %rax
movq 0x1e8(%rax), %rax
callq *%rax
movq 0x228(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq 0x4a8(%rsp), %rax
movq %rax, 0x70(%rsp)
movl $0x0, 0x144(%rsp)
movl $0x0, 0x140(%rsp)
leaq 0x148(%rsp), %rdi
leaq 0x144(%rsp), %rsi
leaq 0x140(%rsp), %rdx
callq 0x279d0
movq 0x70(%rsp), %rcx
movups 0x148(%rsp), %xmm0
movq %rsp, %rax
movups %xmm0, (%rax)
movl $0x0, 0x38(%rax)
movl $0x0, 0x30(%rax)
movl $0x1, 0x28(%rax)
movl $0x0, 0x20(%rax)
movl $0x0, 0x18(%rax)
movl $0x0, 0x10(%rax)
xorl %edx, %edx
movl %edx, %r9d
leaq 0x158(%rsp), %rdi
movl $0x4, %esi
movl $0x2, %r8d
xorps %xmm1, %xmm1
movsd 0x8995(%rip), %xmm2     # 0x55890
movaps %xmm2, %xmm0
callq 0x46830
movl $0x490, %edi            # imm = 0x490
callq 0x4240
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x78(%rsp)
movq 0x1b8(%rsp), %rax
movq %rax, 0x130(%rsp)
movups 0x1a8(%rsp), %xmm0
movaps %xmm0, 0x120(%rsp)
movups 0x198(%rsp), %xmm0
movaps %xmm0, 0x110(%rsp)
movups 0x158(%rsp), %xmm0
movups 0x168(%rsp), %xmm1
movups 0x178(%rsp), %xmm2
movups 0x188(%rsp), %xmm3
movaps %xmm3, 0x100(%rsp)
movaps %xmm2, 0xf0(%rsp)
movaps %xmm1, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movq 0x130(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x60(%rax)
movaps 0x120(%rsp), %xmm0
movups %xmm0, 0x50(%rax)
movaps 0x110(%rsp), %xmm0
movups %xmm0, 0x40(%rax)
movaps 0xd0(%rsp), %xmm0
movaps 0xe0(%rsp), %xmm1
movaps 0xf0(%rsp), %xmm2
movaps 0x100(%rsp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x4ea0
jmp 0x4cfe5
movq 0x78(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x138(%rsp), %rdi
movq 0x228(%rsp), %rsi
movq (%rdi), %rax
callq *0x1e8(%rax)
movq 0x138(%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x318(%rsp), %rdi
movq 0x228(%rsp), %rsi
movq (%rdi), %rax
callq *0x1f0(%rax)
movq 0x228(%rsp), %rdi
movq 0x138(%rsp), %rsi
movq (%rdi), %rax
callq *0x1f0(%rax)
movq 0x4a8(%rsp), %rdi
callq 0x3a2a0
movq 0x410(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x318(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x228(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x138(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x318(%rsp), %rdi
movq (%rdi), %rax
callq *0x88(%rax)
movq 0x228(%rsp), %rdi
movq (%rdi), %rax
callq *0x88(%rax)
movq 0x138(%rsp), %rdi
movq (%rdi), %rax
callq *0x88(%rax)
movq 0x4a8(%rsp), %rdi
callq 0x39b20
movq 0x4a8(%rsp), %rdi
callq 0x3a030
movq 0x410(%rsp), %rdi
movq (%rdi), %rax
callq *0x180(%rax)
movq 0x4a8(%rsp), %rdi
callq 0x1f310
movl %eax, 0xcc(%rsp)
movl $0x0, 0xc8(%rsp)
movl 0xc8(%rsp), %eax
cmpl 0xcc(%rsp), %eax
jge 0x4d270
movq 0x318(%rsp), %rdi
movl 0xc8(%rsp), %esi
movq (%rdi), %rax
callq *0x28(%rax)
movq 0x318(%rsp), %rdi
movl 0xc8(%rsp), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x228(%rsp), %rdi
movl 0xc8(%rsp), %esi
movq (%rdi), %rax
callq *0x28(%rax)
movq 0x228(%rsp), %rdi
movl 0xc8(%rsp), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x138(%rsp), %rdi
movl 0xc8(%rsp), %esi
movq (%rdi), %rax
callq *0x28(%rax)
movq 0x138(%rsp), %rdi
movl 0xc8(%rsp), %esi
movq (%rdi), %rax
callq *0x30(%rax)
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc8(%rsp)
jmp 0x4d10d
movq 0xb0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a0(%rsp)
movl %eax, 0x49c(%rsp)
callq 0x4220
jmp 0x4d52d
movq 0xa8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a0(%rsp)
movl %eax, 0x49c(%rsp)
callq 0x4220
jmp 0x4d52d
movq 0x98(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a0(%rsp)
movl %eax, 0x49c(%rsp)
callq 0x4220
jmp 0x4d52d
movq 0x88(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a0(%rsp)
movl %eax, 0x49c(%rsp)
callq 0x4220
jmp 0x4d52d
movq 0x78(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4a0(%rsp)
movl %eax, 0x49c(%rsp)
callq 0x4220
jmp 0x4d52d
movq 0x1dd61(%rip), %rdi     # 0x6afd8
leaq 0x9367(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1dd23(%rip), %rsi     # 0x6afb0
callq 0x4260
movq 0x410(%rsp), %rsi
leaq 0xc5(%rsp), %rdi
callq 0x4d540
movq 0x410(%rsp), %rsi
leaq 0xc6(%rsp), %rdi
callq 0x4d750
movq 0x410(%rsp), %rsi
leaq 0xc7(%rsp), %rdi
callq 0x4d920
movq 0x1dd00(%rip), %rdi     # 0x6afd8
leaq 0x9306(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1dcc2(%rip), %rsi     # 0x6afb0
callq 0x4260
movq 0x1dcde(%rip), %rdi     # 0x6afd8
leaq 0x92e4(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1dca0(%rip), %rsi     # 0x6afb0
callq 0x4260
movq 0x1dcbc(%rip), %rdi     # 0x6afd8
leaq 0x92c2(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1dc7e(%rip), %rsi     # 0x6afb0
callq 0x4260
movl $0x0, 0xc0(%rsp)
movl 0xc0(%rsp), %eax
cmpl 0xcc(%rsp), %eax
jge 0x4d3a4
movq 0x138(%rsp), %rdi
movl 0xc0(%rsp), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movq 0x228(%rsp), %rdi
movl 0xc0(%rsp), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movq 0x318(%rsp), %rdi
movl 0xc0(%rsp), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
jmp 0x4d342
movq 0x1dc2d(%rip), %rdi     # 0x6afd8
leaq 0x9233(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1dbef(%rip), %rsi     # 0x6afb0
callq 0x4260
movq 0x138(%rsp), %rsi
leaq 0xc7(%rsp), %rdi
callq 0x4d920
movq 0x138(%rsp), %rsi
leaq 0xbf(%rsp), %rdi
callq 0x4daf0
movq 0x138(%rsp), %rsi
leaq 0xbe(%rsp), %rdi
callq 0x4dcc0
movq 0x138(%rsp), %rsi
leaq 0xc5(%rsp), %rdi
callq 0x4d540
movq 0x1dbb7(%rip), %rdi     # 0x6afd8
leaq 0x91bd(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1db79(%rip), %rsi     # 0x6afb0
callq 0x4260
movq 0x1db95(%rip), %rdi     # 0x6afd8
leaq 0x919b(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1db57(%rip), %rsi     # 0x6afb0
callq 0x4260
movq 0x1db73(%rip), %rdi     # 0x6afd8
leaq 0x9179(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1db35(%rip), %rsi     # 0x6afb0
callq 0x4260
movq 0x1db51(%rip), %rdi     # 0x6afd8
leaq 0x9157(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1db13(%rip), %rsi     # 0x6afb0
callq 0x4260
movq 0x318(%rsp), %rsi
leaq 0xbd(%rsp), %rdi
callq 0x4de90
movq 0x138(%rsp), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq 0x228(%rsp), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq 0x318(%rsp), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq 0x1daf0(%rip), %rdi     # 0x6afd8
leaq 0x90f6(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1dab2(%rip), %rsi     # 0x6afb0
callq 0x4260
movq 0x1dace(%rip), %rdi     # 0x6afd8
leaq 0x90d4(%rip), %rsi      # 0x565e5
callq 0x4230
movq %rax, %rdi
movq 0x1da90(%rip), %rsi     # 0x6afb0
callq 0x4260
addq $0x4b8, %rsp            # imm = 0x4B8
retq
movq 0x4a0(%rsp), %rdi
callq 0x43f0
nopw (%rax,%rax)