// File: /workspace/github_c_makefile_star2_O2/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
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpq $0xc, %r15
je 0x60043
callq 0x6790
movq (%rax), %rax
movsbq (%r14,%r15), %r12
movzwl (%rax,%r12,2), %eax
testb $0x8, %al
jne 0x5fe67
movzbl %r12b, %eax
leal -0x2d(%rax), %ecx
cmpl $0x2, %ecx
jb 0x5fe67
cmpl $0x2b, %eax
jne 0x5fe7d
callq 0x6160
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, 0x14(%rsp,%r15)
incq %r15
jmp 0x5fe36
cmpl $0x3a, %eax
jne 0x60043
testq %r15, %r15
je 0x5ff3e
movb $0x0, 0x14(%rsp,%r15)
leaq 0x6888c(%rip), %rdi     # 0xc8728
callq 0x6ae0
cmpq $0x0, 0x68877(%rip)     # 0xc8720
jne 0x5ff6c
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x6470
movq %rax, 0x6885f(%rip)     # 0xc8720
testq %rax, %rax
je 0x6009f
leaq 0x2755c(%rip), %rdi     # 0x8742d
leaq 0x52d10(%rip), %rsi     # 0xb2be8
callq 0x5fbb6
leaq 0x2827a(%rip), %rdi     # 0x8815e
leaq 0x52d1d(%rip), %rsi     # 0xb2c08
callq 0x5fbb6
pushq $0x28
popq %rdi
callq 0x69d0
testq %rax, %rax
je 0x6009f
movq %rax, %rbx
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
andq $0x0, 0x18(%rax)
movq %rax, %rdi
callq 0x60784
leaq 0x54ec3(%rip), %rcx     # 0xb4de8
movl (%rcx), %ecx
testl %eax, %eax
je 0x5ff45
cmpl $0x4, %ecx
jge 0x60055
movq %rbx, %rdi
callq 0x68a0
jmp 0x5ff60
xorl %ebx, %ebx
jmp 0x60043
cmpl $0x5, %ecx
jge 0x6007b
movq 0x687fb(%rip), %rax     # 0xc8750
movq %rax, 0x20(%rbx)
movq %rbx, 0x687f0(%rip)     # 0xc8750
leaq 0x73d(%rip), %rdi       # 0x606a4
callq 0x7a010
leaq 0x687b5(%rip), %rdi     # 0xc8728
callq 0x64f0
movq 0x687a1(%rip), %rbx     # 0xc8720
movl (%rbx), %eax
testl %eax, %eax
je 0x60027
movq %rax, 0x20(%rsp)
leal -0x1(%rax), %r14d
leaq 0x14(%rsp), %rdi
callq 0x604ca
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 0x6000d
testb $0x1, %al
jne 0x5fffb
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movl %esi, %ebx
leaq 0x14(%rsp), %rsi
callq 0x6a50
movl %ebx, %esi
testl %eax, %eax
je 0x6000d
addl %r13d, %r14d
andl 0x4(%rsp), %r14d
incl %r13d
cmpl %esi, %r14d
jne 0x5ffb6
jmp 0x6002f
movl %r15d, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x20(%rsp), %rax
cmovnel %eax, %r14d
movq 0x8(%rsp), %rbx
jmp 0x6002a
xorl %r14d, %r14d
cmpl %eax, %r14d
jne 0x60038
leaq 0x52b92(%rip), %rbx     # 0xb2bc8
jmp 0x60043
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 0x52f7c(%rip), %rcx     # 0xb2fd8
movq (%rcx), %rdi
leaq 0x29043(%rip), %rsi     # 0x890a9
leaq 0x29012(%rip), %rdx     # 0x8907f
movl %eax, %ecx
xorl %eax, %eax
callq 0x6a90
jmp 0x5ff34
movq 0x52f56(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x29060(%rip), %rsi     # 0x890ec
leaq 0x28fec(%rip), %rdx     # 0x8907f
xorl %eax, %eax
callq 0x6a90
jmp 0x5ff4e
callq 0x63c0