// File: /workspace/github_cpp_makefile_star2_O3/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 0x83f16
movq %rsi, %r14
testl %edx, %edx
je 0x83ce0
movl %edx, %r15d
leaq (%r14,%r15), %rax
leaq 0x3bd90(%rip), %rcx     # 0xbfa32
movq %r14, %rsi
movb (%rsi), %dil
movb $0x22, %r9b
movl $0x1, %r8d
cmpb %dil, %r9b
je 0x83d3d
movb (%r8,%rcx), %r9b
incq %r8
cmpq $0x8, %r8
jne 0x83cb1
incq %rsi
cmpq %rax, %rsi
jb 0x83ca5
xorl %eax, %eax
cmpb $0x20, (%r14,%rax)
jb 0x83d3d
incq %rax
cmpq %rax, %r15
jne 0x83cd1
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3bd4b(%rip), %rsi     # 0xbfa3b
leaq 0x3bd45(%rip), %rdx     # 0xbfa3c
leaq 0x8(%rsp), %rdi
callq 0x1a88c
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x11b50
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x83f40
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x83f48
leal 0x3(,%rdx,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 0x11950
leaq 0x3bcd0(%rip), %rsi     # 0xbfa3b
movq %rbx, %rdi
callq 0x11b50
xorl %r12d, %r12d
leaq 0x3b13b(%rip), %r13     # 0xbeeb8
movb (%r14,%r12), %al
movzbl %al, %ecx
leal -0x8(%rcx), %edx
cmpl $0x5, %edx
ja 0x83da2
movslq (%r13,%rdx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
leaq 0x3bca3(%rip), %rsi     # 0xbfa40
jmp 0x83edf
leaq 0x3bc94(%rip), %rsi     # 0xbfa3d
cmpl $0x5c, %ecx
je 0x83edf
cmpl $0x22, %ecx
jne 0x83dc3
leaq 0x3bc7c(%rip), %rsi     # 0xbfa3a
jmp 0x83edf
cmpb $0x1f, %al
ja 0x83ef5
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
callq 0x117f0
movl $0x2, %edx
movq %rbp, %rdi
leaq 0x3bc68(%rip), %rsi     # 0xbfa4f
callq 0x116c0
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), %rcx
leaq (%rsp,%rcx), %rbp
addq $0x30, %rbp
cmpb $0x0, 0xe1(%rbp)
jne 0x83e3d
movq %rbp, %rdi
movl $0x20, %esi
callq 0x11560
movb $0x1, 0xe1(%rbp)
movq 0x30(%rsp), %rax
movb $0x30, 0xe0(%rbp)
movq -0x18(%rax), %rax
movq $0x4, 0x40(%rsp,%rax)
movsbl (%r14,%r12), %esi
leaq 0x30(%rsp), %rdi
callq 0x11a30
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x11980
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 0x83e9d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x115c0
leaq 0x30(%rsp), %rdi
movq 0x800f7(%rip), %rsi     # 0x103fa0
callq 0x112f0
leaq 0xa0(%rsp), %rdi
callq 0x111f0
jmp 0x83ee7
leaq 0x3bb88(%rip), %rsi     # 0xbfa4c
jmp 0x83edf
leaq 0x3bb79(%rip), %rsi     # 0xbfa46
jmp 0x83edf
leaq 0x3bb6d(%rip), %rsi     # 0xbfa43
jmp 0x83edf
leaq 0x3bb6a(%rip), %rsi     # 0xbfa49
movq %rbx, %rdi
callq 0x11b50
incq %r12
cmpq %r12, %r15
jne 0x83d7d
jmp 0x83f02
movsbl %al, %esi
movq %rbx, %rdi
callq 0x114e0
jmp 0x83ee7
leaq 0x3bb32(%rip), %rsi     # 0xbfa3b
movq %rbx, %rdi
callq 0x11b50
jmp 0x83fdd
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x38710(%rip), %rdx     # 0xbc634
movq %rbx, %rdi
movq %rdx, %rsi
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1a88c
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 0x3bad0(%rip), %rsi     # 0xbfa3b
callq 0x11b50
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x83f92
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x83f98
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 0x83fc6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x115c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x83fdd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x115c0
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 0x8400e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x8400e
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x8408d
movq 0x18(%rsp), %rsi
jmp 0x84085
movq %rax, %r14
jmp 0x8408d
jmp 0x84070
jmp 0x84070
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x84050
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x84050
jmp 0x8404d
jmp 0x84070
movq %rax, %r14
movq 0x7ff49(%rip), %rsi     # 0x103fa0
leaq 0x30(%rsp), %rdi
callq 0x112f0
leaq 0xa0(%rsp), %rdi
callq 0x111f0
jmp 0x84073
movq %rax, %r14
movq (%rbx), %rdi
cmpq 0x28(%rsp), %rdi
je 0x8408d
movq 0x28(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x115c0
movq %r14, %rdi
callq 0x11a60
nop