// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: reduce_ma_utg_t(ma_utg_t*, asg_t*, ma_hit_t_alloc*, ma_sub_t*, kvec_asg_arc_t_warp*, int, int, kvec_asg_arc_t_warp*)
void reduce_ma_utg_t(ma_utg_t* collection, asg_t* read_g, ma_hit_t_alloc* sources, 
ma_sub_t *coverage_cut, kvec_asg_arc_t_warp* edge, int max_hang, int min_ovlp, kvec_asg_arc_t_warp* newE)
{
    asg_arc_t t_f;
    asg_arc_t* av = NULL;
    uint32_t m = 0, k, i, nv;
    for (i = 0; i < collection->n; i++)
    {
        if(collection->a[i] == (uint64_t)-1)
        {
            // if(newE) asg_seq_del(read_g, collection->a[i]>>33);
            continue;
        } 
        
        collection->a[m] = collection->a[i];
        m++;
    }
    collection->n = m;


    uint32_t totalLen = 0, v, w, l;
    for (i = 0; i < collection->n - 1; i++)
    {
        v = (uint64_t)(collection->a[i])>>32;
        w = (uint64_t)(collection->a[i + 1])>>32; 




        /*******************************for debug************************************/
        l = (uint32_t)-1;
        av = asg_arc_a(read_g, v);
        nv = asg_arc_n(read_g, v);
        for (k = 0; k < nv; k++)
        {
            if(av[k].del) continue;
            if(av[k].v == w) 
            {
                l = asg_arc_len(av[k]);
                break;
            }
        }

        if(k == nv) 
        {
            for (k = 0; k < edge->a.n; k++)
            {
                if(edge->a.a[k].del) continue;
                if((edge->a.a[k].ul>>32) == v && edge->a.a[k].v == w)
                {
                    l = asg_arc_len(edge->a.a[k]);
                    break;
                }
            }

            if(k == edge->a.n)
            {
                if(get_edge_from_source(sources, coverage_cut, NULL, max_hang, min_ovlp, v, w, &t_f)==0)
                {
                    fprintf(stderr, "####ERROR1: v>>1: %u, v&1: %u, w>>1: %u, w&1: %u, r_seq: %u\n",
                    v>>1, v&1, w>>1, w&1, read_g->r_seq);
                }
                l = asg_arc_len(t_f);

                
                if(newE)
                {
                    kv_push(asg_arc_t, newE->a, t_f);
                    if(get_edge_from_source(sources, coverage_cut, NULL, max_hang, min_ovlp, w^1, v^1, &t_f)==0)
                    {
                        fprintf(stderr, "####ERROR2: v>>1: %u, v&1: %u, w>>1: %u, w&1: %u, r_seq: %u\n",
                        v>>1, v&1, w>>1, w&1, read_g->r_seq);
                    }
                    kv_push(asg_arc_t, newE->a, t_f);
                }
                
            }
            else if(newE)
            {
                kv_push(asg_arc_t, newE->a, edge->a.a[k]);
                for (k = 0; k < edge->a.n; k++)
                {
                    if(edge->a.a[k].del) continue;
                    if((edge->a.a[k].ul>>32) == (w^1) && edge->a.a[k].v == (v^1))
                    {
                        l = asg_arc_len(edge->a.a[k]);
                        break;
                    }
                }
                kv_push(asg_arc_t, newE->a, edge->a.a[k]);
            }
        }
        if(l == (uint32_t)-1) fprintf(stderr, "ERROR\n");
        /*******************************for debug************************************/









        collection->a[i] = v; collection->a[i] = collection->a[i]<<32; 
        collection->a[i] = collection->a[i] | (uint64_t)(l);
        totalLen += l;
    }

    if(i < collection->n)
    {
        if(collection->circ)
        {
            v = (uint64_t)(collection->a[i])>>32;
            w = (uint64_t)(collection->a[0])>>32; 
            



            /*******************************for debug************************************/
            l = (uint32_t)-1;
            av = asg_arc_a(read_g, v);
            nv = asg_arc_n(read_g, v);
            for (k = 0; k < nv; k++)
            {
                if(av[k].del) continue;
                if(av[k].v == w) 
                {
                    l = asg_arc_len(av[k]);
                    break;
                }
            }
            
            if(k == nv) 
            {
                for (k = 0; k < edge->a.n; k++)
                {
                    if(edge->a.a[k].del) continue;
                    if((edge->a.a[k].ul>>32) == v && edge->a.a[k].v == w)
                    {
                        l = asg_arc_len(edge->a.a[k]);
                        break;
                    }
                }

                if(k == edge->a.n)
                {
                    if(get_edge_from_source(sources, coverage_cut, NULL, max_hang, min_ovlp, v, w, &t_f)==0)
                    {
                        fprintf(stderr, "####ERROR1: v>>1: %u, v&1: %u, w>>1: %u, w&1: %u, r_seq: %u\n",
                        v>>1, v&1, w>>1, w&1, read_g->r_seq);
                    }
                    l = asg_arc_len(t_f);

                    if(newE)
                    {
                        kv_push(asg_arc_t, newE->a, t_f);
                        if(get_edge_from_source(sources, coverage_cut, NULL, max_hang, min_ovlp, w^1, v^1, &t_f)==0)
                        {
                            fprintf(stderr, "####ERROR2: v>>1: %u, v&1: %u, w>>1: %u, w&1: %u, r_seq: %u\n",
                            v>>1, v&1, w>>1, w&1, read_g->r_seq);
                        }
                        kv_push(asg_arc_t, newE->a, t_f);
                    }
                }
                else if(newE)
                {
                    kv_push(asg_arc_t, newE->a, edge->a.a[k]);
                    for (k = 0; k < edge->a.n; k++)
                    {
                        if(edge->a.a[k].del) continue;
                        if((edge->a.a[k].ul>>32) == (w^1) && edge->a.a[k].v == (v^1))
                        {
                            l = asg_arc_len(edge->a.a[k]);
                            break;
                        }
                    }
                    kv_push(asg_arc_t, newE->a, edge->a.a[k]);
                }
            }
            if(l == (uint32_t)-1) fprintf(stderr, "ERROR\n");
            /*******************************for debug************************************/












            collection->a[i] = v; collection->a[i] = collection->a[i]<<32; 
            collection->a[i] = collection->a[i] | (uint64_t)(l);

            totalLen += l;
        }
        else
        {
            v = (uint64_t)(collection->a[i])>>32;
            l = read_g->seq[v>>1].len;
            collection->a[i] = v;
            collection->a[i] = collection->a[i]<<32;
            collection->a[i] = collection->a[i] | (uint64_t)(l);
            totalLen += l;
        }
    }

    collection->len = totalLen;
    if(!collection->circ)
    {
        collection->start = collection->a[0]>>32;
        collection->end = (collection->a[collection->n-1]>>32)^1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0xe8712
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
cmpq $-0x1, (%rax,%rcx,8)
jne 0xe86e0
jmp 0xe8707
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x54(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xe86c0
movl -0x54(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movl $0x0, -0x64(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0xe8db7
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x6c(%rbp)
movl $0xffffffff, -0x70(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x68(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x68(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x60(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0xe8812
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe87d9
jmp 0xe8807
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xe8805
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe8812
jmp 0xe8807
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe87b6
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jne 0xe8d28
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xe88b9
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe8854
jmp 0xe88ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl -0x68(%rbp), %ecx
cmpq %rcx, %rax
jne 0xe88a9
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xe88a9
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe88b9
jmp 0xe88ab
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe8825
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jne 0xe8b02
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0x68(%rbp), %r9d
movl -0x6c(%rbp), %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
cmpl $0x0, %eax
jne 0xe8937
movq 0x2db6de(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x68(%rbp), %edx
shrl %edx
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
movl -0x6c(%rbp), %r8d
shrl %r8d
movl -0x6c(%rbp), %r9d
andl $0x1, %r9d
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
leaq 0x29e446(%rip), %rsi    # 0x386d73
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x48(%rbp), %rax
movl %eax, -0x70(%rbp)
cmpq $0x0, 0x18(%rbp)
je 0xe8afd
jmp 0xe894b
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe89b0
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe8978
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x78(%rbp)
jmp 0xe8983
movl $0x2, %eax
movq %rax, -0x78(%rbp)
jmp 0xe8983
movq -0x78(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0x6c(%rbp), %r9d
xorl $0x1, %r9d
movl -0x68(%rbp), %r10d
xorl $0x1, %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
cmpl $0x0, %eax
jne 0xe8a5d
movq 0x2db5b8(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x68(%rbp), %edx
shrl %edx
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
movl -0x6c(%rbp), %r8d
shrl %r8d
movl -0x6c(%rbp), %r9d
andl $0x1, %r9d
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
leaq 0x29e35d(%rip), %rsi    # 0x386db0
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
jmp 0xe8a5f
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe8ac4
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe8a8c
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x80(%rbp)
jmp 0xe8a97
movl $0x2, %eax
movq %rax, -0x80(%rbp)
jmp 0xe8a97
movq -0x80(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0xe8afd
jmp 0xe8d26
cmpq $0x0, 0x18(%rbp)
je 0xe8d24
jmp 0xe8b0f
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe8b7d
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe8b3f
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x88(%rbp)
jmp 0xe8b4d
movl $0x2, %eax
movq %rax, -0x88(%rbp)
jmp 0xe8b4d
movq -0x88(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x58(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xe8c6a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe8bfb
jmp 0xe8c5c
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl -0x6c(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0xe8c5a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x68(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0xe8c5a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe8c6a
jmp 0xe8c5c
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe8bcc
jmp 0xe8c6c
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe8cda
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe8c9c
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x90(%rbp)
jmp 0xe8caa
movl $0x2, %eax
movq %rax, -0x90(%rbp)
jmp 0xe8caa
movq -0x90(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x58(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0xe8d24
jmp 0xe8d26
jmp 0xe8d28
cmpl $-0x1, -0x70(%rbp)
jne 0xe8d46
movq 0x2db2ab(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x2a0d70(%rip), %rsi    # 0x389aaf
movb $0x0, %al
callq 0x22a0
movl -0x68(%rbp), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl -0x70(%rbp), %eax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x70(%rbp), %eax
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xe872a
movl -0x5c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0xe94e6
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe9451
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x6c(%rbp)
movl $0xffffffff, -0x70(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x68(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x68(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x60(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0xe8ea3
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe8e6a
jmp 0xe8e98
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xe8e96
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe8ea3
jmp 0xe8e98
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe8e47
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jne 0xe93cb
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xe8f4a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe8ee5
jmp 0xe8f3c
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl -0x68(%rbp), %ecx
cmpq %rcx, %rax
jne 0xe8f3a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xe8f3a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe8f4a
jmp 0xe8f3c
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe8eb6
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jne 0xe91a5
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0x68(%rbp), %r9d
movl -0x6c(%rbp), %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
cmpl $0x0, %eax
jne 0xe8fc8
movq 0x2db04d(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x68(%rbp), %edx
shrl %edx
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
movl -0x6c(%rbp), %r8d
shrl %r8d
movl -0x6c(%rbp), %r9d
andl $0x1, %r9d
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
leaq 0x29ddb5(%rip), %rsi    # 0x386d73
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x48(%rbp), %rax
movl %eax, -0x70(%rbp)
cmpq $0x0, 0x18(%rbp)
je 0xe91a0
jmp 0xe8fdc
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe904a
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe900c
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x98(%rbp)
jmp 0xe901a
movl $0x2, %eax
movq %rax, -0x98(%rbp)
jmp 0xe901a
movq -0x98(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0x6c(%rbp), %r9d
xorl $0x1, %r9d
movl -0x68(%rbp), %r10d
xorl $0x1, %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
cmpl $0x0, %eax
jne 0xe90f7
movq 0x2daf1e(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x68(%rbp), %edx
shrl %edx
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
movl -0x6c(%rbp), %r8d
shrl %r8d
movl -0x6c(%rbp), %r9d
andl $0x1, %r9d
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
leaq 0x29dcc3(%rip), %rsi    # 0x386db0
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
jmp 0xe90f9
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe9167
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe9129
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xa0(%rbp)
jmp 0xe9137
movl $0x2, %eax
movq %rax, -0xa0(%rbp)
jmp 0xe9137
movq -0xa0(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0xe91a0
jmp 0xe93c9
cmpq $0x0, 0x18(%rbp)
je 0xe93c7
jmp 0xe91b2
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe9220
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe91e2
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xa8(%rbp)
jmp 0xe91f0
movl $0x2, %eax
movq %rax, -0xa8(%rbp)
jmp 0xe91f0
movq -0xa8(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x58(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xe930d
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe929e
jmp 0xe92ff
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl -0x6c(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0xe92fd
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x68(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0xe92fd
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe930d
jmp 0xe92ff
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe926f
jmp 0xe930f
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe937d
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe933f
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xb0(%rbp)
jmp 0xe934d
movl $0x2, %eax
movq %rax, -0xb0(%rbp)
jmp 0xe934d
movq -0xb0(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x58(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0xe93c7
jmp 0xe93c9
jmp 0xe93cb
cmpl $-0x1, -0x70(%rbp)
jne 0xe93e9
movq 0x2dac08(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x2a06cd(%rip), %rsi    # 0x389aaf
movb $0x0, %al
callq 0x22a0
movl -0x68(%rbp), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl -0x70(%rbp), %eax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x70(%rbp), %eax
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0xe94e4
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x68(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x70(%rbp)
movl -0x68(%rbp), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl -0x70(%rbp), %eax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x70(%rbp), %eax
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0xe94e6
movl -0x64(%rbp), %edx
movq -0x8(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0xe954e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%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 -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)