// File: /workspace/github_c_makefile_star2_O1/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 0x6f47
movq %rdi, %rbx
cmpl $0x1, 0x1a4(%rdi)
jg 0x6f47
movq %rsi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x1, 0x8(%rsp)
ja 0x6bd4
movq 0x10(%rsp), %rdi
movl $0x3, %esi
callq 0x4840
testq %rax, %rax
je 0x6bf6
movq %rax, 0x10(%rsp)
movq $0x3, 0x8(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0x23, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x10(%r14), %rax
cmpl $0x0, (%rax)
je 0x6d5f
xorl %r12d, %r12d
testq %r12, %r12
je 0x6c7c
movb 0x78(%r14), %bpl
movq (%rsp), %rax
addq $0x2, %rax
cmpq %rax, 0x8(%rsp)
jae 0x6c5a
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 0x6c7c
movq %rax, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb %bpl, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
cmpl $0x0, 0x1a4(%rbx)
jne 0x6c9b
leal 0x1(%r12), %edx
movq %rsp, %rdi
leaq 0x8f6ee(%rip), %rsi     # 0x96382
xorl %eax, %eax
callq 0x9aab
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq (%rax,%r12,8), %r13
testq %r13, %r13
je 0x6d35
movq %r13, %rdi
callq 0x41d0
movq %rax, %rbp
movq (%rsp), %rcx
addq %rcx, %rax
addq $0x2, %rax
cmpq %rcx, %rax
jbe 0x6d42
cmpq %rax, 0x8(%rsp)
jae 0x6d0e
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 0x6d4d
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq 0x10(%rsp), %rdi
addq (%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x43c0
addq (%rsp), %rbp
movq %rbp, (%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax,%rbp)
jmp 0x6d4d
callq 0x4050
movl $0xe, (%rax)
jmp 0x6d4d
callq 0x4050
movl $0x4b, (%rax)
incq %r12
movq 0x10(%r14), %rax
movl (%rax), %eax
cmpq %rax, %r12
jb 0x6c06
cmpq $0x0, 0x18(%r14)
je 0x6eb5
movq 0x18(%r14), %rax
cmpl $0x0, (%rax)
je 0x6eb5
xorl %ebp, %ebp
movq (%rsp), %rax
cmpq $0x2, %rax
jb 0x6df0
movb 0x78(%r14), %r12b
addq $0x2, %rax
cmpq %rax, 0x8(%rsp)
jae 0x6dce
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 0x6df0
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb %r12b, (%rcx,%rax)
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 0x6e8b
movq %r15, %rdi
callq 0x41d0
movq %rax, %r12
movq (%rsp), %rcx
addq %rcx, %rax
addq $0x2, %rax
cmpq %rcx, %rax
jbe 0x6e98
cmpq %rax, 0x8(%rsp)
jae 0x6e63
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 0x6ea3
movq %rax, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq 0x10(%rsp), %rdi
addq (%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x43c0
addq (%rsp), %r12
movq %r12, (%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax,%r12)
jmp 0x6ea3
callq 0x4050
movl $0xe, (%rax)
jmp 0x6ea3
callq 0x4050
movl $0x4b, (%rax)
incq %rbp
movq 0x18(%r14), %rax
movl (%rax), %eax
cmpq %rax, %rbp
jb 0x6d79
movq (%rsp), %rax
addq $0x2, %rax
cmpq %rax, 0x8(%rsp)
jae 0x6efd
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 0x6f1f
movq %rax, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0xa, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x190(%rbx), %rdi
movq (%rsp), %rdx
movq 0x10(%rsp), %rsi
callq 0xd0bb
movq (%rsp), %rsi
cmpq %rsi, %rax
jne 0x6f56
movq 0x10(%rsp), %rdi
callq 0x45c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8f42a(%rip), %rdi     # 0x96387
xorl %eax, %eax
callq 0x5ed4