// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/annot-tsv.c
// Function: write_header
void write_header(args_t *args, dat_t *dat)
{
    if ( dat->hdr.dummy ) return;
    if ( args->no_write_hdr>1 ) return;
    int i;
    kstring_t str = {0,0,0};
    kputc('#', &str);
    for (i=0; i<dat->hdr.cols->n; i++)
    {
        if ( i>0 ) kputc(dat->delim, &str);
        if ( !args->no_write_hdr ) ksprintf(&str,"[%d]", i+1);
        kputs(dat->hdr.cols->off[i], &str);
    }
    if ( dat->hdr.annots )
    {
        for (i=0; i<dat->hdr.annots->n; i++)
        {
            if ( str.l > 1 ) kputc(dat->delim, &str);
            kputs(dat->hdr.annots->off[i], &str);
        }
    }
    kputc('\n',&str);
    if ( bgzf_write(args->out_fp, str.s, str.l) != str.l ) error("Failed to write %zd bytes\n", str.l);
    free(str.s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x0, 0x20(%rsi)
jne 0x6fb0
movq %rdi, %rbx
cmpl $0x1, 0x1a4(%rdi)
jg 0x6fb0
movq %rsi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movl $0x3, %edi
callq 0x4680
testq %rax, %rax
je 0x6c59
movq %rax, 0x10(%rsp)
movq $0x3, 0x8(%rsp)
movq $0x1, (%rsp)
movw $0x23, (%rax)
movq 0x10(%r14), %rax
cmpl $0x0, (%rax)
je 0x6dc5
xorl %r12d, %r12d
testq %r12, %r12
je 0x6ce1
movb 0x78(%r14), %bpl
movq (%rsp), %rcx
leaq 0x2(%rcx), %rax
cmpq %rax, 0x8(%rsp)
jae 0x6cc3
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r13d
cmovbeq %rcx, %r13
addq %rax, %r13
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x4840
testq %rax, %rax
je 0x6ce1
movq %rax, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq (%rsp), %rcx
jmp 0x6cc8
movq 0x10(%rsp), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rsp)
movb %bpl, (%rax,%rcx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
cmpl $0x0, 0x1a4(%rbx)
jne 0x6d00
leal 0x1(%r12), %edx
movq %rsp, %rdi
leaq 0x8c689(%rip), %rsi     # 0x93382
xorl %eax, %eax
callq 0x9ab7
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq (%rax,%r12,8), %r13
testq %r13, %r13
je 0x6d75
movq %r13, %rdi
callq 0x41d0
movq %rax, %rbp
movq (%rsp), %rdi
addq %rdi, %rax
addq $0x2, %rax
cmpq %rdi, %rax
jbe 0x6d82
cmpq %rax, 0x8(%rsp)
jae 0x6d8f
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r15d
cmovbeq %rcx, %r15
addq %rax, %r15
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x6db3
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq (%rsp), %rdi
jmp 0x6d94
callq 0x4050
movl $0xe, (%rax)
jmp 0x6db3
callq 0x4050
movl $0x4b, (%rax)
jmp 0x6db3
movq 0x10(%rsp), %rax
addq %rax, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x43c0
addq (%rsp), %rbp
movq %rbp, (%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax,%rbp)
incq %r12
movq 0x10(%r14), %rax
movl (%rax), %eax
cmpq %rax, %r12
jb 0x6c69
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x6f1c
cmpl $0x0, (%rax)
je 0x6f1c
xorl %ebp, %ebp
movq (%rsp), %rcx
cmpq $0x2, %rcx
jb 0x6e56
movb 0x78(%r14), %r12b
leaq 0x2(%rcx), %rax
cmpq %rax, 0x8(%rsp)
jae 0x6e38
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r15d
cmovbeq %rcx, %r15
addq %rax, %r15
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x6e56
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq (%rsp), %rcx
jmp 0x6e3d
movq 0x10(%rsp), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rsp)
movb %r12b, (%rax,%rcx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x18(%r14), %rax
movq 0x8(%rax), %rax
movq (%rax,%rbp,8), %r15
testq %r15, %r15
je 0x6ecb
movq %r15, %rdi
callq 0x41d0
movq %rax, %r12
movq (%rsp), %rdi
addq %rdi, %rax
addq $0x2, %rax
cmpq %rdi, %rax
jbe 0x6ed8
cmpq %rax, 0x8(%rsp)
jae 0x6ee5
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r13d
cmovbeq %rcx, %r13
addq %rax, %r13
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x4840
testq %rax, %rax
je 0x6f0a
movq %rax, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq (%rsp), %rdi
jmp 0x6eea
callq 0x4050
movl $0xe, (%rax)
jmp 0x6f0a
callq 0x4050
movl $0x4b, (%rax)
jmp 0x6f0a
movq 0x10(%rsp), %rax
addq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x43c0
addq (%rsp), %r12
movq %r12, (%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax,%r12)
incq %rbp
movq 0x18(%r14), %rax
movl (%rax), %eax
cmpq %rax, %rbp
jb 0x6ddd
movq (%rsp), %rcx
leaq 0x2(%rcx), %rax
cmpq %rax, 0x8(%rsp)
jae 0x6f6a
movq %rax, %rcx
shrq %rcx
xorl %r14d, %r14d
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
cmovbeq %rcx, %r14
addq %rax, %r14
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x4840
testq %rax, %rax
je 0x6f88
movq %rax, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq (%rsp), %rcx
jmp 0x6f6f
movq 0x10(%rsp), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rsp)
movb $0xa, (%rax,%rcx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x190(%rbx), %rdi
movq (%rsp), %rdx
movq 0x10(%rsp), %rsi
callq 0xd005
movq (%rsp), %rsi
cmpq %rsi, %rax
jne 0x6fbf
movq 0x10(%rsp), %rdi
callq 0x45c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8c3c1(%rip), %rdi     # 0x93387
xorl %eax, %eax
callq 0x5edc