// File: chhylp123[P]hifiasm/hic.cpp
// Function: append_boundary_chain(ma_ug_t*, hc_links*, bubble_type*)
void append_boundary_chain(ma_ug_t* ug, hc_links* link, bubble_type* bub)
{
    double index_time = yak_realtime();
    ma_ug_t *bs_ug = bub->b_ug;
    uint32_t v, u, i, k, beg_idx, m, nv, n_vx, flag_pri = 1, flag_aux = 2, flag_ava = 4;
    uint32_t root, rId_0, ori_0, root_0, new_bub;
    asg_arc_t *av = NULL;
    n_vx = bs_ug->g->n_seq << 1;
    uint8_t *vis = NULL; CALLOC(vis, ug->g->n_seq<<1);
    uint8_t *is_vis = NULL; CALLOC(is_vis, ug->g->n_seq<<1);
    uint8_t *is_used = NULL; CALLOC(is_used, n_vx);
    uint8_t *dedup = NULL; CALLOC(dedup, ug->g->n_seq<<1);
    buf_t b; memset(&b, 0, sizeof(buf_t));
    kvec_t_u32_warp stack, result, res_utg;
    kv_init(stack.a); kv_init(result.a); kv_init(res_utg.a);
    kvec_asg_arc_t_warp edges; kv_init(edges.a);

    for (i = 0; i < bs_ug->g->n_seq; i++)
    {
        set_b_utg_weight_flag(bub, &b, i<<1, vis, flag_aux, NULL);
    }

    if(bub->num.n > 0) bub->num.n--;
    new_bub = bub->b_g->n_seq;
    for (v = 0; v < n_vx; v++)
    {
        av = asg_arc_a(bs_ug->g, v);
        nv = asg_arc_n(bs_ug->g, v);
        if(nv == 0 || get_real_length(bs_ug->g, v, NULL) == 0) continue;
        res_utg.a.n = 0;
        for (i = 0; i < nv; i++)
        {
            if(av[i].del) continue;
            u = av[i].v^1;
            /**
            beg_idx = res_utg.a.n;
            set_b_utg_weight_flag_xor(bub, bs_ug, &b, v^1, vis, flag_pri, NULL);
            get_chain_weight(bub, bs_ug, &b, u^1, v, link, vis, is_vis, ug, &stack, &result, flag_pri, flag_ava, &res_utg, NULL);
            set_b_utg_weight_flag_xor(bub, bs_ug, &b, v^1, vis, flag_pri, NULL);
            for (k = m = beg_idx; k < res_utg.a.n; k++)
            {
                if(dedup[res_utg.a.a[k]>>1] != 0) continue;
                dedup[res_utg.a.a[k]>>1] = 1;
                res_utg.a.a[m] = res_utg.a.a[k];
                m++;
            }
            res_utg.a.n = m;
            **/
            beg_idx = res_utg.a.n;
            set_b_utg_weight_flag_xor(bub, bs_ug, &b, u^1, vis, flag_pri, NULL);
            get_chain_weight(bub, bs_ug, &b, v^1, u, link, vis, is_vis, ug, &stack, &result, flag_pri, flag_ava, &res_utg, NULL);
            set_b_utg_weight_flag_xor(bub, bs_ug, &b, u^1, vis, flag_pri, NULL);
            for (k = m = beg_idx; k < res_utg.a.n; k++)
            {
                if(dedup[res_utg.a.a[k]>>1] != 0) continue;
                dedup[res_utg.a.a[k]>>1] = 1;
                res_utg.a.a[m] = res_utg.a.a[k];
                m++;
            }
            res_utg.a.n = m;
        }

        for (k = 0; k < res_utg.a.n; k++) dedup[res_utg.a.a[k]>>1] = 0;
        /*******************************for debug************************************/
        // for (i = 0; i < res_utg.a.n; i++)
        // {
        //     for (k = 0; k < res_utg.a.n; k++)
        //     {
        //         if(k == i) continue;
        //         if((res_utg.a.a[i]>>1) == (res_utg.a.a[k]>>1)) fprintf(stderr, "ERROR\n");
        //     }
        // }
        /*******************************for debug************************************/

        root = get_utg_end_from_btg(bub, bs_ug, v);
        rId_0 = root>>1;
        ori_0 = root&1;
        get_bubbles(bub, rId_0, ori_0 == 1?&root_0:NULL, ori_0 == 0?&root_0:NULL, NULL, NULL, NULL);

        if(root_0 != (uint32_t)-1 && (!IF_HOM(root_0>>1, *bub))) kv_push(uint32_t, res_utg.a, root_0);

        if(v&1)
        {
            update_bubble_graph(&res_utg, root_0^1, rId_0, (uint32_t)-1, (uint32_t)-1, bub, &edges, bub->b_g, NULL, NULL, ug, NULL, 0);
        }
        else
        {
            update_bubble_graph(&res_utg, (uint32_t)-1, (uint32_t)-1, root_0^1, rId_0, bub, &edges, bub->b_g, NULL, NULL, ug, NULL, 0);
        }
    }
    kv_push(uint32_t, bub->num, bub->list.n);
    new_bub = bub->b_g->n_seq - new_bub;
    bub->mess_bub += new_bub;
    ///actually not useful, and may have bug when one bubble at multipe chains
    if(new_bub) update_bub_b_s_idx(bub);


    for (v = 0; v < n_vx; v++)
    {
        av = asg_arc_a(bs_ug->g, v);
        nv = asg_arc_n(bs_ug->g, v);
        if(nv == 0 || get_real_length(bs_ug->g, v, NULL) == 0) continue;
        drop_g_edges_by_utg(bub, bub->b_g, bs_ug, NULL, v, (uint32_t)-1);
    }

    update_bsg(bub->b_g, &edges);

    ma_ug_destroy(bs_ug);
    bs_ug = ma_ug_gen(bub->b_g);
    bub->b_ug = bs_ug;
    kv_destroy(bub->chain_weight);
    ma_utg_t *u_x = NULL;
    bs_ug = bub->b_ug;
    kv_malloc(bub->chain_weight, bs_ug->u.n); bub->chain_weight.n = bs_ug->u.n;
    for (i = 0; i < bs_ug->u.n; i++)
    {
        u_x = &(bs_ug->u.a[i]);
        bub->chain_weight.a[i].id = i;
        // if(u->n <= 1) ///not a chain
        // {
        //     bub->chain_weight.a[i].b_occ = bub->chain_weight.a[i].g_occ = 0;
        //     bub->chain_weight.a[i].del = 1;
        // } 
        // else
        {
            bub->chain_weight.a[i].del = 0;
            calculate_chain_weight(u_x, bub, ug, &(bub->chain_weight.a[i]));
        }
    }
    qsort(bub->chain_weight.a, bub->chain_weight.n, sizeof(chain_w_type), cmp_chain_weight);



    free(vis); free(is_vis); free(is_used); free(dedup); free(b.b.a);
    kv_destroy(stack.a); kv_destroy(result.a); kv_destroy(res_utg.a);
    kv_destroy(edges.a);


    /*******************************for debug************************************/
    // for (v = 0; v < (uint32_t)(bs_ug->g->n_seq<<1); v++)
    // {
    //     if(asg_arc_n(bs_ug->g, v) > 0) fprintf(stderr, "ERROR, btg%.6ul\n", (v>>1)+1);
    //     ma_utg_t *utg = &(bs_ug->u.a[v>>1]);
    //     for (i = 0; i < utg->n; i++)
    //     {
    //         if((utg->a[i]>>33) >= 
    //                 (bub->f_bub + bub->b_bub + bub->b_end_bub + bub->tangle_bub + bub->cross_bub))
    //         {
    //             if(i != 0 && i != utg->n - 1) fprintf(stderr, "ERROR, btg%.6ul, i: %u\n", (v>>1)+1, i);
    //         }
    //     }
    // }
    /*******************************for debug************************************/
    fprintf(stderr, "[M::%s::%.3f]\n", __func__, yak_realtime()-index_time);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
callq 0x1b7ca0
movsd %xmm0, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq 0xc0(%rax), %rax
movq %rax, -0x50(%rbp)
movl $0x1, -0x74(%rbp)
movl $0x2, -0x78(%rbp)
movl $0x4, -0x7c(%rbp)
movq $0x0, -0x98(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x70(%rbp)
movq $0x0, -0xa0(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, -0xa8(%rbp)
movq $0x0, -0xb0(%rbp)
movl -0x70(%rbp), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, -0xb0(%rbp)
movq $0x0, -0xb8(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, -0xb8(%rbp)
leaq -0x120(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x2100
movq $0x0, -0x138(%rbp)
movq $0x0, -0x140(%rbp)
movq $0x0, -0x130(%rbp)
movq $0x0, -0x158(%rbp)
movq $0x0, -0x160(%rbp)
movq $0x0, -0x150(%rbp)
movq $0x0, -0x178(%rbp)
movq $0x0, -0x180(%rbp)
movq $0x0, -0x170(%rbp)
movq $0x0, -0x198(%rbp)
movq $0x0, -0x1a0(%rbp)
movq $0x0, -0x190(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x1e83d8
movq -0x40(%rbp), %rdi
movl -0x5c(%rbp), %edx
shll %edx
movq -0xa0(%rbp), %rcx
movl -0x78(%rbp), %r8d
leaq -0x120(%rbp), %rsi
xorl %eax, %eax
movl %eax, %r9d
callq 0x1e0580
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x1e8390
movq -0x40(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jbe 0x1e83f3
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x30(%rax)
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x90(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x70(%rbp), %eax
jae 0x1e8942
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x50(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x54(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x54(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
je 0x1e8485
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x54(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x0, %eax
jne 0x1e848a
jmp 0x1e8934
movq $0x0, -0x180(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jae 0x1e8676
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 0x1e84c9
jmp 0x1e8668
movq -0x98(%rbp), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x58(%rbp)
movq -0x180(%rbp), %rax
movl %eax, -0x64(%rbp)
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x58(%rbp), %ecx
xorl $0x1, %ecx
movq -0xa0(%rbp), %r8
movl -0x74(%rbp), %r9d
leaq -0x120(%rbp), %rdx
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x1e53f0
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x54(%rbp), %ecx
xorl $0x1, %ecx
movl -0x58(%rbp), %r8d
movq -0x38(%rbp), %r9
movq -0xa0(%rbp), %r13
movq -0xa8(%rbp), %r12
movq -0x30(%rbp), %r15
movl -0x74(%rbp), %r11d
movl -0x7c(%rbp), %r10d
leaq -0x120(%rbp), %rdx
leaq -0x140(%rbp), %r14
leaq -0x160(%rbp), %rbx
leaq -0x180(%rbp), %rax
movq %rax, -0x1b0(%rbp)
xorl %eax, %eax
movq -0x1b0(%rbp), %rax
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movl %r11d, 0x28(%rsp)
movl %r10d, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
callq 0x1e5cf0
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x58(%rbp), %ecx
xorl $0x1, %ecx
movq -0xa0(%rbp), %r8
movl -0x74(%rbp), %r9d
leaq -0x120(%rbp), %rdx
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x1e53f0
movl -0x64(%rbp), %eax
movl %eax, -0x68(%rbp)
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpq -0x180(%rbp), %rax
jae 0x1e865e
movq -0xb8(%rbp), %rax
movq -0x170(%rbp), %rcx
movl -0x60(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1e8614
jmp 0x1e8653
movq -0xb8(%rbp), %rax
movq -0x170(%rbp), %rcx
movl -0x60(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
movq -0x170(%rbp), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x170(%rbp), %rax
movl -0x68(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1e85e5
movl -0x68(%rbp), %eax
movq %rax, -0x180(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x1e849c
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpq -0x180(%rbp), %rax
jae 0x1e86b0
movq -0xb8(%rbp), %rax
movq -0x170(%rbp), %rcx
movl -0x60(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1e867d
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x1e2260
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
shrl %eax
movl %eax, -0x84(%rbp)
movl -0x80(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x88(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movl -0x84(%rbp), %eax
movq %rax, -0x1b8(%rbp)
cmpl $0x1, -0x88(%rbp)
jne 0x1e870b
leaq -0x8c(%rbp), %rax
movq %rax, -0x1c8(%rbp)
jmp 0x1e8716
xorl %eax, %eax
movq %rax, -0x1c8(%rbp)
jmp 0x1e8716
movq -0x1c8(%rbp), %rax
movq %rax, -0x1d0(%rbp)
cmpl $0x0, -0x88(%rbp)
jne 0x1e873d
leaq -0x8c(%rbp), %rax
movq %rax, -0x1d8(%rbp)
jmp 0x1e8748
xorl %eax, %eax
movq %rax, -0x1d8(%rbp)
jmp 0x1e8748
movq -0x1d0(%rbp), %rdx
movq -0x1b8(%rbp), %rsi
movq -0x1c0(%rbp), %rdi
movq -0x1d8(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
cmpl $-0x1, -0x8c(%rbp)
je 0x1e8842
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl -0x8c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq -0x40(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
ja 0x1e8842
jmp 0x1e87b4
movq -0x180(%rbp), %rax
cmpq -0x178(%rbp), %rax
jne 0x1e881b
cmpq $0x0, -0x178(%rbp)
je 0x1e87e1
movq -0x178(%rbp), %rax
shlq %rax
movq %rax, -0x1e0(%rbp)
jmp 0x1e87ef
movl $0x2, %eax
movq %rax, -0x1e0(%rbp)
jmp 0x1e87ef
movq -0x1e0(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x170(%rbp), %rdi
movq -0x178(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0x170(%rbp)
movl -0x8c(%rbp), %edx
movq -0x170(%rbp), %rax
movq -0x180(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x180(%rbp)
movl %edx, (%rax,%rcx,4)
jmp 0x1e8842
movl -0x54(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1e88c1
movl -0x8c(%rbp), %esi
xorl $0x1, %esi
movl -0x84(%rbp), %edx
movq -0x40(%rbp), %r9
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %r10
movq -0x30(%rbp), %rax
leaq -0x180(%rbp), %rdi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
leaq -0x1a0(%rbp), %r11
xorl %ecx, %ecx
movl %r8d, %ecx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
callq 0x1deb20
jmp 0x1e8932
movl -0x8c(%rbp), %ecx
xorl $0x1, %ecx
movl -0x84(%rbp), %r8d
movq -0x40(%rbp), %r9
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %r10
movq -0x30(%rbp), %rax
leaq -0x180(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x1a0(%rbp), %r11
xorl %esi, %esi
movl %edx, %esi
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
callq 0x1deb20
jmp 0x1e8934
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1e8413
jmp 0x1e8944
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x1e89b6
movq -0x40(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x1e8975
movq -0x40(%rbp), %rax
movq 0x38(%rax), %rax
shlq %rax
movq %rax, -0x1e8(%rbp)
jmp 0x1e8983
movl $0x2, %eax
movq %rax, -0x1e8(%rbp)
jmp 0x1e8983
movq -0x1e8(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x38(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %edx
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x40(%rbp), %rsi
movq 0x30(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x30(%rsi)
movl %edx, (%rax,%rcx,4)
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl -0x90(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
addq 0xa8(%rax), %rcx
movq %rcx, 0xa8(%rax)
cmpl $0x0, -0x90(%rbp)
je 0x1e8a29
movq -0x40(%rbp), %rdi
callq 0x1c6cf0
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x70(%rbp), %eax
jae 0x1e8ad8
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x50(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x54(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x54(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
je 0x1e8aa2
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x54(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x0, %eax
jne 0x1e8aa4
jmp 0x1e8aca
movq -0x40(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rsi
movq -0x50(%rbp), %rdx
movl -0x54(%rbp), %r8d
xorl %eax, %eax
movl %eax, %ecx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x1e22d0
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1e8a30
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x1e2c80
movq -0x50(%rbp), %rdi
callq 0xcd6f0
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rdi
callq 0xe5910
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xc0(%rax)
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x2210
movq $0x0, -0x1a8(%rbp)
movq -0x40(%rbp), %rax
movq 0xc0(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movq $0x0, 0xc8(%rax)
movq -0x50(%rbp), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xd0(%rax)
movq -0x50(%rbp), %rax
movq (%rax), %rdi
shlq $0x5, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x50(%rbp), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xc8(%rax)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1e8c34
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x1a8(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rax
movl -0x5c(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rax
movl -0x5c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x0, 0x18(%rax)
movq -0x1a8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rcx
movl -0x5c(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rcx
callq 0x1df840
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x1e8b9d
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rdi
movq -0x40(%rbp), %rax
movq 0xc8(%rax), %rsi
movl $0x20, %edx
leaq -0x91d6(%rip), %rcx     # 0x1dfa80
callq 0x23e0
movq -0xa0(%rbp), %rdi
callq 0x2210
movq -0xa8(%rbp), %rdi
callq 0x2210
movq -0xb0(%rbp), %rdi
callq 0x2210
movq -0xb8(%rbp), %rdi
callq 0x2210
movq -0xd8(%rbp), %rdi
callq 0x2210
movq -0x130(%rbp), %rdi
callq 0x2210
movq -0x150(%rbp), %rdi
callq 0x2210
movq -0x170(%rbp), %rdi
callq 0x2210
movq -0x190(%rbp), %rdi
callq 0x2210
movq 0x1db312(%rip), %rax    # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0x1f0(%rbp)
callq 0x1b7ca0
movq -0x1f0(%rbp), %rdi
subsd -0x48(%rbp), %xmm0
leaq 0x1a3b18(%rip), %rsi    # 0x38c808
leaq 0x1a3e77(%rip), %rdx    # 0x38cb6e
movb $0x1, %al
callq 0x22a0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq