// File: /workspace/github_cpp_makefile_star2_O3/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
callq 0x4580
movq (%rax), %r12
xorl %ebx, %ebx
xorl %r15d, %r15d
movzbl (%r14,%r15), %r13d
testb $0x8, (%r12,%r13,2)
jne 0x4788c
leal -0x2d(%r13), %eax
cmpl $0x2, %eax
jb 0x4788c
cmpl $0x2b, %r13d
jne 0x478b8
callq 0x4100
movq (%rax), %rax
movb (%rax,%r13,4), %al
movb %al, 0x14(%rsp,%r15)
incq %r15
cmpq $0xc, %r15
jne 0x47871
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3a, %r13d
jne 0x478a6
testq %r15, %r15
je 0x4797f
movb $0x0, 0x14(%rsp,%r15)
leaq 0x1acf4(%rip), %rdi     # 0x625c8
callq 0x47a0
cmpq $0x0, 0x1acdf(%rip)     # 0x625c0
jne 0x479ad
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x1acc3(%rip)     # 0x625c0
testq %rax, %rax
je 0x47ae4
leaq 0x935c(%rip), %rdi      # 0x50c69
leaq 0x1a2b4(%rip), %rsi     # 0x61bc8
callq 0x475bd
leaq 0xb7d0(%rip), %rdi      # 0x530f0
leaq 0x1a2c1(%rip), %rsi     # 0x61be8
callq 0x475bd
movl $0x28, %edi
callq 0x4700
testq %rax, %rax
je 0x47ae4
movq %rax, %rbx
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, %rdi
callq 0x4822a
leaq 0x1abea(%rip), %rcx     # 0x62550
movl (%rcx), %ecx
testl %eax, %eax
je 0x47986
cmpl $0x4, %ecx
jge 0x47ab4
movq %rbx, %rdi
callq 0x4610
jmp 0x479a1
xorl %ebx, %ebx
jmp 0x478a6
cmpl $0x5, %ecx
jge 0x47ada
movq 0x1ac5a(%rip), %rax     # 0x625f0
movq %rax, 0x20(%rbx)
movq %rbx, 0x1ac4f(%rip)     # 0x625f0
leaq 0x77b(%rip), %rdi       # 0x48123
callq 0x4df50
leaq 0x1ac14(%rip), %rdi     # 0x625c8
callq 0x43f0
movq 0x1ac00(%rip), %rax     # 0x625c0
movq %rax, 0x8(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
je 0x47a06
leal -0x1(%rcx), %esi
movsbl 0x14(%rsp), %r12d
testl %r12d, %r12d
movq %rcx, 0x20(%rsp)
je 0x47a0e
movb 0x15(%rsp), %al
testb %al, %al
je 0x47a11
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 0x479eb
jmp 0x47a11
xorl %r14d, %r14d
jmp 0x47a8e
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 0x47a7c
testb $0x1, %al
jne 0x47a6c
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x14(%rsp), %rsi
callq 0x4750
movl 0x10(%rsp), %esi
testl %eax, %eax
je 0x47a7c
addl %r13d, %r14d
andl %esi, %r14d
incl %r13d
cmpl %r12d, %r14d
jne 0x47a2a
jmp 0x47a93
movl %ebp, %ecx
shrl %cl, %r15d
testb $0x3, %r15b
movq 0x20(%rsp), %rcx
cmovnel %ecx, %r14d
cmpl %ecx, %r14d
jne 0x47a9f
leaq 0x1a10e(%rip), %rbx     # 0x61ba8
jmp 0x478a6
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rbx
jmp 0x478a6
movq 0x1a50d(%rip), %rcx     # 0x61fc8
movq (%rcx), %rdi
leaq 0xcc64(%rip), %rsi      # 0x54729
leaq 0xcc33(%rip), %rdx      # 0x546ff
movl %eax, %ecx
xorl %eax, %eax
callq 0x4770
jmp 0x47975
callq 0x608e
jmp 0x4798f
callq 0x42e0