// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movq %r8, %r14
movq %rcx, %rbx
movq %rsi, %r13
movq %rdi, %r15
movl 0xc(%rdx), %esi
callq 0xba88
movq %rax, %r12
movl 0xc(%rbx), %esi
movq %r15, 0x50(%rsp)
movq %r15, %rdi
callq 0xba88
movq %rax, %r15
movl $0xf8, %edi
callq 0x3220
movq %rax, %rbp
movq %rax, %rdi
callq 0x10a4c
movq %rbp, 0x8(%rsp)
leaq 0xc(%r14), %rbx
movslq 0xc(%r14), %rax
movq 0x11153(%rip), %rcx     # 0x18460
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x7329
movq %rbp, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x7333
leaq 0x8(%rsp), %rdx
callq 0xa3ea
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movq %rbx, %rsi
callq 0xa526
movq 0x8(%rsp), %rdi
movq 0x40(%r13), %rax
movq %rax, 0x40(%rdi)
movsd 0x48(%r13), %xmm0
movsd %xmm0, 0x48(%rdi)
movdqu 0x58(%r13), %xmm0
movdqu %xmm0, 0x58(%rdi)
leaq 0x68(%r13), %rsi
addq $0x68, %rdi
callq 0x8c9c
movl 0x8(%r13), %eax
movq 0x8(%rsp), %rbp
movl %eax, 0x8(%rbp)
cmpq $0x3, %rax
ja 0x811a
movq %r12, 0x10(%rsp)
movq %r15, %r12
leaq 0x58(%r13), %r15
movl 0x58(%rbp), %ebx
movl 0x5c(%rbp), %ecx
movslq %ebx, %rdx
movq %rdx, 0x38(%rsp)
movl %ecx, 0x20(%rsp)
movslq %ecx, %rcx
movq %rcx, 0x48(%rsp)
leaq 0x9d29(%rip), %rcx      # 0x110e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %r14, 0x40(%rsp)
movl %ebx, 0x18(%rsp)
jmpq *%rax
leaq 0xc8(%rbp), %rdi
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
leaq 0x1c(%rsp), %r13
movl %r14d, (%r13)
movq %r13, %rdx
callq 0x8998
movl $0xe0, %edi
addq 0x8(%rsp), %rdi
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
movl %r14d, (%r13)
leaq 0x1c(%rsp), %rdx
callq 0x8998
movq 0x8(%rsp), %rax
movq 0xc8(%rax), %rcx
movl $0x1, %edx
movl %edx, (%rcx)
movq 0xe8(%rax), %rax
movl %edx, -0x4(%rax)
movq 0x10(%rsp), %rax
decl 0x28(%rax)
decl 0x30(%r12)
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0x75df
movl 0x20(%rsp), %r12d
decl %r12d
movl %r12d, %ebx
movslq %r12d, %rcx
movq 0x38(%rsp), %rdx
subq %rdx, %rcx
leaq 0x3(%rcx), %r13
andq $-0x4, %r13
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm4     # xmm4 = xmm0[0,1,0,1]
leaq 0x10(,%rdx,4), %rcx
movq %rcx, 0x10(%rsp)
xorl %r15d, %r15d
movdqa 0x9bf7(%rip), %xmm0     # 0x11090
pxor %xmm0, %xmm4
xorl %r12d, %r12d
xorl %r14d, %r14d
movdqa %xmm4, 0x20(%rsp)
movl (%rax,%r12,4), %esi
incl %r14d
movl %r14d, %r12d
movl (%rax,%r12,4), %edx
movq 0x50(%rsp), %rdi
callq 0xb0a6
pcmpeqd %xmm8, %xmm8
movdqa 0x9bc2(%rip), %xmm7     # 0x11090
movdqa 0x9baa(%rip), %xmm6     # 0x11080
movdqa 0x9b92(%rip), %xmm5     # 0x11070
movdqa 0x20(%rsp), %xmm4
movq 0x18(%rax), %rax
movq 0x38(%rsp), %rcx
movl %r15d, (%rax,%rcx,4)
movq 0x48(%rsp), %rcx
movl %r15d, (%rax,%rcx,4)
cmpl %ebx, 0x18(%rsp)
jge 0x75c4
addq 0x10(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm1
por %xmm6, %xmm1
pxor %xmm7, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm4, %xmm2
pcmpeqd %xmm4, %xmm1
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm3, %xmm1
movd %xmm1, %edx
notl %edx
testb $0x1, %dl
je 0x7552
movl $0x1, -0xc(%rax,%rcx,4)
pxor %xmm8, %xmm1
pextrw $0x4, %xmm1, %edx
testb $0x1, %dl
je 0x7569
movl $0x1, -0x8(%rax,%rcx,4)
por %xmm5, %xmm0
pxor %xmm7, %xmm0
movdqa %xmm0, %xmm1
pcmpgtd %xmm4, %xmm1
pcmpeqd %xmm4, %xmm0
pshufd $0xf5, %xmm0, %xmm2     # xmm2 = xmm0[1,1,3,3]
pand %xmm1, %xmm2
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
por %xmm2, %xmm0
pxor %xmm8, %xmm0
pextrw $0x0, %xmm0, %edx
testb $0x1, %dl
je 0x75a6
movl $0x1, -0x4(%rax,%rcx,4)
pextrw $0x4, %xmm0, %edx
testb $0x1, %dl
je 0x75b7
movl $0x1, (%rax,%rcx,4)
addq $0x4, %rcx
cmpq %rcx, %r13
jne 0x750b
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
decq %rcx
cmpq %r12, %rcx
ja 0x74a9
movl $0x18, %edi
callq 0x3220
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10e37(%rip), %rsi     # 0x18430
movq %rax, %rdi
callq 0x3050
incq 0x10e38(%rip)           # 0x18440
incl 0x10d1a(%rip)           # 0x18328
movq 0x40(%rsp), %rdi
movl 0xc(%rdi), %ecx
movl 0x10bd0(%rip), %eax     # 0x181ec
cltd
idivl 0x10bbd(%rip)           # 0x181e0
movl %eax, %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
movq 0x10d7d(%rip), %rcx     # 0x183b0
incl (%rcx,%rax,4)
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rcx
subq 0x68(%rax), %rcx
sarq $0x2, %rcx
movq %rcx, %xmm0
punpckldq 0x99fc(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x9a04(%rip), %xmm0     # 0x11060
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x99b8(%rip), %xmm1     # 0x11028
xorps %xmm0, %xmm0
cvtsi2sdl 0x4c(%rdi), %xmm0
xorps %xmm2, %xmm2
cvtsi2sdl 0x40(%rax), %xmm2
mulsd %xmm1, %xmm0
divsd %xmm2, %xmm0
xorps %xmm2, %xmm2
cvtsi2sdl 0x10b75(%rip), %xmm2 # 0x18208
addsd %xmm1, %xmm1
mulsd %xmm1, %xmm2
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm3
addsd %xmm1, %xmm3
addsd %xmm2, %xmm3
xorps %xmm4, %xmm4
cvtss2sd 0x54(%rdi), %xmm4
mulsd %xmm4, %xmm3
addsd 0x10d09(%rip), %xmm3    # 0x183c8
movsd %xmm3, 0x10d01(%rip)    # 0x183c8
mulsd %xmm4, %xmm0
addsd 0x10cfd(%rip), %xmm0    # 0x183d0
movsd %xmm0, 0x10cf5(%rip)    # 0x183d0
mulsd %xmm4, %xmm1
addsd 0x10cf1(%rip), %xmm1    # 0x183d8
movsd %xmm1, 0x10ce9(%rip)    # 0x183d8
mulsd %xmm4, %xmm2
addsd 0x10ce5(%rip), %xmm2    # 0x183e0
movsd %xmm2, 0x10cdd(%rip)    # 0x183e0
jmp 0x8132
movl $0xc8, %edi
addq %rdi, %r13
addq %rbp, %rdi
movq %r13, %rsi
callq 0x8c9c
movl $0xe0, %edi
addq 0x8(%rsp), %rdi
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
leaq 0x1c(%rsp), %rdx
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
callq 0x8998
movq %r12, %rdi
subq $-0x80, %rdi
callq 0x8159
movq 0x8(%rsp), %rcx
movq 0xe8(%rcx), %rdx
movl %eax, -0x4(%rdx)
cltq
movq 0x80(%r12), %rdx
imulq $0x58, %rax, %rax
movdqu (%r15), %xmm0
movdqu %xmm0, 0x48(%rdx,%rax)
movq 0xe8(%rcx), %rax
movslq -0x4(%rax), %rdx
movq 0x80(%r12), %rsi
imulq $0x58, %rdx, %rdx
decl 0xc(%rsi,%rdx)
movslq -0x4(%rax), %rax
imulq $0x58, %rax, %rax
movb $0x1, 0x8(%rsi,%rax)
decl 0x34(%r12)
movq 0xc8(%rcx), %rcx
movslq (%rcx), %rdx
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
imulq $0x58, %rdx, %rdx
decl 0xc(%rax,%rdx)
movslq (%rcx), %rdx
imulq $0x58, %rdx, %rsi
cmpl %ebx, 0x48(%rax,%rsi)
jle 0x77d7
leaq (%rax,%rsi), %rdx
addq $0x48, %rdx
movl %ebx, (%rdx)
movslq (%rcx), %rdx
imulq $0x58, %rdx, %rcx
movl 0x20(%rsp), %edx
cmpl %edx, 0x4c(%rax,%rcx)
jge 0x77f2
addq %rcx, %rax
addq $0x4c, %rax
movl 0x20(%rsp), %ecx
movl %ecx, (%rax)
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0x7c01
movl 0x20(%rsp), %r12d
decl %r12d
movl %r12d, %ebx
movslq %r12d, %rcx
movq 0x38(%rsp), %rdx
subq %rdx, %rcx
leaq 0x3(%rcx), %r13
andq $-0x4, %r13
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm4     # xmm4 = xmm0[0,1,0,1]
leaq 0x10(,%rdx,4), %rcx
movq %rcx, 0x10(%rsp)
xorl %r15d, %r15d
movdqa 0x9846(%rip), %xmm0     # 0x11090
pxor %xmm0, %xmm4
xorl %r12d, %r12d
xorl %r14d, %r14d
movdqa %xmm4, 0x20(%rsp)
movl (%rax,%r12,4), %esi
incl %r14d
movl %r14d, %r12d
movl (%rax,%r12,4), %edx
movq 0x50(%rsp), %rdi
callq 0xb0a6
pcmpeqd %xmm8, %xmm8
movdqa 0x9811(%rip), %xmm7     # 0x11090
movdqa 0x97f9(%rip), %xmm6     # 0x11080
movdqa 0x97e1(%rip), %xmm5     # 0x11070
movdqa 0x20(%rsp), %xmm4
movq 0x18(%rax), %rax
movq 0x38(%rsp), %rcx
movl %r15d, (%rax,%rcx,4)
movq 0x48(%rsp), %rcx
movl %r15d, (%rax,%rcx,4)
cmpl %ebx, 0x18(%rsp)
jge 0x7975
addq 0x10(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm1
por %xmm6, %xmm1
pxor %xmm7, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm4, %xmm2
pcmpeqd %xmm4, %xmm1
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm3, %xmm1
movd %xmm1, %edx
notl %edx
testb $0x1, %dl
je 0x7903
movl $0x1, -0xc(%rax,%rcx,4)
pxor %xmm8, %xmm1
pextrw $0x4, %xmm1, %edx
testb $0x1, %dl
je 0x791a
movl $0x1, -0x8(%rax,%rcx,4)
por %xmm5, %xmm0
pxor %xmm7, %xmm0
movdqa %xmm0, %xmm1
pcmpgtd %xmm4, %xmm1
pcmpeqd %xmm4, %xmm0
pshufd $0xf5, %xmm0, %xmm2     # xmm2 = xmm0[1,1,3,3]
pand %xmm1, %xmm2
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
por %xmm2, %xmm0
pxor %xmm8, %xmm0
pextrw $0x0, %xmm0, %edx
testb $0x1, %dl
je 0x7957
movl $0x1, -0x4(%rax,%rcx,4)
pextrw $0x4, %xmm0, %edx
testb $0x1, %dl
je 0x7968
movl $0x1, (%rax,%rcx,4)
addq $0x4, %rcx
cmpq %rcx, %r13
jne 0x78bc
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
decq %rcx
cmpq %r12, %rcx
ja 0x785a
jmp 0x7c01
movl $0xc8, %edi
leaq (%rdi,%r13), %rsi
addq %rbp, %rdi
callq 0x8c9c
movl $0xe0, %edi
addq %rdi, %r13
addq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x8c9c
movq 0x8(%rsp), %rax
movq 0xc8(%rax), %rsi
movslq (%rsi), %rcx
movq 0x10(%rsp), %rdx
movq 0x68(%rdx), %rdx
imulq $0x58, %rcx, %rcx
decl 0xc(%rdx,%rcx)
movq 0xe8(%rax), %rcx
movslq -0x4(%rcx), %rdi
movq 0x80(%r12), %rax
imulq $0x58, %rdi, %rdi
decl 0xc(%rax,%rdi)
movslq (%rsi), %rdi
imulq $0x58, %rdi, %r8
cmpl %ebx, 0x48(%rdx,%r8)
jle 0x7a11
leaq (%rdx,%r8), %rdi
addq $0x48, %rdi
movl %ebx, (%rdi)
movslq (%rsi), %rdi
imulq $0x58, %rdi, %rsi
movl 0x20(%rsp), %edi
cmpl %edi, 0x4c(%rdx,%rsi)
jge 0x7a2c
addq %rsi, %rdx
addq $0x4c, %rdx
movl 0x20(%rsp), %esi
movl %esi, (%rdx)
movslq -0x4(%rcx), %rdx
imulq $0x58, %rdx, %rsi
cmpl %ebx, 0x48(%rax,%rsi)
jle 0x7a48
leaq (%rax,%rsi), %rdx
addq $0x48, %rdx
movl %ebx, (%rdx)
movslq -0x4(%rcx), %rdx
imulq $0x58, %rdx, %rcx
movl 0x20(%rsp), %edx
cmpl %edx, 0x4c(%rax,%rcx)
jge 0x7a63
addq %rcx, %rax
addq $0x4c, %rax
movl 0x20(%rsp), %ecx
movl %ecx, (%rax)
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0x7c01
movl 0x20(%rsp), %r12d
decl %r12d
movl %r12d, %ebx
movslq %r12d, %rcx
movq 0x38(%rsp), %rdx
subq %rdx, %rcx
leaq 0x3(%rcx), %r13
andq $-0x4, %r13
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm4     # xmm4 = xmm0[0,1,0,1]
leaq 0x10(,%rdx,4), %rcx
movq %rcx, 0x10(%rsp)
xorl %r15d, %r15d
movdqa 0x95d5(%rip), %xmm0     # 0x11090
pxor %xmm0, %xmm4
xorl %r12d, %r12d
xorl %r14d, %r14d
movdqa %xmm4, 0x20(%rsp)
movl (%rax,%r12,4), %esi
incl %r14d
movl %r14d, %r12d
movl (%rax,%r12,4), %edx
movq 0x50(%rsp), %rdi
callq 0xb0a6
pcmpeqd %xmm8, %xmm8
movdqa 0x95a0(%rip), %xmm7     # 0x11090
movdqa 0x9588(%rip), %xmm6     # 0x11080
movdqa 0x9570(%rip), %xmm5     # 0x11070
movdqa 0x20(%rsp), %xmm4
movq 0x18(%rax), %rax
movq 0x38(%rsp), %rcx
movl %r15d, (%rax,%rcx,4)
movq 0x48(%rsp), %rcx
movl %r15d, (%rax,%rcx,4)
cmpl %ebx, 0x18(%rsp)
jge 0x7be6
addq 0x10(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm1
por %xmm6, %xmm1
pxor %xmm7, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm4, %xmm2
pcmpeqd %xmm4, %xmm1
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm3, %xmm1
movd %xmm1, %edx
notl %edx
testb $0x1, %dl
je 0x7b74
movl $0x1, -0xc(%rax,%rcx,4)
pxor %xmm8, %xmm1
pextrw $0x4, %xmm1, %edx
testb $0x1, %dl
je 0x7b8b
movl $0x1, -0x8(%rax,%rcx,4)
por %xmm5, %xmm0
pxor %xmm7, %xmm0
movdqa %xmm0, %xmm1
pcmpgtd %xmm4, %xmm1
pcmpeqd %xmm4, %xmm0
pshufd $0xf5, %xmm0, %xmm2     # xmm2 = xmm0[1,1,3,3]
pand %xmm1, %xmm2
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
por %xmm2, %xmm0
pxor %xmm8, %xmm0
pextrw $0x0, %xmm0, %edx
testb $0x1, %dl
je 0x7bc8
movl $0x1, -0x4(%rax,%rcx,4)
pextrw $0x4, %xmm0, %edx
testb $0x1, %dl
je 0x7bd9
movl $0x1, (%rax,%rcx,4)
addq $0x4, %rcx
cmpq %rcx, %r13
jne 0x7b2d
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
decq %rcx
cmpq %r12, %rcx
ja 0x7acb
movl $0x18, %edi
callq 0x3220
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x1082d(%rip), %rsi     # 0x18448
movq %rax, %rdi
callq 0x3050
incq 0x1082e(%rip)           # 0x18458
incl 0x106f4(%rip)           # 0x18324
movq 0x40(%rsp), %rdi
movl 0xc(%rdi), %ecx
movl 0x105ae(%rip), %eax     # 0x181ec
cltd
idivl 0x1059b(%rip)           # 0x181e0
movl %eax, %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
movq 0x10743(%rip), %rcx     # 0x18398
incl (%rcx,%rax,4)
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rcx
subq 0x68(%rax), %rcx
sarq $0x2, %rcx
movq %rcx, %xmm1
punpckldq 0x93da(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x93e2(%rip), %xmm1     # 0x11060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
addsd 0x9396(%rip), %xmm0     # 0x11028
xorps %xmm1, %xmm1
cvtsi2sdl 0x4c(%rdi), %xmm1
mulsd %xmm0, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0x40(%rax), %xmm2
divsd %xmm2, %xmm1
movl 0x10558(%rip), %esi     # 0x18208
xorps %xmm2, %xmm2
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 0x106d5(%rip), %xmm2    # 0x183c8
movsd %xmm2, 0x106cd(%rip)    # 0x183c8
mulsd %xmm4, %xmm1
addsd 0x106c9(%rip), %xmm1    # 0x183d0
movsd %xmm1, 0x106c1(%rip)    # 0x183d0
mulsd %xmm4, %xmm3
addsd 0x106bd(%rip), %xmm3    # 0x183d8
movsd %xmm3, 0x106b5(%rip)    # 0x183d8
jmp 0x8104
leaq 0xc8(%rbp), %rdi
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
leaq 0x1c(%rsp), %r13
movl %r14d, (%r13)
movq %r13, %rdx
callq 0x8998
movl $0xe0, %edi
addq 0x8(%rsp), %rdi
movq 0x70(%rbp), %rsi
subq 0x68(%rbp), %rsi
sarq $0x2, %rsi
movl %r14d, (%r13)
leaq 0x1c(%rsp), %rdx
callq 0x8998
movq 0x10(%rsp), %r14
movq %r14, %rdi
addq $0x68, %rdi
callq 0x8159
movq 0x8(%rsp), %rcx
movq 0xc8(%rcx), %rcx
movl %eax, (%rcx)
decl 0x2c(%r14)
movq %r12, %rdi
subq $-0x80, %rdi
callq 0x8159
movq 0x8(%rsp), %rcx
movq 0xe8(%rcx), %rdx
movl %eax, -0x4(%rdx)
decl 0x34(%r12)
movq 0xc8(%rcx), %rax
movslq (%rax), %rax
movq 0x68(%r14), %rdx
imulq $0x58, %rax, %rax
movups (%r15), %xmm0
movups %xmm0, 0x48(%rdx,%rax)
movq 0xc8(%rcx), %rax
movslq (%rax), %rdx
movq 0x68(%r14), %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(%r12), %rsi
imulq $0x58, %rax, %rax
movdqu (%r15), %xmm0
movdqu %xmm0, 0x48(%rsi,%rax)
movq 0xe8(%rcx), %rax
movslq -0x4(%rax), %rcx
movq 0x80(%r12), %rsi
imulq $0x58, %rcx, %rcx
decl 0xc(%rsi,%rcx)
movslq -0x4(%rax), %rax
imulq $0x58, %rax, %rax
movb %dl, 0x8(%rsi,%rax)
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0x7fde
movl 0x20(%rsp), %r12d
decl %r12d
movl %r12d, %ebx
movslq %r12d, %rcx
movq 0x38(%rsp), %rdx
subq %rdx, %rcx
leaq 0x3(%rcx), %r13
andq $-0x4, %r13
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm4     # xmm4 = xmm0[0,1,0,1]
leaq 0x10(,%rdx,4), %rcx
movq %rcx, 0x10(%rsp)
xorl %r15d, %r15d
movdqa 0x91f8(%rip), %xmm0     # 0x11090
pxor %xmm0, %xmm4
xorl %r12d, %r12d
xorl %r14d, %r14d
movdqa %xmm4, 0x20(%rsp)
movl (%rax,%r12,4), %esi
incl %r14d
movl %r14d, %r12d
movl (%rax,%r12,4), %edx
movq 0x50(%rsp), %rdi
callq 0xb0a6
pcmpeqd %xmm8, %xmm8
movdqa 0x91c3(%rip), %xmm7     # 0x11090
movdqa 0x91ab(%rip), %xmm6     # 0x11080
movdqa 0x9193(%rip), %xmm5     # 0x11070
movdqa 0x20(%rsp), %xmm4
movq 0x18(%rax), %rax
movq 0x38(%rsp), %rcx
movl %r15d, (%rax,%rcx,4)
movq 0x48(%rsp), %rcx
movl %r15d, (%rax,%rcx,4)
cmpl %ebx, 0x18(%rsp)
jge 0x7fc3
addq 0x10(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm1
por %xmm6, %xmm1
pxor %xmm7, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm4, %xmm2
pcmpeqd %xmm4, %xmm1
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm3, %xmm1
movd %xmm1, %edx
notl %edx
testb $0x1, %dl
je 0x7f51
movl $0x1, -0xc(%rax,%rcx,4)
pxor %xmm8, %xmm1
pextrw $0x4, %xmm1, %edx
testb $0x1, %dl
je 0x7f68
movl $0x1, -0x8(%rax,%rcx,4)
por %xmm5, %xmm0
pxor %xmm7, %xmm0
movdqa %xmm0, %xmm1
pcmpgtd %xmm4, %xmm1
pcmpeqd %xmm4, %xmm0
pshufd $0xf5, %xmm0, %xmm2     # xmm2 = xmm0[1,1,3,3]
pand %xmm1, %xmm2
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
por %xmm2, %xmm0
pxor %xmm8, %xmm0
pextrw $0x0, %xmm0, %edx
testb $0x1, %dl
je 0x7fa5
movl $0x1, -0x4(%rax,%rcx,4)
pextrw $0x4, %xmm0, %edx
testb $0x1, %dl
je 0x7fb6
movl $0x1, (%rax,%rcx,4)
addq $0x4, %rcx
cmpq %rcx, %r13
jne 0x7f0a
movq 0x68(%rbp), %rax
movq 0x70(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
decq %rcx
cmpq %r12, %rcx
ja 0x7ea8
movl $0x18, %edi
callq 0x3220
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10450(%rip), %rsi     # 0x18448
movq %rax, %rdi
callq 0x3050
incq 0x10451(%rip)           # 0x18458
incl 0x10317(%rip)           # 0x18324
movq 0x40(%rsp), %rdi
movl 0xc(%rdi), %ecx
movl 0x101d1(%rip), %eax     # 0x181ec
cltd
idivl 0x101be(%rip)           # 0x181e0
movl %eax, %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
movq 0x10366(%rip), %rcx     # 0x18398
incl (%rcx,%rax,4)
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rcx
subq 0x68(%rax), %rcx
sarq $0x2, %rcx
movq %rcx, %xmm1
punpckldq 0x8ffd(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x9005(%rip), %xmm1     # 0x11060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
addsd 0x8fb9(%rip), %xmm0     # 0x11028
xorps %xmm1, %xmm1
cvtsi2sdl 0x4c(%rdi), %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0x40(%rax), %xmm2
mulsd %xmm0, %xmm1
movl 0x1017f(%rip), %esi     # 0x18208
cvtsi2sd %esi, %xmm3
divsd %xmm2, %xmm1
cvttsd2si %xmm1, %ecx
movl %ecx, %eax
cltd
idivl %esi
subl %edx, %ecx
xorps %xmm2, %xmm2
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 0x102f4(%rip), %xmm3    # 0x183c8
movsd %xmm3, 0x102ec(%rip)    # 0x183c8
mulsd %xmm4, %xmm1
addsd 0x102e8(%rip), %xmm1    # 0x183d0
movsd %xmm1, 0x102e0(%rip)    # 0x183d0
mulsd %xmm4, %xmm2
addsd 0x102dc(%rip), %xmm2    # 0x183d8
movsd %xmm2, 0x102d4(%rip)    # 0x183d8
mulsd %xmm4, %xmm0
addsd 0x102d0(%rip), %xmm0    # 0x183e0
movsd %xmm0, 0x102c8(%rip)    # 0x183e0
jmp 0x8132
movq 0xfecf(%rip), %rdi      # 0x17ff0
leaq 0x9117(%rip), %rsi      # 0x1123f
movl $0x16, %edx
callq 0x3250
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0xf8, %esi
movq %rbp, %rdi
callq 0x3230
movq %rbx, %rdi
callq 0x3370