// File: eatonphil[P]cpp-json/main.cpp
// Function: main
int main(int argc, char *argv[]) {
  if (argc == 1) {
    std::cerr << "Expected JSON input argument to parse" << std::endl;
    return 1;
  }

  std::string in{argv[1]};

  auto [ast, error] = json::parse(in);
  if (error.size()) {
    std::cerr << error << std::endl;
    return 1;
  }

  std::cout << json::deparse(ast);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jne 0x1492d
movq 0xb6ea(%rip), %rdi      # 0x1fff0
leaq 0xaf4(%rip), %rsi       # 0x15401
callq 0x4180
movq %rax, %rdi
movq 0xb684(%rip), %rsi      # 0x1ffa0
callq 0x41c0
movl $0x1, -0x4(%rbp)
jmp 0x14b41
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x238(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x42b0
movq -0x238(%rbp), %rsi
movq -0x230(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x8560
jmp 0x14965
leaq -0x31(%rbp), %rdi
callq 0x41d0
leaq -0x128(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x88e0
jmp 0x14980
leaq -0x108(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x7920
jmp 0x14995
leaq -0x128(%rbp), %rdi
callq 0x87f0
leaq -0x108(%rbp), %rdi
callq 0x14bd0
movq %rax, -0x130(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x14bf0
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
callq 0x87a0
cmpq $0x0, %rax
je 0x14a7d
movq -0x138(%rbp), %rsi
movq 0xb605(%rip), %rdi      # 0x1fff0
callq 0x4170
movq %rax, -0x240(%rbp)
jmp 0x149f9
movq -0x240(%rbp), %rdi
movq 0xb599(%rip), %rsi      # 0x1ffa0
callq 0x41c0
jmp 0x14a0e
movl $0x1, -0x4(%rbp)
movl $0x1, -0x13c(%rbp)
jmp 0x14b2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x41d0
jmp 0x14bba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x14bb1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x87f0
jmp 0x14bb1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x14ba5
movq -0x130(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x9c60
jmp 0x14a92
leaq -0x221(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x42b0
movq -0x248(%rbp), %rdx
leaq 0x738(%rip), %rsi       # 0x151eb
leaq -0x220(%rbp), %rdi
callq 0x8560
jmp 0x14ac1
leaq -0x160(%rbp), %rdi
leaq -0x200(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x7b80
jmp 0x14add
movq 0xb4ec(%rip), %rdi      # 0x1ffd0
leaq -0x160(%rbp), %rsi
callq 0x4170
jmp 0x14af2
leaq -0x160(%rbp), %rdi
callq 0x87f0
leaq -0x220(%rbp), %rdi
callq 0x87f0
leaq -0x221(%rbp), %rdi
callq 0x41d0
leaq -0x200(%rbp), %rdi
callq 0x9540
movl $0x0, -0x13c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x14c10
leaq -0x30(%rbp), %rdi
callq 0x87f0
movl -0x4(%rbp), %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x14b8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x14b81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x87f0
leaq -0x220(%rbp), %rdi
callq 0x87f0
leaq -0x221(%rbp), %rdi
callq 0x41d0
leaq -0x200(%rbp), %rdi
callq 0x9540
leaq -0x108(%rbp), %rdi
callq 0x14c10
leaq -0x30(%rbp), %rdi
callq 0x87f0
movq -0x40(%rbp), %rdi
callq 0x42a0
nopw %cs:(%rax,%rax)
nopl (%rax)