// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]byzantine-agreement/src/main.cc
// Function: ValidateOrder(args::ValueFlag<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, args::ValueReader<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, bool)
std::experimental::optional<msg::Order> ValidateOrder(StringFlag& order,
                                                      bool is_commander) {
  if (is_commander) {
    if (!order) {
      throw args::UsageError("the commander must specify an order");
    }

    try {
      auto order_val = args::get(order);
      return msg::StringToOrder(order_val);
    } catch (std::invalid_argument e) {
      throw args::ValidationError(e.what());
    }
  } else {
    if (order) {
      throw args::ValidationError(
          "only the commander process can specify an order");
    }
    return {};
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x10(%rax)
testl %ebp, %ebp
je 0x6e3d
testb %al, %al
je 0x6e60
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0xc8(%r14), %rsi
movq 0xd0(%r14), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe3ee
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xe3ee
leaq 0x30(%rsp), %rdi
callq 0x11088
movl %eax, (%rbx)
movb $0x1, 0x4(%rbx)
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x6e24
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e50
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x6e50
testb %al, %al
jne 0x6ec5
movq $0x0, (%rbx)
movb $0x0, 0x4(%rbx)
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x51a0
movq %rax, %r14
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfb69(%rip), %rsi      # 0x169e6
leaq 0xfb85(%rip), %rdx      # 0x16a09
leaq 0x10(%rsp), %rdi
callq 0xe47e
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x5410
leaq 0x1865b(%rip), %rax     # 0x1f500
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x18587(%rip), %rsi     # 0x1f438
movq 0x190c8(%rip), %rdx     # 0x1ff80
movq %r14, %rdi
callq 0x55d0
jmp 0x703b
movl $0x10, %edi
callq 0x51a0
movq %rax, %r14
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfb28(%rip), %rsi      # 0x16a0a
leaq 0xfb50(%rip), %rdx      # 0x16a39
leaq 0x10(%rsp), %rdi
callq 0xe47e
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x5410
leaq 0x1861e(%rip), %rax     # 0x1f528
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x1853a(%rip), %rsi     # 0x1f450
movq 0x19063(%rip), %rdx     # 0x1ff80
movq %r14, %rdi
callq 0x55d0
jmp 0x703b
jmp 0x6f2c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x6f50
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x6f50
jmp 0x6f4a
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7079
movq %r14, %rdi
callq 0x5270
jmp 0x7079
movq %rdx, %r14
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x6f8b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x6f8b
movq %rdx, %r14
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x6faa
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x6faa
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x7079
movq %rbx, %rdi
callq 0x5400
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x5590
movq 0x18f8d(%rip), %rax     # 0x1ff60
addq $0x10, %rax
movq %rax, (%r15)
movq %rbx, %rdi
callq 0x5160
movl $0x10, %edi
callq 0x51a0
movq %rax, %r14
movq %r15, %rdi
callq 0x54f0
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x9a9c
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x5410
leaq 0x18508(%rip), %rax     # 0x1f528
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x18424(%rip), %rsi     # 0x1f450
movq 0x18f4d(%rip), %rdx     # 0x1ff80
movq %r14, %rdi
callq 0x55d0
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x705d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x705d
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x706a
movq %r14, %rdi
callq 0x5270
leaq 0x50(%rsp), %rdi
callq 0x5690
callq 0x5580
movq %rbx, %rdi
callq 0x5600
movq %rax, %rdi
callq 0x9b2f