// File: /workspace/github_cpp_makefile_star2_O3/eatonphil[P]cpp-json/json.cpp
// Function: json::parse_array[abi:cxx11](std::vector<json::JSONToken, std::allocator<json::JSONToken>>, int)
std::tuple<std::vector<JSONValue>, int, std::string>
parse_array(std::vector<JSONToken> tokens, int index) {
  std::vector<JSONValue> children = {};
  while (index < tokens.size()) {
    auto t = tokens[index];
    if (t.type == JSONTokenType::Syntax) {
      if (t.value == "]") {
        return {children, index + 1, ""};
      }

      if (t.value == ",") {
        index++;
        t = tokens[index];
      } else if (children.size() > 0) {
        return {{},
                index,
                format_parse_error("Expected comma after element in array", t)};
      }
    }

    auto [child, new_index, error] = parse(tokens, index);
    if (error.size()) {
      return {{}, index, error};
    }

    children.push_back(child);
    index = new_index;
  }

  return {
      {},
      index,
      format_parse_error("Unexpected EOF while parsing array", tokens[index])};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %r14
movq %rdi, -0x38(%rbp)
leaq -0x2c(%rbp), %rax
movl %edx, (%rax)
xorps %xmm0, %xmm0
leaq -0xb0(%rbp), %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
leaq -0x70(%rbp), %r13
leaq -0x248(%rbp), %r12
leaq -0x90(%rbp), %r15
movq %rsi, -0xb8(%rbp)
movslq -0x2c(%rbp), %rax
movq (%r14), %rbx
movq 0x8(%r14), %rcx
subq %rbx, %rcx
sarq $0x3, %rcx
movabsq $0x6db6db6db6db6db7, %rdx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rdx, %rcx
cmpq %rax, %rcx
jbe 0x3a6f
movq %r12, %r14
movq %r13, %rdi
movq %r15, %r13
imulq $0x38, %rax, %r15
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq (%rbx,%r15), %rsi
movq 0x8(%rbx,%r15), %rdx
addq %rsi, %rdx
movq %rdi, %r12
callq 0x84f0
addq %r15, %rbx
movq 0x20(%rbx), %rax
movq %rax, -0x50(%rbp)
movq 0x28(%rbx), %rcx
movq %rcx, -0x48(%rbp)
movq 0x30(%rbx), %rcx
movq %rcx, -0x40(%rbp)
testq %rcx, %rcx
je 0x3895
movq 0xb738(%rip), %rdx      # 0xefc0
cmpb $0x0, (%rdx)
movq %r13, %r15
je 0x389a
incl 0x8(%rcx)
jmp 0x38a1
movq %r13, %r15
jmp 0x38a1
lock
incl 0x8(%rcx)
movl -0x50(%rbp), %eax
movq %r12, %r13
cmpl $0x2, %eax
movq %r14, %r12
movq -0xb8(%rbp), %r14
jne 0x392e
movq %r13, %rdi
leaq 0x7846(%rip), %rsi      # 0xb103
callq 0x92f8
testl %eax, %eax
je 0x3b16
movq %r13, %rdi
leaq 0x7831(%rip), %rsi      # 0xb105
callq 0x92f8
testl %eax, %eax
je 0x38f2
movq -0xa8(%rbp), %rax
cmpq -0xb0(%rbp), %rax
je 0x392e
jmp 0x3b40
movslq -0x2c(%rbp), %rax
incq %rax
movl %eax, -0x2c(%rbp)
imulq $0x38, %rax, %rbx
addq (%r14), %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8d36
movq 0x20(%rbx), %rax
movq %rax, -0x50(%rbp)
movq 0x28(%rbx), %rax
movq %rax, -0x48(%rbp)
addq $0x30, %rbx
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0x6f58
movq %r12, %rdi
movq %r14, %rsi
callq 0x68e8
movl -0x2c(%rbp), %edx
leaq -0x1c0(%rbp), %rdi
movq %r12, %rsi
callq 0x3ea5
movq %r12, %rdi
callq 0x6770
movq -0x1b8(%rbp), %rbx
testq %rbx, %rbx
je 0x3992
xorps %xmm0, %xmm0
movaps %xmm0, -0x90(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x38(%rbp), %rdi
movq %r15, %rsi
leaq -0x2c(%rbp), %rdx
leaq -0x1c0(%rbp), %rcx
callq 0x70ec
movq %r15, %rdi
callq 0x683e
jmp 0x39ae
leaq -0xb0(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x698a
movl -0x1a0(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpb $0x1, -0x108(%rbp)
jne 0x39ca
movb $0x0, -0x108(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x722c
cmpb $0x1, -0x140(%rbp)
jne 0x39e6
movb $0x0, -0x140(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x683e
cmpb $0x1, -0x178(%rbp)
jne 0x3a18
movb $0x0, -0x178(%rbp)
movq -0x198(%rbp), %rdi
leaq -0x188(%rbp), %rax
cmpq %rax, %rdi
je 0x3a18
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x3a3a
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3a48
callq 0x6fa2
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3a61
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21c0
testq %rbx, %rbx
je 0x380f
jmp 0x3d52
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
leaq -0xc8(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x769d(%rip), %rsi      # 0xb12d
leaq 0x76b8(%rip), %rdx      # 0xb14f
leaq -0xd8(%rbp), %rdi
callq 0x8c32
movslq -0x2c(%rbp), %rax
movq (%r14), %r14
imulq $0x38, %rax, %r12
leaq -0x1e8(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r14,%r12), %rsi
movq 0x8(%r14,%r12), %rdx
addq %rsi, %rdx
leaq -0x1f8(%rbp), %rdi
callq 0x84f0
addq %r12, %r14
movq 0x20(%r14), %rax
movq %rax, -0x1d8(%rbp)
movq 0x28(%r14), %rax
movq %rax, -0x1d0(%rbp)
movq 0x30(%r14), %rax
movq %rax, -0x1c8(%rbp)
testq %rax, %rax
je 0x3bd4
movq 0xb4bb(%rip), %rcx      # 0xefc0
cmpb $0x0, (%rcx)
je 0x3bd0
incl 0x8(%rax)
jmp 0x3bd4
movl -0x2c(%rbp), %eax
incl %eax
leaq -0x1c0(%rbp), %rdx
movl %eax, (%rdx)
leaq 0x76dc(%rip), %rcx      # 0xb207
leaq -0xb0(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x7074
jmp 0x3d2b
xorps %xmm0, %xmm0
movaps %xmm0, -0x90(%rbp)
movq $0x0, -0x80(%rbp)
leaq -0xe8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x75a3(%rip), %rsi      # 0xb107
leaq 0x75c1(%rip), %rdx      # 0xb12c
leaq -0xf8(%rbp), %rdi
callq 0x8c32
leaq -0x220(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0x230(%rbp), %rdi
callq 0x84f0
movups -0x50(%rbp), %xmm0
movups %xmm0, -0x210(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x200(%rbp)
testq %rax, %rax
je 0x3c81
movq 0xb401(%rip), %rcx      # 0xefc0
cmpb $0x0, (%rcx)
je 0x3c7d
incl 0x8(%rax)
jmp 0x3c81
lock
incl 0x8(%rax)
leaq -0x1c0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0x1f8(%rbp), %rdx
callq 0x35ad
leaq -0x70(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
leaq -0x1c0(%rbp), %rcx
movq -0x38(%rbp), %rdi
callq 0x70ec
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x3c28
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x1c8(%rbp), %rdi
testq %rdi, %rdi
je 0x3c39
callq 0x6fa2
movq -0x1f8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3c54
movq -0x1e8(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0xd8(%rbp), %rdi
cmpq %r15, %rdi
je 0x3c6f
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0x70(%rbp), %rdi
callq 0x683e
jmp 0x3d52
lock
incl 0x8(%rax)
leaq -0x1c0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x230(%rbp), %rdx
callq 0x35ad
leaq -0x90(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
leaq -0x1c0(%rbp), %rcx
movq -0x38(%rbp), %rdi
callq 0x70ec
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x3cd8
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x200(%rbp), %rdi
testq %rdi, %rdi
je 0x3ce9
callq 0x6fa2
movq -0x230(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3d04
movq -0x220(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0xf8(%rbp), %rdi
cmpq %r14, %rdi
je 0x3d1f
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0x90(%rbp), %rdi
callq 0x683e
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3d39
callq 0x6fa2
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3d52
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0xb0(%rbp), %rdi
callq 0x683e
movq -0x38(%rbp), %rax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x3d9e
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x3d9e
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x6734
jmp 0x3daf
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
cmpq %r14, %rdi
je 0x3dcf
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x3dcf
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x683e
jmp 0x3e83
jmp 0x3e6f
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x3e0f
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x3e0f
movq %rax, %rbx
leaq -0x1f8(%rbp), %rdi
callq 0x6734
jmp 0x3e20
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r15, %rdi
je 0x3e40
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x3e40
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x683e
jmp 0x3e91
jmp 0x3e6f
movq %rax, %rbx
jmp 0x3e61
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x683e
leaq -0x1c0(%rbp), %rdi
callq 0x69c8
jmp 0x3e83
movq %rax, %rbx
jmp 0x3e83
movq %rax, %rbx
leaq -0x248(%rbp), %rdi
callq 0x6770
leaq -0x70(%rbp), %rdi
callq 0x6734
jmp 0x3e91
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x683e
movq %rbx, %rdi
callq 0x2290