// File: chhylp123[P]hifiasm/hic.cpp
// Function: append_boundary_chain_hic(ma_ug_t*, kv_u_trans_t*, bubble_type*)
void append_boundary_chain_hic(ma_ug_t* ug, kv_u_trans_t *ta, 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, u^1, vis, flag_pri, NULL);
            get_chain_weight_hic(bub, bs_ug, &b, v^1, u, ta, 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;

        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);
    // 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 $0x208, %rsp            # imm = 0x208
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0xc0(%rax), %rax
movq %rax, -0x48(%rbp)
movl $0x1, -0x6c(%rbp)
movl $0x2, -0x70(%rbp)
movl $0x4, -0x74(%rbp)
movq $0x0, -0x90(%rbp)
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x68(%rbp)
movq $0x0, -0x98(%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, -0x98(%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)
movl -0x68(%rbp), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, -0xa8(%rbp)
movq $0x0, -0xb0(%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, -0xb0(%rbp)
leaq -0x118(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x2100
movq $0x0, -0x130(%rbp)
movq $0x0, -0x138(%rbp)
movq $0x0, -0x128(%rbp)
movq $0x0, -0x150(%rbp)
movq $0x0, -0x158(%rbp)
movq $0x0, -0x148(%rbp)
movq $0x0, -0x170(%rbp)
movq $0x0, -0x178(%rbp)
movq $0x0, -0x168(%rbp)
movq $0x0, -0x190(%rbp)
movq $0x0, -0x198(%rbp)
movq $0x0, -0x188(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x48(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x1fd42e
movq -0x40(%rbp), %rdi
movl -0x54(%rbp), %edx
shll %edx
movq -0x98(%rbp), %rcx
movl -0x70(%rbp), %r8d
leaq -0x118(%rbp), %rsi
xorl %eax, %eax
movl %eax, %r9d
callq 0x1e0580
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1fd3e6
movq -0x40(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jbe 0x1fd449
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, -0x88(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jae 0x1fd983
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x4c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
je 0x1fd4db
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x4c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x0, %eax
jne 0x1fd4e0
jmp 0x1fd975
movq $0x0, -0x178(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x64(%rbp), %eax
jae 0x1fd6cc
movq -0x90(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1fd51f
jmp 0x1fd6be
movq -0x90(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x50(%rbp)
movq -0x178(%rbp), %rax
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x50(%rbp), %ecx
xorl $0x1, %ecx
movq -0x98(%rbp), %r8
movl -0x6c(%rbp), %r9d
leaq -0x118(%rbp), %rdx
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x1e53f0
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x4c(%rbp), %ecx
xorl $0x1, %ecx
movl -0x50(%rbp), %r8d
movq -0x38(%rbp), %r9
movq -0x98(%rbp), %r13
movq -0xa0(%rbp), %r12
movq -0x30(%rbp), %r15
movl -0x6c(%rbp), %r11d
movl -0x74(%rbp), %r10d
leaq -0x118(%rbp), %rdx
leaq -0x138(%rbp), %r14
leaq -0x158(%rbp), %rbx
leaq -0x178(%rbp), %rax
movq %rax, -0x1a8(%rbp)
xorl %eax, %eax
movq -0x1a8(%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 0x1f8150
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x50(%rbp), %ecx
xorl $0x1, %ecx
movq -0x98(%rbp), %r8
movl -0x6c(%rbp), %r9d
leaq -0x118(%rbp), %rdx
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x1e53f0
movl -0x5c(%rbp), %eax
movl %eax, -0x60(%rbp)
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpq -0x178(%rbp), %rax
jae 0x1fd6b4
movq -0xb0(%rbp), %rax
movq -0x168(%rbp), %rcx
movl -0x58(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1fd66a
jmp 0x1fd6a9
movq -0xb0(%rbp), %rax
movq -0x168(%rbp), %rcx
movl -0x58(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
movq -0x168(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x168(%rbp), %rax
movl -0x60(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1fd63b
movl -0x60(%rbp), %eax
movq %rax, -0x178(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1fd4f2
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpq -0x178(%rbp), %rax
jae 0x1fd706
movq -0xb0(%rbp), %rax
movq -0x168(%rbp), %rcx
movl -0x58(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1fd6d3
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x4c(%rbp), %edx
callq 0x1e2260
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
shrl %eax
movl %eax, -0x7c(%rbp)
movl -0x78(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x80(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movl -0x7c(%rbp), %eax
movq %rax, -0x1b0(%rbp)
cmpl $0x1, -0x80(%rbp)
jne 0x1fd755
leaq -0x84(%rbp), %rax
movq %rax, -0x1c0(%rbp)
jmp 0x1fd760
xorl %eax, %eax
movq %rax, -0x1c0(%rbp)
jmp 0x1fd760
movq -0x1c0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
cmpl $0x0, -0x80(%rbp)
jne 0x1fd784
leaq -0x84(%rbp), %rax
movq %rax, -0x1d0(%rbp)
jmp 0x1fd78f
xorl %eax, %eax
movq %rax, -0x1d0(%rbp)
jmp 0x1fd78f
movq -0x1c8(%rbp), %rdx
movq -0x1b0(%rbp), %rsi
movq -0x1b8(%rbp), %rdi
movq -0x1d0(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
cmpl $-0x1, -0x84(%rbp)
je 0x1fd889
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl -0x84(%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 0x1fd889
jmp 0x1fd7fb
movq -0x178(%rbp), %rax
cmpq -0x170(%rbp), %rax
jne 0x1fd862
cmpq $0x0, -0x170(%rbp)
je 0x1fd828
movq -0x170(%rbp), %rax
shlq %rax
movq %rax, -0x1d8(%rbp)
jmp 0x1fd836
movl $0x2, %eax
movq %rax, -0x1d8(%rbp)
jmp 0x1fd836
movq -0x1d8(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x168(%rbp), %rdi
movq -0x170(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0x168(%rbp)
movl -0x84(%rbp), %edx
movq -0x168(%rbp), %rax
movq -0x178(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x178(%rbp)
movl %edx, (%rax,%rcx,4)
jmp 0x1fd889
movl -0x4c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1fd905
movl -0x84(%rbp), %esi
xorl $0x1, %esi
movl -0x7c(%rbp), %edx
movq -0x40(%rbp), %r9
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %r10
movq -0x30(%rbp), %rax
leaq -0x178(%rbp), %rdi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
leaq -0x198(%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 0x1fd973
movl -0x84(%rbp), %ecx
xorl $0x1, %ecx
movl -0x7c(%rbp), %r8d
movq -0x40(%rbp), %r9
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %r10
movq -0x30(%rbp), %rax
leaq -0x178(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x198(%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 0x1fd975
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1fd469
jmp 0x1fd985
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x1fd9f7
movq -0x40(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x1fd9b6
movq -0x40(%rbp), %rax
movq 0x38(%rax), %rax
shlq %rax
movq %rax, -0x1e0(%rbp)
jmp 0x1fd9c4
movl $0x2, %eax
movq %rax, -0x1e0(%rbp)
jmp 0x1fd9c4
movq -0x1e0(%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 -0x88(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
addq 0xa8(%rax), %rcx
movq %rcx, 0xa8(%rax)
cmpl $0x0, -0x88(%rbp)
je 0x1fda6a
movq -0x40(%rbp), %rdi
callq 0x1c6cf0
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jae 0x1fdb19
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x4c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
je 0x1fdae3
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x4c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x0, %eax
jne 0x1fdae5
jmp 0x1fdb0b
movq -0x40(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rsi
movq -0x48(%rbp), %rdx
movl -0x4c(%rbp), %r8d
xorl %eax, %eax
movl %eax, %ecx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x1e22d0
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1fda71
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rdi
leaq -0x198(%rbp), %rsi
callq 0x1e2c80
movq -0x48(%rbp), %rdi
callq 0xcd6f0
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rdi
callq 0xe5910
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xc0(%rax)
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x2210
movq $0x0, -0x1a0(%rbp)
movq -0x40(%rbp), %rax
movq 0xc0(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq $0x0, 0xc8(%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xd0(%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rdi
shlq $0x5, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xc8(%rax)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1fdc75
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x1a0(%rbp)
movl -0x54(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rax
movl -0x54(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rax
movl -0x54(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x0, 0x18(%rax)
movq -0x1a0(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rcx
movl -0x54(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rcx
callq 0x1df840
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1fdbde
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rdi
movq -0x40(%rbp), %rax
movq 0xc8(%rax), %rsi
movl $0x20, %edx
leaq -0x1e217(%rip), %rcx    # 0x1dfa80
callq 0x23e0
movq -0x98(%rbp), %rdi
callq 0x2210
movq -0xa0(%rbp), %rdi
callq 0x2210
movq -0xa8(%rbp), %rdi
callq 0x2210
movq -0xb0(%rbp), %rdi
callq 0x2210
movq -0xd0(%rbp), %rdi
callq 0x2210
movq -0x128(%rbp), %rdi
callq 0x2210
movq -0x148(%rbp), %rdi
callq 0x2210
movq -0x168(%rbp), %rdi
callq 0x2210
movq -0x188(%rbp), %rdi
callq 0x2210
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)