// File: /workspace/github_cpp_makefile_star2_O3/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, %r10
movq 0x20(%rdi), %rax
movl %edx, %ecx
shrl %ecx
xorl %r14d, %r14d
movq %rcx, 0x60(%rsp)
cmpl $0x0, (%rax,%rcx,8)
js 0xe4faa
movl %edx, %ebp
movq %rsi, %r11
movq %rdi, %r15
movq 0x28(%rdi), %rcx
movl %edx, %eax
movq (%rcx,%rax,8), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rcx, %rdx
je 0xe4764
movq 0x8(%r15), %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 0xe4750
xorl %ecx, %ecx
testq %r11, %r11
je 0xe47b4
movq 0x28(%r11), %rdx
movq (%rdx,%rax,8), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rdx, %rsi
je 0xe47b4
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), %r9d
notl %r9d
shrl $0x1f, %r9d
addl %r9d, %ecx
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe479d
addl %r14d, %ecx
cmpl $0x2, %ecx
jae 0xe47c4
xorl %r14d, %r14d
jmp 0xe4faa
xorl %ecx, %ecx
movq %rcx, 0x50(%r8)
movq %rcx, 0x38(%r8)
movq %rcx, 0x20(%r8)
movq %rcx, 0x8(%r8)
movq (%r8), %rdx
leaq (%rax,%rax,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rax, %rsi
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rdx,%rsi)
movl $0x0, 0x14(%rdx,%rsi)
cmpq %rcx, 0x10(%r8)
movq %r10, 0x20(%rsp)
movq %r11, 0x18(%rsp)
movq %r8, 0x8(%rsp)
je 0xe4811
movq 0x18(%r8), %rax
xorl %ecx, %ecx
jmp 0xe483e
movq $0x2, 0x10(%r8)
movq 0x18(%r8), %rdi
movl $0x8, %esi
callq 0x2370
movq 0x8(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq %rax, 0x18(%r8)
movq 0x8(%r8), %rcx
movl %ebp, (%rax,%rcx,4)
incq %rcx
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
xorl %r14d, %r14d
xorl %ebx, %ebx
movq $0x0, 0x50(%rsp)
movq (%r8), %rax
movq 0x18(%r8), %rdx
leaq -0x1(%rcx), %rsi
movq %rsi, 0x8(%r8)
movl -0x4(%rdx,%rcx,4), %esi
testq %r11, %r11
je 0xe4896
movq 0x28(%r11), %rcx
movq (%rcx,%rsi,8), %rcx
movq %rcx, 0x30(%rsp)
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%r11), %rcx
movq %rcx, 0x38(%rsp)
jmp 0xe48a8
movq $0x0, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
leaq (%rsi,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %rdx
addq %rsi, %rdx
movq 0x28(%r15), %rcx
movq %rsi, 0x58(%rsp)
movq (%rcx,%rsi,8), %rcx
movl 0x4(%rax,%rdx), %eax
movl %eax, 0x2c(%rsp)
testl %ecx, %ecx
je 0xe4bea
movq %rcx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x8(%r15), %rsi
movl %ecx, %eax
movq %rax, 0x48(%rsp)
xorl %r12d, %r12d
movb $0x1, %al
movl $0x0, 0x4(%rsp)
movq %rsi, 0x40(%rsp)
leaq (%r12,%r12,2), %rcx
cmpl $0x0, 0xc(%rsi,%rcx,8)
js 0xe4bd7
leaq (%rsi,%rcx,8), %rcx
movl 0x8(%rcx), %ebp
movl %ebp, %edx
shrl %edx
cmpl 0x60(%rsp), %edx
je 0xe4f68
movl %ebx, (%rsp)
movq %r15, %rbx
movl $0x0, %r15d
testb $0x1, 0x50(%rsp)
je 0xe4936
movl (%rcx), %r15d
addl 0x2c(%rsp), %r15d
cmpq %r10, %r15
ja 0xe4eff
leaq (,%rbp,8), %rax
addq %rbp, %rax
leaq (%rax,%rax,2), %r13
addq %rbp, %r13
addq (%r8), %r13
movl 0x18(%r13), %eax
testl %eax, %eax
js 0xe4a8f
movq 0x38(%r8), %rcx
movq 0x48(%r8), %rax
cmpq 0x40(%r8), %rcx
jne 0xe49aa
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x40(%r8)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq %rax, 0x48(%r8)
movq 0x38(%r8), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x38(%r8)
movl %ebp, (%rax,%rcx,4)
movq 0x58(%rsp), %rax
movl %eax, (%r13)
orb $-0x80, 0x1b(%r13)
movl %r15d, 0x4(%r13)
movq %rbp, %rdx
xorq $0x1, %rdx
movq %rbx, %r15
movq 0x28(%rbx), %rax
movq (%rax,%rdx,8), %rsi
xorl %eax, %eax
movq %rsi, %rdi
movl $0x0, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
andq %r8, %rdi
je 0xe4a26
movq 0x8(%r15), %rcx
shrq $0x20, %rsi
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rsi
addq $0xc, %rsi
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdi
xorl %r8d, %r8d
xorl %ecx, %ecx
movl (%rsi,%r8), %r9d
notl %r9d
shrl $0x1f, %r9d
addl %r9d, %ecx
addq $0x18, %r8
cmpq %r8, %rdi
jne 0xe4a0f
testq %r11, %r11
movl (%rsp), %ebx
je 0xe4a7a
movq 0x28(%r11), %rsi
movq (%rsi,%rdx,8), %rdx
movq %rdx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe4a7a
movq 0x8(%r11), %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 0xe4a63
addl %ecx, %eax
orl $0x80000000, %eax       # imm = 0x80000000
incl %ebx
movq 0x8(%rsp), %r8
movq 0x40(%rsp), %rsi
jmp 0xe4a9f
cmpl 0x4(%r13), %r15d
jae 0xe4a99
movl %r15d, 0x4(%r13)
movq %rbx, %r15
movl (%rsp), %ebx
addl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %ecx
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x18(%r13)
testl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
jne 0xe4bd7
movq 0x28(%r15), %rax
movq (%rax,%rbp,8), %rdx
xorl %eax, %eax
movq %rdx, %rsi
movl $0x0, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe4b0e
movq 0x8(%r15), %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), %r9d
notl %r9d
shrl $0x1f, %r9d
addl %r9d, %ecx
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe4af7
testq %r11, %r11
je 0xe4b5f
movq 0x28(%r11), %rdx
movq (%rdx,%rbp,8), %rdx
movq %rdx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe4b5f
movq 0x8(%r11), %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), %r9d
notl %r9d
shrl $0x1f, %r9d
addl %r9d, %eax
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe4b48
addl %eax, %ecx
jne 0xe4b80
movl %ebp, 0x14(%rsp)
cmpl $0x0, 0x4(%rsp)
movl $0x1, 0x4(%rsp)
movq 0x40(%rsp), %rsi
je 0xe4bd5
jmp 0xe4f68
movq 0x8(%r8), %rcx
movq 0x18(%r8), %rax
cmpq 0x10(%r8), %rcx
jne 0xe4bc5
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x10(%r8)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq %rax, 0x18(%r8)
movq 0x8(%r8), %rcx
movq 0x40(%rsp), %rsi
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r8)
movl %ebp, (%rax,%rcx,4)
decl %ebx
incq %r12
cmpq 0x48(%rsp), %r12
setb %al
jne 0xe48fc
jmp 0xe4bf2
movl $0x0, 0x4(%rsp)
movq 0x30(%rsp), %rax
testl %eax, %eax
je 0xe4ef9
movl %eax, %eax
movq %rax, 0x48(%rsp)
xorl %r12d, %r12d
movq 0x38(%rsp), %rcx
leaq (%r12,%r12,2), %rax
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0xe4ee2
leaq (%rcx,%rax,8), %rax
movl 0x8(%rax), %r13d
movl %r13d, %ecx
shrl %ecx
cmpl 0x60(%rsp), %ecx
je 0xe4f68
movl %ebx, (%rsp)
movq %r12, %rbx
xorl %r12d, %r12d
testb $0x1, 0x50(%rsp)
je 0xe4c47
movl (%rax), %r12d
addl 0x2c(%rsp), %r12d
cmpq %r10, %r12
ja 0xe4f06
leaq (,%r13,8), %rax
addq %r13, %rax
leaq (%rax,%rax,2), %rbp
addq %r13, %rbp
addq (%r8), %rbp
movl 0x18(%rbp), %eax
testl %eax, %eax
js 0xe4d8b
movq 0x38(%r8), %rcx
movq 0x48(%r8), %rax
cmpq 0x40(%r8), %rcx
jne 0xe4cba
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x40(%r8)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq %rax, 0x48(%r8)
movq 0x38(%r8), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x38(%r8)
movl %r13d, (%rax,%rcx,4)
movq 0x58(%rsp), %rax
movl %eax, (%rbp)
orb $-0x80, 0x1b(%rbp)
movl %r12d, 0x4(%rbp)
movq %r13, %rdx
xorq $0x1, %rdx
movq 0x28(%r15), %rax
movq (%rax,%rdx,8), %rsi
xorl %eax, %eax
movq %rsi, %rdi
movl $0x0, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
andq %r8, %rdi
je 0xe4d32
movq 0x8(%r15), %rcx
shrq $0x20, %rsi
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rsi
addq $0xc, %rsi
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdi
xorl %r8d, %r8d
xorl %ecx, %ecx
movl (%rsi,%r8), %r9d
notl %r9d
shrl $0x1f, %r9d
addl %r9d, %ecx
addq $0x18, %r8
cmpq %r8, %rdi
jne 0xe4d1b
testq %r11, %r11
movq %rbx, %r12
je 0xe4d9d
movq 0x28(%r11), %rsi
movq (%rsi,%rdx,8), %rdx
movq %rdx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
movl (%rsp), %ebx
je 0xe4da0
movq 0x8(%r11), %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 0xe4d72
jmp 0xe4da0
cmpl 0x4(%rbp), %r12d
jae 0xe4d95
movl %r12d, 0x4(%rbp)
movq %rbx, %r12
movl (%rsp), %ebx
jmp 0xe4dae
movl (%rsp), %ebx
addl %ecx, %eax
orl $0x80000000, %eax       # imm = 0x80000000
incl %ebx
movq 0x8(%rsp), %r8
addl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %ecx
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x18(%rbp)
testl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
jne 0xe4edd
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rdx
xorl %eax, %eax
movq %rdx, %rsi
movl $0x0, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe4e1c
movq 0x8(%r15), %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), %r9d
notl %r9d
shrl $0x1f, %r9d
addl %r9d, %ecx
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe4e05
testq %r11, %r11
je 0xe4e6d
movq 0x28(%r11), %rdx
movq (%rdx,%r13,8), %rdx
movq %rdx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0xe4e6d
movq 0x8(%r11), %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), %r9d
notl %r9d
shrl $0x1f, %r9d
addl %r9d, %eax
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xe4e56
addl %eax, %ecx
jne 0xe4e8a
movl %r13d, 0x14(%rsp)
cmpl $0x0, 0x4(%rsp)
movl $0x1, 0x4(%rsp)
je 0xe4edb
jmp 0xe4f68
movq 0x8(%r8), %rcx
movq 0x18(%r8), %rax
cmpq 0x10(%r8), %rcx
jne 0xe4ecf
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x10(%r8)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq %rax, 0x18(%r8)
movq 0x8(%r8), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r8)
movl %r13d, (%rax,%rcx,4)
decl %ebx
movq 0x38(%rsp), %rcx
incq %r12
cmpq 0x48(%rsp), %r12
jne 0xe4c0e
xorl %eax, %eax
movq 0x30(%rsp), %rcx
jmp 0xe4f0e
xorl %eax, %eax
xorl %ecx, %ecx
jmp 0xe4f0e
xorl %ecx, %ecx
movq %rbx, %r15
jmp 0xe4f0b
xorl %eax, %eax
movq %rbx, %rcx
movl (%rsp), %ebx
cmpl $0x1, 0x4(%rsp)
je 0xe4f4c
cmpl 0x30(%rsp), %ecx
setb %cl
orb %cl, %al
testb $0x1, %al
jne 0xe4f68
movq 0x8(%r8), %rcx
testq %rcx, %rcx
je 0xe4f68
movb $0x1, %al
movq %rax, 0x50(%rsp)
cmpq $0x1, %rcx
jne 0xe485a
testl %ebx, %ebx
jne 0xe485a
movl $0x1, %r14d
jmp 0xe4f68
movl %ebx, %eax
xorl %r14d, %r14d
movl 0x14(%rsp), %ebx
cmpl $-0x1, %ebx
je 0xe4f68
testl %eax, %eax
jne 0xe4f68
cmpq $0x0, 0x8(%r8)
je 0xe4fbc
xorl %r14d, %r14d
cmpq $0x0, 0x38(%r8)
je 0xe4faa
movl $0x1, %eax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movq (%r8), %rdx
movq 0x48(%r8), %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(%r8)
ja 0xe4f79
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x10(%r8)
movq 0x18(%r8), %rax
je 0xe4fcb
xorl %ecx, %ecx
jmp 0xe4fed
movq $0x2, 0x10(%r8)
movl $0x8, %esi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r8
movq %rax, 0x18(%r8)
movq 0x8(%r8), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r8)
movl %ebx, (%rax,%rcx,4)
jmp 0xe4f44