// File: /workspace/github_c_makefile_star2_O1/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 $0x78, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
movq %rdi, %r15
cmpq $0x0, (%rdi)
movq %rdi, 0x18(%rsp)
je 0x6b34
leaq 0x50(%rsp), %rbp
xorl %eax, %eax
xorl %edx, %edx
movq 0x10(%r15), %rbx
leaq (%rax,%rax,4), %r15
incl %edx
movl (%rbx,%r15,8), %eax
shrl $0x1f, %eax
leaq 0x3be4(%rip), %rcx      # 0xa5c8
movsbl (%rax,%rcx), %ecx
movq %rbp, %rdi
leaq 0x3bcc(%rip), %rsi      # 0xa5be
movl %edx, 0x10(%rsp)
xorl %eax, %eax
callq 0x11f0
movq 0x20(%rbx,%r15,8), %rcx
testq %rcx, %rcx
leaq 0x3bd0(%rip), %rax      # 0xa5dc
cmoveq %rax, %rcx
movl (%rbx,%r15,8), %r8d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r8d
movq 0x8(%rsp), %rdi
leaq 0x3ba3(%rip), %rsi      # 0xa5cb
movq %rbp, %rdx
xorl %eax, %eax
callq 0x1120
cmpl $0x0, 0x10(%rbx,%r15,8)
je 0x6b20
leaq (%rbx,%r15,8), %r15
xorl %ebx, %ebx
xorl %r13d, %r13d
movq 0x18(%r15), %rax
movq (%rax,%rbx,8), %r10
movq %r10, %rax
shrq $0x21, %rax
testq %r14, %r14
je 0x6ac0
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rax, %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %r8
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 0x3b11(%rip), %rax      # 0xa5a0
adcq $0x0, %rax
movsbl (%rax), %r12d
subq $0x8, %rsp
movq 0x10(%rsp), %rdi
leaq 0x3b37(%rip), %rsi      # 0xa5de
movq %rbp, %rdx
movl %r13d, %ecx
xorl %eax, %eax
pushq %r10
pushq %r12
pushq %r11
callq 0x1120
addq $0x20, %rsp
jmp 0x6b08
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %r8
btq $0x20, %r10
leaq 0x3ac3(%rip), %rax      # 0xa5a0
adcq $0x0, %rax
movsbl (%rax), %r9d
subq $0x8, %rsp
movq 0x10(%rsp), %rdi
leaq 0x3b01(%rip), %rsi      # 0xa5f6
movq %rbp, %rdx
movl %r13d, %ecx
xorl %eax, %eax
pushq %r10
callq 0x1120
addq $0x10, %rsp
movq 0x18(%r15), %rax
addl (%rax,%rbx,8), %r13d
incq %rbx
movl 0x10(%r15), %eax
cmpq %rax, %rbx
jb 0x6a47
movl 0x10(%rsp), %edx
movl %edx, %eax
movq 0x18(%rsp), %r15
cmpq %rax, (%r15)
ja 0x69cc
movq 0x18(%r15), %rax
testl $0x7fffffff, 0x4(%rax)  # imm = 0x7FFFFFFF
movq 0x8(%rsp), %r12
je 0x6c05
movl $0xc, %r13d
xorl %ebp, %ebp
movq 0x8(%rax), %rax
movq -0xc(%rax,%r13), %r10
movl -0x4(%rax,%r13), %esi
movq %r10, %rcx
shrq $0x21, %rcx
leal 0x1(%rcx), %edx
movq 0x10(%r15), %rdi
leaq (%rcx,%rcx,4), %rcx
movl (%rdi,%rcx,8), %ecx
shrl $0x1f, %ecx
leaq 0x3a49(%rip), %rbx      # 0xa5c8
movsbl (%rcx,%rbx), %ecx
btq $0x20, %r10
leaq 0x3a11(%rip), %r15      # 0xa5a0
movq %r15, %r8
adcq $0x0, %r8
movsbl (%r8), %r8d
movl %esi, %r9d
shrl %r9d
leaq (%r9,%r9,4), %r11
incl %r9d
movl (%rdi,%r11,8), %edi
shrl $0x1f, %edi
movsbl (%rdi,%rbx), %r11d
andl $0x1, %esi
movsbl (%rsi,%r15), %ebx
movl (%rax,%r13), %r15d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r15d
movq %r12, %rdi
leaq 0x3a37(%rip), %rsi      # 0xa608
xorl %eax, %eax
pushq %r10
pushq %r15
movq 0x28(%rsp), %r15
pushq %rbx
pushq %r11
callq 0x1120
addq $0x20, %rsp
incq %rbp
movq 0x18(%r15), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq $0x10, %r13
cmpq %rcx, %rbp
jb 0x6b52
cmpq $0x0, (%r15)
je 0x6dce
movq %r12, %rbx
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
xorl %r12d, %r12d
xorl %eax, %eax
xorl %ebp, %ebp
movq 0x10(%r15), %rcx
leaq (%rax,%rax,4), %rax
leaq (%rcx,%rax,8), %rax
movl 0x4(%rax), %esi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rsi
je 0x6d2e
movl %r12d, %ecx
shlq $0x3, %rcx
movq 0x18(%r15), %rdx
addq 0x20(%rdx), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,8), %edi
movl %edi, 0x28(%rsp,%rdx,4)
incq %rdx
cmpq $0x1, %rdx
je 0x6c4d
leal 0x1(%rbp), %edx
movl (%rax), %ecx
andl %r10d, %ecx
movl %esi, %ebx
shrl %ebx
movl 0x10(%rax), %r8d
movl 0x28(%rsp), %edi
movq %rdi, 0x10(%rsp)
testq %r14, %r14
je 0x6d4d
movl 0x2c(%rsp), %r9d
movq 0x20(%rsp), %rdi
movq 0x8(%rdi), %rdi
movq %rdi, 0x48(%rsp)
movq %rbx, %r13
shlq $0x4, %r13
movl (%r14,%rbx,8), %r15d
andl %r10d, %r15d
incl %r15d
movl 0x4(%r14,%rbx,8), %edi
movq %rdi, 0x40(%rsp)
andl $0x1, %esi
leaq 0x38e9(%rip), %rdi      # 0xa5a0
movsbl (%rsi,%rdi), %esi
movq %rsi, 0x38(%rsp)
movl 0x8(%rax), %eax
movl %eax, %esi
shrl %esi
movl (%r14,%rsi,8), %ebx
movl 0x4(%r14,%rsi,8), %r11d
movq %r11, 0x30(%rsp)
movq %rsi, %r11
shlq $0x4, %r11
andl %r10d, %ebx
incl %ebx
andl $0x1, %eax
movsbl (%rax,%rdi), %r10d
subq $0x8, %rsp
movq 0x10(%rsp), %rdi
leaq 0x394a(%rip), %rsi      # 0xa643
xorl %eax, %eax
pushq %r10
pushq 0x40(%rsp)
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rsp), %r10
pushq (%r10,%r11)
pushq 0x60(%rsp)
pushq 0x70(%rsp)
pushq %r15
pushq (%r10,%r13)
pushq 0x58(%rsp)
callq 0x1120
addq $0x50, %rsp
jmp 0x6db1
leal 0x1(%rbp), %edx
movl (%rax), %ecx
andl %r10d, %ecx
movl 0x10(%rax), %r8d
movq %rbx, %rdi
leaq 0x38ed(%rip), %rsi      # 0xa631
xorl %eax, %eax
callq 0x1120
jmp 0x6db6
movl 0x2c(%rsp), %r9d
movq 0x20(%rsp), %rdi
movq 0x8(%rdi), %r10
shlq $0x4, %rbx
andl $0x1, %esi
leaq 0x3837(%rip), %rdi      # 0xa5a0
movsbl (%rsi,%rdi), %r11d
movl 0x8(%rax), %eax
movl %eax, %r15d
shrl %r15d
shlq $0x4, %r15
andl $0x1, %eax
movsbl (%rax,%rdi), %r13d
subq $0x8, %rsp
movq 0x10(%rsp), %rdi
leaq 0x38e0(%rip), %rsi      # 0xa673
xorl %eax, %eax
pushq %r13
pushq (%r10,%r15)
pushq %r11
pushq (%r10,%rbx)
movq %rdi, %rbx
pushq 0x38(%rsp)
callq 0x1120
addq $0x30, %rsp
movq 0x18(%rsp), %r15
incl %ebp
addl $0x2, %r12d
movq %rbp, %rax
cmpq %rbp, (%r15)
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
ja 0x6c1f
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq