LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: Thomas1995[P]Rentz/src/./server.h
// Function: Server::poll()
int poll() {
    static std::vector<epoll_event> events(MAX_EVENTS);
    const int n = epoll_wait(epfd, events.data(), MAX_EVENTS, -1);
    debug("Received %d events\n", n);
    return n;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpb $0x0, 0x1aa6d(%rip)     # 0x21338
jne 0x6931
leaq 0x1aa64(%rip), %rdi     # 0x21338
callq 0x3510
cmpl $0x0, %eax
je 0x6931
leaq -0x9(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x6d40
movq -0x30(%rbp), %rdx
leaq 0x1aa2a(%rip), %rdi     # 0x21320
movl $0x400, %esi            # imm = 0x400
callq 0x6d60
jmp 0x6902
leaq -0x9(%rbp), %rdi
callq 0x6dd0
leaq 0x4de(%rip), %rdi       # 0x6df0
leaq 0x1aa07(%rip), %rsi     # 0x21320
leaq 0x1a9a0(%rip), %rdx     # 0x212c0
callq 0x32a0
leaq 0x1aa0c(%rip), %rdi     # 0x21338
callq 0x31f0
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
leaq 0x1a9de(%rip), %rdi     # 0x21320
callq 0x6e50
movl -0x34(%rbp), %edi
movq %rax, %rsi
movl $0x400, %edx            # imm = 0x400
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x3160
movl %eax, -0x20(%rbp)
movq 0x1a66a(%rip), %rax     # 0x20fd0
movq (%rax), %rdi
movl -0x20(%rbp), %edx
leaq 0xf82e(%rip), %rsi      # 0x161a1
movb $0x0, %al
callq 0x3450
movq 0x1a64f(%rip), %rax     # 0x20fd0
movq (%rax), %rdi
callq 0x3390
movl -0x20(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x9(%rbp), %rdi
callq 0x6dd0
leaq 0x1a98a(%rip), %rdi     # 0x21338
callq 0x31e0
movq -0x18(%rbp), %rdi
callq 0x34d0
nopl (%rax)
// File: Thomas1995[P]Rentz/src/./server.h
// Function: Server::acceptConnection()
int acceptConnection() {
    sockaddr_storage addr;
    socklen_t addrlen = sizeof(addr);
    int client = accept(fd, (sockaddr *)&addr, &addrlen);

    char buff[INET6_ADDRSTRLEN];

    if(addr.ss_family == AF_INET) {
      //the client is using IPv4
      sockaddr_in *sin = (sockaddr_in *)&addr;
      inet_ntop(sin->sin_family, (void *)&sin->sin_addr, buff, sizeof(buff));

      debug("Accepted connection from %s: %d\n", buff, sin->sin_port);
    } else {
      //the client is using IPv6
      sockaddr_in6 *sin = (sockaddr_in6 *)&addr;
      inet_ntop(sin->sin6_family, (void *)&sin->sin6_addr, buff, sizeof(buff));
      debug("Accepted connection from %s: %d\n", buff, sin->sin6_port);
    }

    if(client == -1) {
      perror("Accept() failed: ");
      exit(1);
    }
    return client;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x80, -0x8c(%rbp)
movl (%rax), %edi
leaq -0x88(%rbp), %rsi
leaq -0x8c(%rbp), %rdx
callq 0x30e0
movl %eax, -0x90(%rbp)
movzwl -0x88(%rbp), %eax
cmpl $0x2, %eax
jne 0x6a73
leaq -0x88(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movzwl (%rax), %edi
movq -0xc8(%rbp), %rsi
addq $0x4, %rsi
leaq -0xc0(%rbp), %rdx
movl $0x2e, %ecx
callq 0x3320
movq 0x1a591(%rip), %rax     # 0x20fd0
movq (%rax), %rdi
leaq -0xc0(%rbp), %rdx
movq -0xc8(%rbp), %rax
movzwl 0x2(%rax), %ecx
leaq 0xf75a(%rip), %rsi      # 0x161b5
movb $0x0, %al
callq 0x3450
movq 0x1a567(%rip), %rax     # 0x20fd0
movq (%rax), %rdi
callq 0x3390
jmp 0x6ae0
leaq -0x88(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movzwl (%rax), %edi
movq -0xd0(%rbp), %rsi
addq $0x8, %rsi
leaq -0xc0(%rbp), %rdx
movl $0x2e, %ecx
callq 0x3320
movq 0x1a522(%rip), %rax     # 0x20fd0
movq (%rax), %rdi
leaq -0xc0(%rbp), %rdx
movq -0xd0(%rbp), %rax
movzwl 0x2(%rax), %ecx
leaq 0xf6eb(%rip), %rsi      # 0x161b5
movb $0x0, %al
callq 0x3450
movq 0x1a4f8(%rip), %rax     # 0x20fd0
movq (%rax), %rdi
callq 0x3390
cmpl $-0x1, -0x90(%rbp)
jne 0x6aff
leaq 0xf6e6(%rip), %rdi      # 0x161d6
callq 0x3280
movl $0x1, %edi
callq 0x33a0
movl -0x90(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nop
// File: Thomas1995[P]Rentz/src/./server.h
// Function: Server::addEpollEvent(int, int)
void addEpollEvent(const int fd, const int flags) {
    epoll_event e;
    memset(&e, 0, sizeof(e));
    e.events = flags;
    e.data.fd = fd;
    epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &e);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x1c(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x3190
movq -0x28(%rbp), %rax
movl -0x10(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, -0x18(%rbp)
movl 0x4(%rax), %edi
movl -0xc(%rbp), %edx
movl $0x1, %esi
leaq -0x1c(%rbp), %rcx
callq 0x3430
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::handshake[abi:cxx11](unsigned char)
std::string Connection::handshake(uint8_t playerCount) {
  event req;
  req.type = event::EType::HANDSHAKE;
  req.len = 1;
  req.data = &playerCount;
  req.send(sfd);

  readAndAssert(resp);

  std::string name;

  for(size_t i = 0; i < resp.len; ++i) {
    name += resp.data[i];
  }

  resp.free();
  return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x80(%rbp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x9, -0x30(%rbp)
movq $0x1, -0x28(%rbp)
leaq -0x11(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movl 0x201c(%rax), %esi
leaq -0x30(%rbp), %rdi
callq 0xbc80
movq -0x70(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x14ef0
movl -0x48(%rbp), %eax
cmpl -0x30(%rbp), %eax
jne 0xb0f8
jmp 0xb117
leaq 0xb125(%rip), %rdi      # 0x16224
leaq 0xb134(%rip), %rsi      # 0x1623a
movl $0x44, %edx
leaq 0xb18c(%rip), %rcx      # 0x1629e
callq 0x3200
movq -0x80(%rbp), %rdi
movb $0x0, -0x49(%rbp)
callq 0x3440
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0xb174
movq -0x80(%rbp), %rdi
movq -0x38(%rbp), %rax
movq -0x58(%rbp), %rcx
movsbl (%rax,%rcx), %esi
callq 0x31d0
jmp 0xb14d
jmp 0xb14f
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xb12c
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x31c0
jmp 0xb19f
leaq -0x48(%rbp), %rdi
callq 0xc0d0
jmp 0xb17f
movb $0x1, -0x49(%rbp)
testb $0x1, -0x49(%rbp)
jne 0xb192
movq -0x80(%rbp), %rdi
callq 0x31c0
movq -0x78(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x34d0
nopl (%rax,%rax)
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::getCardChoice()
Card Connection::getCardChoice() {
  event req;
  req.type = event::ASK_CARD;
  req.len = 0;
  req.data = NULL;
  req.send(sfd);

  readAndAssert(resp);

  assert(resp.len == 1);

  Card card(resp.data[0]);

  //debug("Received card %s from client\n", card.to_string().c_str());

  bool in = 0;

  for(const auto &i: hand) {
      if(i == card)
          in = 1;
  }

  if(!in) {
      debug("The client has sent an incorrect card");
      exit(1);
  }

  hand.erase(find(hand.begin(), hand.end(), card));

  resp.free();
  return card;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0xa8(%rbp)
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x6, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movl 0x201c(%rax), %esi
leaq -0x28(%rbp), %rdi
callq 0xbc80
movq -0x98(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x14ef0
movl -0x40(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0xb21f
jmp 0xb23e
leaq 0xaffe(%rip), %rdi      # 0x16224
leaq 0xb00d(%rip), %rsi      # 0x1623a
movl $0x1a, %edx
leaq 0xb010(%rip), %rcx      # 0x16249
callq 0x3200
cmpq $0x1, -0x38(%rbp)
jne 0xb247
jmp 0xb266
leaq 0xb01c(%rip), %rdi      # 0x1626a
leaq 0xafe5(%rip), %rsi      # 0x1623a
movl $0x1c, %edx
leaq 0xafe8(%rip), %rcx      # 0x16249
callq 0x3200
movq -0xa8(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl (%rax), %esi
callq 0xdd40
movq -0x98(%rbp), %rax
movb $0x0, -0x41(%rbp)
addq $0x2040, %rax           # imm = 0x2040
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x58b0
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x58e0
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x5910
testb $0x1, %al
jne 0xb2bb
jmp 0xb2ef
leaq -0x58(%rbp), %rdi
callq 0x5950
movq -0xa8(%rbp), %rsi
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0xdf30
testb $0x1, %al
jne 0xb2de
jmp 0xb2e2
movb $0x1, -0x41(%rbp)
jmp 0xb2e4
leaq -0x58(%rbp), %rdi
callq 0x5970
jmp 0xb2a8
testb $0x1, -0x41(%rbp)
jne 0xb326
movq 0x15cd4(%rip), %rax     # 0x20fd0
movq (%rax), %rdi
leaq 0xaf72(%rip), %rsi      # 0x16278
movb $0x0, %al
callq 0x3450
movq 0x15cbc(%rip), %rax     # 0x20fd0
movq (%rax), %rdi
callq 0x3390
movl $0x1, %edi
callq 0x33a0
movq -0x98(%rbp), %rdi
movq %rdi, %rax
addq $0x2040, %rax           # imm = 0x2040
movq %rax, -0xb0(%rbp)
addq $0x2040, %rdi           # imm = 0x2040
callq 0x58b0
movq -0x98(%rbp), %rdi
movq %rax, -0x80(%rbp)
addq $0x2040, %rdi           # imm = 0x2040
callq 0x58e0
movq -0xa8(%rbp), %rdx
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0xc040
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xc090
movq -0xb0(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0xbfd0
movq %rax, -0x90(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xc0d0
movq -0xa0(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nop
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: encodeCards(std::vector<Card, std::allocator<Card>> const&)
std::vector<uint8_t> encodeCards(const std::vector<Card>& cards) {
  std::vector<uint8_t> ret;

  for(const auto &c: cards)
    ret.push_back(c.encode());

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x60(%rbp)
movq %rdi, %rax
movq %rax, -0x58(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0xc100
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8f30
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8f60
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9340
testb $0x1, %al
jne 0xb419
jmp 0xb46d
leaq -0x28(%rbp), %rdi
callq 0x93b0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0xe150
movb %al, -0x61(%rbp)
jmp 0xb434
movq -0x60(%rbp), %rdi
movb -0x61(%rbp), %al
movb %al, -0x39(%rbp)
leaq -0x39(%rbp), %rsi
callq 0xc120
jmp 0xb449
jmp 0xb44b
leaq -0x28(%rbp), %rdi
callq 0x93d0
jmp 0xb406
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0xc150
jmp 0xb48a
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0xb480
movq -0x60(%rbp), %rdi
callq 0xc150
movq -0x58(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x34d0
nopw %cs:(%rax,%rax)
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::sendCards(std::vector<Card, std::allocator<Card>> const&)
void Connection::sendCards(const std::vector<Card>& cardsOnTable) {

  auto cards = encodeCards(cardsOnTable);

  event req;
  req.type = event::EType::SEND_CARDS;
  req.len = cards.size();
  req.data = cards.data();
  req.send(sfd);

  readAndAssert(resp);

  resp.free();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0xb3c0
movq -0x78(%rbp), %rdi
movl $0x0, -0x40(%rbp)
callq 0xc1b0
movq -0x78(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0xc1d0
movq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, -0x30(%rbp)
movl 0x201c(%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0xbc80
jmp 0xb505
movq -0x70(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x14ef0
jmp 0xb514
movl -0x68(%rbp), %eax
cmpl -0x40(%rbp), %eax
jne 0xb51e
jmp 0xb554
leaq 0xacff(%rip), %rdi      # 0x16224
leaq 0xad0e(%rip), %rsi      # 0x1623a
movl $0x5a, %edx
leaq 0xad91(%rip), %rcx      # 0x162c9
callq 0x3200
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xc150
jmp 0xb571
leaq -0x68(%rbp), %rdi
callq 0xc0d0
jmp 0xb55f
leaq -0x28(%rbp), %rdi
callq 0xc150
addq $0x80, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x34d0
nopw (%rax,%rax)
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::turnEnd()
void Connection::turnEnd() {
  event req;
  req.type = event::EType::TURN_END;
  req.len = 0;
  req.data = NULL;
  req.send(sfd);

  readAndAssert(resp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x5, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movl 0x201c(%rax), %esi
leaq -0x20(%rbp), %rdi
callq 0xbc80
movq -0x40(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x14ef0
movl -0x38(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0xb5d1
jmp 0xb5f0
leaq 0xac4c(%rip), %rdi      # 0x16224
leaq 0xac5b(%rip), %rsi      # 0x1623a
movl $0x66, %edx
leaq 0xad14(%rip), %rcx      # 0x162ff
callq 0x3200
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::sendScores(std::vector<int, std::allocator<int>> const&)
void Connection::sendScores(const std::vector<int>& allScores) {

  std::vector<uint8_t> data;

  data.reserve(allScores.size() * 4);

  for(const auto &i: allScores) {
    const int x = htonl(i);
    const uint8_t*const ptr = reinterpret_cast<const uint8_t *const>(&x);
    for(int i = 0; i < 4; ++i)
      data.push_back(ptr[i]);
  }

  event req;
  req.type = event::EType::ROUND_END;
  req.len = data.size();
  req.data = data.data();
  req.send(sfd);

  readAndAssert(resp);

  resp.free();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0xc100
movq -0x10(%rbp), %rdi
callq 0x86a0
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
shlq $0x2, %rsi
callq 0xc1f0
jmp 0xb64c
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x87c0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x87f0
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xc2d0
testb $0x1, %al
jne 0xb681
jmp 0xb6fe
leaq -0x48(%rbp), %rdi
callq 0xc310
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl (%rax), %edi
callq 0x3240
movl %eax, -0x5c(%rbp)
leaq -0x5c(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
cmpl $0x4, -0x6c(%rbp)
jge 0xb6ee
movq -0x68(%rbp), %rsi
movslq -0x6c(%rbp), %rax
addq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0xc330
jmp 0xb6c7
jmp 0xb6c9
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0xb6ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xc150
jmp 0xb7ae
jmp 0xb6f0
leaq -0x48(%rbp), %rdi
callq 0xc3a0
jmp 0xb66e
movl $0x2, -0x88(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0xc1b0
movq -0xb8(%rbp), %rdi
movq %rax, -0x80(%rbp)
callq 0xc1d0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movq %rcx, -0x78(%rbp)
movl 0x201c(%rax), %esi
leaq -0x88(%rbp), %rdi
callq 0xbc80
jmp 0xb74a
movq -0xb0(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x14ef0
jmp 0xb75f
movl -0xa0(%rbp), %eax
cmpl -0x88(%rbp), %eax
jne 0xb76f
jmp 0xb78e
leaq 0xaaae(%rip), %rdi      # 0x16224
leaq 0xaabd(%rip), %rsi      # 0x1623a
movl $0x7c, %edx
leaq 0xab91(%rip), %rcx      # 0x1631a
callq 0x3200
leaq -0xa0(%rbp), %rdi
callq 0xc0d0
jmp 0xb79c
leaq -0x28(%rbp), %rdi
callq 0xc150
addq $0xc0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x34d0
nopw (%rax,%rax)
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::gameEnd()
void Connection::gameEnd() {
  event req;
  req.type = event::EType::GAME_END;
  req.len = 0;
  req.data = NULL;
  req.send(sfd);

  readAndAssert(resp);
  resp.free();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0xa, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movl 0x201c(%rax), %esi
leaq -0x20(%rbp), %rdi
callq 0xbc80
movq -0x40(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x14ef0
movl -0x38(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0xb811
jmp 0xb830
leaq 0xaa0c(%rip), %rdi      # 0x16224
leaq 0xaa1b(%rip), %rsi      # 0x1623a
movl $0x88, %edx
leaq 0xab25(%rip), %rcx      # 0x16350
callq 0x3200
leaq -0x38(%rbp), %rdi
callq 0xc0d0
addq $0x40, %rsp
popq %rbp
retq
nop
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::getGameChoice()
uint8_t Connection::getGameChoice() {
  event req;
  req.type = event::EType::ASK_GAME;
  req.len = 0;
  req.data = NULL;
  req.send(sfd);

  readAndAssert(resp);
  assert(resp.len == 1);

  uint8_t choice = resp.data[0];
  resp.free();
  return choice;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x3, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movl 0x201c(%rax), %esi
leaq -0x20(%rbp), %rdi
callq 0xbc80
movq -0x48(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x14ef0
movl -0x38(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0xb911
jmp 0xb930
leaq 0xa90c(%rip), %rdi      # 0x16224
leaq 0xa91b(%rip), %rsi      # 0x1623a
movl $0x9b, %edx
leaq 0xaa40(%rip), %rcx      # 0x1636b
callq 0x3200
cmpq $0x1, -0x30(%rbp)
jne 0xb939
jmp 0xb958
leaq 0xa92a(%rip), %rdi      # 0x1626a
leaq 0xa8f3(%rip), %rsi      # 0x1623a
movl $0x9c, %edx
leaq 0xaa18(%rip), %rcx      # 0x1636b
callq 0x3200
movq -0x28(%rbp), %rax
movb (%rax), %al
movb %al, -0x39(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xc0d0
movb -0x39(%rbp), %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::sendGameChoice(unsigned char)
void Connection::sendGameChoice(uint8_t type) {
  event req;
  req.type = event::EType::ROUND_START;
  req.len = 1;
  req.data = &type;
  req.send(sfd);

  readAndAssert(resp);

  resp.free();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x4, -0x28(%rbp)
movq $0x1, -0x20(%rbp)
leaq -0x9(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movl 0x201c(%rax), %esi
leaq -0x28(%rbp), %rdi
callq 0xbc80
movq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x14ef0
movl -0x40(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0xb9d7
jmp 0xb9f6
leaq 0xa846(%rip), %rdi      # 0x16224
leaq 0xa855(%rip), %rsi      # 0x1623a
movl $0xaa, %edx
leaq 0xa99e(%rip), %rcx      # 0x1638f
callq 0x3200
leaq -0x40(%rbp), %rdi
callq 0xc0d0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::getNVChoice()
bool Connection::getNVChoice() {
  event req;
  req.type = event::EType::ASK_NV;
  req.len = 0;
  req.data = NULL;
  req.send(sfd);

  readAndAssert(resp);
  assert(resp.len == 1);
  bool NV = resp.data[0];

  resp.free();
  return NV;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x7, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movl 0x201c(%rax), %esi
leaq -0x20(%rbp), %rdi
callq 0xbc80
movq -0x48(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x14ef0
movl -0x38(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0xba61
jmp 0xba80
leaq 0xa7bc(%rip), %rdi      # 0x16224
leaq 0xa7cb(%rip), %rsi      # 0x1623a
movl $0xb6, %edx
leaq 0xa93d(%rip), %rcx      # 0x163b8
callq 0x3200
cmpq $0x1, -0x30(%rbp)
jne 0xba89
jmp 0xbaa8
leaq 0xa7da(%rip), %rdi      # 0x1626a
leaq 0xa7a3(%rip), %rsi      # 0x1623a
movl $0xb7, %edx
leaq 0xa915(%rip), %rcx      # 0x163b8
callq 0x3200
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
setne %al
andb $0x1, %al
movb %al, -0x39(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xc0d0
movb -0x39(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::sendHand(std::vector<Card, std::allocator<Card>> const&)
void Connection::sendHand(const std::vector<Card>& hand) {
  auto cards = encodeCards(hand);
  event req;
  req.type = event::EType::SEND_HAND;
  req.len = cards.size();
  req.data = cards.data();
  req.send(sfd);

  this->hand = hand;

  readAndAssert(resp);

  resp.free();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0xb3c0
movq -0x78(%rbp), %rdi
movl $0x1, -0x40(%rbp)
callq 0xc1b0
movq -0x78(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0xc1d0
movq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, -0x30(%rbp)
movl 0x201c(%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0xbc80
jmp 0xbb35
movq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x2040, %rdi           # imm = 0x2040
callq 0x7870
jmp 0xbb4b
movq -0x70(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x14ef0
jmp 0xbb5a
movl -0x68(%rbp), %eax
cmpl -0x40(%rbp), %eax
jne 0xbb64
jmp 0xbb9a
leaq 0xa6b9(%rip), %rdi      # 0x16224
leaq 0xa6c8(%rip), %rsi      # 0x1623a
movl $0xc8, %edx
leaq 0xa859(%rip), %rcx      # 0x163d7
callq 0x3200
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xc150
jmp 0xbbb7
leaq -0x68(%rbp), %rdi
callq 0xc0d0
jmp 0xbba5
leaq -0x28(%rbp), %rdi
callq 0xc150
addq $0x80, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x34d0
// File: Thomas1995[P]Rentz/src/connection.cpp
// Function: Connection::sendIndex(unsigned long)
void Connection::sendIndex(size_t index) {

  index = htonl(index);

  event req;
  req.type = event::EType::SEND_INIT;
  req.len = 4;
  req.data = reinterpret_cast<uint8_t *>(&index);
  req.send(sfd);


  readAndAssert(resp);

  resp.free();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movl %eax, %edi
callq 0x3240
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, %ecx
movq %rcx, -0x10(%rbp)
movl $0x8, -0x28(%rbp)
movq $0x4, -0x20(%rbp)
leaq -0x10(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movl 0x201c(%rax), %esi
leaq -0x28(%rbp), %rdi
callq 0xbc80
movq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x14ef0
movl -0x40(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0xbc2c
jmp 0xbc4b
leaq 0xa5f1(%rip), %rdi      # 0x16224
leaq 0xa600(%rip), %rsi      # 0x1623a
movl $0xd8, %edx
leaq 0xa7c6(%rip), %rcx      # 0x1640c
callq 0x3200
leaq -0x40(%rbp), %rdi
callq 0xc0d0
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: Thomas1995[P]Rentz/src/table.cpp
// Function: Table::GiveHands()
void Table::GiveHands() {
  // get all cards in play
  std::vector<Card> allCards = Card::getAllCards();

  unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
  std::shuffle(allCards.begin(), allCards.end(), std::default_random_engine(seed));

  auto card = allCards.begin();

  // give cards to players
  for(size_t i=0;i<players.size();++i) {
    std::vector<Card> hand;
    for(int j=1;j<=8;++j) {
      hand.push_back(*card);
      ++card;
    }
    players[i].sendHand(hand);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xe190
callq 0x3070
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x106c0
movq %rax, -0x98(%rbp)
jmp 0xf85e
movq -0x98(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xad40
movq %rax, -0xa8(%rbp)
jmp 0xf87b
movq -0xa8(%rbp), %rax
movl %eax, -0x24(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x58b0
movq -0xb0(%rbp), %rdi
movq %rax, -0x50(%rbp)
callq 0x58e0
movq %rax, -0x58(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %esi
leaq -0x60(%rbp), %rdi
callq 0x10950
jmp 0xf8b9
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x106e0
jmp 0xf8cc
leaq -0x20(%rbp), %rdi
callq 0x58b0
movq %rax, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x70(%rbp), %rax
movq %rax, -0xb8(%rbp)
addq $0x8, %rdi
callq 0x7d10
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
jae 0xf9cc
leaq -0x88(%rbp), %rdi
callq 0xbc60
movl $0x1, -0x8c(%rbp)
cmpl $0x8, -0x8c(%rbp)
jg 0xf98a
leaq -0x68(%rbp), %rdi
callq 0x5950
movq %rax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x10650
jmp 0xf948
leaq -0x68(%rbp), %rdi
callq 0x5970
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0xf925
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xf9de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x9670
jmp 0xf9de
movq -0xa0(%rbp), %rdi
addq $0x8, %rdi
movq -0x70(%rbp), %rsi
callq 0x101c0
movq %rax, %rdi
leaq -0x88(%rbp), %rsi
callq 0xbad0
jmp 0xf9af
leaq -0x88(%rbp), %rdi
callq 0x9670
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0xf8e1
leaq -0x20(%rbp), %rdi
callq 0x9670
addq $0xc0, %rsp
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x9670
movq -0x40(%rbp), %rdi
callq 0x34d0
// File: Thomas1995[P]Rentz/src/table.cpp
// Function: Table::printScores()
void Table::printScores() {
  std::cout << "Scores:\n";
  for(size_t i=0;i<players.size();++i) {
    players[i].sendScores(score);
    std::cout << players[i].getName() + ": " << score[i] << "\n";
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq 0x1137a(%rip), %rdi     # 0x20fc8
leaq 0x6a2d(%rip), %rsi      # 0x16682
callq 0x32d0
movq $0x0, -0x10(%rbp)
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
addq $0x8, %rdi
callq 0x7d10
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jae 0xfd86
movq -0x68(%rbp), %rdi
addq $0x8, %rdi
movq %rdi, -0x80(%rbp)
movq -0x10(%rbp), %rsi
callq 0x101c0
movq -0x68(%rbp), %rsi
movq %rax, %rdi
addq $0x40, %rsi
callq 0xb600
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x101c0
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0xb840
movq -0x78(%rbp), %rsi
leaq 0x645e(%rip), %rdx      # 0x16132
leaq -0x30(%rbp), %rdi
callq 0x10520
jmp 0xfcdf
movq 0x112e2(%rip), %rdi     # 0x20fc8
leaq -0x30(%rbp), %rsi
callq 0x32b0
movq %rax, -0x88(%rbp)
jmp 0xfcf8
movq -0x68(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
callq 0x5890
movq -0x88(%rbp), %rdi
movl (%rax), %esi
callq 0x34c0
movq %rax, -0x90(%rbp)
jmp 0xfd20
movq -0x90(%rbp), %rdi
leaq 0x6875(%rip), %rsi      # 0x165a3
callq 0x32d0
jmp 0xfd35
leaq -0x30(%rbp), %rdi
callq 0x31c0
leaq -0x50(%rbp), %rdi
callq 0x31c0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xfc62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xfd7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x31c0
leaq -0x50(%rbp), %rdi
callq 0x31c0
jmp 0xfd8f
addq $0x90, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x34d0
nopl (%rax,%rax)
// File: Thomas1995[P]Rentz/src/table.cpp
// Function: Table::PlayTurn(__gnu_cxx::__normal_iterator<Connection*, std::vector<Connection, std::allocator<Connection>>>)
void Table::PlayTurn(std::vector<Connection>::iterator iterator) {
  for(auto it = iterator; it != players.end(); ++it)
    PlayerAction(*it);
  for(auto it = players.begin(); it != iterator; ++it)
    PlayerAction(*it);
  std::cout << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x7fd0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x9810
testb $0x1, %al
jne 0x10074
jmp 0x10094
leaq -0x18(%rbp), %rdi
callq 0x9850
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0xfda0
leaq -0x18(%rbp), %rdi
callq 0x9870
jmp 0x10050
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x5860
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x9810
testb $0x1, %al
jne 0x100b8
jmp 0x100d8
leaq -0x28(%rbp), %rdi
callq 0x9850
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0xfda0
leaq -0x28(%rbp), %rdi
callq 0x9870
jmp 0x100a5
movq 0x10ee9(%rip), %rdi     # 0x20fc8
movq 0x10ed2(%rip), %rsi     # 0x20fb8
callq 0x3300
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: enfiskutensykkel[P]lamport/src/lamport.cpp
// Function: LamportQueue::enqueue(int)
bool LamportQueue::enqueue(int element)
{
	uint64_t curr_tail, curr_head;

	// Try to take ticket for a slot atomically
	do
	{
		curr_head = head;
		curr_tail = tail;

		if (curr_tail >= curr_head + capacity)
		{
			return false;
		}
	}
	while (!CAS(tail, curr_tail, curr_tail + 1));

	// We got the ticket for this slot, so we can take our time inserting
	buffer[curr_tail & mask] = new int(element);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x28(%rbp)
movl %esi, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdx
movq 0x10(%rdx), %rax
movq %rax, -0x40(%rbp)
movq 0x18(%rdx), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movl 0x8(%rdx), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jb 0x2424
movb $0x0, -0x1a(%rbp)
jmp 0x249d
jmp 0x2426
movq -0x48(%rbp), %rdx
addq $0x18, %rdx
movq -0x38(%rbp), %rcx
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rdx, -0x8(%rbp)
movq %rcx, -0x10(%rbp)
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
lock
cmpxchgq %rdx, (%rcx)
sete %al
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x23f7
movl $0x4, %edi
callq 0x2130
movq -0x48(%rbp), %rsi
movq %rax, %rdx
movl -0x2c(%rbp), %eax
movl %eax, (%rdx)
movq 0x20(%rsi), %rax
movq -0x38(%rbp), %rcx
movl 0x28(%rsi), %esi
andq %rsi, %rcx
movq %rdx, (%rax,%rcx,8)
movb $0x1, -0x1a(%rbp)
movb -0x1a(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: enfiskutensykkel[P]lamport/src/lamport.cpp
// Function: LamportQueue::dequeue(int&)
bool LamportQueue::dequeue(int& element)
{
	uint64_t curr_head = head;
	if (curr_head == tail)
	{
		return false;
	}

	// A producer may take some time inserting an element, so we'll just wait
	int* ptr;
	do
	{
		ptr = buffer[curr_head & mask];
	} 
	while (ptr == nullptr);

	element = *ptr;

	delete buffer[curr_head & mask];
	buffer[curr_head & mask] = nullptr;

	// As the very last thing we do, we update the head pointer to signal others that we're done
	head = curr_head + 1;

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movq 0x10(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq 0x18(%rcx), %rax
jne 0x24e3
movb $0x0, -0x1(%rbp)
jmp 0x2565
jmp 0x24e5
movq -0x30(%rbp), %rdx
movq 0x20(%rdx), %rax
movq -0x20(%rbp), %rcx
movl 0x28(%rdx), %edx
andq %rdx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x24e5
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq 0x20(%rdx), %rax
movq -0x20(%rbp), %rcx
movl 0x28(%rdx), %edx
andq %rdx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x253b
movq -0x38(%rbp), %rdi
callq 0x2120
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x20(%rbp), %rdx
movl 0x28(%rax), %esi
andq %rsi, %rdx
movq $0x0, (%rcx,%rdx,8)
movq -0x20(%rbp), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
// File: enfiskutensykkel[P]lamport/src/locking.cpp
// Function: LockingQueue::enqueue(int)
bool LockingQueue::enqueue(int element)
{
	if (pthread_mutex_lock(&queue_lock) != 0)
	{
		assert(false);
		throw std::runtime_error("failed to take lock in enqueue");
	}

	if (tail - head >= capacity)
	{
		pthread_mutex_unlock(&queue_lock);
		return false;
	}

	buffer[tail % capacity] = new int(element);
	++tail;

	pthread_mutex_unlock(&queue_lock);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x28, %rdi
callq 0x21d0
cmpl $0x0, %eax
je 0x27b5
movl $0x10, %edi
callq 0x2090
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x38c0(%rip), %rsi      # 0x6040
callq 0x2060
jmp 0x2787
movq -0x38(%rbp), %rdi
movq 0x6866(%rip), %rsi      # 0x8ff8
movq 0x682f(%rip), %rdx      # 0x8fc8
callq 0x2210
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x20d0
jmp 0x2834
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rax
subq 0x10(%rcx), %rax
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jb 0x27dc
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
callq 0x20e0
movb $0x0, -0x1(%rbp)
jmp 0x2829
movl $0x4, %edi
callq 0x2130
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl -0x14(%rbp), %eax
movl %eax, (%rcx)
movq 0x20(%rdi), %rax
movq %rax, -0x40(%rbp)
movq 0x18(%rdi), %rax
movl 0x8(%rdi), %edx
movl %edx, %esi
xorl %edx, %edx
divq %rsi
movq -0x40(%rbp), %rax
movq %rcx, (%rax,%rdx,8)
movq 0x18(%rdi), %rax
addq $0x1, %rax
movq %rax, 0x18(%rdi)
addq $0x28, %rdi
callq 0x20e0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x2220
nopl (%rax)
// File: enfiskutensykkel[P]lamport/src/locking.cpp
// Function: LockingQueue::dequeue(int&)
bool LockingQueue::dequeue(int& element)
{
	if (pthread_mutex_lock(&queue_lock) != 0)
	{
		assert(false);
		throw std::runtime_error("failed to take lock in dequeue");
	}

	if (tail == head)
	{
		pthread_mutex_unlock(&queue_lock);
		return false;
	}

	element = *buffer[head % capacity];
	delete buffer[head % capacity];
	buffer[head % capacity] = nullptr;
	++head;

	pthread_mutex_unlock(&queue_lock);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x28, %rdi
callq 0x21d0
cmpl $0x0, %eax
je 0x28b9
movl $0x10, %edi
callq 0x2090
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x37de(%rip), %rsi      # 0x605f
callq 0x2060
jmp 0x2888
movq -0x38(%rbp), %rdi
movq 0x6765(%rip), %rsi      # 0x8ff8
movq 0x672e(%rip), %rdx      # 0x8fc8
callq 0x2210
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x20d0
jmp 0x297e
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rax
cmpq 0x10(%rcx), %rax
jne 0x28dd
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
callq 0x20e0
movb $0x0, -0x1(%rbp)
jmp 0x2973
movq -0x30(%rbp), %rcx
movq 0x20(%rcx), %rax
movq %rax, -0x50(%rbp)
movq 0x10(%rcx), %rax
movl 0x8(%rcx), %edx
movl %edx, %esi
xorl %edx, %edx
divq %rsi
movq -0x50(%rbp), %rax
movq (%rax,%rdx,8), %rax
movl (%rax), %edx
movq -0x18(%rbp), %rax
movl %edx, (%rax)
movq 0x20(%rcx), %rax
movq %rax, -0x48(%rbp)
movq 0x10(%rcx), %rax
movl 0x8(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq -0x48(%rbp), %rax
movq (%rax,%rdx,8), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x2936
movq -0x40(%rbp), %rdi
callq 0x2120
movq -0x30(%rbp), %rdi
movq 0x20(%rdi), %rax
movq %rax, -0x58(%rbp)
movq 0x10(%rdi), %rax
movl 0x8(%rdi), %ecx
xorl %edx, %edx
divq %rcx
movq -0x58(%rbp), %rax
movq $0x0, (%rax,%rdx,8)
movq 0x10(%rdi), %rax
addq $0x1, %rax
movq %rax, 0x10(%rdi)
addq $0x28, %rdi
callq 0x20e0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x2220
nopw (%rax,%rax)
// File: enfiskutensykkel[P]lamport/src/locking.cpp
// Function: LockingQueue::size()
uint32_t LockingQueue::size()
{
	if (pthread_mutex_lock(&queue_lock) != 0)
	{
		assert(false);
		throw std::runtime_error("failed to take lock in size");
	}

	uint32_t size = tail - head;

	pthread_mutex_unlock(&queue_lock);
	return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x28, %rdi
callq 0x21d0
cmpl $0x0, %eax
je 0x2a02
movl $0x10, %edi
callq 0x2090
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x28(%rbp)
leaq 0x36b1(%rip), %rsi      # 0x607e
callq 0x2060
jmp 0x29d4
movq -0x28(%rbp), %rdi
movq 0x6619(%rip), %rsi      # 0x8ff8
movq 0x65e2(%rip), %rdx      # 0x8fc8
callq 0x2210
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x20d0
jmp 0x2a23
movq -0x20(%rbp), %rdi
movq 0x18(%rdi), %rax
subq 0x10(%rdi), %rax
movl %eax, -0x18(%rbp)
addq $0x28, %rdi
callq 0x20e0
movl -0x18(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x2220
nopl (%rax)
// File: enfiskutensykkel[P]lamport/src/main.cpp
// Function: main
int main(void)
{
	LockingQueue locking(QUEUE_SIZE);
	OptimizedLockingQueue locking_optimized(QUEUE_SIZE);
	LamportQueue lockfree(QUEUE_SIZE);

	unsigned failed = 0;
	failed += ! Producer::test_queue(locking, REPETITIONS, PRODUCERS);
	failed += ! Producer::test_queue(locking_optimized, REPETITIONS, PRODUCERS);
	failed += ! Producer::test_queue(lockfree, REPETITIONS, PRODUCERS);

	return failed == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl $0x0, -0x4(%rbp)
leaq -0x58(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
movl %esi, -0xf8(%rbp)
callq 0x2600
movl -0xf8(%rbp), %esi
leaq -0xb0(%rbp), %rdi
callq 0x2c50
jmp 0x2ada
leaq -0xf0(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2350
jmp 0x2aed
movl $0x0, -0xf4(%rbp)
leaq -0x58(%rbp), %rdi
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x3, %edx
callq 0x2ff0
movb %al, -0xf9(%rbp)
jmp 0x2b12
movb -0xf9(%rbp), %al
notb %al
movzbl %al, %ecx
andl $0x1, %ecx
movl -0xf4(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xf4(%rbp)
leaq -0xb0(%rbp), %rdi
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x3, %edx
callq 0x2ff0
movb %al, -0xfa(%rbp)
jmp 0x2b4c
movb -0xfa(%rbp), %al
notb %al
movzbl %al, %ecx
andl $0x1, %ecx
movl -0xf4(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xf4(%rbp)
leaq -0xf0(%rbp), %rdi
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x3, %edx
callq 0x2ff0
movb %al, -0xfb(%rbp)
jmp 0x2b86
movb -0xfb(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
addl -0xf4(%rbp), %eax
movl %eax, -0xf4(%rbp)
cmpl $0x0, -0xf4(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x2390
leaq -0xb0(%rbp), %rdi
callq 0x2d20
leaq -0x58(%rbp), %rdi
callq 0x26c0
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x2c30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x2c24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x2390
leaq -0xb0(%rbp), %rdi
callq 0x2d20
leaq -0x58(%rbp), %rdi
callq 0x26c0
movq -0xb8(%rbp), %rdi
callq 0x2220
nopw %cs:(%rax,%rax)
nop
// File: enfiskutensykkel[P]lamport/src/optimized.cpp
// Function: OptimizedLockingQueue::enqueue(int)
bool OptimizedLockingQueue::enqueue(int element)
{
	if (pthread_mutex_lock(&tail_lock) != 0)
	{
		assert(false);
		throw std::runtime_error("failed to take lock in enqueue");
	}

	if (tail - head >= capacity)
	{
		pthread_mutex_unlock(&tail_lock);
		return false;
	}

	uint64_t curr_tail = tail++;
	pthread_mutex_unlock(&tail_lock);

	buffer[curr_tail & mask] = new int(element);

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x28, %rdi
callq 0x21d0
cmpl $0x0, %eax
je 0x2e15
movl $0x10, %edi
callq 0x2090
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x3260(%rip), %rsi      # 0x6040
callq 0x2060
jmp 0x2de7
movq -0x40(%rbp), %rdi
movq 0x6206(%rip), %rsi      # 0x8ff8
movq 0x61cf(%rip), %rdx      # 0x8fc8
callq 0x2210
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x20d0
jmp 0x2e93
movq -0x38(%rbp), %rcx
movq 0x18(%rcx), %rax
subq 0x10(%rcx), %rax
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jb 0x2e3c
movq -0x38(%rbp), %rdi
addq $0x28, %rdi
callq 0x20e0
movb $0x0, -0x1(%rbp)
jmp 0x2e88
movq -0x38(%rbp), %rdi
movq 0x18(%rdi), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rdi)
movq %rax, -0x30(%rbp)
addq $0x28, %rdi
callq 0x20e0
movl $0x4, %edi
callq 0x2130
movq -0x38(%rbp), %rsi
movq %rax, %rdx
movl -0x14(%rbp), %eax
movl %eax, (%rdx)
movq 0x20(%rsi), %rax
movq -0x30(%rbp), %rcx
movl 0x50(%rsi), %esi
andq %rsi, %rcx
movq %rdx, (%rax,%rcx,8)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x2220
nopl (%rax)
// File: enfiskutensykkel[P]lamport/src/optimized.cpp
// Function: OptimizedLockingQueue::dequeue(int&)
bool OptimizedLockingQueue::dequeue(int& element)
{
	if (tail == head)
	{
		return false;
	}

	int* ptr;
	do
	{
		ptr = buffer[head & mask];
	} 
	while (ptr == nullptr);

	element = *ptr;

	delete buffer[head & mask];
	buffer[head & mask] = nullptr;

	++head;

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movq 0x18(%rcx), %rax
cmpq 0x10(%rcx), %rax
jne 0x2ecb
movb $0x0, -0x1(%rbp)
jmp 0x2f4d
jmp 0x2ecd
movq -0x28(%rbp), %rdx
movq 0x20(%rdx), %rax
movq 0x10(%rdx), %rcx
movl 0x50(%rdx), %edx
andq %rdx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2ecd
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq 0x20(%rdx), %rax
movq 0x10(%rdx), %rcx
movl 0x50(%rdx), %edx
andq %rdx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x2f23
movq -0x30(%rbp), %rdi
callq 0x2120
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rcx
movq 0x10(%rax), %rdx
movl 0x50(%rax), %esi
andq %rsi, %rdx
movq $0x0, (%rcx,%rdx,8)
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: enfiskutensykkel[P]lamport/src/producer.cpp
// Function: test_dequeuing(Queue&, std::vector<std::pair<std::shared_ptr<Producer>, bool>, std::allocator<std::pair<std::shared_ptr<Producer>, bool>>>&, unsigned int)
static uint64_t test_dequeuing(Queue& queue, std::vector<TProducer>& producers, unsigned repetitions)
{
	timespec start, stop;
	unsigned* count = new unsigned[producers.size()];
	bzero((void*) count, producers.size() * sizeof(unsigned)); // not very C++-ish, C++ purists would complain about this

#ifndef NDEBUG
	for (TProducer& test: producers)
	{
		assert(test.first->value >= 0 && test.first->value < producers.size());
	}
#endif

	unsigned n = repetitions * producers.size() + 1;
	clock_gettime(CLOCK_REALTIME, &start);
	while (--n != 0)
	{
		// Try to dequeue an element from the queue
		// and yield if the queue is (temporarily) empty
		int value;
		while (!queue.dequeue(value))
		{
			pthread_yield();
		}

		assert(value >= 0 && value < producers.size());
		++count[value];
	}
	clock_gettime(CLOCK_REALTIME, &stop);

	for (TProducer& test: producers)
	{
		test.second = (count[test.first->value] == repetitions);
	}

	delete[] count;
	return tsdiff(stop, start);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3cd0
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3cd0
movq -0x78(%rbp), %rdi
movq %rax, %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x20b0
movl -0x14(%rbp), %eax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3cd0
movq %rax, %rcx
movq -0x70(%rbp), %rax
imulq %rcx, %rax
addq $0x1, %rax
movl %eax, -0x44(%rbp)
xorl %edi, %edi
leaq -0x28(%rbp), %rsi
callq 0x2110
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
cmpl $0x0, %eax
je 0x3804
jmp 0x37d4
movq -0x8(%rbp), %rdi
movq (%rdi), %rax
leaq -0x48(%rbp), %rsi
callq *0x20(%rax)
xorb $-0x1, %al
testb $0x1, %al
jne 0x37ea
jmp 0x37f1
callq 0x21c0
jmp 0x37d4
movq -0x40(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x37c4
xorl %edi, %edi
leaq -0x38(%rbp), %rsi
callq 0x2110
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x4100
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x4130
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4160
testb $0x1, %al
jne 0x3844
jmp 0x388a
leaq -0x58(%rbp), %rdi
callq 0x41a0
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x68(%rbp), %rdi
callq 0x41c0
movq %rax, %rcx
movq -0x80(%rbp), %rax
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
sete %cl
movq -0x68(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x10(%rax)
leaq -0x58(%rbp), %rdi
callq 0x41e0
jmp 0x3831
movq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0x38a7
movq -0x88(%rbp), %rdi
callq 0x2180
leaq -0x38(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3af0
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)
// File: enfiskutensykkel[P]lamport/src/producer.cpp
// Function: Producer::dispatch(Producer*)
void Producer::dispatch(Producer* thread)
{
	int ret = pthread_barrier_wait(&thread->barrier);

	assert(ret == PTHREAD_BARRIER_SERIAL_THREAD || ret == 0);
	if (ret != PTHREAD_BARRIER_SERIAL_THREAD && ret != 0)
	{
		throw std::runtime_error("failed to wait on barrier in thread");
	}

	if (thread->running)
	{
		thread->run();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2160
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
je 0x39f8
cmpl $0x0, -0xc(%rbp)
je 0x39f8
movl $0x10, %edi
callq 0x2090
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x28(%rbp)
leaq 0x28f6(%rip), %rsi      # 0x62b9
callq 0x2060
jmp 0x39ca
movq -0x28(%rbp), %rdi
movq 0x5623(%rip), %rsi      # 0x8ff8
movq 0x55ec(%rip), %rdx      # 0x8fc8
callq 0x2210
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x20d0
jmp 0x3a11
movq -0x8(%rbp), %rax
testb $0x1, 0x18(%rax)
je 0x3a0b
movq -0x8(%rbp), %rdi
callq 0x3a60
addq $0x30, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x2220
nopw (%rax,%rax)
// File: enfiskutensykkel[P]lamport/src/producer.cpp
// Function: Producer::run()
void Producer::run()
{
	unsigned remaining = repetitions + 1;

	while (running && --remaining != 0)
	{
		// Try to insert element into queue
		// If it's full, yield and try again later
		while (running && !queue.enqueue(value))
		{
			pthread_yield();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x18(%rcx)
movb %al, -0x19(%rbp)
je 0x3a9e
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x3aa7
jmp 0x3adf
jmp 0x3aa9
movq -0x18(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x18(%rcx)
movb %al, -0x1a(%rbp)
je 0x3acd
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movl (%rax), %esi
movq (%rdi), %rax
callq *0x18(%rax)
xorb $-0x1, %al
movb %al, -0x1a(%rbp)
movb -0x1a(%rbp), %al
testb $0x1, %al
jne 0x3ad6
jmp 0x3add
callq 0x21c0
jmp 0x3aa9
jmp 0x3a7d
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)