// File: /workspace/github_c_makefile_star2_O1/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, %rbx
callq 0x6790
movq (%rax), %r15
xorl %r14d, %r14d
movsbq (%rbx,%r14), %r12
movzwl (%r15,%r12,2), %eax
testb $0x8, %al
jne 0x6b7b6
movzbl %r12b, %eax
leal -0x2d(%rax), %ecx
cmpl $0x2, %ecx
jb 0x6b7b6
cmpl $0x2b, %eax
jne 0x6b89f
callq 0x6160
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, 0x14(%rsp,%r14)
incq %r14
cmpq $0xc, %r14
jne 0x6b793
movl $0xc, %r14d
movl $0xc, %eax
addl $-0xc, %eax
cmpl $-0xb, %eax
jb 0x6b8ac
movb $0x0, 0x14(%rsp,%r14)
leaq 0x68f14(%rip), %rdi     # 0xd4708
callq 0x6ae0
cmpq $0x0, 0x68eff(%rip)     # 0xd4700
jne 0x6b8da
movl $0x1, %edi
movl $0x28, %esi
callq 0x6470
movq %rax, 0x68ee3(%rip)     # 0xd4700
testq %rax, %rax
je 0x6ba20
leaq 0x2cbde(%rip), %rdi     # 0x9840b
leaq 0x533b4(%rip), %rsi     # 0xbebe8
callq 0x6b4ec
leaq 0x2d968(%rip), %rdi     # 0x991a8
leaq 0x533c1(%rip), %rsi     # 0xbec08
callq 0x6b4ec
movl $0x28, %edi
callq 0x69d0
testq %rax, %rax
je 0x6ba20
movq %rax, %rbx
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, %rdi
callq 0x6c186
leaq 0x55542(%rip), %rcx     # 0xc0dc8
movl (%rcx), %ecx
testl %eax, %eax
je 0x6b8b3
cmpl $0x4, %ecx
jge 0x6b9f0
movq %rbx, %rdi
callq 0x68a0
jmp 0x6b8ce
cmpl $0x3a, %eax
jne 0x6b8ac
movl %r14d, %eax
jmp 0x6b7db
xorl %eax, %eax
jmp 0x6b9e1
cmpl $0x5, %ecx
jge 0x6ba16
movq 0x68e6d(%rip), %rax     # 0xd4730
movq %rax, 0x20(%rbx)
movq %rbx, 0x68e62(%rip)     # 0xd4730
leaq 0x7ce(%rip), %rdi       # 0x6c0a3
callq 0x8bf40
leaq 0x68e27(%rip), %rdi     # 0xd4708
callq 0x64f0
movq 0x68e13(%rip), %rax     # 0xd4700
movq %rax, 0x8(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
je 0x6b933
leal -0x1(%rcx), %esi
movsbl 0x14(%rsp), %r13d
testl %r13d, %r13d
movq %rcx, 0x20(%rsp)
je 0x6b93b
movb 0x15(%rsp), %al
testb %al, %al
je 0x6b93e
leaq 0x16(%rsp), %rcx
movl %r13d, %edx
shll $0x5, %edx
subl %r13d, %edx
movsbl %al, %r13d
addl %edx, %r13d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x6b918
jmp 0x6b93e
xorl %r15d, %r15d
jmp 0x6b9c3
xorl %r13d, %r13d
andl %esi, %r13d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rbx
movl $0x1, %r14d
movl %r13d, %r15d
movl %esi, 0x10(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rbx,%rax,4), %r12d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r12d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x6b9b1
testb $0x1, %al
jne 0x6b999
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x14(%rsp), %rsi
callq 0x6a50
movl 0x10(%rsp), %esi
testl %eax, %eax
je 0x6b9b1
addl %r14d, %r15d
andl %esi, %r15d
incl %r14d
cmpl %r13d, %r15d
jne 0x6b957
movq 0x20(%rsp), %rcx
movl %ecx, %r15d
jmp 0x6b9c3
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x20(%rsp), %rcx
cmovnel %ecx, %r15d
cmpl %ecx, %r15d
jne 0x6b9d1
leaq 0x531f9(%rip), %rax     # 0xbebc8
jmp 0x6b9e1
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x535e1(%rip), %rcx     # 0xbefd8
movq (%rcx), %rdi
leaq 0x2e6f8(%rip), %rsi     # 0x9a0f9
leaq 0x2e6c7(%rip), %rdx     # 0x9a0cf
movl %eax, %ecx
xorl %eax, %eax
callq 0x6a90
jmp 0x6b895
callq 0x7d45
jmp 0x6b8bc
callq 0x63c0