// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movq %rcx, 0x20(%rsp)
movq %rdx, %rbx
movq %rsi, %r8
movq %rdi, %r14
movq %rdx, %r13
subq %rsi, %r13
movq %rsi, %r12
cmpq $0x10, %r13
jl 0x21b90
movq %rbx, 0x28(%rsp)
cmpq $0x10, %r13
jb 0x21b40
movq %r13, 0x18(%rsp)
movdqu (%r12), %xmm0
movdqa %xmm0, %xmm1
movdqa %xmm0, %xmm2
pminub 0x256ab(%rip), %xmm2    # 0x470b0
pcmpeqb %xmm0, %xmm2
pcmpeqb 0x2567f(%rip), %xmm0    # 0x47090
pcmpeqb 0x25687(%rip), %xmm1    # 0x470a0
por %xmm0, %xmm1
por %xmm1, %xmm2
pmovmskb %xmm2, %ebp
testl %ebp, %ebp
je 0x21b15
leaq 0x10(%r12), %rax
movq %rax, 0x30(%rsp)
xorl %ebx, %ebx
movq %r8, %r15
btl %ebx, %ebp
jae 0x21a8c
movq %r14, %r13
leaq (%r12,%rbx), %r14
cmpq %r15, %r14
je 0x21a6d
movq %r15, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x20f2c
testb %al, %al
je 0x21ae4
movsbl (%r14), %esi
movq %r13, %rdi
movq 0x20(%rsp), %rdx
callq 0x21c4c
testb %al, %al
movq %r13, %r14
je 0x21ad0
leaq (%r12,%rbx), %r15
incq %r15
incq %rbx
cmpq $0x10, %rbx
jne 0x21a3c
movq 0x30(%rsp), %rbp
cmpq %rbp, %r15
movq 0x28(%rsp), %rbx
je 0x21b12
movq %r15, 0x10(%rsp)
movq %rbp, 0x8(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x20f2c
movq %rbp, %r8
testb %al, %al
movq 0x18(%rsp), %r13
movb $0x1, %dl
je 0x21af4
jmp 0x21b1c
addq %rbx, %r12
xorl %edx, %edx
movq %r15, %r8
movq 0x28(%rsp), %rbx
movq 0x18(%rsp), %r13
jmp 0x21b1c
movq %r14, %rbp
movq %r13, %r14
movq 0x28(%rsp), %rbx
movq 0x18(%rsp), %r13
callq 0x20204
movq 0x20(%rsp), %rcx
movl $0x1, (%rcx)
movq %rax, 0x8(%rcx)
xorl %edx, %edx
movq %r15, %r8
movq %rbp, %r12
jmp 0x21b1c
movq %rbp, %r8
movq 0x18(%rsp), %r13
movb $0x1, %dl
movq %r12, %rax
leaq -0x10(%r13), %rcx
movzbl %dl, %edx
movl %edx, %r12d
shll $0x4, %r12d
addq %rax, %r12
testb %dl, %dl
cmovneq %rcx, %r13
jne 0x219e0
xorl %ebp, %ebp
jmp 0x21b87
cmpq %r12, %r8
je 0x21b6b
leaq 0x10(%rsp), %rsi
movq %r8, %r15
movq %r8, (%rsi)
leaq 0x8(%rsp), %rdx
movq %r12, (%rdx)
movq %r14, %rdi
callq 0x20f2c
movl %eax, %ebp
testb %al, %al
je 0x21b70
movq %r12, %r8
jmp 0x21b87
movb $0x1, %bpl
jmp 0x21b87
callq 0x20204
movq 0x20(%rsp), %rcx
movl $0x1, (%rcx)
movq %rax, 0x8(%rcx)
movq %r15, %r8
testb %bpl, %bpl
je 0x21c1b
cmpq %rbx, %r12
je 0x21bf6
leaq 0x261e4(%rip), %r15     # 0x47d80
leaq 0x10(%rsp), %r13
leaq 0x8(%rsp), %rbp
movzbl (%r12), %eax
cmpb $0x1, (%rax,%r15)
jne 0x21bee
cmpq %r8, %r12
je 0x21bd3
movq %r8, 0x10(%rsp)
movq %r12, 0x8(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x20f2c
testb %al, %al
je 0x21c24
movsbl (%r12), %esi
movq %r14, %rdi
movq 0x20(%rsp), %rdx
callq 0x21c4c
testb %al, %al
je 0x21c1b
leaq 0x1(%r12), %r8
incq %r12
cmpq %rbx, %r12
jne 0x21ba6
cmpq %r12, %r8
je 0x21c1f
leaq 0x10(%rsp), %rsi
movq %r8, (%rsi)
leaq 0x8(%rsp), %rdx
movq %r12, (%rdx)
movq %r14, %rdi
callq 0x20f2c
movl %eax, %ebp
testb %al, %al
je 0x21c26
jmp 0x21c3a
xorl %ebp, %ebp
jmp 0x21c3a
movb $0x1, %bpl
jmp 0x21c3a
xorl %ebp, %ebp
callq 0x20204
movq 0x20(%rsp), %rcx
movl $0x1, (%rcx)
movq %rax, 0x8(%rcx)
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop