// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: print_integer_ovlps(ma_ug_t*, ul_str_t*, integer_aln_t*, long, ul_chain_t*, long, long, long)
void print_integer_ovlps(ma_ug_t *ug, ul_str_t *str, integer_aln_t *aln, int64_t aln_occ, ul_chain_t *idx, int64_t idx_n, int64_t qid, int64_t consenus_occ)
{
    fprintf(stderr, "\n[M::%s::qid->%ld] qstr->cn::%u, aln_occ::%ld, idx_n::%ld, consenus_occ::%ld\n", 
                                __func__, qid, str[qid].cn, aln_occ, idx_n, consenus_occ);
    // print_integer_seq(ug, str, qid, 0);
    int64_t k, z, z_n, qk, tk, is_rev, tid; //uint64_t z;
    for (k = 0; k < idx_n; k++) {
        fprintf(stderr, "\n[M::%s::tid->%lu] rev->%lu, aln_n->%u\n", __func__, aln[idx[k].s].tn_rev_qk>>33, (aln[idx[k].s].tn_rev_qk>>32)&1, idx[k].e - idx[k].s);
        print_integer_seq(ug, str, aln[idx[k].s].tn_rev_qk>>33, 0);
        z = idx[k].s; z_n = idx[k].e; tid = aln[idx[k].s].tn_rev_qk>>33;
        for (; z < z_n; z++) {
            qk = (uint32_t)aln[z].tn_rev_qk; is_rev = ((aln[z].tn_rev_qk>>32)&1);
            tk = ((is_rev == 0)? (aln[z].tk):(str[tid].cn - aln[z].tk - 1));
            fprintf(stderr, "[qk::%ld]utg%.6d%c(%c) <---> [tk::%ld]utg%.6d%c(%c)\n", 
            qk, (((uint32_t)str[qid].a[qk])>>1)+1, "lc"[ug->u.a[(((uint32_t)str[qid].a[qk])>>1)].circ], "+-"[(((uint32_t)str[qid].a[qk])&1)], 
            tk, (((uint32_t)str[tid].a[tk])>>1)+1, "lc"[ug->u.a[(((uint32_t)str[tid].a[tk])>>1)].circ], "+-"[(((uint32_t)str[tid].a[tk])&1)]);
        }
        
        // for (z = idx[k].s; z < idx[k].e; z++) {
        //     aln[z].tn_rev_qk
        // }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, 0x20(%rsp)
movq %rcx, %r9
movq %rdx, 0x8(%rsp)
movq %rsi, %rbp
movq %rdi, 0x18(%rsp)
movq 0x70(%rsp), %rcx
movq 0x269ccb(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
movq %rcx, %rax
shlq $0x5, %rax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rax, 0x10(%rsp)
movl 0x18(%rsi,%rax), %r8d
andl %edx, %r8d
leaq 0x21b3f5(%rip), %rsi    # 0x24672d
leaq 0x21b43c(%rip), %rdx    # 0x24677b
xorl %eax, %eax
pushq 0x78(%rsp)
pushq %rbx
callq 0x22b0
addq $0x10, %rsp
movq %rbx, 0x28(%rsp)
testq %rbx, %rbx
jle 0x2b4f3
addq %rbp, 0x10(%rsp)
xorl %ebx, %ebx
movq %rbp, 0x30(%rsp)
movq 0x269c70(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
imulq $0x28, %rbx, %r15
movq 0x20(%rsp), %r14
movl (%r14,%r15), %eax
movl 0x4(%r14,%r15), %r9d
imulq $0x18, %rax, %rcx
movq 0x8(%rsp), %r12
movq 0x10(%r12,%rcx), %r8
movq %r8, %rcx
shrq $0x21, %rcx
shrq $0x20, %r8
andl $0x1, %r8d
subl %eax, %r9d
leaq 0x21b3e3(%rip), %rsi    # 0x24678f
leaq 0x21b3c8(%rip), %rdx    # 0x24677b
xorl %eax, %eax
callq 0x22b0
movl (%r14,%r15), %eax
imulq $0x18, %rax, %rax
movq 0x10(%r12,%rax), %rdx
shrq $0x21, %rdx
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
callq 0x2004cf
movl (%r14,%r15), %eax
movl 0x4(%r14,%r15), %r12d
cmpl %r12d, %eax
jae 0x2b4e5
imulq $0x18, %rax, %rcx
movq 0x8(%rsp), %rdx
leaq (%rdx,%rcx), %r13
movq 0x10(%rdx,%rcx), %rcx
shrq $0x1c, %rcx
andq $-0x20, %rcx
addq %rbp, %rcx
addq $0x18, %rcx
movq %rcx, (%rsp)
subq %rax, %r12
movq 0x10(%r13), %rax
btq $0x20, %rax
jb 0x2b429
movl (%r13), %ecx
movq (%rsp), %r9
jmp 0x2b43f
movq (%rsp), %r9
movl (%r9), %edx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %edx
movl (%r13), %ecx
notl %ecx
addl %edx, %ecx
movl %eax, %edx
movl %ecx, %r10d
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdx,8), %rax
movl %eax, %ecx
shrl %ecx
movq 0x18(%rsp), %rsi
movq 0x10(%rsi), %rsi
imulq $0x28, %rcx, %rdi
movl (%rsi,%rdi), %r8d
movq -0x8(%r9), %rdi
movq (%rdi,%r10,8), %rbp
movl %ebp, %r11d
shrl %r11d
imulq $0x28, %r11, %rdi
movl (%rsi,%rdi), %esi
movq 0x269b5e(%rip), %rdi    # 0x294fe0
movq (%rdi), %rdi
incl %ecx
shrl $0x1f, %r8d
leaq 0x2092a9(%rip), %r15    # 0x23473b
movsbl (%r8,%r15), %r8d
andl $0x1, %eax
leaq 0x206e32(%rip), %r14    # 0x2322d3
movsbl (%rax,%r14), %r9d
incl %r11d
shrl $0x1f, %esi
movsbl (%rsi,%r15), %r15d
andl $0x1, %ebp
movsbl (%rbp,%r14), %ebp
leaq 0x21b2f6(%rip), %rsi    # 0x2467b7
xorl %eax, %eax
pushq %rbp
pushq %r15
pushq %r11
pushq %r10
callq 0x22b0
addq $0x20, %rsp
addq $0x18, %r13
decq %r12
movq 0x30(%rsp), %rbp
jne 0x2b414
incq %rbx
cmpq 0x28(%rsp), %rbx
jne 0x2b369
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq