// File: /workspace/github_cpp_makefile_star2_O1/eatonphil[P]cpp-json/json.cpp
// Function: json::lex_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
std::tuple<JSONToken, int, std::string> lex_string(std::string raw_json,
                                                   int original_index) {
  int index = original_index;
  JSONToken token{"", JSONTokenType::String, index};
  std::string value = "";
  auto c = raw_json[index];
  if (c != '"') {
    return {token, original_index, ""};
  }
  index++;

  // TODO: handle nested quotes
  while (c = raw_json[index], c != '"') {
    if (index == raw_json.length()) {
      return {
          token, index,
          format_error("Unexpected EOF while lexing string", raw_json, index)};
    }

    token.value += c;
    index++;
  }
  index++;

  return {token, index, ""};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
leaq -0xd8(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x8800(%rip), %r15      # 0xb207
leaq -0xe8(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x8c74
movl $0x0, 0x20(%r12)
movl -0x2c(%rbp), %eax
movl %eax, 0x24(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r12)
leaq -0xa0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq -0xb0(%rbp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x8c74
movslq -0x2c(%rbp), %rax
movq (%r14), %rcx
cmpb $0x22, (%rcx,%rax)
jne 0x2a96
leaq -0xe8(%rbp), %r15
movslq -0x2c(%rbp), %rax
leaq 0x1(%rax), %rdx
movl %edx, -0x2c(%rbp)
movq (%r14), %rcx
movb 0x1(%rcx,%rax), %cl
cmpb $0x22, %cl
je 0x2a9c
cmpq %rdx, 0x8(%r14)
je 0x2b17
movsbl %cl, %esi
movq %r15, %rdi
callq 0x8d0e
jmp 0x2a68
leaq -0x30(%rbp), %rdx
jmp 0x2aa5
addl $0x2, %eax
leaq -0x2c(%rbp), %rdx
movl %eax, (%rdx)
leaq 0x875b(%rip), %rcx      # 0xb207
leaq -0xe8(%rbp), %rsi
movq %rbx, %rdi
callq 0x6dee
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0x2ad6
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x2ae7
callq 0x6ff2
movq -0xe8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2b02
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x8575(%rip), %rsi      # 0xb09b
leaq 0x8590(%rip), %rdx      # 0xb0bd
leaq -0x50(%rbp), %rdi
callq 0x8c74
leaq -0x60(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x853e
movl -0x2c(%rbp), %ecx
leaq -0x90(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x24ae
leaq -0xe8(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
leaq -0x90(%rbp), %rcx
movq %rbx, %rdi
callq 0x6ec0
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b9b
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x2bb0
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2abb
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2abb
movq %rax, %rbx
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2bf3
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2bf3
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x2c0d
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2c0d
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2c34
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2c34
jmp 0x2c31
jmp 0x2c31
movq %rax, %rbx
jmp 0x2c4f
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0x2c4f
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0xe8(%rbp), %rdi
callq 0x678c
movq %rbx, %rdi
callq 0x2290