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

      if (t.value == ",") {
        index++;
        t = tokens[index];
      } else if (values.size() > 0) {
        return {
            {},
            index,
            format_parse_error("Expected comma after element in object", t)};
      } else {
        return {{},
                index,
                format_parse_error(
                    "Expected key-value pair or closing brace in object", t)};
      }
    }

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

    if (key.type != JSONValueType::String) {
      return {
          {}, index, format_parse_error("Expected string key in object", t)};
    }
    index = new_index;
    t = tokens[index];

    if (!(t.type == JSONTokenType::Syntax && t.value == ":")) {
      return {{},
              index,
              format_parse_error("Expected colon after key in object", t)};
    }
    index++;
    t = tokens[index];

    auto [value, new_index1, error1] = parse(tokens, index);
    if (error1.size()) {
      return {{}, index, error1};
    }

    values[key.string.value()] = value;
    index = new_index1;
  }

  return {values, index + 1, ""};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x640, %rsp            # imm = 0x640
movq %rsi, -0x5e0(%rbp)
movq %rdi, -0x5d8(%rbp)
movq %rdi, %rax
movq %rax, -0x5d0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x40f0
leaq -0x48(%rbp), %rdi
callq 0x9180
movq -0x5e0(%rbp), %rdi
movslq -0x14(%rbp), %rax
movq %rax, -0x5e8(%rbp)
callq 0x8d70
movq %rax, %rcx
movq -0x5e8(%rbp), %rax
cmpq %rcx, %rax
jae 0x78b4
movq -0x5e0(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x8da0
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x8dc0
jmp 0x6def
cmpl $0x2, -0x60(%rbp)
jne 0x71df
leaq 0xe334(%rip), %rsi      # 0x15134
leaq -0x80(%rbp), %rdi
callq 0x8e10
movb %al, -0x5e9(%rbp)
jmp 0x6e11
movb -0x5e9(%rbp), %al
testb $0x1, %al
jne 0x6e1d
jmp 0x6e85
movq -0x5d8(%rbp), %rdi
movl -0x14(%rbp), %eax
incl %eax
movl %eax, -0x90(%rbp)
leaq 0xe3b5(%rip), %rcx      # 0x151eb
leaq -0x48(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x91a0
jmp 0x6e48
movl $0x1, -0x94(%rbp)
jmp 0x7865
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7902
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x78a9
leaq 0xe25d(%rip), %rsi      # 0x150e9
leaq -0x80(%rbp), %rdi
callq 0x8e10
movb %al, -0x5ea(%rbp)
jmp 0x6e9d
movb -0x5ea(%rbp), %al
testb $0x1, %al
jne 0x6ea9
jmp 0x6ed4
movq -0x5e0(%rbp), %rdi
movl -0x14(%rbp), %eax
incl %eax
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x8da0
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x8e80
jmp 0x6ecf
jmp 0x71dd
leaq -0x48(%rbp), %rdi
callq 0x91e0
cmpq $0x0, %rax
jbe 0x7062
xorps %xmm0, %xmm0
movaps %xmm0, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps %xmm0, -0xd0(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x9180
leaq -0x111(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
callq 0x42b0
movq -0x5f8(%rbp), %rdx
leaq 0xe20a(%rip), %rsi      # 0x15136
leaq -0x110(%rbp), %rdi
callq 0x8560
jmp 0x6f3a
leaq -0x150(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x8dc0
jmp 0x6f4c
leaq -0xf0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x150(%rbp), %rdx
callq 0x5c50
jmp 0x6f68
movq -0x5d8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x14(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
callq 0x9200
jmp 0x6f88
leaq -0xf0(%rbp), %rdi
callq 0x87f0
leaq -0x150(%rbp), %rdi
callq 0x88b0
leaq -0x110(%rbp), %rdi
callq 0x87f0
leaq -0x111(%rbp), %rdi
callq 0x41d0
leaq -0xd0(%rbp), %rdi
callq 0x9240
movl $0x1, -0x94(%rbp)
jmp 0x7865
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7045
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7039
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x702d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x87f0
leaq -0x150(%rbp), %rdi
callq 0x88b0
leaq -0x110(%rbp), %rdi
callq 0x87f0
leaq -0x111(%rbp), %rdi
callq 0x41d0
leaq -0xd0(%rbp), %rdi
callq 0x9240
jmp 0x78a9
xorps %xmm0, %xmm0
movaps %xmm0, -0x160(%rbp)
movaps %xmm0, -0x170(%rbp)
movaps %xmm0, -0x180(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x9180
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x600(%rbp)
callq 0x42b0
movq -0x600(%rbp), %rdx
leaq 0xe0b6(%rip), %rsi      # 0x1515d
leaq -0x1c0(%rbp), %rdi
callq 0x8560
jmp 0x70b5
leaq -0x200(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x8dc0
jmp 0x70c7
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
leaq -0x200(%rbp), %rdx
callq 0x5c50
jmp 0x70e3
movq -0x5d8(%rbp), %rdi
leaq -0x180(%rbp), %rsi
leaq -0x14(%rbp), %rdx
leaq -0x1a0(%rbp), %rcx
callq 0x9200
jmp 0x7103
leaq -0x1a0(%rbp), %rdi
callq 0x87f0
leaq -0x200(%rbp), %rdi
callq 0x88b0
leaq -0x1c0(%rbp), %rdi
callq 0x87f0
leaq -0x1c1(%rbp), %rdi
callq 0x41d0
leaq -0x180(%rbp), %rdi
callq 0x9240
movl $0x1, -0x94(%rbp)
jmp 0x7865
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x71c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x71b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x71a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x87f0
leaq -0x200(%rbp), %rdi
callq 0x88b0
leaq -0x1c0(%rbp), %rdi
callq 0x87f0
leaq -0x1c1(%rbp), %rdi
callq 0x41d0
leaq -0x180(%rbp), %rdi
callq 0x9240
jmp 0x78a9
jmp 0x71df
movq -0x5e0(%rbp), %rsi
leaq -0x2e0(%rbp), %rdi
callq 0x8fa0
jmp 0x71f4
movl -0x14(%rbp), %edx
leaq -0x2c8(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x6480
jmp 0x720c
leaq -0x2e0(%rbp), %rdi
callq 0x8bb0
leaq -0x2c8(%rbp), %rdi
callq 0x9090
movq %rax, -0x2e8(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x90b0
movq %rax, -0x2f0(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x90d0
movq %rax, -0x2f8(%rbp)
movq -0x2f8(%rbp), %rdi
callq 0x87a0
cmpq $0x0, %rax
je 0x7313
xorps %xmm0, %xmm0
movaps %xmm0, -0x310(%rbp)
movaps %xmm0, -0x320(%rbp)
movaps %xmm0, -0x330(%rbp)
leaq -0x330(%rbp), %rdi
movq %rdi, -0x608(%rbp)
callq 0x9180
movq -0x5d8(%rbp), %rdi
movq -0x608(%rbp), %rsi
movq -0x2f8(%rbp), %rcx
leaq -0x14(%rbp), %rdx
callq 0x9200
jmp 0x72b2
leaq -0x330(%rbp), %rdi
callq 0x9240
movl $0x1, -0x94(%rbp)
jmp 0x7859
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x8bb0
jmp 0x78a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x330(%rbp), %rdi
callq 0x9240
jmp 0x789d
movq -0x2e8(%rbp), %rax
cmpl $0x0, 0x98(%rax)
je 0x74a2
xorps %xmm0, %xmm0
movaps %xmm0, -0x340(%rbp)
movaps %xmm0, -0x350(%rbp)
movaps %xmm0, -0x360(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x9180
leaq -0x3a1(%rbp), %rdi
movq %rdi, -0x610(%rbp)
callq 0x42b0
movq -0x610(%rbp), %rdx
leaq 0xde24(%rip), %rsi      # 0x15190
leaq -0x3a0(%rbp), %rdi
callq 0x8560
jmp 0x737a
leaq -0x3e0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x8dc0
jmp 0x738c
leaq -0x380(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
leaq -0x3e0(%rbp), %rdx
callq 0x5c50
jmp 0x73a8
movq -0x5d8(%rbp), %rdi
leaq -0x360(%rbp), %rsi
leaq -0x14(%rbp), %rdx
leaq -0x380(%rbp), %rcx
callq 0x9200
jmp 0x73c8
leaq -0x380(%rbp), %rdi
callq 0x87f0
leaq -0x3e0(%rbp), %rdi
callq 0x88b0
leaq -0x3a0(%rbp), %rdi
callq 0x87f0
leaq -0x3a1(%rbp), %rdi
callq 0x41d0
leaq -0x360(%rbp), %rdi
callq 0x9240
movl $0x1, -0x94(%rbp)
jmp 0x7859
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7485
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7479
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x746d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x87f0
leaq -0x3e0(%rbp), %rdi
callq 0x88b0
leaq -0x3a0(%rbp), %rdi
callq 0x87f0
leaq -0x3a1(%rbp), %rdi
callq 0x41d0
leaq -0x360(%rbp), %rdi
callq 0x9240
jmp 0x789d
movq -0x5e0(%rbp), %rdi
movq -0x2f0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x8da0
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x8e80
jmp 0x74cc
cmpl $0x2, -0x60(%rbp)
jne 0x74fa
leaq 0xdcd5(%rip), %rsi      # 0x151ae
leaq -0x80(%rbp), %rdi
callq 0x8e10
movb %al, -0x611(%rbp)
jmp 0x74ea
movb -0x611(%rbp), %al
testb $0x1, %al
jne 0x768c
jmp 0x74fa
xorps %xmm0, %xmm0
movaps %xmm0, -0x3f0(%rbp)
movaps %xmm0, -0x400(%rbp)
movaps %xmm0, -0x410(%rbp)
leaq -0x410(%rbp), %rdi
callq 0x9180
leaq -0x451(%rbp), %rdi
movq %rdi, -0x620(%rbp)
callq 0x42b0
movq -0x620(%rbp), %rdx
leaq 0xdc71(%rip), %rsi      # 0x151b0
leaq -0x450(%rbp), %rdi
callq 0x8560
jmp 0x754d
leaq -0x490(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x8dc0
jmp 0x755f
leaq -0x430(%rbp), %rdi
leaq -0x450(%rbp), %rsi
leaq -0x490(%rbp), %rdx
callq 0x5c50
jmp 0x757b
movq -0x5d8(%rbp), %rdi
leaq -0x410(%rbp), %rsi
leaq -0x14(%rbp), %rdx
leaq -0x430(%rbp), %rcx
callq 0x9200
jmp 0x759b
leaq -0x430(%rbp), %rdi
callq 0x87f0
leaq -0x490(%rbp), %rdi
callq 0x88b0
leaq -0x450(%rbp), %rdi
callq 0x87f0
leaq -0x451(%rbp), %rdi
callq 0x41d0
leaq -0x410(%rbp), %rdi
callq 0x9240
movl $0x1, -0x94(%rbp)
jmp 0x7859
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x789d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x766f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7663
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7657
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x87f0
leaq -0x490(%rbp), %rdi
callq 0x88b0
leaq -0x450(%rbp), %rdi
callq 0x87f0
leaq -0x451(%rbp), %rdi
callq 0x41d0
leaq -0x410(%rbp), %rdi
callq 0x9240
jmp 0x789d
movq -0x5e0(%rbp), %rdi
movl -0x14(%rbp), %eax
incl %eax
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x8da0
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x8e80
jmp 0x76b2
movq -0x5e0(%rbp), %rsi
leaq -0x570(%rbp), %rdi
callq 0x8fa0
jmp 0x76c7
movl -0x14(%rbp), %edx
leaq -0x558(%rbp), %rdi
leaq -0x570(%rbp), %rsi
callq 0x6480
jmp 0x76df
leaq -0x570(%rbp), %rdi
callq 0x8bb0
leaq -0x558(%rbp), %rdi
callq 0x9090
movq %rax, -0x578(%rbp)
leaq -0x558(%rbp), %rdi
callq 0x90b0
movq %rax, -0x580(%rbp)
leaq -0x558(%rbp), %rdi
callq 0x90d0
movq %rax, -0x588(%rbp)
movq -0x588(%rbp), %rdi
callq 0x87a0
cmpq $0x0, %rax
je 0x77e6
xorps %xmm0, %xmm0
movaps %xmm0, -0x5a0(%rbp)
movaps %xmm0, -0x5b0(%rbp)
movaps %xmm0, -0x5c0(%rbp)
leaq -0x5c0(%rbp), %rdi
movq %rdi, -0x628(%rbp)
callq 0x9180
movq -0x5d8(%rbp), %rdi
movq -0x628(%rbp), %rsi
movq -0x588(%rbp), %rcx
leaq -0x14(%rbp), %rdx
callq 0x9200
jmp 0x7785
leaq -0x5c0(%rbp), %rdi
callq 0x9240
movl $0x1, -0x94(%rbp)
jmp 0x784d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x570(%rbp), %rdi
callq 0x8bb0
jmp 0x789d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x5c0(%rbp), %rdi
callq 0x9240
jmp 0x7891
movq -0x578(%rbp), %rax
movq %rax, -0x638(%rbp)
movq -0x2e8(%rbp), %rdi
callq 0x9340
movq %rax, -0x630(%rbp)
jmp 0x7809
movq -0x630(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x9260
movq %rax, -0x640(%rbp)
jmp 0x7822
movq -0x638(%rbp), %rsi
movq -0x640(%rbp), %rdi
callq 0x9380
jmp 0x7837
movq -0x580(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x94(%rbp)
leaq -0x558(%rbp), %rdi
callq 0x9160
leaq -0x2c8(%rbp), %rdi
callq 0x9160
leaq -0x80(%rbp), %rdi
callq 0x88b0
movl -0x94(%rbp), %eax
testl %eax, %eax
jne 0x78e9
jmp 0x787a
jmp 0x6da7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x558(%rbp), %rdi
callq 0x9160
leaq -0x2c8(%rbp), %rdi
callq 0x9160
leaq -0x80(%rbp), %rdi
callq 0x88b0
jmp 0x7902
movq -0x5d8(%rbp), %rdi
movl -0x14(%rbp), %eax
incl %eax
movl %eax, -0x5c4(%rbp)
leaq 0xd91e(%rip), %rcx      # 0x151eb
leaq -0x48(%rbp), %rsi
leaq -0x5c4(%rbp), %rdx
callq 0x91a0
jmp 0x78df
movl $0x1, -0x94(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x9240
movq -0x5d0(%rbp), %rax
addq $0x640, %rsp            # imm = 0x640
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x9240
movq -0x88(%rbp), %rdi
callq 0x42a0
nopw (%rax,%rax)