// File: /workspace/github_cpp_makefile_star2_O3/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 0x6e6e
testb %al, %al
je 0x6e89
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0xc8(%r14), %rsi
movq 0xd0(%r14), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe276
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xe276
leaq 0x30(%rsp), %rdi
callq 0x10e6c
movl %eax, (%rbx)
movb $0x1, 0x4(%rbx)
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x6e55
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e79
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x6e79
testb %al, %al
jne 0x6eee
movq $0x0, (%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 0xfb40(%rip), %rsi      # 0x169e6
leaq 0xfb5c(%rip), %rdx      # 0x16a09
leaq 0x10(%rsp), %rdi
callq 0xe30c
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x5410
leaq 0x1866a(%rip), %rax     # 0x1f538
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x18596(%rip), %rsi     # 0x1f470
movq 0x1909f(%rip), %rdx     # 0x1ff80
movq %r14, %rdi
callq 0x55d0
jmp 0x7060
movl $0x10, %edi
callq 0x51a0
movq %rax, %r14
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfaff(%rip), %rsi      # 0x16a0a
leaq 0xfb27(%rip), %rdx      # 0x16a39
leaq 0x10(%rsp), %rdi
callq 0xe30c
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x5410
leaq 0x1862d(%rip), %rax     # 0x1f560
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x18549(%rip), %rsi     # 0x1f488
movq 0x1903a(%rip), %rdx     # 0x1ff80
movq %r14, %rdi
callq 0x55d0
jmp 0x7060
jmp 0x6f55
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x6f6f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
testb %bpl, %bpl
jne 0x6f7e
jmp 0x709b
jmp 0x6f7b
movq %rax, %rbx
movq %r14, %rdi
callq 0x5270
jmp 0x709b
movq %rdx, %r14
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x6fb0
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x6fb0
movq %rdx, %r14
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x6fcf
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x6fcf
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x709b
movq %rbx, %rdi
callq 0x5400
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x5590
movq 0x18f68(%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 0x9ac6
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x5410
leaq 0x1851b(%rip), %rax     # 0x1f560
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x18437(%rip), %rsi     # 0x1f488
movq 0x18f28(%rip), %rdx     # 0x1ff80
movq %r14, %rdi
callq 0x55d0
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x707a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
testb %bpl, %bpl
jne 0x7084
jmp 0x708c
movq %rax, %rbx
movq %r14, %rdi
callq 0x5270
leaq 0x50(%rsp), %rdi
callq 0x5690
callq 0x5580
movq %rbx, %rdi
callq 0x5600
movq %rax, %rdi
callq 0x9b59