// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: clean_sub_tangle(bubble_type*, unsigned char*, kvec_t_u32_warp*, unsigned char*, unsigned char*, kvec_asg_arc_t_warp*, unsigned int, unsigned int, unsigned int)
void clean_sub_tangle(bubble_type* bub, uint8_t* vis_flag, kvec_t_u32_warp *res_utg, 
uint8_t *dedup, uint8_t *is_tangle, kvec_asg_arc_t_warp* edges, uint32_t flag, uint32_t s, 
uint32_t e)
{
    uint32_t i, k_i, pv, v, occ, beg, sink, p_beg, p_sink, n, *a = NULL;
    ma_utg_t *u = NULL;

    for (i = 0, pv = (uint32_t)-1; i < res_utg->a.n; i++)
    {
        if(is_tangle[res_utg->a.a[i]>>1] == 1)
        {
            if(pv == (uint32_t)-1)
            {
                pv = res_utg->a.a[i]>>1;
            }
            else if(pv != (res_utg->a.a[i]>>1))
            {
                pv = (uint32_t)-1;
                break;
            }
        }
        else if(is_tangle[res_utg->a.a[i]>>1] == (uint8_t)-1)
        {
            pv = (uint32_t)-1;
            break;
        }
    }

    if(pv == (uint32_t)-1)
    {
        for (i = 0; i < res_utg->a.n; i++)
        {
            is_tangle[res_utg->a.a[i]>>1] = (uint8_t)-1;
        }
        return;
    } 

    occ = 0;
    u = &(bub->b_ug->u.a[s]);
    for (i = 0, p_beg = p_sink = (uint32_t)-1; i < u->n; i++)
    {
        get_bubbles(bub, u->a[i]>>33, &beg, &sink, &a, &n, NULL);

        for (k_i = 0; k_i < n; k_i++)
        {
            occ += bub->ug->u.a[a[k_i]>>1].n;
        }
        if(beg != (uint32_t)-1 && (beg>>1) != (p_beg>>1) && (beg>>1) != (p_sink>>1))
        {
            occ += bub->ug->u.a[beg>>1].n; 
        } 
        if(sink != (uint32_t)-1 && (sink>>1) != (p_beg>>1) && (sink>>1) != (p_sink>>1))
        {
            occ += bub->ug->u.a[sink>>1].n; 
        } 
        p_beg = beg; p_sink = sink;
    }

    u = &(bub->b_ug->u.a[e]);
    for (i = 0, p_beg = p_sink = (uint32_t)-1; i < u->n; i++)
    {
        get_bubbles(bub, u->a[i]>>33, &beg, &sink, &a, &n, NULL);

        for (k_i = 0; k_i < n; k_i++)
        {
            occ += bub->ug->u.a[a[k_i]>>1].n;
        }
        if(beg != (uint32_t)-1 && (beg>>1) != (p_beg>>1) && (beg>>1) != (p_sink>>1))
        {
            occ += bub->ug->u.a[beg>>1].n; 
        } 
        if(sink != (uint32_t)-1 && (sink>>1) != (p_beg>>1) && (sink>>1) != (p_sink>>1))
        {
            occ += bub->ug->u.a[sink>>1].n; 
        } 
        p_beg = beg; p_sink = sink;
    }

    if(occ <= bub->ug->u.a[pv].n*200)
    {
        for (i = 0; i < res_utg->a.n; i++)
        {
            is_tangle[res_utg->a.a[i]>>1] = (uint8_t)-1;
        }
        return;
    }

    if(!edges) return;

    u = &(bub->b_ug->u.a[s]);
    for (i = 0; i < u->n; i++)
    {
        get_bubbles(bub, u->a[i]>>33, &beg, &sink, &a, &n, NULL);

        for (k_i = 0; k_i < n; k_i++)
        {
            vis_flag[a[k_i]>>1] ^= flag;
        }
        if(beg != (uint32_t)-1)
        {
            vis_flag[beg>>1] ^= flag;
        } 
        if(sink != (uint32_t)-1)
        {
            vis_flag[sink>>1] ^= flag;
        } 
    }
    u = &(bub->b_ug->u.a[e]);
    for (i = 0; i < u->n; i++)
    {
        get_bubbles(bub, u->a[i]>>33, &beg, &sink, &a, &n, NULL);

        for (k_i = 0; k_i < n; k_i++)
        {
            vis_flag[a[k_i]>>1] ^= flag;
        }
        if(beg != (uint32_t)-1)
        {
            vis_flag[beg>>1] ^= flag;
        } 
        if(sink != (uint32_t)-1)
        {
            vis_flag[sink>>1] ^= flag;
        } 
    }
    for (i = 0; i < res_utg->a.n; i++)
    {
        if(dedup[res_utg->a.a[i]>>1] == 3)
        {
            vis_flag[res_utg->a.a[i]>>1] ^= flag;
        }
    }



    asg_arc_t *av = NULL, *p = NULL;
    uint32_t nv, c[2];

    c[0] = c[1] = 0;
    while (1)
    {
        c[0] = c[1] = 0; p = NULL;
        v = pv<<1;
        av = asg_arc_a(bub->ug->g, v);
        nv = asg_arc_n(bub->ug->g, v);
        for (i = 0; i < nv; i++)
        {
            if(av[i].del) continue;
            c[(!!(vis_flag[av[i].v>>1]&flag))]++;
            if(p == NULL || p->ol > av[i].ol)
            {
                p = &(av[i]);
            }
        }
        



        v = (pv<<1) + 1;
        av = asg_arc_a(bub->ug->g, v);
        nv = asg_arc_n(bub->ug->g, v);
        for (i = 0; i < nv; i++)
        {
            if(av[i].del) continue;
            c[(!!(vis_flag[av[i].v>>1]&flag))]++;
            if(p == NULL || p->ol > av[i].ol)
            {
                p = &(av[i]);
            }
        }

        if(p)
        {
            p->del = 1;
            c[(!!(vis_flag[p->v>>1]&flag))]--;
            if((p->v>>1) == pv)
            {
                asg_arc_del(bub->ug->g, (p->v)^1, (p->ul>>32)^1, 1);
                c[0] = c[1] = 0;
                v = pv<<1;
                av = asg_arc_a(bub->ug->g, v);
                nv = asg_arc_n(bub->ug->g, v);
                for (i = 0; i < nv; i++)
                {
                    if(av[i].del) continue;
                    c[(!!(vis_flag[av[i].v>>1]&flag))]++;
                }

                v = (pv<<1) + 1;
                av = asg_arc_a(bub->ug->g, v);
                nv = asg_arc_n(bub->ug->g, v);
                for (i = 0; i < nv; i++)
                {
                    if(av[i].del) continue;
                    c[(!!(vis_flag[av[i].v>>1]&flag))]++;
                }
            }

            
        }
        if(c[0] == 0 || c[1] == 0) break;
    }
    


    
    v = pv<<1;
    av = asg_arc_a(bub->ug->g, v);
    nv = asg_arc_n(bub->ug->g, v);
    for (i = 0; i < nv; i++)
    {
        if(!av[i].del) continue;
        av[i].del = 0;
        kv_push(asg_arc_t, edges->a, av[i]);
    }
    

    v = (pv<<1) + 1;
    av = asg_arc_a(bub->ug->g, v);
    nv = asg_arc_n(bub->ug->g, v);
    for (i = 0; i < nv; i++)
    {
        if(!av[i].del) continue;
        av[i].del = 0;
        kv_push(asg_arc_t, edges->a, av[i]);
    }

    is_tangle[pv] = (uint8_t)-1;


    u = &(bub->b_ug->u.a[s]);
    for (i = 0; i < u->n; i++)
    {
        get_bubbles(bub, u->a[i]>>33, &beg, &sink, &a, &n, NULL);

        for (k_i = 0; k_i < n; k_i++)
        {
            vis_flag[a[k_i]>>1] ^= flag;
        }
        if(beg != (uint32_t)-1)
        {
            vis_flag[beg>>1] ^= flag;
        } 
        if(sink != (uint32_t)-1)
        {
            vis_flag[sink>>1] ^= flag;
        } 
    }
    u = &(bub->b_ug->u.a[e]);
    for (i = 0; i < u->n; i++)
    {
        get_bubbles(bub, u->a[i]>>33, &beg, &sink, &a, &n, NULL);

        for (k_i = 0; k_i < n; k_i++)
        {
            vis_flag[a[k_i]>>1] ^= flag;
        }
        if(beg != (uint32_t)-1)
        {
            vis_flag[beg>>1] ^= flag;
        } 
        if(sink != (uint32_t)-1)
        {
            vis_flag[sink>>1] ^= flag;
        } 
    }
    for (i = 0; i < res_utg->a.n; i++)
    {
        if(dedup[res_utg->a.a[i]>>1] == 3)
        {
            vis_flag[res_utg->a.a[i]>>1] ^= flag;
        }
    }


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x8(%rsp)
movq %rcx, 0x40(%rsp)
movq %rsi, %r15
movq %rdi, %r13
movq (%rdx), %rax
testq %rax, %rax
movq %rdx, 0x18(%rsp)
je 0x152b66
movq 0x10(%rdx), %rcx
movl $0x1, %edx
xorl %esi, %esi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl (%rcx,%rsi,4), %esi
shrl %esi
movzbl (%r8,%rsi), %edi
cmpl $0x1, %edi
je 0x152b4b
cmpl $0xff, %edi
jne 0x152b5b
jmp 0x152b66
cmpl $-0x1, %r9d
je 0x152b58
cmpl %esi, %r9d
je 0x152b5b
jmp 0x152b66
movl %esi, %r9d
movl %edx, %esi
incl %edx
cmpq %rsi, %rax
ja 0x152b32
jmp 0x152b6c
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
cmpl $-0x1, %r9d
je 0x152c98
movq %r9, 0x30(%rsp)
movq %r8, 0x38(%rsp)
movq 0xc0(%r13), %rax
movq 0x10(%rax), %rcx
movl 0x98(%rsp), %eax
leaq (%rax,%rax,4), %rax
movq %rax, 0x50(%rsp)
movq %rcx, 0x28(%rsp)
leaq (%rcx,%rax,8), %rax
movl 0x10(%rax), %r8d
testq %r8, %r8
movq %r13, 0x10(%rsp)
movq %rax, 0x48(%rsp)
je 0x152cca
movq 0x18(%rax), %r9
movq 0x28(%r13), %r10
movq 0x40(%r13), %r11
xorl %r14d, %r14d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl %esi, %edi
movl %eax, %ebp
movq (%r9,%r14,8), %rcx
shrq $0x21, %rcx
movl (%r11,%rcx,4), %eax
movl 0x4(%r11,%rcx,4), %ecx
subl %eax, %ecx
addl $-0x2, %ecx
je 0x152c1c
leaq (%r10,%rax,4), %rsi
movq 0x10(%r13), %rbx
movq 0x10(%rbx), %rbx
movl %ecx, %r13d
xorl %ecx, %ecx
movl 0x8(%rsi,%rcx,4), %r12d
shrl %r12d
leaq (%r12,%r12,4), %r12
addl 0x10(%rbx,%r12,8), %edx
incq %rcx
cmpq %rcx, %r13
jne 0x152c03
movl (%r10,%rax,4), %esi
cmpl $-0x1, %esi
je 0x152c50
movl %esi, %ecx
shrl %ecx
movl %edi, %ebx
shrl %ebx
cmpl %ebx, %ecx
movq 0x10(%rsp), %r13
je 0x152c55
movl %ebp, %ebx
shrl %ebx
cmpl %ebx, %ecx
je 0x152c55
movq 0x10(%r13), %rbx
movq 0x10(%rbx), %rbx
leaq (%rcx,%rcx,4), %rcx
addl 0x10(%rbx,%rcx,8), %edx
jmp 0x152c55
movq 0x10(%rsp), %r13
incl %eax
movl (%r10,%rax,4), %eax
cmpl $-0x1, %eax
je 0x152c8a
movl %eax, %ecx
shrl %ecx
shrl %edi
cmpl %edi, %ecx
sete %dil
shrl %ebp
cmpl %ebp, %ecx
sete %bl
orb %dil, %bl
jne 0x152c8a
movl %ecx, %ecx
movq 0x10(%r13), %rdi
movq 0x10(%rdi), %rdi
leaq (%rcx,%rcx,4), %rcx
addl 0x10(%rdi,%rcx,8), %edx
incq %r14
cmpq %r8, %r14
jne 0x152bd6
jmp 0x152ccc
movq 0x18(%rsp), %rsi
cmpq $0x0, (%rsi)
je 0x1534b5
movl $0x1, %eax
xorl %ecx, %ecx
movq 0x10(%rsi), %rdx
movl (%rdx,%rcx,4), %ecx
shrl %ecx
movb $-0x1, (%r8,%rcx)
movl %eax, %ecx
incl %eax
cmpq %rcx, (%rsi)
ja 0x152cae
jmp 0x1534b5
xorl %edx, %edx
movl 0xa0(%rsp), %eax
leaq (%rax,%rax,4), %rax
movq 0x28(%rsp), %rcx
movl 0x10(%rcx,%rax,8), %edi
testq %rdi, %rdi
movq %rax, 0x20(%rsp)
je 0x152dd4
leaq (%rcx,%rax,8), %rax
movq 0x18(%rax), %rsi
movq 0x28(%r13), %r8
movq 0x40(%r13), %r9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %r10d, %r10d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %ebp
movl %eax, %r11d
movq (%rsi,%r10,8), %rcx
shrq $0x21, %rcx
movl (%r9,%rcx,4), %eax
movl 0x4(%r9,%rcx,4), %ecx
subl %eax, %ecx
addl $-0x2, %ecx
je 0x152d54
leaq (%r8,%rax,4), %rbx
movq 0x10(%r13), %r14
movq 0x10(%r14), %r14
movl %ecx, %r13d
xorl %ecx, %ecx
movl 0x8(%rbx,%rcx,4), %r12d
shrl %r12d
leaq (%r12,%r12,4), %r12
addl 0x10(%r14,%r12,8), %edx
incq %rcx
cmpq %rcx, %r13
jne 0x152d3b
movl (%r8,%rax,4), %r14d
cmpl $-0x1, %r14d
je 0x152d8b
movl %r14d, %ecx
shrl %ecx
movl %ebp, %ebx
shrl %ebx
cmpl %ebx, %ecx
movq 0x10(%rsp), %r13
je 0x152d90
movl %r11d, %ebx
shrl %ebx
cmpl %ebx, %ecx
je 0x152d90
movq 0x10(%r13), %rbx
movq 0x10(%rbx), %rbx
leaq (%rcx,%rcx,4), %rcx
addl 0x10(%rbx,%rcx,8), %edx
jmp 0x152d90
movq 0x10(%rsp), %r13
incl %eax
movl (%r8,%rax,4), %eax
cmpl $-0x1, %eax
je 0x152dc8
movl %eax, %ecx
shrl %ecx
shrl %ebp
cmpl %ebp, %ecx
sete %bl
shrl %r11d
cmpl %r11d, %ecx
sete %r11b
orb %bl, %r11b
jne 0x152dc8
movl %ecx, %ecx
movq 0x10(%r13), %r11
movq 0x10(%r11), %r11
leaq (%rcx,%rcx,4), %rcx
addl 0x10(%r11,%rcx,8), %edx
incq %r10
cmpq %rdi, %r10
jne 0x152d0c
movq 0x10(%r13), %rax
movq 0x10(%rax), %rax
movl 0x30(%rsp), %r11d
leaq (%r11,%r11,4), %rcx
imull $0xc8, 0x10(%rax,%rcx,8), %eax
cmpl %eax, %edx
jbe 0x153488
cmpq $0x0, 0x8(%rsp)
je 0x1534b5
movl 0x90(%rsp), %r14d
movq 0x48(%rsp), %r10
cmpl $0x0, 0x10(%r10)
je 0x152e85
xorl %eax, %eax
movq 0x18(%r10), %rcx
movq (%rcx,%rax,8), %rdx
movq 0x28(%r13), %rdi
movq 0x40(%r13), %rsi
shrq $0x21, %rdx
movl (%rsi,%rdx,4), %ecx
movl 0x4(%rsi,%rdx,4), %r8d
subl %ecx, %r8d
leal 0x1(%rcx), %edx
movl (%rdi,%rcx,4), %esi
movl (%rdi,%rdx,4), %edx
addl $-0x2, %r8d
je 0x152e63
leaq (%rdi,%rcx,4), %rcx
movl %r8d, %edi
xorl %r8d, %r8d
movl 0x8(%rcx,%r8,4), %r9d
shrl %r9d
xorb %r14b, (%r15,%r9)
incq %r8
cmpq %r8, %rdi
jne 0x152e4f
cmpl $-0x1, %esi
je 0x152e6e
shrl %esi
xorb %r14b, (%r15,%rsi)
cmpl $-0x1, %edx
je 0x152e79
shrl %edx
xorb %r14b, (%r15,%rdx)
incq %rax
movl 0x10(%r10), %ecx
cmpq %rcx, %rax
jb 0x152e17
movq 0xc0(%r13), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
cmpl $0x0, 0x10(%rax,%rcx,8)
je 0x152f17
movq 0x20(%rsp), %rcx
leaq (%rax,%rcx,8), %rcx
xorl %edx, %edx
movq 0x18(%rcx), %rax
movq (%rax,%rdx,8), %rax
movq 0x28(%r13), %rdi
movq 0x40(%r13), %rsi
shrq $0x21, %rax
movl (%rsi,%rax,4), %r9d
movl 0x4(%rsi,%rax,4), %r8d
subl %r9d, %r8d
leal 0x1(%r9), %eax
movl (%rdi,%r9,4), %esi
movl (%rdi,%rax,4), %eax
addl $-0x2, %r8d
je 0x152ef6
leaq (%rdi,%r9,4), %rdi
movl %r8d, %r8d
xorl %r9d, %r9d
movl 0x8(%rdi,%r9,4), %r10d
shrl %r10d
xorb %r14b, (%r15,%r10)
incq %r9
cmpq %r9, %r8
jne 0x152ee2
cmpl $-0x1, %esi
je 0x152f01
shrl %esi
xorb %r14b, (%r15,%rsi)
cmpl $-0x1, %eax
je 0x152f0c
shrl %eax
xorb %r14b, (%r15,%rax)
incq %rdx
movl 0x10(%rcx), %eax
cmpq %rax, %rdx
jb 0x152ea7
movq 0x18(%rsp), %rsi
cmpq $0x0, (%rsi)
je 0x152f4a
movl $0x1, %eax
xorl %ecx, %ecx
movq 0x10(%rsi), %rdx
movl (%rdx,%rcx,4), %ecx
shrl %ecx
movq 0x40(%rsp), %rdx
cmpb $0x3, (%rdx,%rcx)
jne 0x152f41
xorb %r14b, (%r15,%rcx)
movl %eax, %ecx
incl %eax
cmpq %rcx, (%rsi)
ja 0x152f29
movq %r11, 0x28(%rsp)
movq $0x0, (%rsp)
movq 0x30(%rsp), %rax
leal (%rax,%rax), %ecx
leal 0x1(,%rax,2), %ebp
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq $0x0, (%rsp)
movq 0x10(%r13), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %r8
movq 0x28(%rax), %rax
movq (%rax,%rcx,8), %rdi
testl %edi, %edi
je 0x152fe3
movq %rdi, %r9
shrq $0x20, %r9
leaq (%r9,%r9,2), %r9
leaq (%r8,%r9,8), %r9
movl %edi, %r10d
xorl %edi, %edi
movl 0xc(%r9), %r11d
testl %r11d, %r11d
js 0x152fd8
movl 0x8(%r9), %ebx
shrl %ebx
movzbl (%r15,%rbx), %ebx
xorl %r12d, %r12d
testl %r14d, %ebx
setne %r12b
incl (%rsp,%r12,4)
testq %rdi, %rdi
je 0x152fd5
movl 0xc(%rdi), %ebx
andl %esi, %ebx
cmpl %r11d, %ebx
jbe 0x152fd8
movq %r9, %rdi
addq $0x18, %r9
decq %r10
jne 0x152fa4
jmp 0x152fe5
xorl %edi, %edi
movq (%rax,%rbp,8), %r9
testl %r9d, %r9d
je 0x153040
movq %r9, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
leaq (%r8,%rax,8), %rax
movl %r9d, %r8d
movl 0xc(%rax), %r9d
testl %r9d, %r9d
js 0x153037
movl 0x8(%rax), %r10d
shrl %r10d
movzbl (%r15,%r10), %r10d
xorl %r11d, %r11d
testl %r14d, %r10d
setne %r11b
incl (%rsp,%r11,4)
testq %rdi, %rdi
je 0x153034
movl 0xc(%rdi), %r10d
andl %esi, %r10d
cmpl %r9d, %r10d
jbe 0x153037
movq %rax, %rdi
addq $0x18, %rax
decq %r8
jne 0x153000
testq %rdi, %rdi
je 0x153191
orb $-0x80, 0xf(%rdi)
movl 0x8(%rdi), %eax
shrl %eax
movzbl (%r15,%rax), %eax
xorl %r8d, %r8d
testl %r14d, %eax
setne %r8b
decl (%rsp,%r8,4)
movl 0x8(%rdi), %eax
movl %eax, %r8d
shrl %r8d
cmpl 0x30(%rsp), %r8d
jne 0x153191
movq 0x10(%r13), %r8
movq 0x18(%r8), %r9
xorq $0x1, %rax
movq 0x28(%r9), %r8
movq (%r8,%rax,8), %r8
movq %r8, %r10
andq %rdx, %r10
je 0x1530d4
movl 0x4(%rdi), %eax
movq 0x8(%r9), %r9
shrq $0x20, %r8
shlq $0x3, %r10
leaq (%r10,%r10,2), %rdi
leaq (%r8,%r8,2), %r8
leaq (%r9,%r8,8), %r8
addq $0xc, %r8
xorl %r9d, %r9d
movl -0x4(%r8,%r9), %r10d
xorl %eax, %r10d
cmpl $0x1, %r10d
jne 0x1530cb
orb $-0x80, 0x3(%r8,%r9)
addq $0x18, %r9
cmpq %r9, %rdi
jne 0x1530b7
movq $0x0, (%rsp)
movq 0x10(%r13), %rax
movq 0x18(%rax), %rdi
movq 0x8(%rdi), %rax
movq 0x28(%rdi), %rdi
movq (%rdi,%rcx,8), %r8
testl %r8d, %r8d
je 0x15313e
movq %r8, %r9
shrq $0x20, %r9
movl %r8d, %r10d
leaq (%r9,%r9,2), %r8
leaq (%rax,%r8,8), %r8
addq $0xc, %r8
shlq $0x3, %r10
leaq (%r10,%r10,2), %r9
xorl %r10d, %r10d
cmpl $0x0, (%r8,%r10)
js 0x153135
movl -0x4(%r8,%r10), %r11d
shrl %r11d
movzbl (%r15,%r11), %r11d
xorl %ebx, %ebx
testl %r14d, %r11d
setne %bl
incl (%rsp,%rbx,4)
addq $0x18, %r10
cmpq %r10, %r9
jne 0x153116
movq (%rdi,%rbp,8), %rdi
testl %edi, %edi
je 0x153191
movq %rdi, %r8
shrq $0x20, %r8
movl %edi, %edi
leaq (%r8,%r8,2), %r8
leaq (%rax,%r8,8), %rax
addq $0xc, %rax
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdi
xorl %r8d, %r8d
cmpl $0x0, (%rax,%r8)
js 0x153188
movl -0x4(%rax,%r8), %r9d
shrl %r9d
movzbl (%r15,%r9), %r9d
xorl %r10d, %r10d
testl %r14d, %r9d
setne %r10b
incl (%rsp,%r10,4)
addq $0x18, %r8
cmpq %r8, %rdi
jne 0x153166
cmpl $0x0, (%rsp)
je 0x1531a2
cmpl $0x0, 0x4(%rsp)
jne 0x152f70
movq %rbp, %r12
movq 0x10(%r13), %rax
movq 0x18(%rax), %rdx
movq 0x28(%rdx), %rax
movq (%rax,%rcx,8), %rax
testl %eax, %eax
movq 0x8(%rsp), %rdi
je 0x153265
movq 0x8(%rdx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %eax
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rbp
addq $0xc, %rbp
shlq $0x3, %rax
leaq (%rax,%rax,2), %r13
xorl %ebx, %ebx
movl (%rbp,%rbx), %eax
testl %eax, %eax
jns 0x15325c
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, (%rbp,%rbx)
movq 0x8(%rdi), %rax
cmpq %rax, (%rdi)
jne 0x153232
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x8(%rdi)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rdi)
leaq (%rbx,%rbp), %rax
addq $-0xc, %rax
movq (%rdi), %rcx
movq 0x10(%rdi), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rdi)
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax), %rsi
movq %rsi, 0x10(%rdx,%rcx,8)
movups (%rax), %xmm0
movups %xmm0, (%rdx,%rcx,8)
addq $0x18, %rbx
cmpq %rbx, %r13
jne 0x1531e5
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rcx
movq 0x28(%rcx), %rax
movq (%rax,%r12,8), %rax
testl %eax, %eax
je 0x153326
movq 0x8(%rcx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %eax
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rbp
addq $0xc, %rbp
shlq $0x3, %rax
leaq (%rax,%rax,2), %r13
xorl %ebx, %ebx
movl $0x2, %r12d
movl (%rbp,%rbx), %eax
testl %eax, %eax
jns 0x15331d
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, (%rbp,%rbx)
movq 0x8(%rdi), %rax
cmpq %rax, (%rdi)
jne 0x1532f3
leaq (%rax,%rax), %rcx
testq %rax, %rax
cmoveq %r12, %rcx
movq %rcx, 0x8(%rdi)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rdi)
leaq (%rbx,%rbp), %rax
addq $-0xc, %rax
movq (%rdi), %rcx
movq 0x10(%rdi), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rdi)
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax), %rsi
movq %rsi, 0x10(%rdx,%rcx,8)
movups (%rax), %xmm0
movups %xmm0, (%rdx,%rcx,8)
addq $0x18, %rbx
cmpq %rbx, %r13
jne 0x1532ab
movq 0x38(%rsp), %rax
movq 0x28(%rsp), %rcx
movb $-0x1, (%rax,%rcx)
movq 0x10(%rsp), %r11
movq 0xc0(%r11), %rax
movq 0x10(%rax), %rax
movq 0x50(%rsp), %rcx
cmpl $0x0, 0x10(%rax,%rcx,8)
je 0x1533c6
leaq (%rax,%rcx,8), %rax
xorl %ecx, %ecx
movq 0x18(%rax), %rdx
movq (%rdx,%rcx,8), %rdx
movq 0x28(%r11), %rdi
movq 0x40(%r11), %rsi
shrq $0x21, %rdx
movl (%rsi,%rdx,4), %r9d
movl 0x4(%rsi,%rdx,4), %r8d
subl %r9d, %r8d
leal 0x1(%r9), %edx
movl (%rdi,%r9,4), %esi
movl (%rdi,%rdx,4), %edx
addl $-0x2, %r8d
je 0x1533a5
leaq (%rdi,%r9,4), %rdi
movl %r8d, %r8d
xorl %r9d, %r9d
movl 0x8(%rdi,%r9,4), %r10d
shrl %r10d
xorb %r14b, (%r15,%r10)
incq %r9
cmpq %r9, %r8
jne 0x153391
cmpl $-0x1, %esi
je 0x1533b0
shrl %esi
xorb %r14b, (%r15,%rsi)
cmpl $-0x1, %edx
je 0x1533bb
shrl %edx
xorb %r14b, (%r15,%rdx)
incq %rcx
movl 0x10(%rax), %edx
cmpq %rdx, %rcx
jb 0x153356
movq 0xc0(%r11), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
cmpl $0x0, 0x10(%rax,%rcx,8)
je 0x153453
leaq (%rax,%rcx,8), %rax
xorl %ecx, %ecx
movq 0x18(%rax), %rdx
movq (%rdx,%rcx,8), %rdx
movq 0x28(%r11), %rdi
movq 0x40(%r11), %rsi
shrq $0x21, %rdx
movl (%rsi,%rdx,4), %r9d
movl 0x4(%rsi,%rdx,4), %r8d
subl %r9d, %r8d
leal 0x1(%r9), %edx
movl (%rdi,%r9,4), %esi
movl (%rdi,%rdx,4), %edx
addl $-0x2, %r8d
je 0x153432
leaq (%rdi,%r9,4), %rdi
movl %r8d, %r8d
xorl %r9d, %r9d
movl 0x8(%rdi,%r9,4), %r10d
shrl %r10d
xorb %r14b, (%r15,%r10)
incq %r9
cmpq %r9, %r8
jne 0x15341e
cmpl $-0x1, %esi
je 0x15343d
shrl %esi
xorb %r14b, (%r15,%rsi)
cmpl $-0x1, %edx
je 0x153448
shrl %edx
xorb %r14b, (%r15,%rdx)
incq %rcx
movl 0x10(%rax), %edx
cmpq %rdx, %rcx
jb 0x1533e3
movq 0x18(%rsp), %rsi
cmpq $0x0, (%rsi)
je 0x1534b5
movl $0x1, %eax
xorl %ecx, %ecx
movq 0x10(%rsi), %rdx
movl (%rdx,%rcx,4), %ecx
shrl %ecx
movq 0x40(%rsp), %rdx
cmpb $0x3, (%rdx,%rcx)
jne 0x15347d
xorb %r14b, (%r15,%rcx)
movl %eax, %ecx
incl %eax
cmpq %rcx, (%rsi)
ja 0x153465
jmp 0x1534b5
movq 0x18(%rsp), %rsi
cmpq $0x0, (%rsi)
movq 0x38(%rsp), %rdi
je 0x1534b5
movl $0x1, %eax
xorl %ecx, %ecx
movq 0x10(%rsi), %rdx
movl (%rdx,%rcx,4), %ecx
shrl %ecx
movb $-0x1, (%rdi,%rcx)
movl %eax, %ecx
incl %eax
cmpq %rcx, (%rsi)
ja 0x15349f
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq