// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: asg_arc_cut_tips(asg_t*, unsigned int, asg64_v*, unsigned int, R_to_U*, telo_end_t*)
uint32_t asg_arc_cut_tips(asg_t *g, uint32_t max_ext, asg64_v *in, uint32_t is_ou, R_to_U *ru, telo_end_t *te)
{
    asg64_v tx = {0,0,0}, *b = NULL;
    uint32_t n_vtx = g->n_seq<<1, v, w, i, k, cnt = 0, nv, kv, pb, ou, mm_ou, rr, is_u, is_telo;
    asg_arc_t *av = NULL; uint64_t lw;
	if(in) b = in;
    else b = &tx;
    b->n = 0;
    for (v = 0; v < n_vtx; ++v) {
        if (g->seq[v>>1].del) continue;
        if(te && te->hh[v>>1]) continue;

        av = asg_arc_a(g, v^1); nv = asg_arc_n(g, v^1);
        for (i = kv = 0; i < nv; i++) {
            if (av[i].del) continue;
            kv++; break;
        }
        if(kv) continue;
        
        kv = 1; mm_ou = (uint32_t)-1; ou = 0; is_telo = 0;
        if(te && te->hh[v>>1]) is_telo = 1;
        for (i = 0, w = v; i < max_ext; i++) {
            if(asg_end(g, w^1, &lw, is_ou?&ou:NULL)!=0) break;
            w = (uint32_t)lw; kv++; mm_ou = MIN(mm_ou, ou);
            if(te && te->hh[w>>1]) is_telo = 1;
        }

		if(mm_ou == (uint32_t)-1) mm_ou = 0;
		kv += mm_ou; i += mm_ou;
        if((i < max_ext/** + (!!is_ou)**/) && (!is_telo)) kv_push(uint64_t, *b, (((uint64_t)kv)<<32)|v);  
    }

    radix_sort_srt64(b->a, b->a + b->n);

    for (k = 0; k < b->n; k++) {
        v = (uint32_t)(b->a[k]);

        if (g->seq[v>>1].del) continue;
        if(te && te->hh[v>>1]) continue;

        av = asg_arc_a(g, v^1); nv = asg_arc_n(g, v^1);
        for (i = kv = 0; i < nv; i++) {
            if (av[i].del) continue;
            kv++; break;
        }

        if(kv) continue;
        
        pb = b->n; kv_push(uint64_t, *b, v); mm_ou = (uint32_t)-1; ou = 0; is_telo = 0;
        if(te && te->hh[v>>1]) is_telo = 1;
        for (i = 0, w = v; i < max_ext; i++) {
            if(asg_end(g, w^1, &lw, is_ou?&ou:NULL)!=0) break;
            w = (uint32_t)lw; kv_push(uint64_t, *b, lw); mm_ou = MIN(mm_ou, ou);
            if(te && te->hh[w>>1]) is_telo = 1;
        }
		if(mm_ou == (uint32_t)-1) mm_ou = 0;
		i += mm_ou;

        if((i < max_ext/** + (!!is_ou)**/) && (!is_telo)) {
            for (i = pb; i < b->n; i++) asg_seq_del(g, ((uint32_t)b->a[i])>>1);
            cnt++;
        }
        b->n = pb; 
    }

    if(ru && is_ou) {
        for (v = b->n = 0; v < n_vtx; ++v) {
            if (g->seq[v>>1].del) continue;
            av = asg_arc_a(g, v^1); nv = asg_arc_n(g, v^1);
            for (i = kv = 0; i < nv; i++) {
                if (av[i].del) continue;
                kv++; break;
            }
            if(kv) continue;


            get_R_to_U(ru, v>>1, &rr, &is_u);
            if(rr == (uint32_t)-1 || is_u == 1) continue;
            if(te && te->hh[v>>1]) continue;
            kv_push(uint64_t, *b, v); 

            for (i = 0, w = v; i < max_ext; i++) {
                if(asg_end(g, w^1, &lw, NULL)!=0) break;
                w = (uint32_t)lw; 

                get_R_to_U(ru, w>>1, &rr, &is_u);
                if(rr == (uint32_t)-1 || is_u == 1) break;
                if(te && te->hh[w>>1]) break;

                kv_push(uint64_t, *b, lw);
            }

            for (i = 0; i < b->n; i++) {
                asg_seq_del(g, ((uint32_t)b->a[i])>>1);
            }
            if(b->n) cnt++;
        }
    }
    

    /**
    for (v = 0; v < n_vtx; ++v) {
        if (g->seq[v>>1].del) continue;

        av = asg_arc_a(g, v^1); nv = asg_arc_n(g, v^1);
        for (i = kv = 0; i < nv; i++) {
            if (av[i].del) continue;
            kv++;
        }

        if(kv) continue;
        pb = b->n; kv_push(uint64_t, *b, v);
        for (i = 0, w = v; i < max_ext; i++) {
            if(asg_is_utg_end(g, w^1, &lw)!=0) break;
            w = (uint32_t)lw; kv_push(uint64_t, *b, lw);
        }

        if(i < max_ext) {
            for (i = pb; i < b->n; i++) asg_seq_del(g, ((uint32_t)b->a[i])>>1);
            cnt++;
        }
        b->n = pb; 
    }
    **/
    // stats_sysm(g);
    if(!in) free(tx.a);
    if (cnt > 0) asg_cleanup(g);

    return cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x60(%rsp)
movl %ecx, 0x48(%rsp)
movq %rdx, %r15
movq %rsi, 0x38(%rsp)
movq %rdi, %rbx
movl 0x14(%rdi), %ecx
addl %ecx, %ecx
testq %rdx, %rdx
je 0x1efd6a
movq $0x0, (%r15)
testl %ecx, %ecx
movq %r15, 0x30(%rsp)
movl %ecx, 0x74(%rsp)
je 0x1f0080
movq 0x38(%rsp), %rax
incl %eax
movl %eax, 0x44(%rsp)
movl %ecx, %r8d
xorl %r12d, %r12d
movq $0x0, (%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x18(%rsp), %rcx
movq %r8, 0x58(%rsp)
movq 0x20(%rbx), %rax
movl %r12d, %edi
shrl %edi
cmpl $0x0, (%rax,%rdi,8)
js 0x1f0072
testq %rcx, %rcx
je 0x1efdd6
movq 0x10(%rcx), %rax
cmpb $0x0, (%rax,%rdi)
jne 0x1f0072
movq 0x8(%rbx), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rbx), %rsi
movl %r12d, %eax
xorq $0x1, %rax
movq (%rsi,%rax,8), %rax
testl %eax, %eax
je 0x1efe29
movq %rax, %rcx
shrq $0x20, %rcx
movl %eax, %edx
leaq (%rcx,%rcx,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rcx
xorl %edx, %edx
cmpl $0x0, (%rax,%rdx)
jns 0x1f006d
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x1efe16
xorl %ecx, %ecx
movl $0x0, %r9d
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1efe4a
movq 0x10(%rax), %rdx
xorl %r9d, %r9d
cmpb $0x0, (%rdx,%rdi)
setne %r9b
cmpl $0x0, 0x38(%rsp)
je 0x1eff94
movl %r9d, 0xc(%rsp)
movq 0x28(%rsp), %rax
leaq 0xc(%rax), %rdi
xorl %ecx, %ecx
movl $0x1, %ebp
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r12d, %r9d
xorl %r8d, %r8d
movl %r9d, %edx
movq (%rsi,%rdx,8), %r10
testl %r10d, %r10d
jle 0x1eff7b
movq %r10, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
movq 0x28(%rsp), %rax
leaq (%rax,%rdx,8), %r9
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
leaq (%rdi,%rdx,8), %r14
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
xorl %r13d, %r13d
xorl %edx, %edx
xorl %eax, %eax
cmpl $0x0, (%r14)
setns %al
cmovnsl %r13d, %r11d
addl %eax, %edx
incq %r13
addq $0x18, %r14
cmpq %r13, %r10
jne 0x1efeb0
cmpl $0x1, %edx
jne 0x1eff7b
movslq %r11d, %rax
leaq (%rax,%rax,2), %rdx
cmpl $0x0, 0x48(%rsp)
je 0x1efeef
movzwl 0x10(%r9,%rdx,8), %r8d
andl $0x3fff, %r8d           # imm = 0x3FFF
movl 0x8(%r9,%rdx,8), %r9d
movq %r9, %rax
xorq $0x1, %rax
movq (%rsi,%rax,8), %r10
testl %r10d, %r10d
jle 0x1eff7b
movq %r10, %rax
shrq $0x20, %rax
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax,8), %r11
xorl %edx, %edx
movl (%r11), %eax
notl %eax
shrl $0x1f, %eax
addl %eax, %edx
addq $0x18, %r11
decq %r10
jne 0x1eff1c
cmpl $0x1, %edx
jne 0x1eff7b
cmpl %r8d, %r15d
cmovael %r8d, %r15d
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1eff62
movq 0x10(%rax), %rax
movl %r9d, %edx
shrl %edx
cmpb $0x0, (%rax,%rdx)
movl $0x1, %eax
movl 0xc(%rsp), %edx
cmovnel %eax, %edx
movl %edx, 0xc(%rsp)
incl %ebp
incl %ecx
cmpl 0x38(%rsp), %ecx
jne 0x1efe76
movq 0x38(%rsp), %rax
movl %eax, %ecx
movl 0x44(%rsp), %ebp
cmpl $-0x1, %r15d
movl $0x0, %eax
cmovel %eax, %r15d
movq 0x58(%rsp), %r8
movl 0xc(%rsp), %r9d
jmp 0x1eff9c
movl $0x1, %ebp
xorl %r15d, %r15d
addl %r15d, %ecx
cmpl 0x38(%rsp), %ecx
jae 0x1f0068
testl %r9d, %r9d
movq 0x18(%rsp), %rcx
jne 0x1efff5
movq 0x30(%rsp), %r14
testq %r14, %r14
je 0x1efffc
movq (%r14), %rcx
cmpq 0x8(%r14), %rcx
jne 0x1f0035
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x58(%rsp), %r8
movq %rax, 0x10(%r14)
movq (%r14), %rcx
jmp 0x1f0039
movq 0x30(%rsp), %r15
jmp 0x1f0072
movq 0x20(%rsp), %rax
cmpq %rax, 0x10(%rsp)
jne 0x1f0042
leaq (%rax,%rax), %r14
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rsi
movq (%rsp), %rdi
callq 0x2370
movq 0x58(%rsp), %r8
movq %r14, 0x20(%rsp)
jmp 0x1f0046
movq 0x10(%r14), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%r14)
jmp 0x1f005a
movq (%rsp), %rax
movq 0x10(%rsp), %rdx
movq %rdx, %rcx
incq %rdx
movq %rax, (%rsp)
movq %rdx, 0x10(%rsp)
addl %ebp, %r15d
shlq $0x20, %r15
orq %r12, %r15
movq %r15, (%rax,%rcx,8)
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %rcx
incq %r12
cmpq %r8, %r12
jne 0x1efdb0
jmp 0x1f009a
movq $0x0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, (%rsp)
movq (%rsp), %rdi
movq 0x10(%rsp), %rax
testq %r15, %r15
je 0x1f00af
movq (%r15), %rax
movq 0x10(%r15), %rdi
leaq (%rdi,%rax,8), %rsi
callq 0x1ee586
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movl $0x0, 0x4c(%rsp)
movq 0x18(%rsp), %rcx
movl %r13d, %r13d
testq %r15, %r15
je 0x1f00e5
cmpq %r13, (%r15)
jbe 0x1f05b4
movq 0x10(%r15), %rax
jmp 0x1f00f4
movq (%rsp), %rax
cmpq %r13, 0x10(%rsp)
jbe 0x1f05d6
movq %r13, 0x28(%rsp)
movq (%rax,%r13,8), %r13
movq 0x20(%rbx), %rax
movl %r13d, %r14d
shrl %r14d
cmpl $0x0, (%rax,%r14,8)
js 0x1f01bc
testq %rcx, %rcx
je 0x1f0126
movq 0x10(%rcx), %rax
cmpb $0x0, (%rax,%r14)
jne 0x1f01bc
movq 0x28(%rbx), %rax
movl %r13d, %r15d
movq %r15, %rcx
xorq $0x1, %rcx
movq (%rax,%rcx,8), %rax
testl %eax, %eax
je 0x1f016e
movq 0x8(%rbx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %esi
leaq (%rdx,%rdx,2), %rax
leaq (%rcx,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rcx
xorl %edx, %edx
cmpl $0x0, (%rax,%rdx)
jns 0x1f01b2
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x1f015f
movq 0x30(%rsp), %rbp
testq %rbp, %rbp
je 0x1f01c9
movq (%rbp), %rcx
cmpq 0x8(%rbp), %rcx
movq %rcx, 0x68(%rsp)
jne 0x1f0201
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%rbp)
movq 0x10(%rbp), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%rbp)
movq (%rbp), %rcx
jmp 0x1f0205
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %r13
incl %r13d
jmp 0x1f00ce
movq 0x10(%rsp), %rbp
cmpq 0x20(%rsp), %rbp
jne 0x1f020f
leaq (,%rbp,2), %rax
testq %rbp, %rbp
movl $0x2, %ecx
cmoveq %rcx, %rax
movq %rax, 0x20(%rsp)
leaq (,%rax,8), %rsi
movq (%rsp), %rdi
callq 0x2370
jmp 0x1f0213
movq 0x10(%rbp), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbp)
jmp 0x1f0228
movq (%rsp), %rax
movq %rbp, %rcx
movq %rbp, 0x68(%rsp)
leaq 0x1(%rbp), %rdx
movq %rax, (%rsp)
movq %rdx, 0x10(%rsp)
movq %r15, (%rax,%rcx,8)
movl $0x0, %edx
movq 0x18(%rsp), %rcx
testq %rcx, %rcx
je 0x1f0249
movq 0x10(%rcx), %rax
xorl %edx, %edx
cmpb $0x0, (%rax,%r14)
setne %dl
cmpl $0x0, 0x38(%rsp)
movq 0x30(%rsp), %r15
je 0x1f0447
movl %edx, 0x44(%rsp)
xorl %ebp, %ebp
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl $0x0, 0x58(%rsp)
movq 0x28(%rbx), %rcx
movl %r13d, %eax
movq (%rcx,%rax,8), %rsi
testl %esi, %esi
jle 0x1f0456
movq 0x8(%rbx), %rax
movq %rsi, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdi
leaq (%rax,%rdi,8), %rdx
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
leaq (%rax,%rdi,8), %r8
addq $0xc, %r8
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
xorl %r10d, %r10d
movq 0x28(%rsp), %r13
xorl %r11d, %r11d
cmpl $0x0, (%r8)
setns %r11b
cmovnsl %r9d, %edi
addl %r11d, %r10d
incq %r9
addq $0x18, %r8
cmpq %r9, %rsi
jne 0x1f02b1
cmpl $0x1, %r10d
jne 0x1f0467
movslq %edi, %rsi
leaq (%rsi,%rsi,2), %rsi
cmpl $0x0, 0x48(%rsp)
je 0x1f02f6
movzwl 0x10(%rdx,%rsi,8), %edi
andl $0x3fff, %edi           # imm = 0x3FFF
movl %edi, 0x58(%rsp)
movl 0x8(%rdx,%rsi,8), %r15d
movl %r15d, %edi
xorl $0x1, %edi
movq (%rcx,%rdi,8), %rcx
testl %ecx, %ecx
jle 0x1f0462
movl %r14d, 0xc(%rsp)
movq (%rdx,%rsi,8), %r13
shlq $0x20, %r13
orq %r15, %r13
movq %rcx, %rdx
shrq $0x20, %rdx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0xc, %rdx
xorl %eax, %eax
movl (%rdx), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %eax
addq $0x18, %rdx
decq %rcx
jne 0x1f0338
cmpl $0x1, %eax
movq 0x18(%rsp), %rcx
jne 0x1f046e
movq 0x30(%rsp), %r14
testq %r14, %r14
je 0x1f0395
movq (%r14), %rcx
cmpq 0x8(%r14), %rcx
jne 0x1f03c9
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%r14)
movq (%r14), %rcx
jmp 0x1f03cd
movq 0x20(%rsp), %rax
cmpq %rax, 0x10(%rsp)
jne 0x1f03db
leaq (%rax,%rax), %r14
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rsi
movq (%rsp), %rdi
callq 0x2370
movq %r14, 0x20(%rsp)
jmp 0x1f03df
movq 0x10(%r14), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%r14)
movl 0xc(%rsp), %r14d
jmp 0x1f03f8
movq (%rsp), %rax
movl 0xc(%rsp), %r14d
movq 0x10(%rsp), %rdx
movq %rdx, %rcx
incq %rdx
movq %rax, (%rsp)
movq %rdx, 0x10(%rsp)
movl 0x58(%rsp), %edx
cmpl %edx, %r14d
cmovael %edx, %r14d
movq %r13, (%rax,%rcx,8)
movq 0x18(%rsp), %rcx
testq %rcx, %rcx
je 0x1f042d
movq 0x10(%rcx), %rax
shrl %r15d
cmpb $0x0, (%rax,%r15)
movl $0x1, %eax
movl 0x44(%rsp), %edx
cmovnel %eax, %edx
movl %edx, 0x44(%rsp)
movq 0x30(%rsp), %r15
incl %ebp
cmpl 0x38(%rsp), %ebp
jne 0x1f026d
movq 0x38(%rsp), %rax
movl %eax, %ebp
jmp 0x1f045b
movq 0x28(%rsp), %r13
movq 0x68(%rsp), %rax
xorl %r14d, %r14d
jmp 0x1f0496
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %r13
jmp 0x1f047d
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %rcx
jmp 0x1f047d
movq 0x30(%rsp), %r15
movq 0x28(%rsp), %r13
movl 0xc(%rsp), %r14d
cmpl $-0x1, %r14d
movl $0x0, %eax
cmovel %eax, %r14d
addl %ebp, %r14d
movq 0x68(%rsp), %rax
movl 0x44(%rsp), %edx
cmpl 0x38(%rsp), %r14d
jae 0x1f059b
testl %edx, %edx
jne 0x1f059b
movl %eax, %eax
testq %r15, %r15
je 0x1f04bf
cmpq %rax, (%r15)
jbe 0x1f058d
movq 0x10(%r15), %rcx
jmp 0x1f04ce
movq (%rsp), %rcx
cmpq %rax, 0x10(%rsp)
jbe 0x1f058d
movq (%rcx,%rax,8), %rcx
movl %ecx, %edx
shrl %edx
movq 0x20(%rbx), %rsi
orl $0x80000000, (%rsi,%rdx,8) # imm = 0x80000000
andl $-0x2, %ecx
movb $0x1, %dl
xorl %esi, %esi
orq %rcx, %rsi
movq 0x28(%rbx), %rdi
movq (%rdi,%rsi,8), %r8
movq %r8, %rdi
andq %r12, %rdi
je 0x1f0573
shrq $0x20, %r8
leaq (%r8,%r8,2), %r8
shlq $0x3, %r8
addq 0x8(%rbx), %r8
xorl %r9d, %r9d
leaq (%r9,%r9,2), %r10
orb $-0x80, 0xf(%r8,%r10,8)
movl 0x8(%r8,%r10,8), %r10d
xorq $0x1, %r10
movq 0x28(%rbx), %r11
movq (%r11,%r10,8), %r11
movq %r11, %r10
andq %r12, %r10
je 0x1f056b
movq 0x8(%rbx), %r14
shrq $0x20, %r11
shlq $0x3, %r10
leaq (%r10,%r10,2), %r10
leaq (%r11,%r11,2), %r11
leaq (%r14,%r11,8), %r11
addq $0xc, %r11
xorl %r14d, %r14d
movl -0x4(%r11,%r14), %ebp
xorl %esi, %ebp
cmpl $0x1, %ebp
jne 0x1f0562
orb $-0x80, 0x3(%r11,%r14)
addq $0x18, %r14
cmpq %r14, %r10
jne 0x1f0550
incq %r9
cmpq %rdi, %r9
jne 0x1f050e
movl $0x1, %esi
testb $0x1, %dl
movl $0x0, %edx
jne 0x1f04e8
incl %eax
jmp 0x1f04a9
incl 0x4c(%rsp)
movq 0x18(%rsp), %rcx
movq 0x68(%rsp), %rax
movl %eax, %eax
testq %r15, %r15
je 0x1f05aa
movq %rax, (%r15)
jmp 0x1f01c1
movq %rax, 0x10(%rsp)
jmp 0x1f01c1
cmpq $0x0, 0x60(%rsp)
sete %al
cmpl $0x0, 0x48(%rsp)
sete %cl
orb %al, %cl
jne 0x1f0a76
movq $0x0, (%r15)
jmp 0x1f05f8
cmpq $0x0, 0x60(%rsp)
setne %al
cmpl $0x0, 0x48(%rsp)
setne %cl
testb %al, %cl
je 0x1f0a6a
movq $0x0, 0x10(%rsp)
movq (%rsp), %r12
movl 0x74(%rsp), %eax
testl %eax, %eax
movq 0x20(%rsp), %rcx
je 0x1f0a63
movl %eax, %eax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %r12, %r14
movq 0x20(%rbx), %rax
movl %ebp, %r12d
shrl %r12d
cmpl $0x0, (%rax,%r12,8)
js 0x1f06bc
movq %rcx, 0x20(%rsp)
movq 0x28(%rbx), %rax
movl %ebp, %ecx
xorq $0x1, %rcx
movq (%rax,%rcx,8), %rax
testl %eax, %eax
je 0x1f067d
movq 0x8(%rbx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %esi
leaq (%rdx,%rdx,2), %rax
leaq (%rcx,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rcx
xorl %edx, %edx
cmpl $0x0, (%rax,%rdx)
jns 0x1f06c4
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x1f066e
movq 0x60(%rsp), %rdi
movl %r12d, %esi
leaq 0x54(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0xa3c62
cmpl $-0x1, 0x54(%rsp)
je 0x1f06c4
cmpl $0x1, 0x50(%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
je 0x1f06bc
testq %rax, %rax
je 0x1f06cc
movq 0x10(%rax), %rax
cmpb $0x0, (%rax,%r12)
je 0x1f06cc
movq %r14, %r12
jmp 0x1f0a55
movq %r14, %r12
jmp 0x1f0a50
testq %r15, %r15
je 0x1f0707
movq (%r15), %rcx
cmpq 0x8(%r15), %rcx
movq %r14, %r12
jne 0x1f074f
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r15)
movq 0x10(%r15), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%r15)
movq (%r15), %rcx
jmp 0x1f0753
cmpq %rcx, 0x10(%rsp)
movq %r14, %r12
jne 0x1f0739
leaq (%rcx,%rcx), %r14
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rsi
movq %r12, %rdi
callq 0x2370
movq %rax, %r12
movq %r14, 0x20(%rsp)
movq 0x10(%rsp), %rax
movq %rax, %rcx
leaq 0x1(%rax), %rdx
movq %r12, %rax
movq %rdx, 0x10(%rsp)
jmp 0x1f075a
movq 0x10(%r15), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%r15)
movq %rbp, (%rax,%rcx,8)
cmpl $0x0, 0x38(%rsp)
je 0x1f0953
xorl %r14d, %r14d
movl %ebp, %r15d
movq 0x28(%rbx), %rcx
movl %r15d, %eax
movq (%rcx,%rax,8), %rsi
testl %esi, %esi
jle 0x1f0953
movq 0x8(%rbx), %rax
movq %rsi, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdi
leaq (%rax,%rdi,8), %rdx
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
leaq (%rax,%rdi,8), %r8
addq $0xc, %r8
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %r11d, %r11d
cmpl $0x0, (%r8)
setns %r11b
cmovnsl %r9d, %edi
addl %r11d, %r10d
incq %r9
addq $0x18, %r8
cmpq %r9, %rsi
jne 0x1f07ae
cmpl $0x1, %r10d
jne 0x1f0953
movslq %edi, %rsi
leaq (%rsi,%rsi,2), %rsi
movl 0x8(%rdx,%rsi,8), %r15d
movq %r15, %rdi
xorq $0x1, %rdi
movq (%rcx,%rdi,8), %rcx
testl %ecx, %ecx
jle 0x1f0953
movl %r14d, 0xc(%rsp)
movq %r12, (%rsp)
movq (%rdx,%rsi,8), %r14
shlq $0x20, %r14
orq %r15, %r14
movq %rcx, %rdx
shrq $0x20, %rdx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0xc, %rdx
xorl %eax, %eax
movl (%rdx), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %eax
addq $0x18, %rdx
decq %rcx
jne 0x1f0824
cmpl $0x1, %eax
jne 0x1f094f
movl %r15d, %r12d
shrl %r12d
movq 0x60(%rsp), %rdi
movl %r12d, %esi
leaq 0x54(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0xa3c62
cmpl $-0x1, 0x54(%rsp)
je 0x1f094f
cmpl $0x1, 0x50(%rsp)
je 0x1f094f
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1f088b
movq 0x10(%rax), %rax
cmpb $0x0, (%rax,%r12)
jne 0x1f094f
movq 0x30(%rsp), %r12
testq %r12, %r12
je 0x1f08ce
movq (%r12), %rcx
cmpq 0x8(%r12), %rcx
jne 0x1f090d
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r12)
movq 0x10(%r12), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%r12)
movq (%r12), %rcx
jmp 0x1f0912
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq %rcx, %rax
jne 0x1f0920
leaq (%rcx,%rcx), %r12
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %r12
leaq (,%r12,8), %rsi
movq (%rsp), %rdi
callq 0x2370
movq %rax, %rsi
movq %r12, 0x20(%rsp)
movq 0x10(%rsp), %rax
jmp 0x1f0924
movq 0x10(%r12), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%r12)
movq (%rsp), %r12
jmp 0x1f0936
movq (%rsp), %rsi
movq %rax, %rcx
leaq 0x1(%rax), %rdx
movq %rsi, %rax
movq %rdx, 0x10(%rsp)
movq %rsi, %r12
movl 0xc(%rsp), %edx
movq %r14, (%rax,%rcx,8)
incl %edx
cmpl 0x38(%rsp), %edx
movl %edx, %r14d
jne 0x1f076f
jmp 0x1f0953
movq (%rsp), %r12
xorl %eax, %eax
movl %eax, %eax
movq 0x30(%rsp), %r15
testq %r15, %r15
je 0x1f0973
movq (%r15), %rcx
cmpq %rax, %rcx
jbe 0x1f0a47
movq 0x10(%r15), %rcx
jmp 0x1f0981
movq %r12, %rcx
cmpq %rax, 0x10(%rsp)
jbe 0x1f0a42
movq (%rcx,%rax,8), %rcx
movl %ecx, %edx
shrl %edx
movq 0x20(%rbx), %rsi
orl $0x80000000, (%rsi,%rdx,8) # imm = 0x80000000
andl $-0x2, %ecx
movb $0x1, %dl
xorl %esi, %esi
orq %rcx, %rsi
movq 0x28(%rbx), %rdi
movq (%rdi,%rsi,8), %r8
movq %r8, %rdi
andq %r13, %rdi
je 0x1f0a28
shrq $0x20, %r8
leaq (%r8,%r8,2), %r8
shlq $0x3, %r8
addq 0x8(%rbx), %r8
xorl %r9d, %r9d
leaq (%r9,%r9,2), %r10
orb $-0x80, 0xf(%r8,%r10,8)
movl 0x8(%r8,%r10,8), %r10d
xorq $0x1, %r10
movq 0x28(%rbx), %r11
movq (%r11,%r10,8), %r11
movq %r11, %r10
andq %r13, %r10
je 0x1f0a20
movq 0x8(%rbx), %r14
shrq $0x20, %r11
shlq $0x3, %r10
leaq (%r10,%r10,2), %r10
leaq (%r11,%r11,2), %r11
leaq (%r14,%r11,8), %r11
addq $0xc, %r11
xorl %r14d, %r14d
movl -0x4(%r11,%r14), %r15d
xorl %esi, %r15d
cmpl $0x1, %r15d
jne 0x1f0a17
orb $-0x80, 0x3(%r11,%r14)
addq $0x18, %r14
cmpq %r14, %r10
jne 0x1f0a03
incq %r9
cmpq %rdi, %r9
jne 0x1f09c1
movl $0x1, %esi
testb $0x1, %dl
movl $0x0, %edx
jne 0x1f099b
incl %eax
jmp 0x1f0955
movq 0x10(%rsp), %rcx
cmpq $0x1, %rcx
sbbl $-0x1, 0x4c(%rsp)
movq 0x20(%rsp), %rcx
incq %rbp
cmpq 0x28(%rsp), %rbp
jne 0x1f061c
testq %r15, %r15
jne 0x1f0a76
jmp 0x1f0a6e
movq (%rsp), %r12
movq %r12, %rdi
callq 0x2220
movl 0x4c(%rsp), %ebp
testl %ebp, %ebp
je 0x1f0a86
movq %rbx, %rdi
callq 0xa0a7d
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq