// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: renew_phase_bubble(rd_hamming_fly_simp_t*, unsigned long, buf_t*, ma_ug_t*, unsigned long, unsigned int, unsigned int, hap_cov_t*, utg_trans_t*, unsigned int)
uint64_t renew_phase_bubble(rd_hamming_fly_simp_t *pf, uint64_t v0, buf_t *b, ma_ug_t *ug, uint64_t max_dist, 
uint32_t positive_flag, uint32_t negative_flag, hap_cov_t *cov, utg_trans_t *o, uint32_t is_update_chain)
{
    uint64_t v, k, i, v1 = b->S.a[0], is_update, is_pop = 0; ma_ug_t *fg = pf->fg;
    uint8_t *s = pf->vs; asg32_v *bc = pf->srt; uint8_t sn = 1, se = 2; uint64_t max_dist0 = max_dist;
    bc->n = 0; kv_resize(uint32_t, (*bc), b->b.n);
    assert((fg->u.a[v0>>1].len == ug->u.a[v0>>1].len) && (fg->u.a[v0>>1].n == ug->u.a[v0>>1].n));
    assert((fg->u.a[v1>>1].len == ug->u.a[v1>>1].len) && (fg->u.a[v1>>1].n == ug->u.a[v1>>1].n));


    // if(((v0>>1) == 7536) && ((v1>>1) == 99223)) {
    //     print_simple_dbg_gfa(ug->g, "ug0");
    // }

    ///b->S.a[0] is the sink of this bubble
    for (i = 0; i < b->b.n; i++) {
        v = b->b.a[i];
        if((v == v0) || (v == v1)) continue;
        s[v] = sn;
        kv_push(uint32_t, *bc, v);
        assert((fg->u.a[v>>1].len == ug->u.a[v>>1].len) && (fg->u.a[v>>1].n == ug->u.a[v>>1].n));
    }
    
    asg_arc_t *av, *za, *ra; uint32_t an, zn, rn, ri;
    v = v0;
    av = asg_arc_a(fg->g, v); 
    an = asg_arc_n(fg->g, v); 
    for (k = 0; k < an; k++) {
        av[k].del = 1; asg_arc_del(fg->g, av[k].v^1, (av[k].ul>>32)^1, 1);
    }
    fg->g->seq[v>>1].c = ug->g->seq[v>>1].c;


    v = v1^1; 
    av = asg_arc_a(fg->g, v); 
    an = asg_arc_n(fg->g, v); 
    for (k = 0; k < an; k++) {
        av[k].del = 1; asg_arc_del(fg->g, av[k].v^1, (av[k].ul>>32)^1, 1);
    }
    fg->g->seq[v>>1].c = ug->g->seq[v>>1].c;


    for (i = 0; i < bc->n; i++) {
        v = bc->a[i];
        av = asg_arc_a(fg->g, v); an = asg_arc_n(fg->g, v); 
        for (k = 0; k < an; k++) {
            // av[k].del = 1;
            av[k].del = 1; asg_arc_del(fg->g, av[k].v^1, (av[k].ul>>32)^1, 1);
        }

        v ^= 1;
        av = asg_arc_a(fg->g, v); an = asg_arc_n(fg->g, v); 
        for (k = 0; k < an; k++) {
            // av[k].del = 1;
            av[k].del = 1; asg_arc_del(fg->g, av[k].v^1, (av[k].ul>>32)^1, 1);
        }

        fg->g->seq[v>>1].c = ug->g->seq[v>>1].c;
    }


    for (i = 0; i < bc->n; i++) {
        v = bc->a[i];
        za = asg_arc_a(ug->g, v); zn = asg_arc_n(ug->g, v); 
        av = asg_arc_a(fg->g, v); an = asg_arc_n(fg->g, v); 

        ///set
        for (k = 0; k < zn; k++) {
            if((za[k].del) || (!s[za[k].v])) continue;
            s[za[k].v] |= se;
        }

        
        for (k = 0; k < an; k++) {
            ///s[av[k].v]&se:: in the existing graph
            if((!s[av[k].v]) || (s[av[k].v]&se)) continue; ///in the existing graph
            // if((av[k].v) == (v>>1)) continue;///looks like a bug
            if((av[k].v>>1) == (v>>1)) continue;
            av[k].del = 0;

            ra = asg_arc_a(fg->g, (av[k].v^1)); rn = asg_arc_n(fg->g, (av[k].v^1));
            for (ri = 0; ri < rn; ri++) {
                if(ra[ri].v == ((av[k].ul>>32)^1)) {
                    ra[ri].del = 0; break;
                }
            }
            assert(ri < rn);
        }

        ///reset
        for (k = 0; k < zn; k++) {
            if((za[k].del) || (!s[za[k].v])) continue;
            if(s[za[k].v]&se) s[za[k].v] -= se;
        }
    }


    is_update = rd_hamming_symm_simple0(b, ug->g, fg->g, v0, v1^1, max_dist, &max_dist);

    // if(((v0>>1) == 7536) && ((v1>>1) == 99223)) {
    //     fprintf(stderr, "v0::utg%.6lul(%c)\tv1::utg%.6lul(%c)\n", (v0>>1) + 1, "+-"[(v0&1)], (v1>>1) + 1, "+-"[(v1&1)]);
    //     for (i = 0; i < bc->n; i++) fprintf(stderr, "w::utg%.6ul(%c)\n", (bc->a[i]>>1) + 1, "+-"[(bc->a[i]&1)]);
    //     print_simple_dbg_gfa(ug->g, "ug1");
    //     print_simple_dbg_gfa(fg->g, "fg0");
    // }

    // fprintf(stderr, "[M::%s] is_update::%lu\n", __func__, is_update);
    if(is_update) {
        for (i = 0; i < bc->n; i++) {
            append_node_arcs(fg->g, ug->g, s, se, bc->a[i]);
            append_node_arcs(fg->g, ug->g, s, se, bc->a[i]^1);
        }
        append_node_arcs(fg->g, ug->g, s, se, v0);
        append_node_arcs(fg->g, ug->g, s, se, v1^1);
        is_pop = bub_pop_merge(ug, fg, v0, v1, max_dist, b, positive_flag, negative_flag, cov, is_update_chain, o, pf->ae, pf->src, pf->cov, pf->max_hang, pf->min_ovlp, pf->gap_fuzz, &(pf->n_insert));
    } else {
        max_dist = max_dist0;
        is_pop = asg_bub_pop1_primary_trio(ug->g, ug, v0, max_dist, b, positive_flag, negative_flag, 1, NULL, NULL, cov, is_update_chain, 0, o);
    }



    for (i = 0; i < bc->n; i++) s[bc->a[i]] = 0;
    ///reset
    v = v0;
    av = asg_arc_a(fg->g, v); 
    an = asg_arc_n(fg->g, v); 
    for (k = 0; k < an; k++) {
        av[k].del = 0; asg_arc_del(fg->g, av[k].v^1, (av[k].ul>>32)^1, 0);
    }
    fg->g->seq[v>>1].c = PRIMARY_LABLE;


    v = v1^1; 
    av = asg_arc_a(fg->g, v); 
    an = asg_arc_n(fg->g, v); 
    for (k = 0; k < an; k++) {
        av[k].del = 0; asg_arc_del(fg->g, av[k].v^1, (av[k].ul>>32)^1, 0);
    }
    fg->g->seq[v>>1].c = PRIMARY_LABLE;


    for (i = 0; i < bc->n; i++) {
        v = bc->a[i];
        av = asg_arc_a(fg->g, v); 
        an = asg_arc_n(fg->g, v); 
        for (k = 0; k < an; k++) {
            av[k].del = 0; asg_arc_del(fg->g, av[k].v^1, (av[k].ul>>32)^1, 0);
        }

        v ^= 1;
        av = asg_arc_a(fg->g, v); 
        an = asg_arc_n(fg->g, v); 
        for (k = 0; k < an; k++) {
            av[k].del = 0; asg_arc_del(fg->g, av[k].v^1, (av[k].ul>>32)^1, 0);
        }

        fg->g->seq[v>>1].c = PRIMARY_LABLE;
    }
    return is_pop;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %r9d, %ebp
movq %rcx, %r14
movq %rdi, %r12
movq %r8, 0xc8(%rsp)
movq %r8, 0x98(%rsp)
movq 0x18(%rdx), %rax
movl (%rax), %r13d
movq 0x30(%rdi), %rbx
movq 0x20(%rdi), %rdi
movq 0x28(%r12), %r15
movq $0x0, (%rdi)
movq 0x38(%rdx), %rax
cmpq %rax, 0x8(%rdi)
movq %rdi, 0x68(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdx, 0x80(%rsp)
jae 0xe61c9
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%rdi)
movq 0x10(%rdi), %rdi
leaq 0x4(,%rcx,4), %rsi
callq 0x2370
movq 0x80(%rsp), %rdx
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdi
movq %rax, 0x10(%rdi)
movq 0x10(%rbx), %rax
movq %rsi, %rcx
shrq %rcx
movq %rcx, 0xb0(%rsp)
leaq (,%rcx,8), %rcx
leaq (%rcx,%rcx,4), %r9
movq 0x10(%r14), %rcx
movl (%rcx,%r9), %r8d
xorl (%rax,%r9), %r8d
testl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jne 0xe6d62
leaq (%rax,%r9), %r8
addq %rcx, %r9
movl 0x10(%r8), %r8d
cmpl 0x10(%r9), %r8d
jne 0xe6d62
movq %r12, 0xd0(%rsp)
movq %r14, 0x88(%rsp)
movl %ebp, 0x7c(%rsp)
movl %r13d, %r8d
shrl %r8d
movq %r8, 0xa8(%rsp)
leaq (,%r8,8), %r8
leaq (%r8,%r8,4), %r9
movl (%rcx,%r9), %r8d
xorl (%rax,%r9), %r8d
testl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jne 0xe6d81
addq %r9, %rax
addq %r9, %rcx
movl 0x10(%rax), %eax
cmpl 0x10(%rcx), %eax
jne 0xe6d81
cmpq $0x0, 0x38(%rdx)
je 0xe6338
xorl %r14d, %r14d
movl $0x2, %ebp
movq 0x48(%rdx), %rax
movl (%rax,%r14,4), %r12d
cmpq %rsi, %r12
je 0xe632b
cmpl %r13d, %r12d
je 0xe632b
movb $0x1, (%r15,%r12)
movq 0x8(%rdi), %rax
cmpq %rax, (%rdi)
jne 0xe62d7
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %rbp, %rsi
movq %rsi, 0x8(%rdi)
movq 0x10(%rdi), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x80(%rsp), %rdx
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdi
movq %rax, 0x10(%rdi)
movq (%rdi), %rax
movq 0x10(%rdi), %rcx
leaq 0x1(%rax), %r8
movq %r8, (%rdi)
movl %r12d, (%rcx,%rax,4)
movq 0x10(%rbx), %rax
shrl %r12d
shlq $0x3, %r12
leaq (%r12,%r12,4), %r9
movq 0x88(%rsp), %rcx
movq 0x10(%rcx), %rcx
movl (%rcx,%r9), %r8d
xorl (%rax,%r9), %r8d
testl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jne 0xe6d43
addq %r9, %rax
addq %r9, %rcx
movl 0x10(%rax), %eax
cmpl 0x10(%rcx), %eax
jne 0xe6d43
incq %r14
cmpq 0x38(%rdx), %r14
jb 0xe627d
movq %r13, 0xa0(%rsp)
movq 0x18(%rbx), %rdi
movq 0x28(%rdi), %rax
movq (%rax,%rsi,8), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rdx, %rcx
andq %rax, %rcx
movq 0x88(%rsp), %r13
je 0xe63e5
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x3, %rdx
addq 0x8(%rdi), %rdx
xorl %esi, %esi
leaq (%rsi,%rsi,2), %rdi
orb $-0x80, 0xf(%rdx,%rdi,8)
movq 0x18(%rbx), %r8
movl 0x8(%rdx,%rdi,8), %r9d
xorq $0x1, %r9
movq 0x28(%r8), %r10
movq (%r10,%r9,8), %r9
movq %r9, %r10
andq %rax, %r10
je 0xe63dd
movl 0x4(%rdx,%rdi,8), %edi
movq 0x8(%r8), %r11
shrq $0x20, %r9
shlq $0x3, %r10
leaq (%r10,%r10,2), %r8
leaq (%r9,%r9,2), %r9
leaq (%r11,%r9,8), %r9
addq $0xc, %r9
xorl %r10d, %r10d
movl -0x4(%r9,%r10), %r11d
xorl %edi, %r11d
cmpl $0x1, %r11d
jne 0xe63d4
orb $-0x80, 0x3(%r9,%r10)
addq $0x18, %r10
cmpq %r10, %r8
jne 0xe63c0
incq %rsi
cmpq %rcx, %rsi
jne 0xe6377
movq 0x18(%r13), %rcx
movq 0x20(%rcx), %rcx
movq 0xb0(%rsp), %rdi
movb 0x4(%rcx,%rdi,8), %cl
movq 0x18(%rbx), %rdx
movq 0x20(%rdx), %rsi
movb %cl, 0x4(%rsi,%rdi,8)
movq 0xa0(%rsp), %rsi
xorq $0x1, %rsi
movq 0x28(%rdx), %rcx
movq %rsi, 0x90(%rsp)
movq (%rcx,%rsi,8), %rcx
andq %rcx, %rax
je 0xe64af
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%rdx), %rcx
xorl %edx, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq (%rdx,%rdx,2), %rdi
orb $-0x80, 0xf(%rcx,%rdi,8)
movq 0x18(%rbx), %r8
movl 0x8(%rcx,%rdi,8), %r9d
xorq $0x1, %r9
movq 0x28(%r8), %r10
movq (%r10,%r9,8), %r9
movq %r9, %r10
andq %rsi, %r10
je 0xe64a7
movl 0x4(%rcx,%rdi,8), %edi
movq 0x8(%r8), %r11
shrq $0x20, %r9
shlq $0x3, %r10
leaq (%r10,%r10,2), %r8
leaq (%r9,%r9,2), %r9
leaq (%r11,%r9,8), %r9
addq $0xc, %r9
xorl %r10d, %r10d
movl -0x4(%r9,%r10), %r11d
xorl %edi, %r11d
cmpl $0x1, %r11d
jne 0xe649e
orb $-0x80, 0x3(%r9,%r10)
addq $0x18, %r10
cmpq %r10, %r8
jne 0xe648a
incq %rdx
cmpq %rax, %rdx
jne 0xe6441
movq 0x18(%r13), %rax
movq 0x20(%rax), %rax
movq 0xa8(%rsp), %rdx
movb 0x4(%rax,%rdx,8), %al
movq 0x18(%rbx), %rcx
movq 0x20(%rcx), %rcx
movb %al, 0x4(%rcx,%rdx,8)
movq 0x68(%rsp), %rdx
cmpq $0x0, (%rdx)
je 0xe665c
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq 0x88(%rsp), %r13
movq 0x10(%rdx), %rdx
movl (%rdx,%rax,4), %edx
movq 0x18(%rbx), %r8
movq 0x28(%r8), %rsi
movq (%rsi,%rdx,8), %rdi
movq %rdi, %rsi
andq %rcx, %rsi
je 0xe658e
shrq $0x20, %rdi
leaq (%rdi,%rdi,2), %rdi
shlq $0x3, %rdi
addq 0x8(%r8), %rdi
xorl %r8d, %r8d
leaq (%r8,%r8,2), %r9
orb $-0x80, 0xf(%rdi,%r9,8)
movq 0x18(%rbx), %r10
movl 0x8(%rdi,%r9,8), %r11d
xorq $0x1, %r11
movq 0x28(%r10), %r14
movq (%r14,%r11,8), %r11
movq %r11, %r14
andq %rcx, %r14
je 0xe6586
movl 0x4(%rdi,%r9,8), %r9d
movq 0x8(%r10), %r12
shrq $0x20, %r11
shlq $0x3, %r14
leaq (%r14,%r14,2), %r10
leaq (%r11,%r11,2), %r11
leaq (%r12,%r11,8), %r11
addq $0xc, %r11
xorl %r14d, %r14d
movl -0x4(%r11,%r14), %ebp
xorl %r9d, %ebp
cmpl $0x1, %ebp
jne 0xe657d
orb $-0x80, 0x3(%r11,%r14)
addq $0x18, %r14
cmpq %r14, %r10
jne 0xe656a
incq %r8
cmpq %rsi, %r8
jne 0xe651f
movq %rdx, %rsi
xorq $0x1, %rsi
movq 0x18(%rbx), %r8
movq 0x28(%r8), %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, %rsi
andq %rcx, %rsi
je 0xe662f
shrq $0x20, %rdi
leaq (%rdi,%rdi,2), %rdi
shlq $0x3, %rdi
addq 0x8(%r8), %rdi
xorl %r8d, %r8d
leaq (%r8,%r8,2), %r9
orb $-0x80, 0xf(%rdi,%r9,8)
movq 0x18(%rbx), %r10
movl 0x8(%rdi,%r9,8), %r11d
xorq $0x1, %r11
movq 0x28(%r10), %r14
movq (%r14,%r11,8), %r11
movq %r11, %r14
andq %rcx, %r14
je 0xe6627
movl 0x4(%rdi,%r9,8), %r9d
movq 0x8(%r10), %r12
shrq $0x20, %r11
shlq $0x3, %r14
leaq (%r14,%r14,2), %r10
leaq (%r11,%r11,2), %r11
leaq (%r12,%r11,8), %r11
addq $0xc, %r11
xorl %r14d, %r14d
movl -0x4(%r11,%r14), %ebp
xorl %r9d, %ebp
cmpl $0x1, %ebp
jne 0xe661e
orb $-0x80, 0x3(%r11,%r14)
addq $0x18, %r14
cmpq %r14, %r10
jne 0xe660b
incq %r8
cmpq %rsi, %r8
jne 0xe65c0
movq 0x18(%r13), %rsi
movq 0x20(%rsi), %rsi
shrl %edx
movb 0x4(%rsi,%rdx,8), %sil
movq 0x18(%rbx), %rdi
movq 0x20(%rdi), %rdi
movb %sil, 0x4(%rdi,%rdx,8)
incq %rax
movq 0x68(%rsp), %rdx
cmpq (%rdx), %rax
jb 0xe64ed
cmpq $0x0, (%rdx)
je 0xe6831
xorl %eax, %eax
movq 0x10(%rdx), %rcx
movl (%rcx,%rax,4), %r8d
movq 0x18(%r13), %rcx
movq 0x8(%rcx), %rdx
movq %rdx, 0xc0(%rsp)
movq 0x28(%rcx), %rcx
movq (%rcx,%r8,8), %rdi
movq %rdi, %rcx
shrq $0x20, %rcx
movq %rcx, 0xb8(%rsp)
movq 0x18(%rbx), %rcx
movq 0x28(%rcx), %rdx
movq (%rdx,%r8,8), %r9
movq %r9, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %r10
shlq $0x3, %r10
addq 0x8(%rcx), %r10
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
andq %rcx, %rdi
je 0xe6710
leaq (,%rdi,8), %rcx
leaq (%rcx,%rcx,2), %r11
movq 0xb8(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0xc0(%rsp), %rdx
leaq (%rdx,%rcx,8), %r14
addq $0xc, %r14
xorl %ecx, %ecx
cmpl $0x0, (%r14,%rcx)
js 0xe6707
movl -0x4(%r14,%rcx), %edx
movb (%r15,%rdx), %bpl
testb %bpl, %bpl
je 0xe6707
orb $0x2, %bpl
movb %bpl, (%r15,%rdx)
addq $0x18, %rcx
cmpq %rcx, %r11
jne 0xe66ea
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
andq %rcx, %r9
je 0xe67c8
shrl %r8d
xorl %r11d, %r11d
leaq (%r11,%r11,2), %rcx
movl 0x8(%r10,%rcx,8), %r14d
movb (%r15,%r14), %dl
testb %dl, %dl
je 0xe67bc
andb $0x2, %dl
jne 0xe67bc
movl %r14d, %edx
shrl %edx
cmpl %edx, %r8d
je 0xe67bc
leaq (%r10,%rcx,8), %rcx
andb $0x7f, 0xf(%rcx)
movq 0x18(%rbx), %r12
movq 0x28(%r12), %rdx
xorq $0x1, %r14
movq (%rdx,%r14,8), %rdx
testl %edx, %edx
je 0xe6d24
movq 0x8(%r12), %r14
movq %rdx, %r13
shrq $0x20, %r13
movl 0x4(%rcx), %r12d
movl %edx, %edx
leaq (,%r13,2), %rcx
addq %r13, %rcx
leaq (%r14,%rcx,8), %r13
addq $0xc, %r13
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rbp
xorl %edx, %edx
movl -0x4(%r13,%rdx), %esi
xorl %r12d, %esi
cmpl $0x1, %esi
je 0xe67b3
addq $0x18, %rdx
cmpq %rdx, %rbp
jne 0xe6798
jmp 0xe6d24
leaq (%r14,%rcx,8), %rcx
andb $0x7f, 0xf(%rdx,%rcx)
incq %r11
cmpq %r9, %r11
jne 0xe6724
testq %rdi, %rdi
movq 0x88(%rsp), %r13
je 0xe6820
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdi
movq 0xb8(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0xc0(%rsp), %rdx
leaq (%rdx,%rcx,8), %rdx
addq $0xc, %rdx
xorl %ecx, %ecx
cmpl $0x0, (%rdx,%rcx)
js 0xe6817
movl -0x4(%rdx,%rcx), %esi
movb (%r15,%rsi), %r8b
testb $0x2, %r8b
je 0xe6817
addb $-0x2, %r8b
movb %r8b, (%r15,%rsi)
addq $0x18, %rcx
cmpq %rcx, %rdi
jne 0xe67fb
incq %rax
movq 0x68(%rsp), %rdx
cmpq (%rdx), %rax
jb 0xe6668
movq 0x120(%rsp), %rbp
movq 0x18(%r13), %rsi
movq 0x18(%rbx), %rdx
leaq 0x98(%rsp), %rax
movq (%rax), %r9
movq %rax, (%rsp)
movq 0x80(%rsp), %r12
movq %r12, %rdi
movq 0x70(%rsp), %r14
movl %r14d, %ecx
movq 0x90(%rsp), %r8
callq 0xe4391
testl %eax, %eax
je 0xe69a7
movq %rbp, %r12
movq 0x118(%rsp), %rbp
movq 0x68(%rsp), %rax
cmpq $0x0, (%rax)
je 0xe68e1
xorl %r14d, %r14d
movq 0x18(%rbx), %rdi
movq 0x18(%r13), %rsi
movq 0x10(%rax), %rax
movl (%rax,%r14,4), %r8d
movq %r15, %rdx
movl $0x2, %ecx
callq 0xe5744
movq 0x18(%rbx), %rdi
movq 0x18(%r13), %rsi
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax,%r14,4), %r8d
xorl $0x1, %r8d
movq %r15, %rdx
movl $0x2, %ecx
callq 0xe5744
movq 0x68(%rsp), %rax
incq %r14
cmpq (%rax), %r14
jb 0xe6891
movq 0x18(%rbx), %rdi
movq 0x18(%r13), %rsi
movq %r15, %rdx
movl $0x2, %ecx
movq 0x70(%rsp), %r14
movl %r14d, %r8d
callq 0xe5744
movq 0x18(%rbx), %rdi
movq 0x18(%r13), %rsi
movq %r15, %rdx
movl $0x2, %ecx
movq 0x90(%rsp), %r8
callq 0xe5744
movq 0x98(%rsp), %r8
movq 0xd0(%rsp), %r9
movq 0x38(%r9), %rax
movq (%r9), %rcx
movq 0x8(%r9), %rdx
movl 0x10(%r9), %esi
movl 0x14(%r9), %edi
addq $0x40, %r9
movq %r9, 0x58(%rsp)
movl %edi, 0x48(%rsp)
movl %esi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %rax, 0x28(%rsp)
movq %r12, 0x20(%rsp)
movl 0x128(%rsp), %eax
movl %eax, 0x18(%rsp)
movq %rbp, 0x10(%rsp)
movl 0x110(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x7c(%rsp), %eax
movl %eax, (%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movq 0x80(%rsp), %r9
movl %r14d, %edx
movq 0xa0(%rsp), %rcx
callq 0xe58d0
movl %eax, %eax
jmp 0xe6a0d
movq 0xc8(%rsp), %rcx
movq %rcx, 0x98(%rsp)
movq 0x18(%r13), %rdi
movq %rbp, 0x38(%rsp)
movl 0x128(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl 0x110(%rsp), %eax
movl %eax, (%rsp)
movl $0x0, 0x30(%rsp)
movl $0x1, 0x8(%rsp)
movq %r13, %rsi
movl %r14d, %edx
movq %r12, %r8
movl 0x7c(%rsp), %r9d
callq 0xbf39f
movq 0x68(%rsp), %rsi
cmpq $0x0, (%rsi)
je 0xe6a2e
xorl %ecx, %ecx
movq 0x10(%rsi), %rdx
movl (%rdx,%rcx,4), %edx
movb $0x0, (%r15,%rdx)
incq %rcx
cmpq (%rsi), %rcx
jb 0xe6a1a
movq 0x18(%rbx), %rdi
movq 0x28(%rdi), %rcx
movq 0x70(%rsp), %rdx
movq (%rcx,%rdx,8), %rsi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rsi, %rdx
andq %rcx, %rdx
je 0xe6ad1
shrq $0x20, %rsi
leaq (%rsi,%rsi,2), %rsi
shlq $0x3, %rsi
addq 0x8(%rdi), %rsi
xorl %edi, %edi
leaq (%rdi,%rdi,2), %r8
andb $0x7f, 0xf(%rsi,%r8,8)
movq 0x18(%rbx), %r9
movl 0x8(%rsi,%r8,8), %r10d
xorq $0x1, %r10
movq 0x28(%r9), %r11
movq (%r11,%r10,8), %r10
movq %r10, %r11
andq %rcx, %r11
je 0xe6ac9
movl 0x4(%rsi,%r8,8), %r8d
movq 0x8(%r9), %r14
shrq $0x20, %r10
shlq $0x3, %r11
leaq (%r11,%r11,2), %r9
leaq (%r10,%r10,2), %r10
leaq (%r14,%r10,8), %r10
addq $0xc, %r10
xorl %r11d, %r11d
movl -0x4(%r10,%r11), %ebp
xorl %r8d, %ebp
cmpl $0x1, %ebp
jne 0xe6ac0
andb $0x7f, 0x3(%r10,%r11)
addq $0x18, %r11
cmpq %r11, %r9
jne 0xe6aad
incq %rdi
cmpq %rdx, %rdi
jne 0xe6a62
movq 0x18(%rbx), %rsi
movq 0x20(%rsi), %rdx
movq 0xb0(%rsp), %rdi
movb $0x0, 0x4(%rdx,%rdi,8)
movq 0x28(%rsi), %rdx
movq 0x90(%rsp), %rdi
movq (%rdx,%rdi,8), %rdx
andq %rdx, %rcx
je 0xe6b85
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x3, %rdx
addq 0x8(%rsi), %rdx
xorl %esi, %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
leaq (%rsi,%rsi,2), %r8
andb $0x7f, 0xf(%rdx,%r8,8)
movq 0x18(%rbx), %r9
movl 0x8(%rdx,%r8,8), %r10d
xorq $0x1, %r10
movq 0x28(%r9), %r11
movq (%r11,%r10,8), %r10
movq %r10, %r11
andq %rdi, %r11
je 0xe6b7d
movl 0x4(%rdx,%r8,8), %r8d
movq 0x8(%r9), %r14
shrq $0x20, %r10
shlq $0x3, %r11
leaq (%r11,%r11,2), %r9
leaq (%r10,%r10,2), %r10
leaq (%r14,%r10,8), %r10
addq $0xc, %r10
xorl %r11d, %r11d
movl -0x4(%r10,%r11), %ebp
xorl %r8d, %ebp
cmpl $0x1, %ebp
jne 0xe6b74
andb $0x7f, 0x3(%r10,%r11)
addq $0x18, %r11
cmpq %r11, %r9
jne 0xe6b61
incq %rsi
cmpq %rcx, %rsi
jne 0xe6b16
movq 0x18(%rbx), %rcx
movq 0x20(%rcx), %rcx
movq 0xa8(%rsp), %rdx
movb $0x0, 0x4(%rcx,%rdx,8)
movq 0x68(%rsp), %rsi
cmpq $0x0, (%rsi)
je 0xe6d12
xorl %ecx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq 0x10(%rsi), %rsi
movl (%rsi,%rcx,4), %esi
movq 0x18(%rbx), %r9
movq 0x28(%r9), %rdi
movq (%rdi,%rsi,8), %r8
movq %r8, %rdi
andq %rdx, %rdi
je 0xe6c51
shrq $0x20, %r8
leaq (%r8,%r8,2), %r8
shlq $0x3, %r8
addq 0x8(%r9), %r8
xorl %r9d, %r9d
leaq (%r9,%r9,2), %r10
andb $0x7f, 0xf(%r8,%r10,8)
movq 0x18(%rbx), %r11
movl 0x8(%r8,%r10,8), %r14d
xorq $0x1, %r14
movq 0x28(%r11), %r15
movq (%r15,%r14,8), %r14
movq %r14, %r15
andq %rdx, %r15
je 0xe6c49
movl 0x4(%r8,%r10,8), %r10d
movq 0x8(%r11), %r12
shrq $0x20, %r14
shlq $0x3, %r15
leaq (%r15,%r15,2), %r11
leaq (%r14,%r14,2), %r14
leaq (%r12,%r14,8), %r14
addq $0xc, %r14
xorl %r15d, %r15d
movl -0x4(%r14,%r15), %ebp
xorl %r10d, %ebp
cmpl $0x1, %ebp
jne 0xe6c40
andb $0x7f, 0x3(%r14,%r15)
addq $0x18, %r15
cmpq %r15, %r11
jne 0xe6c2d
incq %r9
cmpq %rdi, %r9
jne 0xe6be2
movq %rsi, %rdi
xorq $0x1, %rdi
movq 0x18(%rbx), %r9
movq 0x28(%r9), %r8
movq (%r8,%rdi,8), %r8
movq %r8, %rdi
andq %rdx, %rdi
je 0xe6cf2
shrq $0x20, %r8
leaq (%r8,%r8,2), %r8
shlq $0x3, %r8
addq 0x8(%r9), %r8
xorl %r9d, %r9d
leaq (%r9,%r9,2), %r10
andb $0x7f, 0xf(%r8,%r10,8)
movq 0x18(%rbx), %r11
movl 0x8(%r8,%r10,8), %r14d
xorq $0x1, %r14
movq 0x28(%r11), %r15
movq (%r15,%r14,8), %r14
movq %r14, %r15
andq %rdx, %r15
je 0xe6cea
movl 0x4(%r8,%r10,8), %r10d
movq 0x8(%r11), %r12
shrq $0x20, %r14
shlq $0x3, %r15
leaq (%r15,%r15,2), %r11
leaq (%r14,%r14,2), %r14
leaq (%r12,%r14,8), %r14
addq $0xc, %r14
xorl %r15d, %r15d
movl -0x4(%r14,%r15), %ebp
xorl %r10d, %ebp
cmpl $0x1, %ebp
jne 0xe6ce1
andb $0x7f, 0x3(%r14,%r15)
addq $0x18, %r15
cmpq %r15, %r11
jne 0xe6cce
incq %r9
cmpq %rdi, %r9
jne 0xe6c83
movq 0x18(%rbx), %rdi
movq 0x20(%rdi), %rdi
shrl %esi
movb $0x0, 0x4(%rdi,%rsi,8)
incq %rcx
movq 0x68(%rsp), %rsi
cmpq (%rsi), %rcx
jb 0xe6bb0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x145410(%rip), %rdi    # 0x22c13b
leaq 0x142f6f(%rip), %rsi    # 0x229ca1
leaq 0x1452c5(%rip), %rcx    # 0x22bffe
movl $0x684f, %edx           # imm = 0x684F
callq 0x2110
leaq 0x1453a0(%rip), %rdi    # 0x22c0ea
leaq 0x142f50(%rip), %rsi    # 0x229ca1
leaq 0x1452a6(%rip), %rcx    # 0x22bffe
movl $0x680d, %edx           # imm = 0x680D
callq 0x2110
leaq 0x145240(%rip), %rdi    # 0x22bfa9
leaq 0x142f31(%rip), %rsi    # 0x229ca1
leaq 0x145287(%rip), %rcx    # 0x22bffe
movl $0x67ff, %edx           # imm = 0x67FF
callq 0x2110
leaq 0x14530d(%rip), %rdi    # 0x22c095
leaq 0x142f12(%rip), %rsi    # 0x229ca1
leaq 0x145268(%rip), %rcx    # 0x22bffe
movl $0x6800, %edx           # imm = 0x6800
callq 0x2110