// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: break_all_contigs(ma_ug_t**, asg_t*, kvec_asg_arc_t_warp*, kvec_t_u64_warp*)
void break_all_contigs(ma_ug_t **ug, asg_t *read_g, kvec_asg_arc_t_warp* edge, kvec_t_u64_warp* break_points)
{
    asg_cleanup((*ug)->g);
    uint32_t k, l, m, occ, uID, idx;
    uint64_t *a = NULL, w;
    ma_utg_t *u = NULL;
    radix_sort_arch64(break_points->a.a, break_points->a.a + break_points->a.n);
    uint32_t *utg_idx = NULL; MALLOC(utg_idx, (*ug)->u.n<<1);
    memset(utg_idx, -1, sizeof(uint32_t)*((*ug)->u.n<<1));
    asg_arc_t *av = NULL;
    uint32_t p_u_idx, nv, v, s_i, p_i;
    ma_ug_t *n_ug = NULL;
    ma_utg_t *p = NULL, *z = NULL;
    n_ug = (ma_ug_t*)calloc(1, sizeof(ma_ug_t));
    n_ug->g = asg_init();

    for (k = m = 0; k < break_points->a.n; k++)
    {
        if(k == 0 || (m > 0 && break_points->a.a[m-1] != break_points->a.a[k]))
        {
            break_points->a.a[m] = break_points->a.a[k];
            m++;
        }
    }
    ///fprintf(stderr, "break_points->a.n: %u, m: %u\n", (uint32_t)break_points->a.n, m);
    break_points->a.n = m;

    for (k = 1, l = 0, p_i = 0; k <= break_points->a.n; ++k) 
    {
        if (k == break_points->a.n || (break_points->a.a[k]>>32) != (break_points->a.a[l]>>32)) 
        {
            occ = k - l;
            a = break_points->a.a + l;
            l = k;
            if(occ == 0) continue;
            uID = a[0]>>32;
            u = &((*ug)->u.a[uID]);
            if(u->n < 2) continue;

            for (s_i = p_i; s_i < uID; s_i++)
            {
                kv_pushp(ma_utg_t, n_ug->u, &p);
                z = &((*ug)->u.a[s_i]);
                (*p) = (*z);
                z->len = z->circ = /**z->start = z->end =**/ z->m = z->n = 0;
                z->a = NULL; z->s = NULL;

                utg_idx[s_i<<1] = ((uint32_t)(n_ug->u.n-1))<<1;
                utg_idx[(s_i<<1)+1] = (((uint32_t)(n_ug->u.n-1))<<1)+1;
            }
            p_i = uID + 1;


            utg_idx[(uID<<1)+1] = (((uint32_t)(n_ug->u.n))<<1)+1;
            for (m = p_u_idx = 0; m < occ; m++)
            {
                idx = (uint32_t)(a[m]);
                if(!u->circ && idx == 0)
                {
                    fprintf(stderr, "ERROR 1\n");
                    continue;
                } 
                

                if(u->circ && idx == 0) 
                {
                    av = asg_arc_a((*ug)->g, (uID<<1)+1);
                    nv = asg_arc_n((*ug)->g, (uID<<1)+1);
                    for (v = 0; v < nv; v++)
                    {
                        if(av[v].del) continue;
                        av[v].del = 1;
                        asg_arc_del((*ug)->g, (av[v].v)^1, (av[v].ul>>32)^1, 1);
                    }
                    u->circ = 0;
                    u->start = u->a[0]>>32;
                    u->end = (u->a[u->n-1]>>32)^1;
                    continue; 
                }

                if(idx - p_u_idx <= 0)
                {
                    fprintf(stderr, "ERROR2: uID: %u, u->circ: %u, idx: %u, p_u_idx: %u\n", 
                                                                        uID, u->circ, idx, p_u_idx);
                    continue;
                } 
                
                
                push_sub_unitig(n_ug, u, read_g, edge, p_u_idx, idx - p_u_idx);
                p_u_idx = idx;
            }
            push_sub_unitig(n_ug, u, read_g, edge, p_u_idx, u->n - p_u_idx);
            utg_idx[(uID<<1)] = ((uint32_t)(n_ug->u.n-1))<<1;

        }
    }

    for (s_i = p_i; s_i < (*ug)->u.n; s_i++)
    {
        kv_pushp(ma_utg_t, n_ug->u, &p);
        z = &((*ug)->u.a[s_i]);
        (*p) = (*z);
        z->len = z->circ = /**z->start = z->end =**/ z->m = z->n = 0;
        z->a = NULL; z->s = NULL;

        utg_idx[s_i<<1] = ((uint32_t)(n_ug->u.n-1))<<1;
        utg_idx[(s_i<<1)+1] = (((uint32_t)(n_ug->u.n-1))<<1)+1;
    }

    // for (k = 0; k < (*ug)->u.n; k++)
    // {
    //     if(utg_idx[(k<<1)] == (uint32_t)-1) fprintf(stderr, "ERROR 3\n");
    //     if(utg_idx[(k<<1)+1] == (uint32_t)-1) fprintf(stderr, "ERROR 4\n");
    // }
    
    asg_arc_t *q = NULL;
    for (k = 0; k < (*ug)->g->n_arc; k++)
    {
        if((*ug)->g->arc[k].del) continue;
        q = asg_arc_pushp(n_ug->g);
        (*q) = (*ug)->g->arc[k];

        q->v = utg_idx[q->v^1]^1;

        w = q->ul>>32; w = utg_idx[w]; w <<= 32;
        q->ul <<= 32; q->ul >>= 32; q->ul |= w;
    }
    
    for (k = 0; k < n_ug->u.n; k++)
    {
        asg_seq_set(n_ug->g, k, n_ug->u.a[k].len, 0);
    }
    
    asg_cleanup(n_ug->g);
    
    // fprintf(stderr, "n_ug->u.n: %u, n_ug->g->n_seq: %u, (*ug)->u.n: %u\n", (uint32_t)n_ug->u.n, (uint32_t)n_ug->g->n_seq,
    // (uint32_t)(*ug)->u.n);

    // for (k = 0; k < ((*ug)->u.n<<1); k++)
    // {
    //     uint32_t ug_rid, n_ug_rid;
    //     if(k&1) ug_rid = ((*ug)->u.a[k>>1]).start;
    //     else ug_rid = ((*ug)->u.a[k>>1]).end;

    //     if(utg_idx[k]&1) n_ug_rid = n_ug->u.a[utg_idx[k]>>1].start;
    //     else n_ug_rid = n_ug->u.a[utg_idx[k]>>1].end;
        
    //     if(ug_rid != n_ug_rid)
    //     {
    //         fprintf(stderr, "ERROR, uid: %u, dir: %u, circle: %u, ug_rid: %u, n_ug_rid: %u\n", 
    //                     k>>1, k&1, (*ug)->u.a[k>>1].circ, ug_rid, n_ug_rid);
    //     }
    // }



    ma_ug_destroy((*ug));
    (*ug) = n_ug;
    renew_utg(ug, read_g, edge); ///for circle
    // fprintf(stderr, "***********(1)edge->a.n: %u***********\n", (uint32_t)edge->a.n);
    // debug_utg_graph(*ug, read_g, edge, 0, 0);
    // fprintf(stderr, "***********(1)edge->a.n: %u***********\n", (uint32_t)edge->a.n);
    free(utg_idx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
callq 0xcdd10
movq $0x0, -0x40(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0xc90e0
movq $0x0, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
shlq %rdi
shlq $0x2, %rdi
callq 0x2270
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdx
shlq %rdx
shlq $0x2, %rdx
movl $0xff, %esi
callq 0x2100
movq $0x0, -0x60(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movq %rax, -0x80(%rbp)
callq 0xcd150
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xf57c7
cmpl $0x0, -0x24(%rbp)
je 0xf5793
cmpl $0x0, -0x2c(%rbp)
jbe 0xf57ba
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x24(%rbp), %edx
cmpq (%rcx,%rdx,8), %rax
je 0xf57ba
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xf57bc
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf5756
movl -0x2c(%rbp), %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
ja 0xf5cd2
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
je 0xf5833
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x28(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
je 0xf5cc2
movl -0x24(%rbp), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0xf5863
jmp 0xf5cc4
movq -0x40(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpl $0x2, 0x10(%rax)
jae 0xf5899
jmp 0xf5cc4
movl -0x74(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x34(%rbp), %eax
jae 0xf5a26
jmp 0xf58ad
movq -0x80(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xf591b
movq -0x80(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xf58dd
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xa0(%rbp)
jmp 0xf58eb
movl $0x2, %eax
movq %rax, -0xa0(%rbp)
jmp 0xf58eb
movq -0xa0(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x80(%rbp), %rax
imulq $0x28, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x70(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdi
movl $0x28, %edx
callq 0x2180
movq -0x90(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x90(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x90(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x90(%rbp), %rax
movl (%rax), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x90(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x90(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x80(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movl %eax, %edx
shll %edx
movq -0x58(%rbp), %rax
movl -0x70(%rbp), %ecx
shll %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movq -0x80(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movl %eax, %edx
shll %edx
addl $0x1, %edx
movq -0x58(%rbp), %rax
movl -0x70(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0xf589f
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
shll %edx
addl $0x1, %edx
movq -0x58(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x64(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0xf5c80
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x38(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0xf5aa7
cmpl $0x0, -0x38(%rbp)
jne 0xf5aa7
movq 0x2ce54f(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x291836(%rip), %rsi    # 0x3872d1
movb $0x0, %al
callq 0x22a0
jmp 0xf5c72
movq -0x50(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xf5c12
cmpl $0x0, -0x38(%rbp)
jne 0xf5c12
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x34(%rbp), %edx
shll %edx
addl $0x1, %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x34(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jae 0xf5bbe
movq -0x60(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xf5b4c
jmp 0xf5bb0
movq -0x60(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
movq -0x60(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
xorl $0x1, %esi
movq -0x60(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %edx
movl $0x1, %ecx
callq 0xd6530
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0xf5b25
movq -0x50(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
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
xorq $0x1, %rax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0xf5c72
movl -0x38(%rbp), %eax
subl -0x64(%rbp), %eax
cmpl $0x0, %eax
ja 0xf5c4b
movq 0x2ce3bc(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x34(%rbp), %edx
movq -0x50(%rbp), %rax
movl (%rax), %ecx
shrl $0x1f, %ecx
movl -0x38(%rbp), %r8d
movl -0x64(%rbp), %r9d
leaq 0x291698(%rip), %rsi    # 0x3872da
movb $0x0, %al
callq 0x22a0
jmp 0xf5c72
movq -0x80(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl -0x64(%rbp), %r8d
movl -0x38(%rbp), %r9d
subl -0x64(%rbp), %r9d
callq 0xf5430
movl -0x38(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xf5a5c
movq -0x80(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl -0x64(%rbp), %r8d
movq -0x50(%rbp), %rax
movl 0x10(%rax), %r9d
subl -0x64(%rbp), %r9d
callq 0xf5430
movq -0x80(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movl %eax, %edx
shll %edx
movq -0x58(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
jmp 0xf5cc4
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf57e8
movl -0x74(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
cmpq (%rcx), %rax
jae 0xf5e66
jmp 0xf5ced
movq -0x80(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xf5d5b
movq -0x80(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xf5d1d
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xa8(%rbp)
jmp 0xf5d2b
movl $0x2, %eax
movq %rax, -0xa8(%rbp)
jmp 0xf5d2b
movq -0xa8(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x80(%rbp), %rax
imulq $0x28, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x70(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdi
movl $0x28, %edx
callq 0x2180
movq -0x90(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x90(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x90(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x90(%rbp), %rax
movl (%rax), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x90(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x90(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x80(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movl %eax, %edx
shll %edx
movq -0x58(%rbp), %rax
movl -0x70(%rbp), %ecx
shll %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movq -0x80(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movl %eax, %edx
shll %edx
addl $0x1, %edx
movq -0x58(%rbp), %rax
movl -0x70(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0xf5cd8
movq $0x0, -0x98(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movq 0x18(%rcx), %rcx
movl 0x4(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0xf5f9b
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xf5ec0
jmp 0xf5f8d
movq -0x80(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xd4050
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rcx
movl -0x24(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq -0x98(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq -0x98(%rbp), %rcx
movl 0x8(%rcx), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %ecx
xorl $0x1, %ecx
movq -0x98(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x98(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x48(%rbp)
movq -0x98(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x98(%rbp), %rax
movq (%rax), %rcx
shrq $0x20, %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
movq -0x98(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf5e78
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x80(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xf5fe5
movq -0x80(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x24(%rbp), %esi
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
callq 0xcd8f0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf5fa2
movq -0x80(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xcdd10
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xcd6f0
movq -0x80(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xf6030
movq -0x58(%rbp), %rdi
callq 0x2210
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)