// File: chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: hap_alignment_advance_worker(void*, long, int)
static void hap_alignment_advance_worker(void *_data, long eid, int tid)
{
    hap_alignment_struct_pip* hap_buf = (hap_alignment_struct_pip*)_data;
    ma_ug_t *ug = hap_buf->ug;
    asg_t *read_g = hap_buf->read_g;
    ma_hit_t_alloc* sources = hap_buf->sources;
    ma_hit_t_alloc* reverse_sources = hap_buf->reverse_sources;
    R_to_U* ruIndex = hap_buf->ruIndex;
    ma_sub_t *coverage_cut = hap_buf->coverage_cut;
    uint64_t* position_index = hap_buf->position_index;
    float Hap_rate = hap_buf->Hap_rate/**MIN(hap_buf->Hap_rate, 0.2)**/, sim;
    int max_hang = hap_buf->max_hang;
    int min_ovlp = hap_buf->min_ovlp;
    float chain_rate = hap_buf->chain_rate;
    hap_overlaps_list* all_ovlp = hap_buf->all_ovlp;
    uint32_t Input_uId = eid;
    uint64_t* vote_counting = hap_buf->buf[tid].vote_counting;
    uint8_t* visit = hap_buf->buf[tid].visit;
    kvec_t_u64_warp* u_vecs = &(hap_buf->buf[tid].u_vecs);
    kvec_asg_arc_t_offset* u_buffer = &(hap_buf->buf[tid].u_buffer);
    kvec_hap_candidates* u_can = &(hap_buf->buf[tid].u_can);
    kvec_t_i32_warp* score_vc = &(hap_buf->buf[tid].u_buffer_tailIndex);
    kvec_t_i32_warp* prevIndex_vec = &(hap_buf->buf[tid].u_buffer_prevIndex);
    kvec_t_i32_warp* begIndex_vec = &(hap_buf->buf[tid].u_buffer_beg);
    kvec_t_u8_warp* flag_vec = &(hap_buf->buf[tid].u_buffer_flag);
    uint64_t cov_threshold = hap_buf->cov_threshold;
    hap_cov_t *cov = hap_buf->cov;
    uint8_t *hh = hap_buf->hh, hhc;
    if(hap_buf->cov_threshold < 0) cov_threshold = (uint64_t)-1;
    ma_utg_t *xReads = NULL, *yReads = NULL;
    ma_hit_t_alloc *xR = NULL;
    ma_hit_t *h = NULL;
    ma_sub_t *sq = NULL, *st = NULL;
    asg_t* nsg = ug->g;
    uint32_t i, j, v, rId, k, is_Unitig, Hap_uId, xUid, yUid, seedOcc;
    uint64_t tmp, max_weight, m;
    long long r_x_pos_beg, r_x_pos_end, r_y_pos_beg, r_y_pos_end, max_score;
    int32_t r;
    asg_arc_t t;
    asg_arc_t_offset t_offset;
    hap_overlaps hap_align;
    hap_overlaps *hap_align_x = NULL;
    xUid = Input_uId;
    if(nsg->seq[xUid].del || nsg->seq[xUid].c == ALTER_LABLE) return;
    memset(vote_counting, 0, sizeof(uint64_t)*nsg->n_seq);
    memset(visit, 0, nsg->n_seq);
    u_vecs->a.n = 0;
    u_can->a.n = 0;

    xReads = &(ug->u.a[xUid]);
    for (i = 0; i < xReads->n; i++)
    {
        xR = &(reverse_sources[xReads->a[i]>>33]);
        
        for (k = 0; k < xR->length; k++)
        {
            rId = Get_tn(xR->buffer[k]);
        
            if(read_g->seq[rId].del == 1)
            {
                ///get the id of read that contains it 
                get_R_to_U(ruIndex, rId, &rId, &is_Unitig);
                if(rId == (uint32_t)-1 || is_Unitig == 1 || read_g->seq[rId].del == 1) continue;
            }

            ///there are two cases: 
            ///1. read at primary contigs, get_R_to_U() return its corresponding contig Id  
            ///2. read at alternative contigs, get_R_to_U() return (uint32_t)-1
            get_R_to_U(ruIndex, rId, &Hap_uId, &is_Unitig);
            if(is_Unitig == 0 || Hap_uId == (uint32_t)-1) continue;
            ///here rId is the id of the read coming from the different haplotype
            ///Hap_cId is the id of the corresponding contig (note here is the contig, instead of untig)
            if(visit[Hap_uId]!=0) continue; ///one read only has one vote for one hap unitig
            visit[Hap_uId] = 1;
            if(vote_counting[Hap_uId] < UINT64_MAX) vote_counting[Hap_uId]++;
        }

        clean_visit_flag(visit, read_g, ruIndex, nsg->n_seq, xR);
    }



    u_vecs->a.n = 0;
    for (i = 0; i < nsg->n_seq; i++)
    {
        if(i == xUid) continue;
        if(vote_counting[i] == 0) continue;
        tmp = vote_counting[i]; tmp = tmp << 32; tmp = tmp | (uint64_t)i;
        kv_push(uint64_t, u_vecs->a, tmp);
    }

    if(u_vecs->a.n == 0) return;
    sort_kvec_t_u64_warp(u_vecs, 1);


    ///scan each candidate unitig
    for (i = 0; i < u_vecs->a.n; i++)
    {
        yUid = (uint32_t)u_vecs->a.a[i];
        seedOcc = u_vecs->a.a[i]>>32;
        xReads = &(ug->u.a[xUid]);
        yReads = &(ug->u.a[yUid]);
        u_buffer->a.n = 0;

        for (k = 0; k < xReads->n; k++)
        {
            xR = &(reverse_sources[xReads->a[k]>>33]);
            hhc = hh[xReads->a[k]>>33];
            for (j = 0; j < xR->length; j++)
            {
                h = &(xR->buffer[j]);
                sq = &(coverage_cut[Get_qn(*h)]);
                st = &(coverage_cut[Get_tn(*h)]);
                if(st->del || read_g->seq[Get_tn(*h)].del) continue;

                r = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                asm_opt.max_hang_rate, min_ovlp, &t);
                ///if it is a contained overlap, skip
                if(r < 0) continue;

                rId = t.v>>1;
                if(read_g->seq[rId].del == 1) continue;
                ///there are two cases: 
                ///1. read at primary contigs, get_R_to_U() return its corresponding contig Id  
                ///2. read at alternative contigs, get_R_to_U() return (uint32_t)-1
                get_R_to_U(ruIndex, rId, &Hap_uId, &is_Unitig);
                if(is_Unitig == 0 || Hap_uId == (uint32_t)-1) continue;
                if(Hap_uId != yUid) continue;

                v = xReads->a[k]>>32;
                get_R_to_U(ruIndex, v>>1, &Hap_uId, &is_Unitig);
                if(is_Unitig == 0 || Hap_uId == (uint32_t)-1) continue;
                if(Hap_uId != xUid) continue;
                if((uint32_t)(position_index[v>>1]) != k) continue;

                if(asm_opt.purge_level_primary <= 2 &&
                    (prefilter((uint32_t)(position_index[v>>1]), (uint32_t)(position_index[rId]), 
                    xReads->n, yReads->n, 0, Hap_rate, seedOcc)==NON_PLOID) && 
                   (prefilter((uint32_t)(position_index[v>>1]), (uint32_t)(position_index[rId]), 
                    xReads->n, yReads->n, 1, Hap_rate, seedOcc)==NON_PLOID))
                {
                    continue;
                }
            
                t_offset.Off = get_xy_pos(read_g, &t, v, (yReads->a[(uint32_t)(position_index[rId])])>>32, 
                xReads->len, yReads->len, position_index, &(t.el));
                if(((t_offset.Off>>32) == (uint32_t)-1) || (((uint32_t)t_offset.Off) == (uint32_t)-1)) continue;

                t_offset.x = t;
                t_offset.weight = hhc;

                kv_push(asg_arc_t_offset, u_buffer->a, t_offset);
            }

            deduplicate_edge(u_buffer);
        }

        if(u_buffer->a.n == 0) continue;

        
        get_candidate_hap_alignment(u_can, u_buffer, score_vc, prevIndex_vec, begIndex_vec,
        flag_vec, chain_rate, 50, xReads->len, yReads->len);

        if(u_can->a.n == 0) continue;
        
        qsort(u_can->a.a, u_can->a.n, sizeof(hap_candidates), cmp_hap_candidates);

        memset(&hap_align, 0, sizeof(hap_overlaps));    
        m = all_ovlp->x[xUid].a.n;     
        max_weight = 0; max_score = 0;
        for (k = 0; k < u_can->a.n; k++)
        {
            if(u_can->a.a[k].weight < max_weight*0.33) continue;
            if(calculate_pair_hap_similarity_advance(&(u_can->a.a[k]), position_index, xUid, yUid, 
            xReads, yReads, sources, reverse_sources, read_g, ruIndex, coverage_cut, Hap_rate,
            (asm_opt.purge_level_primary<=2? 0:1), max_hang, min_ovlp, cov_threshold, u_buffer, 
            score_vc, prevIndex_vec, cov, &r_x_pos_beg, &r_x_pos_end, &r_y_pos_beg, &r_y_pos_end, &sim)!=PLOID)
            {
                continue;
            }
            ///max_weight == 0 means the first matched chain
            if(max_weight == 0 || max_score < u_can->a.a[k].score) max_score = u_can->a.a[k].score;
            if(max_weight < u_can->a.a[k].weight) max_weight = u_can->a.a[k].weight;
            ///if one is positive and another one is negative, it is wrong
            if(!filter_secondary_chain(max_score, u_can->a.a[k].score, CHAIN_FILTER_RATE)) continue;
                            
            hap_align.rev = Get_rev(u_can->a.a[k]);
            hap_align.type = Get_type(u_can->a.a[k]);
            hap_align.x_beg_id = Get_x_beg(u_can->a.a[k]);
            hap_align.x_end_id = Get_x_end(u_can->a.a[k]) + 1;
            hap_align.y_beg_id = Get_y_beg(u_can->a.a[k]);
            hap_align.y_end_id = Get_y_end(u_can->a.a[k]) + 1;
            hap_align.weight = Get_match(u_can->a.a[k]);
            hap_align.score = u_can->a.a[k].score;
            hap_align.x_beg_pos = r_x_pos_beg;
            hap_align.x_end_pos = r_x_pos_end + 1;
            if(hap_align.rev == 0)
            {
                hap_align.y_beg_pos = r_y_pos_beg;
                hap_align.y_end_pos = r_y_pos_end + 1;
            }
            else
            {
                hap_align.y_beg_pos = yReads->len - r_y_pos_end - 1;
                hap_align.y_end_pos = yReads->len - r_y_pos_beg - 1 + 1;
            }
            hap_align.xUid = xUid;
            hap_align.yUid = yUid;
            hap_align.status = SELF_EXIST;
            hap_align.s = sim;
            kv_push(hap_overlaps, all_ovlp->x[hap_align.xUid].a, hap_align);
        }
        /**
        ///chains with same xUid && yUid
        for (k = m; k < all_ovlp->x[xUid].a.n; k++)
        {
            if(!filter_secondary_chain(max_score, 
                        all_ovlp->x[xUid].a.a[k].score, CHAIN_FILTER_RATE))
            {
                continue;
            } 
            all_ovlp->x[xUid].a.a[m] = all_ovlp->x[xUid].a.a[k];
            m++;
        }
        all_ovlp->x[xUid].a.n = m;
        **/

        hap_align_x = NULL;
        for (k = m; k < all_ovlp->x[xUid].a.n; k++)
        {
            if(all_ovlp->x[xUid].a.a[k].score != max_score) continue;
            if(hap_align_x == NULL || all_ovlp->x[xUid].a.a[k].weight > hap_align_x->weight)
            {
                hap_align_x = &(all_ovlp->x[xUid].a.a[k]);
            }
            else if(all_ovlp->x[xUid].a.a[k].weight == hap_align_x->weight)
            {
                if((all_ovlp->x[xUid].a.a[k].x_end_pos 
                            - all_ovlp->x[xUid].a.a[k].x_beg_pos) < 
                    (hap_align_x->x_end_pos - hap_align_x->x_beg_pos))
                {
                    hap_align_x = &(all_ovlp->x[xUid].a.a[k]);
                }
            }
        }
        if(hap_align_x)
        {
            all_ovlp->x[xUid].a.a[m] = (*hap_align_x);
            all_ovlp->x[xUid].a.n = m + 1;
        }
    }
    // filter_secondary_ovlp(&all_ovlp->x[xUid], u_vecs, hap_buf->Hap_rate, 0.7);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x48(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x48(%rbp), %rax
movss 0x50(%rax), %xmm0
movss %xmm0, -0x84(%rbp)
movq -0x48(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x48(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, -0x90(%rbp)
movq -0x48(%rbp), %rax
movss 0x5c(%rax), %xmm0
movss %xmm0, -0x94(%rbp)
movq -0x48(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x38(%rbp), %rax
movl %eax, -0xa4(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xf0, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xf0, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xf0, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movq %rax, -0xc0(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xf0, %rcx, %rcx
addq %rcx, %rax
addq $0x30, %rax
movq %rax, -0xc8(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xf0, %rcx, %rcx
addq %rcx, %rax
addq $0xd0, %rax
movq %rax, -0xd0(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xf0, %rcx, %rcx
addq %rcx, %rax
addq $0x50, %rax
movq %rax, -0xd8(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xf0, %rcx, %rcx
addq %rcx, %rax
addq $0x70, %rax
movq %rax, -0xe0(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xf0, %rcx, %rcx
addq %rcx, %rax
addq $0xb0, %rax
movq %rax, -0xe8(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xf0, %rcx, %rcx
addq %rcx, %rax
addq $0x90, %rax
movq %rax, -0xf0(%rbp)
movq -0x48(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0xf8(%rbp)
movq -0x48(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x100(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x108(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jge 0x1817a8
movq $-0x1, -0xf8(%rbp)
movq $0x0, -0x118(%rbp)
movq $0x0, -0x120(%rbp)
movq $0x0, -0x128(%rbp)
movq $0x0, -0x130(%rbp)
movq $0x0, -0x138(%rbp)
movq $0x0, -0x140(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x148(%rbp)
movq $0x0, -0x240(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x168(%rbp)
movq -0x148(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x168(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x181847
movq -0x148(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x168(%rbp), %ecx
movzbl 0x4(%rax,%rcx,8), %eax
cmpl $0x1, %eax
jne 0x18184c
jmp 0x182bb5
movq -0xb0(%rbp), %rdi
movq -0x148(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2100
movq -0xb8(%rbp), %rdi
movq -0x148(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x2100
movq -0xc0(%rbp), %rax
movq $0x0, (%rax)
movq -0xd0(%rbp), %rax
movq $0x0, (%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movl $0x0, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movq -0x118(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x181a99
movq -0x68(%rbp), %rax
movq -0x118(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x14c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
movl $0x0, -0x15c(%rbp)
movl -0x15c(%rbp), %eax
movq -0x128(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x181a5a
movq -0x128(%rbp), %rax
movq (%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x158(%rbp)
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x158(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x1, %eax
jne 0x1819bd
movq -0x70(%rbp), %rdi
movl -0x158(%rbp), %esi
leaq -0x158(%rbp), %rdx
leaq -0x160(%rbp), %rcx
callq 0xd3d50
cmpl $-0x1, -0x158(%rbp)
je 0x1819b6
cmpl $0x1, -0x160(%rbp)
je 0x1819b6
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x158(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x1, %eax
jne 0x1819bb
jmp 0x181a46
jmp 0x1819bd
movq -0x70(%rbp), %rdi
movl -0x158(%rbp), %esi
leaq -0x164(%rbp), %rdx
leaq -0x160(%rbp), %rcx
callq 0xd3d50
cmpl $0x0, -0x160(%rbp)
je 0x1819ec
cmpl $-0x1, -0x164(%rbp)
jne 0x1819ee
jmp 0x181a46
movq -0xb8(%rbp), %rax
movl -0x164(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x181a06
jmp 0x181a46
movq -0xb8(%rbp), %rax
movl -0x164(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movq -0xb0(%rbp), %rax
movl -0x164(%rbp), %ecx
cmpq $-0x1, (%rax,%rcx,8)
jae 0x181a44
movq -0xb0(%rbp), %rax
movl -0x164(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x181a46
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x18191f
movq -0xb8(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x148(%rbp), %rax
movl 0x14(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x128(%rbp), %r8
callq 0x186300
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0x1818d4
movq -0xc0(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movq -0x148(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x181c05
movl -0x14c(%rbp), %eax
cmpl -0x168(%rbp), %eax
jne 0x181ae2
jmp 0x181bf1
movq -0xb0(%rbp), %rax
movl -0x14c(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jne 0x181afb
jmp 0x181bf1
movq -0xb0(%rbp), %rax
movl -0x14c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
movl -0x14c(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x178(%rbp)
movq -0xc0(%rbp), %rax
movq (%rax), %rax
movq -0xc0(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x181bc5
movq -0xc0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x181b78
movq -0xc0(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x248(%rbp)
jmp 0x181b86
movl $0x2, %eax
movq %rax, -0x248(%rbp)
jmp 0x181b86
movq -0x248(%rbp), %rcx
movq -0xc0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc0(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xc0(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x178(%rbp), %rdx
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc0(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x181bf1
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0x181ab1
movq -0xc0(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x181c17
jmp 0x182bb5
movq -0xc0(%rbp), %rdi
movl $0x1, %esi
callq 0xcd080
movl $0x0, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movq -0xc0(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x182bb5
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x16c(%rbp)
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x170(%rbp)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x16c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x120(%rbp)
movq -0xc8(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x15c(%rbp)
movl -0x15c(%rbp), %eax
movq -0x118(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1821ed
movq -0x68(%rbp), %rax
movq -0x118(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x15c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
movq -0x108(%rbp), %rax
movq -0x118(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x15c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movb (%rax,%rcx), %al
movb %al, -0x109(%rbp)
movl $0x0, -0x150(%rbp)
movl -0x150(%rbp), %eax
movq -0x128(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x1821cd
movq -0x128(%rbp), %rax
movq (%rax), %rax
movl -0x150(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x130(%rbp)
movq -0x78(%rbp), %rax
movq -0x130(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x138(%rbp)
movq -0x78(%rbp), %rax
movq -0x130(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x181de6
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x130(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x181deb
jmp 0x1821b9
movq -0x130(%rbp), %rdi
movq -0x138(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x138(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0x140(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x140(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl -0x8c(%rbp), %ecx
leaq 0x2429c5(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl -0x90(%rbp), %r8d
leaq -0x1d0(%rbp), %r9
callq 0x172eb0
movl %eax, -0x1b4(%rbp)
cmpl $0x0, -0x1b4(%rbp)
jge 0x181e62
jmp 0x1821b9
movl -0x1c8(%rbp), %eax
shrl %eax
movl %eax, -0x158(%rbp)
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x158(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x1, %eax
jne 0x181e8e
jmp 0x1821b9
movq -0x70(%rbp), %rdi
movl -0x158(%rbp), %esi
leaq -0x164(%rbp), %rdx
leaq -0x160(%rbp), %rcx
callq 0xd3d50
cmpl $0x0, -0x160(%rbp)
je 0x181ebd
cmpl $-0x1, -0x164(%rbp)
jne 0x181ec2
jmp 0x1821b9
movl -0x164(%rbp), %eax
cmpl -0x16c(%rbp), %eax
je 0x181ed5
jmp 0x1821b9
movq -0x118(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x15c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x154(%rbp)
movq -0x70(%rbp), %rdi
movl -0x154(%rbp), %esi
shrl %esi
leaq -0x164(%rbp), %rdx
leaq -0x160(%rbp), %rcx
callq 0xd3d50
cmpl $0x0, -0x160(%rbp)
je 0x181f25
cmpl $-0x1, -0x164(%rbp)
jne 0x181f2a
jmp 0x1821b9
movl -0x164(%rbp), %eax
cmpl -0x168(%rbp), %eax
je 0x181f3d
jmp 0x1821b9
movq -0x80(%rbp), %rax
movl -0x154(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
cmpl -0x15c(%rbp), %eax
je 0x181f5c
jmp 0x1821b9
leaq 0x242895(%rip), %rax    # 0x3c47f8
cmpl $0x2, 0x130(%rax)
jg 0x182020
movq -0x80(%rbp), %rax
movl -0x154(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movq -0x80(%rbp), %rax
movl -0x158(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
movq -0x118(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x120(%rbp), %rax
movl 0x10(%rax), %ecx
movss -0x84(%rbp), %xmm0
movl -0x170(%rbp), %r9d
xorl %r8d, %r8d
callq 0x1700a0
cmpl $0x1, %eax
jne 0x182020
movq -0x80(%rbp), %rax
movl -0x154(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movq -0x80(%rbp), %rax
movl -0x158(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
movq -0x118(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x120(%rbp), %rax
movl 0x10(%rax), %ecx
movss -0x84(%rbp), %xmm0
movl -0x170(%rbp), %r9d
movl $0x1, %r8d
callq 0x1700a0
cmpl $0x1, %eax
jne 0x182020
jmp 0x1821b9
movq -0x58(%rbp), %rdi
movl -0x154(%rbp), %edx
movq -0x120(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x80(%rbp), %rcx
movl -0x158(%rbp), %esi
movq (%rcx,%rsi,8), %rcx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0x118(%rbp), %rax
movl (%rax), %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq -0x120(%rbp), %rax
movl (%rax), %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movq -0x80(%rbp), %r10
leaq -0x1d0(%rbp), %rax
addq $0x12, %rax
leaq -0x1d0(%rbp), %rsi
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1859f0
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
shrq $0x20, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x1820bd
movq -0x1e0(%rbp), %rax
cmpl $-0x1, %eax
jne 0x1820c2
jmp 0x1821b9
movq -0x1d0(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0x1c8(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0x1c0(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movzbl -0x109(%rbp), %eax
movq %rax, -0x1d8(%rbp)
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movq -0xc8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x182180
movq -0xc8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x182136
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x250(%rbp)
jmp 0x182144
movl $0x2, %eax
movq %rax, -0x250(%rbp)
jmp 0x182144
movq -0x250(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
imulq $0x28, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq -0x1f8(%rbp), %rsi
movl $0x28, %edx
callq 0x2180
jmp 0x1821b9
movl -0x150(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x150(%rbp)
jmp 0x181d46
movq -0xc8(%rbp), %rdi
callq 0x1702b0
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x181cd2
movq -0xc8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1821ff
jmp 0x182ba1
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq -0xe0(%rbp), %rcx
movq -0xe8(%rbp), %r8
movq -0xf0(%rbp), %r9
movss -0x94(%rbp), %xmm0
movq -0x118(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %r10d
movq -0x120(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq $0x32, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x179690
movq -0xd0(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x18227d
jmp 0x182ba1
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq (%rax), %rsi
movl $0x48, %edx
leaq -0x11b1e(%rip), %rcx    # 0x170780
callq 0x23e0
leaq -0x238(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x2100
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x188(%rbp)
movq $0x0, -0x180(%rbp)
movq $0x0, -0x1b0(%rbp)
movl $0x0, -0x15c(%rbp)
movl -0x15c(%rbp), %eax
movq -0xd0(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x182957
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
leaq (%rcx,%rcx,8), %rcx
movq (%rax,%rcx,8), %xmm1
movaps 0x1ffce2(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movapd 0x1ffce6(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movq -0x180(%rbp), %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm2, %xmm0
movaps %xmm0, %xmm2
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm2, %xmm0
movsd 0x207c64(%rip), %xmm2   # 0x389fd0
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x18237b
jmp 0x182943
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x15c(%rbp), %eax
imulq $0x48, %rax, %rax
addq %rax, %rdi
movq -0x80(%rbp), %rsi
movl -0x168(%rbp), %edx
movl -0x16c(%rbp), %ecx
movq -0x118(%rbp), %r8
movq -0x120(%rbp), %r9
movq -0x60(%rbp), %rax
movq %rax, -0x2a0(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x298(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x288(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x280(%rbp)
movss -0x84(%rbp), %xmm0
leaq 0x242401(%rip), %rax    # 0x3c47f8
movl 0x130(%rax), %r11d
movl $0x1, %eax
xorl %r10d, %r10d
cmpl $0x2, %r11d
cmovlel %r10d, %eax
movl %eax, -0x274(%rbp)
movl -0x8c(%rbp), %eax
movl %eax, -0x270(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x26c(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0x268(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0xd8(%rbp), %r13
movq -0xe0(%rbp), %r12
movq -0x100(%rbp), %r15
leaq -0x190(%rbp), %r14
leaq -0x198(%rbp), %rbx
leaq -0x1a0(%rbp), %r11
leaq -0x1a8(%rbp), %r10
leaq -0x88(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x2a0(%rbp), %rax
movq %rax, (%rsp)
movq -0x298(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x290(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x288(%rbp), %rax
movq %rax, 0x18(%rsp)
movq -0x280(%rbp), %rax
movq %rax, 0x20(%rsp)
movl -0x274(%rbp), %eax
movl %eax, 0x28(%rsp)
movl -0x270(%rbp), %eax
movl %eax, 0x30(%rsp)
movl -0x26c(%rbp), %eax
movl %eax, 0x38(%rsp)
movq -0x268(%rbp), %rax
movq %rax, 0x40(%rsp)
movq -0x260(%rbp), %rax
movq %rax, 0x48(%rsp)
movq -0x258(%rbp), %rax
movq %r13, 0x50(%rsp)
movq %r12, 0x58(%rsp)
movq %r15, 0x60(%rsp)
movq %r14, 0x68(%rsp)
movq %rbx, 0x70(%rsp)
movq %r11, 0x78(%rsp)
movq %r10, 0x80(%rsp)
movq %rax, 0x88(%rsp)
callq 0x177ec0
cmpl $0x0, %eax
je 0x18253c
jmp 0x182943
cmpq $0x0, -0x180(%rbp)
je 0x18256b
movq -0x1b0(%rbp), %rax
movq -0xd0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x15c(%rbp), %edx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x20(%rcx), %rax
jge 0x18258e
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x1b0(%rbp)
movq -0x180(%rbp), %rax
movq -0xd0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x15c(%rbp), %edx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x1825d4
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x180(%rbp)
movq -0x1b0(%rbp), %rdi
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rsi
movsd 0x1ffc29(%rip), %xmm0   # 0x382228
callq 0x179930
cmpl $0x0, %eax
jne 0x18260e
jmp 0x182943
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
movb %al, -0x238(%rbp)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movb %al, -0x237(%rbp)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x224(%rbp)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
addl $0x1, %eax
movl %eax, -0x220(%rbp)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x21c(%rbp)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
addl $0x1, %eax
movl %eax, -0x218(%rbp)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x20c(%rbp)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x208(%rbp)
movq -0x190(%rbp), %rax
movl %eax, -0x234(%rbp)
movq -0x198(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x230(%rbp)
movzbl -0x238(%rbp), %eax
cmpl $0x0, %eax
jne 0x182768
movq -0x1a0(%rbp), %rax
movl %eax, -0x22c(%rbp)
movq -0x1a8(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x228(%rbp)
jmp 0x1827ae
movq -0x120(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
subq -0x1a8(%rbp), %rax
subq $0x1, %rax
movl %eax, -0x22c(%rbp)
movq -0x120(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
subq -0x1a0(%rbp), %rax
subq $0x1, %rax
addq $0x1, %rax
movl %eax, -0x228(%rbp)
movl -0x168(%rbp), %eax
movl %eax, -0x214(%rbp)
movl -0x16c(%rbp), %eax
movl %eax, -0x210(%rbp)
movb $0x0, -0x236(%rbp)
movss -0x88(%rbp), %xmm0
movss %xmm0, -0x200(%rbp)
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x214(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0xa0(%rbp), %rcx
movq (%rcx), %rcx
movl -0x214(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jne 0x1828ea
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x214(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x18285d
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x214(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x2a8(%rbp)
jmp 0x18286b
movl $0x2, %eax
movq %rax, -0x2a8(%rbp)
jmp 0x18286b
movq -0x2a8(%rbp), %rcx
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x214(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x214(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x214(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
shlq $0x6, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x214(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x214(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0xa0(%rbp), %rax
movq (%rax), %rcx
movl -0x214(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
shlq $0x6, %rax
addq %rax, %rdi
leaq -0x238(%rbp), %rsi
movl $0x40, %edx
callq 0x2180
jmp 0x182943
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x1822f7
movq $0x0, -0x240(%rbp)
movq -0x188(%rbp), %rax
movl %eax, -0x15c(%rbp)
movl -0x15c(%rbp), %eax
movq -0xa0(%rbp), %rcx
movq (%rcx), %rcx
movl -0x168(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x182b36
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
cmpq -0x1b0(%rbp), %rax
je 0x1829cf
jmp 0x182b22
cmpq $0x0, -0x240(%rbp)
je 0x182a10
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %eax
movq -0x240(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jbe 0x182a44
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x240(%rbp)
jmp 0x182b20
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %eax
movq -0x240(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jne 0x182b1e
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0xa0(%rbp), %rcx
movq (%rcx), %rcx
movl -0x168(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
movl -0x15c(%rbp), %edx
shlq $0x6, %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
movq -0x240(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0x240(%rbp), %rdx
subl 0x4(%rdx), %ecx
cmpl %ecx, %eax
jae 0x182b1c
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x240(%rbp)
jmp 0x182b1e
jmp 0x182b20
jmp 0x182b22
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x18296f
cmpq $0x0, -0x240(%rbp)
je 0x182b9f
movq -0x240(%rbp), %rsi
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x168(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x188(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rdi
movl $0x40, %edx
callq 0x2180
movq -0x188(%rbp), %rcx
addq $0x1, %rcx
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl -0x168(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
jmp 0x182ba1
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0x181c32
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)