// File: /workspace/github_c_makefile_star2_O3/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 0xfc7d
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 0x1e1e4(%rip), %rsi     # 0x2de29
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe575
movq 0x48(%r14), %rax
movl 0x14(%rax), %eax
shrl $0x1e, %eax
leal -0x1(%rax), %ecx
cmpl $0x1, %ecx
ja 0xfc7d
leaq 0x1e1eb(%rip), %rcx     # 0x2de53
movsbl (%rax,%rcx), %edx
leaq 0x1e1d7(%rip), %rsi     # 0x2de4a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe575
movl 0x4(%r14), %ecx
movl 0xc(%r14), %r8d
leaq 0x1e1cc(%rip), %rsi     # 0x2de58
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe575
movl 0x20(%r14), %eax
cmpl (%r14), %eax
jne 0xfcb6
movl 0x24(%r14), %edx
leaq 0x1e1c5(%rip), %rsi     # 0x2de71
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe575
cmpq $0x0, 0x48(%r14)
je 0xfcd9
movq %r14, %rdi
callq 0x17204
ucomisd 0x1b35b(%rip), %xmm0    # 0x2b028
jne 0xfd0a
jp 0xfd0a
movw $0x30, (%rsp)
jmp 0xfd38
movss 0x44(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0xfd6f
movss 0x1cefd(%rip), %xmm1    # 0x2cbf0
ucomiss %xmm0, %xmm1
jb 0xfd6f
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xfd41
jp 0xfd41
movw $0x30, (%rsp)
jmp 0xfd5b
movq %r14, %rdi
callq 0x17204
movsd 0x1b30e(%rip), %xmm1    # 0x2b028
subsd %xmm0, %xmm1
leaq 0x1e155(%rip), %rdx     # 0x2de7a
movq %rsp, %rdi
movl $0x10, %esi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x2170
leaq 0x1e140(%rip), %rsi     # 0x2de7f
jmp 0xfd62
cvtss2sd %xmm0, %xmm0
leaq 0x1e12e(%rip), %rdx     # 0x2de7a
movq %rsp, %rdi
movl $0x10, %esi
movb $0x1, %al
callq 0x2170
leaq 0x1e126(%rip), %rsi     # 0x2de88
movq %rsp, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe575
movl 0x3c(%r14), %edx
shrl $0x8, %edx
andl $0x3, %edx
je 0xfd8c
leaq 0x1e10f(%rip), %rsi     # 0x2de91
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe575
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq