// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_seek
int bcf_sr_seek(bcf_srs_t *readers, const char *seq, hts_pos_t pos)
{
    if ( !readers->regions ) return 0;
    bcf_sr_sort_reset(&BCF_SR_AUX(readers)->sort);
    if ( !seq && !pos )
    {
        // seek to start
        bcf_sr_seek_start(readers);
        return 0;
    }

    int i, nret = 0;

    // Need to position both the readers and the regions. The latter is a bit of a mess
    // because we can have in memory or external regions. The safe way is:
    //  - reset all regions as if they were not read from at all (bcf_sr_seek_start)
    //  - find the requested iseq (stored in the seq_hash)
    //  - position regions to the requested position (bcf_sr_regions_overlap)
    bcf_sr_seek_start(readers);
    if ( khash_str2int_get(readers->regions->seq_hash, seq, &i)>=0 ) readers->regions->iseq = i;
    _bcf_sr_regions_overlap(readers->regions, seq, pos, pos, 0);

    for (i=0; i<readers->nreaders; i++)
    {
        nret += _reader_seek(&readers->readers[i],seq,pos,MAX_CSI_COOR-1);
    }
    return nret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
xorl %ebp, %ebp
cmpq $0x0, 0x48(%rdi)
je 0x2c3af
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r15
movq 0x88(%rdi), %rdi
callq 0x93c27
movq %r13, %rax
orq %r14, %rax
movq 0x48(%r15), %rax
movl 0x98(%rax), %ecx
je 0x2c248
testl %ecx, %ecx
jle 0x2c1bf
movq 0x80(%rax), %rdx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %esi, %esi
movl $0xffffffff, 0x10(%rdx,%rsi) # imm = 0xFFFFFFFF
addq $0x18, %rsi
cmpq %rsi, %rcx
jne 0x2c1ae
movl $0x0, 0x9c(%rax)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0xa0(%rax)
movl $0xffffffff, 0xb0(%rax) # imm = 0xFFFFFFFF
movdqu %xmm0, 0xb8(%rax)
movq 0x48(%r15), %rdi
movq 0x88(%rdi), %rdx
xorl %r12d, %r12d
testq %rdx, %rdx
je 0x2c343
movl (%rdx), %eax
testl %eax, %eax
je 0x2c33b
movq %r14, 0x20(%rsp)
movq %rax, 0x10(%rsp)
leal -0x1(%rax), %esi
movb (%r13), %cl
testb %cl, %cl
movq %r13, (%rsp)
movq %rdi, 0x18(%rsp)
je 0x2c29b
leaq 0x1(%r13), %rax
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r13d, %ecx
imull $0x1000193, %ecx, %r13d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x2c230
jmp 0x2c2a1
testl %ecx, %ecx
jle 0x2c26e
movq 0x80(%rax), %rdx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %esi, %esi
movl $0xffffffff, 0x10(%rdx,%rsi) # imm = 0xFFFFFFFF
addq $0x18, %rsi
cmpq %rsi, %rcx
jne 0x2c25d
movl $0x0, 0x9c(%rax)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0xa0(%rax)
movl $0xffffffff, 0xb0(%rax) # imm = 0xFFFFFFFF
movdqu %xmm0, 0xb8(%rax)
jmp 0x2c3af
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
andl %esi, %r13d
movq 0x10(%rdx), %rdi
movl $0x1, %ebx
movl %r13d, %r12d
movq %rdx, 0x30(%rsp)
movl %esi, 0xc(%rsp)
movq %rdi, 0x28(%rsp)
movl %r12d, %eax
shrl $0x4, %eax
movl (%rdi,%rax,4), %r14d
leal (%r12,%r12), %ebp
andl $0x1e, %ebp
movl %r14d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x2c31b
testb $0x1, %al
jne 0x2c304
movq 0x18(%rdx), %rax
movl %r12d, %ecx
movq (%rax,%rcx,8), %rdi
movq (%rsp), %rsi
callq 0x46f0
movq 0x28(%rsp), %rdi
movl 0xc(%rsp), %esi
movq 0x30(%rsp), %rdx
testl %eax, %eax
je 0x2c31b
addl %ebx, %r12d
andl %esi, %r12d
incl %ebx
cmpl %r13d, %r12d
jne 0x2c2be
movq 0x10(%rsp), %rax
movl %eax, %r12d
jmp 0x2c32d
movl %ebp, %ecx
shrl %cl, %r14d
testb $0x3, %r14b
movq 0x10(%rsp), %rax
cmovnel %eax, %r12d
movq 0x20(%rsp), %r14
movq (%rsp), %r13
movq 0x18(%rsp), %rdi
cmpl %eax, %r12d
jne 0x2c345
xorl %r12d, %r12d
jmp 0x2c352
movq 0x20(%rdx), %rax
movl %r12d, %ecx
movl (%rax,%rcx,4), %eax
movb $0x1, %r12b
testb %r12b, %r12b
je 0x2c35d
movl %eax, 0x9c(%rdi)
xorl %ebp, %ebp
movq %r13, %rsi
movq %r14, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x2c3c0
cmpl $0x0, 0x30(%r15)
jle 0x2c3af
movq %r14, %r12
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x28(%r15), %rdi
addq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movabsq $0xffffffffffe, %rcx    # imm = 0xFFFFFFFFFFE
callq 0x2c5fe
addl %eax, %ebp
incq %r14
movslq 0x30(%r15), %rax
addq $0x60, %rbx
cmpq %rax, %r14
jl 0x2c381
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq