// File: /workspace/github_c_makefile_star2_O3/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 0x2a916
movq %rbx, %rdi
callq 0x2a960
testl %eax, %eax
je 0x2a929
movl %eax, %ebp
movl 0x30(%rbx), %eax
testl %eax, %eax
jle 0x2a5b7
movq 0x18(%rbx), %rdx
xorl %ecx, %ecx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x2a5b3
incq %rcx
cmpq %rcx, %rax
jne 0x2a5a3
movl %eax, %ecx
movl %ecx, %eax
jmp 0x2a5b9
xorl %eax, %eax
movq 0x50(%rbx), %r14
cmpq $0x0, 0x80(%r14)
jne 0x2a93c
movq 0x28(%rbx), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x5, %rax
movq 0x30(%rcx,%rax), %rax
movq (%rax), %rdi
cmpl $0x0, 0x60(%r14)
jne 0x2a8b7
movl 0x58(%rbx), %eax
movq 0x20(%r14), %r15
cmpl $0x2, %eax
jl 0x2a612
decl %eax
xorl %ecx, %ecx
movzbl (%r15), %edx
cmpl $0x9, %edx
je 0x2a609
testl %edx, %edx
jne 0x2a60b
jmp 0x2a612
incl %ecx
incq %r15
cmpl %eax, %ecx
jl 0x2a5fa
movl $0x1, 0x60(%r14)
movl $0x1, %ecx
movl $0x1, %eax
movzbl -0x1(%r15,%rax), %edx
cmpl $0x2c, %edx
je 0x2a63a
testl %edx, %edx
je 0x2a645
cmpl $0x9, %edx
jne 0x2a640
jmp 0x2a645
incl %ecx
movl %ecx, 0x60(%r14)
incq %rax
jmp 0x2a624
movq %rdi, 0x10(%rsp)
movslq %ecx, %rcx
addq %rax, %rcx
cmpq %rcx, 0x50(%r14)
jae 0x2a68c
movq %rcx, %rax
shrq $0x3e, %rax
movq %rcx, %rdx
shrq %rdx
testq %rax, %rax
movl $0x0, %r12d
cmoveq %rdx, %r12
addq %rcx, %r12
movq 0x58(%r14), %rdi
movq %r12, %rsi
callq 0x4870
testq %rax, %rax
je 0x2a68c
movq %rax, 0x58(%r14)
movq %r12, 0x50(%r14)
movq $0x0, 0x48(%r14)
movl 0x60(%r14), %edi
movslq 0x64(%r14), %rsi
cmpl %esi, %edi
jle 0x2a6d0
cmpl $0x2, %edi
movl $0x1, %eax
cmovll %eax, %edi
leaq 0x40(%r14), %r9
leaq 0x88c5a(%rip), %rax     # 0xb3310
movq %rax, (%rsp)
movl $0x4, %edx
movl $0x8, %ecx
xorl %r8d, %r8d
callq 0x11bb5
movl %eax, 0x64(%r14)
movl $0x0, 0x60(%r14)
xorl %eax, %eax
xorl %r13d, %r13d
xorl %r12d, %r12d
movzbl 0x1(%r15,%r12), %ecx
incq %r12
testl %ecx, %ecx
je 0x2a7dd
cmpl $0x9, %ecx
je 0x2a7dd
cmpl $0x2c, %ecx
jne 0x2a6e0
movq 0x40(%r14), %rcx
movq 0x48(%r14), %rdi
movq 0x58(%r14), %rdx
addq %rdi, %rdx
cltq
movq %rdx, (%rcx,%rax,8)
leaq (%rdi,%r12), %rax
addq $0x2, %rax
cmpq %rdi, %rax
jbe 0x2a76e
cmpq %rax, 0x50(%r14)
jae 0x2a77b
movq %rax, %rcx
shrq $0x3e, %rcx
shrq %rax
testq %rcx, %rcx
movl $0x0, %ecx
cmoveq %rax, %rcx
addq %rdi, %rcx
leaq (%r12,%rcx), %rsi
addq $0x2, %rsi
movq 0x58(%r14), %rdi
movq %rsi, 0x8(%rsp)
callq 0x4870
testq %rax, %rax
je 0x2a7a0
movq %rax, 0x58(%r14)
movq 0x8(%rsp), %rcx
movq %rcx, 0x50(%r14)
movq 0x48(%r14), %rdi
jmp 0x2a77f
callq 0x4050
movl $0x4b, (%rax)
jmp 0x2a7a0
movq 0x58(%r14), %rax
addq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x43c0
movq 0x48(%r14), %rax
addq %r12, %rax
movq %rax, 0x48(%r14)
movq 0x58(%r14), %rcx
movb $0x0, (%rcx,%rax)
movq 0x40(%r14), %rax
movq 0x48(%r14), %rcx
movq 0x58(%r14), %rdx
addq %rcx, %rdx
movslq 0x60(%r14), %rsi
subq (%rax,%rsi,8), %rdx
movslq %r13d, %rax
cmpq %rax, %rdx
cmovlel %r13d, %edx
incq %rcx
movq %rcx, 0x48(%r14)
leal 0x1(%rsi), %eax
movl %eax, 0x60(%r14)
addq %r12, %r15
incq %r15
movl %edx, %r13d
jmp 0x2a6dd
movq 0x40(%r14), %rcx
movq 0x48(%r14), %rdi
movq 0x58(%r14), %rdx
addq %rdi, %rdx
cltq
movq %rdx, (%rcx,%rax,8)
leaq (%rdi,%r12), %rax
addq $0x2, %rax
cmpq %rdi, %rax
jbe 0x2a84c
cmpq %rax, 0x50(%r14)
jae 0x2a859
movq %rax, %rcx
shrq $0x3e, %rcx
shrq %rax
testq %rcx, %rcx
movl $0x0, %ecx
cmoveq %rax, %rcx
addq %rdi, %rcx
leaq (%r12,%rcx), %rsi
addq $0x2, %rsi
movq 0x58(%r14), %rdi
movq %rsi, 0x8(%rsp)
callq 0x4870
testq %rax, %rax
je 0x2a87c
movq %rax, 0x58(%r14)
movq 0x8(%rsp), %rcx
movq %rcx, 0x50(%r14)
movq 0x48(%r14), %rdi
jmp 0x2a85d
callq 0x4050
movl $0x4b, (%rax)
jmp 0x2a87c
movq 0x58(%r14), %rax
addq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x43c0
addq 0x48(%r14), %r12
movq %r12, 0x48(%r14)
movq 0x58(%r14), %rax
movb $0x0, (%rax,%r12)
movq 0x58(%r14), %rax
addq 0x48(%r14), %rax
movq 0x40(%r14), %rcx
movslq 0x60(%r14), %rdx
subq (%rcx,%rdx,8), %rax
movslq %r13d, %rcx
cmpq %rcx, %rax
cmovlel %r13d, %eax
leal 0x1(%rdx), %ecx
movl %ecx, 0x60(%r14)
xorl %ecx, %ecx
cmpl $0x2, %eax
setge %cl
leal (%rcx,%rcx,2), %eax
incl %eax
movl %eax, 0x68(%r14)
movq 0x10(%rsp), %rdi
callq 0x43db0
xorl 0x68(%r14), %eax
testb $0x4, %al
je 0x2a92b
movslq 0x30(%rbx), %rax
testq %rax, %rax
jle 0x2a90a
movq 0x18(%rbx), %rdx
movl $0xe, %esi
xorl %ecx, %ecx
cmpl $0x0, (%rdx,%rcx,4)
je 0x2a8fc
movq 0x28(%rbx), %rdi
cmpl $0x0, (%rdi,%rsi,4)
je 0x2a8fc
movq -0x8(%rdi,%rsi,4), %rdi
movq (%rdi), %r8
movq 0x8(%rdi), %rdi
movq (%rdi), %rdi
cmpq (%r8), %rdi
je 0x2a90c
incq %rcx
addq $0x18, %rsi
cmpq %rcx, %rax
jne 0x2a8d8
jmp 0x2a92b
xorl %ecx, %ecx
cmpl %eax, %ecx
jne 0x2a584
jmp 0x2a92b
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2a960
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x889cd(%rip), %rsi     # 0xb3310
leaq 0x889dd(%rip), %rdx     # 0xb3327
movl $0x1, %edi
xorl %eax, %eax
callq 0x9b31
movl $0x1, %edi
callq 0x4600