// File: /workspace/github_c_makefile_star2_O1/lh3[P]miniprot/format.c
// Function: mp_write_paf
void mp_write_paf(kstring_t *s, const mp_idx_t *mi, const mp_mapopt_t *opt, const mp_bseq1_t *seq, const mp_reg1_t *r)
{
	const mp_ctg_t *ctg;
	if (opt->flag & (MP_F_GFF|MP_F_GTF)) mp_sprintf_lite(s, "##PAF\t");
	if (r == 0) {
		mp_sprintf_lite(s, "%s\t%d\t0\t0\t*\t*\t0\t0\t0\t0\t0\t0\n", seq->name, seq->l_seq);
		return;
	}
	ctg = &mi->nt->ctg[r->vid>>1];
	mp_sprintf_lite(s, "%s\t%d\t%d\t%d\t%c\t%s\t%ld\t", seq->name, seq->l_seq, r->qs, r->qe, "+-"[r->vid&1], ctg->name, (long)ctg->len);
	if (r->vid&1) mp_sprintf_lite(s, "%ld\t%ld\t", (long)(ctg->len - r->ve), (long)(ctg->len - r->vs));
	else mp_sprintf_lite(s, "%ld\t%ld\t", (long)r->vs, (long)r->ve);
	if (r->p) {
		int32_t k;
		mp_sprintf_lite(s, "%d\t%d\t0\tAS:i:%d\tms:i:%d\tnp:i:%d\tfs:i:%d\tst:i:%d\tda:i:%d\tdo:i:%d\t",
			r->p->n_iden * 3, r->p->blen, r->p->dp_score, r->p->dp_max, r->p->n_plus, r->p->n_fs, r->p->n_stop, r->p->dist_start, r->p->dist_stop);
		mp_sprintf_lite(s, "cg:Z:");
		for (k = 0; k < r->p->n_cigar; ++k)
			mp_sprintf_lite(s, "%d%c", r->p->cigar[k]>>4, NS_CIGAR_STR[r->p->cigar[k]&0xf]);
	} else mp_sprintf_lite(s, "%d\t%d\t%d", r->chn_sc, r->chn_sc_ungap, r->cnt);
	if (!(opt->flag & MP_F_NO_CS)) {
		mp_sprintf_lite(s, "\t");
		mp_write_cs(s, mi, &seq->seq[r->qs], r);
	}
	mp_sprintf_lite(s, "\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %r13
testb $0x28, (%rdx)
je 0xfc9a
leaq 0x4629(%rip), %rsi      # 0x142b9
movq %r13, %rdi
xorl %eax, %eax
callq 0xf530
testq %r12, %r12
je 0xfd17
movq %r14, 0x8(%rsp)
movq 0x18(%r14), %rax
movq 0x28(%rax), %rbx
movl 0x30(%r12), %eax
movl 0x34(%r12), %r8d
movl %eax, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %r14
movq 0x8(%r15), %rdx
movl (%r15), %ecx
movl 0x38(%r12), %r9d
andl $0x1, %eax
leaq 0x3a40(%rip), %rsi      # 0x13714
movsbl (%rax,%rsi), %r10d
subq $0x8, %rsp
leaq 0x45f7(%rip), %rsi      # 0x142db
movq %r13, %rdi
xorl %eax, %eax
pushq 0x8(%rbx,%r14,8)
pushq 0x10(%rbx,%r14,8)
pushq %r10
callq 0xf530
addq $0x20, %rsp
testb $0x1, 0x30(%r12)
movq %rbp, 0x48(%rsp)
jne 0xfd3d
movq 0x40(%r12), %rdx
movq 0x48(%r12), %rcx
jmp 0xfd52
movq 0x8(%r15), %rdx
movl (%r15), %ecx
leaq 0x459b(%rip), %rsi      # 0x142c0
movq %r13, %rdi
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf530
leaq (%rbx,%r14,8), %rax
movq 0x8(%rax), %rcx
movq %rcx, %rdx
subq 0x48(%r12), %rdx
subq 0x40(%r12), %rcx
leaq 0x4599(%rip), %rsi      # 0x142f2
movq %r13, %rdi
xorl %eax, %eax
callq 0xf530
movq 0x60(%r12), %rax
testq %rax, %rax
movq %r13, 0x40(%rsp)
je 0xfe20
movl 0x28(%rax), %ecx
leal (%rcx,%rcx,2), %edx
movl 0x14(%rax), %ecx
movl (%rax), %r8d
movl 0x4(%rax), %r9d
movl 0x2c(%rax), %r10d
movl 0x18(%rax), %r11d
movl 0x1c(%rax), %ebx
movl 0x24(%rax), %r14d
movl 0x20(%rax), %r13d
subq $0x8, %rsp
leaq 0x4557(%rip), %rsi      # 0x142fb
movq 0x48(%rsp), %rdi
xorl %eax, %eax
pushq %r13
movq 0x50(%rsp), %r13
pushq %r14
pushq %rbx
pushq %r11
pushq %r10
callq 0xf530
addq $0x30, %rsp
leaq 0x4573(%rip), %rsi      # 0x1433c
movq %r13, %rdi
xorl %eax, %eax
callq 0xf530
movq 0x60(%r12), %rax
cmpl $0x0, 0xc(%rax)
jle 0xfe40
leaq 0x4562(%rip), %rbx      # 0x14347
leaq 0x4556(%rip), %rbp      # 0x14342
xorl %r14d, %r14d
movl 0x30(%rax,%r14,4), %eax
movl %eax, %edx
shrl $0x4, %edx
andl $0xf, %eax
movsbl (%rax,%rbx), %ecx
movq %r13, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0xf530
incq %r14
movq 0x60(%r12), %rax
movslq 0xc(%rax), %rcx
cmpq %rcx, %r14
jl 0xfdef
jmp 0xfe40
movl 0x4(%r12), %r8d
movl 0x24(%r12), %edx
movl 0x28(%r12), %ecx
leaq 0x4521(%rip), %rsi      # 0x14357
movq %r13, %rdi
xorl %eax, %eax
callq 0xf530
movq 0x48(%rsp), %rax
testb $0x2, 0x1(%rax)
jne 0x1050c
leaq 0x45e4(%rip), %rsi      # 0x1443a
movq %r13, %rdi
xorl %eax, %eax
callq 0xf530
movq 0x60(%r12), %rbp
testq %rbp, %rbp
je 0x1050c
movq 0x10(%r15), %rax
movq %rax, 0x30(%rsp)
movq %r12, 0x28(%rsp)
movslq 0x34(%r12), %rbx
leaq 0x44d8(%rip), %rsi      # 0x14360
movq %r13, %rdi
xorl %eax, %eax
callq 0xf530
movslq 0xc(%rbp), %rax
testq %rax, %rax
jle 0xfeec
movl $0x10, %esi
xorl %ecx, %ecx
movl 0x30(%rbp,%rcx,4), %r8d
movl %r8d, %edi
andl $0xf, %edi
movl %r8d, %edx
shrl $0x4, %edx
cmpl $0x1, %edi
setne %r9b
andl $0xe, %r8d
cmpl $0xa, %r8d
setne %r8b
testb %r8b, %r9b
jne 0xfed2
cmpl %edx, %esi
cmovlel %edx, %esi
jmp 0xfedf
cmpl $0x2, %edi
jne 0xfedf
leal (%rdx,%rdx,2), %edx
cmpl %edx, %esi
cmovlel %edx, %esi
incq %rcx
cmpq %rcx, %rax
jne 0xfea2
addl $0x10, %esi
jmp 0xfef1
movl $0x20, %esi
movq $0x0, 0x10(%rsp)
xorl %edi, %edi
callq 0x80a1
movq %rax, %r15
movq 0x28(%rsp), %r14
movq 0x48(%r14), %rsi
subq 0x40(%r14), %rsi
xorl %edi, %edi
callq 0x80a1
movq 0x8(%rsp), %rcx
movq 0x18(%rcx), %rdi
movl 0x30(%r14), %esi
movq 0x40(%r14), %rdx
movq 0x48(%r14), %rcx
movq %rax, 0x20(%rsp)
movq %rax, %r8
callq 0xc425
movq 0x48(%r14), %rcx
subq 0x40(%r14), %rcx
cmpq %rcx, %rax
jne 0x1052b
cmpl $0x0, 0xc(%rbp)
jle 0x104d6
addq %rbx, 0x30(%rsp)
movq 0x20(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x60(%rsp)
leaq 0x446b(%rip), %rdi      # 0x143da
xorl %edx, %edx
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x28(%rsp), %rbx
movq %rbp, 0x18(%rsp)
movl 0x30(%rbp,%rdx,4), %r14d
movl %r14d, %ebp
andl $0xf, %ebp
movl %r14d, %r8d
shrl $0x4, %r8d
cmpl $0xb, %ebp
ja 0x1011c
leal (%r8,%r8,2), %esi
leaq 0x427d(%rip), %rcx      # 0x14230
movslq (%rcx,%rbp,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %esi, 0x5c(%rsp)
movq %r8, 0x50(%rsp)
movq %rdx, 0x38(%rsp)
xorl %ebp, %ebp
cmpl $0x10, %r14d
jb 0x100de
movslq 0x8(%rsp), %r13
addq 0x60(%rsp), %r13
movslq 0x10(%rsp), %rax
addq 0x30(%rsp), %rax
movq %rax, 0x48(%rsp)
shrl $0x4, %r14d
xorl %ebx, %ebx
xorl %ebp, %ebp
movb -0x2(%r13), %al
movb -0x1(%r13), %cl
movl %eax, %edx
shlb $0x4, %dl
leal (,%rcx,4), %esi
orb %dl, %sil
movb (%r13), %dl
orb %dl, %sil
movzbl %sil, %esi
addq 0x7fb8(%rip), %rsi      # 0x17fd8
leaq 0x84d9(%rip), %r8       # 0x18500
leaq 0x58(%r8), %rdi
cmpb $0x4, %dl
cmovaeq %rdi, %rsi
cmpb $0x4, %cl
cmovaeq %rdi, %rsi
cmpb $0x4, %al
cmovaeq %rdi, %rsi
movb (%rsi), %al
movq 0x48(%rsp), %rcx
movzbl (%rcx,%rbx), %ecx
cmpb (%r8,%rcx), %al
jne 0x10054
incl %ebp
jmp 0x100ce
testl %ebp, %ebp
movq 0x40(%rsp), %r12
jle 0x10070
movq %r12, %rdi
leaq 0x436f(%rip), %rsi      # 0x143d6
movl %ebp, %edx
xorl %eax, %eax
callq 0xf530
movzbl -0x2(%r13), %eax
leaq 0x435e(%rip), %rcx      # 0x143da
movb (%rax,%rcx), %al
movb %al, (%r15)
movzbl -0x1(%r13), %eax
movb (%rax,%rcx), %al
movb %al, 0x1(%r15)
movzbl (%r13), %eax
movb (%rax,%rcx), %al
movb %al, 0x2(%r15)
callq 0x2030
movq (%rax), %rax
movq 0x48(%rsp), %rcx
movsbq (%rcx,%rbx), %rcx
movb (%rax,%rcx,4), %al
movb %al, 0x3(%r15)
movb $0x0, 0x4(%r15)
xorl %ebp, %ebp
movq %r12, %rdi
leaq 0x431c(%rip), %rsi      # 0x143e0
movq %r15, %rdx
xorl %eax, %eax
callq 0xf530
incq %rbx
addq $0x3, %r13
cmpl %ebx, %r14d
jne 0xfff7
testl %ebp, %ebp
movq 0x40(%rsp), %r13
jle 0x100fa
movq %r13, %rdi
leaq 0x42e5(%rip), %rsi      # 0x143d6
movl %ebp, %edx
xorl %eax, %eax
callq 0xf530
movl 0x5c(%rsp), %ecx
addl 0x8(%rsp), %ecx
movq 0x50(%rsp), %rax
addl 0x10(%rsp), %eax
movq %rax, 0x10(%rsp)
movl %ecx, %eax
movq %rax, 0x8(%rsp)
jmp 0x10292
cmpl $0x3, %ebp
setne %al
andl $0xe, %r14d
cmpl $0xc, %r14d
setne %cl
testb %cl, %al
jne 0x10313
movq %rdx, 0x38(%rsp)
xorl %r14d, %r14d
cmpl $0xc, %ebp
setne %r14b
incl %r14d
movl %r14d, %ebx
xorl $0x3, %ebx
cmpl $0x3, %ebp
movl $0x0, %eax
cmovel %eax, %r14d
cmovel %eax, %ebx
je 0x101d2
movq %r8, 0x50(%rsp)
movslq 0x8(%rsp), %rax
cmpl $0x1, %r14d
movl %r14d, %ecx
adcl $0x0, %ecx
addq 0x20(%rsp), %rax
xorl %r12d, %r12d
movzbl (%rax,%r12), %edx
movb (%rdx,%rdi), %dl
movb %dl, (%r15,%r12)
incq %r12
cmpq %r12, %rcx
jne 0x1017a
callq 0x2030
movq (%rax), %rax
movslq 0x10(%rsp), %rcx
movq 0x30(%rsp), %rdx
movsbq (%rdx,%rcx), %rcx
movb (%rax,%rcx,4), %al
movb %al, (%r15,%r12)
movb $0x0, 0x1(%r15,%r12)
movq %r13, %rdi
leaq 0x4224(%rip), %rsi      # 0x143e0
movq %r15, %rdx
xorl %eax, %eax
callq 0xf530
leaq 0x420d(%rip), %rdi      # 0x143da
movq 0x50(%rsp), %r8
movq 0x8(%rsp), %r9
leal (%r14,%r9), %eax
cltq
movq 0x20(%rsp), %rsi
movzbl (%rsi,%rax), %ecx
movsbl (%rcx,%rdi), %edx
movzbl 0x1(%rsi,%rax), %eax
movsbl (%rax,%rdi), %ecx
addl %ebx, %r14d
movq %r8, %rax
subl %r14d, %r8d
addl %eax, %r9d
movq %r9, 0x8(%rsp)
movl %r9d, %eax
subl %ebx, %eax
movslq %eax, %r14
movzbl -0x2(%rsi,%r14), %eax
movsbl (%rax,%rdi), %r9d
movzbl -0x1(%rsi,%r14), %eax
movsbl (%rax,%rdi), %r10d
subq $0x8, %rsp
movq %r13, %rdi
leaq 0x41bc(%rip), %rsi      # 0x143ec
xorl %eax, %eax
pushq %r10
callq 0xf530
addq $0x10, %rsp
testl %ebx, %ebx
je 0x1027e
movl %ebx, %eax
addq 0x20(%rsp), %r14
xorl %ecx, %ecx
leaq 0x4189(%rip), %rsi      # 0x143da
movzbl (%r14,%rcx), %edx
movb (%rdx,%rsi), %dl
movb %dl, (%r15,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x10251
movb $0x0, (%r15,%rcx)
movq %r13, %rdi
leaq 0x4174(%rip), %rsi      # 0x143e8
movq %r15, %rdx
xorl %eax, %eax
callq 0xf530
xorl %eax, %eax
cmpl $0x3, %ebp
setne %al
movq 0x10(%rsp), %rcx
addl %eax, %ecx
movq %rcx, 0x10(%rsp)
movq 0x28(%rsp), %rbx
movq 0x18(%rsp), %rbp
leaq 0x4137(%rip), %rdi      # 0x143da
jmp 0x104ba
movq %rdx, %r12
cmpl $0x10, %r14d
jae 0x1031d
movl %esi, %r14d
xorl %edx, %edx
movq 0x18(%rsp), %rbp
jmp 0x10347
movq %rdx, %r12
cmpl $0x10, %r14d
jae 0x10374
movq %r8, %r14
xorl %esi, %esi
movq 0x18(%rsp), %rbp
jmp 0x103aa
movq %rdx, %r12
cmpl $0x10, %r14d
jae 0x103d8
movq %r8, %r14
xorl %edx, %edx
movq 0x18(%rsp), %rbp
jmp 0x10403
cmpl $0x10, %r14d
movq %rdx, 0x38(%rsp)
jae 0x10437
xorl %ebx, %ebx
movq 0x18(%rsp), %rbp
jmp 0x1045b
movq 0x18(%rsp), %rbp
jmp 0x104bf
movslq 0x8(%rsp), %rax
movl %esi, %r14d
movl %esi, %ecx
addq 0x20(%rsp), %rax
xorl %edx, %edx
movq 0x18(%rsp), %rbp
movzbl (%rax,%rdx), %esi
movb (%rsi,%rdi), %sil
movb %sil, (%r15,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x10333
movb $0x0, (%r15,%rdx)
movq %r13, %rdi
leaq 0x4092(%rip), %rsi      # 0x143e8
movq %r15, %rdx
xorl %eax, %eax
callq 0xf530
leaq 0x4073(%rip), %rdi      # 0x143da
addl 0x8(%rsp), %r14d
movl %r14d, %eax
jmp 0x1042a
movq %r8, %rbp
callq 0x2030
movslq 0x10(%rsp), %rcx
movq %rbp, %r14
movl %ebp, %edx
addq 0x30(%rsp), %rcx
xorl %esi, %esi
movq 0x18(%rsp), %rbp
movq (%rax), %rdi
movsbq (%rcx,%rsi), %r8
movb (%rdi,%r8,4), %dil
movb %dil, (%r15,%rsi)
incq %rsi
cmpq %rsi, %rdx
jne 0x10392
movb $0x0, (%r15,%rsi)
movq %r13, %rdi
leaq 0x402b(%rip), %rsi      # 0x143e4
movq %r15, %rdx
xorl %eax, %eax
callq 0xf530
movq %r14, %rax
addl 0x10(%rsp), %eax
movq %rax, 0x10(%rsp)
leaq 0x4004(%rip), %rdi      # 0x143da
jmp 0x1042f
movslq 0x8(%rsp), %rax
movq %r8, %r14
movl %r8d, %ecx
addq 0x20(%rsp), %rax
xorl %edx, %edx
movq 0x18(%rsp), %rbp
movzbl (%rax,%rdx), %esi
movb (%rsi,%rdi), %sil
movb %sil, (%r15,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x103ef
movb $0x0, (%r15,%rdx)
movq %r13, %rdi
leaq 0x3fd6(%rip), %rsi      # 0x143e8
movq %r15, %rdx
xorl %eax, %eax
callq 0xf530
leaq 0x3fb7(%rip), %rdi      # 0x143da
movq %r14, %rax
addl 0x8(%rsp), %eax
movq %rax, 0x8(%rsp)
movq %r12, %rdx
jmp 0x104bf
movslq 0x8(%rsp), %rax
addq 0x20(%rsp), %rax
xorl %ebx, %ebx
movq 0x18(%rsp), %rbp
movzbl (%rax,%rbx), %ecx
movb (%rcx,%rdi), %cl
movb %cl, (%r15,%rbx)
incq %rbx
cmpq %rbx, %r8
jne 0x10448
movq %r8, %r12
callq 0x2030
movq (%rax), %rax
movq 0x10(%rsp), %r14
movslq %r14d, %r14
movq 0x30(%rsp), %rcx
movsbq (%rcx,%r14), %rcx
movb (%rax,%rcx,4), %al
movb %al, (%r15,%rbx)
movb $0x0, 0x1(%r15,%rbx)
movq %r13, %rdi
leaq 0x3f51(%rip), %rsi      # 0x143e0
movq %r15, %rdx
xorl %eax, %eax
callq 0xf530
leaq 0x3f3a(%rip), %rdi      # 0x143da
addl 0x8(%rsp), %r12d
incl %r14d
movq %r14, 0x10(%rsp)
movl %r12d, %eax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rbx
movq 0x38(%rsp), %rdx
incq %rdx
movslq 0xc(%rbp), %rax
cmpq %rax, %rdx
jl 0xff8d
movslq 0x8(%rsp), %rax
jmp 0x104dd
xorl %eax, %eax
movq 0x28(%rsp), %rbx
movq 0x48(%rbx), %rcx
subq 0x40(%rbx), %rcx
cmpq %rax, %rcx
jne 0x1054a
movl 0x38(%rbx), %eax
subl 0x34(%rbx), %eax
cmpl %eax, 0x10(%rsp)
jne 0x10569
xorl %edi, %edi
movq 0x20(%rsp), %rsi
callq 0x7fd6
xorl %edi, %edi
movq %r15, %rsi
callq 0x7fd6
leaq 0x391e(%rip), %rsi      # 0x13e31
movq %r13, %rdi
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf530
leaq 0x3e34(%rip), %rdi      # 0x14366
leaq 0x3e43(%rip), %rsi      # 0x1437c
leaq 0x3e45(%rip), %rcx      # 0x14385
movl $0x77, %edx
callq 0x2150
leaq 0x3ea7(%rip), %rdi      # 0x143f8
leaq 0x3e24(%rip), %rsi      # 0x1437c
leaq 0x3e26(%rip), %rcx      # 0x14385
movl $0xb7, %edx
callq 0x2150
leaq 0x3e9c(%rip), %rdi      # 0x1440c
leaq 0x3e05(%rip), %rsi      # 0x1437c
leaq 0x3e07(%rip), %rcx      # 0x14385
movl $0xb8, %edx
callq 0x2150