// File: mattn[P]wandbox-run/wandbox.cxx
// Function: main
int
main(int argc, char* argv[]) {
  if (argc < 3) {
    std::cerr << "usage: " << argv[0] << " [compiler] [file] [arguments...]" << std::endl;
    return languages();
  }
  std::stringstream ss;
  if (std::string(argv[2]) != "-") {
    std::ifstream in(argv[2], std::ifstream::in);
    std::string line;
    std::getline(in, line);
    if (line.find("#!") != 0 && line.find("@wandbox-run") != 0)
      ss << line + "\n";
    ss << in.rdbuf();
  } else {
    ss << std::cin.rdbuf();
  }

  nlohmann::json obj;
  obj["code"] = ss.str();

  reset_stream(ss);
  obj["compiler"] = argv[1];
  for (int i = 3; i < argc; i++) {
    if (i > 3)  ss << "\n";
    ss << argv[i];
  }
  obj["runtime-option-raw"] = ss.str();

  return run(obj);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x550, %rsp            # imm = 0x550
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x1637c
leaq 0x10606a(%rip), %rdi    # 0x11c3a0
leaq 0xbe217(%rip), %rsi     # 0xd4554
callq 0x920f0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x920f0
movq %rax, %rdi
leaq 0xbe201(%rip), %rsi     # 0xd455c
callq 0x920f0
movq %rax, %rdi
leaq 0x7b666(%rip), %rsi     # 0x919d0
callq 0x90be0
callq 0x169d0
movl %eax, -0x4(%rbp)
jmp 0x169a9
leaq -0x198(%rbp), %rdi
callq 0x9b640
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x4d8(%rbp)
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x26cc0
movq -0x4d8(%rbp), %rsi
movq -0x4d0(%rbp), %rdx
leaq -0x1b8(%rbp), %rdi
callq 0x17380
jmp 0x163c6
leaq 0xc4fd9(%rip), %rsi     # 0xdb3a6
leaq -0x1b8(%rbp), %rdi
callq 0x17350
movb %al, -0x4d9(%rbp)
jmp 0x163e1
leaq -0x1b8(%rbp), %rdi
callq 0xa23d0
leaq -0x1b9(%rbp), %rdi
callq 0x26ce0
movb -0x4d9(%rbp), %al
testb $0x1, %al
jne 0x16408
jmp 0x165da
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x3d8(%rbp), %rdi
movl $0x8, %edx
callq 0x6e930
jmp 0x16423
leaq -0x3f8(%rbp), %rdi
movq %rdi, -0x4e8(%rbp)
callq 0xa22c0
movq -0x4e8(%rbp), %rsi
leaq -0x3d8(%rbp), %rdi
callq 0xa4e10
jmp 0x1644b
leaq -0x3f8(%rbp), %rdi
leaq 0xbe125(%rip), %rsi     # 0xd457e
xorl %eax, %eax
movl %eax, %edx
callq 0xa3f30
cmpq $0x0, %rax
je 0x1656b
leaq -0x3f8(%rbp), %rdi
leaq 0xbe107(%rip), %rsi     # 0xd4581
xorl %eax, %eax
movl %eax, %edx
callq 0xa3f30
cmpq $0x0, %rax
je 0x1656b
leaq -0x188(%rbp), %rax
movq %rax, -0x4f0(%rbp)
leaq 0xc1052(%rip), %rdx     # 0xd74f4
leaq -0x418(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x17430
jmp 0x164b7
movq -0x4f0(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0xa4e00
jmp 0x164cc
leaq -0x418(%rbp), %rdi
callq 0xa23d0
jmp 0x1656b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0x1650f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0xa23d0
leaq -0x1b9(%rbp), %rdi
callq 0x26ce0
jmp 0x1699b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0x1699b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0x165bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x418(%rbp), %rdi
callq 0xa23d0
jmp 0x165bd
leaq -0x188(%rbp), %rax
movq %rax, -0x500(%rbp)
leaq -0x3d8(%rbp), %rdi
callq 0x6aad0
movq %rax, -0x4f8(%rbp)
jmp 0x1658e
movq -0x4f8(%rbp), %rsi
movq -0x500(%rbp), %rdi
callq 0x91500
jmp 0x165a3
leaq -0x3f8(%rbp), %rdi
callq 0xa23d0
leaq -0x3d8(%rbp), %rdi
callq 0x6f290
jmp 0x1661e
leaq -0x3f8(%rbp), %rdi
callq 0xa23d0
leaq -0x3d8(%rbp), %rdi
callq 0x6f290
jmp 0x1699b
leaq -0x188(%rbp), %rax
movq %rax, -0x510(%rbp)
leaq 0x105ff1(%rip), %rdi    # 0x11c5e0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x72b40
movq %rax, -0x508(%rbp)
jmp 0x16607
movq -0x508(%rbp), %rsi
movq -0x510(%rbp), %rdi
callq 0x91500
jmp 0x1661c
jmp 0x1661e
xorl %eax, %eax
movl %eax, %esi
leaq -0x428(%rbp), %rdi
callq 0x174b0
leaq -0x458(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x9c610
jmp 0x16643
leaq -0x438(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0x174f0
jmp 0x16658
leaq 0xbdf2f(%rip), %rsi     # 0xd458e
leaq -0x428(%rbp), %rdi
callq 0x17540
movq %rax, -0x518(%rbp)
jmp 0x16674
movq -0x518(%rbp), %rdi
leaq -0x438(%rbp), %rsi
movq %rsi, -0x528(%rbp)
callq 0x17740
movq -0x528(%rbp), %rdi
callq 0x177b0
leaq -0x458(%rbp), %rdi
callq 0xa23d0
leaq -0x479(%rbp), %rdi
movq %rdi, -0x520(%rbp)
callq 0x26cc0
movq -0x520(%rbp), %rdx
leaq 0xbefc8(%rip), %rsi     # 0xd568f
leaq -0x478(%rbp), %rdi
callq 0x17380
jmp 0x166d5
leaq -0x198(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x9c6a0
jmp 0x166ea
leaq -0x478(%rbp), %rdi
callq 0xa23d0
leaq -0x479(%rbp), %rdi
callq 0x26ce0
movq -0x198(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x198(%rbp,%rax), %rdi
xorl %esi, %esi
callq 0x72a40
jmp 0x1671e
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
leaq -0x490(%rbp), %rdi
callq 0x178b0
jmp 0x16734
leaq 0xbde58(%rip), %rsi     # 0xd4593
leaq -0x428(%rbp), %rdi
callq 0x17540
movq %rax, -0x530(%rbp)
jmp 0x16750
movq -0x530(%rbp), %rdi
leaq -0x490(%rbp), %rsi
callq 0x17740
leaq -0x490(%rbp), %rdi
callq 0x177b0
movl $0x3, -0x494(%rbp)
movl -0x494(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x168a2
cmpl $0x3, -0x494(%rbp)
jle 0x1686f
leaq -0x188(%rbp), %rdi
leaq 0xc0d51(%rip), %rsi     # 0xd74f4
callq 0x920f0
jmp 0x167aa
jmp 0x1686f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0x1698f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0x167f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x438(%rbp), %rdi
callq 0x177b0
leaq -0x458(%rbp), %rdi
callq 0xa23d0
jmp 0x1698f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0x1683b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x478(%rbp), %rdi
callq 0xa23d0
leaq -0x479(%rbp), %rdi
callq 0x26ce0
jmp 0x1698f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x490(%rbp), %rdi
callq 0x177b0
jmp 0x1698f
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x494(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x920f0
jmp 0x1688c
jmp 0x1688e
movl -0x494(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x494(%rbp)
jmp 0x16779
leaq -0x4c8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x9c610
jmp 0x168b7
leaq -0x4a8(%rbp), %rdi
leaq -0x4c8(%rbp), %rsi
callq 0x174f0
jmp 0x168cc
leaq 0xbdcc9(%rip), %rsi     # 0xd459c
leaq -0x428(%rbp), %rdi
callq 0x17540
movq %rax, -0x538(%rbp)
jmp 0x168e8
movq -0x538(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
movq %rsi, -0x548(%rbp)
callq 0x17740
movq -0x548(%rbp), %rdi
callq 0x177b0
leaq -0x4c8(%rbp), %rdi
callq 0xa23d0
leaq -0x428(%rbp), %rdi
callq 0x16cf0
movl %eax, -0x53c(%rbp)
jmp 0x1692e
movl -0x53c(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x428(%rbp), %rdi
callq 0x177b0
leaq -0x198(%rbp), %rdi
callq 0x97a60
jmp 0x169a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0x16983
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x4a8(%rbp), %rdi
callq 0x177b0
leaq -0x4c8(%rbp), %rdi
callq 0xa23d0
leaq -0x428(%rbp), %rdi
callq 0x177b0
leaq -0x198(%rbp), %rdi
callq 0x97a60
jmp 0x169b5
movl -0x4(%rbp), %eax
addq $0x550, %rsp            # imm = 0x550
popq %rbp
retq
movq -0x1c8(%rbp), %rdi
callq 0xd1250
nopw %cs:(%rax,%rax)