// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, 0x40(%rsp)
movq %rcx, 0x8(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdi, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
testl %edx, %edx
jle 0x2010b
movq %r8, %r14
movl %edx, %eax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
leaq 0x10(%rsp), %rbp
leaq 0xa009(%rip), %rbx      # 0x29ec8
movq %rax, 0x70(%rsp)
leaq (%rax,%rax,4), %rax
movq 0x8(%rsp), %rsi
movslq (%rsi,%rax,8), %rcx
shlq $0x4, %rcx
movzbl 0xc(%r14,%rcx), %edx
movl 0x4(%rsi,%rax,8), %r10d
addl %r10d, %r10d
sarl %r10d
cmpl $0x2, %r10d
jl 0x1ff47
movl %r10d, %esi
addq %r14, %rcx
shlq $0x4, %rsi
movl $0x10, %edi
movl %edx, %r11d
movl %edx, %r15d
movl (%rcx,%rdi), %r8d
movl 0x8(%rcx,%rdi), %r9d
subl -0x8(%rcx,%rdi), %r9d
subl -0x10(%rcx,%rdi), %r8d
cmpl %r9d, %r8d
movl %r9d, %r12d
cmovgl %r8d, %r12d
movl %r9d, %r13d
cmovll %r8d, %r13d
addl %r12d, %r15d
cmpl %edx, %r9d
movl %r13d, %r9d
cmovgl %edx, %r9d
cmpl %edx, %r8d
cmovlel %r13d, %r9d
addl %r9d, %r11d
addq $0x10, %rdi
cmpq %rdi, %rsi
jne 0x1ff01
jmp 0x1ff4d
movl %edx, %r15d
movl %edx, %r11d
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %r13
movl $0x0, 0x10(%rsp)
movl 0x14(%r13), %ecx
movl 0x18(%r13), %r8d
movl 0x8(%r13), %r12d
movl 0xc(%r13), %eax
movq %rax, 0x68(%rsp)
movl %r12d, %eax
andl $0x1, %eax
leaq 0x83ef(%rip), %rdx      # 0x2836f
movsbl (%rax,%rdx), %r9d
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x60(%rsp)
shrl %r12d
shlq $0x6, %r12
movl (%rax,%r12), %eax
movq %rax, 0x58(%rsp)
movl 0x10(%r13), %eax
movq %rax, 0x50(%rsp)
movl 0x1c(%r13), %eax
movq %rax, 0x48(%rsp)
movq %rbp, %rdi
leaq 0x9ede(%rip), %rsi      # 0x29ea0
movq 0x40(%rsp), %rdx
xorl %eax, %eax
pushq %r10
pushq %r15
pushq %r11
pushq 0x60(%rsp)
pushq 0x70(%rsp)
pushq 0x90(%rsp)
pushq 0x88(%rsp)
movq 0x98(%rsp), %r10
pushq 0x18(%r10,%r12)
callq 0x1fd66
addq $0x40, %rsp
movl 0x4(%r13), %eax
addl %eax, %eax
testl %eax, %eax
jle 0x20035
xorl %r15d, %r15d
movslq (%r13), %rax
addq %r15, %rax
shlq $0x4, %rax
movl 0x8(%r14,%rax), %edx
movq %rbp, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1fd66
movl 0x4(%r13), %eax
addl %eax, %eax
sarl %eax
incq %r15
cmpl %eax, %r15d
jl 0x20008
movq %rbp, %rdi
leaq 0x9eb1(%rip), %r12      # 0x29ef0
movq %r12, %rsi
xorl %eax, %eax
callq 0x1fd66
movl 0x4(%r13), %eax
addl %eax, %eax
testl %eax, %eax
jle 0x20082
xorl %r15d, %r15d
movslq (%r13), %rax
addq %r15, %rax
shlq $0x4, %rax
movl (%r14,%rax), %edx
movq %rbp, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1fd66
movl 0x4(%r13), %eax
addl %eax, %eax
sarl %eax
incq %r15
cmpl %eax, %r15d
jl 0x20056
movq %rbp, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1fd66
movl 0x4(%r13), %eax
addl %eax, %eax
testl %eax, %eax
jle 0x200ca
xorl %r15d, %r15d
movslq (%r13), %rax
addq %r15, %rax
shlq $0x4, %rax
movzbl 0xf(%r14,%rax), %edx
movq %rbp, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1fd66
movl 0x4(%r13), %eax
addl %eax, %eax
sarl %eax
incq %r15
cmpl %eax, %r15d
jl 0x2009c
movq %rbp, %rdi
leaq 0x9cf6(%rip), %rsi      # 0x29dca
xorl %eax, %eax
callq 0x1fd66
movq 0x18(%rsp), %r13
movl 0x10(%rsp), %edx
movl $0x1, %esi
movq %r13, %rdi
movq 0x30(%rsp), %rcx
callq 0x2340
movq 0x70(%rsp), %rax
incq %rax
cmpq 0x28(%rsp), %rax
jne 0x1febf
jmp 0x2010e
xorl %r13d, %r13d
movq %r13, %rdi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040