// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/format.c
// Function: mm_write_paf4
void mm_write_paf4(kstring_t *s, const mm_idx_t *mi, const mm_bseq1_t *t, const mm_reg1_t *r, void *km, int64_t opt_flag, int rep_len, int n_seg, int seg_idx)
{
	s->l = 0;
	mm_sprintf_lite(s, "%s", t->name);
	if ((opt_flag & MM_F_FRAG_MODE) && n_seg >= 2 && seg_idx >= 0)
		mm_sprintf_lite(s, "/%d", seg_idx + 1);
	if (r == 0) {
		mm_sprintf_lite(s, "\t%d\t0\t0\t*\t*\t0\t0\t0\t0\t0\t0", t->l_seq);
		if (rep_len >= 0) mm_sprintf_lite(s, "\trl:i:%d", rep_len);
		return;
	}
	mm_sprintf_lite(s, "\t%d\t%d\t%d\t%c\t", t->l_seq, r->qs, r->qe, "+-"[r->rev]);
	if (mi->seq[r->rid].name) mm_sprintf_lite(s, "%s", mi->seq[r->rid].name);
	else mm_sprintf_lite(s, "%d", r->rid);
	mm_sprintf_lite(s, "\t%d", mi->seq[r->rid].len);
	if ((opt_flag & MM_F_QSTRAND) && r->rev)
		mm_sprintf_lite(s, "\t%d\t%d", mi->seq[r->rid].len - r->re, mi->seq[r->rid].len - r->rs);
	else
		mm_sprintf_lite(s, "\t%d\t%d", r->rs, r->re);
	mm_sprintf_lite(s, "\t%d\t%d", r->mlen, r->blen);
	mm_sprintf_lite(s, "\t%d", r->mapq);
	write_tags(s, r);
	if (rep_len >= 0) mm_sprintf_lite(s, "\trl:i:%d", rep_len);
	if (r->p && (opt_flag & MM_F_OUT_CG)) {
		uint32_t k;
		mm_sprintf_lite(s, "\tcg:Z:");
		for (k = 0; k < r->p->n_cigar; ++k)
			mm_sprintf_lite(s, "%d%c", r->p->cigar[k]>>4, MM_CIGAR_STR[r->p->cigar[k]&0xf]);
	}
	if (r->p && (opt_flag & (MM_F_OUT_CS|MM_F_OUT_DS|MM_F_OUT_MD)))
		write_cs_ds_or_MD(km, s, mi, t, r, !(opt_flag&MM_F_OUT_CS_LONG), !!(opt_flag&MM_F_OUT_MD), !!(opt_flag&MM_F_OUT_DS), 1, !!(opt_flag&MM_F_QSTRAND));
	if ((opt_flag & MM_F_COPY_COMMENT) && t->comment)
		mm_sprintf_lite(s, "\t%s", t->comment);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x421ea(%rip), %rsi     # 0x576e1
movb $0x0, %al
callq 0x144f0
movq -0x30(%rbp), %rax
andq $0x2000, %rax           # imm = 0x2000
cmpq $0x0, %rax
je 0x15532
cmpl $0x2, 0x18(%rbp)
jl 0x15532
cmpl $0x0, 0x20(%rbp)
jl 0x15532
movq -0x8(%rbp), %rdi
movl 0x20(%rbp), %edx
addl $0x1, %edx
leaq 0x42164(%rip), %rsi     # 0x5768f
movb $0x0, %al
callq 0x144f0
cmpq $0x0, -0x20(%rbp)
jne 0x15571
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %edx
leaq 0x42149(%rip), %rsi     # 0x57693
movb $0x0, %al
callq 0x144f0
cmpl $0x0, 0x10(%rbp)
jl 0x1556c
movq -0x8(%rbp), %rdi
movl 0x10(%rbp), %edx
leaq 0x42146(%rip), %rsi     # 0x576ab
movb $0x0, %al
callq 0x144f0
jmp 0x158db
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %edx
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x20(%rbp), %rax
movl 0x14(%rax), %r8d
movq -0x20(%rbp), %rax
movl 0x3c(%rax), %eax
shrl $0xa, %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x41def(%rip), %rax     # 0x57391
movsbl (%rax,%rsi), %r9d
leaq 0x42106(%rip), %rsi     # 0x576b4
movb $0x0, %al
callq 0x144f0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x15600
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x420ea(%rip), %rsi     # 0x576e1
movb $0x0, %al
callq 0x144f0
jmp 0x15619
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x420b4(%rip), %rsi     # 0x576c6
movb $0x0, %al
callq 0x144f0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %edx
leaq 0x42087(%rip), %rsi     # 0x576c5
movb $0x0, %al
callq 0x144f0
movabsq $0x100000000, %rax      # imm = 0x100000000
andq -0x30(%rbp), %rax
cmpq $0x0, %rax
je 0x156c1
movq -0x20(%rbp), %rax
movl 0x3c(%rax), %eax
shrl $0xa, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x156c1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %edx
movq -0x20(%rbp), %rax
subl 0x1c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x20(%rbp), %rax
subl 0x18(%rax), %ecx
leaq 0x4200a(%rip), %rsi     # 0x576c2
movb $0x0, %al
callq 0x144f0
jmp 0x156e1
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %ecx
leaq 0x41fe8(%rip), %rsi     # 0x576c2
movb $0x0, %al
callq 0x144f0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x30(%rax), %ecx
leaq 0x41fc8(%rip), %rsi     # 0x576c2
movb $0x0, %al
callq 0x144f0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x3c(%rax), %edx
andl $0xff, %edx
leaq 0x41fac(%rip), %rsi     # 0x576c5
movb $0x0, %al
callq 0x144f0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x158f0
cmpl $0x0, 0x10(%rbp)
jl 0x15748
movq -0x8(%rbp), %rdi
movl 0x10(%rbp), %edx
leaq 0x41f6a(%rip), %rsi     # 0x576ab
movb $0x0, %al
callq 0x144f0
movq -0x20(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x157e0
movq -0x30(%rbp), %rax
andq $0x20, %rax
cmpq $0x0, %rax
je 0x157e0
movq -0x8(%rbp), %rdi
leaq 0x41f59(%rip), %rsi     # 0x576c9
movb $0x0, %al
callq 0x144f0
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
movq 0x48(%rcx), %rcx
cmpl 0x18(%rcx), %eax
jae 0x157de
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x34(%rbp), %ecx
movl 0x1c(%rax,%rcx,4), %edx
shrl $0x4, %edx
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x34(%rbp), %ecx
movl 0x1c(%rax,%rcx,4), %eax
andl $0xf, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x41f14(%rip), %rax     # 0x576d5
movsbl (%rax,%rcx), %ecx
leaq 0x41f04(%rip), %rsi     # 0x576d0
movb $0x0, %al
callq 0x144f0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1577e
jmp 0x157e0
movq -0x20(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x158a6
movabsq $0x2001000040, %rax     # imm = 0x2001000040
andq -0x30(%rbp), %rax
cmpq $0x0, %rax
je 0x158a6
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x30(%rbp), %rax
andq $0x800, %rax            # imm = 0x800
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %r9d
movq -0x30(%rbp), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %r11d
movabsq $0x2000000000, %rax     # imm = 0x2000000000
andq -0x30(%rbp), %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %r10d
movabsq $0x100000000, %rax      # imm = 0x100000000
andq -0x30(%rbp), %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x150f0
movq -0x30(%rbp), %rax
andq $0x2000000, %rax        # imm = 0x2000000
cmpq $0x0, %rax
je 0x158db
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x158db
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x41e0c(%rip), %rsi     # 0x576e0
movb $0x0, %al
callq 0x144f0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)