// File: /workspace/github_cpp_makefile_star2_O1/ynilu[P]elastic/simulator.cpp
// Function: main
int main(int argc, char *argv[])
{
    if( argc > 6 )
    {
        cout << "\nToo many arguments,EX: simulation labmda rquest_number" << "\n";
        return 1;
    }
    if( argc > 1 )
    {
        if( atoi( argv[ 1 ] ) > 0 )
        {
            traffic_lambda = atoi( argv[ 1 ] );
        }
        else
        {
            cout << "\nError parameter: 1" << "\n";
            return 1;
        }
    }
    if( argc > 2 )
    {
        if( atoi( argv[ 2 ] ) > 0 )
        {
            num_requests = atoi( argv[ 2 ] );
        }
        else
        {
            cout << "\nError parameter: 2" << "\n";
            return 1;
        }
    }
    if( argc > 3 )
    {
        if( atoi( argv[ 3 ] ) == 0 )
        {
            enable_OTDM = 0;
        }
    }
    if( argc > 4 )
    {
        if( atoi( argv[ 4 ] ) > 0 )
        {
            num_transceiver = atoi( argv[ 4 ] );
        }
        else
        {
            cout << "\nError parameter: 4" << "\n";
            return 1;
        }
    }
    if( argc > 5 )
    {
        switch( atoi( argv[5] ) )
        {
        case 1:
            graph_file = (char*) "USnet.txt";
            source_file = (char*) "USnet_source.txt";
            traffic_file = (char*) "USnet_traffic.txt";
            break;
        default:
            break;
        }
    }

    if(num_transceiver < 800)
    {
        OEO_weight = hop_limit;
    }

    if(enable_OTDM)
    {
        num_OFDM_transceiver = num_transceiver / 2;
        num_OTDM_transceiver = num_transceiver / 2;
    }
    else
    {
        num_OFDM_transceiver = num_transceiver;
        num_OTDM_transceiver = 0;
    }

    start_clk = clock();

    accepted_requests_BM.resize(num_batch, 0);
    blocked_requests_BM.resize(num_batch, 0);
    blocked_bandwidth_BM.resize(num_batch, 0);
    num_OEO_BM.resize(num_batch, 0);
    num_OFDM_lightpath_use_BM.resize(num_batch, 0);
    num_OTDM_lightpath_use_BM.resize(num_batch, 0);

    Graph_info g_info;
    g_info.graph_file = graph_file;
    g_info.num_slots = num_slots;
    g_info.num_OTDM_transceiver = num_OTDM_transceiver;
    g_info.num_OFDM_transceiver = num_OFDM_transceiver;
    g_info.slot_capacity = slot_capacity;
    g_info.transceiver_slot_limit = transceiver_slot_limit;
    g_info.transceiver_connection_limit = transceiver_connection_limit;
    g_info.transmission_distance_16QAM = transmission_distance_16QAM;
    g_info.transmission_distance_8QAM = transmission_distance_8QAM;
    g_info.transmission_distance_QPSK = transmission_distance_QPSK;

    Phy_graph p_graph(g_info);

    cout << "num_nodes : " << p_graph.node_list.size() << "\n";
    num_nodes = p_graph.node_list.size();

    Traffic_info t_info;
    t_info.source_file = source_file;
    t_info.traffic_file = traffic_file;
    t_info.num_nodes = p_graph.node_list.size();
    t_info.num_requests = num_requests;
    t_info.OC1_share = OC1_share;
    t_info.OC3_share = OC3_share;
    t_info.OC9_share = OC9_share;
    t_info.OC12_share = OC12_share;
    t_info.OC18_share = OC18_share;
    t_info.OC24_share = OC24_share;
    t_info.OC36_share = OC36_share;
    t_info.OC48_share = OC48_share;
    t_info.OC192_share = OC192_share;
    t_info.OC768_share = OC768_share;
    t_info.OC3072_share = OC3072_share;
    t_info.traffic_lambda = traffic_lambda;
    t_info.traffic_mu = traffic_mu;
    t_info.unicast_percentage = unicast_percentage;

    t_info.aTime_seed = aTime_seed;
    t_info.hTime_seed = hTime_seed;
    t_info.s_seed = s_seed;
    t_info.d_seed = d_seed;
    t_info.numD_seed = numD_seed;
    t_info.b_seed = b_seed;

    Traffic traffic (t_info);

    request2lightpath.resize(num_requests);

    Auxiliary_info a_info;
    a_info.num_nodes = num_nodes;
    a_info.num_slots = num_slots;
    a_info.transceiver_weight = transceiver_weight;
    a_info.used_transceiver_weight = used_transceiver_weight;
    a_info.OFDM_transceiver_weight = OFDM_transceiver_weight;
    a_info.used_OFDM_transceiver_weight = used_OFDM_transceiver_weight;
    a_info.OEO_weight = OEO_weight;
    Aux_graph a_graph(a_info);


    while( !traffic.empty() )
    {
        Event event = traffic.next_event();
        if(event.type == Event::arrival)
        {
            cout << "arrival :\nid = " << event.request_id << "\nsource = " << event.source << "\ndest = " << *event.destination.begin() << "\nbandwidth = " << event.bandwidth << "\narrivaltime = " << event.arrival_time << "\n\n";
            start_clk_construction = clock();
            construct_candidate_path(event, p_graph, a_graph);
            construct_exist_path(event, p_graph, a_graph);
            clk_construction += (double) ( clock() - start_clk_construction ) / CLOCKS_PER_SEC;
            start_clk_finding = clock();
            Aux_node* aux_source = a_graph.get_adding_node(event.source);
            Aux_node* aux_destination = a_graph.get_dropping_node(*(event.destination.begin()));
            Aux_node2Aux_link result = BellmanFordSP(aux_source);
            clk_finding += (double) ( clock() - start_clk_finding ) / CLOCKS_PER_SEC;
            start_clk_parsing = clock();
            if(result[aux_destination] != NULL) // Accepted
            {
                path_parsing(p_graph, result, aux_source, aux_destination, event);
                accepted_requests++;
                accepted_requests_BM[(int)event.request_id/(num_requests/num_batch)]++;
            }
            else
            {
                blocked_requests++;
                blocked_requests_BM[(int)event.request_id/(num_requests/num_batch)]++;
                blocked_bandwidth += event.bandwidth;
                blocked_bandwidth_BM[(int)event.request_id/(num_requests/num_batch)] += event.bandwidth;
            }
            clk_parsing += (double) ( clock() - start_clk_parsing ) / CLOCKS_PER_SEC;
            total_bandwidth += event.bandwidth;
            start_clk_construction = clock();
            reset_auxiliary_graph();
            clk_construction += (double) ( clock() - start_clk_construction ) / CLOCKS_PER_SEC;
        }
        else // if(event.type == Event::departure)
        {
            cout << "departure :\nid = " << event.request_id << "\nsource = " << event.source << "\ndest = " << *event.destination.begin() << "\nbandwidth = " << event.bandwidth << "\narrivaltime = " << event.arrival_time << "\n\n";
            for(auto &lp : request2lightpath[event.request_id])
            {
                lp->requests.erase(event.request_id);
                if(lp->requests.empty())
                {
                    int slot_st;
                    int slot_ed;
                    Path& path = lp->p_path;
                    switch(lp->type)
                    {
                    case LightPath::OTDM:
                        slot_st = lp->spectrum.slot_st;
                        slot_ed = lp->spectrum.slot_ed;

                        for(unsigned int node_i = 0; node_i < path.size() - 1; node_i++)
                        {
                            int from = path[node_i];
                            int to = path[node_i + 1];
                            Phy_link& link = p_graph.get_link(from, to);

                            for(int i = slot_st; i <= slot_ed; i++)
                            {
                                link.slot[i] = -1;
                            }
                        }

                        for(unsigned int i = 0; i < lp->transmitter_index.size(); i++)
                        {
                            if(lp->transmitter_index[i] != -1)
                            {
                                p_graph.get_node(path[i]).num_available_transmitter++;
                            }
                        }

                        for(unsigned int i = 0; i < lp->receiver_index.size(); i++)
                        {
                            if(lp->receiver_index[i] != -1)
                            {
                                p_graph.get_node(path[i]).num_available_receiver++;
                            }
                        }
                        delete lp;
                        exist_OTDM_light_path_list.remove(lp);
                        break;
                    case LightPath::OFDM_WOB:
                    case LightPath::OFDM_WB:
                    case LightPath::OFDM:
                        slot_st = lp->spectrum.slot_st;
                        slot_ed = lp->spectrum.slot_ed;

                        Phy_node& src_node = p_graph.get_node(path.front());
                        Phy_node& dst_node = p_graph.get_node(path.back());
                        src_node.OFDMtransmitter[lp->transmitter_index.front()].num_available_sub_transceiver++;
                        dst_node.OFDMreceiver[lp->receiver_index.back()].num_available_sub_transceiver++;

                        for(unsigned int node_i = 0; node_i < path.size() - 1; node_i++)
                        {
                            int from = path[node_i];
                            int to = path[node_i + 1];
                            Phy_link& link = p_graph.get_link(from, to);

                            for(int i = slot_st; i <= slot_ed; i++)
                            {
                                link.slot[i] = -1;
                            }
                        }

                        if(src_node.OFDMtransmitter[lp->transmitter_index.front()].num_available_sub_transceiver >= transceiver_connection_limit)
                        {
                            src_node.OFDMtransmitter[lp->transmitter_index.front()].spectrum.slot_st = -1;
                            src_node.OFDMtransmitter[lp->transmitter_index.front()].spectrum.slot_ed = -1;
                            src_node.OFDMtransmitter[lp->transmitter_index.front()].in_used = false;
                            src_node.OFDMtransmitter[lp->transmitter_index.front()].num_available_sub_transceiver = transceiver_connection_limit;
                            src_node.num_available_OFDM_transmitter++;
                        }

                        if(dst_node.OFDMreceiver[lp->receiver_index.back()].num_available_sub_transceiver >= transceiver_connection_limit)
                        {
                            dst_node.OFDMreceiver[lp->receiver_index.back()].spectrum.slot_st = -1;
                            dst_node.OFDMreceiver[lp->receiver_index.back()].spectrum.slot_ed = -1;
                            dst_node.OFDMreceiver[lp->receiver_index.back()].in_used = false;
                            dst_node.OFDMreceiver[lp->receiver_index.back()].num_available_sub_transceiver = transceiver_connection_limit;
                            dst_node.num_available_OFDM_receiver++;
                        }
                        delete lp;
                        exist_OFDM_light_path_list.remove(lp);
                        break;
                    }
                }
                else
                {
                    lp->available_bitrate += event.bandwidth;
                }
            }
            end_time = event.arrival_time;
        }
    }
    total_network_bandwidth = slot_capacity * num_slots * p_graph.link_list.size();
    print_result(traffic);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5d8, %rsp            # imm = 0x5D8
cmpl $0x7, %edi
jl 0x393a
movq 0x146a7(%rip), %rbx     # 0x17fd0
leaq 0xd7c0(%rip), %rsi      # 0x110f0
movl $0x37, %edx
jmp 0x45c8
movq %rsi, %rbx
movl %edi, %ebp
cmpl $0x2, %edi
jl 0x395b
movq 0x8(%rbx), %rdi
callq 0x32f0
testl %eax, %eax
jle 0x4595
movl %eax, 0x14899(%rip)     # 0x181f4
cmpl $0x3, %ebp
jl 0x3977
movq 0x10(%rbx), %rdi
callq 0x32f0
testl %eax, %eax
jle 0x45a5
movl %eax, 0x14875(%rip)     # 0x181ec
cmpl $0x4, %ebp
jl 0x3993
movq 0x18(%rbx), %rdi
callq 0x32f0
testl %eax, %eax
jne 0x3993
movl $0x0, 0x14885(%rip)     # 0x18218
cmpl $0x5, %ebp
jl 0x39af
movq 0x20(%rbx), %rdi
callq 0x32f0
testl %eax, %eax
jle 0x45b5
movl %eax, 0x1484d(%rip)     # 0x181fc
cmpl $0x6, %ebp
jne 0x39ec
movq 0x28(%rbx), %rdi
callq 0x32f0
cmpl $0x1, %eax
jne 0x39ec
leaq 0xd79b(%rip), %rax      # 0x11164
movq %rax, 0x148c8(%rip)     # 0x18298
leaq 0xd797(%rip), %rax      # 0x1116e
movq %rax, 0x148c2(%rip)     # 0x182a0
leaq 0xd79a(%rip), %rax      # 0x1117f
movq %rax, 0x148bc(%rip)     # 0x182a8
movl 0x1480a(%rip), %eax     # 0x181fc
cmpl $0x31f, %eax            # imm = 0x31F
jg 0x3a09
cvtsi2sdl 0x147e3(%rip), %xmm0 # 0x181e4
movsd %xmm0, 0x14a07(%rip)    # 0x18410
movl 0x14809(%rip), %ecx     # 0x18218
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
testl %ecx, %ecx
cmovnel %edx, %eax
cmovel %ecx, %edx
movl %eax, 0x147de(%rip)     # 0x18204
movl %edx, 0x147d4(%rip)     # 0x18200
callq 0x3150
movq %rax, 0x14890(%rip)     # 0x182c8
movslq 0x147a1(%rip), %rsi     # 0x181e0
xorl %ebp, %ebp
leaq 0x158(%rsp), %rbx
movl %ebp, (%rbx)
leaq 0x148e6(%rip), %rdi     # 0x18338
movq %rbx, %rdx
callq 0x85f6
movslq 0x1477f(%rip), %rsi     # 0x181e0
movl %ebp, (%rbx)
leaq 0x148e6(%rip), %rdi     # 0x18350
leaq 0x158(%rsp), %rbx
movq %rbx, %rdx
callq 0x85f6
movslq 0x1475f(%rip), %rsi     # 0x181e0
movl %ebp, (%rbx)
leaq 0x148de(%rip), %rdi     # 0x18368
leaq 0x158(%rsp), %rbx
movq %rbx, %rdx
callq 0x85f6
movslq 0x1473f(%rip), %rsi     # 0x181e0
movl %ebp, (%rbx)
leaq 0x148d6(%rip), %rdi     # 0x18380
leaq 0x158(%rsp), %rbx
movq %rbx, %rdx
callq 0x85f6
movslq 0x1471f(%rip), %rsi     # 0x181e0
movl %ebp, (%rbx)
leaq 0x148ce(%rip), %rdi     # 0x18398
leaq 0x158(%rsp), %rbx
movq %rbx, %rdx
callq 0x85f6
movslq 0x146ff(%rip), %rsi     # 0x181e0
movl %ebp, (%rbx)
leaq 0x148c6(%rip), %rdi     # 0x183b0
leaq 0x158(%rsp), %rdx
callq 0x85f6
movq 0x1479a(%rip), %rax     # 0x18298
leaq 0x3d0(%rsp), %rsi
movq %rax, (%rsi)
movl 0x146e1(%rip), %eax     # 0x181f0
movl %eax, 0x8(%rsi)
movl 0x146e8(%rip), %eax     # 0x18200
movl %eax, 0xc(%rsi)
movl 0x146e3(%rip), %eax     # 0x18204
movl %eax, 0x10(%rsi)
movl 0x146de(%rip), %eax     # 0x18208
movl %eax, 0x14(%rsi)
movl 0x146d9(%rip), %eax     # 0x1820c
movl %eax, 0x18(%rsi)
movl 0x146d4(%rip), %eax     # 0x18210
movl %eax, 0x1c(%rsi)
movl 0x146db(%rip), %eax     # 0x18220
movl %eax, 0x20(%rsi)
movl 0x146d6(%rip), %eax     # 0x18224
movl %eax, 0x24(%rsi)
movl 0x146d1(%rip), %eax     # 0x18228
movl %eax, 0x28(%rsi)
leaq 0x90(%rsp), %rdi
callq 0xa98e
movq 0x14462(%rip), %rdi     # 0x17fd0
leaq 0xd61c(%rip), %rsi      # 0x11191
movl $0xc, %edx
callq 0x3250
movq 0xa0(%rsp), %rax
subq 0x98(%rsp), %rax
sarq $0x3, %rax
movabsq $-0x79435e50d79435e5, %rsi # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rsi
movq 0x14428(%rip), %rdi     # 0x17fd0
callq 0x3160
leaq 0xd62d(%rip), %rsi      # 0x111e1
movl $0x1, %edx
movq %rax, %rdi
callq 0x3250
movq 0xa0(%rsp), %rax
subq 0x98(%rsp), %rax
shrq $0x3, %rax
imull $0x286bca1b, %eax, %eax # imm = 0x286BCA1B
movl %eax, 0x1471f(%rip)     # 0x18300
movq 0x146b8(%rip), %rcx     # 0x182a0
leaq 0x550(%rsp), %rsi
movq %rcx, (%rsi)
movq 0x146ae(%rip), %rcx     # 0x182a8
movq %rcx, 0x8(%rsi)
movl %eax, 0x10(%rsi)
movl 0x145e5(%rip), %eax     # 0x181ec
movl %eax, 0x14(%rsi)
movl 0x146f4(%rip), %eax     # 0x18304
movl %eax, 0x58(%rsi)
movl 0x146ef(%rip), %eax     # 0x18308
movl %eax, 0x5c(%rsi)
movl 0x146ea(%rip), %eax     # 0x1830c
movl %eax, 0x60(%rsi)
movl 0x146e5(%rip), %eax     # 0x18310
movl %eax, 0x64(%rsi)
movl 0x145f8(%rip), %eax     # 0x1822c
movl %eax, 0x68(%rsi)
movl 0x145f3(%rip), %eax     # 0x18230
movl %eax, 0x6c(%rsi)
movl 0x145ee(%rip), %eax     # 0x18234
movl %eax, 0x70(%rsi)
movl 0x145e9(%rip), %eax     # 0x18238
movl %eax, 0x74(%rsi)
movl 0x145e4(%rip), %eax     # 0x1823c
movl %eax, 0x78(%rsi)
movl 0x145df(%rip), %eax     # 0x18240
movl %eax, 0x7c(%rsi)
movl 0x145da(%rip), %eax     # 0x18244
movl %eax, 0x80(%rsi)
movl 0x1457e(%rip), %eax     # 0x181f4
movl %eax, 0x18(%rsi)
movl 0x14579(%rip), %eax     # 0x181f8
movl %eax, 0x1c(%rsi)
movss 0x1455e(%rip), %xmm0    # 0x181e8
movss %xmm0, 0x20(%rsi)
movq 0x145b2(%rip), %rax     # 0x18248
movq %rax, 0x28(%rsi)
movq 0x145af(%rip), %rax     # 0x18250
movq %rax, 0x30(%rsi)
movq 0x145ac(%rip), %rax     # 0x18258
movq %rax, 0x38(%rsi)
movq 0x145a9(%rip), %rax     # 0x18260
movq %rax, 0x40(%rsi)
movq 0x145a6(%rip), %rax     # 0x18268
movq %rax, 0x48(%rsi)
movq 0x145a3(%rip), %rax     # 0x18270
movq %rax, 0x50(%rsi)
leaq 0x158(%rsp), %rdi
callq 0xde70
movslq 0x14507(%rip), %rsi     # 0x181ec
leaq 0x14774(%rip), %rdi     # 0x18460
callq 0x862a
movl 0x14609(%rip), %eax     # 0x18300
leaq 0x3a0(%rsp), %rsi
movl %eax, 0x4(%rsi)
movl 0x144e8(%rip), %eax     # 0x181f0
movl %eax, (%rsi)
movsd 0x146de(%rip), %xmm0    # 0x183f0
movsd %xmm0, 0x8(%rsi)
movsd 0x146d9(%rip), %xmm0    # 0x183f8
movsd %xmm0, 0x10(%rsi)
movsd 0x146d4(%rip), %xmm0    # 0x18400
movsd %xmm0, 0x18(%rsi)
movsd 0x146cf(%rip), %xmm0    # 0x18408
movsd %xmm0, 0x20(%rsi)
movsd 0x146ca(%rip), %xmm0    # 0x18410
movsd %xmm0, 0x28(%rsi)
leaq 0x2a8(%rsp), %rdi
callq 0xf7a2
leaq 0x34(%rsp), %r14
leaq 0x158(%rsp), %rbx
leaq 0x28(%rsp), %r15
movq 0x1425f(%rip), %r12     # 0x17fd0
leaq 0x90(%rsp), %r13
leaq 0x2a8(%rsp), %rbp
movq %rbx, %rdi
callq 0xe8ac
testb %al, %al
jne 0x4520
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe8b8
cmpl $0x0, 0x30(%rsp)
je 0x423b
movl $0x11, %edx
movq %r12, %rdi
leaq 0xd42d(%rip), %rsi      # 0x111e3
callq 0x3250
movl 0x34(%rsp), %esi
movq %r12, %rdi
callq 0x3360
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
leaq 0xd3d5(%rip), %rsi      # 0x111ae
callq 0x3250
movl 0x38(%rsp), %esi
movq %rbx, %rdi
callq 0x3360
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
leaq 0xd3bd(%rip), %rsi      # 0x111b9
callq 0x3250
movq 0x58(%rsp), %rax
movl 0x20(%rax), %esi
movq %rbx, %rdi
callq 0x3360
movq %rax, %rbx
movl $0xd, %edx
movq %rax, %rdi
leaq 0xd39f(%rip), %rsi      # 0x111c2
callq 0x3250
movl 0x74(%rsp), %esi
movq %rbx, %rdi
callq 0x3360
movq %rax, %rbx
movl $0xf, %edx
movq %rax, %rdi
leaq 0xd38a(%rip), %rsi      # 0x111d0
callq 0x3250
cvtss2sd 0x78(%rsp), %xmm0
movq %rbx, %rdi
callq 0x3310
movl $0x2, %edx
movq %rax, %rdi
leaq 0xd378(%rip), %rsi      # 0x111e0
callq 0x3250
movslq 0x34(%rsp), %rax
movq 0x145e7(%rip), %rcx     # 0x18460
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rbp
movq 0x8(%rcx,%rax,8), %r12
cmpq %r12, %rbp
movq %r12, 0x18(%rsp)
je 0x4225
movq (%rbp), %rbx
addq $0x10, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a40
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9ab8
movq (%rbp), %r15
cmpq $0x0, 0x38(%r15)
je 0x3eca
movl 0x74(%rsp), %eax
addl %eax, 0x44(%r15)
jmp 0x4218
movl 0x8(%r15), %eax
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
jae 0x40ac
movslq 0x58(%r15), %r14
movl 0x5c(%r15), %r12d
movq 0x68(%r15), %rax
movl (%rax), %esi
movq %r13, %rdi
callq 0xb390
movq %rax, %rbx
movq 0x70(%r15), %rax
movl -0x4(%rax), %esi
movq %r13, %rdi
callq 0xb390
movq (%rbp), %rsi
movq 0xc8(%rsi), %rcx
movslq (%rcx), %rcx
movq %rbx, 0x80(%rsp)
movq 0x68(%rbx), %rdx
imulq $0x58, %rcx, %rcx
incl 0xc(%rdx,%rcx)
movq 0xe8(%rsi), %rcx
movslq -0x4(%rcx), %rdx
movq %rax, 0x88(%rsp)
movq 0x80(%rax), %rcx
imulq $0x58, %rdx, %rax
incl 0xc(%rcx,%rax)
movq 0x68(%r15), %rax
movq 0x70(%r15), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0x3fcd
leaq (,%r14,4), %rcx
movq %rcx, 0x10(%rsp)
movl %r12d, %ecx
subl %r14d, %ecx
leaq 0x4(,%rcx,4), %rcx
movq %rcx, 0x8(%rsp)
movl $0x1, %ebx
xorl %r13d, %r13d
movl (%rax,%r13,4), %esi
movl %ebx, %r13d
movl (%rax,%r13,4), %edx
leaq 0x90(%rsp), %rdi
callq 0xa972
cmpl %r12d, %r14d
jg 0x3fb4
movq 0x18(%rax), %rdi
addq 0x10(%rsp), %rdi
movl $0xff, %esi
movq 0x8(%rsp), %rdx
callq 0x3110
movq 0x68(%r15), %rax
movq 0x70(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
decq %rcx
incl %ebx
cmpq %r13, %rcx
ja 0x3f7f
movq (%rbp), %rdi
movq 0xc8(%rdi), %rcx
movslq (%rcx), %rdx
movq 0x80(%rsp), %r8
movq 0x68(%r8), %rax
imulq $0x58, %rdx, %rdx
movl 0xc(%rax,%rdx), %esi
cmpl 0x1421b(%rip), %esi     # 0x18210
jl 0x4027
addq %rax, %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %esi, 0x48(%rdx)
movslq (%rcx), %rdx
imulq $0x58, %rdx, %rdx
movl %esi, 0x4c(%rax,%rdx)
movslq (%rcx), %rcx
imulq $0x58, %rcx, %rcx
movb $0x0, 0x8(%rax,%rcx)
movl 0x141f1(%rip), %edx     # 0x18210
movl %edx, 0xc(%rax,%rcx)
incl 0x2c(%r8)
movq 0xe8(%rdi), %rcx
movslq -0x4(%rcx), %rdx
movq 0x88(%rsp), %r8
movq 0x80(%r8), %rax
imulq $0x58, %rdx, %rdx
movl 0xc(%rax,%rdx), %esi
cmpl 0x141c1(%rip), %esi     # 0x18210
leaq 0x34(%rsp), %r14
leaq 0x90(%rsp), %r13
movq 0x18(%rsp), %r12
jl 0x4095
addq %rax, %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %esi, 0x48(%rdx)
movslq -0x4(%rcx), %rdx
imulq $0x58, %rdx, %rdx
movl %esi, 0x4c(%rax,%rdx)
movslq -0x4(%rcx), %rcx
imulq $0x58, %rcx, %rcx
movb $0x0, 0x8(%rax,%rcx)
movl 0x14183(%rip), %edx     # 0x18210
movl %edx, 0xc(%rax,%rcx)
incl 0x34(%r8)
testq %rdi, %rdi
je 0x40a0
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x143a1(%rip), %rdi     # 0x18448
jmp 0x4210
testl %eax, %eax
jne 0x4218
movq 0x68(%r15), %rax
movq 0x70(%r15), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0x4142
movl 0x5c(%r15), %r14d
movslq 0x58(%r15), %r12
movq %r12, %rcx
shlq $0x2, %rcx
movq %rcx, 0x10(%rsp)
movl %r14d, %ecx
subl %r12d, %ecx
leaq 0x4(,%rcx,4), %rcx
movq %rcx, 0x8(%rsp)
movl $0x1, %ebx
xorl %r13d, %r13d
movl (%rax,%r13,4), %esi
movl %ebx, %r13d
movl (%rax,%r13,4), %edx
leaq 0x90(%rsp), %rdi
callq 0xa972
cmpl %r12d, %r14d
jl 0x4129
movq 0x18(%rax), %rdi
addq 0x10(%rsp), %rdi
movl $0xff, %esi
movq 0x8(%rsp), %rdx
callq 0x3110
movq 0x68(%r15), %rax
movq 0x70(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
decq %rcx
incl %ebx
cmpq %r13, %rcx
ja 0x40f4
movq (%rbp), %rcx
movq 0xc8(%rcx), %rax
cmpq %rax, 0xd0(%rcx)
leaq 0x90(%rsp), %r13
je 0x419f
movl $0x1, %ebx
xorl %ecx, %ecx
cmpl $-0x1, (%rax,%rcx,4)
je 0x417d
movq 0x68(%r15), %rax
movl (%rax,%rcx,4), %esi
movq %r13, %rdi
callq 0xb390
incl 0x28(%rax)
movl %ebx, %ecx
movq (%rbp), %rdx
movq 0xc8(%rdx), %rax
movq 0xd0(%rdx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebx
cmpq %rcx, %rdx
ja 0x4165
movq (%rbp), %rdi
movq 0xe0(%rdi), %rax
cmpq %rax, 0xe8(%rdi)
leaq 0x34(%rsp), %r14
movq 0x18(%rsp), %r12
je 0x41fe
movl $0x1, %ebx
xorl %ecx, %ecx
cmpl $-0x1, (%rax,%rcx,4)
je 0x41dc
movq 0x68(%r15), %rax
movl (%rax,%rcx,4), %esi
movq %r13, %rdi
callq 0xb390
incl 0x30(%rax)
movl %ebx, %ecx
movq (%rbp), %rdi
movq 0xe0(%rdi), %rax
movq 0xe8(%rdi), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebx
cmpq %rcx, %rdx
ja 0x41c4
testq %rdi, %rdi
je 0x4209
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x14220(%rip), %rdi     # 0x18430
movq %rbp, %rsi
callq 0x8666
addq $0x8, %rbp
cmpq %r12, %rbp
jne 0x3e94
xorps %xmm0, %xmm0
cvtss2sd 0x78(%rsp), %xmm0
movsd %xmm0, 0x141b2(%rip)    # 0x183e8
jmp 0x44f7
movl $0xf, %edx
movq %r12, %rdi
leaq 0xcf54(%rip), %rsi      # 0x1119e
callq 0x3250
movl 0x34(%rsp), %esi
movq %r12, %rdi
callq 0x3360
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
leaq 0xcf41(%rip), %rsi      # 0x111ae
callq 0x3250
movl 0x38(%rsp), %esi
movq %rbx, %rdi
callq 0x3360
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
leaq 0xcf29(%rip), %rsi      # 0x111b9
callq 0x3250
movq 0x58(%rsp), %rax
movl 0x20(%rax), %esi
movq %rbx, %rdi
callq 0x3360
movq %rax, %rbx
movl $0xd, %edx
movq %rax, %rdi
leaq 0xcf0b(%rip), %rsi      # 0x111c2
callq 0x3250
movl 0x74(%rsp), %esi
movq %rbx, %rdi
callq 0x3360
movq %rax, %rbx
movl $0xf, %edx
movq %rax, %rdi
leaq 0xcef6(%rip), %rsi      # 0x111d0
callq 0x3250
cvtss2sd 0x78(%rsp), %xmm0
movq %rbx, %rdi
callq 0x3310
movl $0x2, %edx
movq %rax, %rdi
leaq 0xcee4(%rip), %rsi      # 0x111e0
callq 0x3250
callq 0x3150
movq %rax, 0x13fd3(%rip)     # 0x182e0
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x468a
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x475b
callq 0x3150
subq 0x13fab(%rip), %rax     # 0x182e0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xccc3(%rip), %xmm0     # 0x11008
addsd 0x13f9b(%rip), %xmm0    # 0x182e8
movsd %xmm0, 0x13f93(%rip)    # 0x182e8
callq 0x3150
movq %rax, 0x13f6f(%rip)     # 0x182d0
movl 0x38(%rsp), %esi
movq %rbp, %rdi
callq 0x102de
movq %rax, %rbx
movq 0x58(%rsp), %rax
movl 0x20(%rax), %esi
movq %rbp, %rdi
callq 0x102ea
movq %rax, 0x20(%rsp)
leaq 0x120(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4b97
callq 0x3150
subq 0x13f2c(%rip), %rax     # 0x182d0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xcc54(%rip), %xmm0     # 0x11008
addsd 0x13f1c(%rip), %xmm0    # 0x182d8
movsd %xmm0, 0x13f14(%rip)    # 0x182d8
callq 0x3150
movq %rax, 0x13f20(%rip)     # 0x182f0
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x975c
cmpq $0x0, (%rax)
je 0x4415
movl $0x1, %ebp
movq 0x20(%rsp), %rcx
movq %r13, %rdi
leaq 0x120(%rsp), %rsi
movq %rbx, %rdx
leaq 0x28(%rsp), %r8
callq 0x4d8d
leaq 0x13f08(%rip), %rax     # 0x18314
leaq 0x13f25(%rip), %rdi     # 0x18338
jmp 0x4451
incl 0x13efd(%rip)           # 0x18318
movl 0x34(%rsp), %ecx
movl 0x13dc7(%rip), %eax     # 0x181ec
cltd
idivl 0x13db4(%rip)           # 0x181e0
movl %eax, %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
movq 0x13f14(%rip), %rcx     # 0x18350
incl (%rcx,%rax,4)
movl 0x74(%rsp), %ebp
leaq 0x13ed2(%rip), %rax     # 0x1831c
leaq 0x13f17(%rip), %rdi     # 0x18368
addl %ebp, (%rax)
movl 0x34(%rsp), %ecx
movl 0x13d8f(%rip), %eax     # 0x181ec
cltd
idivl 0x13d7c(%rip)           # 0x181e0
movl %eax, %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
movq (%rdi), %rcx
addl %ebp, (%rcx,%rax,4)
callq 0x3150
subq 0x13e71(%rip), %rax     # 0x182f0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0xcb79(%rip), %xmm1     # 0x11008
divsd %xmm1, %xmm0
addsd 0x13e5d(%rip), %xmm0    # 0x182f8
movsd %xmm0, 0x13e55(%rip)    # 0x182f8
movl 0x74(%rsp), %eax
addl %eax, 0x13e7f(%rip)     # 0x1832c
callq 0x3150
movq %rax, 0x13e27(%rip)     # 0x182e0
callq 0x5186
callq 0x3150
subq 0x13e16(%rip), %rax     # 0x182e0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xcb2e(%rip), %xmm0     # 0x11008
addsd 0x13e06(%rip), %xmm0    # 0x182e8
movsd %xmm0, 0x13dfe(%rip)    # 0x182e8
leaq 0x120(%rsp), %rdi
callq 0x8a16
movq 0x13ad2(%rip), %r12     # 0x17fd0
leaq 0x2a8(%rsp), %rbp
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xed50
leaq 0x158(%rsp), %rbx
jmp 0x3d81
movl 0x13cca(%rip), %eax     # 0x181f0
imull 0x13cdb(%rip), %eax     # 0x18208
imull 0xd8(%rsp), %eax
movl %eax, 0x13df5(%rip)     # 0x18330
leaq 0x400(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x86f8
leaq 0x400(%rsp), %rdi
callq 0x52bb
leaq 0x400(%rsp), %rdi
callq 0xe83c
leaq 0x2a8(%rsp), %rdi
callq 0xffb4
leaq 0x158(%rsp), %rdi
callq 0xe83c
leaq 0x90(%rsp), %rdi
callq 0xaeec
xorl %eax, %eax
jmp 0x45e9
movq 0x13a34(%rip), %rbx     # 0x17fd0
leaq 0xcb85(%rip), %rsi      # 0x11128
jmp 0x45c3
movq 0x13a24(%rip), %rbx     # 0x17fd0
leaq 0xcb89(%rip), %rsi      # 0x1113c
jmp 0x45c3
movq 0x13a14(%rip), %rbx     # 0x17fd0
leaq 0xcb8d(%rip), %rsi      # 0x11150
movl $0x13, %edx
movq %rbx, %rdi
callq 0x3250
leaq 0xcc0a(%rip), %rsi      # 0x111e1
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3250
movl $0x1, %eax
addq $0x5d8, %rsp            # imm = 0x5D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x400(%rsp), %rdi
callq 0xe83c
jmp 0x465b
jmp 0x4637
jmp 0x4611
movq %rax, %rbx
jmp 0x4668
jmp 0x4618
movq %rax, %rbx
jmp 0x4675
jmp 0x464e
jmp 0x464e
jmp 0x464e
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x8a16
jmp 0x4651
jmp 0x4637
movq %rax, %rbx
jmp 0x465b
jmp 0x464e
jmp 0x464e
jmp 0x464e
jmp 0x464e
jmp 0x464e
jmp 0x464e
jmp 0x464e
jmp 0x464e
jmp 0x464e
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xed50
leaq 0x2a8(%rsp), %rdi
callq 0xffb4
leaq 0x158(%rsp), %rdi
callq 0xe83c
leaq 0x90(%rsp), %rdi
callq 0xaeec
movq %rbx, %rdi
callq 0x3370