// File: /workspace/github_cpp_makefile_star2_O2/oknenavin[P]cxon/test/../src/cxon/lang/common/cio/char.hxx
// Function: std::enable_if<(std::integral_constant<bool, false>::value || !cxon::JSON<cxon::json::format_traits>::assume_no_escapes) && use_simd_<cxon::JSON<cxon::json::format_traits>>::value, bool>::type cxon::cio::chr::imp::encode_<cxon::JSON<cxon::json::format_traits>, char>::range<cxon::json::indenter<cxon::JSON<cxon::JSON<cxon::json::format_traits>>, std::ostreambuf_iterator<char, std::char_traits<char>>>, cxon::context<cxon::JSON<cxon::json::format_traits>, cxon::napa::imp::var<cxon::node::recursion_guard, unsigned int>>, cxon::JSON<cxon::json::format_traits>>(cxon::json::indenter<cxon::JSON<cxon::JSON<cxon::json::format_traits>>, std::ostreambuf_iterator<char, std::char_traits<char>>>&, char const*, char const*, cxon::context<cxon::JSON<cxon::json::format_traits>, cxon::napa::imp::var<cxon::node::recursion_guard, unsigned int>>&)
static auto range(O& o, const char* f, const char* l, Cx& cx)
                        -> enable_if_t<( is_unquoted_key_context<X>::value || !Y::assume_no_escapes) &&  use_simd_<Y>::value, bool>
                    {   // TODO: assumes that the input 16 byte aligned, but it may not be the case - preprocess the unaligned prefix
                        static_assert(X::string::del == '"' || X::string::del == '\'', "expecting single or double quotes as a string delimiter");
#                       if CXON_USE_SIMD_SSE2
                            char const *a = f;

                            if (l - f >= 16) {
                                __m128i const v1 = _mm_set1_epi8('"');
                                __m128i const v2 = _mm_set1_epi8('\'');
                                __m128i const v3 = _mm_set1_epi8('\\');
                                __m128i const v4 = _mm_set1_epi8(0x1F);
                                std::size_t n = l - f;
                                while (n >= 16) {
                                    __m128i const v0 = _mm_loadu_si128((__m128i const*)f);
                                    __m128i r = X::string::del == '\"' ?
                                                                _mm_cmpeq_epi8(v0, v1) :
                                                                _mm_cmpeq_epi8(v0, v2) ;
                                            r = _mm_or_si128(r, _mm_cmpeq_epi8(v0, v3));
                                            r = _mm_or_si128(r, _mm_cmpeq_epi8(v0, _mm_min_epu8(v0, v4)));
                                    if (int const m = _mm_movemask_epi8(r)) {
                                        int e = 0;
                                            for (auto* g = f + 16; f != g; ++f, ++e) {
                                                if ((1 << e) & m) {
                                                    if (a != f && !poke<Y>(o, a, f, cx))    return false;
                                                    if (!value(o, *f, cx))                  return false;
                                                    a = f + 1;
                                                }
                                            }
                                        if (a != f && !poke<Y>(o, a, f, cx)) return false;
                                        a = f, f -= 16;
                                    }
                                    f += 16, n -= 16;
                                }
                                if (a != f) {
                                    if (!poke<Y>(o, a, f, cx)) return false;
                                    a = f;
                                }
                            }

                            for ( ; f != l; ++f) {
                                if (should_escape_<Y>(*f)) {
                                    if (a != f && !poke<Y>(o, a, f, cx))    return false;
                                    if (!value(o, *f, cx))                  return false;
                                    a = f + 1;
                                }
                            }

                            return a == f || poke<Y>(o, a, f, cx);
#                       else
                            return cx/X::read_error::unexpected;
#                       endif
                    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r14
movq %rdx, %rax
subq %rsi, %rax
cmpq $0x10, %rax
jl 0x18414
movq %rsi, %r12
cmpq $0x10, %rax
jb 0x183ec
movdqu (%r12), %xmm0
movdqa %xmm0, %xmm1
movdqa %xmm0, %xmm2
pminub 0x22d7b(%rip), %xmm2    # 0x3b0c0
pcmpeqb %xmm0, %xmm2
pcmpeqb 0x22d4f(%rip), %xmm0    # 0x3b0a0
pcmpeqb 0x22d57(%rip), %xmm1    # 0x3b0b0
por %xmm0, %xmm1
por %xmm1, %xmm2
pmovmskb %xmm2, %ebp
testl %ebp, %ebp
je 0x183df
movq %rax, (%rsp)
movq %r12, %r13
pushq $-0x10
popq %r12
testq %r12, %r12
je 0x183bd
leal 0x10(%r12), %eax
movzbl %al, %eax
btl %eax, %ebp
jae 0x183b5
cmpq %rsi, %r13
je 0x1839d
movq %r14, %rdi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x18495
testb %al, %al
je 0x18403
movsbl (%r13), %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x184b2
testb %al, %al
je 0x18403
leaq 0x1(%r13), %rsi
incq %r12
incq %r13
jmp 0x18374
cmpq %rsi, %r13
je 0x183d4
movq %r14, %rdi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x18495
testb %al, %al
je 0x18403
leaq -0x10(%r13), %r12
movq %r13, %rsi
movq (%rsp), %rax
addq $0x10, %r12
addq $-0x10, %rax
jmp 0x18325
cmpq %r12, %rsi
je 0x18414
movq %r14, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x18495
testb %al, %al
jne 0x18417
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r12
leaq 0x23af2(%rip), %rbp     # 0x3bf10
movq %r12, %r13
cmpq %r15, %r13
je 0x1846a
movzbl (%r13), %eax
cmpb $0x1, (%rax,%rbp)
jne 0x18465
cmpq %r12, %r13
je 0x1844f
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x18495
testb %al, %al
je 0x18403
movb (%r13), %al
movsbl %al, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x184b2
testb %al, %al
je 0x18403
leaq 0x1(%r13), %r12
incq %r13
jmp 0x18421
cmpq %r15, %r12
je 0x1848e
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x18495
movb $0x1, %al
jmp 0x18405