// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
callq 0x4580
movq (%rax), %r15
xorl %r14d, %r14d
movzbl (%rbx,%r14), %r12d
testb $0x8, (%r15,%r12,2)
jne 0x488e7
leal -0x2d(%r12), %eax
cmpl $0x2, %eax
jb 0x488e7
cmpl $0x2b, %r12d
jne 0x489d0
callq 0x4100
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, 0x14(%rsp,%r14)
incq %r14
cmpq $0xc, %r14
jne 0x488c7
movl $0xc, %r14d
movl $0xc, %eax
addl $-0xc, %eax
cmpl $-0xb, %eax
jb 0x489de
movb $0x0, 0x14(%rsp,%r14)
leaq 0x1bca3(%rip), %rdi     # 0x645c8
callq 0x47a0
cmpq $0x0, 0x1bc8e(%rip)     # 0x645c0
jne 0x48a0c
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x1bc72(%rip)     # 0x645c0
testq %rax, %rax
je 0x48b52
leaq 0xa2d7(%rip), %rdi      # 0x52c35
leaq 0x1b263(%rip), %rsi     # 0x63bc8
callq 0x48620
leaq 0xc4d4(%rip), %rdi      # 0x54e45
leaq 0x1b270(%rip), %rsi     # 0x63be8
callq 0x48620
movl $0x28, %edi
callq 0x4700
testq %rax, %rax
je 0x48b52
movq %rax, %rbx
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, %rdi
callq 0x492da
leaq 0x1bb99(%rip), %rcx     # 0x64550
movl (%rcx), %ecx
testl %eax, %eax
je 0x489e5
cmpl $0x4, %ecx
jge 0x48b22
movq %rbx, %rdi
callq 0x4610
jmp 0x48a00
cmpl $0x3a, %r12d
jne 0x489de
movl %r14d, %eax
jmp 0x4890c
xorl %eax, %eax
jmp 0x48b13
cmpl $0x5, %ecx
jge 0x48b48
movq 0x1bbfb(%rip), %rax     # 0x645f0
movq %rax, 0x20(%rbx)
movq %rbx, 0x1bbf0(%rip)     # 0x645f0
leaq 0x7ce(%rip), %rdi       # 0x491d5
callq 0x4f070
leaq 0x1bbb5(%rip), %rdi     # 0x645c8
callq 0x43f0
movq 0x1bba1(%rip), %rax     # 0x645c0
movq %rax, 0x8(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
je 0x48a65
leal -0x1(%rcx), %esi
movsbl 0x14(%rsp), %r13d
testl %r13d, %r13d
movq %rcx, 0x20(%rsp)
je 0x48a6d
movb 0x15(%rsp), %al
testb %al, %al
je 0x48a70
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 0x48a4a
jmp 0x48a70
xorl %r15d, %r15d
jmp 0x48af5
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 0x48ae3
testb $0x1, %al
jne 0x48acb
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x14(%rsp), %rsi
callq 0x4750
movl 0x10(%rsp), %esi
testl %eax, %eax
je 0x48ae3
addl %r14d, %r15d
andl %esi, %r15d
incl %r14d
cmpl %r13d, %r15d
jne 0x48a89
movq 0x20(%rsp), %rcx
movl %ecx, %r15d
jmp 0x48af5
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x20(%rsp), %rcx
cmovnel %ecx, %r15d
cmpl %ecx, %r15d
jne 0x48b03
leaq 0x1b0a7(%rip), %rax     # 0x63ba8
jmp 0x48b13
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 0x1b49f(%rip), %rcx     # 0x63fc8
movq (%rcx), %rdi
leaq 0xd936(%rip), %rsi      # 0x56469
leaq 0xd905(%rip), %rdx      # 0x5643f
movl %eax, %ecx
xorl %eax, %eax
callq 0x4770
jmp 0x489c6
callq 0x6130
jmp 0x489ee
callq 0x42e0