// File: /workspace/github_c_makefile_star2_O1/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, %r13
movl 0x98(%rsp), %r14d
movq 0x90(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %rdi, (%rsp)
movq $0x0, (%rdi)
movl (%r9), %eax
testq %r8, %r8
je 0x10661
movq %r8, %r15
movq %rsi, %rbx
testb $0x20, %al
jne 0x1068c
testb $0x10, %al
movq %r14, 0x18(%rsp)
jne 0x105fc
movq (%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0xfc67
movq 0x18(%rsp), %r14
movzwl (%r12), %eax
testl $0x180, %eax            # imm = 0x180
je 0x10623
movq 0x10(%rbp), %rcx
movq (%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %r8
callq 0x10ddb
movq 0x18(%rsp), %r14
testb $0x8, (%r12)
je 0x10dcc
movq 0x60(%r15), %rax
testq %rax, %rax
je 0x10dcc
movl 0x98(%r12), %esi
movl 0x38(%r15), %ecx
cmpl (%rbp), %ecx
movq %rbp, 0x10(%rsp)
jne 0x10990
cmpl $0x0, 0x20(%rax)
sete %cl
jmp 0x10992
testb $0x4, %al
je 0x10dcc
movq (%rsp), %rdi
movq %r13, %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 0xfc67
testl $0x180, %eax            # imm = 0x180
je 0x106c0
movq (%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0xfc67
movq 0x10(%rbp), %rcx
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %r8
callq 0x10ddb
movq 0x60(%r15), %rax
testq %rax, %rax
je 0x10dcc
movq %rbp, %rdx
movq 0xa0(%r12), %rbp
movl 0x38(%r15), %ecx
cmpl (%rdx), %ecx
jne 0x106ea
cmpl $0x0, 0x20(%rax)
je 0x10a6e
movq 0x48(%r15), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%r15), %r12
movq %rbp, %rdi
callq 0x2100
leaq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x80a1
movq %rax, %r14
movq %rbp, %rdi
callq 0x2100
leaq 0x10(%rax), %rsi
movq %rbx, 0x38(%rsp)
movq %rbx, %rdi
callq 0x80a1
movq %rax, %rbx
leaq 0x3daa(%rip), %rsi      # 0x144db
movq %r14, 0x28(%rsp)
movq %r14, %rdi
movq %rbp, %rdx
movq 0x20(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x22d0
leaq 0x3d92(%rip), %rsi      # 0x144e4
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
movq %rbp, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22d0
movq 0x18(%r13), %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 0x10792
movq 0x8(%rbx), %r13
movq 0x8(%rsp), %rbp
subq %rbp, %r13
jmp 0x1079b
movq 0x40(%r15), %r13
movq 0x8(%rsp), %rbp
testl %eax, %eax
je 0x107a7
movq 0x8(%rbx), %rbp
subq 0x40(%r15), %rbp
movq 0x10(%rbx), %rdx
incq %r13
movq 0x60(%r15), %rcx
movl 0x4(%rcx), %r9d
leaq 0x2f57(%rip), %rcx      # 0x13714
movsbl (%rax,%rcx), %r10d
leaq 0x3d24(%rip), %rsi      # 0x144ed
movq (%rsp), %r14
movq %r14, %rdi
movq %r13, %rcx
movq %rbp, %r8
xorl %eax, %eax
pushq 0x28(%rsp)
pushq %r10
callq 0xf530
addq $0x10, %rsp
movq 0x10(%rbx), %rdx
movq 0x60(%r15), %rax
movl 0x4(%rax), %r9d
movl 0x30(%r15), %eax
andl $0x1, %eax
leaq 0x2f13(%rip), %rcx      # 0x13714
movsbl (%rax,%rcx), %r10d
subq $0x8, %rsp
leaq 0x3d0c(%rip), %rsi      # 0x1451d
movq %r14, %rdi
movq %r13, %rcx
movq %rbp, %r8
xorl %eax, %eax
pushq 0x30(%rsp)
pushq 0x20(%rsp)
pushq %r10
callq 0xf530
addq $0x20, %rsp
cmpl $0x0, 0x18(%r15)
jle 0x10963
xorl %r14d, %r14d
movq %r15, 0x20(%rsp)
movq %rbx, 0x18(%rsp)
movq 0x10(%rsp), %rbp
cmpw $0x0, 0x18(%r12)
jne 0x1094f
movl 0x30(%r15), %eax
andl $0x1, %eax
je 0x1086d
movq 0x8(%rbx), %r13
subq 0x8(%r12), %r13
jmp 0x10871
movq (%r12), %r13
movq 0x8(%rsp), %rdi
testl %eax, %eax
je 0x10884
movq 0x8(%rbx), %r9
subq (%r12), %r9
jmp 0x10889
movq 0x8(%r12), %r9
movq 0x8(%r12), %rdx
movq 0x48(%r15), %rsi
cmpq %rsi, %rdx
movq %rdi, %r8
cmovneq %r9, %r8
movq %r13, %rcx
testl %eax, %eax
je 0x108b2
cmpq %rsi, %rdx
jne 0x108b2
movq 0x8(%rbx), %rcx
subq %rdi, %rcx
movq %r9, %r8
movq 0x10(%rbx), %rdx
incq %rcx
movq %r9, 0x30(%rsp)
movl 0x24(%r12), %r9d
leaq 0x2e4a(%rip), %rsi      # 0x13714
movsbl (%rax,%rsi), %r10d
subq $0x8, %rsp
movq 0x8(%rsp), %r15
movq %r15, %rdi
leaq 0x3c85(%rip), %rsi      # 0x14567
xorl %eax, %eax
movq 0x30(%rsp), %rbx
pushq %rbx
pushq %rbp
pushq %r10
callq 0xf530
addq $0x20, %rsp
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdx
incq %r13
movl 0x24(%r12), %r9d
movq 0x20(%rsp), %rcx
movl 0x30(%rcx), %eax
andl $0x1, %eax
leaq 0x2dfb(%rip), %rsi      # 0x13714
movsbl (%rax,%rsi), %r10d
movswl 0x1a(%r12), %r11d
movq %r15, %rdi
movq %rcx, %r15
leaq 0x3c7a(%rip), %rsi      # 0x145ab
movq %r13, %rcx
movq 0x30(%rsp), %r8
xorl %eax, %eax
pushq %rbx
movq 0x20(%rsp), %rbx
pushq %rbp
pushq %r11
pushq %r10
callq 0xf530
addq $0x20, %rsp
incq %r14
movslq 0x18(%r15), %rax
addq $0x38, %r12
cmpq %rax, %r14
jl 0x1084c
movq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
callq 0x7fd6
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7fd6
xorl %ecx, %ecx
movq 0x58(%r15), %rbp
movq 0x48(%r15), %rax
leaq 0x3(%rax), %rdx
movl %ecx, 0x28(%rsp)
testb %cl, %cl
cmoveq %rax, %rdx
movq %rdx, 0x8(%rsp)
leal -0x21(%rsi), %eax
cmpl $0x5e, %eax
setae %al
testl %r14d, %r14d
sets %cl
orb %al, %cl
jne 0x10a05
movq 0x10(%rsp), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
movq %rsi, 0x20(%rsp)
callq 0x2100
leaq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x80a1
leaq 0x3c06(%rip), %rsi      # 0x145ef
movq %rax, 0x30(%rsp)
movq %rax, %rdi
movq %r12, %rdx
movq 0x20(%rsp), %rcx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x22d0
jmp 0x10a3f
movq 0xa0(%r12), %r12
movq %r12, %rdi
callq 0x2100
leaq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x80a1
leaq 0x3bce(%rip), %rsi      # 0x145f6
movq %rax, 0x30(%rsp)
movq %rax, %rdi
movq %r12, %rdx
movq 0x20(%rsp), %rcx
xorl %eax, %eax
callq 0x22d0
movq 0x18(%r13), %rcx
movl 0x30(%r15), %eax
movl %eax, %edx
shrl %edx
leaq (%rdx,%rdx,2), %r13
shlq $0x3, %r13
addq 0x28(%rcx), %r13
andl $0x1, %eax
movq (%rsp), %rdi
movq 0x8(%rsp), %r8
je 0x10a7b
movq 0x8(%r13), %rcx
subq %r8, %rcx
jmp 0x10a7f
movq 0x48(%r15), %rax
addq $0x3, %rax
jmp 0x106ee
movq 0x40(%r15), %rcx
testl %eax, %eax
je 0x10a8b
movq 0x8(%r13), %r8
subq 0x40(%r15), %r8
movq %rbx, 0x38(%rsp)
movq 0x10(%r13), %rdx
incq %rcx
movq 0x60(%r15), %rsi
movl 0x4(%rsi), %r9d
leaq 0x2c6e(%rip), %rsi      # 0x13714
movsbl (%rax,%rsi), %r10d
subq $0x8, %rsp
leaq 0x3b48(%rip), %rsi      # 0x145fe
xorl %eax, %eax
pushq 0x20(%rsp)
pushq 0x40(%rsp)
pushq %r10
callq 0xf530
addq $0x20, %rsp
movq 0x60(%r15), %rax
cvtsi2sdl 0x28(%rax), %xmm0
mulsd 0x37b4(%rip), %xmm0     # 0x14290
cvtsi2sdl 0x14(%rax), %xmm1
divsd %xmm1, %xmm0
leaq 0x3b41(%rip), %rbx      # 0x1462d
leaq 0x40(%rsp), %r12
movl $0x10, %esi
movq %r12, %rdi
movq %rbx, %rdx
movb $0x1, %al
callq 0x2120
leaq 0x3b28(%rip), %rsi      # 0x14632
movq (%rsp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xf530
movq 0x60(%r15), %rax
xorps %xmm0, %xmm0
cvtsi2sdl 0x2c(%rax), %xmm0
mulsd 0x3764(%rip), %xmm0     # 0x14290
xorps %xmm1, %xmm1
cvtsi2sdl 0x14(%rax), %xmm1
divsd %xmm1, %xmm0
movl $0x10, %esi
movq %r12, %rdi
movq %rbx, %rdx
movb $0x1, %al
callq 0x2120
leaq 0x3aee(%rip), %rsi      # 0x1463f
movq (%rsp), %rdi
movq %r12, %rdx
movq (%rsp), %r12
xorl %eax, %eax
callq 0xf530
movq 0x60(%r15), %rax
movl 0x18(%rax), %edx
testl %edx, %edx
jle 0x10b7f
leaq 0x3ad7(%rip), %rsi      # 0x1464c
movq %r12, %rdi
xorl %eax, %eax
callq 0xf530
movq 0x60(%r15), %rax
movl 0x1c(%rax), %edx
testl %edx, %edx
jle 0x10b9b
leaq 0x3aca(%rip), %rsi      # 0x1465b
movq %r12, %rdi
xorl %eax, %eax
callq 0xf530
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdx
movl 0x34(%r15), %ecx
movl 0x38(%r15), %r8d
incl %ecx
leaq 0x3ab4(%rip), %rsi      # 0x14669
movq %r12, %rdi
xorl %eax, %eax
callq 0xf530
movl 0x18(%r15), %eax
testl %eax, %eax
jle 0x10dbd
addq $0x30, %rbp
movl $0x1, %ebx
movq -0x28(%rbp), %r9
cmpb $0x0, 0x28(%rsp)
je 0x10bfa
cmpw $0x0, -0x18(%rbp)
jne 0x10bfa
cltq
cmpq %rax, %rbx
jge 0x10bfa
leaq 0x3(%r9), %rax
cmpw $0x1, 0x20(%rbp)
cmoveq %rax, %r9
movl 0x30(%r15), %eax
andl $0x1, %eax
je 0x10c0c
movq 0x8(%r13), %r8
subq %r9, %r8
jmp 0x10c10
movq -0x30(%rbp), %r8
testl %eax, %eax
je 0x10c1c
movq 0x8(%r13), %r9
subq -0x30(%rbp), %r9
cmpw $0x1, -0x18(%rbp)
movq 0x10(%r13), %rdx
leaq 0x3a8c(%rip), %rcx      # 0x146b8
leaq 0x3a7a(%rip), %rsi      # 0x146ad
cmoveq %rsi, %rcx
incq %r8
movl -0xc(%rbp), %r10d
leaq 0x2acf(%rip), %rsi      # 0x13714
movsbl (%rax,%rsi), %r11d
movswl -0x16(%rbp), %r14d
subq $0x8, %rsp
movq %r12, %rdi
leaq 0x3a1e(%rip), %rsi      # 0x1467b
xorl %eax, %eax
pushq 0x20(%rsp)
pushq 0x40(%rsp)
pushq %r14
pushq %r11
pushq %r10
callq 0xf530
addq $0x30, %rsp
cmpw $0x0, -0x18(%rbp)
jne 0x10d94
cvtsi2sdl -0x8(%rbp), %xmm0
mulsd 0x3602(%rip), %xmm0     # 0x14290
cvtsi2sdl -0x4(%rbp), %xmm1
divsd %xmm1, %xmm0
movl $0x10, %esi
leaq 0x40(%rsp), %r14
movq %r14, %rdi
leaq 0x3982(%rip), %rdx      # 0x1462d
movb $0x1, %al
callq 0x2120
movq %r12, %rdi
leaq 0x3976(%rip), %rsi      # 0x14632
movq %r14, %rdx
xorl %eax, %eax
callq 0xf530
movsbl 0x2(%rbp), %r12d
testl %r12d, %r12d
je 0x10d02
leaq 0x2(%rbp), %rdi
movl $0x2, %edx
leaq 0x39dc(%rip), %rsi      # 0x146bc
callq 0x2070
testl %eax, %eax
je 0x10d02
movsbl 0x3(%rbp), %ecx
movq (%rsp), %rdi
leaq 0x39c7(%rip), %rsi      # 0x146bf
movl %r12d, %edx
xorl %eax, %eax
callq 0xf530
movsbl (%rbp), %r12d
testl %r12d, %r12d
je 0x10d3d
movl $0x2, %edx
movq %rbp, %rdi
leaq 0x39b3(%rip), %rsi      # 0x146ce
callq 0x2070
testl %eax, %eax
je 0x10d3d
movsbl 0x1(%rbp), %ecx
movq (%rsp), %rdi
leaq 0x399e(%rip), %rsi      # 0x146d1
movl %r12d, %edx
xorl %eax, %eax
callq 0xf530
movl -0x14(%rbp), %edx
testl %edx, %edx
movq (%rsp), %r12
jle 0x10d59
movq %r12, %rdi
leaq 0x38fa(%rip), %rsi      # 0x1464c
xorl %eax, %eax
callq 0xf530
movl -0x10(%rbp), %edx
testl %edx, %edx
jle 0x10d71
movq %r12, %rdi
leaq 0x38f1(%rip), %rsi      # 0x1465b
xorl %eax, %eax
callq 0xf530
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdx
movl -0x20(%rbp), %ecx
movl -0x1c(%rbp), %r8d
incl %ecx
movq %r12, %rdi
leaq 0x3950(%rip), %rsi      # 0x146dd
xorl %eax, %eax
callq 0xf530
movq %r12, %rdi
leaq 0x3093(%rip), %rsi      # 0x13e31
xorl %eax, %eax
callq 0xf530
movslq 0x18(%r15), %rax
addq $0x38, %rbp
leaq 0x1(%rbx), %rcx
cmpq %rax, %rbx
movq %rcx, %rbx
jl 0x10bd4
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x7fd6
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq