// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/format.c
// Function: mg_print_lchain
void mg_print_lchain(FILE *fp, const mg_idx_t *gi, int n_lc, const mg_lchain_t *lc, const mg128_t *a, const char *qname)
{
	kstring_t str = {0,0,0};
	int i, j;
	for (i = 0; i < n_lc; ++i) {
		const mg_lchain_t *p = &lc[i];
		int mlen, blen, span = a[p->off].y>>32&0xff;
		mlen = blen = span;
		for (j = 1; j < p->cnt; ++j) {
			int ql = (int32_t)a[p->off + j].y - (int32_t)a[p->off + j - 1].y;
			int pl = (int32_t)a[p->off + j].x - (int32_t)a[p->off + j - 1].x;
			blen += pl > ql? pl : ql;
			mlen += pl > span && ql > span? span : pl < ql? pl : ql;
		}
		str.l = 0;
		mg_sprintf_lite(&str, "LC\t%s\t%d\t%d\t%c\t%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t", qname, p->qs, p->qe, "+-"[p->v&1], gi->g->seg[p->v>>1].name, gi->g->seg[p->v>>1].len,
						p->rs, p->re, p->score, mlen, blen, p->cnt);
		for (j = 0; j < p->cnt; ++j)
			mg_sprintf_lite(&str, "%d,", (int32_t)a[p->off + j].y);
		mg_sprintf_lite(&str, "\t");
		for (j = 0; j < p->cnt; ++j)
			mg_sprintf_lite(&str, "%d,", (int32_t)a[p->off + j].x);
		mg_sprintf_lite(&str, "\t");
		for (j = 0; j < p->cnt; ++j)
			mg_sprintf_lite(&str, "%d,", (int32_t)(a[p->off + j].y>>MG_SEED_OCC_SHIFT));
		mg_sprintf_lite(&str, "\n");
		fwrite(str.s, 1, str.l, fp);
	}
	free(str.s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2190
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x312d9
movq -0x48(%rbp), %rax
movslq -0x6c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq -0x78(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0x80(%rbp)
movl %eax, -0x7c(%rbp)
movl $0x1, -0x70(%rbp)
movl -0x70(%rbp), %eax
movq -0x78(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
sarl %ecx
cmpl %ecx, %eax
jge 0x310ac
movq -0x50(%rbp), %rax
movq -0x78(%rbp), %rcx
movl (%rcx), %ecx
addl -0x70(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x78(%rbp), %rdx
movl (%rdx), %edx
addl -0x70(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
subl %ecx, %eax
movl %eax, -0x88(%rbp)
movq -0x50(%rbp), %rax
movq -0x78(%rbp), %rcx
movl (%rcx), %ecx
addl -0x70(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x78(%rbp), %rdx
movl (%rdx), %edx
addl -0x70(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
subl %ecx, %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x88(%rbp), %eax
jle 0x3101c
movl -0x8c(%rbp), %eax
movl %eax, -0x90(%rbp)
jmp 0x31028
movl -0x88(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %eax
addl -0x80(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jle 0x3105e
movl -0x88(%rbp), %eax
cmpl -0x84(%rbp), %eax
jle 0x3105e
movl -0x84(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x31092
movl -0x8c(%rbp), %eax
cmpl -0x88(%rbp), %eax
jge 0x3107a
movl -0x8c(%rbp), %eax
movl %eax, -0x98(%rbp)
jmp 0x31086
movl -0x88(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %eax
addl -0x7c(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x30f6a
movl $0x0, -0x68(%rbp)
movq -0x58(%rbp), %rdx
movq -0x78(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x78(%rbp), %rax
movl 0x18(%rax), %r8d
movq -0x78(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0xb284(%rip), %rax      # 0x3c35f
movsbl (%rax,%rsi), %r9d
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rsi
movl 0x8(%rsi), %esi
shrl %esi
movl %esi, %esi
shlq $0x6, %rsi
addq %rsi, %rax
movq 0x18(%rax), %r13
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rsi
movl 0x8(%rsi), %esi
shrl %esi
movl %esi, %esi
shlq $0x6, %rsi
addq %rsi, %rax
movl (%rax), %r12d
movq -0x78(%rbp), %rax
movl 0xc(%rax), %r15d
movq -0x78(%rbp), %rax
movl 0x10(%rax), %r14d
movq -0x78(%rbp), %rax
movl 0x1c(%rax), %ebx
movl -0x7c(%rbp), %r11d
movl -0x80(%rbp), %r10d
movq -0x78(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
sarl %eax
leaq -0x68(%rbp), %rdi
leaq 0xcbfa(%rip), %rsi      # 0x3dd50
movq %r13, (%rsp)
movl %r12d, 0x8(%rsp)
movl %r15d, 0x10(%rsp)
movl %r14d, 0x18(%rsp)
movl %ebx, 0x20(%rsp)
movl %r11d, 0x28(%rsp)
movl %r10d, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movb $0x0, %al
callq 0x30d90
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movq -0x78(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
sarl %ecx
cmpl %ecx, %eax
jge 0x311d5
movq -0x50(%rbp), %rax
movq -0x78(%rbp), %rcx
movl (%rcx), %ecx
addl -0x70(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, %edx
leaq -0x68(%rbp), %rdi
leaq 0xcbb5(%rip), %rsi      # 0x3dd78
movb $0x0, %al
callq 0x30d90
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x31189
leaq -0x68(%rbp), %rdi
leaq 0xcbc0(%rip), %rsi      # 0x3dda0
movb $0x0, %al
callq 0x30d90
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movq -0x78(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
sarl %ecx
cmpl %ecx, %eax
jge 0x31239
movq -0x50(%rbp), %rax
movq -0x78(%rbp), %rcx
movl (%rcx), %ecx
addl -0x70(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %edx
leaq -0x68(%rbp), %rdi
leaq 0xcb51(%rip), %rsi      # 0x3dd78
movb $0x0, %al
callq 0x30d90
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x311ee
leaq -0x68(%rbp), %rdi
leaq 0xcb5c(%rip), %rsi      # 0x3dda0
movb $0x0, %al
callq 0x30d90
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movq -0x78(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
sarl %ecx
cmpl %ecx, %eax
jge 0x312a2
movq -0x50(%rbp), %rax
movq -0x78(%rbp), %rcx
movl (%rcx), %ecx
addl -0x70(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x38, %rax
movl %eax, %edx
leaq -0x68(%rbp), %rdi
leaq 0xcae8(%rip), %rsi      # 0x3dd78
movb $0x0, %al
callq 0x30d90
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x31252
leaq -0x68(%rbp), %rdi
leaq 0xc9dd(%rip), %rsi      # 0x3dc8a
movb $0x0, %al
callq 0x30d90
movq -0x60(%rbp), %rdi
movl -0x68(%rbp), %eax
movl %eax, %edx
movq -0x30(%rbp), %rcx
movl $0x1, %esi
callq 0x2340
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x30f12
movq -0x60(%rbp), %rdi
callq 0x2040
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)