// File: /workspace/github_cpp_makefile_star2_O2/ynilu[P]elastic/simulator.cpp
// Function: build_light_path(Phy_graph&, LightPath*, Aux_node*, Aux_node*, Event&)
void build_light_path(Phy_graph& p_graph, LightPath* candidate_path, Aux_node* aux_source, Aux_node* aux_destination, Event& event)
{
    Phy_node& src_node = p_graph.get_node(aux_source->phy_id);
    Phy_node& dst_node = p_graph.get_node(aux_destination->phy_id);
    LightPath* new_path = new LightPath();

    request2lightpath[event.request_id].push_back(new_path);
    new_path->requests.insert(event.request_id);
    new_path->modulation_level = candidate_path->modulation_level;
    new_path->available_bitrate = candidate_path->available_bitrate;
    new_path->weight = candidate_path->weight;
    new_path->spectrum = candidate_path->spectrum;
    new_path->p_path = candidate_path->p_path;
    new_path->type = candidate_path->type;


    int slot_st = new_path->spectrum.slot_st;
    int slot_ed = new_path->spectrum.slot_ed;
    Path& path = new_path->p_path;
    double used_bandwidth;
    double wasted_bandwidth;
    double guardband_bandwidth;
    double total_bandwidth;
    double num_links;

    switch(candidate_path->type)
    {
    case LightPath::OTDM:

        new_path->transmitter_index.resize(path.size(), -1);
        new_path->receiver_index.resize(path.size(), -1);
        new_path->transmitter_index.front() = 1;
        new_path->receiver_index.back() = 1;
        src_node.num_available_transmitter--;
        dst_node.num_available_receiver--;

        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);

            link.slot[slot_st] = 0;
            link.slot[slot_ed] = 0;

            for(int i = slot_st + 1; i <= slot_ed - 1; i++)
            {
                link.slot[i] = 1;
            }
        }
        exist_OTDM_light_path_list.push_back(new_path);
        num_OTDM_lightpath_use++;
        num_OTDM_lightpath_use_BM[(int)event.request_id/(num_requests/num_batch)]++;

        num_links = 1.0 * new_path->p_path.size() - 1;
        used_bandwidth = num_links * event.bandwidth / new_path->modulation_level;
        wasted_bandwidth = 0;
        guardband_bandwidth = num_links * 2 * slot_capacity;
        total_bandwidth = used_bandwidth + wasted_bandwidth + guardband_bandwidth;
        total_bandwidth_utilization += total_bandwidth * event.holding_time;
        used_bandwidth_utilization += used_bandwidth * event.holding_time;
        wasted_bandwidth_utilization += wasted_bandwidth * event.holding_time;
        guardband_bandwidth_utilization += guardband_bandwidth * event.holding_time;
        break;

    case LightPath:: OFDM:
        new_path->transmitter_index.resize(path.size(), -1);
        new_path->receiver_index.resize(path.size(), -1);
        new_path->transmitter_index.front() = get_available_OFDM_transceiver(src_node.OFDMtransmitter);
        src_node.num_available_OFDM_transmitter--;
        new_path->receiver_index.back() = get_available_OFDM_transceiver(dst_node.OFDMreceiver);
        dst_node.num_available_OFDM_receiver--;
        src_node.OFDMtransmitter[new_path->transmitter_index.front()].spectrum = candidate_path->spectrum;
        src_node.OFDMtransmitter[new_path->transmitter_index.front()].num_available_sub_transceiver--;
        src_node.OFDMtransmitter[new_path->transmitter_index.front()].in_used = true;
        dst_node.OFDMreceiver[new_path->receiver_index.back()].spectrum = candidate_path->spectrum;
        dst_node.OFDMreceiver[new_path->receiver_index.back()].num_available_sub_transceiver--;
        dst_node.OFDMreceiver[new_path->receiver_index.back()].in_used = true;

        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);

            link.slot[slot_st] = 0;
            link.slot[slot_ed] = 0;
            for(int i = slot_st + 1; i <= slot_ed - 1; i++)
            {
                link.slot[i] = 1;
            }
        }
        exist_OFDM_light_path_list.push_back(new_path);
        num_OFDM_lightpath_use++;
        num_OFDM_lightpath_use_BM[(int)event.request_id/(num_requests/num_batch)]++;

        num_links = 1.0 * new_path->p_path.size() - 1;
        used_bandwidth = num_links * event.bandwidth / new_path->modulation_level;
        wasted_bandwidth = num_links * (slot_capacity - (used_bandwidth - slot_capacity * ((int)used_bandwidth / slot_capacity)));
        guardband_bandwidth = num_links * 2 * slot_capacity;
        total_bandwidth = used_bandwidth + wasted_bandwidth + guardband_bandwidth;
        total_bandwidth_utilization += total_bandwidth * event.holding_time;
        used_bandwidth_utilization += used_bandwidth * event.holding_time;
        wasted_bandwidth_utilization += wasted_bandwidth * event.holding_time;
        guardband_bandwidth_utilization += guardband_bandwidth * event.holding_time;
        break;

    case LightPath:: OFDM_WB:
        new_path->transmitter_index = candidate_path->transmitter_index;
        new_path->receiver_index.resize(path.size(), -1);
        new_path->receiver_index.back() = get_available_OFDM_transceiver(dst_node.OFDMreceiver);
        dst_node.OFDMreceiver[new_path->receiver_index.back()].spectrum = candidate_path->spectrum;
        dst_node.OFDMreceiver[new_path->receiver_index.back()].num_available_sub_transceiver--;
        dst_node.OFDMreceiver[new_path->receiver_index.back()].in_used = true;
        dst_node.num_available_OFDM_receiver--;
        src_node.OFDMtransmitter[new_path->transmitter_index.front()].num_available_sub_transceiver--;
        if(src_node.OFDMtransmitter[new_path->transmitter_index.front()].spectrum.slot_st > slot_st)
        {
            src_node.OFDMtransmitter[new_path->transmitter_index.front()].spectrum.slot_st = slot_st;
        }
        if(src_node.OFDMtransmitter[new_path->transmitter_index.front()].spectrum.slot_ed < slot_ed)
        {
            src_node.OFDMtransmitter[new_path->transmitter_index.front()].spectrum.slot_ed = 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);

            link.slot[slot_st] = 0;
            link.slot[slot_ed] = 0;
            for(int i = slot_st + 1; i <= slot_ed - 1; i++)
            {
                link.slot[i] = 1;
            }
        }
        exist_OFDM_light_path_list.push_back(new_path);
        num_OFDM_lightpath_use++;
        num_OFDM_lightpath_use_BM[(int)event.request_id/(num_requests/num_batch)]++;

        num_links = 1.0 * new_path->p_path.size() - 1;
        used_bandwidth = num_links * event.bandwidth / new_path->modulation_level;
        wasted_bandwidth = num_links * (slot_capacity - (used_bandwidth - slot_capacity * ((int)used_bandwidth / slot_capacity)));
        guardband_bandwidth = num_links * slot_capacity;
        total_bandwidth = used_bandwidth + wasted_bandwidth + guardband_bandwidth;
        total_bandwidth_utilization += total_bandwidth * event.holding_time;
        used_bandwidth_utilization += used_bandwidth * event.holding_time;
        wasted_bandwidth_utilization += wasted_bandwidth * event.holding_time;
        guardband_bandwidth_utilization += guardband_bandwidth * event.holding_time;
        break;

    case LightPath:: OFDM_WOB:
        new_path->transmitter_index = candidate_path->transmitter_index;
        new_path->receiver_index = candidate_path->receiver_index;
        src_node.OFDMtransmitter[new_path->transmitter_index.front()].num_available_sub_transceiver--;
        dst_node.OFDMreceiver[new_path->receiver_index.back()].num_available_sub_transceiver--;
        if(src_node.OFDMtransmitter[new_path->transmitter_index.front()].spectrum.slot_st > slot_st)
        {
            src_node.OFDMtransmitter[new_path->transmitter_index.front()].spectrum.slot_st = slot_st;
        }
        if(src_node.OFDMtransmitter[new_path->transmitter_index.front()].spectrum.slot_ed < slot_ed)
        {
            src_node.OFDMtransmitter[new_path->transmitter_index.front()].spectrum.slot_ed = slot_ed;
        }
        if(dst_node.OFDMreceiver[new_path->receiver_index.back()].spectrum.slot_st > slot_st)
        {
            dst_node.OFDMreceiver[new_path->receiver_index.back()].spectrum.slot_st = slot_st;
        }
        if(dst_node.OFDMreceiver[new_path->receiver_index.back()].spectrum.slot_ed < slot_ed)
        {
            dst_node.OFDMreceiver[new_path->receiver_index.back()].spectrum.slot_ed = 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);

            link.slot[slot_st] = 0;
            link.slot[slot_ed] = 0;
            for(int i = slot_st + 1; i <= slot_ed - 1; i++)
            {
                link.slot[i] = 1;
            }
        }
        exist_OFDM_light_path_list.push_back(new_path);
        num_OFDM_lightpath_use++;
        num_OFDM_lightpath_use_BM[(int)event.request_id/(num_requests/num_batch)]++;

        num_links = 1.0 * new_path->p_path.size() - 1;
        used_bandwidth = num_links * event.bandwidth / new_path->modulation_level;
        wasted_bandwidth = num_links * (slot_capacity - (used_bandwidth - slot_capacity * ((int)used_bandwidth / slot_capacity)));
        guardband_bandwidth = num_links * slot_capacity;
        total_bandwidth = used_bandwidth + wasted_bandwidth + guardband_bandwidth;
        total_bandwidth_utilization += total_bandwidth * event.holding_time;
        used_bandwidth_utilization += used_bandwidth * event.holding_time;
        wasted_bandwidth_utilization += wasted_bandwidth * event.holding_time;
        guardband_bandwidth_utilization += guardband_bandwidth * event.holding_time;
        break;

    default:
        cerr << "light path type error\n";
        break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r14
movq %rcx, %rbx
movq %rsi, %r13
movq %rdi, %r15
movl 0xc(%rdx), %esi
callq 0x98a8
movq %rax, %r12
movl 0xc(%rbx), %esi
movq %r15, 0x40(%rsp)
movq %r15, %rdi
callq 0x98a8
movq %rax, %r15
movl $0xf8, %edi
callq 0x21f0
movq %rax, %rbx
movq %rax, %rdi
callq 0xe020
leaq 0x8(%rsp), %rbp
movq %rbx, (%rbp)
leaq 0xc(%r14), %rbx
movslq 0xc(%r14), %rax
imulq $0x18, %rax, %rdi
addq 0x12e3c(%rip), %rdi     # 0x18438
movq %rbp, %rsi
callq 0x6858
movq (%rbp), %rdi
addq $0x10, %rdi
movq %rbx, %rsi
callq 0x840e
movq (%rbp), %rdi
movq 0x40(%r13), %rax
movq %rax, 0x40(%rdi)
movsd 0x48(%r13), %xmm0
movsd %xmm0, 0x48(%rdi)
movupd 0x58(%r13), %xmm0
movupd %xmm0, 0x58(%rdi)
leaq 0x68(%r13), %rsi
addq $0x68, %rdi
callq 0x6876
movl 0x8(%r13), %eax
movq (%rbp), %rbp
movl %eax, 0x8(%rbp)
cmpq $0x3, %rax
ja 0x5eba
movq %r12, 0x28(%rsp)
movq %r15, 0x30(%rsp)
leaq 0x58(%r13), %rsi
movl 0x58(%rbp), %r15d
movl 0x5c(%rbp), %edx
movslq %r15d, %r12
movslq %edx, %rbx
leaq 0x9a36(%rip), %rcx      # 0xf0b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %r14, 0x38(%rsp)
movq %rbx, 0x20(%rsp)
jmpq *%rax
leaq 0xc8(%rbp), %rdi
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
leaq 0x14(%rsp), %r13
orl $-0x1, (%r13)
movq %r13, %rdx
callq 0x65c0
movl $0xe0, %edi
addq 0x8(%rsp), %rdi
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
orl $-0x1, (%r13)
leaq 0x14(%rsp), %rdx
callq 0x65c0
movq 0x8(%rsp), %rax
movq 0xc8(%rax), %rcx
pushq $0x1
popq %r15
movl %r15d, (%rcx)
movq 0xe8(%rax), %rax
movl %r15d, -0x4(%rax)
movq 0x28(%rsp), %rax
decl 0x28(%rax)
movq 0x30(%rsp), %rax
decl 0x30(%rax)
leaq -0x1(%rbx), %r13
leaq -0x1(%r12), %r14
xorl %ebx, %ebx
movl %ebx, %ecx
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %rcx, %rdx
jbe 0x5c98
movl (%rax,%rcx,4), %esi
leal 0x1(%rcx), %ebx
movl (%rax,%rbx,4), %edx
movq 0x40(%rsp), %rdi
callq 0x9148
movq 0x18(%rax), %rax
andl $0x0, (%rax,%r12,4)
xorl %esi, %esi
movq %r14, %rcx
movq 0x20(%rsp), %rdi
movq %r12, %rdx
movl %esi, (%rax,%rdi,4)
incq %rdx
incq %rcx
movq %rdx, %rdi
movl %r15d, %esi
cmpq %r13, %rcx
jl 0x5756
jmp 0x5710
movl %edx, 0x18(%rsp)
movl $0xc8, %edi
addq %rdi, %r13
addq %rbp, %rdi
movq %rsi, %rbx
movq %r13, %rsi
callq 0x6876
movl $0xe0, %edi
addq 0x8(%rsp), %rdi
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
leaq 0x14(%rsp), %rdx
orl $-0x1, (%rdx)
callq 0x65c0
movq 0x30(%rsp), %r13
movq %r13, %rdi
subq $-0x80, %rdi
callq 0x5ef4
movq 0x8(%rsp), %rcx
movq 0xe8(%rcx), %rdx
movl %eax, -0x4(%rdx)
cltq
movq 0x80(%r13), %rdx
imulq $0x58, %rax, %rax
movupd (%rbx), %xmm0
movupd %xmm0, 0x48(%rdx,%rax)
movq 0xe8(%rcx), %rax
movslq -0x4(%rax), %rdx
movq 0x80(%r13), %rsi
imulq $0x58, %rdx, %rdx
decl 0xc(%rsi,%rdx)
movslq -0x4(%rax), %rax
imulq $0x58, %rax, %rax
movb $0x1, 0x8(%rsi,%rax)
decl 0x34(%r13)
movq 0xc8(%rcx), %rcx
movslq (%rcx), %rdx
movq 0x28(%rsp), %rax
movq 0x68(%rax), %rax
imulq $0x58, %rdx, %rdx
decl 0xc(%rax,%rdx)
movslq (%rcx), %rdx
imulq $0x58, %rdx, %rsi
cmpl %r15d, 0x48(%rax,%rsi)
jle 0x5842
leaq (%rax,%rsi), %rdx
addq $0x48, %rdx
movl %r15d, (%rdx)
movslq (%rcx), %rdx
imulq $0x58, %rdx, %rcx
movl 0x18(%rsp), %edx
cmpl %edx, 0x4c(%rax,%rcx)
movq 0x20(%rsp), %r15
jge 0x585e
addq %rcx, %rax
addq $0x4c, %rax
movl %edx, (%rax)
decq %r15
movq %r12, %r13
decq %r13
xorl %ebx, %ebx
pushq $0x1
popq %r14
movl %ebx, %ecx
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %rcx, %rdx
jbe 0x5a05
movl (%rax,%rcx,4), %esi
leal 0x1(%rcx), %ebx
movl (%rax,%rbx,4), %edx
movq 0x40(%rsp), %rdi
callq 0x9148
movq 0x18(%rax), %rax
andl $0x0, (%rax,%r12,4)
xorl %esi, %esi
movq %r13, %rcx
movq 0x20(%rsp), %rdi
movq %r12, %rdx
movl %esi, (%rax,%rdi,4)
incq %rdx
incq %rcx
movq %rdx, %rdi
movl %r14d, %esi
cmpq %r15, %rcx
jl 0x58b3
jmp 0x586d
movl %edx, 0x18(%rsp)
movl $0xc8, %edi
leaq (%rdi,%r13), %rsi
addq %rbp, %rdi
callq 0x6876
movl $0xe0, %edi
addq %rdi, %r13
addq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x6876
movq 0x8(%rsp), %rax
movq 0xc8(%rax), %rsi
movslq (%rsi), %rcx
movq 0x28(%rsp), %rdx
movq 0x68(%rdx), %rdx
imulq $0x58, %rcx, %rcx
decl 0xc(%rdx,%rcx)
movq 0xe8(%rax), %rcx
movslq -0x4(%rcx), %rdi
movq 0x30(%rsp), %rax
movq 0x80(%rax), %rax
imulq $0x58, %rdi, %rdi
decl 0xc(%rax,%rdi)
movslq (%rsi), %rdi
imulq $0x58, %rdi, %r8
cmpl %r15d, 0x48(%rdx,%r8)
jle 0x594e
leaq (%rdx,%r8), %rdi
addq $0x48, %rdi
movl %r15d, (%rdi)
movslq (%rsi), %rdi
imulq $0x58, %rdi, %rsi
movl 0x18(%rsp), %r8d
cmpl %r8d, 0x4c(%rdx,%rsi)
jge 0x5968
addq %rsi, %rdx
addq $0x4c, %rdx
movl %r8d, (%rdx)
movslq -0x4(%rcx), %rdx
imulq $0x58, %rdx, %rsi
cmpl %r15d, 0x48(%rax,%rsi)
jle 0x5986
leaq (%rax,%rsi), %rdx
addq $0x48, %rdx
movl %r15d, (%rdx)
movslq -0x4(%rcx), %rdx
imulq $0x58, %rdx, %rcx
cmpl %r8d, 0x4c(%rax,%rcx)
jge 0x599b
addq %rcx, %rax
addq $0x4c, %rax
movl %r8d, (%rax)
movq %rbx, %r15
decq %r15
movq %r12, %r13
decq %r13
xorl %ebx, %ebx
pushq $0x1
popq %r14
movl %ebx, %ecx
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %rcx, %rdx
jbe 0x5a05
movl (%rax,%rcx,4), %esi
leal 0x1(%rcx), %ebx
movl (%rax,%rbx,4), %edx
movq 0x40(%rsp), %rdi
callq 0x9148
movq 0x18(%rax), %rax
andl $0x0, (%rax,%r12,4)
xorl %esi, %esi
movq %r13, %rcx
movq 0x20(%rsp), %rdi
movq %r12, %rdx
movl %esi, (%rax,%rdi,4)
incq %rdx
incq %rcx
movq %rdx, %rdi
movl %r14d, %esi
cmpq %r15, %rcx
jl 0x59ef
jmp 0x59ad
leaq 0x12a14(%rip), %rdi     # 0x18420
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x684c
incl 0x128dd(%rip)           # 0x182fc
movq 0x38(%rsp), %rdi
movl 0xc(%rdi), %ecx
movl 0x12797(%rip), %eax     # 0x181c4
cltd
idivl 0x12784(%rip)           # 0x181b8
movl %eax, %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
movq 0x1292c(%rip), %rcx     # 0x18370
incl (%rcx,%rax,4)
movq (%rbx), %rax
movq 0x70(%rax), %rcx
subq 0x68(%rax), %rcx
sarq $0x2, %rcx
movq %rcx, %xmm1
punpckldq 0x95ed(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x95f5(%rip), %xmm1     # 0xf060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
addsd 0x95a9(%rip), %xmm0     # 0xf028
cvtsi2sdl 0x4c(%rdi), %xmm1
mulsd %xmm0, %xmm1
cvtsi2sdl 0x40(%rax), %xmm2
divsd %xmm2, %xmm1
movl 0x12749(%rip), %esi     # 0x181e0
cvtsi2sd %esi, %xmm2
cvttsd2si %xmm1, %ecx
movl %ecx, %eax
cltd
idivl %esi
subl %edx, %ecx
cvtsi2sd %ecx, %xmm3
subsd %xmm1, %xmm3
addsd %xmm2, %xmm3
mulsd %xmm0, %xmm3
mulsd %xmm2, %xmm0
movapd %xmm1, %xmm2
addsd %xmm3, %xmm2
addsd %xmm0, %xmm2
cvtss2sd 0x54(%rdi), %xmm4
mulsd %xmm4, %xmm2
addsd 0x128c9(%rip), %xmm2    # 0x183a0
movsd %xmm2, 0x128c1(%rip)    # 0x183a0
mulsd %xmm4, %xmm1
addsd 0x128bd(%rip), %xmm1    # 0x183a8
movsd %xmm1, 0x128b5(%rip)    # 0x183a8
mulsd %xmm4, %xmm3
addsd 0x128b1(%rip), %xmm3    # 0x183b0
movsd %xmm3, 0x128a9(%rip)    # 0x183b0
jmp 0x5ea4
leaq 0xc8(%rbp), %rdi
movq %rsi, 0x18(%rsp)
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
leaq 0x14(%rsp), %r13
orl $-0x1, (%r13)
movq %r13, %rdx
callq 0x65c0
movl $0xe0, %edi
addq 0x8(%rsp), %rdi
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
orl $-0x1, (%r13)
leaq 0x14(%rsp), %rdx
callq 0x65c0
movq 0x28(%rsp), %r15
movq %r15, %rdi
addq $0x68, %rdi
callq 0x5ef4
movq 0x8(%rsp), %rcx
movq 0xc8(%rcx), %rcx
movl %eax, (%rcx)
decl 0x2c(%r15)
movq 0x30(%rsp), %r14
movq %r14, %rdi
subq $-0x80, %rdi
callq 0x5ef4
movq 0x8(%rsp), %rcx
movq 0xe8(%rcx), %rdx
movl %eax, -0x4(%rdx)
decl 0x34(%r14)
movq 0xc8(%rcx), %rax
movslq (%rax), %rax
movq 0x68(%r15), %rdx
imulq $0x58, %rax, %rax
movq 0x18(%rsp), %rdi
movups (%rdi), %xmm0
movups %xmm0, 0x48(%rdx,%rax)
movq 0xc8(%rcx), %rax
movslq (%rax), %rdx
movq 0x68(%r15), %rsi
imulq $0x58, %rdx, %rdx
decl 0xc(%rsi,%rdx)
movslq (%rax), %rax
imulq $0x58, %rax, %rax
movb $0x1, %dl
movb %dl, 0x8(%rsi,%rax)
movq 0xe8(%rcx), %rax
movslq -0x4(%rax), %rax
movq 0x80(%r14), %rsi
imulq $0x58, %rax, %rax
movupd (%rdi), %xmm0
movupd %xmm0, 0x48(%rsi,%rax)
movq 0xe8(%rcx), %rax
movslq -0x4(%rax), %rcx
movq 0x80(%r14), %rsi
imulq $0x58, %rcx, %rcx
decl 0xc(%rsi,%rcx)
movslq -0x4(%rax), %rax
imulq $0x58, %rax, %rax
movb %dl, 0x8(%rsi,%rax)
movq %rbx, %r15
decq %r15
movq %r12, %r13
decq %r13
xorl %ebx, %ebx
pushq $0x1
popq %r14
movl %ebx, %ecx
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %rcx, %rdx
jbe 0x5d9e
movl (%rax,%rcx,4), %esi
leal 0x1(%rcx), %ebx
movl (%rax,%rbx,4), %edx
movq 0x40(%rsp), %rdi
callq 0x9148
movq 0x18(%rax), %rax
andl $0x0, (%rax,%r12,4)
xorl %esi, %esi
movq %r13, %rcx
movq 0x20(%rsp), %rdi
movq %r12, %rdx
movl %esi, (%rax,%rdi,4)
incq %rdx
incq %rcx
movq %rdx, %rdi
movl %r14d, %esi
cmpq %r15, %rcx
jl 0x5c82
jmp 0x5c3c
leaq 0x12769(%rip), %rdi     # 0x18408
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x684c
incl 0x1264e(%rip)           # 0x18300
movq 0x38(%rsp), %rdi
movl 0xc(%rdi), %ecx
movl 0x12504(%rip), %eax     # 0x181c4
cltd
idivl 0x124f1(%rip)           # 0x181b8
movl %eax, %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
movq 0x126b1(%rip), %rcx     # 0x18388
incl (%rcx,%rax,4)
movq (%rbx), %rax
movq 0x70(%rax), %rcx
subq 0x68(%rax), %rcx
sarq $0x2, %rcx
movq %rcx, %xmm0
punpckldq 0x935a(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x9362(%rip), %xmm0     # 0xf060
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x9316(%rip), %xmm1     # 0xf028
cvtsi2sdl 0x4c(%rdi), %xmm0
cvtsi2sdl 0x40(%rax), %xmm2
mulsd %xmm1, %xmm0
divsd %xmm2, %xmm0
cvtsi2sdl 0x124b4(%rip), %xmm2 # 0x181e0
addsd %xmm1, %xmm1
mulsd %xmm1, %xmm2
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm3
addsd %xmm1, %xmm3
addsd %xmm2, %xmm3
cvtss2sd 0x54(%rdi), %xmm4
mulsd %xmm4, %xmm3
addsd 0x1264b(%rip), %xmm3    # 0x183a0
movsd %xmm3, 0x12643(%rip)    # 0x183a0
mulsd %xmm4, %xmm0
addsd 0x1263f(%rip), %xmm0    # 0x183a8
movsd %xmm0, 0x12637(%rip)    # 0x183a8
mulsd %xmm4, %xmm1
addsd 0x12633(%rip), %xmm1    # 0x183b0
movsd %xmm1, 0x1262b(%rip)    # 0x183b0
mulsd %xmm4, %xmm2
addsd 0x12627(%rip), %xmm2    # 0x183b8
movsd %xmm2, 0x1261f(%rip)    # 0x183b8
jmp 0x5ecd
leaq 0x1267b(%rip), %rdi     # 0x18420
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x684c
incl 0x12544(%rip)           # 0x182fc
movq 0x38(%rsp), %rdi
movl 0xc(%rdi), %ecx
movl 0x123fe(%rip), %eax     # 0x181c4
cltd
idivl 0x123eb(%rip)           # 0x181b8
movl %eax, %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
movq 0x12593(%rip), %rcx     # 0x18370
incl (%rcx,%rax,4)
movq (%rbx), %rax
movq 0x70(%rax), %rcx
subq 0x68(%rax), %rcx
sarq $0x2, %rcx
movq %rcx, %xmm1
punpckldq 0x9254(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x925c(%rip), %xmm1     # 0xf060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
addsd 0x9210(%rip), %xmm0     # 0xf028
cvtsi2sdl 0x4c(%rdi), %xmm1
cvtsi2sdl 0x40(%rax), %xmm2
mulsd %xmm0, %xmm1
movl 0x123b4(%rip), %esi     # 0x181e0
cvtsi2sd %esi, %xmm3
divsd %xmm2, %xmm1
cvttsd2si %xmm1, %ecx
movl %ecx, %eax
cltd
idivl %esi
subl %edx, %ecx
cvtsi2sd %ecx, %xmm2
subsd %xmm1, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm0, %xmm0
mulsd %xmm3, %xmm0
movapd %xmm1, %xmm3
addsd %xmm2, %xmm3
addsd %xmm0, %xmm3
cvtss2sd 0x54(%rdi), %xmm4
mulsd %xmm4, %xmm3
addsd 0x1252c(%rip), %xmm3    # 0x183a0
movsd %xmm3, 0x12524(%rip)    # 0x183a0
mulsd %xmm4, %xmm1
addsd 0x12520(%rip), %xmm1    # 0x183a8
movsd %xmm1, 0x12518(%rip)    # 0x183a8
mulsd %xmm4, %xmm2
addsd 0x12514(%rip), %xmm2    # 0x183b0
movsd %xmm2, 0x1250c(%rip)    # 0x183b0
mulsd %xmm4, %xmm0
addsd 0x12508(%rip), %xmm0    # 0x183b8
movsd %xmm0, 0x12500(%rip)    # 0x183b8
jmp 0x5ecd
movq 0x1212f(%rip), %rdi     # 0x17ff0
leaq 0x9347(%rip), %rsi      # 0xf20f
callq 0x21e0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0xf8, %esi
movq %rbx, %rdi
callq 0x2200
movq %r14, %rdi
callq 0x2320