// File: /workspace/github_c_makefile_star2_O1/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, %rbx
callq 0x4510
movq (%rax), %r15
xorl %r14d, %r14d
movzbl (%rbx,%r14), %r12d
testb $0x8, (%r15,%r12,2)
jne 0x101a5
leal -0x2d(%r12), %eax
cmpl $0x2, %eax
jb 0x101a5
cmpl $0x2b, %r12d
jne 0x102c4
callq 0x40c0
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, 0xc(%rsp,%r14)
incq %r14
cmpq $0xc, %r14
jne 0x10185
movl $0xc, %r14d
movl $0xc, %eax
addl $-0xc, %eax
cmpl $-0xa, %eax
jb 0x10314
movb $0x0, 0xc(%rsp,%r14)
leaq 0xa95ed(%rip), %rdi     # 0xb97d0
callq 0x4750
cmpq $0x0, 0xa9608(%rip)     # 0xb97f8
jne 0x101ff
callq 0xfe5e
testl %eax, %eax
js 0x10308
leaq 0xa95ca(%rip), %rdi     # 0xb97d0
callq 0x4340
movq 0xa95e6(%rip), %rax     # 0xb97f8
movq %rax, (%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
je 0x102e6
leal -0x1(%rcx), %ebx
movb 0xc(%rsp), %al
testb %al, %al
movq %rcx, 0x18(%rsp)
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
je 0x10251
leaq 0xd(%rsp), %rcx
movzbl %al, %eax
xorl %r13d, %eax
imull $0x1000193, %eax, %r13d # imm = 0x1000193
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x1023b
andl %ebx, %r13d
movq (%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %r14d
movl %r13d, %r15d
movq %rsi, 0x20(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r12d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r12d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x102d2
testb $0x1, %al
jne 0x102ac
movq (%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
leaq 0xc(%rsp), %rsi
callq 0x46c0
movq 0x20(%rsp), %rsi
testl %eax, %eax
je 0x102d2
addl %r14d, %r15d
andl %ebx, %r15d
incl %r14d
cmpl %r13d, %r15d
jne 0x1026a
movq 0x18(%rsp), %rcx
movl %ecx, %r15d
jmp 0x102e9
cmpl $0x3a, %r12d
jne 0x10314
movl %r14d, %eax
jmp 0x101ca
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x18(%rsp), %rcx
cmovnel %ecx, %r15d
jmp 0x102e9
xorl %r15d, %r15d
cmpl %ecx, %r15d
jne 0x102f7
leaq 0xa85e3(%rip), %rax     # 0xb88d8
jmp 0x10316
movq (%rsp), %rax
movq 0x20(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rax
jmp 0x10316
leaq 0xa94c1(%rip), %rdi     # 0xb97d0
callq 0x4340
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq