// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: get_integer_seq_ovlps(ul_resolve_t*, unsigned long*, long, long, unsigned long, asg64_v*, unsigned long*)
uint32_t get_integer_seq_ovlps(ul_resolve_t *uidx, uint64_t *p_a, int64_t p_n, int64_t match_bound, uint64_t skip_hom, asg64_v *res, uint64_t *r_w)
{
    ul_str_idx_t *str_idx = &(uidx->pstr); uint32_t v = p_a[match_bound]; uc_block_t *xi;
    uint64_t *hid_a, hid_n, z, vz, ps, pe, ww[2], sw[2], occ; ul_str_t *str; int64_t s_n, s, p;
    bubble_type *bub = uidx->bub;

    hid_a = str_idx->occ.a + str_idx->idx.a[v>>1];
    hid_n = str_idx->idx.a[(v>>1)+1] - str_idx->idx.a[v>>1];
    for (z = ww[0] = ww[1] = (*r_w) = occ = 0; z < hid_n; z++) {
        str = &(str_idx->str.a[hid_a[z]>>32]); s_n = str->cn;
        if(s_n < 2) continue;
        vz = (uint32_t)(str->a[(uint32_t)hid_a[z]]);
        assert((v>>1) == (vz>>1)); ps = pe = (uint64_t)-1;
        sw[0] = sw[1] = 0;
        if(v == vz) {
            s = ((uint32_t)hid_a[z]) + 1; p = match_bound + 1; 
            for (; (s < s_n) && (p < p_n) && ((uint32_t)(str->a[s]) == p_a[p]); s++, p++) {
                xi = &(uidx->idx->a[hid_a[z]>>32].bb.a[str->a[s]>>32]);
                assert(((xi->hid<<1)+xi->rev)==((uint32_t)str->a[s]));
                if(skip_hom && IF_HOM(xi->hid, *bub)) continue;
                sw[1] += ug_occ_w(xi->ts, xi->te, &(uidx->l1_ug->u.a[xi->hid]));
            }
            if(s < s_n && p < p_n) continue;
            if(p <= match_bound + 1) continue;///bridging the two sides of the breakpoint
            if(sw[1] == 0) continue;
            pe = p;

            s = (uint32_t)hid_a[z]; p = match_bound; 
            for (; (s >= 0) && (p >= 0) && ((uint32_t)(str->a[s]) == p_a[p]); s--, p--) {
                xi = &(uidx->idx->a[hid_a[z]>>32].bb.a[str->a[s]>>32]);
                assert(((xi->hid<<1)+xi->rev)==((uint32_t)str->a[s]));
                if(skip_hom && IF_HOM(xi->hid, *bub)) continue;
                sw[0] += ug_occ_w(xi->ts, xi->te, &(uidx->l1_ug->u.a[xi->hid]));
            }
            assert(p < match_bound);
            if(s >= 0 && p >= 0) continue;
            if(sw[0] == 0) continue;
            ps = p + 1;
        } else {
            s = ((int32_t)((uint32_t)hid_a[z]))-1; p = match_bound + 1; 
            for (; (s >= 0) && (p < p_n) && ((uint32_t)(str->a[s]) == (p_a[p]^1)); s--, p++) {
                xi = &(uidx->idx->a[hid_a[z]>>32].bb.a[str->a[s]>>32]);
                assert(((xi->hid<<1)+xi->rev)==((uint32_t)str->a[s]));
                if(skip_hom && IF_HOM(xi->hid, *bub)) continue;
                sw[1] += ug_occ_w(xi->ts, xi->te, &(uidx->l1_ug->u.a[xi->hid]));
            }
            if(s >= 0 && p < p_n) continue;
            if(p <= match_bound + 1) continue;///bridging the two sides of the breakpoint
            if(sw[1] == 0) continue;
            pe = p;

            s = (uint32_t)hid_a[z]; p = match_bound; 
            for (; (s < s_n) && (p >= 0) && ((uint32_t)(str->a[s]) == (p_a[p]^1)); s++, p--) {
                xi = &(uidx->idx->a[hid_a[z]>>32].bb.a[str->a[s]>>32]);
                assert(((xi->hid<<1)+xi->rev)==((uint32_t)str->a[s]));
                if(skip_hom && IF_HOM(xi->hid, *bub)) continue;
                sw[0] += ug_occ_w(xi->ts, xi->te, &(uidx->l1_ug->u.a[xi->hid]));
            }
            assert(p < match_bound);
            if(s < s_n && p >= 0) continue;
            if(sw[0] == 0) continue;
            ps = p + 1;
        }
        if(res) kv_push(uint64_t, *res, ((ps<<32)|(pe)));
        occ++;
        ww[0] += sw[0]; ww[1] += sw[1]; 
        // if(match_bound == 15 && p_n == 36) {
        //     fprintf(stderr, "[M::%s::] z::%lu, ulid::%lu, ps::%lu, pe::%lu\n", __func__, z, hid_a[z]>>32, ps, pe);
        // }
    }

    (*r_w) = MIN(ww[0], ww[1]);
    return occ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x3c(%rbp), %edx
shrl %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
shrl %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x3c(%rbp), %edx
shrl %edx
movl %edx, %edx
subq (%rcx,%rdx,8), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0xa8(%rbp)
movq 0x10(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
jae 0x347124
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0xb8(%rbp)
cmpq $0x2, -0xb8(%rbp)
jge 0x346705
jmp 0x347113
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x68(%rbp)
movl -0x3c(%rbp), %eax
shrl %eax
movl %eax, %eax
movq -0x68(%rbp), %rcx
shrq %rcx
cmpq %rcx, %rax
jne 0x34673d
jmp 0x34675c
leaq 0x525fb(%rip), %rdi     # 0x398d3f
leaq 0x4fa6e(%rip), %rsi     # 0x3961b9
movl $0x2461, %edx           # imm = 0x2461
leaq 0x525fa(%rip), %rcx     # 0x398d51
callq 0x2130
movq $-0x1, -0x78(%rbp)
movq $-0x1, -0x70(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movl -0x3c(%rbp), %eax
cmpq -0x68(%rbp), %rax
jne 0x346bda
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rcx
xorl %eax, %eax
cmpq -0xb8(%rbp), %rcx
movb %al, -0xd1(%rbp)
jge 0x346813
movq -0xc8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0xd1(%rbp)
jge 0x346813
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq -0x10(%rbp), %rcx
movq -0xc8(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
sete %al
movb %al, -0xd1(%rbp)
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x346822
jmp 0x34695d
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq -0xb0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0xc0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %eax
shll %eax
movq -0x48(%rbp), %rcx
movb 0x20(%rcx), %cl
shrb $0x5, %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movq -0xb0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0xc0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl %ecx, %eax
jne 0x3468a4
jmp 0x3468c3
leaq 0x52514(%rip), %rdi     # 0x398dbf
leaq 0x4f907(%rip), %rsi     # 0x3961b9
movl $0x2467, %edx           # imm = 0x2467
leaq 0x52493(%rip), %rcx     # 0x398d51
callq 0x2130
cmpq $0x0, -0x28(%rbp)
je 0x3468f6
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
movl (%rax,%rcx,4), %eax
movq -0xd0(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x3468f6
jmp 0x346934
movq -0x48(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x48(%rbp), %rax
movl (%rax), %eax
imulq $0x28, %rax, %rax
addq %rax, %rdx
callq 0x327090
addq -0x98(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0x3467b6
movq -0xc0(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jge 0x34697f
movq -0xc8(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x34697f
jmp 0x347113
movq -0xc8(%rbp), %rax
movq -0x20(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jg 0x346998
jmp 0x347113
cmpq $0x0, -0x98(%rbp)
jne 0x3469a7
jmp 0x347113
movq -0xc8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
xorl %eax, %eax
cmpq $0x0, -0xc0(%rbp)
movb %al, -0xd2(%rbp)
jl 0x346a26
xorl %eax, %eax
cmpq $0x0, -0xc8(%rbp)
movb %al, -0xd2(%rbp)
jl 0x346a26
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq -0x10(%rbp), %rcx
movq -0xc8(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
sete %al
movb %al, -0xd2(%rbp)
movb -0xd2(%rbp), %al
testb $0x1, %al
jne 0x346a35
jmp 0x346b70
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq -0xb0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0xc0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %eax
shll %eax
movq -0x48(%rbp), %rcx
movb 0x20(%rcx), %cl
shrb $0x5, %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movq -0xb0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0xc0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl %ecx, %eax
jne 0x346ab7
jmp 0x346ad6
leaq 0x52301(%rip), %rdi     # 0x398dbf
leaq 0x4f6f4(%rip), %rsi     # 0x3961b9
movl $0x2473, %edx           # imm = 0x2473
leaq 0x52280(%rip), %rcx     # 0x398d51
callq 0x2130
cmpq $0x0, -0x28(%rbp)
je 0x346b09
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
movl (%rax,%rcx,4), %eax
movq -0xd0(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x346b09
jmp 0x346b47
movq -0x48(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x48(%rbp), %rax
movl (%rax), %eax
imulq $0x28, %rax, %rax
addq %rax, %rdx
callq 0x327090
addq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xc0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xc0(%rbp)
movq -0xc8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0x3469d2
movq -0xc8(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x346b7f
jmp 0x346b9e
leaq 0x52267(%rip), %rdi     # 0x398ded
leaq 0x4f62c(%rip), %rsi     # 0x3961b9
movl $0x2477, %edx           # imm = 0x2477
leaq 0x521b8(%rip), %rcx     # 0x398d51
callq 0x2130
cmpq $0x0, -0xc0(%rbp)
jl 0x346bb7
cmpq $0x0, -0xc8(%rbp)
jl 0x346bb7
jmp 0x347113
cmpq $0x0, -0xa0(%rbp)
jne 0x346bc6
jmp 0x347113
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x34702e
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
subl $0x1, %eax
cltq
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc8(%rbp)
xorl %eax, %eax
cmpq $0x0, -0xc0(%rbp)
movb %al, -0xd3(%rbp)
jl 0x346c5f
movq -0xc8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0xd3(%rbp)
jge 0x346c5f
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq -0x10(%rbp), %rcx
movq -0xc8(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
xorq $0x1, %rcx
cmpq %rcx, %rax
sete %al
movb %al, -0xd3(%rbp)
movb -0xd3(%rbp), %al
testb $0x1, %al
jne 0x346c6e
jmp 0x346da9
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq -0xb0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0xc0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %eax
shll %eax
movq -0x48(%rbp), %rcx
movb 0x20(%rcx), %cl
shrb $0x5, %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movq -0xb0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0xc0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl %ecx, %eax
jne 0x346cf0
jmp 0x346d0f
leaq 0x520c8(%rip), %rdi     # 0x398dbf
leaq 0x4f4bb(%rip), %rsi     # 0x3961b9
movl $0x247f, %edx           # imm = 0x247F
leaq 0x52047(%rip), %rcx     # 0x398d51
callq 0x2130
cmpq $0x0, -0x28(%rbp)
je 0x346d42
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
movl (%rax,%rcx,4), %eax
movq -0xd0(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x346d42
jmp 0x346d80
movq -0x48(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x48(%rbp), %rax
movl (%rax), %eax
imulq $0x28, %rax, %rax
addq %rax, %rdx
callq 0x327090
addq -0x98(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0xc0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xc0(%rbp)
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0x346c01
cmpq $0x0, -0xc0(%rbp)
jl 0x346dc5
movq -0xc8(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x346dc5
jmp 0x347113
movq -0xc8(%rbp), %rax
movq -0x20(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jg 0x346dde
jmp 0x347113
cmpq $0x0, -0x98(%rbp)
jne 0x346ded
jmp 0x347113
movq -0xc8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rcx
xorl %eax, %eax
cmpq -0xb8(%rbp), %rcx
movb %al, -0xd4(%rbp)
jge 0x346e79
xorl %eax, %eax
cmpq $0x0, -0xc8(%rbp)
movb %al, -0xd4(%rbp)
jl 0x346e79
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq -0x10(%rbp), %rcx
movq -0xc8(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
xorq $0x1, %rcx
cmpq %rcx, %rax
sete %al
movb %al, -0xd4(%rbp)
movb -0xd4(%rbp), %al
testb $0x1, %al
jne 0x346e88
jmp 0x346fc3
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq -0xb0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0xc0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %eax
shll %eax
movq -0x48(%rbp), %rcx
movb 0x20(%rcx), %cl
shrb $0x5, %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movq -0xb0(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0xc0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl %ecx, %eax
jne 0x346f0a
jmp 0x346f29
leaq 0x51eae(%rip), %rdi     # 0x398dbf
leaq 0x4f2a1(%rip), %rsi     # 0x3961b9
movl $0x248b, %edx           # imm = 0x248B
leaq 0x51e2d(%rip), %rcx     # 0x398d51
callq 0x2130
cmpq $0x0, -0x28(%rbp)
je 0x346f5c
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
movl (%rax,%rcx,4), %eax
movq -0xd0(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x346f5c
jmp 0x346f9a
movq -0x48(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x48(%rbp), %rax
movl (%rax), %eax
imulq $0x28, %rax, %rax
addq %rax, %rdx
callq 0x327090
addq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
movq -0xc8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0x346e18
movq -0xc8(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x346fd2
jmp 0x346ff1
leaq 0x51e14(%rip), %rdi     # 0x398ded
leaq 0x4f1d9(%rip), %rsi     # 0x3961b9
movl $0x248f, %edx           # imm = 0x248F
leaq 0x51d65(%rip), %rcx     # 0x398d51
callq 0x2130
movq -0xc0(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jge 0x347010
cmpq $0x0, -0xc8(%rbp)
jl 0x347010
jmp 0x347113
cmpq $0x0, -0xa0(%rbp)
jne 0x34701f
jmp 0x347113
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3470d7
jmp 0x34703b
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x3470ac
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x34706b
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xe0(%rbp)
jmp 0x347079
movl $0x2, %eax
movq %rax, -0xe0(%rbp)
jmp 0x347079
movq -0xe0(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x70(%rbp), %rdx
shlq $0x20, %rdx
orq -0x78(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x3470d7
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rax
addq -0x90(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x98(%rbp), %rax
addq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x3466aa
movq -0x90(%rbp), %rax
cmpq -0x88(%rbp), %rax
ja 0x347144
movq -0x90(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0x347152
movq -0x88(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0xa8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq