// File: /workspace/github_c_makefile_star2_O3/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 0x2b574
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x88(%rdi), %rdi
callq 0x92231
movq %r14, %rax
orq %rbx, %rax
movq 0x48(%r15), %rax
movl 0x98(%rax), %edx
je 0x2b32a
movq %r14, 0x8(%rsp)
movq %rbx, 0x28(%rsp)
testl %edx, %edx
jle 0x2b296
movq 0x80(%rax), %rcx
leal 0x3(%rdx), %esi
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %esi
shlq $0x5, %rsi
leaq (%rsi,%rsi,2), %rdx
movdqa 0x87a38(%rip), %xmm1    # 0xb2bf0
movdqa 0x87a40(%rip), %xmm2    # 0xb2c00
xorl %esi, %esi
movdqa 0x87a46(%rip), %xmm3    # 0xb2c10
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x87a46(%rip), %xmm5    # 0xb2c20
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x2b217
movl $0xffffffff, 0x10(%rcx,%rsi) # imm = 0xFFFFFFFF
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x2b22e
movl $0xffffffff, 0x28(%rcx,%rsi) # imm = 0xFFFFFFFF
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %edi
testb $0x1, %dil
je 0x2b26e
movl $0xffffffff, 0x40(%rcx,%rsi) # imm = 0xFFFFFFFF
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x2b281
movl $0xffffffff, 0x58(%rcx,%rsi) # imm = 0xFFFFFFFF
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x60, %rsi
cmpq %rsi, %rdx
jne 0x2b1da
movl $0x0, 0x9c(%rax)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0xa0(%rax)
movl $0xffffffff, 0xb0(%rax) # imm = 0xFFFFFFFF
movdqu %xmm0, 0xb8(%rax)
movq %r15, 0x20(%rsp)
movq 0x48(%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x88(%rax), %rax
movq %rax, (%rsp)
testq %rax, %rax
je 0x2b50e
movq (%rsp), %rax
movl (%rax), %eax
testl %eax, %eax
je 0x2b467
movq %rax, 0x18(%rsp)
leal -0x1(%rax), %r15d
movq 0x8(%rsp), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x2b46f
incq %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 0x2b30f
jmp 0x2b475
testl %edx, %edx
jle 0x2b43a
movq 0x80(%rax), %rcx
leal 0x3(%rdx), %esi
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %esi
shlq $0x5, %rsi
leaq (%rsi,%rsi,2), %rdx
movdqa 0x87894(%rip), %xmm1    # 0xb2bf0
movdqa 0x8789c(%rip), %xmm2    # 0xb2c00
xorl %esi, %esi
movdqa 0x878a2(%rip), %xmm3    # 0xb2c10
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x878a2(%rip), %xmm5    # 0xb2c20
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x2b3bb
movl $0xffffffff, 0x10(%rcx,%rsi) # imm = 0xFFFFFFFF
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x2b3d2
movl $0xffffffff, 0x28(%rcx,%rsi) # imm = 0xFFFFFFFF
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %edi
testb $0x1, %dil
je 0x2b412
movl $0xffffffff, 0x40(%rcx,%rsi) # imm = 0xFFFFFFFF
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x2b425
movl $0xffffffff, 0x58(%rcx,%rsi) # imm = 0xFFFFFFFF
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x60, %rsi
cmpq %rsi, %rdx
jne 0x2b37e
movl $0x0, 0x9c(%rax)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0xa0(%rax)
movl $0xffffffff, 0xb0(%rax) # imm = 0xFFFFFFFF
movdqu %xmm0, 0xb8(%rax)
jmp 0x2b574
xorl %r12d, %r12d
jmp 0x2b4f0
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
andl %r15d, %r13d
movq (%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %ebx
movl %r13d, %r12d
movq %rsi, 0x30(%rsp)
movl %r12d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r14d
leal (%r12,%r12), %ebp
andl $0x1e, %ebp
movl %r14d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x2b4de
testb $0x1, %al
jne 0x2b4cf
movq (%rsp), %rax
movq 0x18(%rax), %rax
movl %r12d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x8(%rsp), %rsi
callq 0x46f0
movq 0x30(%rsp), %rsi
testl %eax, %eax
je 0x2b4de
addl %ebx, %r12d
andl %r15d, %r12d
incl %ebx
cmpl %r13d, %r12d
jne 0x2b48d
jmp 0x2b50e
movl %ebp, %ecx
shrl %cl, %r14d
testb $0x3, %r14b
movq 0x18(%rsp), %rax
cmovnel %eax, %r12d
cmpl %eax, %r12d
je 0x2b50e
movq (%rsp), %rax
movq 0x20(%rax), %rax
movl %r12d, %ecx
movl (%rax,%rcx,4), %eax
movq 0x10(%rsp), %rcx
movl %eax, 0x9c(%rcx)
xorl %ebp, %ebp
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %r15
movq %r15, %rsi
movq 0x28(%rsp), %r13
movq %r13, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x2b585
movq 0x20(%rsp), %r12
cmpl $0x0, 0x30(%r12)
jle 0x2b574
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x28(%r12), %rdi
addq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movabsq $0xffffffffffe, %rcx    # imm = 0xFFFFFFFFFFE
callq 0x2b7c6
addl %eax, %ebp
incq %r14
movslq 0x30(%r12), %rax
addq $0x60, %rbx
cmpq %rax, %r14
jl 0x2b544
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq