// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/annot-tsv.c
// Function: write_annots
static void write_annots(args_t *args)
{
    if ( !args->dst.annots ) return;

    args->tmp_kstr.l = 0;
    int i;
    hts_pos_t len = nbp_length(args->nbp);
    for (i=0; i<args->dst.annots->n; i++)
    {
        if ( args->dst.annots_idx[i]==ANN_NBP )
        {
            kputc(args->dst.delim,&args->tmp_kstr);
            kputw(len,&args->tmp_kstr);
        }
        else if ( args->dst.annots_idx[i]==ANN_FRAC )
        {
            kputc(args->dst.delim,&args->tmp_kstr);
            kputd((double)len/(args->nbp->end - args->nbp->beg + 1),&args->tmp_kstr);
        }
        else if ( args->dst.annots_idx[i]==ANN_CNT )
        {
            kputc(args->dst.delim,&args->tmp_kstr);
            kputw(args->nbp->n/2,&args->tmp_kstr);
        }
    }
    write_string(args, args->tmp_kstr.s, args->tmp_kstr.l);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x48(%rdi)
je 0x8a68
movq %rdi, %rbx
movq $0x0, 0x1d0(%rdi)
movq (%rdi), %r14
movq (%r14), %rsi
movq 0x10(%r14), %rdi
leaq 0xc7c(%rip), %rcx       # 0x93e3
movl $0x8, %edx
callq 0x4990
movq (%r14), %rax
xorl %esi, %esi
testq %rax, %rax
je 0x87c6
movq 0x10(%r14), %rcx
xorl %edx, %edx
xorl %r14d, %r14d
xorl %edi, %edi
movq (%rcx,%rdx,8), %r8
testb $0x1, %r8b
jne 0x879d
sarq %r8
testl %esi, %esi
cmoveq %r8, %rdi
incl %esi
jmp 0x87bc
testl %esi, %esi
jle 0x8a77
decl %esi
jne 0x87bc
testq %rdi, %rdi
jle 0x87bc
sarq %r8
subq %rdi, %r14
addq %r8, %r14
incq %r14
xorl %esi, %esi
incq %rdx
cmpq %rdx, %rax
jne 0x8786
jmp 0x87c9
xorl %r14d, %r14d
movq 0x48(%rbx), %rax
cmpl $0x0, (%rax)
je 0x8a1d
leaq 0x1d0(%rbx), %r15
cvtsi2sd %r14, %xmm0
movsd %xmm0, (%rsp)
xorl %ebp, %ebp
movq 0x68(%rbx), %rax
movl (%rax,%rbp,4), %eax
cmpl $0x4, %eax
je 0x88e6
cmpl $0x2, %eax
je 0x8878
cmpl $0x1, %eax
jne 0x8a0b
movb 0x80(%rbx), %r13b
movq 0x1d0(%rbx), %rcx
leaq 0x2(%rcx), %rax
cmpq %rax, 0x1d8(%rbx)
jae 0x89d8
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r12d
cmovbeq %rcx, %r12
addq %rax, %r12
movq 0x1e0(%rbx), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x8a00
movq %rax, 0x1e0(%rbx)
movq %r12, 0x1d8(%rbx)
movq 0x1d0(%rbx), %rcx
jmp 0x89df
movb 0x80(%rbx), %r13b
movq 0x1d0(%rbx), %rcx
leaq 0x2(%rcx), %rax
cmpq %rax, 0x1d8(%rbx)
jae 0x8954
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r12d
cmovbeq %rcx, %r12
addq %rax, %r12
movq 0x1e0(%rbx), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x897c
movq %rax, 0x1e0(%rbx)
movq %r12, 0x1d8(%rbx)
movq 0x1d0(%rbx), %rcx
jmp 0x895b
movb 0x80(%rbx), %r13b
movq 0x1d0(%rbx), %rcx
leaq 0x2(%rcx), %rax
cmpq %rax, 0x1d8(%rbx)
jae 0x89a5
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r12d
cmovbeq %rcx, %r12
addq %rax, %r12
movq 0x1e0(%rbx), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x89cd
movq %rax, 0x1e0(%rbx)
movq %r12, 0x1d8(%rbx)
movq 0x1d0(%rbx), %rcx
jmp 0x89ac
movq 0x1e0(%rbx), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x1d0(%rbx)
movb %r13b, (%rax,%rcx)
movq 0x1d0(%rbx), %rax
movq 0x1e0(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movq (%rbx), %rax
movq 0x20(%rax), %rcx
subq 0x18(%rax), %rcx
incq %rcx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
movq %r15, %rdi
callq 0x93f8
jmp 0x8a0b
movq 0x1e0(%rbx), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x1d0(%rbx)
movb %r13b, (%rax,%rcx)
movq 0x1d0(%rbx), %rax
movq 0x1e0(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movq (%rbx), %rax
movq (%rax), %rdi
shrq %rdi
jmp 0x8a03
movq 0x1e0(%rbx), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x1d0(%rbx)
movb %r13b, (%rax,%rcx)
movq 0x1d0(%rbx), %rax
movq 0x1e0(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movl %r14d, %edi
movq %r15, %rsi
callq 0x682a
incq %rbp
movq 0x48(%rbx), %rax
movl (%rax), %eax
cmpq %rax, %rbp
jb 0x87e9
movq 0x1d0(%rbx), %r14
movq 0x1e0(%rbx), %r15
testq %r14, %r14
jne 0x8a3b
movq %r15, %rdi
callq 0x41d0
movq %rax, %r14
testq %r14, %r14
leaq 0x8c657(%rip), %rax     # 0x9509c
cmoveq %rax, %r15
cmpq $0x1, %r14
adcq $0x0, %r14
movq 0x190(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xd005
cmpq %r14, %rax
jne 0x8a96
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8ad6f(%rip), %rdi     # 0x937ed
leaq 0x8a899(%rip), %rsi     # 0x9331e
leaq 0x8ad6a(%rip), %rcx     # 0x937f6
movl $0xb5, %edx
callq 0x42f0
leaq 0x8a8ea(%rip), %rdi     # 0x93387
movq %r14, %rsi
xorl %eax, %eax
callq 0x5edc