// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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(s[i]) || s[i] == '+' || s[i] == '-' || s[i] == '.')
            scheme[i] = tolower(s[i]);
        else if (s[i] == ':') break;
        else return NULL;

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

    pthread_mutex_lock(&lockInit);
    if (! schemes) {
        // TODO Wrap this in a critical section for multi-threading
        load_hfile_plugins();
    }
    pthread_mutex_unlock(&lockInit);

    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 0x6790
movq (%rax), %r12
xorl %ebx, %ebx
xorl %r15d, %r15d
movsbq (%r14,%r15), %r13
movzwl (%r12,%r13,2), %eax
testb $0x8, %al
jne 0x6b7c8
movzbl %r13b, %eax
leal -0x2d(%rax), %ecx
cmpl $0x2, %ecx
jb 0x6b7c8
cmpl $0x2b, %eax
jne 0x6b7f4
callq 0x6160
movq (%rax), %rax
movb (%rax,%r13,4), %al
movb %al, 0x14(%rsp,%r15)
incq %r15
cmpq $0xc, %r15
jne 0x6b7a9
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3a, %eax
jne 0x6b7e2
testq %r15, %r15
je 0x6b8ba
movb $0x0, 0x14(%rsp,%r15)
leaq 0x68ef9(%rip), %rdi     # 0xd4708
callq 0x6ae0
cmpq $0x0, 0x68ee4(%rip)     # 0xd4700
jne 0x6b8e8
movl $0x1, %edi
movl $0x28, %esi
callq 0x6470
movq %rax, 0x68ec8(%rip)     # 0xd4700
testq %rax, %rax
je 0x6ba1f
leaq 0x2ccb7(%rip), %rdi     # 0x984ff
leaq 0x53399(%rip), %rsi     # 0xbebe8
callq 0x6b4f5
leaq 0x2db58(%rip), %rdi     # 0x993b3
leaq 0x533a6(%rip), %rsi     # 0xbec08
callq 0x6b4f5
movl $0x28, %edi
callq 0x69d0
testq %rax, %rax
je 0x6ba1f
movq %rax, %rbx
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, %rdi
callq 0x6c142
leaq 0x55527(%rip), %rcx     # 0xc0dc8
movl (%rcx), %ecx
testl %eax, %eax
je 0x6b8c1
cmpl $0x4, %ecx
jge 0x6b9ef
movq %rbx, %rdi
callq 0x68a0
jmp 0x6b8dc
xorl %ebx, %ebx
jmp 0x6b7e2
cmpl $0x5, %ecx
jge 0x6ba15
movq 0x68e5f(%rip), %rax     # 0xd4730
movq %rax, 0x20(%rbx)
movq %rbx, 0x68e54(%rip)     # 0xd4730
leaq 0x77b(%rip), %rdi       # 0x6c05e
callq 0x8ba60
leaq 0x68e19(%rip), %rdi     # 0xd4708
callq 0x64f0
movq 0x68e05(%rip), %rax     # 0xd4700
movq %rax, 0x8(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
je 0x6b941
leal -0x1(%rcx), %esi
movsbl 0x14(%rsp), %r12d
testl %r12d, %r12d
movq %rcx, 0x20(%rsp)
je 0x6b949
movb 0x15(%rsp), %al
testb %al, %al
je 0x6b94c
leaq 0x16(%rsp), %rcx
movl %r12d, %edx
shll $0x5, %edx
subl %r12d, %edx
movsbl %al, %r12d
addl %edx, %r12d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x6b926
jmp 0x6b94c
xorl %r14d, %r14d
jmp 0x6b9c9
xorl %r12d, %r12d
andl %esi, %r12d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rbx
movl $0x1, %r13d
movl %r12d, %r14d
movl %esi, 0x10(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%rbx,%rax,4), %r15d
leal (%r14,%r14), %ebp
andl $0x1e, %ebp
movl %r15d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x6b9b7
testb $0x1, %al
jne 0x6b9a7
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x14(%rsp), %rsi
callq 0x6a50
movl 0x10(%rsp), %esi
testl %eax, %eax
je 0x6b9b7
addl %r13d, %r14d
andl %esi, %r14d
incl %r13d
cmpl %r12d, %r14d
jne 0x6b965
jmp 0x6b9ce
movl %ebp, %ecx
shrl %cl, %r15d
testb $0x3, %r15b
movq 0x20(%rsp), %rcx
cmovnel %ecx, %r14d
cmpl %ecx, %r14d
jne 0x6b9da
leaq 0x531f3(%rip), %rbx     # 0xbebc8
jmp 0x6b7e2
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rbx
jmp 0x6b7e2
movq 0x535e2(%rip), %rcx     # 0xbefd8
movq (%rcx), %rdi
leaq 0x2e929(%rip), %rsi     # 0x9a329
leaq 0x2e8f8(%rip), %rdx     # 0x9a2ff
movl %eax, %ecx
xorl %eax, %eax
callq 0x6a90
jmp 0x6b8b0
callq 0x7cf1
jmp 0x6b8ca
callq 0x63c0