// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/test-bcf-sr.c
// Function: write_summary_format
void write_summary_format(bcf_srs_t *sr, FILE *out)
{
    int n, i, j;
    while ((n = bcf_sr_next_line(sr)) > 0) {
        for (i=0; i<sr->nreaders; i++)
        {
            if ( !bcf_sr_has_line(sr,i) ) continue;
            bcf1_t *rec = bcf_sr_get_line(sr, i);
            if (!rec) error("bcf_sr_get_line() unexpectedly returned NULL\n");
            fprintf(out, "%s:%"PRIhts_pos,
                    bcf_seqname_safe(bcf_sr_get_header(sr,i),rec),rec->pos+1);
            break;
        }

        for (i=0; i<sr->nreaders; i++)
        {
            fprintf(out, "\t");

            if ( !bcf_sr_has_line(sr,i) )
            {
                fprintf(out, "%s","-");
                continue;
            }

            bcf1_t *rec = bcf_sr_get_line(sr, i);
            if (!rec) error("bcf_sr_get_line() unexpectedly returned NULL\n");
            fprintf(out, "%s", rec->n_allele > 1 ? rec->d.allele[1] : ".");
            for (j=2; j<rec->n_allele; j++)
            {
                fprintf(out, ",%s", rec->d.allele[j]);
            }
        }
        fprintf(out, "\n");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2a569
testl %eax, %eax
jle 0x6299
leaq 0xa91de(%rip), %r12     # 0xaf2fd
movslq 0x30(%r14), %rcx
testq %rcx, %rcx
jle 0x627c
movq 0x18(%r14), %rax
shlq $0x5, %rcx
leaq (%rcx,%rcx,2), %rdx
xorl %ecx, %ecx
cmpl $0x0, (%rax)
jne 0x614e
addq $0x60, %rcx
addq $0x4, %rax
cmpq %rcx, %rdx
jne 0x613a
jmp 0x61be
movq 0x28(%r14), %rdx
movq 0x30(%rdx,%rcx), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x62a8
movq 0x18(%rdx,%rcx), %rcx
testq %rcx, %rcx
je 0x618c
movl 0x10(%rax), %esi
movl $0x0, %edx
testl %esi, %esi
js 0x618e
cmpl %esi, 0x4(%rcx)
jle 0x618c
movq 0x18(%rcx), %rcx
shlq $0x4, %rsi
movq (%rcx,%rsi), %rdx
jmp 0x618e
xorl %edx, %edx
testq %rdx, %rdx
leaq 0xa93d3(%rip), %rcx     # 0xaf56b
cmoveq %rcx, %rdx
movq (%rax), %rcx
incq %rcx
movq %rbx, %rdi
leaq 0xaf62b(%rip), %rsi     # 0xb57d7
xorl %eax, %eax
callq 0x4730
cmpl $0x0, 0x30(%r14)
jle 0x627c
xorl %r13d, %r13d
movl $0x9, %edi
movq %rbx, %rsi
callq 0x4660
movq 0x18(%r14), %rax
cmpl $0x0, (%rax,%r13,4)
je 0x625d
movq 0x28(%r14), %rax
leaq (,%r13,2), %rcx
addq %r13, %rcx
shlq $0x5, %rcx
movq 0x30(%rax,%rcx), %rax
movq (%rax), %r15
testq %r15, %r15
je 0x62a8
movzwl 0x1a(%r15), %eax
leaq 0xb8642(%rip), %rdi     # 0xbe84f
testl $0xfffe, %eax           # imm = 0xFFFE
je 0x621f
movq 0x88(%r15), %rax
movq 0x8(%rax), %rdi
movq %rbx, %rsi
callq 0x4560
cmpl $0x30000, 0x18(%r15)    # imm = 0x30000
jb 0x626c
movl $0x2, %ebp
movq 0x88(%r15), %rax
movq (%rax,%rbp,8), %rdx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x4730
incq %rbp
movzwl 0x1a(%r15), %eax
cmpq %rax, %rbp
jb 0x6236
jmp 0x626c
leaq 0xaba76(%rip), %rdi     # 0xb1cda
movq %rbx, %rsi
callq 0x4560
incq %r13
movslq 0x30(%r14), %rax
cmpq %rax, %r13
jl 0x61c1
movl $0xa, %edi
movq %rbx, %rsi
callq 0x4660
movq %r14, %rdi
callq 0x2a569
testl %eax, %eax
jg 0x611f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa9020(%rip), %rdi     # 0xaf2cf
xorl %eax, %eax
callq 0x5f2c