// File: /workspace/github_c_makefile_star2_O1/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 0x2b4fe
testl %eax, %eax
jle 0x6283
leaq 0xab1ee(%rip), %r13     # 0xb12fd
movslq 0x30(%r14), %rcx
testq %rcx, %rcx
jle 0x61a3
movq 0x18(%r14), %rax
shlq $0x5, %rcx
leaq (%rcx,%rcx,2), %rdx
xorl %ecx, %ecx
cmpl $0x0, (%rax)
jne 0x613e
addq $0x60, %rcx
addq $0x4, %rax
cmpq %rcx, %rdx
jne 0x612a
jmp 0x61a3
movq 0x28(%r14), %rdx
movq 0x30(%rdx,%rcx), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x6292
movq 0x18(%rdx,%rcx), %rcx
testq %rcx, %rcx
je 0x617c
movl 0x10(%rax), %esi
movl $0x0, %edx
testl %esi, %esi
js 0x617e
cmpl %esi, 0x4(%rcx)
jle 0x617c
movq 0x18(%rcx), %rcx
shlq $0x4, %rsi
movq (%rcx,%rsi), %rdx
jmp 0x617e
xorl %edx, %edx
testq %rdx, %rdx
leaq 0xab3e3(%rip), %rcx     # 0xb156b
cmoveq %rcx, %rdx
movq (%rax), %rcx
incq %rcx
movq %rbx, %rdi
leaq 0xb167b(%rip), %rsi     # 0xb7817
xorl %eax, %eax
callq 0x4730
cmpl $0x0, 0x30(%r14)
jle 0x6266
xorl %r15d, %r15d
movl $0x9, %edi
movq %rbx, %rsi
callq 0x4660
movq 0x18(%r14), %rax
cmpl $0x0, (%rax,%r15,4)
je 0x6247
movq 0x28(%r14), %rax
leaq (%r15,%r15,2), %rcx
shlq $0x5, %rcx
movq 0x30(%rax,%rcx), %rax
movq (%rax), %r12
testq %r12, %r12
je 0x6292
movzwl 0x1a(%r12), %eax
leaq 0xb9f0c(%rip), %rdi     # 0xc00ff
testl $0xfffe, %eax           # imm = 0xFFFE
je 0x6206
movq 0x88(%r12), %rax
movq 0x8(%rax), %rdi
movq %rbx, %rsi
callq 0x4560
cmpl $0x30000, 0x18(%r12)    # imm = 0x30000
jb 0x6256
movl $0x2, %ebp
movq 0x88(%r12), %rax
movq (%rax,%rbp,8), %rdx
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4730
incq %rbp
movzwl 0x1a(%r12), %eax
cmpq %rax, %rbp
jb 0x621e
jmp 0x6256
leaq 0xadad9(%rip), %rdi     # 0xb3d27
movq %rbx, %rsi
callq 0x4560
incq %r15
movslq 0x30(%r14), %rax
cmpq %rax, %r15
jl 0x61b1
movl $0xa, %edi
movq %rbx, %rsi
callq 0x4660
movq %r14, %rdi
callq 0x2b4fe
testl %eax, %eax
jg 0x610f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xab036(%rip), %rdi     # 0xb12cf
xorl %eax, %eax
callq 0x5f1c