// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: test_triangular_exact(asg_t*, unsigned int*, unsigned int, unsigned int, unsigned int, int, buf_t*)
int test_triangular_exact(asg_t *g, uint32_t* nodes, uint32_t length, 
uint32_t startNode, uint32_t endNode, int max_dist, buf_t* bub)
{
    
    uint32_t i, v, w;
    ///int flag0, flag1, node;
    int n_reduced = 0, todel;
    long long NodeLen_first[3];
    long long NodeLen_second[3];

    uint32_t Ns_first[3];
    uint32_t Ns_second[3];
    
    
    for (i = 0; i < length; ++i)
    {
        v = nodes[i];

        if((v>>1) == (startNode>>1) || (v>>1) == (endNode>>1))
        {
            continue;
        }

        uint32_t nv = asg_arc_n(g, v);
        asg_arc_t *av = asg_arc_a(g, v);
        if(nv != 2)
        {
            continue;
        }
        if(av[0].v == av[1].v)
        {
            continue;
        }
        /**********************test first node************************/
        NodeLen_first[0] = NodeLen_first[1] = NodeLen_first[2] = -1;
        if(asg_is_single_edge(g, av[0].v, v>>1) <= 2 && asg_is_single_edge(g, av[1].v, v>>1) <= 2)
        {
            NodeLen_first[asg_is_single_edge(g, av[0].v, v>>1)] = 0;
            NodeLen_first[asg_is_single_edge(g, av[1].v, v>>1)] = 1;
        }
        ///one node has one out-edge, another node has two out-edges
        if(NodeLen_first[1] == -1 || NodeLen_first[2] == -1)
        {
            continue;
        }
       /**********************test first node************************/

        ///if the potiential edge has already been removed 
        if(av[NodeLen_first[2]].del == 1)
        {
            continue;
        }

        /**********************test second node************************/
        w = av[NodeLen_first[2]].v^1;
        asg_arc_t *aw = asg_arc_a(g, w);
        uint32_t nw = asg_arc_n(g, w);
        if(nw != 2)
        {
            fprintf(stderr, "error\n");
        }
        NodeLen_second[0] = NodeLen_second[1] = NodeLen_second[2] = -1;
        if(asg_is_single_edge(g, aw[0].v, w>>1) <= 2 && asg_is_single_edge(g, aw[1].v, w>>1) <= 2)
        {
            NodeLen_second[asg_is_single_edge(g, aw[0].v, w>>1)] = 0;
            NodeLen_second[asg_is_single_edge(g, aw[1].v, w>>1)] = 1;
        }
        ///one node has one out-edge, another node has two out-edges
        if(NodeLen_second[1] == -1 || NodeLen_second[2] == -1)
        {
            continue;
        }

        /**********************test second node************************/

        if(if_node_exist(nodes, length, (w>>1)) && ((w>>1) != (endNode>>1)))
        {

               uint32_t convex1 = 0, convex2 = 0, f1, f2;
               long long l1 = 0, l2 = 0;
               todel = 0;
               f1 = detect_bubble_end_with_bubbles(g, av[0].v, av[1].v, &convex1, &l1, NULL);
               f2 = detect_bubble_end_with_bubbles(g, aw[0].v, aw[1].v, &convex2, &l2, NULL);
               if(f1 && f2)
               {
                    if(((convex1>>1) == (startNode>>1) || (convex1>>1) == (endNode>>1)) && 
                     ((convex2>>1) == (startNode>>1) || (convex2>>1) == (endNode>>1)))
                     {
                         if(l1 <= min_thres || l2 <= min_thres)
                         {
                             continue;
                         } 

                         todel = 1;
                     } 
               }
               else if(f1)
               {
                  if(((convex1>>1) == (startNode>>1) || (convex1>>1) == (endNode>>1)))
                   {
                       if(l1 <= min_thres)
                       {
                           continue;
                       }

                       todel = 1;
                   }   
               }
               else if(f2)
               {
                   if(((convex2>>1) == (startNode>>1) || (convex2>>1) == (endNode>>1)))
                   {
                       if(l2 <= min_thres)
                       {
                           continue;
                       }

                       todel = 1;
                   }   
               }

            
               if(todel == 0)
               {
                   if(!f1)
                   {
                       Ns_first[0] = av[0].v; Ns_first[1] = av[1].v;
                       f1 = asg_bub_end_finder_with_del_advance(g, Ns_first, 2, max_dist, 
                       bub, 0, (uint32_t)-1, &convex1);
                       l1 = min_thres + 10;
                   }

                   if(!f2)
                   {
                       Ns_second[0] = aw[0].v; Ns_second[1] = aw[1].v;
                       f2 = asg_bub_end_finder_with_del_advance(g, Ns_second, 2, max_dist, 
                       bub, 0, (uint32_t)-1, &convex2);
                       l2 = min_thres + 10;
                   }




                    
                    if(f1 && f2)
                    {
                        if(((convex1>>1) == (startNode>>1) || (convex1>>1) == (endNode>>1)) && 
                        ((convex2>>1) == (startNode>>1) || (convex2>>1) == (endNode>>1)))
                        {
                            if(l1 <= min_thres || l2 <= min_thres)
                            {
                                continue;
                            } 

                            todel = 1;
                        } 
                    }
                    else if(f1)
                    {
                        if(((convex1>>1) == (startNode>>1) || (convex1>>1) == (endNode>>1)))
                        {
                            if(l1 <= min_thres)
                            {
                                continue;
                            }

                            todel = 1;
                        }   
                    }
                    else if(f2)
                    {
                        if(((convex2>>1) == (startNode>>1) || (convex2>>1) == (endNode>>1)))
                        {
                            if(l2 <= min_thres)
                            {
                                continue;
                            }

                            todel = 1;
                        }   
                    }
                    
               }
               
               
               if(todel)
               {
                   av[NodeLen_first[2]].del = 1;
                    ///remove the reverse direction
                    asg_arc_del(g, av[NodeLen_first[2]].v^1, av[NodeLen_first[2]].ul>>32^1, 1);
                    n_reduced++;
               }
 
        }

    }

    return n_reduced;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
testl %edx, %edx
je 0xa5e3a
movl %r8d, %ebp
movl %ecx, %r14d
movq %rsi, %r10
movq %rdi, %r11
movl %r9d, 0x5c(%rsp)
shrl %r14d
shrl %ebp
movl %edx, %r9d
pcmpeqd %xmm0, %xmm0
movl $0x1, %r13d
xorl %r12d, %r12d
movl $0x0, 0x44(%rsp)
movq %rsi, 0x10(%rsp)
movq %r9, 0x8(%rsp)
movl (%r10,%r12,4), %ecx
movl %ecx, %r15d
shrl %r15d
cmpl %r14d, %r15d
sete %al
cmpl %ebp, %r15d
sete %dl
orb %al, %dl
jne 0xa5dea
movq 0x28(%r11), %rax
movq (%rax,%rcx,8), %rdx
cmpl $0x2, %edx
jne 0xa5dea
movq 0x8(%r11), %rcx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdi
movl 0x8(%rdi), %edx
cmpl 0x20(%rdi), %edx
je 0xa5dea
xorq $0x1, %rdx
movdqa %xmm0, 0x80(%rsp)
movq $-0x1, 0x90(%rsp)
movq (%rax,%rdx,8), %rbx
testl %ebx, %ebx
jle 0xa57a3
movq %rbx, %rdx
shrq $0x20, %rdx
movl %ebx, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdx
addq $0x8, %rdx
xorl %ecx, %ecx
movl (%rdx), %esi
shrl %esi
cmpl %r15d, %esi
cmovel %r13d, %ecx
addq $0x18, %rdx
decq %rax
jne 0xa541c
testl %ecx, %ecx
je 0xa57a5
cmpl $0x2, %ebx
jg 0xa5dea
movl 0x20(%rdi), %eax
movq 0x28(%r11), %rcx
xorq $0x1, %rax
movq (%rcx,%rax,8), %rbx
testl %ebx, %ebx
jle 0xa57f6
movq 0x8(%r11), %rcx
movq %rbx, %rdx
shrq $0x20, %rdx
movl %ebx, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdx
addq $0x8, %rdx
xorl %ecx, %ecx
movl (%rdx), %esi
shrl %esi
cmpl %r15d, %esi
cmovel %r13d, %ecx
addq $0x18, %rdx
decq %rax
jne 0xa5478
testl %ecx, %ecx
je 0xa57f8
cmpl $0x2, %ebx
jg 0xa5dea
movq %rdi, 0x18(%rsp)
movl 0x8(%rdi), %eax
movq 0x28(%r11), %rcx
xorq $0x1, %rax
movq (%rcx,%rax,8), %rbx
testl %ebx, %ebx
jle 0xa5849
movq 0x8(%r11), %rax
movq %rbx, %rsi
shrq $0x20, %rsi
movl %ebx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leaq (%rsi,%rsi,2), %rsi
leaq (%rax,%rsi,8), %rdi
addq $0x8, %rdi
xorl %esi, %esi
movl (%rdi), %r8d
shrl %r8d
cmpl %r15d, %r8d
cmovel %r13d, %esi
addq $0x18, %rdi
decq %rdx
jne 0xa54da
testl %esi, %esi
je 0xa584b
movslq %ebx, %rdx
movq $0x0, 0x80(%rsp,%rdx,8)
movq 0x18(%rsp), %rdi
movl 0x20(%rdi), %edx
xorq $0x1, %rdx
movq (%rcx,%rdx,8), %rbx
testl %ebx, %ebx
jle 0xa589a
movq %rbx, %rdx
shrq $0x20, %rdx
movl %ebx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0x8, %rdx
xorl %eax, %eax
movl (%rdx), %esi
shrl %esi
cmpl %r15d, %esi
cmovel %r13d, %eax
addq $0x18, %rdx
decq %rcx
jne 0xa553c
testl %eax, %eax
je 0xa589c
movslq %ebx, %rax
movq $0x1, 0x80(%rsp,%rax,8)
movq 0x90(%rsp), %rax
cmpq $-0x1, 0x88(%rsp)
sete %cl
cmpq $-0x1, %rax
sete %dl
orb %cl, %dl
jne 0xa5dea
leaq (%rax,%rax,2), %r8
cmpl $0x0, 0xc(%rdi,%r8,8)
js 0xa5dea
leaq (%rdi,%r8,8), %rdi
movl 0x8(%rdi), %r15d
movq %r15, %rax
xorq $0x1, %rax
movq 0x8(%r11), %rsi
movq 0x28(%r11), %rcx
movq (%rcx,%rax,8), %rbx
movq %rsi, %rax
cmpl $0x2, %ebx
jne 0xa59a9
shrq $0x20, %rbx
leaq (%rbx,%rbx,2), %rdx
leaq (%rsi,%rdx,8), %rdx
movdqa %xmm0, 0x60(%rsp)
movq $-0x1, 0x70(%rsp)
movq %rdx, 0x38(%rsp)
movl 0x8(%rdx), %edx
shrl %r15d
xorq $0x1, %rdx
movq (%rcx,%rdx,8), %rbx
testl %ebx, %ebx
jle 0xa5a16
movq %rbx, %rdx
shrq $0x20, %rdx
movl %ebx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0x8, %rdx
xorl %eax, %eax
movl (%rdx), %esi
shrl %esi
cmpl %r15d, %esi
cmovel %r13d, %eax
addq $0x18, %rdx
decq %rcx
jne 0xa5614
testl %eax, %eax
je 0xa5a18
cmpl $0x2, %ebx
jg 0xa5dea
movq 0x38(%rsp), %rax
movl 0x20(%rax), %eax
movq 0x28(%r11), %rcx
xorq $0x1, %rax
movq (%rcx,%rax,8), %rbx
testl %ebx, %ebx
jle 0xa5a73
movq 0x8(%r11), %rcx
movq %rbx, %rdx
shrq $0x20, %rdx
movl %ebx, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdx
addq $0x8, %rdx
xorl %ecx, %ecx
movl (%rdx), %esi
shrl %esi
cmpl %r15d, %esi
cmovel %r13d, %ecx
addq $0x18, %rdx
decq %rax
jne 0xa5675
testl %ecx, %ecx
je 0xa5a75
cmpl $0x2, %ebx
jg 0xa5dea
movq %r8, 0x28(%rsp)
movq %rdi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x28(%r11), %rcx
xorq $0x1, %rax
movq (%rcx,%rax,8), %rbx
testl %ebx, %ebx
jle 0xa5b2c
movq 0x8(%r11), %rax
movq %rbx, %rsi
shrq $0x20, %rsi
movl %ebx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leaq (%rsi,%rsi,2), %rsi
leaq (%rax,%rsi,8), %rdi
addq $0x8, %rdi
xorl %esi, %esi
movl (%rdi), %r8d
shrl %r8d
cmpl %r15d, %r8d
cmovel %r13d, %esi
addq $0x18, %rdi
decq %rdx
jne 0xa56e1
testl %esi, %esi
je 0xa5b2e
movslq %ebx, %rdx
movq $0x0, 0x60(%rsp,%rdx,8)
movq 0x38(%rsp), %rdx
movl 0x20(%rdx), %edx
xorq $0x1, %rdx
movq (%rcx,%rdx,8), %rbx
testl %ebx, %ebx
jle 0xa5b7d
movq %rbx, %rdx
shrq $0x20, %rdx
movl %ebx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0x8, %rdx
xorl %eax, %eax
movq 0x18(%rsp), %rdi
movl (%rdx), %esi
shrl %esi
cmpl %r15d, %esi
cmovel %r13d, %eax
addq $0x18, %rdx
decq %rcx
jne 0xa5745
testl %eax, %eax
je 0xa5b7f
movslq %ebx, %rax
movq $0x1, 0x60(%rsp,%rax,8)
cmpq $-0x1, 0x68(%rsp)
je 0xa5dea
cmpq $-0x1, 0x70(%rsp)
je 0xa5dea
xorl %eax, %eax
movl (%r10,%rax,4), %ecx
shrl %ecx
cmpl %r15d, %ecx
je 0xa58da
incq %rax
cmpq %rax, %r9
jne 0xa5787
jmp 0xa5dea
xorl %ebx, %ebx
movq 0x1ef834(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0xa, %esi
movl $0x1, %edx
movq %rdi, 0x18(%rsp)
leaq 0x193955(%rip), %rdi    # 0x23911a
movl %r14d, (%rsp)
movl %ebp, %r14d
movq %r11, %rbp
callq 0x2410
movq 0x18(%rsp), %rdi
pcmpeqd %xmm0, %xmm0
movq 0x8(%rsp), %r9
movq %rbp, %r11
movl %r14d, %ebp
movl (%rsp), %r14d
movq 0x10(%rsp), %r10
jmp 0xa5438
xorl %ebx, %ebx
movq 0x1ef7e1(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0xa, %esi
movl $0x1, %edx
movq %rdi, 0x18(%rsp)
leaq 0x193902(%rip), %rdi    # 0x23911a
movl %r14d, (%rsp)
movl %ebp, %r14d
movq %r11, %rbp
callq 0x2410
movq 0x18(%rsp), %rdi
pcmpeqd %xmm0, %xmm0
movq 0x8(%rsp), %r9
movq %rbp, %r11
movl %r14d, %ebp
movl (%rsp), %r14d
movq 0x10(%rsp), %r10
jmp 0xa5494
xorl %ebx, %ebx
movq 0x1ef78e(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0xa, %esi
movl $0x1, %edx
leaq 0x1938b4(%rip), %rdi    # 0x23911a
movl %r14d, (%rsp)
movl %ebp, %r14d
movq %r11, %rbp
callq 0x2410
pcmpeqd %xmm0, %xmm0
movq 0x8(%rsp), %r9
movq %rbp, %r11
movl %r14d, %ebp
movl (%rsp), %r14d
movq 0x10(%rsp), %r10
movq 0x8(%r11), %rax
movq 0x28(%r11), %rcx
jmp 0xa54f8
xorl %ebx, %ebx
movq 0x1ef73d(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0xa, %esi
movl $0x1, %edx
leaq 0x193863(%rip), %rdi    # 0x23911a
movq %r11, %r15
callq 0x2410
movq 0x18(%rsp), %rdi
pcmpeqd %xmm0, %xmm0
movq 0x8(%rsp), %r9
movq %r15, %r11
movq 0x10(%rsp), %r10
jmp 0xa5558
cmpl %ebp, %r15d
je 0xa5dea
xorl %eax, %eax
movl %eax, 0x24(%rsp)
movl %eax, 0x20(%rsp)
movq %rax, 0x50(%rsp)
movq %rax, 0x48(%rsp)
movl 0x8(%rdi), %esi
movl 0x20(%rdi), %edx
movq %r11, %rdi
leaq 0x24(%rsp), %rcx
leaq 0x50(%rsp), %r8
xorl %r9d, %r9d
movq %r11, %rbx
callq 0xa4f1c
movl %eax, %r15d
movq 0x38(%rsp), %rax
movl 0x8(%rax), %esi
movl 0x20(%rax), %edx
movq %rbx, (%rsp)
movq %rbx, %rdi
leaq 0x20(%rsp), %rcx
leaq 0x48(%rsp), %r8
xorl %r9d, %r9d
callq 0xa4f1c
movl %eax, %r8d
testl %r15d, %r15d
je 0xa5ad0
testl %r8d, %r8d
je 0xa5ad0
movl 0x24(%rsp), %eax
shrl %eax
cmpl %r14d, %eax
setne %cl
cmpl %ebp, %eax
setne %dl
testb %dl, %cl
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdi
jne 0xa5bcb
movl 0x20(%rsp), %ecx
shrl %ecx
cmpl %r14d, %ecx
setne %dl
cmpl %ebp, %ecx
setne %cl
testb %cl, %dl
movq 0x10(%rsp), %r10
movq (%rsp), %r11
movq 0x8(%rsp), %r9
pcmpeqd %xmm0, %xmm0
movq 0x18(%rsp), %rdx
jne 0xa5d4e
jmp 0xa5d76
movq 0x1ef630(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movq %rsi, 0x38(%rsp)
movl $0x6, %esi
movl $0x1, %edx
movq %rdi, 0x30(%rsp)
leaq 0x18c04f(%rip), %rdi    # 0x231a1d
movl %r14d, (%rsp)
movl %ebp, %r14d
movq %r11, %rbp
movq %r8, 0x28(%rsp)
callq 0x2410
movq 0x38(%rsp), %rsi
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %rdi
pcmpeqd %xmm0, %xmm0
movq 0x8(%rsp), %r9
movq %rbp, %r11
movl %r14d, %ebp
movl (%rsp), %r14d
movq 0x10(%rsp), %r10
movq 0x8(%r11), %rax
movq 0x28(%r11), %rcx
jmp 0xa55c1
xorl %ebx, %ebx
movq 0x1ef5c1(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0xa, %esi
movl $0x1, %edx
movq %rdi, 0x30(%rsp)
leaq 0x1936e2(%rip), %rdi    # 0x23911a
movl %r14d, (%rsp)
movl %ebp, %r14d
movq %r11, %rbp
movq %r8, 0x28(%rsp)
callq 0x2410
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %rdi
pcmpeqd %xmm0, %xmm0
movq 0x8(%rsp), %r9
movq %rbp, %r11
movl %r14d, %ebp
movl (%rsp), %r14d
movq 0x10(%rsp), %r10
jmp 0xa5630
xorl %ebx, %ebx
movq 0x1ef564(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0xa, %esi
movl $0x1, %edx
movq %rdi, 0x30(%rsp)
leaq 0x193685(%rip), %rdi    # 0x23911a
movl %r14d, (%rsp)
movl %ebp, %r14d
movq %r11, %rbp
movq %r8, 0x28(%rsp)
callq 0x2410
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %rdi
pcmpeqd %xmm0, %xmm0
movq 0x8(%rsp), %r9
movq %rbp, %r11
movl %r14d, %ebp
movl (%rsp), %r14d
movq 0x10(%rsp), %r10
jmp 0xa5691
testl %r15d, %r15d
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdi
je 0xa5be7
movl 0x24(%rsp), %eax
shrl %eax
cmpl %r14d, %eax
setne %cl
cmpl %ebp, %eax
setne %al
movb $0x1, %bl
testb %al, %cl
movq 0x10(%rsp), %r10
movq (%rsp), %r11
movq 0x8(%rsp), %r9
pcmpeqd %xmm0, %xmm0
movq 0x18(%rsp), %rdx
jne 0xa5cb0
movq 0x50(%rsp), %rax
cmpq 0x1f08ff(%rip), %rax    # 0x296420
jg 0xa5d8b
jmp 0xa5dea
xorl %ebx, %ebx
movq 0x1ef4ab(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0xa, %esi
movl $0x1, %edx
leaq 0x1935d1(%rip), %rdi    # 0x23911a
movl %r14d, (%rsp)
movl %ebp, %r14d
movq %r11, %rbp
callq 0x2410
pcmpeqd %xmm0, %xmm0
movq 0x8(%rsp), %r9
movq %rbp, %r11
movl %r14d, %ebp
movl (%rsp), %r14d
movq 0x10(%rsp), %r10
movq 0x8(%r11), %rax
movq 0x28(%r11), %rcx
jmp 0xa56ff
xorl %ebx, %ebx
movq 0x1ef45a(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0xa, %esi
movl $0x1, %edx
leaq 0x193580(%rip), %rdi    # 0x23911a
movl %r14d, (%rsp)
movl %ebp, %r14d
movq %r11, %rbp
callq 0x2410
movq 0x18(%rsp), %rdi
pcmpeqd %xmm0, %xmm0
movq 0x8(%rsp), %r9
movq %rbp, %r11
movl %r14d, %ebp
movl (%rsp), %r14d
movq 0x10(%rsp), %r10
jmp 0xa5761
movq 0x10(%rsp), %r10
movq (%rsp), %r11
movq 0x8(%rsp), %r9
pcmpeqd %xmm0, %xmm0
movq 0x18(%rsp), %rdx
jmp 0xa5d4e
testl %r8d, %r8d
movq (%rsp), %r11
movq 0x18(%rsp), %rdx
je 0xa5c2f
movl 0x20(%rsp), %eax
shrl %eax
cmpl %r14d, %eax
setne %cl
cmpl %ebp, %eax
setne %al
testb %al, %cl
jne 0xa5c2f
movq 0x48(%rsp), %rax
cmpq 0x1f080a(%rip), %rax    # 0x296420
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r9
pcmpeqd %xmm0, %xmm0
jg 0xa5d8b
jmp 0xa5dea
movl 0x8(%rdx), %eax
movl %eax, 0xac(%rsp)
movl 0x20(%rdx), %eax
movl %eax, 0xb0(%rsp)
movq %r11, %rdi
leaq 0xac(%rsp), %rsi
movl $0x2, %edx
movl 0x5c(%rsp), %ecx
movl %r8d, %ebx
movq 0xf0(%rsp), %r8
xorl %r9d, %r9d
leaq 0x24(%rsp), %rax
pushq %rax
pushq $-0x1
callq 0xa5e58
movl %ebx, %r8d
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x10(%rsp), %r11
addq $0x10, %rsp
movq 0x1f078c(%rip), %rcx    # 0x296420
addq $0xa, %rcx
movq %rcx, 0x50(%rsp)
testl %eax, %eax
setne %bl
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r9
pcmpeqd %xmm0, %xmm0
movb $0x1, %al
testl %r8d, %r8d
jne 0xa5d3b
movq 0x38(%rsp), %rcx
movl 0x8(%rcx), %eax
movl %eax, 0xa0(%rsp)
movl 0x20(%rcx), %eax
movl %eax, 0xa4(%rsp)
movq %r11, %rdi
leaq 0xa0(%rsp), %rsi
movl $0x2, %edx
movl 0x5c(%rsp), %ecx
movq 0xf0(%rsp), %r8
xorl %r9d, %r9d
leaq 0x20(%rsp), %rax
pushq %rax
pushq $-0x1
callq 0xa5e58
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x28(%rsp), %rdx
pcmpeqd %xmm0, %xmm0
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %r11
movq 0x20(%rsp), %r10
addq $0x10, %rsp
movq 0x1f06f3(%rip), %rcx    # 0x296420
addq $0xa, %rcx
movq %rcx, 0x48(%rsp)
testl %eax, %eax
setne %al
movl %ebx, %ecx
andb %al, %cl
cmpb $0x1, %cl
jne 0xa5df8
movl 0x24(%rsp), %eax
shrl %eax
cmpl %r14d, %eax
setne %cl
cmpl %ebp, %eax
setne %al
testb %al, %cl
jne 0xa5dea
movl 0x20(%rsp), %eax
shrl %eax
cmpl %r14d, %eax
setne %cl
cmpl %ebp, %eax
setne %al
testb %al, %cl
jne 0xa5dea
movq 0x1f06a3(%rip), %rax    # 0x296420
cmpq %rax, 0x50(%rsp)
jle 0xa5dea
cmpq %rax, 0x48(%rsp)
jle 0xa5dea
orb $-0x80, 0xf(%rdx,%rdi,8)
movl 0x8(%rsi), %eax
xorq $0x1, %rax
movq 0x28(%r11), %rcx
movq (%rcx,%rax,8), %rdx
movq %rdx, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rax, %rcx
je 0xa5de6
movl 0x4(%rsi), %eax
movq 0x8(%r11), %rsi
shrq $0x20, %rdx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rdx,2), %rdx
leaq (%rsi,%rdx,8), %rdx
addq $0xc, %rdx
xorl %esi, %esi
movl -0x4(%rdx,%rsi), %edi
xorl %eax, %edi
cmpl $0x1, %edi
jne 0xa5ddd
orb $-0x80, 0x3(%rdx,%rsi)
addq $0x18, %rsi
cmpq %rsi, %rcx
jne 0xa5dcd
incl 0x44(%rsp)
incq %r12
cmpq %r9, %r12
jne 0xa5390
jmp 0xa5e42
testb %bl, %bl
je 0xa5e17
movl 0x24(%rsp), %eax
shrl %eax
cmpl %r14d, %eax
setne %cl
cmpl %ebp, %eax
setne %al
testb %al, %cl
je 0xa5b15
jmp 0xa5dea
testb %al, %al
je 0xa5dea
movl 0x20(%rsp), %eax
shrl %eax
cmpl %r14d, %eax
setne %cl
cmpl %ebp, %eax
setne %al
testb %al, %cl
jne 0xa5dea
movq 0x48(%rsp), %rax
jmp 0xa5b1a
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq