// File: /workspace/github_c_makefile_star2_O2/rikuu[P]kermit/miniasm/asm.c
// Function: ma_ug_print
void ma_ug_print(const ma_ug_t *ug, const sdict_t *d, const ma_sub_t *sub, FILE *fp)
{
	uint32_t i, j, l;
	char name[32];
	for (i = 0; i < ug->u.n; ++i) { // the Segment lines in GFA
		ma_utg_t *p = &ug->u.a[i];
		sprintf(name, "utg%.6d%c", i + 1, "lc"[p->circ]);
		fprintf(fp, "S\t%s\t%s\tLN:i:%d\n", name, p->s? p->s : "*", p->len);
		for (j = l = 0; j < p->n; l += (uint32_t)p->a[j++]) {
			uint32_t x = p->a[j]>>33;
			if (sub) fprintf(fp, "a\t%s\t%d\t%s:%d-%d\t%c\t%d\n", name, l, d->seq[x].name, sub[x].s + 1, sub[x].e, "+-"[p->a[j]>>32&1], (uint32_t)p->a[j]);
			else fprintf(fp, "a\t%s\t%d\t%s\t%c\t%d\n", name, l, d->seq[x].name, "+-"[p->a[j]>>32&1], (uint32_t)p->a[j]);
		}
	}
	for (i = 0; i < ug->g->n_arc; ++i) { // the Link lines in GFA
		uint32_t u = ug->g->arc[i].ul>>32, v = ug->g->arc[i].v;
		fprintf(fp, "L\tutg%.6d%c\t%c\tutg%.6d%c\t%c\t%dM\tSD:i:%d\n", (u>>1)+1, "lc"[ug->u.a[u>>1].circ], "+-"[u&1],
				(v>>1)+1, "lc"[ug->u.a[v>>1].circ], "+-"[v&1], ug->g->arc[i].ol, asg_arc_len(ug->g->arc[i]));
	}
	for (i = 0; i < ug->u.n; ++i) { // summary of unitigs
		uint32_t cnt[2];
		ma_utg_t *u = &ug->u.a[i];
		if (u->start == UINT32_MAX) {
			fprintf(fp, "x\tutg%.6dc\t%d\t%d\n", i + 1, u->len, u->n);
		} else {
			for (j = 0; j < 2; ++j) cnt[j] = asg_arc_n(ug->g, i<<1|j);
			if (sub)
				fprintf(fp, "x\tutg%.6dl\t%d\t%d\t%d\t%d\t%s:%d-%d\t%c\t%s:%d-%d\t%c\n", i + 1, u->len, u->n, cnt[1], cnt[0],
						d->seq[u->start>>1].name, sub[u->start>>1].s + 1, sub[u->start>>1].e, "+-"[u->start&1],
						d->seq[u->end>>1].name, sub[u->end>>1].s + 1, sub[u->end>>1].e, "+-"[u->end&1]);
			else
				fprintf(fp, "x\tutg%.6dl\t%d\t%d\t%d\t%d\t%s\t%c\t%s\t%c\n", i + 1, u->len, u->n, cnt[1], cnt[0],
						d->seq[u->start>>1].name, "+-"[u->start&1], d->seq[u->end>>1].name, "+-"[u->end&1]);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, (%rsp)
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
movq %rdi, %rbx
leaq 0x40(%rsp), %rbp
xorl %eax, %eax
movq %rdi, 0x10(%rsp)
movl %eax, %eax
cmpq %rax, (%rbx)
jbe 0x5399
movq 0x10(%rbx), %r13
imulq $0x28, %rax, %rbx
leaq (%rbx,%r13), %r12
leal 0x1(%rax), %edx
movl (%r13,%rbx), %eax
shrl $0x1f, %eax
leaq 0x432d(%rip), %rcx      # 0x9598
movsbl (%rax,%rcx), %ecx
xorl %r15d, %r15d
movq %rbp, %rdi
leaq 0x4312(%rip), %rsi      # 0x958e
movl %edx, 0x8(%rsp)
xorl %eax, %eax
callq 0x11f0
movq 0x20(%r13,%rbx), %rcx
testq %rcx, %rcx
leaq 0x4316(%rip), %rax      # 0x95ac
cmoveq %rax, %rcx
movl (%r13,%rbx), %r8d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r8d
movq (%rsp), %rdi
leaq 0x42e9(%rip), %rsi      # 0x959b
movq %rbp, %rdx
xorl %eax, %eax
callq 0x1120
xorl %r13d, %r13d
movl 0x10(%r12), %eax
cmpq %rax, %r15
jae 0x538b
movq 0x18(%r12), %rax
movq (%rax,%r15,8), %r10
movq %r10, %rax
shrq $0x21, %rax
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x20(%rsp), %rdx
movq 0x8(%rdx), %rdx
movq (%rdx,%rcx), %r8
testq %r14, %r14
je 0x5345
movl (%r14,%rax,8), %r9d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r9d
incl %r9d
movl 0x4(%r14,%rax,8), %r11d
btq $0x20, %r10
leaq 0x425a(%rip), %rax      # 0x9570
adcq $0x0, %rax
movsbl (%rax), %ebx
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
leaq 0x4281(%rip), %rsi      # 0x95ae
movq %rbp, %rdx
movl %r13d, %ecx
xorl %eax, %eax
pushq %r10
pushq %rbx
pushq %r11
callq 0x1120
addq $0x20, %rsp
jmp 0x537a
btq $0x20, %r10
leaq 0x421f(%rip), %rax      # 0x9570
adcq $0x0, %rax
movsbl (%rax), %r9d
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
leaq 0x425d(%rip), %rsi      # 0x95c6
movq %rbp, %rdx
movl %r13d, %ecx
xorl %eax, %eax
pushq %r10
callq 0x1120
popq %rcx
popq %rdx
movq 0x18(%r12), %rax
addl (%rax,%r15,8), %r13d
incq %r15
jmp 0x52bf
movq 0x10(%rsp), %rbx
movl 0x8(%rsp), %eax
jmp 0x5242
pushq $0xc
popq %r15
leaq 0x4234(%rip), %r12      # 0x95d8
xorl %r13d, %r13d
movq 0x18(%rbx), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpq %rcx, %r13
jae 0x5459
movq 0x8(%rax), %rax
movq -0xc(%rax,%r15), %r10
movl -0x4(%rax,%r15), %esi
movq %r10, %rcx
shrq $0x21, %rcx
leal 0x1(%rcx), %edx
movq 0x10(%rbx), %rdi
imulq $0x28, %rcx, %rcx
movl (%rdi,%rcx), %ecx
shrl $0x1f, %ecx
leaq 0x41ae(%rip), %rbp      # 0x9598
movsbl (%rcx,%rbp), %ecx
btq $0x20, %r10
leaq 0x4176(%rip), %rbx      # 0x9570
movq %rbx, %r8
adcq $0x0, %r8
movsbl (%r8), %r8d
movl %esi, %r9d
shrl %r9d
imulq $0x28, %r9, %r11
incl %r9d
movl (%rdi,%r11), %edi
shrl $0x1f, %edi
movsbl (%rdi,%rbp), %r11d
andl $0x1, %esi
movsbl (%rsi,%rbx), %ebx
movl (%rax,%r15), %ebp
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %ebp
movq (%rsp), %rdi
movq %r12, %rsi
xorl %eax, %eax
pushq %r10
pushq %rbp
pushq %rbx
movq 0x28(%rsp), %rbx
pushq %r11
callq 0x1120
addq $0x20, %rsp
incq %r13
addq $0x10, %r15
jmp 0x53a7
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r13d, %r13d
movl %r13d, %r13d
cmpq %r13, (%rbx)
jbe 0x560d
movq 0x10(%rbx), %rcx
imulq $0x28, %r13, %rdx
leaq (%rcx,%rdx), %rax
movl 0x4(%rcx,%rdx), %edx
cmpq %r12, %rdx
je 0x558e
movq 0x18(%rbx), %rsi
leal (,%r13,2), %ecx
shlq $0x3, %rcx
addq 0x20(%rsi), %rcx
xorl %esi, %esi
cmpq $0x2, %rsi
je 0x54b4
movl (%rcx,%rsi,8), %edi
movl %edi, 0x28(%rsp,%rsi,4)
incq %rsi
jmp 0x54a2
incl %r13d
movl (%rax), %ecx
andl %ebp, %ecx
movl %edx, %esi
shrl %esi
movq %rsi, %rdi
shlq $0x4, %rdi
movl 0x10(%rax), %r8d
movl 0x28(%rsp), %r9d
movq %r9, 0x8(%rsp)
movl 0x2c(%rsp), %r9d
movq 0x20(%rsp), %r10
movq 0x8(%r10), %r15
movq (%r15,%rdi), %rdi
movq %rdi, 0x18(%rsp)
testq %r14, %r14
je 0x55b3
movl (%r14,%rsi,8), %r12d
andl %ebp, %r12d
incl %r12d
movl 0x4(%r14,%rsi,8), %esi
movq %rsi, 0x38(%rsp)
andl $0x1, %edx
leaq 0x405e(%rip), %rsi      # 0x9570
movsbl (%rdx,%rsi), %edx
movq %rdx, 0x30(%rsp)
movl 0x8(%rax), %eax
movl %eax, %ebp
shrl %ebp
movl (%r14,%rbp,8), %ebx
movl 0x4(%r14,%rbp,8), %r11d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
shlq $0x4, %rbp
andl %edi, %ebx
incl %ebx
andl $0x1, %eax
movsbl (%rax,%rsi), %r10d
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
leaq 0x40c3(%rip), %rsi      # 0x9613
movl %r13d, %edx
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %rbx
pushq (%r15,%rbp)
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
pushq 0x58(%rsp)
pushq 0x68(%rsp)
pushq %r12
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
pushq 0x58(%rsp)
pushq 0x50(%rsp)
callq 0x1120
addq $0x50, %rsp
movq 0x10(%rsp), %rbx
jmp 0x5467
incl %r13d
movl (%rax), %ecx
andl %ebp, %ecx
movl 0x10(%rax), %r8d
movq (%rsp), %rdi
leaq 0x405d(%rip), %rsi      # 0x9601
movl %r13d, %edx
xorl %eax, %eax
callq 0x1120
jmp 0x5467
andl $0x1, %edx
leaq 0x3fb3(%rip), %rsi      # 0x9570
movsbl (%rdx,%rsi), %r10d
movl 0x8(%rax), %eax
movl %eax, %r11d
shrl %r11d
shlq $0x4, %r11
andl $0x1, %eax
movsbl (%rax,%rsi), %ebx
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
leaq 0x405d(%rip), %rsi      # 0x9643
movl %r13d, %edx
xorl %eax, %eax
pushq %rbx
pushq (%r15,%r11)
pushq %r10
pushq 0x38(%rsp)
pushq 0x30(%rsp)
callq 0x1120
addq $0x30, %rsp
movq 0x10(%rsp), %rbx
jmp 0x5467
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq