// File: /workspace/github_c_makefile_star2_O3/samtools[P]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;

    // 1 byte schemes are likely windows C:/foo pathnames
    if (i <= 1 || i >= sizeof scheme) return NULL;
    scheme[i] = '\0';

    pthread_mutex_lock(&plugins_lock);
    if (!schemes && load_hfile_plugins() < 0) {
        pthread_mutex_unlock(&plugins_lock);
        return NULL;
    }
    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
callq 0x4510
movq (%rax), %r12
xorl %ebx, %ebx
xorl %r15d, %r15d
movzbl (%r14,%r15), %r13d
testb $0x8, (%r12,%r13,2)
jne 0xffc9
leal -0x2d(%r13), %eax
cmpl $0x2, %eax
jb 0xffc9
cmpl $0x2b, %r13d
jne 0xfff5
callq 0x40c0
movq (%rax), %rax
movb (%rax,%r13,4), %al
movb %al, 0xc(%rsp,%r15)
incq %r15
cmpq $0xc, %r15
jne 0xffae
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3a, %r13d
jne 0xffe3
cmpq $0x2, %r15
jae 0x10005
xorl %ebx, %ebx
jmp 0xffe3
movb $0x0, 0xc(%rsp,%r15)
leaq 0xa67be(%rip), %rdi     # 0xb67d0
callq 0x4750
cmpq $0x0, 0xa67d9(%rip)     # 0xb67f8
jne 0x1002e
callq 0xfc8e
testl %eax, %eax
js 0x10127
leaq 0xa679b(%rip), %rdi     # 0xb67d0
callq 0x4340
movq 0xa67b7(%rip), %rax     # 0xb67f8
movq %rax, (%rsp)
movl (%rax), %eax
testl %eax, %eax
je 0x100ff
movq %rax, 0x18(%rsp)
leal -0x1(%rax), %ebx
movb 0xc(%rsp), %al
movl $0x811c9dc5, %r12d      # imm = 0x811C9DC5
testb %al, %al
je 0x10080
leaq 0xd(%rsp), %rcx
movzbl %al, %eax
xorl %r12d, %eax
imull $0x1000193, %eax, %r12d # imm = 0x1000193
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x1006a
andl %ebx, %r12d
movq (%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %r13d
movl %r12d, %r14d
movq %rsi, 0x20(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r15d
leal (%r14,%r14), %ebp
andl $0x1e, %ebp
movl %r15d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x100eb
testb $0x1, %al
jne 0x100db
movq (%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
leaq 0xc(%rsp), %rsi
callq 0x46c0
movq 0x20(%rsp), %rsi
testl %eax, %eax
je 0x100eb
addl %r13d, %r14d
andl %ebx, %r14d
incl %r13d
cmpl %r12d, %r14d
jne 0x10099
jmp 0x10107
movl %ebp, %ecx
shrl %cl, %r15d
testb $0x3, %r15b
movq 0x18(%rsp), %rax
cmovnel %eax, %r14d
jmp 0x10102
xorl %r14d, %r14d
cmpl %eax, %r14d
jne 0x10113
leaq 0xa57fa(%rip), %rbx     # 0xb5908
jmp 0xffe3
movq (%rsp), %rax
movq 0x20(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rbx
jmp 0xffe3
leaq 0xa66a2(%rip), %rdi     # 0xb67d0
callq 0x4340
jmp 0x10001