// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_phase_path(ma_ug_t*, unsigned int, unsigned int, bub_p_t_warp*, H_partition*, unsigned int)
uint64_t get_phase_path(ma_ug_t *ug, uint32_t s, uint32_t d, bub_p_t_warp *b, H_partition* hap, uint32_t max_hap_label)
{
    asg_t *g = ug->g;
    if(g->seq[s>>1].del) return 0; // already deleted
    if(get_real_length(g, s, NULL)<2) return 0;
    uint32_t i, n_pending, is_first, to_replace, cur_nc, cur_uc, cur_ac, n_tips, tip_end, n_pop;
    double cur_nh, cur_w0, cur_w1, cur_rate, max_rate, cur_weight, max_weight;
    ///S saves nodes with all incoming edges visited
    b->S.n = b->T.n = b->b.n = b->e.n = 0;
    ///for each node, b->a saves all related information
    b->a[s].d = b->a[s].nc = b->a[s].ac = b->a[s].uc = 0; b->a[s].nh = b->a[s].w[0] = b->a[s].w[1] = 0;
    ///b->S is the nodes with all incoming edges visited
    kv_push(uint32_t, b->S, s);
    n_pop = n_tips = n_pending = 0;
    tip_end = (uint32_t)-1;
    is_first = 1;

    do {
        ///v is a node that all incoming edges have been visited
        ///d is the distance from v0 to v
        uint32_t v = kv_pop(b->S);
        uint32_t d = b->a[v].d, nc = b->a[v].nc, uc = b->a[v].uc, ac = b->a[v].ac; 
        double nh = b->a[v].nh;
        double nw_0 = b->a[v].w[0], nw_1 = b->a[v].w[1];

        uint32_t nv = asg_arc_n(g, v);
        asg_arc_t *av = asg_arc_a(g, v);
        for (i = 0; i < nv; ++i) {
            uint32_t w = av[i].v, l = (uint32_t)av[i].ul; // v->w with length l, not overlap length
            bub_p_t *t = &b->a[w];
            //got a circle
            if ((w>>1) == (s>>1)) goto pop_reset;
            //important when poping at long untig graph
            if(is_first) l = 0;
            if (av[i].del) continue;
            ///push the edge
            kv_push(uint32_t, b->e, (g->idx[v]>>32) + i);

            if (t->s == 0) 
            { // this vertex has never been visited
                kv_push(uint32_t, b->b, w); // save it for revert
                ///t->p is the parent node of 
                ///t->s = 1 means w has been visited
                ///d is len(v0->v), l is len(v->w), so t->d is len(v0->w)
                t->p = v, t->s = 1, t->d = d + l, t->nc = nc + ug->u.a[(w>>1)].n;
                t->r = get_real_length(g, w^1, NULL);
                /**need fix**/
                t->nh = nh + get_path_weight(w, v, s, b, hap->link);

                get_related_weight(w>>1, hap, &(t->w[0]), &(t->w[1]), &max_hap_label);
                t->w[0] += nw_0; t->w[1] += nw_1; 

                t->ac = ac + ((!is_hap_set_label(w>>1, *hap, max_hap_label))?ug->u.a[(w>>1)].n : 0);
                t->uc = uc + ((is_hap_set_label(w>>1, *hap, max_hap_label))?ug->u.a[(w>>1)].n : 0);
                
                ++n_pending;
            }
            else {
                to_replace = 0;

                cur_nc = nc + ug->u.a[(w>>1)].n;
                /**need fix**/
                cur_nh = nh + get_path_weight(w, v, s, b, hap->link);
                get_related_weight(w>>1, hap, &cur_w0, &cur_w1, &max_hap_label);
                cur_w0 += nw_0; cur_w1 += nw_1;
                cur_weight = cur_nh + MAX(cur_w0, cur_w1) - MIN(cur_w0, cur_w1);
                max_weight = t->nh + MAX(t->w[0], t->w[1]) - MIN(t->w[0], t->w[1]);

                cur_ac = ac + ((!is_hap_set_label(w>>1, *hap, max_hap_label))?ug->u.a[(w>>1)].n : 0);;
                cur_uc = uc + ((is_hap_set_label(w>>1, *hap, max_hap_label))?ug->u.a[(w>>1)].n : 0);
                cur_rate = ((double)(cur_ac)/(double)(cur_ac+cur_uc));
                max_rate = ((double)(t->ac)/(double)(t->ac+t->uc));

                if(cur_rate > max_rate)
                {
                    to_replace = 1;
                }
                else if(cur_rate == max_rate)
                {
                    ///if(cur_nh > t->nh)
                    if(cur_weight > max_weight)
                    {
                        to_replace = 1;
                    }
                    else if(cur_weight == max_weight)///(cur_nh == t->nh)
                    {
                        if(cur_nc > t->nc)
                        {
                            to_replace = 1;
                        }
                        else if(cur_nc == t->nc)
                        {
                            if(d + l > t->d)
                            {
                                to_replace = 1;
                            }
                        }
                    }
                }


                if(to_replace)
                {
                    t->p = v;
                    t->nc = cur_nc;
                    t->nh = cur_nh;
                    t->ac = cur_ac;
                    t->uc = cur_uc;
                    t->w[0] = cur_w0;
                    t->w[1] = cur_w1;
                }


                if (d + l < t->d) t->d = d + l; // update dist
            }

            if (--(t->r) == 0) {
                uint32_t x = get_real_length(g, w, NULL);
                if(x > 0)
                {
                    kv_push(uint32_t, b->S, w);
                }
                else
                {
                    ///at most one tip
                    if(n_tips != 0) goto pop_reset;
                    n_tips++;
                    tip_end = w;
                }
                --n_pending;
            }
        }
        is_first = 0;


        if(n_tips == 1)
        {
            if(tip_end != (uint32_t)-1 && n_pending == 0 && b->S.n == 0)
            {
                ///sink is b.S.a[0]
                kv_push(uint32_t, b->S, tip_end);
                break;
            }
            else
            {
                goto pop_reset;
            }
        }

        if (i < nv || b->S.n == 0) goto pop_reset;
    }while (b->S.n > 1 || n_pending);


    n_pop = 1;
    /**need fix**/
    set_path_hap(b, s, hap, max_hap_label);
    pop_reset:

    for (i = 0; i < b->b.n; ++i) { // clear the states of visited vertices
        bub_p_t *t = &b->a[b->b.a[i]];
        t->p = t->d = t->nc = t->ac = t->uc = t->r = t->s = 0;
        t->nh = t->w[0] = t->w[1] = 0;
    }

    return n_pop;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r9d, (%rsp)
movq %rdi, 0x48(%rsp)
movq 0x18(%rdi), %r10
movq 0x20(%r10), %rax
movl %esi, %r15d
shrl %r15d
cmpl $0x0, (%rax,%r15,8)
js 0x14c457
movq %rcx, %rbx
movl %esi, %ebp
movq 0x28(%r10), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rdx
xorl %eax, %eax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rdx, %rsi
je 0x14c459
movq 0x8(%r10), %rdi
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rdi,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
movl (%rdx,%rdi), %r9d
notl %r9d
shrl $0x1f, %r9d
addl %r9d, %eax
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0x14c43b
cmpl $0x2, %eax
jge 0x14c46b
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edx, %edx
movq %rdx, 0x50(%rbx)
movq %rdx, 0x38(%rbx)
movq %rdx, 0x20(%rbx)
movq %rdx, 0x8(%rbx)
movq (%rbx), %rax
imulq $0x38, %rcx, %rcx
movq %rdx, 0x4(%rax,%rcx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%rax,%rcx)
movupd %xmm0, 0x20(%rax,%rcx)
movq $0x0, 0x20(%rsp)
cmpq %rdx, 0x10(%rbx)
movq %r8, 0x10(%rsp)
movq %r10, 0x8(%rsp)
jne 0x14c4d6
movq $0x2, 0x10(%rbx)
movq 0x18(%rbx), %rdi
movl $0x8, %esi
callq 0x2370
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %r8
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rbx)
movl %ebp, 0x30(%rsp)
movl %ebp, (%rcx,%rax,4)
movl $0x1, 0x1c(%rsp)
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x4(%rsp)
movq %rbx, 0x68(%rsp)
movq %r15, 0x78(%rsp)
movq 0x18(%rbx), %rax
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
leaq -0x1(%rdx), %rsi
movq %rsi, 0x8(%rbx)
movl -0x4(%rax,%rdx,4), %esi
movq 0x28(%r10), %rax
movq (%rax,%rsi,8), %rax
testl %eax, %eax
je 0x14cbbd
imulq $0x38, %rsi, %rdx
movl 0x4(%rcx,%rdx), %edi
movq %rdi, 0x58(%rsp)
movl 0x8(%rcx,%rdx), %edi
movl %edi, 0x3c(%rsp)
movl 0x28(%rcx,%rdx), %edi
movl %edi, 0x38(%rsp)
movl 0x2c(%rcx,%rdx), %edi
movl %edi, 0x34(%rsp)
movsd 0x10(%rcx,%rdx), %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0x18(%rcx,%rdx), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x20(%rcx,%rdx), %xmm0
movsd %xmm0, 0x80(%rsp)
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%r10), %rcx
movl %eax, %edi
xorl %r13d, %r13d
movq %rsi, 0x28(%rsp)
movq %rcx, 0x50(%rsp)
movq %rdi, 0x40(%rsp)
leaq (,%r13,2), %rax
addq %r13, %rax
movl 0x8(%rcx,%rax,8), %ebp
movl %ebp, %r12d
shrl %r12d
cmpl %r15d, %r12d
jne 0x14c5d4
movl $0x9, %r14d
jmp 0x14cb88
leaq (%rcx,%rax,8), %rax
xorl %r14d, %r14d
cmpl $0x0, 0x1c(%rsp)
jne 0x14c5e5
movl (%rax), %r14d
cmpl $0x0, 0xc(%rax)
js 0x14c738
imulq $0x38, %rbp, %r15
addq (%rbx), %r15
movq 0x58(%rbx), %rax
cmpq %rax, 0x50(%rbx)
jne 0x14c634
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x58(%rbx)
movq 0x60(%rbx), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x28(%rsp), %rsi
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %r8
movq %rax, 0x60(%rbx)
movq 0x28(%r10), %rax
movl 0x4(%rax,%rsi,8), %eax
addl %r13d, %eax
movq 0x50(%rbx), %rcx
movq 0x60(%rbx), %rdx
leaq 0x1(%rcx), %rdi
movq %rdi, 0x50(%rbx)
movl %eax, (%rdx,%rcx,4)
cmpl $0x0, 0x30(%r15)
js 0x14c743
movq 0x40(%rbx), %rax
cmpq %rax, 0x38(%rbx)
jne 0x14c69b
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x40(%rbx)
movq 0x48(%rbx), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x28(%rsp), %rsi
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %r8
movq %rax, 0x48(%rbx)
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x38(%rbx)
movl %ebp, (%rcx,%rax,4)
movl %esi, (%r15)
orb $-0x80, 0x33(%r15)
addl 0x58(%rsp), %r14d
movl %r14d, 0x4(%r15)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%r12,%r12,4), %r14
movl 0x10(%rax,%r14,8), %eax
addl 0x3c(%rsp), %eax
movl %eax, 0x8(%r15)
movq %rbp, %rax
xorq $0x1, %rax
movq 0x28(%r10), %rcx
movq (%rcx,%rax,8), %rcx
movq %rcx, %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rax
je 0x14c851
movq 0x8(%r10), %rdx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rcx
addq $0xc, %rcx
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
xorl %r9d, %r9d
xorl %eax, %eax
movl (%rcx,%r9), %edi
notl %edi
shrl $0x1f, %edi
addl %edi, %eax
addq $0x18, %r9
cmpq %r9, %rdx
jne 0x14c71a
orl $0x80000000, %eax       # imm = 0x80000000
jmp 0x14c856
movl $0x8, %r14d
jmp 0x14cb88
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rbx, %rcx
movl %r12d, %ebx
leaq (%rbx,%rbx,4), %rdx
movl 0x10(%rax,%rdx,8), %eax
movl %eax, 0x64(%rsp)
movq 0x30(%r8), %r8
movl %ebp, %edi
movl 0x30(%rsp), %edx
callq 0x14c183
movsd %xmm0, 0x70(%rsp)
movl %r12d, %edi
movq 0x10(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x98(%rsp), %rcx
movq %rsp, %r8
callq 0x14c1ed
movl 0x64(%rsp), %r11d
movq 0x10(%rsp), %r8
movsd 0xa0(%rsp), %xmm0
addsd 0x88(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0x98(%rsp), %xmm1
addsd 0x80(%rsp), %xmm1
movsd %xmm1, 0x98(%rsp)
movq 0x10(%r8), %rax
movl 0x1c(%r8), %esi
orl 0x18(%r8), %esi
movl (%rax,%rbx,4), %edx
orl 0x20(%r8), %esi
testl %edx, %esi
je 0x14c800
movb 0x2c(%r8), %cl
movl %edx, %edi
shrl %cl, %edi
movl (%rsp), %r9d
shrl %cl, %r9d
xorl %eax, %eax
cmpl %r9d, %edi
je 0x14c803
movl %r11d, %eax
movsd 0x18(%r15), %xmm3
movsd 0x20(%r15), %xmm4
movapd %xmm4, %xmm2
cmplesd %xmm3, %xmm2
movapd %xmm2, %xmm5
andpd %xmm3, %xmm5
andnpd %xmm4, %xmm2
orpd %xmm5, %xmm2
addsd 0x10(%r15), %xmm2
testl %edx, %esi
je 0x14c960
movb 0x2c(%r8), %cl
shrl %cl, %edx
movl (%rsp), %esi
shrl %cl, %esi
cmpl %esi, %edx
movl $0x0, %ecx
cmovel %r11d, %ecx
jmp 0x14c962
movl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0x30(%r15)
movq 0x30(%r8), %r8
movl %ebp, %edi
movl 0x30(%rsp), %edx
movq %rbx, %rcx
callq 0x14c183
addsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x10(%r15)
leaq 0x18(%r15), %rdx
leaq 0x20(%r15), %rcx
movl %r12d, %edi
movq 0x10(%rsp), %rsi
movq %rsp, %r8
callq 0x14c1ed
movq 0x10(%rsp), %r8
movsd 0x18(%r15), %xmm0
addsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x18(%r15)
movsd 0x20(%r15), %xmm0
addsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x20(%r15)
movq 0x10(%r8), %rax
movl 0x1c(%r8), %ecx
orl 0x18(%r8), %ecx
movl (%rax,%r12,4), %edx
orl 0x20(%r8), %ecx
testl %edx, %ecx
je 0x14c8eb
movb 0x2c(%r8), %cl
shrl %cl, %edx
movl (%rsp), %esi
shrl %cl, %esi
xorl %ecx, %ecx
cmpl %esi, %edx
je 0x14c8f9
movq 0x48(%rsp), %rcx
movq 0x10(%rcx), %rcx
movl 0x10(%rcx,%r14,8), %ecx
addl 0x34(%rsp), %ecx
movl %ecx, 0x2c(%r15)
movl (%rax,%r12,4), %edx
movl 0x1c(%r8), %ecx
orl 0x18(%r8), %ecx
orl 0x20(%r8), %ecx
xorl %eax, %eax
testl %edx, %ecx
movq 0x40(%rsp), %rdi
je 0x14c945
movb 0x2c(%r8), %cl
shrl %cl, %edx
movl (%rsp), %esi
shrl %cl, %esi
cmpl %esi, %edx
movq 0x8(%rsp), %r10
movq 0x28(%rsp), %rsi
jne 0x14c94f
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x10(%rax,%r14,8), %eax
jmp 0x14c94f
movq 0x8(%rsp), %r10
movq 0x28(%rsp), %rsi
addl 0x38(%rsp), %eax
movl %eax, 0x28(%r15)
incl 0x4(%rsp)
jmp 0x14ca6f
xorl %ecx, %ecx
movq 0x68(%rsp), %rbx
movq 0x8(%rsp), %r10
movq 0x28(%rsp), %rsi
movsd 0x70(%rsp), %xmm8
addl 0x3c(%rsp), %r11d
addl 0x34(%rsp), %eax
movl %eax, %edx
xorps %xmm5, %xmm5
cvtsi2sd %rdx, %xmm5
addl 0x38(%rsp), %ecx
leal (%rcx,%rax), %edx
cvtsi2sd %rdx, %xmm6
divsd %xmm6, %xmm5
movl 0x2c(%r15), %edx
xorps %xmm6, %xmm6
cvtsi2sd %rdx, %xmm6
movl 0x28(%r15), %edi
addl %edx, %edi
cvtsi2sd %rdi, %xmm7
addsd 0x90(%rsp), %xmm8
divsd %xmm7, %xmm6
ucomisd %xmm6, %xmm5
ja 0x14ca3a
jne 0x14ca5b
jp 0x14ca5b
movapd %xmm1, %xmm5
cmplesd %xmm0, %xmm5
movapd %xmm5, %xmm6
andpd %xmm0, %xmm6
andnpd %xmm1, %xmm5
orpd %xmm6, %xmm5
addsd %xmm8, %xmm5
movapd %xmm0, %xmm6
cmplesd %xmm1, %xmm6
movapd %xmm6, %xmm7
andpd %xmm0, %xmm7
andnpd %xmm1, %xmm6
orpd %xmm7, %xmm6
subsd %xmm6, %xmm5
movapd %xmm3, %xmm6
cmplesd %xmm4, %xmm6
andpd %xmm6, %xmm3
andnpd %xmm4, %xmm6
orpd %xmm3, %xmm6
subsd %xmm6, %xmm2
ucomisd %xmm2, %xmm5
ja 0x14ca3a
jne 0x14ca5b
jp 0x14ca5b
cmpl 0x8(%r15), %r11d
jbe 0x14cba0
movl %esi, (%r15)
movl %r11d, 0x8(%r15)
movsd %xmm8, 0x10(%r15)
movl %eax, 0x2c(%r15)
movl %ecx, 0x28(%r15)
movsd %xmm0, 0x18(%r15)
movsd %xmm1, 0x20(%r15)
addl 0x58(%rsp), %r14d
cmpl 0x4(%r15), %r14d
movq 0x40(%rsp), %rdi
jae 0x14ca6f
movl %r14d, 0x4(%r15)
movl 0x30(%r15), %eax
leal -0x1(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, 0x30(%r15)
xorl %r14d, %r14d
testl %ecx, %ecx
je 0x14ca98
movq 0x78(%rsp), %r15
jmp 0x14cb83
movq 0x28(%r10), %rax
movq (%rax,%rbp,8), %rax
movq %rax, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rcx
movq 0x78(%rsp), %r15
je 0x14cb58
movq 0x8(%r10), %rdx
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
leaq (%rdx,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
xorl %r9d, %r9d
movl (%rax,%rdx), %edi
notl %edi
shrl $0x1f, %edi
addl %edi, %r9d
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x14cad7
testl %r9d, %r9d
movq 0x40(%rsp), %rdi
je 0x14cb58
movq 0x10(%rbx), %rax
cmpq %rax, 0x8(%rbx)
jne 0x14cb38
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x10(%rbx)
movq 0x18(%rbx), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x40(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %r8
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rbx)
movl %ebp, (%rcx,%rax,4)
movl 0x18(%rsp), %eax
movl %eax, %ebp
movq 0x20(%rsp), %rax
jmp 0x14cb76
movl $0x1, %eax
cmpl $0x0, 0x20(%rsp)
je 0x14cb76
movl $0x1, %eax
movq %rax, 0x20(%rsp)
movl $0x9, %r14d
jmp 0x14cb83
decl 0x4(%rsp)
movl %ebp, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rcx
testb $0x7, %r14b
jne 0x14cc76
incq %r13
cmpq %rdi, %r13
jne 0x14c5af
jmp 0x14cbbd
jne 0x14ca5b
movq 0x58(%rsp), %rdx
addl %r14d, %edx
cmpl 0x4(%r15), %edx
ja 0x14ca3a
jmp 0x14ca5b
cmpl $0x1, 0x20(%rsp)
jne 0x14cc57
movl $0x0, 0x1c(%rsp)
movl $0x9, %r14d
movl $0x1, %eax
movq %rax, 0x20(%rsp)
cmpl $-0x1, 0x18(%rsp)
je 0x14cc76
cmpl $0x0, 0x4(%rsp)
jne 0x14cc76
cmpq $0x0, 0x8(%rbx)
jne 0x14cc76
cmpq $0x0, 0x10(%rbx)
jne 0x14cc28
movq $0x2, 0x10(%rbx)
movq 0x18(%rbx), %rdi
movl $0x8, %esi
callq 0x2370
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %r8
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rbx)
movl 0x18(%rsp), %edx
movl %edx, (%rcx,%rax,4)
movl $0x4, %r14d
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x4(%rsp)
jmp 0x14cc76
xorl %eax, %eax
cmpq $0x0, 0x8(%rbx)
sete %al
leal (%rax,%rax,8), %r14d
movq $0x0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
testl %r14d, %r14d
jne 0x14cc93
cmpq $0x1, 0x8(%rbx)
ja 0x14c50f
cmpl $0x0, 0x4(%rsp)
jne 0x14c50f
jmp 0x14cca3
cmpl $0x4, %r14d
je 0x14cca3
cmpl $0x9, %r14d
jne 0x14cd10
xorl %eax, %eax
jmp 0x14ccba
movl (%rsp), %ecx
movq %rbx, %rdi
movl 0x30(%rsp), %esi
movq %r8, %rdx
callq 0x14c2c8
movl $0x1, %eax
cmpq $0x0, 0x38(%rbx)
je 0x14c459
movl $0x1, %ecx
xorl %edx, %edx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movq (%rbx), %rdi
movq 0x48(%rbx), %r8
movl (%r8,%rsi,4), %esi
imulq $0x38, %rsi, %r8
movl %edx, 0x8(%rdi,%r8)
movq $0x0, (%rdi,%r8)
movl %ecx, %esi
movupd %xmm0, 0x10(%rdi,%r8)
movupd %xmm0, 0x20(%rdi,%r8)
movl %edx, 0x30(%rdi,%r8)
incl %ecx
cmpq %rsi, 0x38(%rbx)
ja 0x14ccd2
jmp 0x14c459
jmp 0x14c459