// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/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;

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

    pthread_mutex_lock(&plugins_lock);
    if (! schemes) load_hfile_plugins();
    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
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpq $0xc, %r15
je 0x3a991
movzbl (%r14,%r15), %r12d
callq 0x4580
movq (%rax), %rax
testb $0x8, (%rax,%r12,2)
jne 0x3a7b4
leal -0x2d(%r12), %eax
cmpl $0x2, %eax
jb 0x3a7b4
cmpl $0x2b, %r12d
jne 0x3a7ca
callq 0x40f0
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, 0x14(%rsp,%r15)
incq %r15
jmp 0x3a786
cmpl $0x3a, %r12d
jne 0x3a991
testq %r15, %r15
je 0x3a88c
movb $0x0, 0x14(%rsp,%r15)
leaq 0x1cdce(%rip), %rdi     # 0x575b8
callq 0x47a0
cmpq $0x0, 0x1cdb9(%rip)     # 0x575b0
jne 0x3a8ba
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x4370
movq %rax, 0x1cda1(%rip)     # 0x575b0
testq %rax, %rax
je 0x3a9ed
leaq 0x9488(%rip), %rdi      # 0x43ca7
leaq 0x1c402(%rip), %rsi     # 0x56c28
callq 0x3a506
leaq 0xb639(%rip), %rdi      # 0x45e6b
leaq 0x1c40f(%rip), %rsi     # 0x56c48
callq 0x3a506
pushq $0x28
popq %rdi
callq 0x46f0
testq %rax, %rax
je 0x3a9ed
movq %rax, %rbx
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
andq $0x0, 0x18(%rax)
movq %rax, %rdi
callq 0x3b0f4
leaq 0x1ccd5(%rip), %rcx     # 0x57548
movl (%rcx), %ecx
testl %eax, %eax
je 0x3a893
cmpl $0x4, %ecx
jge 0x3a9a3
movq %rbx, %rdi
callq 0x4600
jmp 0x3a8ae
xorl %ebx, %ebx
jmp 0x3a991
cmpl $0x5, %ecx
jge 0x3a9c9
movq 0x1cd3d(%rip), %rax     # 0x575e0
movq %rax, 0x20(%rbx)
movq %rbx, 0x1cd32(%rip)     # 0x575e0
leaq 0x73d(%rip), %rdi       # 0x3aff2
callq 0x40380
leaq 0x1ccf7(%rip), %rdi     # 0x575b8
callq 0x43f0
movq 0x1cce3(%rip), %rbx     # 0x575b0
movl (%rbx), %eax
testl %eax, %eax
je 0x3a975
movq %rax, 0x20(%rsp)
leal -0x1(%rax), %r14d
leaq 0x14(%rsp), %rdi
callq 0x3ae18
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 0x3a95b
testb $0x1, %al
jne 0x3a949
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movl %esi, %ebx
leaq 0x14(%rsp), %rsi
callq 0x4750
movl %ebx, %esi
testl %eax, %eax
je 0x3a95b
addl %r13d, %r14d
andl 0x4(%rsp), %r14d
incl %r13d
cmpl %esi, %r14d
jne 0x3a904
jmp 0x3a97d
movl %r15d, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x20(%rsp), %rax
cmovnel %eax, %r14d
movq 0x8(%rsp), %rbx
jmp 0x3a978
xorl %r14d, %r14d
cmpl %eax, %r14d
jne 0x3a986
leaq 0x1c284(%rip), %rbx     # 0x56c08
jmp 0x3a991
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 0x1c626(%rip), %rcx     # 0x56fd0
movq (%rcx), %rdi
leaq 0xcac5(%rip), %rsi      # 0x47479
leaq 0xca94(%rip), %rdx      # 0x4744f
movl %eax, %ecx
xorl %eax, %eax
callq 0x4770
jmp 0x3a882
movq 0x1c600(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0xcae2(%rip), %rsi      # 0x474bc
leaq 0xca6e(%rip), %rdx      # 0x4744f
xorl %eax, %eax
callq 0x4770
jmp 0x3a89c
callq 0x42f0