// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: explore_graph(asg_t*, unsigned int, float, float, long long, long long, unsigned int, buf_t*, unsigned int**, unsigned long*, unsigned long*, unsigned char*, ma_ug_t*, unsigned int*)
int explore_graph(asg_t *nsg, uint32_t vBeg, float single_threshold,
float l_untig_rate_threshold, long long minLongUntig, long long maxShortUntig, uint32_t ignore_d,
buf_t* bb, uint32_t** r, size_t* rm, size_t* rn, uint8_t* visit, ma_ug_t *ug, uint32_t* r_ID)
{
    ///the ID of the end long unitig
    (*r_ID) = (uint32_t)-1;
    uint32_t nv, vBeg_end;
    asg_arc_t *av;

    kvec_t(uint32_t) u_vecs;
    kv_init(u_vecs);
    if(r && rm && rn) kv_reuse(u_vecs, 0, (*rm), (*r));
    
    memset(visit, 0, nsg->n_seq);
    kdq_t(uint32_t) *buf;
    buf = kdq_init(uint32_t);

    uint32_t vEnd, threshold, num_reads = 0, i, k, v, end = (uint32_t)-1, in = 0, vELen, tmp;
    long long nodeLen, baseLen, max_stop_nodeLen, max_stop_baseLen;

    bb->b.n = 0;
    if(get_unitig(nsg, ug, vBeg, &vEnd, &nodeLen, &baseLen, 
                                        &max_stop_nodeLen, &max_stop_baseLen, 1, bb)==LOOP)
    {
        ///the length of LOO is infinite
        kdq_destroy(uint32_t, buf); 
        return 0;
    }
    vBeg_end = vEnd;
    threshold = nodeLen;
    for (i = 0; i < bb->b.n; i++)
    {
        Set_vis(visit, bb->b.a[i], ignore_d);
        Set_vis(visit, bb->b.a[i]^1, ignore_d);
    }    
    v = vBeg;

    kdq_push(uint32_t, buf, v);
    while (kdq_size(buf) != 0)
    {
        in++;
        v = *(kdq_pop(uint32_t, buf));

        ///in == 1 means the start node, it is useless
        if(in != 1)
        {
            ///get current untig length
            bb->b.n = 0;
            if(get_unitig(nsg, ug, v, &vEnd, &nodeLen, &baseLen, 
                                        &max_stop_nodeLen, &max_stop_baseLen, 1, bb)==LOOP)
            {
                kdq_destroy(uint32_t, buf);
                return 0;
            }
            vELen = nodeLen;

            ///first long unitig except the start node
            if(if_long_tip_length(nsg, ug, v, &vELen, 
                    minLongUntig, maxShortUntig, l_untig_rate_threshold, threshold)==1)
            {
                if(end == (uint32_t)-1)
                {
                    end = v;
                    continue;
                }
                else
                {
                    in = (uint32_t)-1;
                    break;
                }
            }

            if(vELen > (threshold * single_threshold))
            {
                in = (uint32_t)-1;
                break;
            }

            num_reads = num_reads + vELen;
            if(num_reads > threshold)
            {
                in = (uint32_t)-1;
                break;
            }

            if(r && rm && rn)
            {
                for (i = 0; i < bb->b.n; i++)
                {
                    kv_push(uint32_t, u_vecs, bb->b.a[i]);
                }   
            } 
        }

        tmp = v^1;
        v = vEnd;
        nv = asg_arc_n(nsg, v);
        av = asg_arc_a(nsg, v);
        for(k = 0; k < nv; k++)
        {
            if(av[k].del) continue;

            if(av[k].v == vBeg)
            {
                in = (uint32_t)-1;
                goto termi;
            }
            
            if(Get_vis(visit,av[k].v,ignore_d)==0)
            {
                kdq_push(uint32_t, buf, av[k].v);

                bb->b.n = 0;
                get_unitig(nsg, ug, av[k].v, &vEnd, &nodeLen, &baseLen, 
                                        &max_stop_nodeLen, &max_stop_baseLen, 1, bb);

                for (i = 0; i < bb->b.n; i++)
                {
                    Set_vis(visit, bb->b.a[i], ignore_d);
                }
            }
        }

        ///for start node, we just need one direction
        if(in != 1 && ignore_d)
        {
            v = tmp;
            nv = asg_arc_n(nsg, v);
            av = asg_arc_a(nsg, v);
            for(k = 0; k < nv; k++)
            {
                if(av[k].del) continue;

                if(av[k].v == vBeg)
                {
                    in = (uint32_t)-1;
                    goto termi;
                }

                if(Get_vis(visit,av[k].v,ignore_d)==0)
                {
                    kdq_push(uint32_t, buf, av[k].v);

                    bb->b.n = 0;
                    get_unitig(nsg, ug, av[k].v, &vEnd, &nodeLen, &baseLen, 
                                        &max_stop_nodeLen, &max_stop_baseLen, 1, bb);


                    for (i = 0; i < bb->b.n; i++)
                    {
                        Set_vis(visit, bb->b.a[i], ignore_d);
                    }
                }
            }
        }
    }

    termi:
    kdq_destroy(uint32_t, buf);
    if(r && rm && rn)
    {
        (*rn) = u_vecs.n;
        (*rm) = u_vecs.m;
        (*r) = u_vecs.a;
    }


    (*r_ID) = end;
    ///in == 1 means the end subgraph is the long untig itself
    ///so here is no tangles
    if(in == (uint32_t)-1 || in == 1)
    {
        return 0;
    }
    else
    {
        if(r && rm && rn) return double_check_tangle(vBeg_end, (*r_ID), u_vecs.a, u_vecs.n, nsg);

        return 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r9, %r12
movl %r8d, 0x14(%rsp)
movq %rcx, 0xb0(%rsp)
movq %rdx, 0xa8(%rsp)
movss %xmm1, 0x18(%rsp)
movss %xmm0, 0x1c(%rsp)
movl %esi, 0x24(%rsp)
movq %rdi, %rbp
movq 0x118(%rsp), %rax
movq 0x108(%rsp), %rdi
movq 0xf8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
testq %rdx, %rdx
setne %al
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpq $0x0, 0x100(%rsp)
setne %r15b
andb %cl, %r15b
xorl %ecx, %ecx
movl $0x0, %eax
movq %rax, 0x40(%rsp)
cmpb $0x1, %r15b
jne 0xe9cd8
movq (%rsi), %rax
movq %rax, 0x40(%rsp)
movq (%rdx), %rcx
movq %rcx, 0x38(%rsp)
movl 0x14(%rbp), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x20e0
movl $0x1, %edi
movl $0x20, %esi
callq 0x2120
movq %rax, %r13
movabsq $0x800000000000000, %rax # imm = 0x800000000000000
movq %rax, (%r13)
movq $0x3, 0x10(%r13)
movl $0x10, %edi
callq 0x2280
movq %rax, %rbx
movq %rax, 0x18(%r13)
movq $0x0, 0x38(%r12)
leaq 0x78(%rsp), %rax
leaq 0x80(%rsp), %r10
leaq 0x20(%rsp), %rcx
leaq 0x50(%rsp), %r8
leaq 0x88(%rsp), %r9
movq %rbp, %rdi
movq 0x110(%rsp), %rsi
movl 0x24(%rsp), %edx
pushq %r12
pushq $0x1
pushq %rax
pushq %r10
callq 0x1053a7
addq $0x20, %rsp
cmpl $0x7, %eax
jne 0xe9d8a
movq %rbx, %rdi
callq 0x2220
movq %r13, %rdi
callq 0x2220
jmp 0xea6d6
movq %r13, 0x8(%rsp)
movb %r15b, 0x7(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0xa0(%rsp)
movl %eax, %eax
cmpq $0x0, 0x38(%r12)
movl 0x14(%rsp), %ecx
movq 0x108(%rsp), %r9
je 0xe9dff
movl $0x1, %edx
xorl %esi, %esi
movq 0x48(%r12), %rdi
movl (%rdi,%rsi,4), %edi
movl %edi, %r8d
shll %cl, %r8d
shrl %edi
andb $0x1, %r8b
incb %r8b
orb %r8b, (%r9,%rdi)
movq 0x48(%r12), %rdi
movl (%rdi,%rsi,4), %esi
movl %esi, %edi
notl %edi
shll %cl, %edi
shrl %esi
andb $0x1, %dil
incb %dil
orb %dil, (%r9,%rsi)
movl %edx, %esi
incl %edx
cmpq %rsi, 0x38(%r12)
ja 0xe9dbe
leaq 0x20(%rsp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x90(%rsp)
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
movl 0x24(%rsp), %ecx
movl %ecx, (%rbx)
cvtsi2ss %rax, %xmm0
mulss 0x18(%rsp), %xmm0
movss %xmm0, 0x5c(%rsp)
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
mulss 0x1c(%rsp), %xmm0
movss %xmm0, 0x94(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl $0x1, %r15d
movl $0x0, 0x58(%rsp)
xorl %esi, %esi
movq 0x8(%rsp), %rdi
movq %rax, 0x60(%rsp)
movl %esi, %ebx
leaq -0x1(%r15), %r13
leal 0x1(%rbx), %esi
movl %ecx, %eax
movl %eax, 0x1c(%rsp)
cmpq $-0x1, %r13
je 0xea630
movq 0x18(%rdi), %r14
movq (%rdi), %rax
andq %rdx, %rax
addq %r13, %rax
andq 0x10(%rdi), %rax
movl (%r14,%rax,4), %edx
cmpl $0x1, %esi
movl %esi, 0x18(%rsp)
movq %rdx, 0x68(%rsp)
je 0xea02a
movq $0x0, 0x38(%r12)
movq %rbp, %rdi
movq 0x110(%rsp), %rsi
leaq 0x20(%rsp), %rcx
leaq 0x50(%rsp), %r8
leaq 0x88(%rsp), %r9
pushq %r12
pushq $0x1
leaq 0x88(%rsp), %rax
pushq %rax
leaq 0x98(%rsp), %rax
pushq %rax
callq 0x1053a7
addq $0x20, %rsp
cmpl $0x7, %eax
je 0xea6c1
movq 0x50(%rsp), %rax
movl %eax, %ecx
testl %eax, %eax
movq 0x108(%rsp), %r9
movq 0x60(%rsp), %rdx
je 0xe9f67
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
movss 0x5c(%rsp), %xmm1
ucomiss %xmm0, %xmm1
ja 0xe9f67
cmpq 0xb0(%rsp), %rcx
jge 0xe9f3a
cmpq 0xa8(%rsp), %rcx
jl 0xe9f67
ucomiss 0x5c(%rsp), %xmm0
jb 0xe9f67
decq %r13
movl 0x18(%rsp), %esi
incl %esi
cmpl $-0x1, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
movq 0x68(%rsp), %rax
je 0xe9e71
jmp 0xea629
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
movq 0x8(%rsp), %rdi
movq %r13, 0x8(%rdi)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
ucomiss 0x94(%rsp), %xmm0
ja 0xea633
movl 0x58(%rsp), %ecx
addl %eax, %ecx
cmpl 0xa0(%rsp), %ecx
movb 0x7(%rsp), %r15b
movq 0x38(%rsp), %r13
ja 0xea63d
testb %r15b, %r15b
movl %ecx, 0x58(%rsp)
je 0xea02e
movq 0x38(%r12), %rax
testq %rax, %rax
movq 0x40(%rsp), %r14
movl 0x14(%rsp), %r15d
je 0xea038
xorl %ebx, %ebx
cmpq %r14, %rdx
jne 0xea007
leaq (%rdx,%rdx), %r14
testq %rdx, %rdx
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,4), %rsi
movq %r13, %rdi
movq %rdx, %r13
callq 0x2370
movq %r13, %rdx
movq 0x108(%rsp), %r9
movq 0x8(%rsp), %rdi
movq %rax, %r13
movq 0x38(%r12), %rax
movq 0x48(%r12), %rcx
movl (%rcx,%rbx,4), %ecx
movl %ecx, (%r13,%rdx,4)
incq %rdx
incl %ebx
cmpq %rbx, %rax
ja 0xe9fc7
movq %rdx, 0x60(%rsp)
movq %r13, 0x38(%rsp)
jmp 0xea038
movq %r13, 0x8(%rdi)
movq 0x40(%rsp), %r14
movl 0x14(%rsp), %r15d
movq %r14, 0x40(%rsp)
movl 0x20(%rsp), %eax
movq 0x28(%rbp), %rcx
movq (%rcx,%rax,8), %rax
testl %eax, %eax
je 0xea31a
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %r14
shlq $0x3, %r14
addq 0x8(%rbp), %r14
movl %eax, %r8d
xorl %r13d, %r13d
movq %r8, 0x48(%rsp)
movq %rbp, 0x70(%rsp)
movq %r14, 0x98(%rsp)
leaq (,%r13,2), %rax
addq %r13, %rax
cmpl $0x0, 0xc(%r14,%rax,8)
js 0xea2e2
leaq (%r14,%rax,8), %rsi
movl 0x8(%rsi), %ebx
cmpl 0x24(%rsp), %ebx
je 0xea629
movl %ebx, %eax
shrl %eax
movl %ebx, %edx
movl %r15d, %ecx
shll %cl, %edx
movzbl (%r9,%rax), %eax
andl $0x1, %edx
incl %edx
testl %eax, %edx
jne 0xea2e2
movq (%rdi), %r15
movq 0x8(%rdi), %rbp
movq %r15, %rax
shrq $0x3a, %rax
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
cmpq %rdx, %rbp
jne 0xea12d
leal 0x1(%rax), %r14d
movl $0x1, %edx
movl %r14d, %ecx
shlq %cl, %rdx
cmpq %rbp, %rdx
movq %rsi, 0x28(%rsp)
jae 0xea13c
movq $-0x1, %r14
incq %r14
movq %rbp, %rdx
movl %r14d, %ecx
shrq %cl, %rdx
cmpq $0x3f, %r14
ja 0xea115
testq %rdx, %rdx
jne 0xea0fe
cmpq %r14, %rax
jne 0xea2f0
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
jmp 0xea226
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
jmp 0xea22e
movq %rdx, 0x30(%rsp)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
movl %r14d, %ecx
shlq %cl, %rsi
callq 0x2370
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rdi)
movabsq $0x3ffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFF
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %r8
movq %r15, %r9
andq %rax, %r9
leaq (%r9,%rbp), %rdx
cmpq %rbp, %rdx
jbe 0xea1d0
movq 0x18(%rdi), %rax
movq %rbp, %rdx
subq %r9, %rdx
movq %r8, %rcx
subq %rdx, %rcx
leaq (%rax,%rcx,4), %rdi
leaq (%rax,%r9,4), %rsi
shlq $0x2, %rdx
movq %r8, 0x30(%rsp)
callq 0x2360
movq 0x28(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %r9
subq %rbp, %r9
addq %r15, %r9
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
andq %rdx, %r9
jmp 0xea205
subq %r8, %rdx
jbe 0xea1fb
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
leaq (%rdi,%r8,4), %rsi
shlq $0x2, %rdx
movq %r9, %r15
callq 0x2360
movq %r15, %r9
movq 0x28(%rsp), %rsi
movq 0x8(%rsp), %rdi
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
movq %r14, %r15
shlq $0x3a, %r15
movq $-0x1, %rax
movl %r14d, %ecx
shlq %cl, %rax
orq %r9, %r15
movq %r15, (%rdi)
notq %rax
movq %rax, 0x10(%rdi)
movq 0x98(%rsp), %r14
movq 0x18(%rdi), %rax
leaq 0x1(%rbp), %rcx
movq %rcx, 0x8(%rdi)
andq %rdx, %r15
addq %rbp, %r15
andq 0x10(%rdi), %r15
movl %ebx, (%rax,%r15,4)
movq $0x0, 0x38(%r12)
movl 0x8(%rsi), %edx
movq 0x70(%rsp), %rbp
movq %rbp, %rdi
movq 0x110(%rsp), %rsi
leaq 0x20(%rsp), %rcx
leaq 0x50(%rsp), %r8
leaq 0x88(%rsp), %r9
pushq %r12
pushq $0x1
leaq 0x88(%rsp), %rax
pushq %rax
leaq 0x98(%rsp), %rax
pushq %rax
callq 0x1053a7
movq 0x28(%rsp), %rdi
addq $0x20, %rsp
cmpq $0x0, 0x38(%r12)
movl 0x14(%rsp), %r15d
movq 0x108(%rsp), %r9
movq 0x48(%rsp), %r8
je 0xea2e2
movl $0x1, %eax
xorl %ecx, %ecx
movq 0x48(%r12), %rdx
movl (%rdx,%rcx,4), %edx
movl %edx, %esi
movl %r15d, %ecx
shll %cl, %esi
shrl %edx
andb $0x1, %sil
incb %sil
orb %sil, (%r9,%rdx)
movl %eax, %ecx
incl %eax
cmpq %rcx, 0x38(%r12)
ja 0xea2bb
incq %r13
cmpq %r8, %r13
jne 0xea07c
jmp 0xea31a
movl $0x1, %r8d
movl %r14d, %ecx
shlq %cl, %r8
cmpq %rax, %r14
jbe 0xea30b
movq %r8, 0x30(%rsp)
jmp 0xea141
movabsq $0x3ffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFF
jmp 0xea177
cmpl $0x1, 0x18(%rsp)
sete %al
testl %r15d, %r15d
sete %cl
orb %al, %cl
jne 0xea609
movq 0x68(%rsp), %rcx
xorq $0x1, %rcx
movq 0x28(%rbp), %rax
movq (%rax,%rcx,8), %rax
testl %eax, %eax
je 0xea609
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rbx
shlq $0x3, %rbx
addq 0x8(%rbp), %rbx
movl %eax, %r8d
xorl %r13d, %r13d
movq %r8, 0x68(%rsp)
movq %rbp, 0x70(%rsp)
movq %rbx, 0x30(%rsp)
leaq (,%r13,2), %rax
addq %r13, %rax
cmpl $0x0, 0xc(%rbx,%rax,8)
js 0xea5d2
leaq (%rbx,%rax,8), %rsi
movl 0x8(%rsi), %r14d
cmpl 0x24(%rsp), %r14d
je 0xea629
movl %r14d, %eax
shrl %eax
movl %r14d, %edx
movl %r15d, %ecx
shll %cl, %edx
movzbl (%r9,%rax), %eax
andl $0x1, %edx
incl %edx
testl %eax, %edx
jne 0xea5d2
movq (%rdi), %r15
movq 0x8(%rdi), %rbp
movq %r15, %rax
shrq $0x3a, %rax
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
cmpq %rdx, %rbp
jne 0xea422
leal 0x1(%rax), %ebx
movl $0x1, %edx
movl %ebx, %ecx
shlq %cl, %rdx
cmpq %rbp, %rdx
movq %rsi, 0x48(%rsp)
jae 0xea431
movq $-0x1, %rbx
incq %rbx
movq %rbp, %rdx
movl %ebx, %ecx
shrq %cl, %rdx
cmpq $0x3f, %rbx
ja 0xea40a
testq %rdx, %rdx
jne 0xea3f4
cmpq %rbx, %rax
jne 0xea5e0
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
jmp 0xea519
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
jmp 0xea51e
movq %rdx, 0x28(%rsp)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
movl %ebx, %ecx
shlq %cl, %rsi
callq 0x2370
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rdi)
movabsq $0x3ffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFF
movq 0x48(%rsp), %rsi
movq 0x28(%rsp), %r8
movq %r15, %r9
andq %rax, %r9
leaq (%r9,%rbp), %rdx
cmpq %rbp, %rdx
jbe 0xea4c4
movq 0x18(%rdi), %rax
movq %rbp, %rdx
subq %r9, %rdx
movq %r8, %rcx
subq %rdx, %rcx
leaq (%rax,%rcx,4), %rdi
leaq (%rax,%r9,4), %rsi
shlq $0x2, %rdx
movq %r8, 0x28(%rsp)
callq 0x2360
movq 0x48(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %r9
subq %rbp, %r9
addq %r15, %r9
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
andq %rdx, %r9
jmp 0xea4f9
subq %r8, %rdx
jbe 0xea4ef
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
leaq (%rdi,%r8,4), %rsi
shlq $0x2, %rdx
movq %r9, %r15
callq 0x2360
movq %r15, %r9
movq 0x48(%rsp), %rsi
movq 0x8(%rsp), %rdi
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
movq %rbx, %r15
shlq $0x3a, %r15
movq $-0x1, %rax
movl %ebx, %ecx
shlq %cl, %rax
orq %r9, %r15
movq %r15, (%rdi)
notq %rax
movq %rax, 0x10(%rdi)
movq 0x30(%rsp), %rbx
movq 0x18(%rdi), %rax
leaq 0x1(%rbp), %rcx
movq %rcx, 0x8(%rdi)
andq %rdx, %r15
addq %rbp, %r15
andq 0x10(%rdi), %r15
movl %r14d, (%rax,%r15,4)
movq $0x0, 0x38(%r12)
movl 0x8(%rsi), %edx
movq 0x70(%rsp), %rbp
movq %rbp, %rdi
movq 0x110(%rsp), %rsi
leaq 0x20(%rsp), %rcx
leaq 0x50(%rsp), %r8
leaq 0x88(%rsp), %r9
pushq %r12
pushq $0x1
leaq 0x88(%rsp), %rax
pushq %rax
leaq 0x98(%rsp), %rax
pushq %rax
callq 0x1053a7
movq 0x28(%rsp), %rdi
addq $0x20, %rsp
cmpq $0x0, 0x38(%r12)
movl 0x14(%rsp), %r15d
movq 0x108(%rsp), %r9
movq 0x68(%rsp), %r8
je 0xea5d2
movl $0x1, %eax
xorl %ecx, %ecx
movq 0x48(%r12), %rdx
movl (%rdx,%rcx,4), %edx
movl %edx, %esi
movl %r15d, %ecx
shll %cl, %esi
shrl %edx
andb $0x1, %sil
incb %sil
orb %sil, (%r9,%rdx)
movl %eax, %ecx
incl %eax
cmpq %rcx, 0x38(%r12)
ja 0xea5ab
incq %r13
cmpq %r8, %r13
jne 0xea371
jmp 0xea609
movl $0x1, %r8d
movl %ebx, %ecx
shlq %cl, %r8
cmpq %rax, %rbx
jbe 0xea5fa
movq %r8, 0x28(%rsp)
jmp 0xea436
movabsq $0x3ffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFF
jmp 0xea46b
movq 0x8(%rdi), %r15
movq 0x60(%rsp), %rax
movl 0x1c(%rsp), %ecx
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
movl 0x18(%rsp), %esi
jmp 0xe9e61
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xea633
addl %r15d, %ebx
movb 0x7(%rsp), %r15b
movq 0x38(%rsp), %r13
movq %rdi, %r14
movq 0x18(%rdi), %rdi
callq 0x2220
movq %r14, %rdi
callq 0x2220
testb %r15b, %r15b
movq 0x60(%rsp), %rdx
je 0xea681
movq 0x100(%rsp), %rax
movq %rdx, (%rax)
movq 0xf8(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rcx, (%rax)
movq 0xf0(%rsp), %rax
movq %r13, (%rax)
movq 0x118(%rsp), %rax
movl 0x1c(%rsp), %esi
movl %esi, (%rax)
xorl %r14d, %r14d
cmpl $-0x1, %ebx
je 0xea6d6
cmpl $0x1, %ebx
je 0xea6d6
movl $0x1, %r14d
testb %r15b, %r15b
je 0xea6d6
movl 0x90(%rsp), %edi
movq %rdx, %rcx
movq %r13, %rdx
movq %rbp, %r8
callq 0xe9a11
movl %eax, %r14d
jmp 0xea6d6
movq %r14, %rdi
callq 0x2220
movq 0x8(%rsp), %rdi
callq 0x2220
xorl %r14d, %r14d
movl %r14d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq