// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::valueToQuotedStringN[abi:cxx11](char const*, unsigned int)
static std::string valueToQuotedStringN(const char* value, unsigned length) {
  if (value == NULL)
    return "";
  // Not sure how to handle unicode...
  if (strnpbrk(value, "\"\\\b\f\n\r\t", length) == NULL &&
      !containsControlCharacter0(value, length))
    return std::string("\"") + value + "\"";
  // We have to walk value and escape any special characters.
  // Appending to std::string is not efficient, but this should be rare.
  // (Note: forward slashes are *not* rare, but I am not escaping them.)
  std::string::size_type maxsize =
      length * 2 + 3; // allescaped+quotes+NULL
  std::string result;
  result.reserve(maxsize); // to avoid lots of mallocs
  result += "\"";
  char const* end = value + length;
  for (const char* c = value; c != end; ++c) {
    switch (*c) {
    case '\"':
      result += "\\\"";
      break;
    case '\\':
      result += "\\\\";
      break;
    case '\b':
      result += "\\b";
      break;
    case '\f':
      result += "\\f";
      break;
    case '\n':
      result += "\\n";
      break;
    case '\r':
      result += "\\r";
      break;
    case '\t':
      result += "\\t";
      break;
    // case '/':
    // Even though \/ is considered a legal escape in JSON, a bare
    // slash is also legal, so I see no reason to escape it.
    // (I hope I am not misunderstanding something.)
    // blep notes: actually escaping \/ may be useful in javascript to avoid </
    // sequence.
    // Should add a flag to allow this compatibility mode and prevent this
    // sequence from occurring.
    default:
      if ((isControlCharacter(*c)) || (*c == 0)) {
        std::ostringstream oss;
        oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
            << std::setw(4) << static_cast<int>(*c);
        result += oss.str();
      } else {
        result += *c;
      }
      break;
    }
  }
  result += "\"";
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
testq %rsi, %rsi
je 0x85f62
movl %edx, %r15d
movq %rsi, %r14
movl %edx, %r12d
testl %edx, %edx
je 0x85d4b
leaq (%r14,%r12), %rax
leaq 0x3bd23(%rip), %rcx     # 0xc1a25
movq %r14, %rsi
movb (%rsi), %dil
cmpb $0x22, %dil
jne 0x85d15
xorl %edi, %edi
movq %rsi, %rdx
jmp 0x85d37
movl $0x1, %r9d
movb (%r9,%rcx), %r8b
cmpq $0x7, %r9
je 0x85d30
incq %r9
cmpb %dil, %r8b
jne 0x85d1b
movq %rsi, %rdx
testb %r8b, %r8b
sete %dil
testb %dil, %dil
je 0x85d46
incq %rsi
cmpq %rax, %rsi
jb 0x85d05
xorl %edx, %edx
testq %rdx, %rdx
jne 0x85d79
testl %r15d, %r15d
setne %al
je 0x85d71
cmpb $0x20, (%r14)
jb 0x85d71
movl $0x1, %ecx
cmpq %rcx, %r12
setne %al
je 0x85d71
cmpb $0x1f, (%r14,%rcx)
leaq 0x1(%rcx), %rcx
ja 0x85d5e
testb %al, %al
je 0x85f80
leal 0x3(,%r15,2), %esi
leaq 0x10(%rbx), %rax
movq %rax, 0x28(%rsp)
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rbx, %rdi
callq 0x11960
leaq 0x3bc86(%rip), %rsi     # 0xc1a2e
movq %rbx, %rdi
callq 0x11b60
testl %r15d, %r15d
je 0x85f4e
xorl %r15d, %r15d
leaq 0x3b0e5(%rip), %r13     # 0xc0ea8
movb (%r14,%r15), %al
movzbl %al, %ecx
leal -0x8(%rcx), %edx
cmpl $0x5, %edx
ja 0x85de8
movslq (%r13,%rdx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
leaq 0x3bc50(%rip), %rsi     # 0xc1a33
jmp 0x85f2b
leaq 0x3bc41(%rip), %rsi     # 0xc1a30
cmpl $0x5c, %ecx
je 0x85f2b
cmpl $0x22, %ecx
jne 0x85e09
leaq 0x3bc29(%rip), %rsi     # 0xc1a2d
jmp 0x85f2b
cmpb $0x1f, %al
ja 0x85f41
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
callq 0x11800
movl $0x2, %edx
movq %rbp, %rdi
leaq 0x3bc15(%rip), %rsi     # 0xc1a42
callq 0x116d0
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rcx
movl 0x48(%rsp,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x48(%rsp,%rcx)
movq -0x18(%rax), %rcx
orl $0x4000, 0x48(%rsp,%rcx) # imm = 0x4000
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rbp
addq $0x30, %rbp
cmpb $0x0, 0xe1(%rbp)
jne 0x85e84
movq %rbp, %rdi
movl $0x20, %esi
callq 0x11560
movb %al, 0xe0(%rbp)
movb $0x1, 0xe1(%rbp)
movb $0x30, 0xe0(%rbp)
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x4, 0x40(%rsp,%rax)
movsbl (%r14,%r15), %esi
leaq 0x30(%rsp), %rdi
callq 0x11a40
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x11990
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x111e0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x85ee9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x115c0
leaq 0x30(%rsp), %rdi
movq 0x800ab(%rip), %rsi     # 0x105fa0
callq 0x112f0
leaq 0xa0(%rsp), %rdi
callq 0x111f0
jmp 0x85f33
leaq 0x3bb2f(%rip), %rsi     # 0xc1a3f
jmp 0x85f2b
leaq 0x3bb20(%rip), %rsi     # 0xc1a39
jmp 0x85f2b
leaq 0x3bb14(%rip), %rsi     # 0xc1a36
jmp 0x85f2b
leaq 0x3bb11(%rip), %rsi     # 0xc1a3c
movq %rbx, %rdi
callq 0x11b60
incq %r15
cmpq %r15, %r12
jne 0x85dc3
jmp 0x85f4e
movsbl %al, %esi
movq %rbx, %rdi
callq 0x114e0
jmp 0x85f33
leaq 0x3bad9(%rip), %rsi     # 0xc1a2e
movq %rbx, %rdi
callq 0x11b60
jmp 0x86073
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x386c7(%rip), %rdx     # 0xbe637
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x1ab58
jmp 0x86073
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3ba9e(%rip), %rsi     # 0xc1a2e
leaq 0x3ba98(%rip), %rdx     # 0xc1a2f
leaq 0x8(%rsp), %rdi
callq 0x1ab58
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x11b60
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x85fd6
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x85fde
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x30(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x3ba2d(%rip), %rsi     # 0xc1a2e
callq 0x11b60
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x86028
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x8602e
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x8605c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x115c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x86073
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x115c0
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x860a7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x860a7
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x86126
movq 0x18(%rsp), %rsi
jmp 0x8611e
movq %rax, %r14
jmp 0x86126
jmp 0x86109
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x860e9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x860e9
jmp 0x860e6
jmp 0x86109
jmp 0x86109
movq %rax, %r14
movq 0x7feb0(%rip), %rsi     # 0x105fa0
leaq 0x30(%rsp), %rdi
callq 0x112f0
leaq 0xa0(%rsp), %rdi
callq 0x111f0
jmp 0x8610c
movq %rax, %r14
movq (%rbx), %rdi
cmpq 0x28(%rsp), %rdi
je 0x86126
movq 0x28(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x115c0
movq %r14, %rdi
callq 0x11a70