// File: /workspace/github_c_makefile_star2_O1/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)
movl $0x50, %ecx
movl $0x49, %edx
cmovel %ecx, %edx
movl $0x53, %ecx
movl $0x69, %ebp
cmovel %ecx, %ebp
cmpl 0x20(%rsi), %eax
cmovel %edx, %ebp
movq 0x48(%rsi), %rax
testq %rax, %rax
je 0xfd73
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 0x1d0d2(%rip), %rsi     # 0x2ce0d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe671
movq 0x48(%r14), %rax
movl 0x14(%rax), %eax
shrl $0x1e, %eax
leal -0x1(%rax), %ecx
cmpl $0x1, %ecx
ja 0xfd73
leaq 0x1d0d9(%rip), %rcx     # 0x2ce37
movsbl (%rax,%rcx), %edx
leaq 0x1d0c5(%rip), %rsi     # 0x2ce2e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe671
movl 0x4(%r14), %ecx
movl 0xc(%r14), %r8d
leaq 0x1d0ba(%rip), %rsi     # 0x2ce3c
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe671
movl 0x20(%r14), %eax
cmpl (%r14), %eax
jne 0xfdac
movl 0x24(%r14), %edx
leaq 0x1d0b3(%rip), %rsi     # 0x2ce55
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe671
cmpq $0x0, 0x48(%r14)
je 0xfdcf
movq %r14, %rdi
callq 0x171b8
ucomisd 0x1a265(%rip), %xmm0    # 0x2a028
jne 0xfe00
jp 0xfe00
movw $0x30, (%rsp)
jmp 0xfe2e
movss 0x44(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0xfe65
movss 0x1bde7(%rip), %xmm1    # 0x2bbd0
ucomiss %xmm0, %xmm1
jb 0xfe65
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xfe37
jp 0xfe37
movw $0x30, (%rsp)
jmp 0xfe51
movq %r14, %rdi
callq 0x171b8
movsd 0x1a218(%rip), %xmm1    # 0x2a028
subsd %xmm0, %xmm1
leaq 0x1d043(%rip), %rdx     # 0x2ce5e
movq %rsp, %rdi
movl $0x10, %esi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x2170
leaq 0x1d02e(%rip), %rsi     # 0x2ce63
jmp 0xfe58
cvtss2sd %xmm0, %xmm0
leaq 0x1d01c(%rip), %rdx     # 0x2ce5e
movq %rsp, %rdi
movl $0x10, %esi
movb $0x1, %al
callq 0x2170
leaq 0x1d014(%rip), %rsi     # 0x2ce6c
movq %rsp, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe671
movl 0x3c(%r14), %edx
shrl $0x8, %edx
andl $0x3, %edx
je 0xfe82
leaq 0x1cffd(%rip), %rsi     # 0x2ce75
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe671
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq