// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]byzantine-agreement/src/main.cc
// Function: GetMaliciousBehavior(args::ValueFlagList<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector, args::ValueReader<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, bool)
generals::MaliciousBehavior GetMaliciousBehavior(StringFlagList& malicious,
                                                 bool is_commander) {
  // Create the MaliciousBehavior instance.
  generals::MaliciousBehavior b = generals::MaliciousBehavior::NONE;
  try {
    for (const auto mal : args::get(malicious)) {
      b |= generals::StringToMaliciousBehavior(mal);
    }
  } catch (std::invalid_argument e) {
    throw args::ValidationError(e.what());
  }

  // Validate that the malicious behavior is valid for the general type.
  if (is_commander) {
    for (auto const& not_avail : only_lieutenant_behavior) {
      if (generals::Exhibits(b, not_avail)) {
        throw args::ValidationError(
            "only a lieutenant can have the malicious behavior \"" +
            generals::MaliciousBehaviorString(not_avail) + "\"");
      }
    }
  } else {
    for (auto const& not_avail : only_commander_behavior) {
      if (generals::Exhibits(b, not_avail)) {
        throw args::ValidationError(
            "only a commander can have the malicious behavior \"" +
            generals::MaliciousBehaviorString(not_avail) + "\"");
      }
    }
  }

  return b;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, 0x24(%rsp)
movq 0xc8(%rdi), %r13
movq 0xd0(%rdi), %r14
xorl %ebx, %ebx
cmpq %r14, %r13
je 0x713f
leaq 0x78(%rsp), %rbp
leaq 0x68(%rsp), %r15
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0xe3ee
movq %rbp, 0x68(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xe3ee
movq %r15, %rdi
callq 0x117a3
movl %eax, %r12d
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7118
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7133
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
orl %r12d, %ebx
addq $0x20, %r13
cmpq %r14, %r13
jne 0x70c1
cmpb $0x0, 0x24(%rsp)
je 0x7171
movq 0x193d3(%rip), %r15     # 0x20520
leaq 0x193bc(%rip), %r14     # 0x20510
cmpq %r14, %r15
je 0x719e
testl %ebx, 0x20(%r15)
jne 0x71b2
movq %r15, %rdi
callq 0x53d0
movq %rax, %r15
cmpq %r14, %rax
jne 0x7159
jmp 0x719e
movq 0x193d8(%rip), %r15     # 0x20550
leaq 0x193c1(%rip), %r14     # 0x20540
cmpq %r14, %r15
je 0x719e
testl %ebx, 0x20(%r15)
jne 0x7215
movq %r15, %rdi
callq 0x53d0
movq %rax, %r15
cmpq %r14, %rax
jne 0x7184
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x51a0
movq %rax, %r14
movl 0x20(%r15), %esi
leaq 0x48(%rsp), %rdi
callq 0x1185a
leaq 0xf866(%rip), %rsi      # 0x16a3a
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x9c1d
leaq 0xf8b5(%rip), %rsi      # 0x16a9f
leaq 0x28(%rsp), %rdi
callq 0x5660
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7278
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x7284
movl $0x10, %edi
callq 0x51a0
movq %rax, %r14
movl 0x20(%r15), %esi
leaq 0x48(%rsp), %rdi
callq 0x1185a
leaq 0xf837(%rip), %rsi      # 0x16a6e
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x9c1d
leaq 0xf852(%rip), %rsi      # 0x16a9f
leaq 0x28(%rsp), %rdi
callq 0x5660
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x72d0
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x72dc
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r14, %rdi
callq 0x5410
leaq 0x18278(%rip), %rax     # 0x1f528
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x18194(%rip), %rsi     # 0x1f450
movq 0x18cbd(%rip), %rdx     # 0x1ff80
movq %r14, %rdi
callq 0x55d0
jmp 0x7482
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r14, %rdi
callq 0x5410
leaq 0x18220(%rip), %rax     # 0x1f528
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x1813c(%rip), %rsi     # 0x1f450
movq 0x18c65(%rip), %rdx     # 0x1ff80
movq %r14, %rdi
callq 0x55d0
jmp 0x7482
jmp 0x732a
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x734d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x734d
jmp 0x7347
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7372
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x7372
jmp 0x736c
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7397
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x7397
jmp 0x7391
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x74c4
movq %r14, %rdi
callq 0x5270
jmp 0x74c4
movq %rdx, %r14
movq %rax, %rbx
jmp 0x73f5
movq %rdx, %r14
movq %rax, %rbx
jmp 0x73da
movq %rdx, %r14
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x73da
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x73f5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
cmpl $0x1, %r14d
jne 0x74c4
movq %rbx, %rdi
callq 0x5400
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x5590
movq 0x18b42(%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
movq %rsp, %rdi
leaq 0x48(%rsp), %rdx
movq %rax, %rsi
callq 0x9a9c
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x5410
leaq 0x180c1(%rip), %rax     # 0x1f528
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x17fdd(%rip), %rsi     # 0x1f450
movq 0x18b06(%rip), %rdx     # 0x1ff80
movq %r14, %rdi
callq 0x55d0
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x74a8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x74a8
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x74b5
movq %r14, %rdi
callq 0x5270
leaq 0x28(%rsp), %rdi
callq 0x5690
callq 0x5580
movq %rbx, %rdi
callq 0x5600
movq %rax, %rdi
callq 0x9b2f