// File: /workspace/github_c_makefile_star2_O2/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 $0x68, %rsp
movq %r9, %r12
movq %rcx, %rbp
movq %rdi, %rbx
movl 0xa8(%rsp), %edi
movq 0xa0(%rsp), %rax
movq %rax, 0x38(%rsp)
andq $0x0, (%rbx)
movq %rdx, %r15
movl (%r9), %eax
testq %r8, %r8
je 0xeb88
movq %r8, %r14
movq %rsi, %r13
testb $0x20, %al
movq %rbx, 0x48(%rsp)
jne 0xebb2
testb $0x10, %al
movq %rdi, 0x18(%rsp)
jne 0xeaba
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r14, %r8
callq 0xe1ba
movq 0x18(%rsp), %rdi
movl (%r12), %eax
testw $0x180, %ax             # imm = 0x180
je 0xeade
movq 0x10(%rbp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %r8
callq 0xf263
movq 0x18(%rsp), %rdi
movl (%r12), %eax
testb $0x8, %al
je 0xf241
movq 0x60(%r14), %rax
testq %rax, %rax
je 0xf241
movl 0x98(%r12), %edx
movl 0x38(%r14), %ecx
cmpl (%rbp), %ecx
movq %r13, 0x28(%rsp)
jne 0xeb13
cmpl $0x0, 0x20(%rax)
je 0xf250
movq 0x48(%r14), %rcx
movl $0x0, 0x30(%rsp)
movq %rcx, 0x8(%rsp)
movq 0x58(%r14), %r13
leal -0x21(%rdx), %eax
cmpl $0x5e, %eax
setae %al
testl %edi, %edi
sets %cl
orb %al, %cl
movq %rbp, 0x20(%rsp)
jne 0xeea3
movq 0x8(%rbp), %r12
movq %r12, %rdi
movq %rdx, 0x10(%rsp)
callq 0x2100
leaq 0x10(%rax), %rsi
movq 0x28(%rsp), %rdi
callq 0x7460
movq %rax, %rbp
leaq 0x4ad3(%rip), %rsi      # 0x1363f
movq %rax, %rdi
movq %r12, %rdx
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
xorl %eax, %eax
callq 0x22f0
jmp 0xeedd
testb $0x4, %al
je 0xf241
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe1ba
testw $0x180, %ax             # imm = 0x180
je 0xebe1
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r14, %r8
callq 0xe1ba
movq 0x10(%rbp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %r8
callq 0xf263
movq 0x60(%r14), %rax
testq %rax, %rax
je 0xf241
movq %rbp, %rdx
movq 0xa0(%r12), %rbp
movl 0x38(%r14), %ecx
cmpl (%rdx), %ecx
movq %r15, 0x40(%rsp)
jne 0xec10
cmpl $0x0, 0x20(%rax)
je 0xef0e
movq %r13, %r12
movq 0x48(%r14), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%r14), %r13
movq %rbp, %rdi
callq 0x2100
leaq 0x10(%rax), %rsi
movq %r12, %rdi
callq 0x7460
movq %rax, %r15
movq %rbp, %rdi
callq 0x2100
leaq 0x10(%rax), %rsi
movq %r12, 0x28(%rsp)
movq %r12, %rdi
callq 0x7460
movq %rax, %r12
leaq 0x48d1(%rip), %rsi      # 0x1352b
movq %r15, 0x20(%rsp)
movq %r15, %rdi
movq %rbp, %rdx
movq 0x38(%rsp), %r15
movq %r15, %rcx
xorl %eax, %eax
callq 0x22f0
leaq 0x48b9(%rip), %rsi      # 0x13534
movq %r12, 0x10(%rsp)
movq %r12, %rdi
movq %rbp, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x22f0
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rcx
movl 0x30(%r14), %eax
movl %eax, %edx
shrl %edx
imulq $0x18, %rdx, %r12
addq 0x28(%rcx), %r12
andl $0x1, %eax
je 0xecc1
movq 0x8(%r12), %rbp
movq %rbp, %r15
subq 0x8(%rsp), %r15
subq 0x40(%r14), %rbp
jmp 0xecca
movq 0x40(%r14), %r15
movq 0x8(%rsp), %rbp
movq 0x10(%r12), %rdx
incq %r15
movq 0x60(%r14), %rcx
movl 0x4(%rcx), %r9d
leaq 0x3a83(%rip), %rcx      # 0x12764
movsbl (%rax,%rcx), %r10d
leaq 0x4850(%rip), %rsi      # 0x1353d
movq %rbx, %rdi
movq %r15, %rcx
movq %rbp, %r8
xorl %eax, %eax
movq 0x20(%rsp), %rbx
pushq %rbx
pushq %r10
callq 0xdd2c
popq %rcx
popq %rdx
movq %r12, 0x40(%rsp)
movq 0x10(%r12), %rdx
movq 0x60(%r14), %rax
movl 0x4(%rax), %r9d
movl 0x30(%r14), %eax
andl $0x1, %eax
leaq 0x3a3d(%rip), %rcx      # 0x12764
movsbl (%rax,%rcx), %r10d
subq $0x8, %rsp
leaq 0x4836(%rip), %rsi      # 0x1356d
movq 0x50(%rsp), %rdi
movq %r15, %rcx
movq %rbp, %r8
xorl %eax, %eax
pushq %rbx
pushq 0x20(%rsp)
pushq %r10
callq 0xdd2c
addq $0x20, %rsp
addq $0x24, %r13
xorl %ecx, %ecx
movq %r14, 0x38(%rsp)
movq 0x40(%rsp), %rbx
movq 0x20(%rsp), %r12
movq 0x10(%rsp), %r15
movslq 0x18(%r14), %rax
cmpq %rax, %rcx
jge 0xee76
cmpw $0x0, -0xc(%r13)
jne 0xee6a
movl 0x30(%r14), %eax
movq -0x1c(%r13), %rsi
andl $0x1, %eax
movq %rcx, 0x18(%rsp)
je 0xedae
movq 0x8(%rbx), %r8
movq %r8, %rbp
subq %rsi, %rbp
cmpq 0x48(%r14), %rsi
je 0xedca
movq %rbp, %rcx
jmp 0xedd2
movq 0x8(%rsp), %r8
cmpq 0x48(%r14), %rsi
je 0xedbc
movq %rsi, %r8
movq -0x24(%r13), %rbp
movq %rbp, %rcx
movq %rsi, 0x30(%rsp)
jmp 0xeddb
movq %r8, %rcx
subq 0x8(%rsp), %rcx
subq -0x24(%r13), %r8
movq %r8, 0x30(%rsp)
movq 0x10(%rbx), %rdx
incq %rcx
movl (%r13), %r9d
leaq 0x3977(%rip), %rsi      # 0x12764
movsbl (%rax,%rsi), %r10d
subq $0x8, %rsp
movq 0x50(%rsp), %r14
movq %r14, %rdi
leaq 0x47b2(%rip), %rsi      # 0x135b7
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r10
callq 0xdd2c
addq $0x20, %rsp
movq 0x10(%rbx), %rdx
incq %rbp
movl (%r13), %r9d
movq 0x38(%rsp), %rcx
movl 0x30(%rcx), %eax
andl $0x1, %eax
leaq 0x3931(%rip), %rsi      # 0x12764
movsbl (%rax,%rsi), %r10d
movswl -0xa(%r13), %r11d
movq %r14, %rdi
movq %rcx, %r14
leaq 0x47b1(%rip), %rsi      # 0x135fb
movq %rbp, %rcx
movq 0x30(%rsp), %r8
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r11
pushq %r10
callq 0xdd2c
addq $0x20, %rsp
movq 0x18(%rsp), %rcx
incq %rcx
addq $0x38, %r13
jmp 0xed6e
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x736b
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x736b
movq 0xa0(%r12), %r12
movq %r12, %rdi
callq 0x2100
leaq 0x10(%rax), %rsi
movq 0x28(%rsp), %rdi
callq 0x7460
movq %rax, %rbp
leaq 0x477b(%rip), %rsi      # 0x13646
movq %rax, %rdi
movq %r12, %rdx
movq 0x38(%rsp), %rcx
xorl %eax, %eax
callq 0x22f0
movq 0x18(%r15), %rcx
movl 0x30(%r14), %eax
movl %eax, %edx
shrl %edx
imulq $0x18, %rdx, %r15
addq 0x28(%rcx), %r15
andl $0x1, %eax
movq 0x8(%rsp), %r8
je 0xef1e
movq 0x8(%r15), %rdx
movq %rdx, %rcx
subq %r8, %rcx
subq 0x40(%r14), %rdx
movq %rdx, %r8
jmp 0xef22
movq %r13, %r12
movq 0x48(%r14), %rax
addq $0x3, %rax
jmp 0xec17
movq 0x40(%r14), %rcx
movq 0x10(%r15), %rdx
incq %rcx
movq 0x60(%r14), %rsi
movl 0x4(%rsi), %r9d
leaq 0x382c(%rip), %rsi      # 0x12764
movsbl (%rax,%rsi), %r10d
subq $0x8, %rsp
leaq 0x4706(%rip), %rsi      # 0x1364e
movq %rbx, %rdi
xorl %eax, %eax
pushq 0x20(%rsp)
pushq %rbp
pushq %r10
callq 0xdd2c
addq $0x20, %rsp
movq 0x60(%r14), %rax
cvtsi2sdl 0x28(%rax), %xmm0
mulsd 0x4372(%rip), %xmm0     # 0x132e0
cvtsi2sdl 0x14(%rax), %xmm1
divsd %xmm1, %xmm0
leaq 0x46ff(%rip), %rdx      # 0x1367d
leaq 0x50(%rsp), %r12
pushq $0x10
popq %rsi
movq %r12, %rdi
movb $0x1, %al
callq 0x2120
leaq 0x46eb(%rip), %rsi      # 0x13682
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xdd2c
movq 0x60(%r14), %rax
cvtsi2sdl 0x2c(%rax), %xmm0
mulsd 0x432b(%rip), %xmm0     # 0x132e0
cvtsi2sdl 0x14(%rax), %xmm1
divsd %xmm1, %xmm0
movq %r12, %rdi
pushq $0x10
popq %rsi
leaq 0x46b2(%rip), %rdx      # 0x1367d
movb $0x1, %al
callq 0x2120
leaq 0x46b6(%rip), %rsi      # 0x1368f
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xdd2c
movq 0x60(%r14), %rax
movl 0x18(%rax), %edx
testl %edx, %edx
jle 0xf006
leaq 0x46a4(%rip), %rsi      # 0x1369c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd2c
movq 0x60(%r14), %rax
movl 0x1c(%rax), %edx
testl %edx, %edx
jle 0xf01e
leaq 0x4697(%rip), %rsi      # 0x136ab
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd2c
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdx
movl 0x34(%r14), %ecx
movl 0x38(%r14), %r8d
incl %ecx
leaq 0x4681(%rip), %rsi      # 0x136b9
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd2c
xorl %r12d, %r12d
movq %r15, 0x10(%rsp)
movslq 0x18(%r14), %rax
cmpq %rax, %r12
jge 0xf234
movq 0x8(%r13), %r9
cmpb $0x0, 0x30(%rsp)
je 0xf081
cmpw $0x0, 0x18(%r13)
jne 0xf081
leal 0x1(%r12), %ecx
cmpl %ecx, %eax
jle 0xf081
leaq 0x3(%r9), %rax
cmpw $0x1, 0x50(%r13)
cmoveq %rax, %r9
movl 0x30(%r14), %eax
andl $0x1, %eax
je 0xf09d
movq 0x8(%r15), %rcx
movq %rcx, %r8
subq %r9, %r8
subq (%r13), %rcx
movq %rcx, %r9
jmp 0xf0a1
movq (%r13), %r8
cmpw $0x1, 0x18(%r13)
movq 0x10(%r15), %rdx
leaq 0x4656(%rip), %rcx      # 0x13708
leaq 0x4644(%rip), %rsi      # 0x136fd
cmoveq %rsi, %rcx
incq %r8
movl 0x24(%r13), %r10d
leaq 0x3699(%rip), %rsi      # 0x12764
movsbl (%rax,%rsi), %r11d
movswl 0x1a(%r13), %ebx
subq $0x8, %rsp
movq 0x50(%rsp), %rdi
leaq 0x45e6(%rip), %rsi      # 0x136cb
xorl %eax, %eax
pushq 0x20(%rsp)
pushq %rbp
pushq %rbx
movq %rdi, %rbx
pushq %r11
pushq %r10
callq 0xdd2c
addq $0x30, %rsp
cmpw $0x0, 0x18(%r13)
jne 0xf217
movq %rbp, %r15
cvtsi2sdl 0x28(%r13), %xmm0
mulsd 0x41c6(%rip), %xmm0     # 0x132e0
cvtsi2sdl 0x2c(%r13), %xmm1
divsd %xmm1, %xmm0
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
pushq $0x10
popq %rsi
leaq 0x4547(%rip), %rdx      # 0x1367d
movb $0x1, %al
callq 0x2120
movq %rbx, %rdi
leaq 0x453b(%rip), %rsi      # 0x13682
movq %rbp, %rdx
xorl %eax, %eax
callq 0xdd2c
movzbl 0x32(%r13), %eax
testl %eax, %eax
je 0xf185
cmpl $0x41, %eax
jne 0xf16a
movb 0x33(%r13), %cl
cmpb $0x47, %cl
jne 0xf16e
jmp 0xf185
movb 0x33(%r13), %cl
movsbl %al, %edx
movsbl %cl, %ecx
movq %rbx, %rdi
leaq 0x458e(%rip), %rsi      # 0x1370c
xorl %eax, %eax
callq 0xdd2c
movzbl 0x30(%r13), %eax
testl %eax, %eax
movq %r15, %rbp
movq 0x10(%rsp), %r15
je 0xf1c1
cmpl $0x47, %eax
jne 0xf1a6
movb 0x31(%r13), %cl
cmpb $0x54, %cl
jne 0xf1aa
jmp 0xf1c1
movb 0x31(%r13), %cl
movsbl %al, %edx
movsbl %cl, %ecx
movq %rbx, %rdi
leaq 0x4561(%rip), %rsi      # 0x1371b
xorl %eax, %eax
callq 0xdd2c
movl 0x1c(%r13), %edx
testl %edx, %edx
jle 0xf1da
movq %rbx, %rdi
leaq 0x44c9(%rip), %rsi      # 0x1369c
xorl %eax, %eax
callq 0xdd2c
movl 0x20(%r13), %edx
testl %edx, %edx
jle 0xf1f3
movq %rbx, %rdi
leaq 0x44bf(%rip), %rsi      # 0x136ab
xorl %eax, %eax
callq 0xdd2c
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdx
movl 0x10(%r13), %ecx
movl 0x14(%r13), %r8d
incl %ecx
movq %rbx, %rdi
leaq 0x4517(%rip), %rsi      # 0x13727
xorl %eax, %eax
callq 0xdd2c
movq %rbx, %rdi
leaq 0x3c60(%rip), %rsi      # 0x12e81
xorl %eax, %eax
callq 0xdd2c
incq %r12
addq $0x38, %r13
jmp 0xf04a
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x736b
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%r14), %rcx
addq $0x3, %rcx
movb $0x1, %al
movl %eax, 0x30(%rsp)
jmp 0xeb1f