// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: merge_ug_nodes(ma_ug_t*, asg_t*, kvec_t_u64_warp*)
void merge_ug_nodes(ma_ug_t *ug, asg_t* read_g, kvec_t_u64_warp* array)
{
    if(array->a.n == 0) return;
    uint32_t i, k, v, w;
    ma_utg_t result;
    memset(&result, 0, sizeof(ma_utg_t));
    v = w = (uint32_t)-1;
    for (i = 0; i < array->a.n; i++)
    {
        w = array->a.a[i];
        collect_ma_utg_ts(ug, v, w, &result);
        v = w;
    }

    

    if(result.n == 0) return;
    asg_arc_t *av = NULL;
    uint32_t nv, l;
    result.len = 0;
    for (i = 0; i < result.n - 1; i++)
    {
        
        v = (uint64_t)(result.a[i])>>32;
        w = (uint64_t)(result.a[i + 1])>>32; 
        av = asg_arc_a(read_g, v);
        nv = asg_arc_n(read_g, v);
        l = 0;
        
        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) fprintf(stderr ,"******error, i: %u, k: %u, nv: %u\n", i, k, nv);
        result.a[i] = v; result.a[i] = result.a[i]<<32; result.a[i] = result.a[i] | (uint64_t)(l);
        result.len += l;
    }
    

    if(i < result.n)
    {
        v = (uint64_t)(result.a[i])>>32;
        l = read_g->seq[v>>1].len;
        result.a[i] = v;
        result.a[i] = result.a[i]<<32;
        result.a[i] = result.a[i] | (uint64_t)(l);
        result.len += l;
    }
    //has already set result.a, result.len, result.n, result.m
    result.circ = 0;
    result.start = result.a[0]>>32;
    result.end = (result.a[result.n-1]>>32)^1;

    
    uint32_t beg_uid = array->a.a[0];
    uint32_t end_uid = array->a.a[array->a.n-1];
    uint32_t realLen = array->a.n;
    uint32_t new_uid = array->a.a[0]>>1;
    uint64_t kmp;





    /*******************************just for debug**********************************/
    /**
    if(beg_uid&1)
    {
        if(result.start != ug->u.a[beg_uid>>1].end)
        {
            fprintf(stderr, "ERROR\n");
        }
    }
    else
    {
        if(result.start != ug->u.a[beg_uid>>1].start)
        {
            fprintf(stderr, "ERROR\n");
        }
    }

    if(end_uid&1)
    {
        if(result.end != ug->u.a[end_uid>>1].start)
        {
            fprintf(stderr, "ERROR\n");
        }
    }
    else
    {
        if(result.end != ug->u.a[end_uid>>1].end)
        {
            fprintf(stderr, "ERROR\n");
        }
    }
    **/
    /*******************************just for debug**********************************/

    asg_arc_t *aw = NULL;
    uint32_t nw = 0;
    ///corresponding to direction 1 of new node
    v = beg_uid^1;
    av = asg_arc_a(ug->g, v);
    nv = asg_arc_n(ug->g, v);
    ///fprintf(stderr, "beg_uid_v>>1: %u, beg_uid_v&1: %u, nv: %u\n", v>>1, v&1, nv);
    for (k = 0; k < nv; k++)
    {
        if(av[k].del) continue;
        kmp = new_uid<<1; kmp = kmp^1; kmp = kmp << 32;

        ///if((av[k].v>>1) == (end_uid>>1)) continue;
        w = av[k].v^1; aw = asg_arc_a(ug->g, w); nw = asg_arc_n(ug->g, w);
        for (i = 0; i < nw; i++)
        {
            if(aw[i].del) continue;
            if(aw[i].v == (v^1)) break;
        }
        if(i == nw) fprintf(stderr, "ERROR at %s:%d\n", __FILE__, __LINE__);
        kmp = kmp | (uint64_t)(aw[i].ol);


        ///kmp = kmp | (uint64_t)(((ug->g)->idx[v]>>32) + k);/**kmp = kmp | av[k].v;**/
        ///here kmp is ul
        kv_push(uint64_t, array->a, kmp);
        kmp = av[k].ol; kmp = kmp<<32; kmp = kmp|(uint64_t)(av[k].v);
        ///here kmp is ol + v
        kv_push(uint64_t, array->a, kmp);
        ///fprintf(stderr, "*av[%u].v>>1: %u, v&1: %u, ol: %u\n", k, av[k].v>>1, av[k].v&1, av[k].ol);
    }

    ///corresponding to direction 0 of new node
    v = end_uid;
    av = asg_arc_a(ug->g, v);
    nv = asg_arc_n(ug->g, v);
    ///fprintf(stderr, "end_uid_v>>1: %u, end_uid_v&1: %u, nv: %u\n", v>>1, v&1, nv);
    for (k = 0; k < nv; k++)
    {
        if(av[k].del) continue;
        kmp = new_uid<<1; kmp = kmp << 32;

        w = av[k].v^1; 
        aw = asg_arc_a(ug->g, w); 
        nw = asg_arc_n(ug->g, w);
        for (i = 0; i < nw; i++)
        {
            if(aw[i].del) continue;
            if(aw[i].v == (v^1)) break;
        }
        if(i == nw) fprintf(stderr, "ERROR at %s:%d\n", __FILE__, __LINE__);
        kmp = kmp | (uint64_t)(aw[i].ol);


        ///here kmp is ul
        kv_push(uint64_t, array->a, kmp);
        kmp = av[k].ol; kmp = kmp<<32; kmp = kmp|(uint64_t)(av[k].v);
        ///here kmp is ol + v
        kv_push(uint64_t, array->a, kmp);
        ///fprintf(stderr, "#av[%u].v>>1: %u, v&1: %u, ol: %u\n", k, av[k].v>>1, av[k].v&1, av[k].ol);
    }

    
    ma_utg_t* tmp;
    for (i = 0; i < realLen; i++)
    {
        w = array->a.a[i];
        tmp = &(ug->u.a[w>>1]);
        if(tmp->m != 0)
        {
            tmp->circ = tmp->end = tmp->len = tmp->m = tmp->n = tmp->start = 0;
            free(tmp->a);
            tmp->a = NULL;
        }
        asg_seq_del(ug->g, w>>1);
    }
    
    ug->u.a[beg_uid>>1] = result;
    ug->g->seq[beg_uid>>1].del = 0;
    ug->g->seq[beg_uid>>1].len = result.len;

    uint32_t oLen = 0;
    for (; i < array->a.n; i += 2)
    {
        v = array->a.a[i]>>32;
        w = (uint32_t)array->a.a[i+1];
        /****************************may have bugs********************************/
        ///may have bug here, if there is an edge between beg_uid and end_uid
        ///if(((w>>1) == (beg_uid>>1)) || ((w>>1) == (end_uid>>1))) continue;
        if(((w>>1) == (beg_uid>>1)) || ((w>>1) == (end_uid>>1))) w = v;
        /****************************may have bugs********************************/

        oLen = array->a.a[i+1]>>32;
        asg_append_edges_to_srt(ug->g, v, ug->u.a[v>>1].len, w, oLen, 0, 0, 0);
        oLen = (uint32_t)array->a.a[i];
        asg_append_edges_to_srt(ug->g, w^1, ug->u.a[w>>1].len, v^1, oLen, 0, 0, 0);
    }
}

// Assembly:
cmpq $0x0, (%rdx)
je 0xf1383
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rdi, %r15
movq %rsi, (%rsp)
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %r12
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq $0x0, 0x20(%r12)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %r14d
xorl %eax, %eax
movq 0x10(%rbx), %rcx
movl (%rcx,%rax,8), %ebp
movq %r15, %rdi
movl %ebp, %edx
movq %r12, %rcx
callq 0xf00a2
movl %r14d, %eax
incl %r14d
movl %ebp, %esi
cmpq %rax, (%rbx)
ja 0xf0bb3
movl 0x50(%rsp), %eax
testl %eax, %eax
je 0xf1375
movq %r15, 0x18(%rsp)
movabsq $-0x100000000, %r10     # imm = 0xFFFFFFFF00000000
movl $0x80000000, %ebp       # imm = 0x80000000
andl 0x40(%rsp), %ebp
decl %eax
movl %eax, %r9d
je 0xf0cdc
movq 0x58(%rsp), %r14
xorl %r13d, %r13d
movq (%rsp), %r8
movq %r9, 0x10(%rsp)
movq (%r14,%r13,8), %r12
movq 0x28(%r8), %rax
movq %r12, %rcx
shrq $0x20, %rcx
movq (%rax,%rcx,8), %rcx
movl $0x0, %eax
movl $0x0, %r15d
testl %ecx, %ecx
je 0xf0c77
movl 0xc(%r14,%r13,8), %edx
movq 0x8(%r8), %rax
movq %rcx, %rdi
shrq $0x20, %rdi
movl %ecx, %esi
leaq (%rdi,%rdi,2), %rdi
leaq (%rax,%rdi,8), %rdi
addq $0xc, %rdi
xorl %eax, %eax
cmpl $0x0, (%rdi)
js 0xf0c60
cmpl %edx, -0x4(%rdi)
je 0xf0c73
incq %rax
addq $0x18, %rdi
cmpq %rax, %rsi
jne 0xf0c56
movl %ecx, %eax
xorl %r15d, %r15d
jmp 0xf0c77
movl -0xc(%rdi), %r15d
cmpl %ecx, %eax
je 0xf0ca9
andq %r10, %r12
movl %r15d, %eax
orq %r12, %rax
movq %rax, (%r14,%r13,8)
incq %r13
addl %ebp, %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
andl $0x80000000, %ebp       # imm = 0x80000000
orl %r15d, %ebp
cmpq %r9, %r13
jne 0xf0c14
jmp 0xf0ce0
movq 0x1a4330(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x147b4b(%rip), %rsi    # 0x238805
movl %r13d, %edx
movl %ecx, %r8d
xorl %eax, %eax
callq 0x22b0
movabsq $-0x100000000, %r10     # imm = 0xFFFFFFFF00000000
movq 0x10(%rsp), %r9
movq (%rsp), %r8
jmp 0xf0c7b
movq (%rsp), %r8
movq 0x58(%rsp), %rax
movq (%rax,%r9,8), %rcx
andq %rcx, %r10
movq 0x20(%r8), %rdx
shrq $0x21, %rcx
movl (%rdx,%rcx,8), %ecx
addl %ecx, %ebp
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orq %r10, %rcx
movq %rcx, (%rax,%r9,8)
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl %ebp, 0x40(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x44(%rsp)
movl 0x4(%rax,%r9,8), %eax
xorl $0x1, %eax
movl %eax, 0x48(%rsp)
movq (%rbx), %rcx
movq 0x10(%rbx), %rax
movq (%rax), %rdi
movl %edi, %r8d
movq %rcx, 0x30(%rsp)
movq -0x8(%rax,%rcx,8), %r13
movl %r13d, %r9d
movq 0x18(%rsp), %rcx
movq 0x18(%rcx), %rdx
movq 0x8(%rdx), %rcx
movq 0x28(%rdx), %rdx
movq %r8, %rsi
xorq $0x1, %rsi
movq (%rdx,%rsi,8), %rsi
testl %esi, %esi
movq %rdi, 0x10(%rsp)
movq %r8, 0x8(%rsp)
je 0xf0f33
movq %r9, 0x68(%rsp)
movq %rsi, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %r9
shlq $0x20, %r8
movq %r8, 0x38(%rsp)
movl %esi, %ecx
movq %rcx, (%rsp)
xorl %r12d, %r12d
movq 0x18(%rsp), %rdx
movq %r9, 0x20(%rsp)
leaq (%r12,%r12,2), %rcx
cmpl $0x0, 0xc(%r9,%rcx,8)
js 0xf0ecf
leaq (%r9,%rcx,8), %r8
movl 0x8(%r8), %ecx
xorq $0x1, %rcx
movq 0x18(%rdx), %rdx
movq 0x8(%rdx), %r9
movq 0x28(%rdx), %rdx
movq (%rdx,%rcx,8), %r14
movq %r14, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %r15
testl %r14d, %r14d
je 0xf0dff
movl %r14d, %edx
leaq (%r9,%r15,8), %rsi
addq $0xc, %rsi
xorl %ecx, %ecx
cmpl $0x0, (%rsi)
js 0xf0dee
cmpl %edi, -0x4(%rsi)
je 0xf0e01
incq %rcx
addq $0x18, %rsi
cmpq %rcx, %rdx
jne 0xf0de4
jmp 0xf0ede
xorl %ecx, %ecx
cmpl %r14d, %ecx
movl %ecx, %r14d
je 0xf0ede
leaq (%r9,%r15,8), %rdx
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rdx,%rcx,8), %r14d
movq (%rbx), %rcx
cmpq 0x8(%rbx), %rcx
jne 0xf0e52
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
movq %r8, %r15
callq 0x2370
movq %r15, %r8
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
orq 0x38(%rsp), %r14
btsq $0x20, %r14
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r14, (%rax,%rcx,8)
movl 0xc(%r8), %r15d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r15d
movl 0x8(%r8), %r14d
movq (%rbx), %rcx
cmpq 0x8(%rbx), %rcx
jne 0xf0eae
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
movq 0x10(%rsp), %rdi
shlq $0x20, %r15
orq %r15, %r14
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r14, (%rax,%rcx,8)
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %r9
incq %r12
cmpq (%rsp), %r12
jne 0xf0d9b
jmp 0xf0f22
movq 0x1a40fb(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x144987(%rip), %rsi    # 0x235876
leaq 0x144f9b(%rip), %rdx    # 0x235e91
movl $0x7983, %ecx           # imm = 0x7983
xorl %eax, %eax
movq %r8, 0x28(%rsp)
movq %r9, 0x70(%rsp)
callq 0x22b0
movq 0x70(%rsp), %r9
movq 0x28(%rsp), %r8
movq 0x10(%rbx), %rax
movl %r14d, %ecx
jmp 0xf0e0d
movq 0x18(%rdx), %rdx
movq 0x8(%rdx), %rcx
movq 0x28(%rdx), %rdx
movq 0x68(%rsp), %r9
movq (%rdx,%r9,8), %rdx
testl %edx, %edx
je 0xf10ef
movq %rdx, %rsi
shrq $0x20, %rsi
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rsi
movq 0x8(%rsp), %rcx
andl $-0x2, %ecx
shlq $0x20, %rcx
movq %rcx, 0x8(%rsp)
movl %edx, %ecx
movq %rcx, (%rsp)
xorl %r12d, %r12d
movq %rsi, 0x20(%rsp)
leaq (%r12,%r12,2), %rcx
cmpl $0x0, 0xc(%rsi,%rcx,8)
js 0xf109c
leaq (%rsi,%rcx,8), %r8
movl 0x8(%r8), %ecx
xorq $0x1, %rcx
movq 0x18(%rsp), %rdx
movq 0x18(%rdx), %rdx
movq 0x8(%rdx), %r9
movq 0x28(%rdx), %rdx
movq (%rdx,%rcx,8), %r14
movq %r14, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %r15
testl %r14d, %r14d
je 0xf0fdb
movl %r14d, %edx
leaq (%r9,%r15,8), %rsi
addq $0xc, %rsi
xorl %ecx, %ecx
cmpl $0x0, (%rsi)
js 0xf0fca
movl -0x4(%rsi), %edi
xorl %r13d, %edi
cmpl $0x1, %edi
je 0xf0fdd
incq %rcx
addq $0x18, %rsi
cmpq %rcx, %rdx
jne 0xf0fba
jmp 0xf10ab
xorl %ecx, %ecx
cmpl %r14d, %ecx
movl %ecx, %r14d
je 0xf10ab
leaq (%r9,%r15,8), %rdx
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rdx,%rcx,8), %r14d
movq (%rbx), %rcx
cmpq 0x8(%rbx), %rcx
jne 0xf102e
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
movq %r8, %r15
callq 0x2370
movq %r15, %r8
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
orq 0x8(%rsp), %r14
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r14, (%rax,%rcx,8)
movl 0xc(%r8), %r15d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r15d
movl 0x8(%r8), %r14d
movq (%rbx), %rcx
cmpq 0x8(%rbx), %rcx
jne 0xf1085
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
shlq $0x20, %r15
orq %r15, %r14
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r14, (%rax,%rcx,8)
movq 0x20(%rsp), %rsi
incq %r12
cmpq (%rsp), %r12
jne 0xf0f6d
jmp 0xf10ef
movq 0x1a3f2e(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1447ba(%rip), %rsi    # 0x235876
leaq 0x144dce(%rip), %rdx    # 0x235e91
movl $0x79a2, %ecx           # imm = 0x79A2
xorl %eax, %eax
movq %r8, 0x38(%rsp)
movq %r9, 0x28(%rsp)
callq 0x22b0
movq 0x28(%rsp), %r9
movq 0x38(%rsp), %r8
movq 0x10(%rbx), %rax
movl %r14d, %ecx
jmp 0xf0fe9
movl %ebp, 0x20(%rsp)
cmpl $0x0, 0x30(%rsp)
movq %rbx, (%rsp)
je 0xf1233
movl 0x30(%rsp), %eax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq 0x10(%rbx), %rax
movq (%rax,%r12,8), %r14
movq 0x18(%rsp), %rdx
movq 0x10(%rdx), %rax
movl %r14d, %ebp
shrl %ebp
leaq (,%rbp,4), %rcx
addq %rbp, %rcx
cmpl $0x0, 0xc(%rax,%rcx,8)
je 0xf1170
movq %r13, %rbx
leaq (%rax,%rcx,8), %r13
movl $0x0, 0x10(%r13)
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movq 0x18(%r13), %rdi
callq 0x2220
movq $0x0, 0x18(%r13)
movq %rbx, %r13
movq (%rsp), %rbx
movq 0x18(%rsp), %rdx
movq 0x18(%rdx), %rax
movq 0x20(%rax), %rcx
orl $0x80000000, (%rcx,%rbp,8) # imm = 0x80000000
andl $-0x2, %r14d
movb $0x1, %cl
xorl %edx, %edx
orq %r14, %rdx
movq 0x28(%rax), %rsi
movq (%rsi,%rdx,8), %rdi
movq %rdi, %rsi
andq %r15, %rsi
je 0xf1212
shrq $0x20, %rdi
leaq (%rdi,%rdi,2), %rdi
shlq $0x3, %rdi
addq 0x8(%rax), %rdi
xorl %r8d, %r8d
leaq (%r8,%r8,2), %r9
orb $-0x80, 0xf(%rdi,%r9,8)
movl 0x8(%rdi,%r9,8), %r9d
xorq $0x1, %r9
movq 0x28(%rax), %r10
movq (%r10,%r9,8), %r10
movq %r10, %r9
andq %r15, %r9
je 0xf120a
movq 0x8(%rax), %r11
shrq $0x20, %r10
shlq $0x3, %r9
leaq (%r9,%r9,2), %r9
leaq (%r10,%r10,2), %r10
leaq (%r11,%r10,8), %r10
addq $0xc, %r10
xorl %r11d, %r11d
movl -0x4(%r10,%r11), %ebp
xorl %edx, %ebp
cmpl $0x1, %ebp
jne 0xf1201
orb $-0x80, 0x3(%r10,%r11)
addq $0x18, %r11
cmpq %r11, %r9
jne 0xf11ef
incq %r8
cmpq %rsi, %r8
jne 0xf11ad
movl $0x1, %edx
testb $0x1, %cl
movl $0x0, %ecx
jne 0xf1187
incq %r12
cmpq 0x8(%rsp), %r12
jne 0xf1114
movq 0x18(%rsp), %rsi
movq 0x10(%rsi), %rax
movq 0x10(%rsp), %rdi
shrl %edi
leaq (%rdi,%rdi,4), %rcx
movq 0x60(%rsp), %rdx
movq %rdx, 0x20(%rax,%rcx,8)
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movups %xmm1, 0x10(%rax,%rcx,8)
movups %xmm0, (%rax,%rcx,8)
movq 0x18(%rsi), %rax
movq 0x20(%rax), %rax
andl $0x7fffffff, (%rax,%rdi,8) # imm = 0x7FFFFFFF
movq 0x18(%rsi), %rax
movq 0x20(%rax), %rax
movl $0x80000000, %ecx       # imm = 0x80000000
andl (%rax,%rdi,8), %ecx
addl 0x20(%rsp), %ecx
movl %ecx, (%rax,%rdi,8)
movq 0x30(%rsp), %rax
movl %eax, %ebp
cmpq %rbp, (%rbx)
jbe 0xf1375
shrl %r13d
leal 0x1(%rax), %r14d
movq %r13, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x10(%rbx), %rax
movq (%rax,%rbp,8), %rcx
movq %rcx, %r15
shrq $0x20, %r15
movl %r14d, %edx
movq (%rax,%rdx,8), %r8
movl %r8d, %eax
shrl %eax
cmpl %r13d, %eax
movl %r8d, %r12d
cmovel %r15d, %r12d
cmpl %edi, %eax
cmovel %r15d, %r12d
shrq $0x20, %r8
movq 0x10(%rsi), %rax
movq 0x18(%rsi), %rdi
shrq $0x21, %rcx
leaq (%rcx,%rcx,4), %rcx
movl (%rax,%rcx,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %edx
movq %rsi, %rbx
movl %r15d, %esi
movl %r12d, %ecx
xorl %r9d, %r9d
xorl %r13d, %r13d
pushq %r13
pushq %r13
callq 0xeaa02
addq $0x10, %rsp
movq (%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax,%rbp,8), %r8d
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rdi
movl %r12d, %esi
xorl $0x1, %esi
shrl %r12d
leaq (%r12,%r12,4), %rcx
movl (%rax,%rcx,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %edx
xorl $0x1, %r15d
movl %r15d, %ecx
xorl %r9d, %r9d
pushq %r13
pushq %r13
callq 0xeaa02
movq %rbx, %rsi
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %r13
movq 0x10(%rsp), %rbx
addq $0x10, %rsp
leal 0x1(%r14), %ebp
addl $0x2, %r14d
cmpq %rbp, (%rbx)
ja 0xf12ab
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq