// File: /workspace/github_cpp_makefile_star2_O1/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 0x41dc9(%rip), %rcx     # 0xbe637
movq %r13, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x11920
leaq 0x50(%rbx), %rdi
callq 0x89b38
movq 0x30(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x7c898
movq %rbx, %rdi
callq 0x8aef8
jmp 0x7c884
movq %rsp, %rsi
movq %r12, (%rsi)
movq %rbx, %rdi
callq 0x8af44
movl $0x0, 0x108(%rbx)
movq %rbx, %rdi
callq 0x7c9e6
movl %eax, %ebp
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x7cfba
cmpb $0x1, 0x111(%rbx)
jne 0x7c910
testl $0xffffffef, 0x20(%rsp) # imm = 0xFFFFFFEF
je 0x7c910
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x44a79(%rip), %rsi     # 0xc1363
leaq 0x44a98(%rip), %rdx     # 0xc1389
movq %rsp, %rdi
callq 0x1ab58
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x7cff8
jmp 0x7c993
cmpb $0x1, 0x118(%rbx)
jne 0x7c936
movq 0xf0(%rbx), %rdx
testq %rdx, %rdx
je 0x7c936
movq (%r13), %rsi
movq %r12, %rdi
movl $0x2, %ecx
callq 0x84a66
cmpb $0x1, 0x10d(%rbx)
jne 0x7c9ab
movzwl 0x8(%r12), %eax
andl $0xfe, %eax
cmpw $0x6, %ax
je 0x7c9ab
movl $0x10, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movq %r14, 0x30(%rsp)
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x44736(%rip), %rsi     # 0xc10a8
leaq 0x44770(%rip), %rdx     # 0xc10e9
movq %rsp, %rdi
callq 0x1ab58
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x7cff8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x7c9a9
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 0x7c9c0
jmp 0x7c9db
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x7c9de
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x7c9de
movq %rax, %rbx
movq %rbx, %rdi
callq 0x11a70