// File: /workspace/github_cpp_makefile_star2_O2/nvanbenschoten[P]byzantine-agreement/src/general.cc
// Function: generals::Commander::Decide()
msg::Order Commander::Decide() {
  // Send in parallel so that some Lieutenants don't end up far ahead of
  // others.
  threadutil::ThreadGroup senders;
  auto ids = std::vector<unsigned int>{0};
  for (unsigned int pid = 1; pid < processes_.size(); ++pid) {
    if (ShouldSendMsg()) {
      msg::Message msg{round_, OrderForMsg(), ids};
      logging::out << "Sending  " << msg << " to p" << pid << "\n";

      udp::ClientPtr client = ClientForId(pid);
      senders.AddThread([this, client, msg] {
        MaybeDelaySend();
        SendMessage(client, msg);
      });
    }
  }
  senders.JoinAll();
  return order_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
leaq 0x20(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0xb0(%rsp), %rdi
pushq $0x1
popq %rdx
leaq 0x80(%rsp), %rcx
callq 0xffe2
leaq 0x28(%rsp), %r13
pushq $0x1
popq %rax
pushq $0x28
popq %rbx
leaq 0x80(%rsp), %r12
leaq 0xa0(%rsp), %rbp
leaq 0x18(%rsp), %r14
movl %eax, 0xc(%rsp)
movl %eax, %ecx
movq 0x10(%r15), %rax
subq 0x8(%r15), %rax
cqto
idivq %rbx
cmpq %rcx, %rax
jbe 0xf34e
movq %r15, %rdi
callq 0xf04a
testb %al, %al
je 0xf343
movl 0x64(%r15), %eax
movl %eax, 0x80(%rsp)
movq %r15, %rdi
callq 0xf416
movl %eax, 0x84(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x10018
leaq 0x10376(%rip), %rdi     # 0x1f590
leaq 0x54cb(%rip), %rsi      # 0x146ec
callq 0x10066
movq %rax, %rdi
movq %r12, %rsi
callq 0x1007e
movq %rax, %rdi
leaq 0x54bb(%rip), %rsi      # 0x146f6
callq 0x10096
movq %rax, %rdi
leaq 0xc(%rsp), %rsi
callq 0x100ae
movq %rax, %rdi
leaq 0x4903(%rip), %rsi      # 0x13b5a
callq 0x100c8
movl 0xc(%rsp), %edx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x100e0
movq %r15, 0x20(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x10426
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0xff2a
andq $0x0, 0x18(%rsp)
pushq $0x40
popq %rdi
callq 0x5330
leaq 0xfa13(%rip), %rcx      # 0x1ecb0
movq %rcx, (%rax)
movaps 0x20(%rsp), %xmm0
movq 0x30(%rsp), %rcx
andq $0x0, 0x30(%rsp)
movups %xmm0, 0x8(%rax)
andq $0x0, 0x28(%rsp)
movq %rcx, 0x18(%rax)
movq 0x38(%rsp), %rcx
movq %rcx, 0x20(%rax)
movaps 0x40(%rsp), %xmm0
movups %xmm0, 0x28(%rax)
movq 0x50(%rsp), %rcx
movq %rcx, 0x38(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x18(%r13)
andq $0x0, 0x28(%r13)
movq %rax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x5310
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xf30a
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x118f4
movq %r14, %rdi
callq 0x104a0
leaq 0x20(%rsp), %rdi
callq 0xf4aa
leaq 0xa8(%rsp), %rdi
callq 0xda3a
leaq 0x88(%rsp), %rdi
callq 0x1096c
movl 0xc(%rsp), %eax
incl %eax
jmp 0xf1b8
leaq 0x60(%rsp), %rdi
callq 0x10118
movl 0x68(%r15), %ebx
leaq 0xb0(%rsp), %rdi
callq 0x1096c
leaq 0x60(%rsp), %rdi
callq 0x1043a
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf3e1
movq %rax, %r14
jmp 0xf403
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x104a0
jmp 0xf3c4
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xf3c4
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0xf3c4
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0xda3a
jmp 0xf3ce
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0xf4aa
leaq 0xa8(%rsp), %rdi
callq 0xda3a
jmp 0xf3e9
jmp 0xf3e6
jmp 0xf3e1
movq %rax, %r14
jmp 0xf3f6
movq %rax, %r14
leaq 0x88(%rsp), %rdi
callq 0x1096c
leaq 0xb0(%rsp), %rdi
callq 0x1096c
leaq 0x60(%rsp), %rdi
callq 0x1043a
movq %r14, %rdi
callq 0x55e0
nop