// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x28, %eax
cmpl $0x0, %eax
je 0x1c5af
movq -0x18(%rbp), %rdi
leaq 0x58f9(%rip), %rsi      # 0x21ea1
movb $0x0, %al
callq 0x1bc80
cmpq $0x0, -0x38(%rbp)
jne 0x1c5db
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x30(%rbp), %rax
movl (%rax), %ecx
leaq 0x58d9(%rip), %rsi      # 0x21ea8
movb $0x0, %al
callq 0x1bc80
jmp 0x1c866
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movl 0x30(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x30(%rbp), %rax
movl (%rax), %ecx
movq -0x38(%rbp), %rax
movl 0x34(%rax), %r8d
movq -0x38(%rbp), %rax
movl 0x38(%rax), %r9d
movq -0x38(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x4f40(%rip), %rax      # 0x21574
movsbl (%rax,%rsi), %r11d
movq -0x40(%rbp), %rax
movq 0x10(%rax), %r10
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
leaq 0x5873(%rip), %rsi      # 0x21ec3
movl %r11d, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x1bc80
movq -0x38(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1c6a8
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x38(%rbp), %rax
subq 0x48(%rax), %rdx
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x38(%rbp), %rax
subq 0x40(%rax), %rcx
leaq 0x583b(%rip), %rsi      # 0x21eda
movb $0x0, %al
callq 0x1bc80
jmp 0x1c6ca
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rdx
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rcx
leaq 0x5817(%rip), %rsi      # 0x21eda
movb $0x0, %al
callq 0x1bc80
movq -0x38(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x1c7e6
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
imull $0x3, 0x28(%rax), %edx
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x14(%rax), %ecx
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movl (%rax), %r8d
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x4(%rax), %r9d
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x2c(%rax), %r14d
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x18(%rax), %ebx
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x1c(%rax), %r11d
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x24(%rax), %r10d
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x20(%rax), %eax
leaq 0x5797(%rip), %rsi      # 0x21ee3
movl %r14d, (%rsp)
movl %ebx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x1bc80
movq -0x18(%rbp), %rdi
leaq 0x57b0(%rip), %rsi      # 0x21f24
movb $0x0, %al
callq 0x1bc80
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x38(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpl 0xc(%rcx), %eax
jge 0x1c7e4
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x44(%rbp), %rcx
movl 0x30(%rax,%rcx,4), %edx
shrl $0x4, %edx
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x44(%rbp), %rcx
movl 0x30(%rax,%rcx,4), %eax
andl $0xf, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x5768(%rip), %rax      # 0x21f2f
movsbl (%rax,%rcx), %ecx
leaq 0x5758(%rip), %rsi      # 0x21f2a
movb $0x0, %al
callq 0x1bc80
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1c782
jmp 0x1c80e
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x24(%rax), %edx
movq -0x38(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x38(%rbp), %rax
movl 0x4(%rax), %r8d
leaq 0x5738(%rip), %rsi      # 0x21f3f
movb $0x0, %al
callq 0x1bc80
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x1c854
movq -0x18(%rbp), %rdi
leaq 0x57f9(%rip), %rsi      # 0x22022
movb $0x0, %al
callq 0x1bc80
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x38(%rbp), %rax
movslq 0x34(%rax), %rax
addq %rax, %rdx
movq -0x38(%rbp), %rcx
callq 0x1c870
movq -0x18(%rbp), %rdi
leaq 0x521e(%rip), %rsi      # 0x21a7d
movb $0x0, %al
callq 0x1bc80
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop