// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_next_line
int bcf_sr_next_line(bcf_srs_t *files)
{
    if ( !files->targets_als )
        return next_line(files);

    while (1)
    {
        int i, ret = next_line(files);
        if ( !ret ) return ret;

        for (i=0; i<files->nreaders; i++)
            if ( files->has_line[i] ) break;

        if ( _regions_match_alleles(files->targets, files->targets_als-1, files->readers[i].buffer[0]) ) return ret;

        // Check if there are more duplicate lines in the buffers. If not, return this line as if it
        // matched the targets, even if there is a type mismatch
        for (i=0; i<files->nreaders; i++)
        {
            if ( !files->has_line[i] ) continue;
            if ( files->readers[i].nbuffer==0 || files->readers[i].buffer[1]->pos!=files->readers[i].buffer[0]->pos ) continue;
            break;
        }
        if ( i==files->nreaders ) return ret;   // no more lines left, output even if target alleles are not of the same type
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x58(%rdi)
je 0x2246b
xorl %r14d, %r14d
pushq $0xe
popq %r12
movq %rbx, %rdi
callq 0x224b2
testl %eax, %eax
je 0x2247e
movl %eax, %ebp
movl 0x30(%rbx), %eax
testl %eax, %eax
cmovlel %r14d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x22259
movq 0x18(%rbx), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x22256
incq %rcx
jmp 0x22242
movq %rcx, %rax
movq 0x50(%rbx), %r15
cmpq $0x0, 0x80(%r15)
jne 0x22491
movq 0x28(%rbx), %rcx
imulq $0x60, %rax, %rax
movq 0x30(%rcx,%rax), %rax
movq (%rax), %rdi
cmpl $0x0, 0x60(%r15)
jne 0x2240a
movl 0x58(%rbx), %eax
decl %eax
movq 0x20(%r15), %r14
xorl %ecx, %ecx
cmpl %eax, %ecx
jge 0x222ab
movzbl (%r14), %edx
cmpl $0x9, %edx
je 0x222a4
testl %edx, %edx
jne 0x222a6
jmp 0x222ab
incl %ecx
incq %r14
jmp 0x22291
movl $0x1, 0x60(%r15)
pushq $0x1
popq %rax
pushq $0x1
popq %rcx
movzbl -0x1(%r14,%rax), %edx
cmpl $0x2c, %edx
je 0x222cf
testl %edx, %edx
je 0x222da
cmpl $0x9, %edx
jne 0x222d5
jmp 0x222da
incl %ecx
movl %ecx, 0x60(%r15)
incq %rax
jmp 0x222b9
movq %rdi, 0x10(%rsp)
leaq 0x48(%r15), %rdi
movslq %ecx, %rsi
addq %rax, %rsi
movq %rdi, 0x8(%rsp)
callq 0x238c9
andq $0x0, 0x48(%r15)
movl 0x60(%r15), %edi
movslq 0x64(%r15), %rsi
cmpl %esi, %edi
jle 0x2232e
cmpl $0x2, %edi
pushq $0x1
popq %rax
cmovll %eax, %edi
leaq 0x40(%r15), %r9
leaq 0x68f98(%rip), %rax     # 0x8b2b0
movq %rax, (%rsp)
pushq $0x4
popq %rdx
pushq $0x8
popq %rcx
xorl %r8d, %r8d
callq 0xf517
movl %eax, 0x64(%r15)
andl $0x0, 0x60(%r15)
xorl %eax, %eax
xorl %ecx, %ecx
leaq 0x1(%r14), %r13
xorl %esi, %esi
movzbl (%r13), %edi
incq %rsi
movslq %eax, %rdx
movslq %ecx, %r12
testl %edi, %edi
je 0x223ad
cmpl $0x9, %edi
je 0x223ad
incq %r13
cmpl $0x2c, %edi
jne 0x2233d
movq 0x40(%r15), %rax
movq 0x58(%r15), %rcx
addq 0x48(%r15), %rcx
movq %rcx, (%rax,%rdx,8)
movq %r14, %rdi
movq 0x8(%rsp), %rdx
callq 0x2386c
movq 0x40(%r15), %rax
movq 0x48(%r15), %rcx
movq 0x58(%r15), %rdx
addq %rcx, %rdx
movslq 0x60(%r15), %rsi
subq (%rax,%rsi,8), %rdx
cmpq %r12, %rdx
cmovgl %edx, %r12d
incq %rcx
movq %rcx, 0x48(%r15)
leal 0x1(%rsi), %eax
movl %eax, 0x60(%r15)
movl %r12d, %ecx
movq %r13, %r14
jmp 0x22337
movq 0x40(%r15), %rax
movq 0x58(%r15), %rcx
addq 0x48(%r15), %rcx
movq %rcx, (%rax,%rdx,8)
movq %r14, %rdi
movq 0x8(%rsp), %rdx
callq 0x2386c
movq 0x58(%r15), %rax
addq 0x48(%r15), %rax
movq 0x40(%r15), %rcx
movslq 0x60(%r15), %rdx
subq (%rcx,%rdx,8), %rax
cmpq %r12, %rax
cmovgl %eax, %r12d
leal 0x1(%rdx), %eax
movl %eax, 0x60(%r15)
xorl %eax, %eax
cmpl $0x2, %r12d
setge %al
leal (%rax,%rax,2), %eax
incl %eax
movl %eax, 0x68(%r15)
xorl %r14d, %r14d
pushq $0xe
popq %r12
movq 0x10(%rsp), %rdi
callq 0x32ee7
xorl 0x68(%r15), %eax
testb $0x4, %al
je 0x22480
movl 0x30(%rbx), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
movq %r12, %rsi
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x22461
movq 0x18(%rbx), %rdi
cmpl $0x0, (%rdi,%rdx,4)
je 0x22456
movq 0x28(%rbx), %rdi
cmpl $0x0, (%rdi,%rsi,4)
je 0x22456
movq -0x8(%rdi,%rsi,4), %rdi
movq (%rdi), %r8
movq 0x8(%rdi), %rdi
movq (%rdi), %rdi
cmpq (%r8), %rdi
je 0x2245f
incq %rdx
addq $0x18, %rsi
jmp 0x22429
movl %edx, %ecx
cmpl %eax, %ecx
jne 0x22225
jmp 0x22480
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x224b2
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x68e18(%rip), %rsi     # 0x8b2b0
leaq 0x68e28(%rip), %rdx     # 0x8b2c7
pushq $0x1
popq %rbx
movl %ebx, %edi
xorl %eax, %eax
callq 0x86fa
movl %ebx, %edi
callq 0x4600