// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: hfile_add_scheme_handler
HTSLIB_EXPORT
void hfile_add_scheme_handler(const char *scheme,
                              const struct hFILE_scheme_handler *handler)
{
    int absent;
    if (handler->open == NULL || handler->isremote == NULL) {
        hts_log_warning("Couldn't register scheme handler for %s: missing method", scheme);
        return;
    }
    if (!schemes) {
        if (try_exe_add_scheme_handler(scheme, handler) != 0) {
            hts_log_warning("Couldn't register scheme handler for %s", scheme);
        }
        return;
    }
    khint_t k = kh_put(scheme_string, schemes, scheme, &absent);
    if (absent < 0) {
        hts_log_warning("Couldn't register scheme handler for %s : %s",
                        scheme, strerror(errno));
        return;
    }
    if (absent || priority(handler) > priority(kh_value(schemes, k))) {
        kh_value(schemes, k) = handler;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r15
cmpq $0x0, (%rsi)
je 0xf7eb
movq %rsi, %rbx
cmpq $0x0, 0x8(%rsi)
je 0xf7eb
movq 0xa702e(%rip), %r13     # 0xb67f8
testq %r13, %r13
je 0xf816
movl 0x8(%r13), %eax
cmpl 0xc(%r13), %eax
jb 0xf838
movl (%r13), %esi
movl 0x4(%r13), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0xf826
decl %esi
jmp 0xf828
leaq 0x85c93(%rip), %rsi     # 0x95485
leaq 0x85ca5(%rip), %rdx     # 0x9549e
movl $0x3, %edi
movq %r15, %rcx
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13de5
leaq 0x85c68(%rip), %rsi     # 0x95485
leaq 0x85cb2(%rip), %rdx     # 0x954d6
jmp 0xf7f9
incl %esi
movq %r13, %rdi
callq 0x10701
testl %eax, %eax
js 0xf939
movl (%r13), %r14d
leal -0x1(%r14), %edx
movb (%r15), %cl
testb %cl, %cl
je 0xf869
leaq 0x1(%r15), %rax
movl $0x811c9dc5, %r12d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r12d, %ecx
imull $0x1000193, %ecx, %r12d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0xf851
jmp 0xf86f
movl $0x811c9dc5, %r12d      # imm = 0x811C9DC5
andl %edx, %r12d
movq 0x10(%r13), %rsi
movl %r12d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %eax
leal (%r12,%r12), %ecx
shrl %cl, %eax
testb $0x2, %al
je 0xf891
movl %r12d, %r14d
jmp 0xf9a8
movq %r13, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %rbx, 0x28(%rsp)
movl $0x1, %ebx
movl %r12d, %r13d
movq %r14, 0x20(%rsp)
movq %rsi, 0x30(%rsp)
movl %edx, 0x1c(%rsp)
movl %r13d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r15d
leal (,%r13,2), %ebp
andl $0x1e, %ebp
movl %r15d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0xf973
testb $0x1, %al
jne 0xf905
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
callq 0x46c0
movl 0x1c(%rsp), %edx
movq 0x30(%rsp), %rsi
testl %eax, %eax
je 0xf973
btl %ebp, %r15d
cmovbl %r13d, %r14d
addl %ebx, %r13d
andl %edx, %r13d
incl %ebx
cmpl %r12d, %r13d
jne 0xf8b6
movb $0x1, %al
movq 0x20(%rsp), %rdx
movl %edx, %ecx
cmpl %edx, %r14d
movq 0x28(%rsp), %rbx
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r13
je 0xf999
jmp 0xf9a8
callq 0x4050
movl (%rax), %edi
callq 0x4150
leaq 0x85b39(%rip), %rsi     # 0x95485
leaq 0x85bab(%rip), %rdx     # 0x954fe
movl $0x3, %edi
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13de5
movl %ebp, %ecx
shrl %cl, %r15d
testb $0x2, %r15b
sete %al
movl %r14d, %ecx
movl %r13d, %r12d
movq 0x28(%rsp), %rbx
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r13
movq 0x20(%rsp), %rdx
cmpl %edx, %ecx
cmovel %r12d, %ecx
testb %al, %al
cmovnel %r12d, %ecx
movl %ecx, %r14d
movl %r14d, %edx
shrl $0x4, %edx
movl (%rsi,%rdx,4), %eax
leal (%r14,%r14), %ecx
andl $0x1e, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0xfa1e
testb $0x1, %al
jne 0xfa4f
movslq 0x18(%rbx), %rcx
imulq $0x10624dd3, %rcx, %rax # imm = 0x10624DD3
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rax
addl %edx, %eax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
subl %eax, %ecx
movq 0xa6e0b(%rip), %rax     # 0xb67f8
movq 0x20(%rax), %rdx
movl %r14d, %eax
movq (%rdx,%rax,8), %rdx
movslq 0x18(%rdx), %rdx
imulq $0x10624dd3, %rdx, %rsi # imm = 0x10624DD3
movq %rsi, %rdi
shrq $0x3f, %rdi
sarq $0x26, %rsi
addl %edi, %esi
imull $0x3e8, %esi, %esi      # imm = 0x3E8
subl %esi, %edx
cmpl %edx, %ecx
jg 0xfa6e
jmp 0xfa7d
movq 0x18(%r13), %rsi
movl %r14d, %eax
movq %r15, (%rsi,%rax,8)
movl $0x3, %esi
shll %cl, %esi
notl %esi
movq 0x10(%r13), %rcx
andl %esi, (%rcx,%rdx,4)
movq 0x4(%r13), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x4(%r13)
jmp 0xfa6e
movq 0x18(%r13), %rsi
movl %r14d, %eax
movq %r15, (%rsi,%rax,8)
movl $0x3, %esi
shll %cl, %esi
notl %esi
movq 0x10(%r13), %rcx
andl %esi, (%rcx,%rdx,4)
incl 0x4(%r13)
movq 0xa6d83(%rip), %rcx     # 0xb67f8
movq 0x20(%rcx), %rcx
movq %rbx, (%rcx,%rax,8)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq