// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::OurReader::parse(char const*, char const*, Json::Value&, bool)
bool OurReader::parse(const char* beginDoc,
                   const char* endDoc,
                   Value& root,
                   bool collectComments) {
  if (!features_.allowComments_) {
    collectComments = false;
  }

  begin_ = beginDoc;
  end_ = endDoc;
  collectComments_ = collectComments;
  current_ = begin_;
  lastValueEnd_ = 0;
  lastValue_ = 0;
  commentsBefore_ = "";
  errors_.clear();
  while (!nodes_.empty())
    nodes_.pop();
  nodes_.push(&root);

  stackDepth_ = 0;
  bool successful = readValue();
  Token token;
  skipCommentTokens(token);
  if (features_.failIfExtra_) {
    if (token.type_ != tokenError && token.type_ != tokenEndOfStream) {
      addError("Extra non-whitespace after JSON value.", token);
      return false;
    }
  }
  if (collectComments_ && !commentsBefore_.empty())
    root.setComment(commentsBefore_, commentAfter);
  if (features_.strictRoot_) {
    if (!root.isArray() && !root.isObject()) {
      // Set error location to start of doc, ideally should be first token found
      // in doc
      token.type_ = tokenError;
      token.start_ = beginDoc;
      token.end_ = endDoc;
      addError(
          "A valid JSON document must be either an array or an object value.",
          token);
      return false;
    }
  }
  return successful;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
andb 0x10c(%rdi), %r8b
movq %rsi, 0xc0(%rdi)
movq %rdx, 0xc8(%rdi)
movb %r8b, 0x118(%rdi)
movq %rsi, 0xd0(%rdi)
leaq 0xe8(%rdi), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%rdi)
movq 0xf0(%rdi), %rdx
leaq 0x4135e(%rip), %rcx     # 0xbc634
movq %r13, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x11910
leaq 0x50(%rbx), %rdi
callq 0x8793e
movq 0x30(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x7b300
movq %rbx, %rdi
callq 0x88d1c
jmp 0x7b2ec
movq %rsp, %rsi
movq %r12, (%rsi)
movq %rbx, %rdi
callq 0x88d68
movl $0x0, 0x108(%rbx)
movq %rbx, %rdi
callq 0x7b44e
movl %eax, %ebp
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x7b93a
cmpb $0x1, 0x111(%rbx)
jne 0x7b378
testl $0xffffffef, 0x20(%rsp) # imm = 0xFFFFFFEF
je 0x7b378
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x44021(%rip), %rsi     # 0xbf373
leaq 0x44040(%rip), %rdx     # 0xbf399
movq %rsp, %rdi
callq 0x1a88c
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x7b978
jmp 0x7b3fb
cmpb $0x1, 0x118(%rbx)
jne 0x7b39e
movq 0xf0(%rbx), %rdx
testq %rdx, %rdx
je 0x7b39e
movq (%r13), %rsi
movq %r12, %rdi
movl $0x2, %ecx
callq 0x82a6e
cmpb $0x1, 0x10d(%rbx)
jne 0x7b413
movzwl 0x8(%r12), %eax
andl $0xfe, %eax
cmpw $0x6, %ax
je 0x7b413
movl $0x10, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movq %r14, 0x30(%rsp)
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x43cde(%rip), %rsi     # 0xbf0b8
leaq 0x43d18(%rip), %rdx     # 0xbf0f9
movq %rsp, %rdi
callq 0x1a88c
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x7b978
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x7b411
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7b428
jmp 0x7b443
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x7b446
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x7b446
movq %rax, %rbx
movq %rbx, %rdi
callq 0x11a60