// File: chhylp123[P]hifiasm/inter.cpp
// Function: print_gaf(ma_ug_t const*, mg_gres_a*, mg_dbn_t*)
void print_gaf(const ma_ug_t *ug, mg_gres_a *hits, mg_dbn_t *name)
{
	uint64_t i, q;
	int32_t k, nl, m;
	char *nn; mg_gchain_t *gc; mg_lres_t *lc; 
	for (i = 0; i < hits->n; i++) {
		q = hits->a[i].qid;
		nn = name->cc.a + (q>0?name->a[q-1]:0);
		nl = name->a[q] - (q>0?name->a[q-1]:0);
		for (k = 0; k < hits->a[i].n_gc; k++) {
			gc = &(hits->a[i].gc[k]);
			fprintf(stderr, "S\t%.*s\tq:id:%lu\tl:n:%d\n", nl, nn, q, gc->cnt);
			for (m = 0; m < gc->cnt; m++) {
				lc = &(hits->a[i].lc[gc->off + m]);
				fprintf(stderr, "*\tA\tutg%.6d%c\t%c\tqs:%u\tqe:%u\tql:%lu\tts:%u\tte:%u\ttl:%u\tcnt:%d\n", 
				(lc->v>>1)+1, "lc"[ug->u.a[lc->v>>1].circ], "+-"[lc->v&1], lc->qs, lc->qe, hits->a[i].qlen, lc->ts, lc->te, ug->u.a[lc->v>>1].len, lc->cnt);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2f45cd
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x40(%rbp)
jbe 0x2f439a
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x78(%rbp)
jmp 0x2f43a2
xorl %eax, %eax
movq %rax, -0x78(%rbp)
jmp 0x2f43a2
movq -0x70(%rbp), %rax
movq -0x78(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x40(%rbp)
jbe 0x2f43e9
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x88(%rbp)
jmp 0x2f43f4
xorl %eax, %eax
movq %rax, -0x88(%rbp)
jmp 0x2f43f4
movq -0x80(%rbp), %rax
movq -0x88(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jge 0x2f45ba
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq 0xcfb8f(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movl -0x48(%rbp), %edx
movq -0x58(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x60(%rbp), %rax
movl 0xc(%rax), %r9d
leaq 0xa0bf9(%rip), %rsi     # 0x395067
movb $0x0, %al
callq 0x22a0
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x2f45aa
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
movl 0x8(%rcx), %ecx
addl -0x4c(%rbp), %ecx
movslq %ecx, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq 0xcfb21(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x68(%rbp), %rax
movl 0x4(%rax), %edx
shrl %edx
addl $0x1, %edx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x4(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x90e0b(%rip), %rax     # 0x385303
movsbl (%rax,%rcx), %ecx
movq -0x68(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x8e98a(%rip), %rax     # 0x382e9b
movsbl (%rax,%rsi), %r8d
movq -0x68(%rbp), %rax
movl 0xc(%rax), %r9d
movq -0x68(%rbp), %rax
movl 0x10(%rax), %r15d
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rsi
addq %rsi, %rax
movq 0x20(%rax), %r14
movq -0x68(%rbp), %rax
movl 0x14(%rax), %ebx
movq -0x68(%rbp), %rax
movl 0x18(%rax), %r11d
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x68(%rbp), %rsi
movl 0x4(%rsi), %esi
shrl %esi
movl %esi, %esi
imulq $0x28, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %r10d
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
movq -0x68(%rbp), %rax
movl (%rax), %eax
leaq 0xa0b05(%rip), %rsi     # 0x39507f
movl %r15d, (%rsp)
movq %r14, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movb $0x0, %al
callq 0x22a0
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x2f447c
jmp 0x2f45ac
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x2f440c
jmp 0x2f45bc
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2f4344
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)