// File: chhylp123[P]hifiasm/hic.cpp
// Function: trace_phase_path(ma_ug_t*, unsigned int, unsigned int, bub_p_t_warp*, min_cut_t*, unsigned char*, unsigned char)
uint64_t trace_phase_path(ma_ug_t *ug, uint32_t s, uint32_t d, bub_p_t_warp *b, min_cut_t* x, uint8_t* flag, uint8_t 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_rate, max_rate;
    ///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 = 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;

        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_hc_weight(w, v, s, b, x);
                t->ac = ac + (flag[(w>>1)] == 0? ug->u.a[(w>>1)].n : 0);
                t->uc = uc + (flag[(w>>1)] != 0? 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_hc_weight(w, v, s, b, x);
                cur_ac = ac + (flag[(w>>1)] == 0? ug->u.a[(w>>1)].n : 0);
                cur_uc = uc + (flag[(w>>1)] != 0? 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)
                    {
                        to_replace = 1;
                    }
                    else if(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;
                }


                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(b, s, flag, 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 = 0;
    }

    return n_pop;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movb 0x10(%rbp), %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x14(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1d9d47
movq $0x0, -0x8(%rbp)
jmp 0x1da921
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x2, %eax
jge 0x1d9d69
movq $0x0, -0x8(%rbp)
jmp 0x1da921
movq -0x20(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x2c(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x4(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x1d9e84
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x1d9e43
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0xd0(%rbp)
jmp 0x1d9e51
movl $0x2, %eax
movq %rax, -0xd0(%rbp)
jmp 0x1d9e51
movq -0xd0(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x8(%rsi)
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x0, -0x60(%rbp)
movl $0xffffffff, -0x5c(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x44(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $-0x1, %rsi
movq %rsi, 0x8(%rdx)
movl -0x4(%rax,%rcx,4), %eax
movl %eax, -0x7c(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x7c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x80(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x7c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x84(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x7c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
movl %eax, -0x88(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x7c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0x7c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x7c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x9c(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x7c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jae 0x1da721
movq -0xa8(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0xac(%rbp)
movq -0xa8(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0xb0(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl -0xac(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movl -0xac(%rbp), %eax
shrl %eax
movl -0x14(%rbp), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x1da026
jmp 0x1da851
cmpl $0x0, -0x44(%rbp)
je 0x1da036
movl $0x0, -0xb0(%rbp)
movq -0xa8(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1da057
jmp 0x1da713
jmp 0x1da059
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jne 0x1da0cb
movq -0x20(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x1da08a
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
shlq %rax
movq %rax, -0xd8(%rbp)
jmp 0x1da098
movl $0x2, %eax
movq %rax, -0xd8(%rbp)
jmp 0x1da098
movq -0xd8(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x7c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl -0x3c(%rbp), %ecx
addq %rcx, %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x20(%rbp), %rsi
movq 0x50(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x50(%rsi)
movl %edx, (%rax,%rcx,4)
movq -0xb8(%rbp), %rax
movl 0x30(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x1da36d
jmp 0x1da11c
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x40(%rcx), %rax
jne 0x1da18e
movq -0x20(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x1da14d
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
shlq %rax
movq %rax, -0xe0(%rbp)
jmp 0x1da15b
movl $0x2, %eax
movq %rax, -0xe0(%rbp)
jmp 0x1da15b
movq -0xe0(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x48(%rax)
movl -0xac(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x20(%rbp), %rsi
movq 0x38(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x38(%rsi)
movl %edx, (%rax,%rcx,4)
movl -0x7c(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, (%rax)
movq -0xb8(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x30(%rax)
movl -0x80(%rbp), %ecx
addl -0xb0(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x84(%rbp), %ecx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xac(%rbp), %edx
shrl %edx
movl %edx, %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
addl 0x10(%rax), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rdi
movl -0xac(%rbp), %esi
xorl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
movl %eax, %edx
movq -0xb8(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, 0x30(%rax)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0xf0(%rbp)
movl -0xac(%rbp), %edi
movl -0x7c(%rbp), %esi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x1d9bb0
movaps %xmm0, %xmm1
movsd -0xf0(%rbp), %xmm0
addsd %xmm1, %xmm0
movq -0xb8(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movl -0x8c(%rbp), %eax
movl %eax, -0xe4(%rbp)
movq -0x30(%rbp), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1da2d4
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0xf4(%rbp)
jmp 0x1da2de
xorl %eax, %eax
movl %eax, -0xf4(%rbp)
jmp 0x1da2de
movl -0xe4(%rbp), %ecx
movl -0xf4(%rbp), %eax
addl %eax, %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x88(%rbp), %eax
movl %eax, -0xf8(%rbp)
movq -0x30(%rbp), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1da33d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0xfc(%rbp)
jmp 0x1da347
xorl %eax, %eax
movl %eax, -0xfc(%rbp)
jmp 0x1da347
movl -0xf8(%rbp), %ecx
movl -0xfc(%rbp), %eax
addl %eax, %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x1da5fd
movl $0x0, -0x48(%rbp)
movl -0x84(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0xac(%rbp), %edx
shrl %edx
movl %edx, %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
addl 0x10(%rcx), %eax
movl %eax, -0x4c(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x108(%rbp)
movl -0xac(%rbp), %edi
movl -0x7c(%rbp), %esi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x1d9bb0
movaps %xmm0, %xmm1
movsd -0x108(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movl -0x8c(%rbp), %eax
movl %eax, -0x100(%rbp)
movq -0x30(%rbp), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1da41d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x10c(%rbp)
jmp 0x1da427
xorl %eax, %eax
movl %eax, -0x10c(%rbp)
jmp 0x1da427
movl -0x100(%rbp), %eax
movl -0x10c(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x54(%rbp)
movl -0x88(%rbp), %eax
movl %eax, -0x110(%rbp)
movq -0x30(%rbp), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1da47f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x114(%rbp)
jmp 0x1da489
xorl %eax, %eax
movl %eax, -0x114(%rbp)
jmp 0x1da489
movl -0x110(%rbp), %eax
movl -0x114(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x50(%rbp)
movl -0x54(%rbp), %eax
movl %eax, %ecx
movl %ecx, %eax
cvtsi2sd %rcx, %xmm0
movl -0x50(%rbp), %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0xb8(%rbp), %rax
movl 0x28(%rax), %ecx
movl 0x2c(%rax), %eax
movl %eax, %edx
movl %edx, %eax
cvtsi2sd %rdx, %xmm0
addl %ecx, %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x70(%rbp), %xmm0
ucomisd -0x78(%rbp), %xmm0
jbe 0x1da4f7
movl $0x1, -0x48(%rbp)
jmp 0x1da589
movsd -0x70(%rbp), %xmm0
ucomisd -0x78(%rbp), %xmm0
jne 0x1da587
jp 0x1da587
movsd -0x68(%rbp), %xmm0
movq -0xb8(%rbp), %rax
ucomisd 0x10(%rax), %xmm0
jbe 0x1da525
movl $0x1, -0x48(%rbp)
jmp 0x1da585
movsd -0x68(%rbp), %xmm0
movq -0xb8(%rbp), %rax
ucomisd 0x10(%rax), %xmm0
jne 0x1da583
jp 0x1da583
movl -0x4c(%rbp), %eax
movq -0xb8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jbe 0x1da552
movl $0x1, -0x48(%rbp)
jmp 0x1da581
movl -0x4c(%rbp), %eax
movq -0xb8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x1da57f
movl -0x80(%rbp), %eax
addl -0xb0(%rbp), %eax
movq -0xb8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jbe 0x1da57d
movl $0x1, -0x48(%rbp)
jmp 0x1da57f
jmp 0x1da581
jmp 0x1da583
jmp 0x1da585
jmp 0x1da587
jmp 0x1da589
cmpl $0x0, -0x48(%rbp)
je 0x1da5d3
movl -0x7c(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, (%rax)
movl -0x4c(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x8(%rax)
movsd -0x68(%rbp), %xmm0
movq -0xb8(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movl -0x54(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x50(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x80(%rbp), %eax
addl -0xb0(%rbp), %eax
movq -0xb8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x1da5fb
movl -0x80(%rbp), %ecx
addl -0xb0(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x1da5fd
movq -0xb8(%rbp), %rcx
movl 0x30(%rcx), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addl $-0x1, %eax
movl 0x30(%rcx), %edx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl $0x80000000, %edx       # imm = 0x80000000
orl %eax, %edx
movl %edx, 0x30(%rcx)
cmpl $0x0, %eax
jne 0x1da711
movq -0x38(%rbp), %rdi
movl -0xac(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
movl %eax, -0xbc(%rbp)
cmpl $0x0, -0xbc(%rbp)
jbe 0x1da6eb
jmp 0x1da653
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x1da6c5
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x1da684
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x120(%rbp)
jmp 0x1da692
movl $0x2, %eax
movq %rax, -0x120(%rbp)
jmp 0x1da692
movq -0x120(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0xac(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x8(%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x1da708
cmpl $0x0, -0x58(%rbp)
je 0x1da6f6
jmp 0x1da851
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x1da713
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1d9fb2
movl $0x0, -0x44(%rbp)
cmpl $0x1, -0x58(%rbp)
jne 0x1da7ee
cmpl $-0x1, -0x5c(%rbp)
je 0x1da7ec
cmpl $0x0, -0x40(%rbp)
jne 0x1da7ec
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1da7ec
jmp 0x1da757
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x1da7c9
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x1da788
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x128(%rbp)
jmp 0x1da796
movl $0x2, %eax
movq %rax, -0x128(%rbp)
jmp 0x1da796
movq -0x128(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x5c(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x8(%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x1da836
jmp 0x1da851
movl -0x3c(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jb 0x1da804
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1da806
jmp 0x1da851
jmp 0x1da808
movq -0x20(%rbp), %rcx
movb $0x1, %al
cmpq $0x1, 0x8(%rcx)
movb %al, -0x129(%rbp)
ja 0x1da828
cmpl $0x0, -0x40(%rbp)
setne %al
movb %al, -0x129(%rbp)
movb -0x129(%rbp), %al
testb $0x1, %al
jne 0x1d9ec8
movl $0x1, -0x60(%rbp)
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x30(%rbp), %rdx
movzbl 0x10(%rbp), %ecx
callq 0x1d9c70
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x1da91a
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x48(%rcx), %rcx
movl -0x3c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0x30(%rax)
movq -0xc8(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl $0x0, %ecx
movl %ecx, 0x30(%rax)
movq -0xc8(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0xc8(%rbp), %rax
movl $0x0, 0x2c(%rax)
movq -0xc8(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0xc8(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0xc8(%rbp), %rax
movl $0x0, (%rax)
movq -0xc8(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1da858
movl -0x60(%rbp), %eax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nop