// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hts.c
// Function: reg2bins_wide
static inline int reg2bins_wide(int64_t beg, int64_t end, hts_itr_t *itr, int min_shift, int n_lvls, bidx_t *bidx)
{
    khint_t i;
    hts_pos_t max_shift = 3 * n_lvls + min_shift;
    --end;
    if (beg < 0) beg = 0;
    for (i = kh_begin(bidx); i != kh_end(bidx); i++) {
        if (!kh_exist(bidx, i)) continue;
        hts_pos_t bin = (hts_pos_t) kh_key(bidx, i);
        int level = hts_bin_level(bin);
        if (level > n_lvls) continue; // Dodgy index?
        hts_pos_t first = hts_bin_first(level);
        hts_pos_t beg_at_level = first + (beg >> (max_shift - 3 * level));
        hts_pos_t end_at_level = first + (end >> (max_shift - 3 * level));
        if (beg_at_level <= bin && bin <= end_at_level) {
            assert(itr->bins.n < itr->bins.m);
            itr->bins.a[itr->bins.n++] = bin;
        }
    }
    return itr->bins.n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq %r9, -0x28(%rbp)
imull $0x3, -0x20(%rbp), %eax
addl -0x1c(%rbp), %eax
cltq
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jge 0x287f7
movq $0x0, -0x8(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
je 0x28951
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0x2c(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x28837
jmp 0x28943
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl %eax, %edi
callq 0x27950
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x20(%rbp), %eax
jle 0x28864
jmp 0x28943
movl -0x44(%rbp), %ecx
shll %ecx
addl -0x44(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl $0x7, %ecx
cltd
idivl %ecx
cltq
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x8(%rbp), %rdx
movq -0x38(%rbp), %rcx
imull $0x3, -0x44(%rbp), %esi
movslq %esi, %rsi
subq %rsi, %rcx
sarq %cl, %rdx
movq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rdx
movq -0x38(%rbp), %rcx
imull $0x3, -0x44(%rbp), %esi
movslq %esi, %rsi
subq %rsi, %rcx
sarq %cl, %rdx
movq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jg 0x28941
movq -0x40(%rbp), %rax
cmpq -0x60(%rbp), %rax
jg 0x28941
movq -0x18(%rbp), %rax
movl 0x80(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x84(%rcx), %eax
jge 0x288f6
jmp 0x28915
leaq 0xc8373(%rip), %rdi     # 0xf0c70
leaq 0xc7cd4(%rip), %rsi     # 0xf05d8
movl $0xc39, %edx            # imm = 0xC39
leaq 0xc83c1(%rip), %rcx     # 0xf0cd1
callq 0x42e0
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x18(%rbp), %rsi
movl 0x80(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x80(%rsi)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x28943
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x287fe
movq -0x18(%rbp), %rax
movl 0x80(%rax), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)