// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: debug_utg_graph(ma_ug_t*, asg_t*, kvec_asg_arc_t_warp*, int, int)
void debug_utg_graph(ma_ug_t *ug, asg_t* read_g, kvec_asg_arc_t_warp* edge, int require_equal_nv, int test_tangle)
{
    asg_t* nsg = ug->g;
    uint32_t n_vtx = nsg->n_seq, i, j, k, l, totalLen, v, nv, nw, w, untig_v, rid_v;
    asg_arc_t *aw = NULL, *av = NULL, *t_v = NULL, *t_w = NULL;
    for (i = 0; i < n_vtx; i++)
    {
        if(ug->g->seq[i].del) continue;

        totalLen = 0;
        ma_utg_t* result = &(ug->u.a[i]);
        if(result->n == 0) continue;
        v = (uint64_t)(result->a[0])>>32;
        if(result->start != UINT32_MAX && result->start != v) fprintf(stderr, "hehe\n");
        v = (uint64_t)(result->a[result->n-1])>>32;
        if(result->end != UINT32_MAX && result->end != (v^1)) fprintf(stderr, "haha\n");
        uint64_t end_index = result->n-1;
        if(result->start == UINT32_MAX && result->end == UINT32_MAX) end_index++;
        for (j = 0; j < end_index; j++)
        {
            v = (uint64_t)(result->a[j])>>32;
            if(j == result->n-1)
            {
                w = (uint64_t)(result->a[0])>>32; 
            }
            else
            {
                w = (uint64_t)(result->a[j+1])>>32; 
            }
            
            

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

            if(edge && 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]);
                        k = nv + 1;
                        break;
                    }
                }
            }
            
            if(k == nv) fprintf(stderr ,"******error, j: %u, k: %u, nv: %u\n", j, k, nv);
            if(l != (uint32_t)(result->a[j]))
            {
                fprintf(stderr ,"(i: %u) ERROR Length, l: %u, result->a[j]: %u, j: %u, k: %u, nv: %u, circ: %u, result->n: %u\n", 
                            i, l, (uint32_t)(result->a[j]), j, k, nv, result->circ, (uint32_t)result->n);
            }
             
            totalLen = totalLen + l;
        }


        if(j < result->n)
        {
            v = (uint64_t)(result->a[j])>>32;
            l = read_g->seq[v>>1].len;
            if(l != (uint32_t)(result->a[j])) fprintf(stderr ,"*** ERROR Length, i: %u\n", i);
            totalLen = totalLen + l;
        }

        if(totalLen != result->len)
        {
            fprintf(stderr ,"ERROR Total Length, i: %u\n", i);
        } 
                


        if(ug->u.a[i].start == UINT32_MAX && ug->u.a[i].end == UINT32_MAX) continue;

        v = i<<1; v=v^1;
        av = asg_arc_a(ug->g, v);
        nv = asg_arc_n(ug->g, v);

        w = (ug->u.a[v>>1].start^1);
        aw = asg_arc_a(read_g, w);
        nw = asg_arc_n(read_g, w);


        if(require_equal_nv && get_real_length(ug->g, v, NULL) != get_real_length(read_g, w, NULL))
        {
            fprintf(stderr, "#########ERROR: i: %u, nv: %u, nw: %u\n", i, nv, nw);
        }

        for (j = 0; j < nv; j++)
        {
            if(av[j].del) continue;
            untig_v = av[j].v;
            if(untig_v&1) rid_v = ug->u.a[untig_v>>1].end;
            else rid_v = ug->u.a[untig_v>>1].start;

            t_v = t_w = NULL;
            for (k = 0; k < nw; k++)
            {
                if(aw[k].del) continue;
                if(aw[k].v == rid_v)
                {
                    t_w = &(aw[k]);
                    break;
                } 
                
            }

            if(edge && t_w == NULL)
            {
                for (k = 0; k < edge->a.n; k++)
                {
                    if(edge->a.a[k].del) continue;
                    if((edge->a.a[k].ul>>32) == w && edge->a.a[k].v == rid_v)
                    {
                        t_w = &(edge->a.a[k]);
                        break;
                    }
                }
            }
            
            if(t_w == NULL) fprintf(stderr, "#########ERROR: i: %u\n", i);
            t_v = &av[j];
            if(t_w && (t_v->ol != t_w->ol))
            {
                fprintf(stderr, "#########????????ERROR\n");
                fprintf(stderr, "nv: %u, nw: %u\n", nv, nw);
                fprintf(stderr, "av[%u].ol: %u, aw[%u].ol: %u, untig_v>>1: %u, untig_v&1: %u\n", 
                j, t_v->ol, k, t_w->ol, untig_v>>1, untig_v&1);
            }
        }






        v = v^1;
        av = asg_arc_a(ug->g, v);
        nv = asg_arc_n(ug->g, v);

        w = (ug->u.a[v>>1].end^1);
        aw = asg_arc_a(read_g, w);
        nw = asg_arc_n(read_g, w);
        if(require_equal_nv && get_real_length(ug->g, v, NULL) != get_real_length(read_g, w, NULL))
        {
            fprintf(stderr, "*******ERROR: i: %u, nv: %u, nw: %u\n", i, nv, nw);
        }
        for (j = 0; j < nv; j++)
        {
            if(av[j].del) continue;
            untig_v = av[j].v;
            if(untig_v&1) rid_v = ug->u.a[untig_v>>1].end;
            else rid_v = ug->u.a[untig_v>>1].start;
            
            t_v = t_w = NULL;
            for (k = 0; k < nw; k++)
            {
                if(aw[k].del) continue;
                if(aw[k].v == rid_v)
                {
                    t_w = &(aw[k]);
                    break;
                } 
                
            }

            if(edge && t_w == NULL)
            {
                for (k = 0; k < edge->a.n; k++)
                {
                    if(edge->a.a[k].del) continue;
                    if((edge->a.a[k].ul>>32) == w && edge->a.a[k].v == rid_v)
                    {
                        t_w = &(edge->a.a[k]);
                        break;
                    }
                }
            }
            
            if(t_w == NULL) fprintf(stderr, "#########ERROR: i: %u\n", i);
            t_v = &av[j];
            if(t_w && (t_v->ol != t_w->ol))
            {
                fprintf(stderr, "#########????????ERROR\n");
                fprintf(stderr, "nv: %u, nw: %u\n", nv, nw);
                fprintf(stderr, "av[%u].ol: %u, aw[%u].ol: %u, untig_v>>1: %u, untig_v&1: %u\n", 
                j, t_v->ol, k, t_w->ol, untig_v>>1, untig_v&1);
            }
        }

    }


    if(test_tangle != 1) return;
    fprintf(stderr, "test_tangle: %u\n", test_tangle);
    n_vtx = nsg->n_seq * 2;
    for (v = 0; v < n_vtx; ++v) 
    {
        uint32_t w1, w2, beg, end, rnw;
        if(nsg->seq[v>>1].del) continue;
        if(asg_arc_n(nsg, v) < 1 || asg_arc_n(nsg, v^1) < 1) continue;
        if(get_real_length(nsg, v, NULL) != 1 || get_real_length(nsg, v^1, NULL) != 1) continue;
        get_real_length(nsg, v, &w1); get_real_length(nsg, v^1, &w2);

        ///for simple circle
        if(w1 == (w2^1))
        {
            beg = end = 0;
            aw = asg_arc_a(nsg, w1^1);
            nw = asg_arc_n(nsg, w1^1);
            for (i = 0, rnw = 0; i < nw; i++)
            {
                if(aw[i].del) continue;
                rnw++;
                if(aw[i].v == (v^1)) continue;
                beg = aw[i].v;
            }
            if(rnw != 2) continue;

            aw = asg_arc_a(nsg, w2^1);
            nw = asg_arc_n(nsg, w2^1);
            for (i = 0, rnw = 0; i < nw; i++)
            {
                if(aw[i].del) continue;
                rnw++;
                if(aw[i].v == v) continue;
                end = aw[i].v;
            }
            if(rnw != 2) continue;

            if(get_real_length(nsg, beg^1, NULL)!=1) continue;
            if(get_real_length(nsg, end^1, NULL)!=1) continue;
            if((beg>>1) == (end>>1)) continue;
            fprintf(stderr, "\n************\n");
        }
        else if(w1 == w2)
        {
            if(get_real_length(nsg, w1^1, NULL) != 2) continue;
            if(get_real_length(nsg, w1, NULL) != 2) continue;
            end = beg = (uint32_t)-1;

            aw = asg_arc_a(nsg, w1);
            nw = asg_arc_n(nsg, w1);
            for (i = 0, rnw = 0; i < nw && rnw < 2; i++)
            {
                if(aw[i].del) continue;
                if(rnw == 0) beg = aw[i].v;
                if(rnw == 1) end = aw[i].v;
                rnw++;
            }
            if((beg>>1) == (end>>1)) continue;
            if(get_real_length(nsg, beg^1, NULL)!=1) continue;
            if(get_real_length(nsg, end^1, NULL)!=1) continue;
            fprintf(stderr, "\n#################\n");
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %r8d, 0x78(%rsp)
movl %ecx, 0x64(%rsp)
movq %rdx, %r15
movq %rdi, 0x40(%rsp)
movq 0x18(%rdi), %rbx
movl 0x14(%rbx), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x90(%rsp)
xorl %ecx, %ecx
movq %rbx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
cmpq 0x90(%rsp), %rcx
je 0xb0f3e
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x30(%rsp)
cmpl $0x0, (%rax,%rcx,8)
js 0xb0e0f
movq 0x40(%rsp), %rax
movq 0x10(%rax), %r11
imulq $0x28, 0x30(%rsp), %rbx
movl 0x10(%r11,%rbx), %r12d
testl %r12d, %r12d
je 0xb0e0f
addq %rbx, %r11
movl 0x4(%r11), %eax
cmpl $-0x1, %eax
movq %r11, 0x18(%rsp)
je 0xb0762
movq 0x18(%r11), %rcx
cmpl 0x4(%rcx), %eax
jne 0xb0e46
movl 0x8(%r11), %eax
cmpl $-0x1, %eax
je 0xb0781
movq 0x18(%r11), %rcx
leal -0x1(%r12), %edx
xorl 0x4(%rcx,%rdx,8), %eax
cmpl $0x1, %eax
jne 0xb0e75
decl %r12d
cmpl $-0x1, 0x4(%r11)
movq %rbx, 0x50(%rsp)
jne 0xb079d
xorl %eax, %eax
cmpl $-0x1, 0x8(%r11)
sete %al
addq %rax, %r12
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %r12, 0x58(%rsp)
movl %r13d, %ebx
cmpq %rbx, %r12
jbe 0xb092a
movq 0x18(%r11), %rcx
movq (%rcx,%rbx,8), %r8
movq %r8, %rax
shrq $0x20, %rax
movl 0x10(%r11), %edx
decl %edx
leal 0x1(%rbx), %r13d
cmpl %edx, %ebx
movl %r13d, %edx
movl $0x0, %edi
cmovel %edi, %edx
movl 0x4(%rcx,%rdx,8), %ecx
movq 0x8(%rsi), %r9
movq 0x28(%rsi), %rdx
movq (%rdx,%rax,8), %r14
movq %r14, %rdi
shrq $0x20, %rdi
movl %r14d, %edx
imulq $0x18, %rdi, %rdi
addq %r9, %rdi
addq $0xc, %rdi
xorl %r10d, %r10d
cmpq %r10, %rdx
je 0xb0819
cmpl $0x0, (%rdi)
js 0xb0810
cmpl %ecx, -0x4(%rdi)
je 0xb0824
incq %r10
addq $0x18, %rdi
jmp 0xb0801
movl %ebp, %r12d
movl %r14d, %r10d
pushq $-0x1
popq %rbp
jmp 0xb082a
movl %ebp, %r12d
movl -0xc(%rdi), %ebp
testq %r15, %r15
je 0xb0874
cmpl %r14d, %r10d
jne 0xb0874
movq (%r15), %rdx
xorl %r10d, %r10d
movl %r10d, %edi
cmpq %rdi, %rdx
jbe 0xb086f
movq 0x10(%r15), %r11
imulq $0x18, %rdi, %rdi
cmpl $0x0, 0xc(%r11,%rdi)
js 0xb086a
addq %rdi, %r11
movq (%r11), %rdi
movq %rdi, %r9
shrq $0x20, %r9
cmpl %eax, %r9d
jne 0xb086a
cmpl %ecx, 0x8(%r11)
je 0xb088e
incl %r10d
jmp 0xb083a
movq 0x18(%rsp), %r11
cmpl %r14d, %r10d
je 0xb08f0
cmpl %r8d, %ebp
jne 0xb089b
addl %ebp, %r12d
movl %r12d, %ebp
movq 0x58(%rsp), %r12
jmp 0xb07a7
leal 0x1(%r14), %r10d
movl %edi, %ebp
movq 0x18(%rsp), %r11
jmp 0xb0879
movq 0x1a273e(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movl (%rax), %r11d
movq 0x18(%rsp), %rax
movl 0x10(%rax), %eax
movq %rax, 0x20(%rsp)
shrl $0x1f, %r11d
leaq 0x139cc2(%rip), %rsi    # 0x1ea587
movq 0x30(%rsp), %rdx
movl %ebp, %ecx
movl %ebx, %r9d
xorl %eax, %eax
pushq 0x20(%rsp)
pushq %r11
pushq %r14
pushq %r10
callq 0x22b0
movq 0x38(%rsp), %r11
movq 0x28(%rsp), %rsi
addq $0x20, %rsp
jmp 0xb087e
movq 0x1a26e9(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x139c63(%rip), %rsi    # 0x1ea564
movl %ebx, %edx
movl %r14d, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %rsi
movq 0x18(%r11), %rax
movq (%rax,%rbx,8), %r8
movl %r14d, %r10d
jmp 0xb0879
cmpl 0x10(%r11), %ebx
jae 0xb0963
movq 0x18(%r11), %rax
movq (%rax,%rbx,8), %rax
movq 0x20(%rsi), %rcx
movq %rax, %rdx
shrq $0x21, %rdx
movl (%rcx,%rdx,8), %ebx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %ebx
cmpl %eax, %ebx
movq 0x30(%rsp), %r14
movq 0x50(%rsp), %r13
jne 0xb0f14
addl %ebx, %ebp
jmp 0xb096d
movq 0x30(%rsp), %r14
movq 0x50(%rsp), %r13
movl (%r11), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cmpl %eax, %ebp
jne 0xb0e21
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax,%r13), %ebx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rbx
jne 0xb09a4
addq %r13, %rax
cmpl $-0x1, 0x8(%rax)
je 0xb0e0f
movq 0x30(%rsp), %r14
leaq (%r14,%r14), %rcx
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x28(%rdi), %rax
movq %rcx, 0x70(%rsp)
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
shrq $0x20, %rax
imulq $0x18, %rax, %r8
addq 0x8(%rdi), %r8
xorq $0x1, %rbx
movq 0x28(%rsi), %rax
movq (%rax,%rbx,8), %r12
movq %r12, %rax
shrq $0x20, %rax
imulq $0x18, %rax, %r9
addq 0x8(%rsi), %r9
cmpl $0x0, 0x64(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x28(%rsp)
je 0xb0a37
leaq 0x1(,%r14,2), %rsi
xorl %edx, %edx
callq 0xc2e7a
movl %eax, %ebp
movq 0x8(%rsp), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0xc2e7a
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r8
movq 0x8(%rsp), %rsi
cmpl %eax, %ebp
jne 0xb0ea4
movq %r12, 0x88(%rsp)
movl %r12d, %r13d
movl 0x38(%rsp), %r10d
xorl %r11d, %r11d
cmpq %r10, %r11
je 0xb0be1
imulq $0x18, %r11, %r12
movl 0xc(%r8,%r12), %eax
testl %eax, %eax
js 0xb0af1
addq %r8, %r12
movl 0x8(%r12), %ecx
movl %ecx, %edi
shrl %ecx
movq %rcx, 0x58(%rsp)
imulq $0x28, %rcx, %rcx
movq 0x40(%rsp), %rdx
addq 0x10(%rdx), %rcx
andl $0x1, %edi
movq %rdi, 0x18(%rsp)
movl 0x4(%rcx,%rdi,4), %ecx
movq %r9, %r14
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0xb0aae
cmpl $0x0, 0xc(%r14)
js 0xb0aa5
cmpl %ecx, 0x8(%r14)
je 0xb0ae2
incq %rbp
addq $0x18, %r14
jmp 0xb0a93
testq %r15, %r15
je 0xb0af9
movq (%r15), %rdx
xorl %ebp, %ebp
movl %ebp, %edi
cmpq %rdi, %rdx
jbe 0xb0af9
movq 0x10(%r15), %r14
imulq $0x18, %rdi, %rdi
cmpl $0x0, 0xc(%r14,%rdi)
js 0xb0ade
addq %rdi, %r14
cmpl %ebx, 0x4(%r14)
jne 0xb0ade
cmpl %ecx, 0x8(%r14)
je 0xb0ae2
incl %ebp
jmp 0xb0ab8
movl 0xc(%r14), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %ecx
cmpl %ecx, %eax
jne 0xb0b33
incq %r11
jmp 0xb0a4a
movq 0x1a24e0(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x139b36(%rip), %rsi    # 0x1ea640
movq 0x30(%rsp), %rdx
xorl %eax, %eax
movq %r10, %r14
movq %r11, %r12
callq 0x22b0
movq %r12, %r11
movq %r14, %r10
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r8
movq 0x8(%rsp), %rsi
jmp 0xb0af1
movq 0x1a24a6(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x139b13(%rip), %rdi    # 0x1ea657
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
movq %r10, 0x80(%rsp)
movq %r11, 0x68(%rsp)
callq 0x2410
movq 0x1a247d(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x139ac3(%rip), %rsi    # 0x1ea630
movq 0x38(%rsp), %rdx
movq 0x88(%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x1a2458(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movl 0xc(%r12), %ecx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %ecx
movl 0xc(%r14), %r9d
andl %eax, %r9d
leaq 0x139aca(%rip), %rsi    # 0x1ea66f
movq 0x68(%rsp), %rdx
movl %ebp, %r8d
xorl %eax, %eax
pushq 0x18(%rsp)
pushq 0x60(%rsp)
callq 0x22b0
movq 0x78(%rsp), %r11
movq 0x90(%rsp), %r10
movq 0x38(%rsp), %r9
movq 0x30(%rsp), %r8
movq 0x18(%rsp), %rsi
addq $0x10, %rsp
jmp 0xb0af1
movq 0x40(%rsp), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rdi
movq 0x28(%rdi), %rcx
movq 0x70(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, 0x38(%rsp)
shrq $0x20, %rcx
imulq $0x18, %rcx, %r8
addq 0x8(%rdi), %r8
movq 0x50(%rsp), %rcx
movl 0x8(%rax,%rcx), %r14d
xorq $0x1, %r14
movq 0x28(%rsi), %rax
movq (%rax,%r14,8), %r12
movq %r12, %rax
shrq $0x20, %rax
imulq $0x18, %rax, %r9
addq 0x8(%rsi), %r9
cmpl $0x0, 0x64(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x28(%rsp)
je 0xb0c73
movl %edx, %esi
xorl %edx, %edx
callq 0xc2e7a
movl %eax, %ebx
movq 0x8(%rsp), %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0xc2e7a
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r8
movq 0x8(%rsp), %rsi
cmpl %eax, %ebx
jne 0xb0edb
movq %r12, 0x68(%rsp)
movl %r12d, %r13d
movl 0x38(%rsp), %r10d
xorl %r11d, %r11d
cmpq %r10, %r11
je 0xb0e0f
imulq $0x18, %r11, %r12
movl 0xc(%r8,%r12), %eax
testl %eax, %eax
js 0xb0d25
addq %r8, %r12
movl 0x8(%r12), %ecx
movl %ecx, %edi
shrl %ecx
movq %rcx, 0x58(%rsp)
imulq $0x28, %rcx, %rcx
movq 0x40(%rsp), %rdx
addq 0x10(%rdx), %rcx
andl $0x1, %edi
movq %rdi, 0x18(%rsp)
movl 0x4(%rcx,%rdi,4), %ecx
movq %r9, %rbx
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0xb0ce5
cmpl $0x0, 0xc(%rbx)
js 0xb0cdc
cmpl %ecx, 0x8(%rbx)
je 0xb0d17
incq %rbp
addq $0x18, %rbx
jmp 0xb0ccc
testq %r15, %r15
je 0xb0d2d
movq (%r15), %rdx
xorl %ebp, %ebp
movl %ebp, %edi
cmpq %rdi, %rdx
jbe 0xb0d2d
movq 0x10(%r15), %rbx
imulq $0x18, %rdi, %rdi
cmpl $0x0, 0xc(%rbx,%rdi)
js 0xb0d13
addq %rdi, %rbx
cmpl %r14d, 0x4(%rbx)
jne 0xb0d13
cmpl %ecx, 0x8(%rbx)
je 0xb0d17
incl %ebp
jmp 0xb0cef
movl 0xc(%rbx), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %ecx
cmpl %ecx, %eax
jne 0xb0d67
incq %r11
jmp 0xb0c83
movq 0x1a22ac(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x139902(%rip), %rsi    # 0x1ea640
movq 0x30(%rsp), %rdx
xorl %eax, %eax
movq %r10, %rbx
movq %r11, %r12
callq 0x22b0
movq %r12, %r11
movq %rbx, %r10
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r8
movq 0x8(%rsp), %rsi
jmp 0xb0d25
movq 0x1a2272(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x1398df(%rip), %rdi    # 0x1ea657
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
movq %r10, 0x70(%rsp)
movq %r11, 0x50(%rsp)
callq 0x2410
movq 0x1a224c(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x139892(%rip), %rsi    # 0x1ea630
movq 0x38(%rsp), %rdx
movq 0x68(%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x1a222a(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movl 0xc(%r12), %ecx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %ecx
movl 0xc(%rbx), %r9d
andl %eax, %r9d
leaq 0x13989c(%rip), %rsi    # 0x1ea66f
movq 0x50(%rsp), %rdx
movl %ebp, %r8d
xorl %eax, %eax
pushq 0x18(%rsp)
pushq 0x60(%rsp)
callq 0x22b0
movq 0x60(%rsp), %r11
movq 0x80(%rsp), %r10
movq 0x38(%rsp), %r9
movq 0x30(%rsp), %r8
movq 0x18(%rsp), %rsi
addq $0x10, %rsp
jmp 0xb0d25
movq 0x30(%rsp), %rcx
incq %rcx
movq 0x10(%rsp), %rbx
jmp 0xb06fd
movq 0x1a21b8(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x1397cc(%rip), %rsi    # 0x1ea5fe
movl %r14d, %edx
xorl %eax, %eax
callq 0x22b0
movq 0x8(%rsp), %rsi
jmp 0xb097f
movq 0x1a2193(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x139701(%rip), %rdi    # 0x1ea558
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %rsi
movl 0x10(%r11), %r12d
jmp 0xb0762
movq 0x1a2164(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x1396d8(%rip), %rdi    # 0x1ea55e
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %rsi
movl 0x10(%r11), %r12d
jmp 0xb0781
movq 0x1a2135(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x139764(%rip), %rsi    # 0x1ea619
movl %r14d, %edx
movq 0x38(%rsp), %rcx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x22b0
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r8
movq 0x8(%rsp), %rsi
jmp 0xb0a37
movq 0x1a20fe(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x1397c0(%rip), %rsi    # 0x1ea6ac
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x22b0
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r8
movq 0x8(%rsp), %rsi
jmp 0xb0c73
movq 0x1a20c5(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x1396c0(%rip), %rsi    # 0x1ea5e5
movl %r14d, %edx
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %rsi
jmp 0xb095f
cmpl $0x1, 0x78(%rsp)
je 0xb0f57
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1a2082(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x139769(%rip), %rsi    # 0x1ea6d1
xorl %r12d, %r12d
pushq $0x1
popq %rdx
xorl %eax, %eax
callq 0x22b0
movl 0x14(%rbx), %ebp
addl %ebp, %ebp
leaq 0x4c(%rsp), %r14
leaq 0x7c(%rsp), %r15
cmpq %rbp, %r12
je 0xb0f45
movq 0x20(%rbx), %rax
movl %r12d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0xb11ea
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
cmpl $0x0, (%rax,%r12,8)
je 0xb11ea
movl %r12d, %ebx
xorl $0x1, %ebx
cmpl $0x0, (%rax,%rbx,8)
je 0xb11ea
movq 0x10(%rsp), %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0xc2e7a
cmpl $0x1, %eax
jne 0xb11ea
movq 0x10(%rsp), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0xc2e7a
cmpl $0x1, %eax
jne 0xb11ea
movq 0x10(%rsp), %r13
movq %r13, %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0xc2e7a
movq %r13, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0xc2e7a
movl 0x4c(%rsp), %esi
movl 0x7c(%rsp), %eax
movl %eax, %ecx
xorl %esi, %ecx
cmpl $0x1, %ecx
jne 0xb1076
movq 0x8(%r13), %rcx
movq 0x28(%r13), %rdx
xorq $0x1, %rsi
movq (%rdx,%rsi,8), %rsi
movl %esi, %edi
movq %rsi, %r8
shrq $0x20, %r8
imulq $0x18, %rdi, %rsi
imulq $0x18, %r8, %rdi
addq %rcx, %rdi
addq $0xc, %rdi
xorl %r8d, %r8d
xorl %r13d, %r13d
xorl %r9d, %r9d
cmpq %r8, %rsi
je 0xb110e
cmpl $0x0, (%rdi,%r8)
js 0xb1070
incl %r9d
movl -0x4(%rdi,%r8), %r10d
cmpl %ebx, %r10d
cmovnel %r10d, %r13d
addq $0x18, %r8
jmp 0xb1051
cmpl %eax, %esi
jne 0xb11ea
xorl $0x1, %esi
movq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0xc2e7a
cmpl $0x2, %eax
jne 0xb11ea
movl 0x4c(%rsp), %esi
movq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0xc2e7a
cmpl $0x2, %eax
jne 0xb11ea
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x28(%rax), %rax
movl 0x4c(%rsp), %edx
movq (%rax,%rdx,8), %rdx
movl %edx, %eax
shrq $0x20, %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
addq $0xc, %rcx
xorl %edx, %edx
pushq $-0x1
popq %rbx
movl %ebx, %esi
xorl %edi, %edi
cmpq %rax, %rdx
jae 0xb11b7
cmpl $0x1, %edi
ja 0xb11b7
cmpl $0x0, (%rcx)
js 0xb1105
testl %edi, %edi
movl -0x4(%rcx), %r8d
cmovel %r8d, %esi
cmovnel %r8d, %ebx
incl %edi
incq %rdx
addq $0x18, %rcx
jmp 0xb10de
cmpl $0x2, %r9d
jne 0xb11ea
xorq $0x1, %rax
movq (%rdx,%rax,8), %rax
movl %eax, %edx
movq %rax, %rsi
shrq $0x20, %rsi
imulq $0x18, %rdx, %rax
imulq $0x18, %rsi, %rdx
addq %rdx, %rcx
addq $0xc, %rcx
xorl %edx, %edx
xorl %ebx, %ebx
xorl %esi, %esi
cmpq %rdx, %rax
je 0xb115b
cmpl $0x0, (%rcx,%rdx)
js 0xb1155
incl %esi
movl -0x4(%rcx,%rdx), %edi
cmpq %rdi, %r12
cmovnel %edi, %ebx
addq $0x18, %rdx
jmp 0xb113e
cmpl $0x2, %esi
jne 0xb11ea
movl %r13d, %esi
xorl $0x1, %esi
movq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0xc2e7a
cmpl $0x1, %eax
jne 0xb11ea
movl %ebx, %esi
xorl $0x1, %esi
movq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0xc2e7a
cmpl $0x1, %eax
jne 0xb11ea
xorl %r13d, %ebx
cmpl $0x2, %ebx
jb 0xb11ea
movq 0x1a1e40(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x139538(%rip), %rdi    # 0x1ea6e2
pushq $0xe
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
jmp 0xb11ea
movl %ebx, %eax
xorl %esi, %eax
cmpl $0x2, %eax
jb 0xb11ea
xorl $0x1, %esi
movq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0xc2e7a
cmpl $0x1, %eax
jne 0xb11ea
xorl $0x1, %ebx
movq 0x10(%rsp), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0xc2e7a
cmpl $0x1, %eax
je 0xb11f7
incq %r12
movq 0x10(%rsp), %rbx
jmp 0xb0f84
movq 0x1a1de2(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x1394e9(%rip), %rdi    # 0x1ea6f1
pushq $0x13
jmp 0xb11ac