LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: srajangarg[P]raytracer/src/main.cpp
// Function: renderWithRaytracing()
void
renderWithRaytracing()
{
  Sample sample;   // Point on the view being sampled.
  Ray ray;         // Ray being traced from the eye through the point.
  RGB c;           // Color being accumulated per pixel.

  int const rpp = view->raysPerPixel();

  for (int yi = 0; yi < view->height(); ++yi)
  {
    for (int xi = 0; xi < view->width(); ++xi)
    {
      c = RGB(0, 0, 0);
      for (int ri = 0; ri < rpp; ++ri)
      {
        view->getSample(xi, yi, ri, sample);
        ray = view->createViewingRay(sample);  // convert the 2d sample position to a 3d ray
        ray.transform(viewToWorld);            // transform this to world space
        c += traceRay(ray, 0);
      }

      frame->setColor(sample, c / (double)rpp);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
leaq -0x10(%rbp), %rdi
callq 0x43520
leaq -0x50(%rbp), %rdi
callq 0x43540
leaq -0x68(%rbp), %rdi
callq 0x3bce0
movq 0x1b583(%rip), %rdi     # 0x5ce00
callq 0x3f420
movl %eax, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x10c(%rbp)
movq 0x1b564(%rip), %rdi     # 0x5ce00
callq 0x3f400
movl %eax, %ecx
movl -0x10c(%rbp), %eax
cmpl %ecx, %eax
jge 0x419fc
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x110(%rbp)
movq 0x1b538(%rip), %rdi     # 0x5ce00
callq 0x3f3e0
movl %eax, %ecx
movl -0x110(%rbp), %eax
cmpl %ecx, %eax
jge 0x419ec
leaq -0x90(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x9640
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x96c0
movl $0x0, -0x94(%rbp)
movl -0x94(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jge 0x419a4
movq 0x1b4de(%rip), %rdi     # 0x5ce00
movl -0x74(%rbp), %esi
movl -0x70(%rbp), %edx
movl -0x94(%rbp), %ecx
leaq -0x10(%rbp), %r8
callq 0x3f090
movq 0x1b4c2(%rip), %rsi     # 0x5ce00
leaq -0xd8(%rbp), %rdi
leaq -0x10(%rbp), %rdx
callq 0x3f310
leaq -0x50(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x43570
leaq -0x50(%rbp), %rdi
leaq 0x1b49f(%rip), %rsi     # 0x5ce08
callq 0x3e1a0
leaq -0xf0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
xorl %edx, %edx
callq 0x41650
leaq -0x68(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x42fc0
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x4190c
movq 0x1b4dd(%rip), %rax     # 0x5ce88
movq %rax, -0x118(%rbp)
cvtsi2sdl -0x6c(%rbp), %xmm0
leaq -0x108(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3bd10
movq -0x118(%rbp), %rdi
leaq -0x10(%rbp), %rsi
leaq -0x108(%rbp), %rdx
callq 0x3ac40
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x418b8
jmp 0x419ee
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x4188c
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: srajangarg[P]raytracer/src/core/Types.hpp
// Function: RGB::operator+=(RGB const&)
inline RGB & RGB::operator +=(RGB const & v)
{
  c_[RED] += v.c_[RED];
  c_[GREEN] += v.c_[GREEN];
  c_[BLUE] += v.c_[BLUE];
  return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movsd (%rcx), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rcx
movsd 0x8(%rcx), %xmm0
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rcx
movsd 0x10(%rcx), %xmm0
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: srajangarg[P]raytracer/src/main.cpp
// Function: getReflectedRay(Primitive*, Vec3&, Ray&)
inline Ray
getReflectedRay(Primitive *z, Vec3 &pos, Ray &ray)
{
  Vec3 r, n, i;
  n = z->calculateNormal(pos);
  i = ray.direction();
  r = i - 2*((i * n) * n);
  return Ray::fromOriginAndDirection(pos + EPS*r, r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x108(%rbp)
movq %rdi, %rax
movq %rax, -0x100(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6fc0
leaq -0x50(%rbp), %rdi
callq 0x6fc0
leaq -0x68(%rbp), %rdi
callq 0x6fc0
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq (%rsi), %rax
leaq -0x80(%rbp), %rdi
callq *0x18(%rax)
leaq -0x50(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x72d0
movq -0x20(%rbp), %rdi
callq 0x3e290
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0x72d0
leaq -0x68(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3e2b0
leaq -0xc8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3ea20
leaq -0xb0(%rbp), %rdi
movsd 0x47a9(%rip), %xmm0     # 0x47960
leaq -0xc8(%rbp), %rsi
callq 0x3ea20
leaq -0x98(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x3bd80
leaq -0x38(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x72d0
movq -0x18(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0xf8(%rbp), %rdi
movsd 0x5ba4(%rip), %xmm0     # 0x48da8
leaq -0x38(%rbp), %rsi
callq 0x3ea20
movq -0x110(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
leaq -0xf8(%rbp), %rdx
callq 0x3bfd0
callq 0x3be50
movq -0x108(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
leaq -0x38(%rbp), %rdx
movsd 0x3ef2(%rip), %xmm1     # 0x47138
callq 0x3c0c0
movq -0x100(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax,%rax)
// File: srajangarg[P]raytracer/src/core/Types.hpp
// Function: Material::Material(float, float, float, float, float, float, float, float)
inline Material::Material(float ma, float ml, float ms, float msp, float msm, float mr, float mt, float mtn)
{
  p_[MA] = ma;
  p_[ML] = ml;
  p_[MS] = ms;
  p_[MSP] = msp;
  p_[MSM] = msm;
  p_[MR] = mr;
  p_[MT] = mt;
  p_[MTN] = mtn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movss %xmm2, -0x14(%rbp)
movss %xmm3, -0x18(%rbp)
movss %xmm4, -0x1c(%rbp)
movss %xmm5, -0x20(%rbp)
movss %xmm6, -0x24(%rbp)
movss %xmm7, -0x28(%rbp)
movq -0x8(%rbp), %rax
movss -0xc(%rbp), %xmm0
movss %xmm0, (%rax)
movss -0x10(%rbp), %xmm0
movss %xmm0, 0x4(%rax)
movss -0x14(%rbp), %xmm0
movss %xmm0, 0x8(%rax)
movss -0x18(%rbp), %xmm0
movss %xmm0, 0xc(%rax)
movss -0x1c(%rbp), %xmm0
movss %xmm0, 0x10(%rax)
movss -0x20(%rbp), %xmm0
movss %xmm0, 0x14(%rax)
movss -0x24(%rbp), %xmm0
movss %xmm0, 0x18(%rax)
movss -0x28(%rbp), %xmm0
movss %xmm0, 0x1c(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::ClientsForProcessList(std::vector<net::Address, std::allocator<net::Address>> const&)
UdpClientMap ClientsForProcessList(const ProcessList& processes) {
  UdpClientMap clients(processes.size());
  for (auto const& addr : processes) {
    clients.emplace(addr, std::make_shared<udp::Client>(addr, kAckTimeout));
  }
  return clients;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x80(%rbp)
movq %rdi, %rax
movq %rax, -0x88(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa090
movq %rax, -0x78(%rbp)
leaq -0x14(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0xa0c0
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %r8
leaq -0x12(%rbp), %rdx
leaq -0x13(%rbp), %rcx
callq 0xa0e0
jmp 0x70fa
leaq -0x14(%rbp), %rdi
callq 0xa120
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xa140
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0xa170
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xa1a0
testb $0x1, %al
jne 0x713b
jmp 0x71ef
leaq -0x38(%rbp), %rdi
callq 0xa1e0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rsi
movq %rsi, -0x90(%rbp)
leaq 0x27f7e(%rip), %rdx     # 0x2f0d8
leaq -0x58(%rbp), %rdi
callq 0xa250
jmp 0x7165
movq -0x90(%rbp), %rsi
movq -0x80(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0xa200
movb %dl, -0x99(%rbp)
movq %rax, -0x98(%rbp)
jmp 0x7188
movb -0x99(%rbp), %al
movq -0x98(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movb %al, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xa2d0
leaq -0x38(%rbp), %rdi
callq 0xa2f0
jmp 0x7125
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x14(%rbp), %rdi
callq 0xa120
jmp 0x721b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x7212
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xa2d0
jmp 0x7212
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x7202
movq -0x80(%rbp), %rdi
callq 0xa310
movq -0x88(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0xa310
movq -0x20(%rbp), %rdi
callq 0x67a0
nopw %cs:(%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::RandomUint32()
uint32_t RandomUint32() {
  // Static thread local to avoid expensive initialization cost on every call,
  // while maintaining thread safety.
  static thread_local std::random_device r;
  static thread_local std::seed_seq seed{r(), r(), r(), r(), r()};
  static thread_local std::default_random_engine random_engine(seed);

  std::uniform_int_distribution<uint32_t> distribution(0, UINT32_MAX);
  return distribution(random_engine);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %fs:-0x58, %al
cmpb $0x0, %al
jne 0x727d
movq %fs:0x0, %rax
leaq -0x13e0(%rax), %rdi
movq %rdi, -0x38(%rbp)
callq 0xa330
movq -0x38(%rbp), %rsi
leaq 0x3168(%rip), %rdi      # 0xa3d0
leaq 0x3f1f9(%rip), %rdx     # 0x46468
callq 0x6790
movb $0x1, %fs:-0x58
movb %fs:-0x38, %al
cmpb $0x0, %al
jne 0x732b
movq %fs:0x0, %rax
movq %rax, -0x48(%rbp)
leaq -0x13e0(%rax), %rdi
movq %rdi, -0x50(%rbp)
callq 0xa400
movq -0x50(%rbp), %rdi
movl %eax, -0x24(%rbp)
callq 0xa400
movq -0x50(%rbp), %rdi
movl %eax, -0x20(%rbp)
callq 0xa400
movq -0x50(%rbp), %rdi
movl %eax, -0x1c(%rbp)
callq 0xa400
movq -0x50(%rbp), %rdi
movl %eax, -0x18(%rbp)
callq 0xa400
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, -0x14(%rbp)
leaq -0x24(%rbp), %rcx
movq %rcx, -0x10(%rbp)
movq $0x5, -0x8(%rbp)
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdx
leaq -0x50(%rax), %rdi
movq %rdi, -0x40(%rbp)
callq 0xa420
movq -0x40(%rbp), %rsi
leaq 0x31da(%rip), %rdi      # 0xa4f0
leaq 0x3f14b(%rip), %rdx     # 0x46468
callq 0x6790
movb $0x1, %fs:-0x38
movb %fs:-0x28, %al
cmpb $0x0, %al
jne 0x735c
movq %fs:0x0, %rax
leaq -0x50(%rax), %rsi
leaq -0x30(%rax), %rdi
callq 0xa510
movb $0x1, %fs:-0x28
leaq -0x2c(%rbp), %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xa540
movq %fs:0x0, %rax
leaq -0x30(%rax), %rsi
leaq -0x2c(%rbp), %rdi
callq 0xa570
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::MessageTypeFromBuf(char*, unsigned long)
std::experimental::optional<uint32_t> MessageTypeFromBuf(char* buf, size_t n) {
  // Check to make sure the size of the buffer is at least the size of the type
  // field.
  if (n < sizeof(uint32_t)) {
    return {};
  }

  // Read the first 32-bits and convert to host endianness.
  uint32_t* buf_type = reinterpret_cast<uint32_t*>(buf);
  return ntohl(*buf_type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x38(%rbp)
movq %rdi, %rax
movq %rax, -0x30(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x4, -0x18(%rbp)
jae 0x73d1
movq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x6260
movq -0x38(%rbp), %rdi
callq 0xa5a0
jmp 0x73f4
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x6570
movq -0x38(%rbp), %rdi
movl %eax, -0x24(%rbp)
leaq -0x24(%rbp), %rsi
callq 0xa5c0
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::DataMsgFromBuf(char*, unsigned long)
std::experimental::optional<msg::DataMessage> DataMsgFromBuf(char* buf,
                                                             size_t n) {
  // Check to make sure the size of the buffer is correct.
  if (n != sizeof(msg::DataMessage)) {
    return {};
  }

  msg::DataMessage* buf_msg = reinterpret_cast<msg::DataMessage*>(buf);
  msg::DataMessage msg;
  msg.type = ntohl(buf_msg->type);
  msg.sender = ntohl(buf_msg->sender);
  msg.msg_id = ntohl(buf_msg->msg_id);
  msg.data = ntohl(buf_msg->data);
  return msg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x10, -0x18(%rbp)
je 0x7441
movq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x6260
movq -0x40(%rbp), %rdi
callq 0xa5f0
jmp 0x7491
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x6570
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x6570
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x6570
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x6570
movq -0x40(%rbp), %rdi
movl %eax, -0x24(%rbp)
leaq -0x30(%rbp), %rsi
callq 0xa610
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::AckMsgFromBuf(char*, unsigned long)
std::experimental::optional<msg::AckMessage> AckMsgFromBuf(char* buf,
                                                           size_t n) {
  // Check to make sure the size of the buffer is correct.
  if (n != sizeof(msg::AckMessage)) {
    return {};
  }

  msg::AckMessage* buf_msg = reinterpret_cast<msg::AckMessage*>(buf);
  msg::AckMessage msg;
  msg.type = ntohl(buf_msg->type);
  msg.sender = ntohl(buf_msg->sender);
  msg.msg_id = ntohl(buf_msg->msg_id);
  msg.proposed_seq = ntohl(buf_msg->proposed_seq);
  msg.proposer = ntohl(buf_msg->proposer);
  return msg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x14, -0x18(%rbp)
je 0x74e1
movq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x6260
movq -0x48(%rbp), %rdi
callq 0xa640
jmp 0x7540
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x6570
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x6570
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x6570
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x6570
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x6570
movq -0x48(%rbp), %rdi
movl %eax, -0x24(%rbp)
leaq -0x34(%rbp), %rsi
callq 0xa660
movq -0x40(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::SeqMsgFromBuf(char*, unsigned long)
std::experimental::optional<msg::SeqMessage> SeqMsgFromBuf(char* buf,
                                                           size_t n) {
  // Check to make sure the size of the buffer is correct.
  if (n != sizeof(msg::SeqMessage)) {
    return {};
  }

  msg::SeqMessage* buf_msg = reinterpret_cast<msg::SeqMessage*>(buf);
  msg::SeqMessage msg;
  msg.type = ntohl(buf_msg->type);
  msg.sender = ntohl(buf_msg->sender);
  msg.msg_id = ntohl(buf_msg->msg_id);
  msg.final_seq = ntohl(buf_msg->final_seq);
  msg.final_seq_proposer = ntohl(buf_msg->final_seq_proposer);
  return msg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x14, -0x18(%rbp)
je 0x7591
movq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x6260
movq -0x48(%rbp), %rdi
callq 0xa690
jmp 0x75f0
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x6570
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x6570
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x6570
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x6570
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x6570
movq -0x48(%rbp), %rdi
movl %eax, -0x24(%rbp)
leaq -0x34(%rbp), %rsi
callq 0xa6b0
movq -0x40(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::SeqAckMsgFromBuf(char*, unsigned long)
std::experimental::optional<msg::SeqAckMessage> SeqAckMsgFromBuf(char* buf,
                                                                 size_t n) {
  // Check to make sure the size of the buffer is correct.
  if (n != sizeof(msg::SeqAckMessage)) {
    return {};
  }

  msg::SeqAckMessage* buf_msg = reinterpret_cast<msg::SeqAckMessage*>(buf);
  msg::SeqAckMessage msg;
  msg.type = ntohl(buf_msg->type);
  msg.sender = ntohl(buf_msg->sender);
  msg.msg_id = ntohl(buf_msg->msg_id);
  return msg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0xc, -0x18(%rbp)
je 0x7641
movq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x6260
movq -0x40(%rbp), %rdi
callq 0xa6e0
jmp 0x7682
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x6570
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x6570
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x6570
movq -0x40(%rbp), %rdi
movl %eax, -0x24(%rbp)
leaq -0x2c(%rbp), %rsi
callq 0xa700
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::SendDataMsg(std::shared_ptr<udp::Client>, std::function<udp::ServerAction (std::shared_ptr<udp::Client>, char*, unsigned long)>, msg::DataMessage)
void SendDataMsg(const udp::ClientPtr client, const udp::OnReceiveFn handle_ack,
                 msg::DataMessage data_msg) {
  data_msg.type = htonl(msg::kDataMessageType);
  data_msg.sender = htonl(data_msg.sender);
  data_msg.msg_id = htonl(data_msg.msg_id);
  data_msg.data = htonl(data_msg.data);

  char* buf = reinterpret_cast<char*>(&data_msg);
  client->SendWithAck(buf, sizeof(data_msg), udp::kUnlimitedAttempts,
                      handle_ack);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x80(%rbp)
movq %rsi, -0x78(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl $0x1, %edi
callq 0x6330
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %edi
callq 0x6330
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %edi
callq 0x6330
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %edi
callq 0x6330
movq -0x80(%rbp), %rdi
movl %eax, -0x4(%rbp)
leaq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0xa730
movq -0x78(%rbp), %rsi
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0xa750
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %r8
movl $0x10, %edx
xorl %ecx, %ecx
callq 0x2be90
jmp 0x7729
leaq -0x48(%rbp), %rdi
callq 0xa800
addq $0x80, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xa800
movq -0x50(%rbp), %rdi
callq 0x67a0
nopl (%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::SendAckMsg(std::shared_ptr<udp::Client>, msg::AckMessage)
void SendAckMsg(const udp::ClientPtr client, msg::AckMessage ack_msg) {
  ack_msg.type = htonl(msg::kAckMessageType);
  ack_msg.sender = htonl(ack_msg.sender);
  ack_msg.msg_id = htonl(ack_msg.msg_id);
  ack_msg.proposed_seq = htonl(ack_msg.proposed_seq);
  ack_msg.proposer = htonl(ack_msg.proposer);

  char* buf = reinterpret_cast<char*>(&ack_msg);
  client->Send(buf, sizeof(ack_msg));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq %rdi, -0x8(%rbp)
movl $0x2, %edi
callq 0x6330
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl 0x4(%rax), %edi
callq 0x6330
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movl 0x8(%rax), %edi
callq 0x6330
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movl 0xc(%rax), %edi
callq 0x6330
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movl 0x10(%rax), %edi
callq 0x6330
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq %rax, -0x10(%rbp)
callq 0xa730
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movl $0x14, %edx
callq 0x2bd80
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::SendSeqMsg(std::shared_ptr<udp::Client>, msg::SeqMessage)
void SendSeqMsg(const udp::ClientPtr client, msg::SeqMessage seq_msg) {
  msg::SeqMessage orig_seq_msg = seq_msg;

  seq_msg.type = htonl(msg::kSeqMessageType);
  seq_msg.sender = htonl(seq_msg.sender);
  seq_msg.msg_id = htonl(seq_msg.msg_id);
  seq_msg.final_seq = htonl(seq_msg.final_seq);
  seq_msg.final_seq_proposer = htonl(seq_msg.final_seq_proposer);

  // Passed to SendWithAck to verify that any acknowledgement we hear is valid.
  auto isValidAck = [&orig_seq_msg](udp::ClientPtr _, char* buf, size_t n) {
    auto seqack_msg = SeqAckMsgFromBuf(buf, n);
    bool valid = seqack_msg && ValidSeqAckMsg(*seqack_msg, orig_seq_msg);
    if (!valid) return udp::ServerAction::Continue;
    return udp::ServerAction::Stop;
  };

  char* buf = reinterpret_cast<char*>(&seq_msg);
  client->SendWithAck(buf, sizeof(seq_msg), udp::kUnlimitedAttempts,
                      isValidAck);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x88(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq %rdi, -0x8(%rbp)
movl 0x10(%rax), %ecx
movl %ecx, -0x10(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x20(%rbp)
movl $0x3, %edi
callq 0x6330
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, (%rax)
movl 0x4(%rax), %edi
callq 0x6330
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x4(%rax)
movl 0x8(%rax), %edi
callq 0x6330
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x8(%rax)
movl 0xc(%rax), %edi
callq 0x6330
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0xc(%rax)
movl 0x10(%rax), %edi
callq 0x6330
movq -0x88(%rbp), %rdi
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x10(%rax)
leaq -0x20(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movq %rax, -0x30(%rbp)
callq 0xa730
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x68(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x7900
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %r8
movl $0x14, %edx
xorl %ecx, %ecx
callq 0x2be90
jmp 0x78d0
leaq -0x50(%rbp), %rdi
callq 0xa800
addq $0x90, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xa800
movq -0x58(%rbp), %rdi
callq 0x67a0
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::SendSeqAckMsg(std::shared_ptr<udp::Client>, msg::SeqAckMessage)
void SendSeqAckMsg(const udp::ClientPtr client, msg::SeqAckMessage seqack_msg) {
  seqack_msg.type = htonl(msg::kSeqAckMessageType);
  seqack_msg.sender = htonl(seqack_msg.sender);
  seqack_msg.msg_id = htonl(seqack_msg.msg_id);

  char* buf = reinterpret_cast<char*>(&seqack_msg);
  client->Send(buf, sizeof(seqack_msg));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x38(%rbp)
movq %rsi, -0x1c(%rbp)
movl %edx, -0x14(%rbp)
movq -0x1c(%rbp), %rax
movq %rax, -0xc(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movq %rdi, -0x28(%rbp)
movl $0x4, %edi
callq 0x6330
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %edi
callq 0x6330
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %edi
callq 0x6330
movq -0x38(%rbp), %rdi
movl %eax, -0x4(%rbp)
leaq -0xc(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0xa730
movq %rax, %rdi
movq -0x30(%rbp), %rsi
movl $0xc, %edx
callq 0x2bd80
addq $0x40, %rsp
popq %rbp
retq
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::ValidDataMsg(msg::DataMessage&, unsigned long)
bool ValidDataMsg(msg::DataMessage& data_msg, size_t process_count) {
  if (data_msg.type != msg::kDataMessageType) {
    return false;
  }
  if (data_msg.sender >= process_count) {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, (%rax)
je 0x7a1b
movb $0x0, -0x1(%rbp)
jmp 0x7a32
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
cmpq -0x18(%rbp), %rax
jb 0x7a2e
movb $0x0, -0x1(%rbp)
jmp 0x7a32
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::ValidAckMsg(msg::AckMessage&, unsigned int, unsigned int, unsigned int)
bool ValidAckMsg(msg::AckMessage& ack_msg, uint32_t exp_sender,
                 uint32_t exp_msg_id, uint32_t exp_proposer) {
  if (ack_msg.type != msg::kAckMessageType) {
    return false;
  }
  if (ack_msg.sender != exp_sender) {
    return false;
  }
  if (ack_msg.msg_id != exp_msg_id) {
    return false;
  }
  if (ack_msg.proposer != exp_proposer) {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
je 0x7a60
movb $0x0, -0x1(%rbp)
jmp 0x7a9a
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x14(%rbp), %eax
je 0x7a72
movb $0x0, -0x1(%rbp)
jmp 0x7a9a
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x18(%rbp), %eax
je 0x7a84
movb $0x0, -0x1(%rbp)
jmp 0x7a9a
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
cmpl -0x1c(%rbp), %eax
je 0x7a96
movb $0x0, -0x1(%rbp)
jmp 0x7a9a
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::ValidSeqMsg(msg::SeqMessage&, unsigned long)
bool ValidSeqMsg(msg::SeqMessage& seq_msg, size_t process_count) {
  if (seq_msg.type != msg::kSeqMessageType) {
    return false;
  }
  if (seq_msg.sender >= process_count) {
    return false;
  }
  if (seq_msg.final_seq_proposer >= process_count) {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x3, (%rax)
je 0x7acb
movb $0x0, -0x1(%rbp)
jmp 0x7af5
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
cmpq -0x18(%rbp), %rax
jb 0x7ade
movb $0x0, -0x1(%rbp)
jmp 0x7af5
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
cmpq -0x18(%rbp), %rax
jb 0x7af1
movb $0x0, -0x1(%rbp)
jmp 0x7af5
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::ValidSeqAckMsg(msg::SeqAckMessage&, msg::SeqMessage&)
bool ValidSeqAckMsg(msg::SeqAckMessage& seqack_msg, msg::SeqMessage& seq_msg) {
  if (seqack_msg.type != msg::kSeqAckMessageType) {
    return false;
  }
  if (seqack_msg.sender != seq_msg.sender) {
    return false;
  }
  if (seqack_msg.msg_id != seq_msg.msg_id) {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
je 0x7b1b
movb $0x0, -0x1(%rbp)
jmp 0x7b4b
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x7b31
movb $0x0, -0x1(%rbp)
jmp 0x7b4b
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
je 0x7b47
movb $0x0, -0x1(%rbp)
jmp 0x7b4b
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::operator<(process::PendingMessage const&, process::PendingMessage const&)
bool operator<(const PendingMessage& lhs, const PendingMessage& rhs) {
  if (lhs.pms.seq != rhs.pms.seq) {
    // 1. Sort by sequence number.
    return lhs.pms.seq < rhs.pms.seq;
  }
  if (lhs.deliverable != rhs.deliverable) {
    // 2. Sort undeliverable messages first.
    return !lhs.deliverable;
  }
  if (lhs.pmk.sender != rhs.pmk.sender) {
    // 3. Sort by sender id.
    return lhs.pmk.sender < rhs.pmk.sender;
  }
  if (lhs.pmk.msg_id != rhs.pmk.msg_id) {
    // 4. Sort by message id.
    return lhs.pmk.msg_id < rhs.pmk.msg_id;
  }
  // (sender, msg_id) should uniquely identify a message, so if we're here,
  // we are comparing the same message.
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
je 0x7b94
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
setb %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x7c11
movq -0x10(%rbp), %rax
movb 0x14(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movq -0x18(%rbp), %rcx
movb 0x14(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x7bc1
movq -0x10(%rbp), %rax
movb 0x14(%rax), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x7c11
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
je 0x7be5
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
setb %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x7c11
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x7c0d
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
setb %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x7c11
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::HoldBackQueue::Lookup(msg::DataMessage const&)
std::experimental::optional<msg::AckMessage> HoldBackQueue::Lookup(
    const msg::DataMessage& data_msg) {
  PendingMessageKey pmk;
  pmk.sender = data_msg.sender;
  pmk.msg_id = data_msg.msg_id;

  auto old_pms_it = pending_seqs_.find(pmk);
  if (old_pms_it == pending_seqs_.end()) {
    // The message is not already in the queue.
    return {};
  }

  // Create the msg::AckMessage
  msg::AckMessage old_ack_msg;
  old_ack_msg.sender = data_msg.sender;
  old_ack_msg.msg_id = data_msg.msg_id;
  old_ack_msg.proposed_seq = old_pms_it->second.seq;
  old_ack_msg.proposer = old_pms_it->second.seq_proposer;
  return old_ack_msg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x60(%rbp)
movq %rdi, %rax
movq %rax, -0x58(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x1c(%rbp)
leaq -0x20(%rbp), %rsi
callq 0xa820
movq -0x50(%rbp), %rdi
movq %rax, -0x28(%rbp)
callq 0xa880
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa850
testb $0x1, %al
jne 0x7c88
jmp 0x7ca3
movq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x6260
movq -0x60(%rbp), %rdi
callq 0xa640
jmp 0x7ce2
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xa8b0
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xa8b0
movq -0x60(%rbp), %rdi
movl 0xc(%rax), %eax
movl %eax, -0x34(%rbp)
leaq -0x44(%rbp), %rsi
callq 0xa660
movq -0x58(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::HoldBackQueue::InsertUndeliverable(msg::AckMessage const&, unsigned int)
void HoldBackQueue::InsertUndeliverable(const msg::AckMessage& ack_msg,
                                        uint32_t data) {
  // Insert into the sequence map so that we can index into this later in
  // constant time, allowing us to find the entry in the ordered set in log time
  // instead of linear time.
  PendingMessageKey pmk;
  pmk.sender = ack_msg.sender;
  pmk.msg_id = ack_msg.msg_id;
  if (pending_seqs_.count(pmk)) {
    throw std::invalid_argument("existing pending message in HoldBackQueue");
  }

  PendingMessageSeq pms;
  pms.seq = ack_msg.proposed_seq;
  pms.seq_proposer = ack_msg.proposer;
  pending_seqs_[pmk] = pms;

  // Insert into the ordered set, initially with the "deliverable" flag set to
  // false. All messages that sort after this message will have to wait to be
  // delivered, even if they themselves are "deliverable".
  PendingMessage pm;
  pm.pmk = pmk;
  pm.pms = pms;
  pm.data = data;
  pm.deliverable = false;
  if (ordering_.count(pm)) {
    throw std::invalid_argument("existing pending message in HoldBackQueue");
  }
  ordering_.insert(pm);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x18(%rbp)
leaq -0x1c(%rbp), %rsi
callq 0xa8e0
cmpq $0x0, %rax
je 0x7d84
movl $0x10, %edi
callq 0x6230
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x70(%rbp)
leaq 0x27524(%rip), %rsi     # 0x2f270
callq 0x6840
jmp 0x7d53
movq -0x70(%rbp), %rdi
movq 0x3e26a(%rip), %rsi     # 0x45fc8
movq 0x3e24b(%rip), %rdx     # 0x45fb0
callq 0x6770
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x6300
jmp 0x7e4e
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x30(%rbp)
leaq -0x1c(%rbp), %rsi
callq 0xa910
movq -0x68(%rbp), %rdi
movq -0x34(%rbp), %rcx
movq %rcx, (%rax)
movq -0x1c(%rbp), %rax
movq %rax, -0x4c(%rbp)
movq -0x34(%rbp), %rax
movq %rax, -0x44(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x3c(%rbp)
movb $0x0, -0x38(%rbp)
addq $0x38, %rdi
leaq -0x4c(%rbp), %rsi
callq 0xa940
cmpq $0x0, %rax
je 0x7e2d
movl $0x10, %edi
callq 0x6230
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x78(%rbp)
leaq 0x27478(%rip), %rsi     # 0x2f270
callq 0x6840
jmp 0x7dff
movq -0x78(%rbp), %rdi
movq 0x3e1be(%rip), %rsi     # 0x45fc8
movq 0x3e19f(%rip), %rdx     # 0x45fb0
callq 0x6770
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x6300
jmp 0x7e4e
movq -0x68(%rbp), %rdi
addq $0x38, %rdi
leaq -0x4c(%rbp), %rsi
callq 0xa9a0
movq %rax, -0x60(%rbp)
movb %dl, -0x58(%rbp)
addq $0x80, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x67a0
nopw (%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::Process::TotalOrder(unsigned int, std::function<void (msg::SeqMessage&)>)
void Process::TotalOrder(unsigned int send_count, deliverMsgFn deliver) {
  // Launch a multicast sender for each message.
  for (unsigned int i = 0; i < send_count; ++i) {
    LaunchMulticastSender();
  }

  // Launch a server, which will block indefinitely.
  server_.Listen(
      // Called on all incoming Data Messages.
      [this, deliver](udp::ClientPtr client, char* buf, size_t n) {
        auto data_type = MessageTypeFromBuf(buf, n);
        if (!data_type) {
          // We didn't even get a full data type message. Drop it on the floor.
          logging::out << "Received message with incomplete type\n";
          return udp::ServerAction::Continue;
        }

        // Delegate message handling based on the message type.
        switch (*data_type) {
          case msg::kDataMessageType:
            HandleDataMsg(client, buf, n);
            break;
          case msg::kSeqMessageType:
            HandleSeqMsg(client, buf, n, deliver);
            break;
          case msg::kAckMessageType:
          case msg::kSeqAckMessageType:
            logging::out << "Received ack message when one was not expected\n";
            break;
          default:
            logging::out << "Received message with unknown type: " << *data_type
                         << "\n";
            break;
        }
        return udp::ServerAction::Continue;
      });
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdx, -0xa8(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x80de
movq -0xa0(%rbp), %rdi
callq 0x81b0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x80bf
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rax
movq %rax, %rcx
addq $0x54, %rcx
movq %rcx, -0xb0(%rbp)
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xac80
leaq -0x40(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x81e0
jmp 0x8116
xorl %eax, %eax
movl %eax, %esi
leaq -0x98(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0xad30
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rdx
leaq -0x40(%rbp), %rsi
callq 0x2c300
jmp 0x8146
leaq -0x98(%rbp), %rdi
callq 0xad70
leaq -0x40(%rbp), %rdi
callq 0xa800
leaq -0x68(%rbp), %rdi
callq 0x8280
addq $0xc0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x819c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xad70
leaq -0x40(%rbp), %rdi
callq 0xa800
leaq -0x68(%rbp), %rdi
callq 0x8280
movq -0x70(%rbp), %rdi
callq 0x67a0
nop
// File: nvanbenschoten[P]total-order-multicast/src/process.cc
// Function: process::Process::MaybeDelaySend()
void Process::MaybeDelaySend() {
  if (!delays_) {
    return;
  }

  // Static thread local to avoid expensive initialization cost on every call,
  // while maintaining thread safety.
  static thread_local std::default_random_engine random_engine(
      std::chrono::system_clock::now().time_since_epoch().count());

  // Only delay about half of the messages.
  std::uniform_real_distribution<double> distribution(0.0, 1.0);
  if (distribution(random_engine) < 0.50) {
    return;
  }

  // Delay for a random duration based on a selection from a poisson
  // distribution centered at half the round timeout, at intervals of 1/10th a
  // second.
  typedef std::chrono::duration<int, std::deci> deciseconds;
  std::poisson_distribution<int> poisson(deciseconds{5}.count());
  int delay = poisson(random_engine);
  if (delay <= 0) {
    return;
  }
  std::this_thread::sleep_for(deciseconds{delay});
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x58(%rax)
jne 0x878e
jmp 0x88a2
movb %fs:-0x18, %al
cmpb $0x0, %al
jne 0x87da
callq 0x6060
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xaff0
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xb010
movq %rax, %rsi
movq %fs:0x0, %rax
leaq -0x20(%rax), %rdi
callq 0xb030
movb $0x1, %fs:-0x18
leaq -0x28(%rbp), %rdi
xorps %xmm0, %xmm0
movsd 0x26827(%rip), %xmm1    # 0x2f010
callq 0xb060
movq %fs:0x0, %rax
leaq -0x20(%rax), %rsi
leaq -0x28(%rbp), %rdi
callq 0xb090
movaps %xmm0, %xmm1
movsd 0x267f6(%rip), %xmm0    # 0x2f008
ucomisd %xmm1, %xmm0
jbe 0x881d
jmp 0x88a2
movl $0x5, -0x98(%rbp)
leaq -0x94(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xb0c0
leaq -0x94(%rbp), %rdi
callq 0xb0e0
cvtsi2sd %eax, %xmm0
leaq -0x90(%rbp), %rdi
callq 0xb0f0
movq %fs:0x0, %rax
leaq -0x20(%rax), %rsi
leaq -0x90(%rbp), %rdi
callq 0xb130
movl %eax, -0x9c(%rbp)
cmpl $0x0, -0x9c(%rbp)
jg 0x8883
jmp 0x88a2
leaq -0xa0(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
callq 0xb0c0
leaq -0xa0(%rbp), %rdi
callq 0xb160
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/include/args.h
// Function: args::Glyphs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string::size_type Glyphs(const std::string &string_) {
  std::string::size_type length = 0;
  for (const char c : string_) {
    if ((c & 0xc0) != 0x80) {
      ++length;
    }
  }
  return length;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6400
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6830
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x186e0
testb $0x1, %al
jne 0x159a9
jmp 0x159e0
leaq -0x20(%rbp), %rdi
callq 0x18720
movb (%rax), %al
movb %al, -0x29(%rbp)
movsbl -0x29(%rbp), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
je 0x159d3
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x159d5
leaq -0x20(%rbp), %rdi
callq 0x18740
jmp 0x15996
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/src/main.cc
// Function: CheckProcessId(std::vector<net::Address, std::allocator<net::Address>> const&, int)
void CheckProcessId(const process::ProcessList& processes, int my_id) {
  // Check if the id is within bounds.
  if (my_id < 0 || (uint)my_id >= processes.size()) {
    throw args::ValidationError("--id value not found in hostfile");
  }

  // Check if the process is on this host.
  if (processes.at(my_id).hostname() != net::GetHostname()) {
    throw args::ValidationError("--id value is not the hostname of this host");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x1646e
movl -0xc(%rbp), %eax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa090
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jb 0x16526
movb $0x1, -0x45(%rbp)
movl $0x10, %edi
callq 0x6230
movq %rax, -0xa8(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x67b0
movq -0xa0(%rbp), %rdx
leaq 0x196be(%rip), %rsi     # 0x2fb5f
leaq -0x30(%rbp), %rdi
callq 0xb990
jmp 0x164ac
movq -0xa8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1a080
jmp 0x164be
movq -0xa8(%rbp), %rdi
movb $0x0, -0x45(%rbp)
leaq 0x2f180(%rip), %rsi     # 0x45650
leaq 0x3be9(%rip), %rdx      # 0x1a0c0
callq 0x6770
jmp 0x16655
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x16504
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x68c8
leaq -0x31(%rbp), %rdi
callq 0x6490
testb $0x1, -0x45(%rbp)
jne 0x16515
jmp 0x16521
movq -0xa8(%rbp), %rdi
callq 0x6300
jmp 0x1664c
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x15420
movq %rax, %rdi
callq 0xe2e0
movq %rax, -0xb8(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2dd30
movq -0xb8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1a0e0
movb %al, -0xa9(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x68c8
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x16579
jmp 0x16643
movb $0x1, -0x8a(%rbp)
movl $0x10, %edi
callq 0x6230
movq %rax, -0xc8(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x67b0
movq -0xc0(%rbp), %rdx
leaq 0x195ce(%rip), %rsi     # 0x2fb80
leaq -0x88(%rbp), %rdi
callq 0xb990
jmp 0x165c0
movq -0xc8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x1a080
jmp 0x165d5
movq -0xc8(%rbp), %rdi
movb $0x0, -0x8a(%rbp)
leaq 0x2f066(%rip), %rsi     # 0x45650
leaq 0x3acf(%rip), %rdx      # 0x1a0c0
callq 0x6770
jmp 0x16655
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1661e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x68c8
leaq -0x89(%rbp), %rdi
callq 0x6490
testb $0x1, -0x8a(%rbp)
jne 0x16635
jmp 0x16641
movq -0xc8(%rbp), %rdi
callq 0x6300
jmp 0x1664c
addq $0xd0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x67a0
nopw %cs:(%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/include/args.h
// Function: args::ArgumentParser::ParseCLI(int, char const* const*)
bool ParseCLI(const int argc, const char *const *argv) {
    if (prog.empty()) {
      prog.assign(argv[0]);
    }
    const std::vector<std::string> args(argv + 1, argv + argc);
    return ParseArgs(args) == std::end(args);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x60(%rbp)
addq $0x68, %rdi
callq 0x6700
testb $0x1, %al
jne 0x1a89d
jmp 0x1a8b1
movq -0x60(%rbp), %rdi
addq $0x68, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x6860
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x78(%rbp)
movslq -0xc(%rbp), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x25ca0
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
leaq -0x30(%rbp), %rdi
callq 0x25cc0
jmp 0x1a8f0
leaq -0x31(%rbp), %rdi
callq 0x25d40
movq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x25d60
movq %rax, -0x80(%rbp)
jmp 0x1a90c
movq -0x80(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1b3f0
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x1ba30
movb %al, -0x81(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x188e0
movb -0x81(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x25d40
jmp 0x1a97a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x188e0
movq -0x40(%rbp), %rdi
callq 0x67a0
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: nvanbenschoten[P]total-order-multicast/include/args.h
// Function: args::Group::HasFlag() const
bool HasFlag() const {
    for (Base *child : children) {
      if (dynamic_cast<FlagBase *>(child)) {
        return true;
      }
      if (auto group = dynamic_cast<Group *>(child)) {
        if (group->HasFlag()) {
          return true;
        }
      }
    }
    return false;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1bb90
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1bbc0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1bbf0
testb $0x1, %al
jne 0x1af48
jmp 0x1b00c
leaq -0x20(%rbp), %rdi
callq 0x1bc30
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x1af87
movq -0x40(%rbp), %rdi
leaq 0x2a70f(%rip), %rsi     # 0x45680
leaq 0x2a730(%rip), %rdx     # 0x456a8
xorl %eax, %eax
movl %eax, %ecx
callq 0x64d0
movq %rax, -0x48(%rbp)
jmp 0x1af8f
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0x1af8f
movq -0x48(%rbp), %rax
cmpq $0x0, %rax
je 0x1af9f
movb $0x1, -0x1(%rbp)
jmp 0x1b010
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x1afce
movq -0x50(%rbp), %rdi
leaq 0x2a6c8(%rip), %rsi     # 0x45680
leaq 0x2a701(%rip), %rdx     # 0x456c0
xorl %eax, %eax
movl %eax, %ecx
callq 0x64d0
movq %rax, -0x58(%rbp)
jmp 0x1afd6
xorl %eax, %eax
movq %rax, -0x58(%rbp)
jmp 0x1afd6
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x1affc
movq -0x38(%rbp), %rdi
callq 0x1af00
testb $0x1, %al
jne 0x1aff4
jmp 0x1affa
movb $0x1, -0x1(%rbp)
jmp 0x1b010
jmp 0x1affc
jmp 0x1affe
leaq -0x20(%rbp), %rdi
callq 0x1bc50
jmp 0x1af32
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: nvanbenschoten[P]total-order-multicast/include/args.h
// Function: args::Group::Validators::AllChildGroups(args::Group const&)
static bool AllChildGroups(const Group &group) {
      return std::find_if(std::begin(group.Children()),
                          std::end(group.Children()),
                          [](const Base *child) -> bool {
                            return dynamic_cast<const Group *>(child) &&
                                   !child->Matched();
                          }) == std::end(group.Children());
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1f950
movq %rax, %rdi
callq 0x1f920
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1f950
movq %rax, %rdi
callq 0x1f970
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1f8e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1f950
movq %rax, %rdi
callq 0x1f970
movq %rax, -0x30(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1f8a0
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)