// File: chhylp123[P]hifiasm/hic.cpp
// Function: get_chain_weight_hic(bubble_type*, ma_ug_t*, buf_t*, unsigned int, unsigned int, kv_u_trans_t*, unsigned char*, unsigned char*, ma_ug_t*, kvec_t_u32_warp*, kvec_t_u32_warp*, unsigned int, unsigned int, kvec_t_u32_warp*, unsigned int*)
double get_chain_weight_hic(bubble_type* bub, ma_ug_t *bub_ug, buf_t* b, uint32_t v, uint32_t convex_source, 
kv_u_trans_t *ta, uint8_t* vis_flag, uint8_t* is_vis, ma_ug_t* ug, kvec_t_u32_warp* stack, 
kvec_t_u32_warp* result, uint32_t e_flag, uint32_t ava_flag, kvec_t_u32_warp* res_utg, uint32_t* link_occ)
{
    long long nodeLen, baseLen, max_stop_nodeLen, max_stop_baseLen;
    ma_utg_t *u = NULL;
    uint32_t convex, k, k_i, k_j, *a, n, beg, sink, uID, root, cur, ncur, n_vx = ug->g->n_seq<<1, occ;
    asg_arc_t *acur = NULL;
    double w = 0;
    b->b.n = 0;
    get_unitig(bub_ug->g, NULL, v, &convex, &nodeLen, &baseLen, &max_stop_nodeLen, 
                                                                    &max_stop_baseLen, 1, b);
    memset(is_vis, 0, n_vx);

    for (k = 0; k < b->b.n; k++)
    {
        u = &(bub_ug->u.a[b->b.a[k]>>1]);
        if(u->n == 0) continue;

        for (k_i = 0; k_i < u->n; k_i++)
        {
            get_bubbles(bub, u->a[k_i]>>33, &beg, &sink, &a, &n, NULL);
            for(k_j = 0; k_j < n; k_j++) is_vis[a[k_j]] = is_vis[a[k_j]^1] = 1;
            if(beg != (uint32_t)-1) is_vis[beg] = is_vis[beg^1] = 1; 
            if(sink != (uint32_t)-1) is_vis[sink] = is_vis[sink^1] = 1; 
        }
    }

    u = &(bub_ug->u.a[v>>1]);
    if((v&1)==0)
    {
        get_bubbles(bub, (u->a[0]>>32)>>1, (((u->a[0]>>32)&1)^1)==1?&root:NULL, 
                                    (((u->a[0]>>32)&1)^1) == 0?&root:NULL, NULL, NULL, NULL);
    } 
    else
    {
        get_bubbles(bub, (u->a[u->n-1]>>32)>>1, ((u->a[u->n-1]>>32)&1)==1?&root:NULL, 
                                    ((u->a[u->n-1]>>32)&1) == 0?&root:NULL, NULL, NULL, NULL);
    }
    
    root ^= 1;
    is_vis[root] = 0; 
    stack->a.n = 0;
    kv_push(uint32_t, stack->a, root);
    while (stack->a.n > 0)///label all untigs not in any chain
    {
        stack->a.n--;
        cur = stack->a.a[stack->a.n];
        if(is_vis[cur]) continue;
        is_vis[cur] = 1;
        if(vis_flag[cur>>1] == 0) vis_flag[cur>>1] = ava_flag;///unitig not in any chain
       
        ncur = asg_arc_n(ug->g, cur);
        acur = asg_arc_a(ug->g, cur);
        for (k = 0; k < ncur; k++)
        {
            if(acur[k].del) continue;
            if(is_vis[acur[k].v]) continue;
            if(vis_flag[acur[k].v>>1] != 0 && vis_flag[acur[k].v>>1] != ava_flag) continue;
            kv_push(uint32_t, stack->a, acur[k].v);
        }
    }


    ///vis_flag keeps isloated nodes
    uint32_t aim_0, aim_1, root_source;
    aim_0 = root>>1;
    u = &(bub_ug->u.a[convex_source>>1]);
    if((convex_source&1)==1)
    {
        get_bubbles(bub, (u->a[0]>>32)>>1, (((u->a[0]>>32)&1)^1)==1?&root_source:NULL, 
                                    (((u->a[0]>>32)&1)^1) == 0?&root_source:NULL, NULL, NULL, NULL);
    } 
    else
    {
        get_bubbles(bub, (u->a[u->n-1]>>32)>>1, ((u->a[u->n-1]>>32)&1)==1?&root_source:NULL, 
                                    ((u->a[u->n-1]>>32)&1) == 0?&root_source:NULL, NULL, NULL, NULL);
    }
    root_source ^= 1;
    aim_1 = root_source>>1;


    cur = root_source;///scan nodes that cannot be reached from root but can be reached from root_source
    ncur = asg_arc_n(ug->g, cur);
    acur = asg_arc_a(ug->g, cur);
    for (k_i = 0; k_i < ncur; k_i++)
    {
        if(acur[k_i].del) continue;
        if(vis_flag[acur[k_i].v>>1] != 0) continue;///skip nodes that are already reachable
        ///don't label any path that can reack other chains
        if_conflict_utg(acur[k_i].v, &aim_0, &aim_1, ug, vis_flag, is_vis, ava_flag, stack);
    }


    for (k = 0; k < ug->g->n_seq; k++)
    {
        if(vis_flag[k] == ava_flag)
        {
            cur = k<<1;
            ncur = asg_arc_n(ug->g, cur);
            acur = asg_arc_a(ug->g, cur);
            for (k_i = 0; k_i < ncur; k_i++)
            {
                if(acur[k_i].del) continue;
                if(vis_flag[acur[k_i].v>>1] != 0) continue;
                if_conflict_utg(acur[k_i].v, &aim_0, &aim_1, ug, vis_flag, is_vis, ava_flag, stack);
            }



            cur = (k<<1)+1;
            ncur = asg_arc_n(ug->g, cur);
            acur = asg_arc_a(ug->g, cur);
            for (k_i = 0; k_i < ncur; k_i++)
            {
                if(acur[k_i].del) continue;
                if(vis_flag[acur[k_i].v>>1] != 0) continue;
                if_conflict_utg(acur[k_i].v, &aim_0, &aim_1, ug, vis_flag, is_vis, ava_flag, stack);
            }
        }
    }
    


    memset(is_vis, 0, n_vx);
    if(link_occ) (*link_occ) = 0;
    for (k = result->a.n = 0, w = 0; k < b->b.n; k++)
    {
        u = &(bub_ug->u.a[b->b.a[k]>>1]);
        if(u->n == 0) continue;
        for (k_i = 0; k_i < u->n; k_i++)
        {
            get_bubbles(bub, u->a[k_i]>>33, NULL, NULL, &a, &n, NULL);

            for (k_j = 0; k_j < n; k_j++)
            {
                uID = a[k_j]>>1;
                w += dfs_weight_hic(uID, vis_flag, is_vis, ta, stack, result, e_flag, ava_flag, &occ);
                if(link_occ) (*link_occ) += occ;
            }
        }
    }


    for (k = 0; k < ug->g->n_seq; k++)
    {
        if(vis_flag[k] == ava_flag)
        {
            vis_flag[k] = 0;
            if(res_utg && (!IF_HOM(k, *bub)))
            {
                kv_push(uint32_t, res_utg->a, k<<1);
            }
        }
    }

    return w;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movl 0x40(%rbp), %eax
movl 0x38(%rbp), %eax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq $0x0, -0x50(%rbp)
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x88(%rbp)
movq $0x0, -0x98(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x1c(%rbp), %edx
movq -0x18(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %esi
leaq -0x54(%rbp), %rcx
leaq -0x30(%rbp), %r8
leaq -0x38(%rbp), %r9
leaq -0x40(%rbp), %r11
leaq -0x48(%rbp), %r10
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x166c30
movq 0x18(%rbp), %rdi
movl -0x88(%rbp), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x2100
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x1f8369
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x48(%rcx), %rcx
movl -0x58(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x1f8277
jmp 0x1f835b
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1f8359
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
shrq $0x21, %rsi
leaq -0x70(%rbp), %rdx
leaq -0x74(%rbp), %rcx
leaq -0x68(%rbp), %r8
leaq -0x6c(%rbp), %r9
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x1c4b20
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jae 0x1f8307
movq 0x18(%rbp), %rax
movq -0x68(%rbp), %rcx
movl -0x60(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
movq 0x18(%rbp), %rax
movq -0x68(%rbp), %rcx
movl -0x60(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
movb $0x1, (%rax,%rcx)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1f82cb
cmpl $-0x1, -0x70(%rbp)
je 0x1f8328
movq 0x18(%rbp), %rax
movl -0x70(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
movq 0x18(%rbp), %rax
movl -0x70(%rbp), %ecx
movb $0x1, (%rax,%rcx)
cmpl $-0x1, -0x74(%rbp)
je 0x1f8349
movq 0x18(%rbp), %rax
movl -0x74(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
movq 0x18(%rbp), %rax
movl -0x74(%rbp), %ecx
movb $0x1, (%rax,%rcx)
jmp 0x1f834b
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x1f827e
jmp 0x1f835b
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1f8232
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x1c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1f8464
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0xb8(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x1, %rax
jne 0x1f83e0
leaq -0x7c(%rbp), %rax
movq %rax, -0xc8(%rbp)
jmp 0x1f83eb
xorl %eax, %eax
movq %rax, -0xc8(%rbp)
jmp 0x1f83eb
movq -0xc8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x0, %rax
jne 0x1f8423
leaq -0x7c(%rbp), %rax
movq %rax, -0xd8(%rbp)
jmp 0x1f842e
xorl %eax, %eax
movq %rax, -0xd8(%rbp)
jmp 0x1f842e
movq -0xd0(%rbp), %rdx
movq -0xb8(%rbp), %rsi
movq -0xc0(%rbp), %rdi
movq -0xd8(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
jmp 0x1f8550
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0xe0(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x1, %rax
jne 0x1f84c8
leaq -0x7c(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x1f84d3
xorl %eax, %eax
movq %rax, -0xf0(%rbp)
jmp 0x1f84d3
movq -0xf0(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x1f8514
leaq -0x7c(%rbp), %rax
movq %rax, -0x100(%rbp)
jmp 0x1f851f
xorl %eax, %eax
movq %rax, -0x100(%rbp)
jmp 0x1f851f
movq -0xf8(%rbp), %rdx
movq -0xe0(%rbp), %rsi
movq -0xe8(%rbp), %rdi
movq -0x100(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
movl -0x7c(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x7c(%rbp)
movq 0x18(%rbp), %rax
movl -0x7c(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movq 0x28(%rbp), %rax
movq $0x0, (%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1f85e0
movq 0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1f859f
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x108(%rbp)
jmp 0x1f85ad
movl $0x2, %eax
movq %rax, -0x108(%rbp)
jmp 0x1f85ad
movq -0x108(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x7c(%rbp), %edx
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x1f8601
movq 0x28(%rbp), %rax
cmpq $0x0, (%rax)
jbe 0x1f881e
movq 0x28(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rbp), %rcx
movq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x80(%rbp)
movq 0x18(%rbp), %rax
movl -0x80(%rbp), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x1f8641
jmp 0x1f8601
movq 0x18(%rbp), %rax
movl -0x80(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movq 0x10(%rbp), %rax
movl -0x80(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1f8673
movl 0x40(%rbp), %eax
movb %al, %dl
movq 0x10(%rbp), %rax
movl -0x80(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x80(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x84(%rbp)
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq 0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x80(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x84(%rbp), %eax
jae 0x1f8819
movq -0x98(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1f86f4
jmp 0x1f880b
movq 0x18(%rbp), %rax
movq -0x98(%rbp), %rcx
movl -0x58(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x1f8717
jmp 0x1f880b
movq 0x10(%rbp), %rax
movq -0x98(%rbp), %rcx
movl -0x58(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1f8766
movq 0x10(%rbp), %rax
movq -0x98(%rbp), %rcx
movl -0x58(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl 0x40(%rbp), %eax
je 0x1f8766
jmp 0x1f880b
jmp 0x1f8768
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1f87d9
movq 0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1f8798
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x110(%rbp)
jmp 0x1f87a6
movl $0x2, %eax
movq %rax, -0x110(%rbp)
jmp 0x1f87a6
movq -0x110(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x98(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x1f880b
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1f86c4
jmp 0x1f8601
movl -0x7c(%rbp), %eax
shrl %eax
movl %eax, -0xa4(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x20(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x20(%rbp), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x1f892a
movq -0x8(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0x118(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x1, %rax
jne 0x1f88a3
leaq -0xac(%rbp), %rax
movq %rax, -0x128(%rbp)
jmp 0x1f88ae
xorl %eax, %eax
movq %rax, -0x128(%rbp)
jmp 0x1f88ae
movq -0x128(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x0, %rax
jne 0x1f88e9
leaq -0xac(%rbp), %rax
movq %rax, -0x138(%rbp)
jmp 0x1f88f4
xorl %eax, %eax
movq %rax, -0x138(%rbp)
jmp 0x1f88f4
movq -0x130(%rbp), %rdx
movq -0x118(%rbp), %rsi
movq -0x120(%rbp), %rdi
movq -0x138(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
jmp 0x1f8a1c
movq -0x8(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0x140(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x1, %rax
jne 0x1f8991
leaq -0xac(%rbp), %rax
movq %rax, -0x150(%rbp)
jmp 0x1f899c
xorl %eax, %eax
movq %rax, -0x150(%rbp)
jmp 0x1f899c
movq -0x150(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x1f89e0
leaq -0xac(%rbp), %rax
movq %rax, -0x160(%rbp)
jmp 0x1f89eb
xorl %eax, %eax
movq %rax, -0x160(%rbp)
jmp 0x1f89eb
movq -0x158(%rbp), %rdx
movq -0x140(%rbp), %rsi
movq -0x148(%rbp), %rdi
movq -0x160(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
movl -0xac(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
shrl %eax
movl %eax, -0xa8(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x80(%rbp)
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x80(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x84(%rbp)
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq 0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x80(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jae 0x1f8b39
movq -0x98(%rbp), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1f8ac0
jmp 0x1f8b2b
movq 0x10(%rbp), %rax
movq -0x98(%rbp), %rcx
movl -0x5c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1f8ae7
jmp 0x1f8b2b
movq -0x98(%rbp), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edi
movq 0x20(%rbp), %rcx
movq 0x10(%rbp), %r8
movq 0x18(%rbp), %r9
movl 0x40(%rbp), %r10d
movq 0x28(%rbp), %rax
leaq -0xa4(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1e5980
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x1f8a93
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq 0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x1f8d83
movq 0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl 0x40(%rbp), %eax
jne 0x1f8d73
movl -0x58(%rbp), %eax
shll %eax
movl %eax, -0x80(%rbp)
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x80(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x84(%rbp)
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq 0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x80(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jae 0x1f8c6f
movq -0x98(%rbp), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1f8bf6
jmp 0x1f8c61
movq 0x10(%rbp), %rax
movq -0x98(%rbp), %rcx
movl -0x5c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1f8c1d
jmp 0x1f8c61
movq -0x98(%rbp), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edi
movq 0x20(%rbp), %rcx
movq 0x10(%rbp), %r8
movq 0x18(%rbp), %r9
movl 0x40(%rbp), %r10d
movq 0x28(%rbp), %rax
leaq -0xa4(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1e5980
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x1f8bc9
movl -0x58(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x80(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x84(%rbp)
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq 0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x80(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jae 0x1f8d71
movq -0x98(%rbp), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1f8cf8
jmp 0x1f8d63
movq 0x10(%rbp), %rax
movq -0x98(%rbp), %rcx
movl -0x5c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1f8d1f
jmp 0x1f8d63
movq -0x98(%rbp), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edi
movq 0x20(%rbp), %rcx
movq 0x10(%rbp), %r8
movq 0x18(%rbp), %r9
movl 0x40(%rbp), %r10d
movq 0x28(%rbp), %rax
leaq -0xa4(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1e5980
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x1f8ccb
jmp 0x1f8d73
jmp 0x1f8d75
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1f8b40
movq 0x18(%rbp), %rdi
movl -0x88(%rbp), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x2100
cmpq $0x0, 0x50(%rbp)
je 0x1f8da7
movq 0x50(%rbp), %rax
movl $0x0, (%rax)
movq 0x30(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
movl -0x58(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x1f8eff
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x48(%rcx), %rcx
movl -0x58(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x1f8e09
jmp 0x1f8ef1
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1f8eef
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
shrq $0x21, %rsi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x68(%rbp), %r8
leaq -0x6c(%rbp), %r9
movq %rcx, %rdx
movq $0x0, (%rsp)
callq 0x1c4b20
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jae 0x1f8edf
movq -0x68(%rbp), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %edi
movq 0x10(%rbp), %rsi
movq 0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq 0x28(%rbp), %r8
movq 0x30(%rbp), %r9
movl 0x38(%rbp), %r11d
movl 0x40(%rbp), %r10d
leaq -0x8c(%rbp), %rax
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1f7e00
addsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
cmpq $0x0, 0x50(%rbp)
je 0x1f8ecf
movl -0x8c(%rbp), %ecx
movq 0x50(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x1f8ed1
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1f8e5a
jmp 0x1f8ee1
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x1f8e10
jmp 0x1f8ef1
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1f8dc4
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq 0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x1f9019
movq 0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl 0x40(%rbp), %eax
jne 0x1f9009
movq 0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
movb $0x0, (%rax,%rcx)
cmpq $0x0, 0x48(%rbp)
je 0x1f9007
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
ja 0x1f9007
jmp 0x1f8f73
movq 0x48(%rbp), %rax
movq (%rax), %rax
movq 0x48(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1f8fe4
movq 0x48(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1f8fa3
movq 0x48(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x168(%rbp)
jmp 0x1f8fb1
movl $0x2, %eax
movq %rax, -0x168(%rbp)
jmp 0x1f8fb1
movq -0x168(%rbp), %rcx
movq 0x48(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x48(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x58(%rbp), %edx
shll %edx
movq 0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x48(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x1f9007
jmp 0x1f9009
jmp 0x1f900b
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1f8f06
movsd -0xa0(%rbp), %xmm0
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopw (%rax,%rax)