// File: /workspace/github_c_makefile_star2_O1/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 0x8a4e
movq %rdi, %rbx
movq $0x0, 0x1d0(%rdi)
movq (%rdi), %r14
movq (%r14), %rsi
movq 0x10(%r14), %rdi
leaq 0xcbd(%rip), %rcx       # 0x9407
movl $0x8, %edx
callq 0x4990
movq (%r14), %rax
xorl %ecx, %ecx
testq %rax, %rax
je 0x87c3
movq 0x10(%r14), %rdx
xorl %esi, %esi
xorl %r14d, %r14d
xorl %edi, %edi
xorl %r9d, %r9d
movq (%rdx,%rsi,8), %r10
movl %r10d, %r8d
andl $0x1, %r8d
negl %r8d
orl $0x1, %r8d
addl %r9d, %r8d
js 0x8a5d
movq %r10, %r11
sarq %r11
testl %r9d, %r9d
movq %rdi, %r9
cmoveq %r11, %r9
testb $0x1, %r10b
cmoveq %r9, %rdi
subq %rdi, %r11
incq %r11
testq %rdi, %rdi
cmovleq %rcx, %r11
testl %r8d, %r8d
cmovneq %rcx, %r11
addq %r11, %r14
incq %rsi
movl %r8d, %r9d
cmpq %rsi, %rax
jne 0x876c
jmp 0x87c6
xorl %r14d, %r14d
movq 0x48(%rbx), %rax
cmpl $0x0, (%rax)
je 0x8a03
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 0x8954
cmpl $0x2, %eax
je 0x889c
cmpl $0x1, %eax
jne 0x89f1
movb 0x80(%rbx), %r13b
movq 0x1d0(%rbx), %rax
addq $0x2, %rax
cmpq %rax, 0x1d8(%rbx)
jae 0x8865
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 0x8894
movq %rax, 0x1e0(%rbx)
movq %r12, 0x1d8(%rbx)
movq 0x1d0(%rbx), %rax
movq 0x1e0(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x1d0(%rbx)
movb %r13b, (%rcx,%rax)
movq 0x1d0(%rbx), %rax
movq 0x1e0(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movl %r14d, %edi
jmp 0x89e9
movb 0x80(%rbx), %r13b
movq 0x1d0(%rbx), %rax
addq $0x2, %rax
cmpq %rax, 0x1d8(%rbx)
jae 0x88f9
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 0x8928
movq %rax, 0x1e0(%rbx)
movq %r12, 0x1d8(%rbx)
movq 0x1d0(%rbx), %rax
movq 0x1e0(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x1d0(%rbx)
movb %r13b, (%rcx,%rax)
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 0x941c
jmp 0x89f1
movb 0x80(%rbx), %r13b
movq 0x1d0(%rbx), %rax
addq $0x2, %rax
cmpq %rax, 0x1d8(%rbx)
jae 0x89b1
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 0x89e0
movq %rax, 0x1e0(%rbx)
movq %r12, 0x1d8(%rbx)
movq 0x1d0(%rbx), %rax
movq 0x1e0(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x1d0(%rbx)
movb %r13b, (%rcx,%rax)
movq 0x1d0(%rbx), %rax
movq 0x1e0(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movq (%rbx), %rax
movq (%rax), %rdi
shrq %rdi
movq %r15, %rsi
callq 0x67c5
incq %rbp
movq 0x48(%rbx), %rax
movl (%rax), %eax
cmpq %rax, %rbp
jb 0x87e6
movq 0x1d0(%rbx), %r14
movq 0x1e0(%rbx), %r15
testq %r14, %r14
jne 0x8a21
movq %r15, %rdi
callq 0x41d0
movq %rax, %r14
testq %r14, %r14
leaq 0x8f631(%rip), %rax     # 0x9805c
cmoveq %rax, %r15
cmpq $0x1, %r14
adcq $0x0, %r14
movq 0x190(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xd0bb
cmpq %r14, %rax
jne 0x8a7c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8dd89(%rip), %rdi     # 0x967ed
leaq 0x8d8b3(%rip), %rsi     # 0x9631e
leaq 0x8dd84(%rip), %rcx     # 0x967f6
movl $0xb5, %edx
callq 0x42f0
leaq 0x8d904(%rip), %rdi     # 0x96387
movq %r14, %rsi
xorl %eax, %eax
callq 0x5ed4