// File: DoubleString[P]RtConverter/src/Json/json_reader.cpp
// Function: Json::Reader::parse(char const*, char const*, Json::Value&, bool)
bool Reader::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_.clear();
  errors_.clear();
  while (!nodes_.empty())
    nodes_.pop();
  nodes_.push(&root);

  bool successful = readValue();
  Token token;
  skipCommentTokens(token);
  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
movq %rsp, %rbp
subq $0xa0, %rsp
movb %r8b, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
testb $0x1, 0x108(%rax)
jne 0xa74b
movb $0x0, -0x29(%rbp)
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, 0xc0(%rdi)
movq -0x20(%rbp), %rax
movq %rax, 0xc8(%rdi)
movb -0x29(%rbp), %al
andb $0x1, %al
movb %al, 0x10c(%rdi)
movq 0xc0(%rdi), %rax
movq %rax, 0xd0(%rdi)
movq $0x0, 0xd8(%rdi)
movq $0x0, 0xe0(%rdi)
addq $0xe8, %rdi
callq 0x99d0
movq -0x98(%rbp), %rdi
addq $0x50, %rdi
callq 0x144a0
movq -0x98(%rbp), %rdi
callq 0x144e0
xorb $-0x1, %al
testb $0x1, %al
jne 0xa7c7
jmp 0xa7d5
movq -0x98(%rbp), %rdi
callq 0x14500
jmp 0xa7b3
movq -0x98(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x14520
movq -0x98(%rbp), %rdi
callq 0xaa30
movq -0x98(%rbp), %rdi
andb $0x1, %al
movb %al, -0x39(%rbp)
leaq -0x58(%rbp), %rsi
callq 0xb110
movq -0x98(%rbp), %rax
testb $0x1, 0x10c(%rax)
je 0xa851
movq -0x98(%rbp), %rdi
addq $0xe8, %rdi
callq 0x9c50
testb $0x1, %al
jne 0xa851
movq -0x98(%rbp), %rsi
movq -0x28(%rbp), %rdi
addq $0xe8, %rsi
movl $0x2, %edx
callq 0x24440
movq -0x98(%rbp), %rax
testb $0x1, 0x109(%rax)
je 0xa935
movq -0x28(%rbp), %rdi
callq 0x21bd0
testb $0x1, %al
jne 0xa933
movq -0x28(%rbp), %rdi
callq 0x21c00
testb $0x1, %al
jne 0xa933
movl $0xd, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x9d30
movq -0xa0(%rbp), %rdx
leaq 0xb0e74(%rip), %rsi     # 0xbb730
leaq -0x78(%rbp), %rdi
callq 0x9a30
jmp 0xa8c7
movq -0x98(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x78(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0xb160
jmp 0xa8e1
leaq -0x78(%rbp), %rdi
callq 0x9480
leaq -0x79(%rbp), %rdi
callq 0x97e0
movb $0x0, -0x1(%rbp)
jmp 0xa93d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0xa928
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x9480
leaq -0x79(%rbp), %rdi
callq 0x97e0
jmp 0xa94b
jmp 0xa935
movb -0x39(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xa0, %rsp
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x9d20
nopw (%rax,%rax)