// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: print_raw_uls_aln(ul_resolve_t*, char const*)
void print_raw_uls_aln(ul_resolve_t *uidx, const char *nn)
{
    char* gfa_name = NULL; MALLOC(gfa_name, strlen(nn)+70);
    sprintf(gfa_name, "%s.raw.aln.log", nn);
    FILE* fp = fopen(gfa_name, "w"); free(gfa_name);
    if (!fp) return;
    ma_ug_t *ug = uidx->init_ug; all_ul_t *aln = uidx->idx;
    uint64_t id; uc_block_t *a = NULL; int64_t k, a_n;
    for (id = 0; id < aln->n; id++) {
        a = aln->a[id].bb.a; a_n = aln->a[id].bb.n; k = 0;
        if(a_n == 0) continue;
        fprintf(fp,"%.*s\tid::%lu\tdd::%u\t", (int32_t)aln->nid.a[id].n, aln->nid.a[id].a, id, aln->a[id].dd);
        // for (k = 0; k < a_n && ug_occ_w(a[k].ts, a[k].te, &(ug->u.a[a[k].hid])) == 0; k++);
        for (; k < a_n; k++) {
            // if(ug_occ_w(a[k].ts, a[k].te, &(ug->u.a[a[k].hid])) == 0) break;
            fprintf(fp, "utg%.6d%c(%c)q::[%u, %u)\t", a[k].hid + 1, "lc"[ug->u.a[a[k].hid].circ], "+-"[a[k].rev], a[k].qs, a[k].qe);
        }
        fprintf(fp,"\n");
    }
    fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20a0
movq %rax, %rdi
addq $0x46, %rdi
shlq $0x0, %rdi
callq 0x2270
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x57218(%rip), %rsi     # 0x398a0c
movb $0x0, %al
callq 0x2050
movq -0x18(%rbp), %rdi
leaq 0x57bcc(%rip), %rsi     # 0x3993d2
callq 0x2200
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2210
cmpq $0x0, -0x20(%rbp)
jne 0x341824
jmp 0x3419df
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x3419d6
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
imulq $0x58, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
imulq $0x58, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x3418a2
jmp 0x3419c5
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
imulq $0x58, -0x38(%rbp), %rsi
addq %rsi, %rax
movzbl 0x50(%rax), %r9d
leaq 0x57129(%rip), %rsi     # 0x398a1b
movb $0x0, %al
callq 0x22a0
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
jge 0x3419b3
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
imulq $0x24, -0x48(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %edx
addl $0x1, %edx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
imulq $0x24, -0x48(%rbp), %rsi
addq %rsi, %rcx
movl (%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x439ba(%rip), %rax     # 0x385303
movsbl (%rax,%rcx), %ecx
movq -0x40(%rbp), %rax
imulq $0x24, -0x48(%rbp), %rsi
addq %rsi, %rax
movb 0x20(%rax), %al
shrb $0x5, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %esi
leaq 0x4152e(%rip), %rax     # 0x382e9b
movsbl (%rax,%rsi), %r8d
movq -0x40(%rbp), %rax
imulq $0x24, -0x48(%rbp), %rsi
addq %rsi, %rax
movl 0x4(%rax), %r9d
movq -0x40(%rbp), %rax
imulq $0x24, -0x48(%rbp), %rsi
addq %rsi, %rax
movl 0x8(%rax), %eax
leaq 0x57098(%rip), %rsi     # 0x398a30
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x3418f9
movq -0x20(%rbp), %rdi
leaq 0x4506a(%rip), %rsi     # 0x386a28
movb $0x0, %al
callq 0x22a0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x34184c
movq -0x20(%rbp), %rdi
callq 0x21a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)