// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: rd_hm_bub(asg_t*, asg_t*, unsigned int, unsigned long, buf_t*)
uint64_t rd_hm_bub(asg_t *g, asg_t *ref, uint32_t v0, uint64_t max_dist, buf_t *b)
{
    uint32_t i0, i1, n_pending = 0, is_first = 1, n_tips, tip_end; uint64_t n_pop = 0;
    uint32_t v, w, d, nv0, nv1, l, x, i; asg_arc_t *av0, *av1; binfo_t *t;
    if (g->seq[v0>>1].del) return 0; // already deleted
    nv0 = g?get_real_length(g, v0, NULL):0; 
    nv1 = ref?get_real_length(ref, v0, NULL):0;
    // if((v0 == 4386) && (!ref)) {
    //     fprintf(stderr, "[M::%s] v0>>1::%u(v0&1::%u), nv0::%u, nv1::%u\n", __func__, v0>>1, v0&1, 
    //     nv0, nv1);
    // }
    if((nv0+nv1)<2) return 0;
    // if(v0 >= (ref->n_seq<<1)) {
    //     fprintf(stderr, "[M::%s] v0::%u, ref->n_seq::%u\n", __func__, v0, ref->n_seq);
    // }
    b->S.n = b->T.n = b->b.n = b->e.n = 0;
    b->a[v0].c = b->a[v0].d = b->a[v0].m = b->a[v0].nc = b->a[v0].np = 0;
    ///b->S is the nodes with all incoming edges visited
    kv_push(uint32_t, b->S, v0);
    n_tips = 0; tip_end = (uint32_t)-1;

    do {
        ///v is a node that all incoming edges have been visited
        ///d is the distance from v0 to v
        v = kv_pop(b->S); d = b->a[v].d;
        nv0 = 0; av0 = NULL; nv1 = 0; av1 = NULL; i0 = i1 = 0;
        if(g) {
            nv0 = asg_arc_n(g, v); av0 = asg_arc_a(g, v);
        }
        if(ref) {
            nv1 = asg_arc_n(ref, v); av1 = asg_arc_a(ref, v);
        }
        // if((v0 == 4386) && (!ref)) {
        //     fprintf(stderr, "[M::%s] v0>>1::%u(v0&1::%u), v>>1::%u(v&1::%u)\n", __func__, v0>>1, v0&1, v>>1, v&1);
        // }
        ///all out-edges of v
        for (i0 = 0; i0 < nv0; ++i0) { // loop through v's neighbors
            if (av0[i0].del) continue;
            w = av0[i0].v; l = (uint32_t)av0[i0].ul; t = &b->a[w];
            // if((v0 == 4386) && (!ref)) {
            //     fprintf(stderr, "[M::%s] v0>>1::%u(v0&1::%u), w>>1::%u(w&1::%u)\n", 
            //     __func__, v0>>1, v0&1, w>>1, w&1);
            // }
            if ((w>>1) == (v0>>1)) goto pop_rd_hm_bub;
            if(is_first) l = 0;
            if (d + l > max_dist) break; // too far
            ///unvisited node
            if (t->s == 0) { // this vertex has never been visited
                kv_push(uint32_t, b->b, w); // save it for revert
                t->p = v, t->s = 1, t->d = d + l;
                t->r = (g?get_real_length(g, w^1, NULL):0)+(ref?get_real_length(ref, w^1, NULL):0);
                ++n_pending;
            } else { // visited before
                ///the shortest path
                if (d + l < t->d) t->d = d + l; // update dist
            }
            // if((v0 == 4386) && (!ref) && ((w>>1) == 2597)) {
            //     fprintf(stderr, "[M::%s] w>>1::%u(w&1::%u), t->r::%u\n", 
            //     __func__, w>>1, w&1, t->r);
            // }
            //if all incoming edges of w have visited
            //push it to b->S
            if (--(t->r) == 0) {
                x = (g?get_real_length(g, w, NULL):0)+(ref?get_real_length(ref, w, NULL):0);
                // if((v0 == 4386) && (!ref) && ((w>>1) == 2597)) {
                //     fprintf(stderr, "[M::%s] w>>1::%u(w&1::%u), t->r::%u, x::%u, b->S.n::%u\n", 
                //     __func__, w>>1, w&1, t->r, x, (uint32_t)b->S.n);
                // }
                if(x > 0) {
                    // if((v0 == 4386) && (!ref)) {
                    //     fprintf(stderr, "+[M::%s] v0>>1::%u(v0&1::%u), push_w>>1::%u(w&1::%u)\n", 
                    //     __func__, v0>>1, v0&1, w>>1, w&1);
                    //     uint32_t m;
                    //     for (m = 0; m < b->S.n; m++) {
                    //         fprintf(stderr, "+[M::%s] m>>1::%u(m&1::%u)\n", __func__, b->S.a[m]>>1, b->S.a[m]&1);
                    //     }
                    // }
                    kv_push(uint32_t, b->S, w);
                } else {
                    ///at most one tip
                    if(n_tips != 0) goto pop_rd_hm_bub;
                    n_tips++; tip_end = w;
                }
                --n_pending;
            }
        }
        if (i0 >= nv0) {
            for (i1 = 0; i1 < nv1; ++i1) { // loop through v's neighbors
                if (av1[i1].del) continue;
                w = av1[i1].v; l = (uint32_t)av1[i1].ul; t = &b->a[w];
                if ((w>>1) == (v0>>1)) goto pop_rd_hm_bub;
                if(is_first) l = 0;
                if (d + l > max_dist) break; // too far
                ///unvisited node
                if (t->s == 0) { // this vertex has never been visited
                    kv_push(uint32_t, b->b, w); // save it for revert
                    t->p = v, t->s = 1, t->d = d + l;
                    t->r = (g?get_real_length(g, w^1, NULL):0)+(ref?get_real_length(ref, w^1, NULL):0);
                    ++n_pending;
                } else { // visited before
                    ///the shortest path
                    if (d + l < t->d) t->d = d + l; // update dist
                }

                //if all incoming edges of w have visited
                //push it to b->S
                if (--(t->r) == 0) {
                    x = (g?get_real_length(g, w, NULL):0)+(ref?get_real_length(ref, w, NULL):0);
                    if(x > 0) {
                        // if((v0 == 4386) && (!ref)) {
                        //     fprintf(stderr, "-[M::%s] v0>>1::%u(v0&1::%u), push_w>>1::%u(w&1::%u)\n", 
                        //     __func__, v0>>1, v0&1, w>>1, w&1);
                        // }
                        kv_push(uint32_t, b->S, w);
                    } else {
                        ///at most one tip
                        if(n_tips != 0) goto pop_rd_hm_bub;
                        n_tips++; tip_end = w;
                    }
                    --n_pending;
                }
            }
        }

        is_first = 0;
        //if found a tip
        if(n_tips == 1) {
            if(tip_end != (uint32_t)-1 && n_pending == 0 && b->S.n == 0) {
                // if((v0 == 4386) && (!ref)) {
                //     fprintf(stderr, ">[M::%s] v0>>1::%u(v0&1::%u), push_w>>1::%u(w&1::%u)\n", 
                //     __func__, v0>>1, v0&1, tip_end>>1, tip_end&1);
                // }
                kv_push(uint32_t, b->S, tip_end);
                break;
            } else {
                goto pop_rd_hm_bub;
            }
        }
        // if((v0 == 4386) && (!ref)) {
        //     fprintf(stderr, "[M::%s] v0>>1::%u(v0&1::%u), b->S.n::%u, n_pending::%u\n", 
        //             __func__, v0>>1, v0&1, (uint32_t)b->S.n, n_pending);
        // }
        ///if i < nv, that means (d + l > max_dist)
        if (i0 < nv0 || i1 < nv1 || b->S.n == 0) goto pop_rd_hm_bub;
    } while (b->S.n > 1 || n_pending);
    n_pop = 1;
    pop_rd_hm_bub:
    for (i = 0; i < b->b.n; ++i) { // clear the states of visited vertices
        t = &b->a[b->b.a[i]];
        t->s = t->c = t->d = t->m = t->nc = t->np = 0;
    }
    return n_pop;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %r9
movq 0x20(%rdi), %rax
movl %edx, %ecx
shrl %ecx
xorl %r14d, %r14d
movq %rcx, 0x60(%rsp)
cmpl $0x0, (%rax,%rcx,8)
js 0xe385b
movq %r8, %rbx
movl %edx, %ebp
movq %rsi, %r10
movq %rdi, %r11
movl %edx, %eax
testq %rdi, %rdi
je 0xe2fcc
movq 0x28(%r11), %rcx
movq (%rcx,%rax,8), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rcx, %rdx
je 0xe2fcc
movq 0x8(%r11), %rsi
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rsi,%rcx,8), %rcx
addq $0xc, %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
xorl %r14d, %r14d
movl (%rcx,%rsi), %edi
notl %edi
shrl $0x1f, %edi
addl %edi, %r14d
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0xe2fb8
xorl %ecx, %ecx
testq %r10, %r10
je 0xe301c
movq 0x28(%r10), %rdx
movq (%rdx,%rax,8), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rdx, %rsi
je 0xe301c
movq 0x8(%r10), %rcx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %ecx, %ecx
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %ecx
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe3005
addl %r14d, %ecx
xorl %r14d, %r14d
cmpl $0x2, %ecx
jb 0xe385b
movq %r14, 0x50(%rbx)
movq %r14, 0x38(%rbx)
movq %r14, 0x20(%rbx)
movq %r14, 0x8(%rbx)
movq (%rbx), %rcx
leaq (%rax,%rax,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rax, %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rcx,%rdx)
movl $0x0, 0x14(%rcx,%rdx)
cmpq %r14, 0x10(%rbx)
movq %r9, 0x20(%rsp)
movq %r10, 0x18(%rsp)
movq %r11, 0x10(%rsp)
jne 0xe3097
movq $0x2, 0x10(%rbx)
movq 0x18(%rbx), %rdi
movl $0x8, %esi
callq 0x2370
movq 0x10(%rsp), %r11
movq 0x18(%rsp), %r10
movq 0x20(%rsp), %r9
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rbx)
movl %ebp, (%rcx,%rax,4)
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
xorl %edi, %edi
movq $0x0, 0x50(%rsp)
movq 0x18(%rbx), %rax
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
leaq -0x1(%rdx), %rsi
movq %rsi, 0x8(%rbx)
movl -0x4(%rax,%rdx,4), %r8d
xorl %esi, %esi
testq %r11, %r11
je 0xe30f9
movq 0x28(%r11), %rax
movq (%rax,%r8,8), %rax
movq %rax, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %r15
shlq $0x3, %r15
addq 0x8(%r11), %r15
jmp 0xe30fe
xorl %eax, %eax
xorl %r15d, %r15d
leaq (%r8,%r8,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %r8, %rdx
movl 0x4(%rcx,%rdx), %ecx
movl %ecx, 0x34(%rsp)
testq %r10, %r10
je 0xe3133
movq 0x28(%r10), %rcx
movq (%rcx,%r8,8), %rsi
movq %rsi, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%r10), %rcx
jmp 0xe3135
xorl %ecx, %ecx
movq %rcx, 0x40(%rsp)
movq %r8, 0x58(%rsp)
movq %rsi, 0x38(%rsp)
testl %eax, %eax
setne %dl
je 0xe3468
movl %eax, %eax
movq %rax, 0x48(%rsp)
xorl %r12d, %r12d
movl $0x0, 0x4(%rsp)
movq %r15, 0x28(%rsp)
leaq (%r12,%r12,2), %rax
cmpl $0x0, 0xc(%r15,%rax,8)
js 0xe3455
leaq (%r15,%rax,8), %rax
movl 0x8(%rax), %r13d
movl %r13d, %ecx
shrl %ecx
cmpl 0x60(%rsp), %ecx
je 0xe3819
xorl %ebp, %ebp
testb $0x1, 0x50(%rsp)
je 0xe3198
movl (%rax), %ebp
addl 0x34(%rsp), %ebp
cmpq %r9, %rbp
ja 0xe37b5
leaq (,%r13,8), %rax
addq %r13, %rax
leaq (%rax,%rax,2), %r15
addq %r13, %r15
addq (%rbx), %r15
cmpl $0x0, 0x18(%r15)
js 0xe32fb
movl %edi, 0xc(%rsp)
movq 0x40(%rbx), %rax
cmpq %rax, 0x38(%rbx)
jne 0xe3207
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x40(%rbx)
movq 0x48(%rbx), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x10(%rsp), %r11
movq 0x18(%rsp), %r10
movq 0x20(%rsp), %r9
movq %rax, 0x48(%rbx)
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x38(%rbx)
movl %r13d, (%rcx,%rax,4)
orb $-0x80, 0x1b(%r15)
xorl %eax, %eax
movq 0x58(%rsp), %rcx
movl %ecx, (%r15)
movl %ebp, 0x4(%r15)
movl $0x0, %ecx
testq %r11, %r11
je 0xe3290
movq %r13, %rcx
xorq $0x1, %rcx
movq 0x28(%r11), %rdx
movq (%rdx,%rcx,8), %rdx
movq %rdx, %rsi
movl $0x0, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe3290
movq 0x8(%r11), %rcx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %ecx, %ecx
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %ecx
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe3279
testq %r10, %r10
je 0xe32e8
movq %r13, %rdx
xorq $0x1, %rdx
movq 0x28(%r10), %rsi
movq (%rsi,%rdx,8), %rdx
movq %rdx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe32e8
movq 0x8(%r10), %rax
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %eax, %eax
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %eax
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe32d1
addl %ecx, %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0x18(%r15)
movl 0xc(%rsp), %edi
incl %edi
jmp 0xe3305
cmpl 0x4(%r15), %ebp
jae 0xe3305
movl %ebp, 0x4(%r15)
movl 0x18(%r15), %eax
leal -0x1(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, 0x18(%r15)
testl %ecx, %ecx
je 0xe332b
movq 0x28(%rsp), %r15
jmp 0xe3455
movl %edi, %ebp
xorl %eax, %eax
movl $0x0, %ecx
testq %r11, %r11
movq 0x28(%rsp), %r15
je 0xe338f
movq 0x28(%r11), %rcx
movq (%rcx,%r13,8), %rdx
movq %rdx, %rsi
movl $0x0, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe338f
movq 0x8(%r11), %rcx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %ecx, %ecx
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %ecx
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe3378
testq %r10, %r10
je 0xe33e0
movq 0x28(%r10), %rdx
movq (%rdx,%r13,8), %rdx
movq %rdx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe33e0
movq 0x8(%r10), %rax
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %eax, %eax
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %eax
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe33c9
addl %eax, %ecx
jne 0xe33ff
movl %r13d, 0x8(%rsp)
cmpl $0x0, 0x4(%rsp)
movl $0x1, 0x4(%rsp)
movl %ebp, %edi
je 0xe3453
jmp 0xe3819
movq 0x10(%rbx), %rax
cmpq %rax, 0x8(%rbx)
jne 0xe343d
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x10(%rbx)
movq 0x18(%rbx), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x10(%rsp), %r11
movq 0x18(%rsp), %r10
movq 0x20(%rsp), %r9
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rbx)
movl %r13d, (%rcx,%rax,4)
movl %ebp, %edi
decl %edi
incq %r12
cmpq 0x48(%rsp), %r12
setb %dl
jne 0xe3166
jmp 0xe3470
movl $0x0, 0x4(%rsp)
movq 0x38(%rsp), %rax
testl %eax, %eax
movq 0x40(%rsp), %r12
je 0xe37b1
movl %eax, %eax
movq %rax, 0x48(%rsp)
xorl %ebp, %ebp
movb %dl, 0x28(%rsp)
leaq (,%rbp,2), %rax
addq %rbp, %rax
cmpl $0x0, 0xc(%r12,%rax,8)
js 0xe379c
leaq (%r12,%rax,8), %rax
movl 0x8(%rax), %r13d
movl %r13d, %ecx
shrl %ecx
cmpl 0x60(%rsp), %ecx
je 0xe3819
xorl %r15d, %r15d
testb $0x1, 0x50(%rsp)
je 0xe34ca
movl (%rax), %r15d
addl 0x34(%rsp), %r15d
cmpq %r9, %r15
ja 0xe37c0
leaq (,%r13,8), %rax
addq %r13, %rax
leaq (%rax,%rax,2), %r12
addq %r13, %r12
addq (%rbx), %r12
cmpl $0x0, 0x18(%r12)
js 0xe3637
movl %edi, 0xc(%rsp)
movq 0x40(%rbx), %rax
cmpq %rax, 0x38(%rbx)
jne 0xe353b
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x40(%rbx)
movq 0x48(%rbx), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x10(%rsp), %r11
movq 0x18(%rsp), %r10
movq 0x20(%rsp), %r9
movq %rax, 0x48(%rbx)
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x38(%rbx)
movl %r13d, (%rcx,%rax,4)
orb $-0x80, 0x1b(%r12)
xorl %eax, %eax
movq 0x58(%rsp), %rcx
movl %ecx, (%r12)
movl %r15d, 0x4(%r12)
movl $0x0, %ecx
testq %r11, %r11
je 0xe35c7
movq %r13, %rcx
xorq $0x1, %rcx
movq 0x28(%r11), %rdx
movq (%rdx,%rcx,8), %rdx
movq %rdx, %rsi
movl $0x0, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe35c7
movq 0x8(%r11), %rcx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %ecx, %ecx
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %ecx
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe35b0
testq %r10, %r10
je 0xe361f
movq %r13, %rdx
xorq $0x1, %rdx
movq 0x28(%r10), %rsi
movq (%rsi,%rdx,8), %rdx
movq %rdx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe361f
movq 0x8(%r10), %rax
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %eax, %eax
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %eax
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe3608
addl %ecx, %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0x18(%r12)
movl 0xc(%rsp), %edi
incl %edi
movb 0x28(%rsp), %dl
jmp 0xe3643
cmpl 0x4(%r12), %r15d
jae 0xe3643
movl %r15d, 0x4(%r12)
movl 0x18(%r12), %eax
leal -0x1(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, 0x18(%r12)
testl %ecx, %ecx
je 0xe366b
movq 0x40(%rsp), %r12
jmp 0xe379c
movl %edi, %r15d
xorl %eax, %eax
movl $0x0, %ecx
testq %r11, %r11
movq 0x40(%rsp), %r12
je 0xe36d0
movq 0x28(%r11), %rcx
movq (%rcx,%r13,8), %rdx
movq %rdx, %rsi
movl $0x0, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe36d0
movq 0x8(%r11), %rcx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %ecx, %ecx
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %ecx
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe36b9
testq %r10, %r10
je 0xe3721
movq 0x28(%r10), %rdx
movq (%rdx,%r13,8), %rdx
movq %rdx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe3721
movq 0x8(%r10), %rax
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0xc, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %eax, %eax
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %eax
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe370a
addl %eax, %ecx
jne 0xe3741
movl %r13d, 0x8(%rsp)
cmpl $0x0, 0x4(%rsp)
movl $0x1, 0x4(%rsp)
movl %r15d, %edi
je 0xe3796
jmp 0xe3819
movq 0x10(%rbx), %rax
cmpq %rax, 0x8(%rbx)
jne 0xe377f
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x10(%rbx)
movq 0x18(%rbx), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x10(%rsp), %r11
movq 0x18(%rsp), %r10
movq 0x20(%rsp), %r9
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rbx)
movl %r13d, (%rcx,%rax,4)
movl %r15d, %edi
decl %edi
movb 0x28(%rsp), %dl
incq %rbp
cmpq 0x48(%rsp), %rbp
jne 0xe348f
movq 0x38(%rsp), %rbp
jmp 0xe37c0
xorl %ebp, %ebp
jmp 0xe37c0
xorl %ebp, %ebp
testb $0x1, %dl
je 0xe3470
cmpl $0x1, 0x4(%rsp)
je 0xe37ff
cmpl 0x38(%rsp), %ebp
setb %al
orb %al, %dl
testb $0x1, %dl
jne 0xe3819
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0xe3819
movb $0x1, %cl
movq %rcx, 0x50(%rsp)
cmpq $0x1, %rax
jne 0xe30bd
testl %edi, %edi
jne 0xe30bd
movl $0x1, %r14d
jmp 0xe3819
xorl %r14d, %r14d
movl 0x8(%rsp), %esi
cmpl $-0x1, %esi
je 0xe3819
testl %edi, %edi
jne 0xe3819
cmpq $0x0, 0x8(%rbx)
je 0xe386d
xorl %r14d, %r14d
cmpq $0x0, 0x38(%rbx)
je 0xe385b
movl $0x1, %eax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movq (%rbx), %rdx
movq 0x48(%rbx), %rsi
movl (%rsi,%rcx,4), %ecx
leaq (%rcx,%rcx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rcx, %rsi
movups %xmm0, 0x4(%rdx,%rsi)
movl $0x0, 0x14(%rdx,%rsi)
andb $0x7f, 0x1b(%rdx,%rsi)
movl %eax, %ecx
incl %eax
cmpq %rcx, 0x38(%rbx)
ja 0xe382a
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x10(%rbx)
jne 0xe3892
movq $0x2, 0x10(%rbx)
movq 0x18(%rbx), %rdi
movl $0x8, %esi
callq 0x2370
movl 0x8(%rsp), %esi
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rbx)
movl %esi, (%rcx,%rax,4)
jmp 0xe37f7