// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_regions_overlap
static int _bcf_sr_regions_overlap(bcf_sr_regions_t *reg, const char *seq, hts_pos_t start, hts_pos_t end, int missed_reg_handler)
{
    int iseq;
    if ( khash_str2int_get(reg->seq_hash, seq, &iseq)<0 ) return -1;    // no such sequence
    if ( missed_reg_handler && !reg->missed_reg_handler ) missed_reg_handler = 0;

    if ( reg->prev_seq==-1 || iseq!=reg->prev_seq || reg->prev_start > start ) // new chromosome or after a seek
    {
        // flush regions left on previous chromosome
        if ( missed_reg_handler && reg->prev_seq!=-1 && reg->iseq!=-1 )
            bcf_sr_regions_flush(reg);

        bcf_sr_regions_seek(reg, seq);
        reg->start = reg->end = -1;
    }
    if ( reg->prev_seq==iseq && reg->iseq!=iseq ) return -2;    // no more regions on this chromosome
    reg->prev_seq = reg->iseq;
    reg->prev_start = start;

    while ( iseq==reg->iseq && reg->end < start )
    {
        if ( bcf_sr_regions_next(reg) < 0 ) return -2;  // no more regions left
        if ( reg->iseq != iseq ) return -1; // does not overlap any regions
        if ( missed_reg_handler && reg->end < start ) reg->missed_reg_handler(reg, reg->missed_reg_data);
    }
    if ( reg->start <= end ) return 0;    // region overlap
    return -1;  // no overlap
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x3a580
cmpl $0x0, %eax
jge 0x3a655
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3a7ef
cmpl $0x0, -0x2c(%rbp)
je 0x3a66d
movq -0x10(%rbp), %rax
cmpq $0x0, 0x70(%rax)
jne 0x3a66d
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0xb0(%rax)
je 0x3a69a
movl -0x30(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xb0(%rcx), %eax
jne 0x3a69a
movq -0x10(%rbp), %rax
movq 0xb8(%rax), %rax
cmpq -0x20(%rbp), %rax
jle 0x3a6ee
cmpl $0x0, -0x2c(%rbp)
je 0x3a6c3
movq -0x10(%rbp), %rax
cmpl $-0x1, 0xb0(%rax)
je 0x3a6c3
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x9c(%rax)
je 0x3a6c3
movq -0x10(%rbp), %rdi
callq 0x3bce0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3b660
movq -0x10(%rbp), %rax
movq $-0x1, 0xa8(%rax)
movq -0x10(%rbp), %rax
movq $-0x1, 0xa0(%rax)
movq -0x10(%rbp), %rax
movl 0xb0(%rax), %eax
cmpl -0x30(%rbp), %eax
jne 0x3a718
movq -0x10(%rbp), %rax
movl 0x9c(%rax), %eax
cmpl -0x30(%rbp), %eax
je 0x3a718
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x3a7ef
movq -0x10(%rbp), %rax
movl 0x9c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xb0(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xb8(%rax)
movl -0x30(%rbp), %ecx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpl 0x9c(%rdx), %ecx
movb %al, -0x31(%rbp)
jne 0x3a764
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
cmpq -0x20(%rbp), %rax
setl %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x3a76d
jmp 0x3a7ce
movq -0x10(%rbp), %rdi
callq 0x3b780
cmpl $0x0, %eax
jge 0x3a784
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x3a7ef
movq -0x10(%rbp), %rax
movl 0x9c(%rax), %eax
cmpl -0x30(%rbp), %eax
je 0x3a79c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3a7ef
cmpl $0x0, -0x2c(%rbp)
je 0x3a7c9
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
cmpq -0x20(%rbp), %rax
jge 0x3a7c9
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x78(%rcx), %rsi
callq *%rax
jmp 0x3a73b
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
cmpq -0x28(%rbp), %rax
jg 0x3a7e8
movl $0x0, -0x4(%rbp)
jmp 0x3a7ef
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)