// File: /workspace/github_c_makefile_star2_O3/lh3[P]miniprot/format.c
// Function: mp_write_output
void mp_write_output(kstring_t *s, void *km, const mp_idx_t *mi, const mp_bseq1_t *seq, const mp_reg1_t *r, const mp_mapopt_t *opt, int64_t id, int32_t hit_idx)
{
	s->l = 0;
	if (r == 0) {
		if (opt->flag&MP_F_SHOW_UNMAP)
			mp_write_paf(s, mi, opt, seq, 0);
	} else if (opt->flag&MP_F_GTF) {
		if (opt->flag & (MP_F_SHOW_RESIDUE|MP_F_SHOW_TRANS)) {
			mp_write_paf(s, mi, opt, seq, r);
			mp_write_residue(s, mi, opt, seq->seq, r);
		}
		mp_write_gtf(s, km, mi, seq, r, opt->gff_prefix, id, seq->name);
	} else {
		if (!(opt->flag&MP_F_NO_PAF))
			mp_write_paf(s, mi, opt, seq, r);
		if (opt->flag & (MP_F_SHOW_RESIDUE|MP_F_SHOW_TRANS))
			mp_write_residue(s, mi, opt, seq->seq, r);
		if (opt->flag&MP_F_GFF)
			mp_write_gff(s, km, mi, seq, r, opt->gff_prefix, id, seq->name, opt->gff_delim, hit_idx);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r12
movq %rcx, %rbp
movq %rdx, %rbx
movq %rsi, 0x28(%rsp)
movq %rdi, %r14
movl 0x98(%rsp), %r13d
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movq $0x0, (%rdi)
movl (%r9), %eax
testq %r8, %r8
je 0x10a23
movq %r8, %r15
testb $0x20, %al
movq %r14, 0x38(%rsp)
jne 0x10a4d
testb $0x10, %al
jne 0x10959
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x10012
movl (%r12), %eax
testl $0x180, %eax            # imm = 0x180
je 0x10979
movq 0x10(%rbp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %r8
callq 0x11112
movl (%r12), %eax
testb $0x8, %al
je 0x110ec
movq 0x60(%r15), %rax
testq %rax, %rax
je 0x110ec
movl 0x98(%r12), %edx
movl 0x38(%r15), %ecx
cmpl (%rbp), %ecx
movq %rbp, 0x8(%rsp)
jne 0x109ae
cmpl $0x0, 0x20(%rax)
je 0x110fb
movq 0x48(%r15), %rax
movq %rax, (%rsp)
movl $0x0, 0x30(%rsp)
movq 0x58(%r15), %rbp
leal -0x21(%rdx), %eax
cmpl $0x5e, %eax
setae %al
testl %r13d, %r13d
sets %cl
orb %al, %cl
jne 0x10d3f
movq 0x8(%rsp), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
movq %rdx, 0x18(%rsp)
callq 0x2100
leaq 0x10(%rax), %rsi
movq 0x28(%rsp), %rdi
callq 0x84a5
leaq 0x4c73(%rip), %rsi      # 0x15677
movq %rax, 0x10(%rsp)
movq %rax, %rdi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
movl %r13d, %r8d
xorl %eax, %eax
callq 0x22d0
jmp 0x10d7b
testb $0x4, %al
je 0x110ec
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10012
testl $0x180, %eax            # imm = 0x180
je 0x10a7d
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x10012
movq 0x10(%rbp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %r8
callq 0x11112
movq 0x60(%r15), %rax
testq %rax, %rax
je 0x110ec
movq %rbp, %rdx
movq 0xa0(%r12), %rbp
movl 0x38(%r15), %ecx
cmpl (%rdx), %ecx
jne 0x10aa7
cmpl $0x0, 0x20(%rax)
je 0x10daf
movq 0x48(%r15), %rax
movq %rax, 0x20(%rsp)
movq 0x58(%r15), %r13
movq %rbp, %rdi
callq 0x2100
leaq 0x10(%rax), %rsi
movq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x84a5
movq %rax, %r12
movq %rbp, %rdi
callq 0x2100
leaq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0x84a5
movq %rax, %r14
leaq 0x4a75(%rip), %rsi      # 0x15563
movq %r12, 0x8(%rsp)
movq %r12, %rdi
movq %rbp, %rdx
movq 0x18(%rsp), %r12
movq %r12, %rcx
xorl %eax, %eax
callq 0x22d0
leaq 0x4a5d(%rip), %rsi      # 0x1556c
movq %r14, (%rsp)
movq %r14, %rdi
movq %rbp, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x22d0
movq 0x18(%rbx), %rcx
movl 0x30(%r15), %eax
movl %eax, %edx
shrl %edx
leaq (%rdx,%rdx,2), %r12
shlq $0x3, %r12
addq 0x28(%rcx), %r12
andl $0x1, %eax
je 0x10b53
movq 0x8(%r12), %rbp
movq %rbp, %rbx
subq 0x20(%rsp), %rbx
subq 0x40(%r15), %rbp
jmp 0x10b5c
movq 0x40(%r15), %rbx
movq 0x20(%rsp), %rbp
movq 0x38(%rsp), %rdi
movq 0x10(%r12), %rdx
incq %rbx
movq 0x60(%r15), %rcx
movl 0x4(%rcx), %r9d
leaq 0x3bec(%rip), %rcx      # 0x14764
movsbl (%rax,%rcx), %r10d
leaq 0x49f1(%rip), %rsi      # 0x15575
movq %rbx, %rcx
movq %rbp, %r8
xorl %eax, %eax
movq 0x8(%rsp), %r14
pushq %r14
pushq %r10
callq 0xf8b8
addq $0x10, %rsp
movq 0x10(%r12), %rdx
movq 0x60(%r15), %rax
movl 0x4(%rax), %r9d
movl 0x30(%r15), %eax
andl $0x1, %eax
leaq 0x3bab(%rip), %rcx      # 0x14764
movsbl (%rax,%rcx), %r10d
subq $0x8, %rsp
leaq 0x49dc(%rip), %rsi      # 0x155a5
movq 0x40(%rsp), %rdi
movq %rbx, %rcx
movq %rbp, %r8
xorl %eax, %eax
pushq %r14
pushq 0x10(%rsp)
pushq %r10
callq 0xf8b8
addq $0x20, %rsp
movl 0x18(%r15), %eax
testl %eax, %eax
jle 0x10d13
addq $0x24, %r13
xorl %r14d, %r14d
movq %r15, 0x18(%rsp)
movq %r12, 0x10(%rsp)
movq (%rsp), %rbx
cmpw $0x0, -0xc(%r13)
jne 0x10d00
movl 0x30(%r15), %eax
movq -0x1c(%r13), %rcx
andl $0x1, %eax
je 0x10c37
movq 0x8(%r12), %r8
movq %r8, %rbp
subq %rcx, %rbp
cmpq 0x48(%r15), %rcx
je 0x10c53
movq %rbp, %rcx
jmp 0x10c5b
movq 0x20(%rsp), %r8
cmpq 0x48(%r15), %rcx
je 0x10c45
movq %rcx, %r8
movq -0x24(%r13), %rbp
movq %rcx, 0x30(%rsp)
movq %rbp, %rcx
jmp 0x10c64
movq %r8, %rcx
subq 0x20(%rsp), %rcx
subq -0x24(%r13), %r8
movq %r8, 0x30(%rsp)
movq 0x10(%r12), %rdx
incq %rcx
movl (%r13), %r9d
leaq 0x3aed(%rip), %rsi      # 0x14764
movsbl (%rax,%rsi), %r10d
subq $0x8, %rsp
movq 0x40(%rsp), %r15
movq %r15, %rdi
leaq 0x4960(%rip), %rsi      # 0x155ef
xorl %eax, %eax
movq 0x10(%rsp), %r12
pushq %r12
pushq %rbx
pushq %r10
callq 0xf8b8
addq $0x20, %rsp
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdx
incq %rbp
movl (%r13), %r9d
movq 0x18(%rsp), %rcx
movl 0x30(%rcx), %eax
andl $0x1, %eax
leaq 0x3a9e(%rip), %rsi      # 0x14764
movsbl (%rax,%rsi), %r10d
movswl -0xa(%r13), %r11d
movq %r15, %rdi
movq %rcx, %r15
leaq 0x4956(%rip), %rsi      # 0x15633
movq %rbp, %rcx
movq 0x30(%rsp), %r8
xorl %eax, %eax
pushq %r12
movq 0x18(%rsp), %r12
pushq %rbx
pushq %r11
pushq %r10
callq 0xf8b8
addq $0x20, %rsp
movl 0x18(%r15), %eax
incq %r14
movslq %eax, %rcx
addq $0x38, %r13
cmpq %rcx, %r14
jl 0x10c08
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0x83df
movq %rbx, %rdi
movq (%rsp), %rsi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x83df
movq 0xa0(%r12), %r12
movq %r12, %rdi
callq 0x2100
leaq 0x10(%rax), %rsi
movq 0x28(%rsp), %rdi
callq 0x84a5
leaq 0x491a(%rip), %rsi      # 0x1567e
movq %rax, 0x10(%rsp)
movq %rax, %rdi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
xorl %eax, %eax
callq 0x22d0
movq (%rsp), %r8
movq 0x18(%rbx), %rcx
movl 0x30(%r15), %eax
movl %eax, %edx
shrl %edx
leaq (%rdx,%rdx,2), %rbx
shlq $0x3, %rbx
addq 0x28(%rcx), %rbx
andl $0x1, %eax
je 0x10dbc
movq 0x8(%rbx), %rdx
movq %rdx, %rcx
subq %r8, %rcx
subq 0x40(%r15), %rdx
movq %rdx, %r8
jmp 0x10dc0
movq 0x48(%r15), %rax
addq $0x3, %rax
jmp 0x10aab
movq 0x40(%r15), %rcx
movq 0x10(%rbx), %rdx
incq %rcx
movq 0x60(%r15), %rsi
movl 0x4(%rsi), %r9d
leaq 0x398e(%rip), %rsi      # 0x14764
movsbl (%rax,%rsi), %r10d
subq $0x8, %rsp
leaq 0x48a0(%rip), %rsi      # 0x15686
movq %r14, %rdi
xorl %eax, %eax
pushq %r13
pushq 0x20(%rsp)
pushq %r10
callq 0xf8b8
addq $0x20, %rsp
movq 0x60(%r15), %rax
cvtsi2sdl 0x28(%rax), %xmm0
mulsd 0x450b(%rip), %xmm0     # 0x15318
cvtsi2sdl 0x14(%rax), %xmm1
divsd %xmm1, %xmm0
leaq 0x4898(%rip), %rdx      # 0x156b5
leaq 0x40(%rsp), %r12
movl $0x10, %esi
movq %r12, %rdi
movb $0x1, %al
callq 0x2120
leaq 0x4882(%rip), %rsi      # 0x156ba
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xf8b8
movq 0x60(%r15), %rax
xorps %xmm0, %xmm0
cvtsi2sdl 0x2c(%rax), %xmm0
mulsd 0x44bf(%rip), %xmm0     # 0x15318
xorps %xmm1, %xmm1
cvtsi2sdl 0x14(%rax), %xmm1
divsd %xmm1, %xmm0
movl $0x10, %esi
movq %r12, %rdi
leaq 0x4841(%rip), %rdx      # 0x156b5
movb $0x1, %al
callq 0x2120
leaq 0x4845(%rip), %rsi      # 0x156c7
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xf8b8
movq 0x60(%r15), %rax
movl 0x18(%rax), %edx
testl %edx, %edx
jle 0x10eaf
leaq 0x4833(%rip), %rsi      # 0x156d4
movq %r14, %rdi
xorl %eax, %eax
callq 0xf8b8
movq 0x60(%r15), %rax
movl 0x1c(%rax), %edx
testl %edx, %edx
jle 0x10ec7
leaq 0x4826(%rip), %rsi      # 0x156e3
movq %r14, %rdi
xorl %eax, %eax
callq 0xf8b8
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdx
movl 0x34(%r15), %ecx
movl 0x38(%r15), %r8d
incl %ecx
leaq 0x4810(%rip), %rsi      # 0x156f1
movq %r14, %rdi
xorl %eax, %eax
callq 0xf8b8
movl 0x18(%r15), %eax
testl %eax, %eax
jle 0x110dd
movl $0x1, %r12d
movq %rbx, (%rsp)
movq 0x8(%rbp), %r9
cmpb $0x0, 0x30(%rsp)
je 0x10f27
cmpw $0x0, 0x18(%rbp)
jne 0x10f27
cltq
cmpq %rax, %r12
jge 0x10f27
leaq 0x3(%r9), %rax
cmpw $0x1, 0x50(%rbp)
cmoveq %rax, %r9
movl 0x30(%r15), %eax
andl $0x1, %eax
je 0x10f43
movq 0x8(%rbx), %rcx
movq %rcx, %r8
subq %r9, %r8
subq (%rbp), %rcx
movq %rcx, %r9
jmp 0x10f47
movq (%rbp), %r8
cmpw $0x1, 0x18(%rbp)
movq 0x10(%rbx), %rdx
leaq 0x47e9(%rip), %rcx      # 0x15740
leaq 0x47d7(%rip), %rsi      # 0x15735
cmoveq %rsi, %rcx
incq %r8
movl 0x24(%rbp), %r10d
leaq 0x37f4(%rip), %rsi      # 0x14764
movsbl (%rax,%rsi), %r11d
movswl 0x1a(%rbp), %r14d
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x4779(%rip), %rsi      # 0x15703
xorl %eax, %eax
pushq %r13
pushq 0x20(%rsp)
pushq %r14
movq %rdi, %r14
pushq %r11
pushq %r10
callq 0xf8b8
addq $0x30, %rsp
cmpw $0x0, 0x18(%rbp)
jne 0x110b3
movq %r13, %rbx
cvtsi2sdl 0x28(%rbp), %xmm0
mulsd 0x4359(%rip), %xmm0     # 0x15318
cvtsi2sdl 0x2c(%rbp), %xmm1
divsd %xmm1, %xmm0
movl $0x10, %esi
leaq 0x40(%rsp), %r13
movq %r13, %rdi
leaq 0x46d9(%rip), %rdx      # 0x156b5
movb $0x1, %al
callq 0x2120
movq %r14, %rdi
leaq 0x46cd(%rip), %rsi      # 0x156ba
movq %r13, %rdx
xorl %eax, %eax
callq 0xf8b8
movzbl 0x32(%rbp), %eax
testl %eax, %eax
je 0x11028
cmpl $0x41, %eax
jne 0x1100e
movb 0x33(%rbp), %cl
cmpb $0x47, %cl
jne 0x11011
jmp 0x11028
movb 0x33(%rbp), %cl
movsbl %al, %edx
movsbl %cl, %ecx
movq %r14, %rdi
leaq 0x4723(%rip), %rsi      # 0x15744
xorl %eax, %eax
callq 0xf8b8
movzbl 0x30(%rbp), %eax
testl %eax, %eax
movq %rbx, %r13
movq (%rsp), %rbx
je 0x11060
cmpl $0x47, %eax
jne 0x11046
movb 0x31(%rbp), %cl
cmpb $0x54, %cl
jne 0x11049
jmp 0x11060
movb 0x31(%rbp), %cl
movsbl %al, %edx
movsbl %cl, %ecx
movq %r14, %rdi
leaq 0x46fa(%rip), %rsi      # 0x15753
xorl %eax, %eax
callq 0xf8b8
movl 0x1c(%rbp), %edx
testl %edx, %edx
jle 0x11078
movq %r14, %rdi
leaq 0x4663(%rip), %rsi      # 0x156d4
xorl %eax, %eax
callq 0xf8b8
movl 0x20(%rbp), %edx
testl %edx, %edx
jle 0x11090
movq %r14, %rdi
leaq 0x465a(%rip), %rsi      # 0x156e3
xorl %eax, %eax
callq 0xf8b8
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdx
movl 0x10(%rbp), %ecx
movl 0x14(%rbp), %r8d
incl %ecx
movq %r14, %rdi
leaq 0x46b3(%rip), %rsi      # 0x1575f
xorl %eax, %eax
callq 0xf8b8
movq %r14, %rdi
leaq 0x3dc4(%rip), %rsi      # 0x14e81
xorl %eax, %eax
callq 0xf8b8
movslq 0x18(%r15), %rax
addq $0x38, %rbp
leaq 0x1(%r12), %rcx
cmpq %rax, %r12
movq %rcx, %r12
jl 0x10f01
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x83df
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%r15), %rax
addq $0x3, %rax
movq %rax, (%rsp)
movb $0x1, %al
movl %eax, 0x30(%rsp)
jmp 0x109be