// File: /workspace/github_c_makefile_star2_O2/lh3[P]minimap2/format.c
// Function: write_tags
static inline void write_tags(kstring_t *s, const mm_reg1_t *r)
{
	int type;
	if (r->id == r->parent) type = r->inv? 'I' : 'P';
	else type = r->inv? 'i' : 'S';
	if (r->p) {
		mm_sprintf_lite(s, "\tNM:i:%d\tms:i:%d\tAS:i:%d\tnn:i:%d", r->blen - r->mlen + r->p->n_ambi, r->p->dp_max0, r->p->dp_score, r->p->n_ambi);
		if (r->p->trans_strand == 1 || r->p->trans_strand == 2)
			mm_sprintf_lite(s, "\tts:A:%c", "?+-?"[r->p->trans_strand]);
	}
	mm_sprintf_lite(s, "\ttp:A:%c\tcm:i:%d\ts1:i:%d", type, r->cnt, r->score);
	if (r->parent == r->id) mm_sprintf_lite(s, "\ts2:i:%d", r->subsc);
	if (r->p) {
		char buf[16];
		double div;
		div = 1.0 - mm_event_identity(r);
		if (div == 0.0) buf[0] = '0', buf[1] = 0;
		else snprintf(buf, 16, "%.4f", 1.0 - mm_event_identity(r));
		mm_sprintf_lite(s, "\tde:f:%s", buf);
	} else if (r->div >= 0.0f && r->div <= 1.0f) {
		char buf[16];
		if (r->div == 0.0f) buf[0] = '0', buf[1] = 0;
		else snprintf(buf, 16, "%.4f", r->div);
		mm_sprintf_lite(s, "\tdv:f:%s", buf);
	}
	if (r->split) mm_sprintf_lite(s, "\tzd:i:%d", r->split);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
testb $0x8, 0x3d(%rsi)
pushq $0x50
popq %rcx
pushq $0x49
popq %rdx
cmovel %ecx, %edx
pushq $0x53
popq %rcx
pushq $0x69
popq %rbp
cmovel %ecx, %ebp
cmpl 0x20(%rsi), %eax
cmovel %edx, %ebp
movq 0x48(%rsi), %rax
testq %rax, %rax
je 0xe28b
movl 0x30(%r14), %edx
subl 0x2c(%r14), %edx
movl $0x3fffffff, %r9d       # imm = 0x3FFFFFFF
andl 0x14(%rax), %r9d
addl %r9d, %edx
movl 0x4(%rax), %r8d
movl 0x10(%rax), %ecx
leaq 0x1abd6(%rip), %rsi     # 0x28e29
movq %rbx, %rdi
xorl %eax, %eax
callq 0xce8e
movq 0x48(%r14), %rax
movl 0x14(%rax), %eax
shrl $0x1e, %eax
leal -0x1(%rax), %ecx
cmpl $0x1, %ecx
ja 0xe28b
leaq 0x1abdd(%rip), %rcx     # 0x28e53
movsbl (%rax,%rcx), %edx
leaq 0x1abc9(%rip), %rsi     # 0x28e4a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xce8e
movl 0x4(%r14), %ecx
movl 0xc(%r14), %r8d
leaq 0x1abbe(%rip), %rsi     # 0x28e58
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xce8e
movl 0x20(%r14), %eax
cmpl (%r14), %eax
jne 0xe2c4
movl 0x24(%r14), %edx
leaq 0x1abb7(%rip), %rsi     # 0x28e71
movq %rbx, %rdi
xorl %eax, %eax
callq 0xce8e
cmpq $0x0, 0x48(%r14)
je 0xe2e7
movq %r14, %rdi
callq 0x14ee6
ucomisd 0x17d35(%rip), %xmm0    # 0x26010
jne 0xe318
jp 0xe318
movw $0x30, (%rsp)
jmp 0xe344
movss 0x44(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0xe379
movss 0x198ef(%rip), %xmm1    # 0x27bf0
ucomiss %xmm0, %xmm1
jb 0xe379
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xe34d
jp 0xe34d
movw $0x30, (%rsp)
jmp 0xe365
movq %r14, %rdi
callq 0x14ee6
movsd 0x17ce8(%rip), %xmm1    # 0x26010
subsd %xmm0, %xmm1
leaq 0x1ab47(%rip), %rdx     # 0x28e7a
movq %rsp, %rdi
pushq $0x10
popq %rsi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x2170
leaq 0x1ab34(%rip), %rsi     # 0x28e7f
jmp 0xe36c
cvtss2sd %xmm0, %xmm0
leaq 0x1ab22(%rip), %rdx     # 0x28e7a
movq %rsp, %rdi
pushq $0x10
popq %rsi
movb $0x1, %al
callq 0x2170
leaq 0x1ab1c(%rip), %rsi     # 0x28e88
movq %rsp, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xce8e
movl 0x3c(%r14), %edx
shrl $0x8, %edx
andl $0x3, %edx
je 0xe396
leaq 0x1ab05(%rip), %rsi     # 0x28e91
movq %rbx, %rdi
xorl %eax, %eax
callq 0xce8e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq