// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/hfile.c
// Function: find_scheme_handler
static const struct hFILE_scheme_handler *find_scheme_handler(const char *s)
{
    static const struct hFILE_scheme_handler unknown_scheme =
        { hopen_unknown_scheme, hfile_always_local, "built-in", 0 };

    char scheme[12];
    int i;

    for (i = 0; i < sizeof scheme; i++)
        if (isalnum_c(s[i]) || s[i] == '+' || s[i] == '-' || s[i] == '.')
            scheme[i] = tolower_c(s[i]);
        else if (s[i] == ':') break;
        else return NULL;

    if (i == 0 || i >= sizeof scheme) return NULL;
    scheme[i] = '\0';

    pthread_mutex_lock(&plugins_lock);
    if (! schemes) load_hfile_plugins();
    pthread_mutex_unlock(&plugins_lock);

    khint_t k = kh_get(scheme_string, schemes, scheme);
    return (k != kh_end(schemes))? kh_value(schemes, k) : &unknown_scheme;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpq $0xc, %r15
je 0x24895
movzbl (%r14,%r15), %r12d
callq 0x3410
movq (%rax), %rax
testb $0x8, (%rax,%r12,2)
jne 0x246b8
leal -0x2d(%r12), %eax
cmpl $0x2, %eax
jb 0x246b8
cmpl $0x2b, %r12d
jne 0x246ce
callq 0x36a0
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, 0x14(%rsp,%r15)
incq %r15
jmp 0x2468a
cmpl $0x3a, %r12d
jne 0x24895
testq %r15, %r15
je 0x24790
movb $0x0, 0x14(%rsp,%r15)
leaq 0x2ee8a(%rip), %rdi     # 0x53578
callq 0x37b0
cmpq $0x0, 0x2ee75(%rip)     # 0x53570
jne 0x247be
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x36b0
movq %rax, 0x2ee5d(%rip)     # 0x53570
testq %rax, %rax
je 0x248f1
leaq 0x1bcd3(%rip), %rdi     # 0x403f6
leaq 0x2e50e(%rip), %rsi     # 0x52c38
callq 0x2440a
leaq 0x1caf3(%rip), %rdi     # 0x41229
leaq 0x2e51b(%rip), %rsi     # 0x52c58
callq 0x2440a
pushq $0x28
popq %rdi
callq 0x3240
testq %rax, %rax
je 0x248f1
movq %rax, %rbx
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
andq $0x0, 0x18(%rax)
movq %rax, %rdi
callq 0x24ff8
leaq 0x2ed19(%rip), %rcx     # 0x53490
movl (%rcx), %ecx
testl %eax, %eax
je 0x24797
cmpl $0x4, %ecx
jge 0x248a7
movq %rbx, %rdi
callq 0x3370
jmp 0x247b2
xorl %ebx, %ebx
jmp 0x24895
cmpl $0x5, %ecx
jge 0x248cd
movq 0x2edf9(%rip), %rax     # 0x535a0
movq %rax, 0x20(%rbx)
movq %rbx, 0x2edee(%rip)     # 0x535a0
leaq 0x73d(%rip), %rdi       # 0x24ef6
callq 0x3e980
leaq 0x2edb3(%rip), %rdi     # 0x53578
callq 0x3850
movq 0x2ed9f(%rip), %rbx     # 0x53570
movl (%rbx), %eax
testl %eax, %eax
je 0x24879
movq %rax, 0x20(%rsp)
leal -0x1(%rax), %r14d
leaq 0x14(%rsp), %rdi
callq 0x24d1c
movl %eax, %esi
movl %r14d, 0x4(%rsp)
andl %r14d, %esi
movq %rbx, 0x8(%rsp)
movq 0x10(%rbx), %rbp
pushq $0x1
popq %r13
movl %esi, %r14d
movl %r14d, %eax
shrl $0x4, %eax
movl (%rbp,%rax,4), %r12d
leal (%r14,%r14), %r15d
andl $0x1e, %r15d
movl %r12d, %eax
movl %r15d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x2485f
testb $0x1, %al
jne 0x2484d
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movl %esi, %ebx
leaq 0x14(%rsp), %rsi
callq 0x3630
movl %ebx, %esi
testl %eax, %eax
je 0x2485f
addl %r13d, %r14d
andl 0x4(%rsp), %r14d
incl %r13d
cmpl %esi, %r14d
jne 0x24808
jmp 0x24881
movl %r15d, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x20(%rsp), %rax
cmovnel %eax, %r14d
movq 0x8(%rsp), %rbx
jmp 0x2487c
xorl %r14d, %r14d
cmpl %eax, %r14d
jne 0x2488a
leaq 0x2e390(%rip), %rbx     # 0x52c18
jmp 0x24895
movq 0x20(%rbx), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rbx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e73a(%rip), %rcx     # 0x52fe8
movq (%rcx), %rdi
leaq 0x1debe(%rip), %rsi     # 0x42776
leaq 0x1de8d(%rip), %rdx     # 0x4274c
movl %eax, %ecx
xorl %eax, %eax
callq 0x37f0
jmp 0x24786
movq 0x2e714(%rip), %rax     # 0x52fe8
movq (%rax), %rdi
leaq 0x1dedb(%rip), %rsi     # 0x427b9
leaq 0x1de67(%rip), %rdx     # 0x4274c
xorl %eax, %eax
callq 0x37f0
jmp 0x247a0
callq 0x3100