// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jne 0x15931
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %edx
shrl $0xb, %edx
andl $0x1, %edx
movl $0x50, %eax
movl $0x49, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x14(%rbp)
jmp 0x15951
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %edx
shrl $0xb, %edx
andl $0x1, %edx
movl $0x53, %eax
movl $0x69, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x15a13
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %edx
movq -0x10(%rbp), %rax
subl 0x2c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addl %eax, %edx
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x4(%rax), %r8d
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rax), %r9d
andl $0x3fffffff, %r9d       # imm = 0x3FFFFFFF
leaq 0x42060(%rip), %rsi     # 0x57a15
movb $0x0, %al
callq 0x144f0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rax), %eax
shrl $0x1e, %eax
cmpl $0x1, %eax
je 0x159e2
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rax), %eax
shrl $0x1e, %eax
cmpl $0x2, %eax
jne 0x15a11
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rax), %eax
shrl $0x1e, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x42040(%rip), %rax     # 0x57a3f
movsbl (%rax,%rcx), %edx
leaq 0x4202c(%rip), %rsi     # 0x57a36
movb $0x0, %al
callq 0x144f0
jmp 0x15a13
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0xc(%rax), %r8d
leaq 0x42014(%rip), %rsi     # 0x57a44
movb $0x0, %al
callq 0x144f0
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x15a5f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x24(%rax), %edx
leaq 0x42005(%rip), %rsi     # 0x57a5d
movb $0x0, %al
callq 0x144f0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x15af4
movq -0x10(%rbp), %rdi
callq 0x22720
movaps %xmm0, %xmm1
movsd 0x3f58e(%rip), %xmm0    # 0x55010
subsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x15aa5
jp 0x15aa5
movb $0x30, -0x30(%rbp)
movb $0x0, -0x2f(%rbp)
jmp 0x15adc
leaq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22720
movq -0x58(%rbp), %rdi
movaps %xmm0, %xmm1
movsd 0x3f54b(%rip), %xmm0    # 0x55010
subsd %xmm1, %xmm0
movl $0x10, %esi
leaq 0x41f91(%rip), %rdx     # 0x57a66
movb $0x1, %al
callq 0x2170
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rdx
leaq 0x41f80(%rip), %rsi     # 0x57a6b
movb $0x0, %al
callq 0x144f0
jmp 0x15b70
movq -0x10(%rbp), %rax
movss 0x44(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x15b6e
movq -0x10(%rbp), %rax
movss 0x40cff(%rip), %xmm0    # 0x56810
ucomiss 0x44(%rax), %xmm0
jb 0x15b6e
movq -0x10(%rbp), %rax
movss 0x44(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x15b34
jp 0x15b34
movb $0x30, -0x50(%rbp)
movb $0x0, -0x4f(%rbp)
jmp 0x15b58
leaq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movss 0x44(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movl $0x10, %esi
leaq 0x41f15(%rip), %rdx     # 0x57a66
movb $0x1, %al
callq 0x2170
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rdx
leaq 0x41f0d(%rip), %rsi     # 0x57a74
movb $0x0, %al
callq 0x144f0
jmp 0x15b70
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %eax
shrl $0x8, %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x15ba1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %edx
shrl $0x8, %edx
andl $0x3, %edx
leaq 0x41ee3(%rip), %rsi     # 0x57a7d
movb $0x0, %al
callq 0x144f0
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)