// File: /workspace/github_cpp_makefile_star2_O3/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
subq $0x28, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
movq %rdx, 0x18(%rsp)
subq %rsi, %r12
cmpq $0x10, %r12
jl 0x1fc4b
movq %r15, %rcx
movdqu (%r15), %xmm0
movdqa %xmm0, %xmm1
movdqa %xmm0, %xmm2
pminub 0x2458c(%rip), %xmm2    # 0x440e0
pcmpeqb %xmm0, %xmm2
pcmpeqb 0x24560(%rip), %xmm0    # 0x440c0
pcmpeqb 0x24568(%rip), %xmm1    # 0x440d0
por %xmm0, %xmm1
por %xmm1, %xmm2
pmovmskb %xmm2, %ebp
testl %ebp, %ebp
je 0x1fc12
leaq 0x10(%r15), %rax
movq %rax, 0x20(%rsp)
xorl %r13d, %r13d
btl %r13d, %ebp
jae 0x1fbd7
leaq (%r15,%r13), %rbx
cmpq %rcx, %rbx
je 0x1fbb8
movq %rcx, 0x8(%rsp)
movq %rbx, (%rsp)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
movq %rsp, %rdx
callq 0x1efe6
testb %al, %al
je 0x1fce0
movsbl (%rbx), %esi
movq %r14, %rdi
movq 0x10(%rsp), %rdx
callq 0x1fd08
testb %al, %al
je 0x1fcf4
leaq (%r15,%r13), %rcx
incq %rcx
incq %r13
cmpq $0x10, %r13
jne 0x1fb88
movq 0x20(%rsp), %rbx
cmpq %rbx, %rcx
je 0x1fc0f
movq %rcx, 0x8(%rsp)
movq %rbx, (%rsp)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
movq %rsp, %rdx
callq 0x1efe6
movq %rbx, %rcx
testb %al, %al
jne 0x1fc12
jmp 0x1fce0
movq %rbx, %rcx
addq $0x10, %r15
addq $-0x10, %r12
cmpq $0xf, %r12
ja 0x1fb3f
cmpq %r15, %rcx
je 0x1fc48
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
movq %rsp, %rdx
movq %r15, (%rdx)
movq %r14, %rdi
callq 0x1efe6
testb %al, %al
jne 0x1fc4b
jmp 0x1fce0
movq %rcx, %r15
movb $0x1, %bpl
movq 0x18(%rsp), %rdx
cmpq %rdx, %r15
je 0x1fcf6
leaq 0x2505d(%rip), %r12     # 0x44cc0
leaq 0x8(%rsp), %rbx
movq %rsp, %r13
movq %r15, %rax
movzbl (%r15), %ecx
cmpb $0x1, (%rcx,%r12)
jne 0x1fcb9
cmpq %rax, %r15
je 0x1fc9c
movq %rax, 0x8(%rsp)
movq %r15, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1efe6
testb %al, %al
je 0x1fce0
movb (%r15), %cl
movsbl %cl, %esi
movq %r14, %rdi
movq 0x10(%rsp), %rdx
callq 0x1fd08
testb %al, %al
je 0x1fcf4
leaq 0x1(%r15), %rax
movq 0x18(%rsp), %rdx
incq %r15
cmpq %rdx, %r15
jne 0x1fc6e
cmpq %rax, %r15
je 0x1fcf6
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %rsp, %rdx
movq %r15, (%rdx)
movq %r14, %rdi
callq 0x1efe6
testb %al, %al
jne 0x1fcf6
callq 0x1e39a
movq 0x10(%rsp), %rcx
movl $0x1, (%rcx)
movq %rax, 0x8(%rcx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop