LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/Thomas1995[P]Rentz/src/./server.h
// Function: Server::Server()
Server() {
    //returns server's fd

    struct addrinfo hints, *rez;
    memset(&hints, 0, sizeof(hints));
    hints.ai_family = AF_UNSPEC;
    hints.ai_socktype = SOCK_STREAM;
    hints.ai_flags = AI_PASSIVE;

    getaddrinfo(NULL, PORT, &hints, &rez);

    int yes = 1;

    int server = -1;

    for(addrinfo *p = rez; p != NULL; p = p->ai_next) {
      server = socket(p->ai_family, p->ai_socktype, p->ai_protocol);

      if(server == -1) {
        perror("Socket() failed: ");
        continue;
      }

      if(setsockopt(server, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) {
        perror("Setsockopt() failed: ");
        exit(1);
      }

      if(bind(server, p->ai_addr, p->ai_addrlen) == -1) {
        perror("Bind() failed: ");
        exit(1);
      }

      if(listen(server, BACKLOG) == -1) {
        perror("Listen() failed: ");
        exit(1);
      }

      break;
    }

    freeaddrinfo(rez);

    if(server == -1) {
      printf("Could not set up server\n");
      exit(1);
    }

    fd = server;

    epfd = epoll_create1(0);

    if(epfd == -1) {
      perror("Epoll_create() failed: ");
      exit(1);
    }

    addEpollEvent(server, EPOLLIN);

    printf("Server up and listening for connections\n");
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl $0x1, %ebp
movl %ebp, 0x8(%rdx)
movl %ebp, (%rdx)
leaq 0x5755(%rip), %rsi      # 0x91d8
leaq 0x8(%rsp), %r14
xorl %edi, %edi
movq %r14, %rcx
callq 0x22e0
movl %ebp, 0x4(%rsp)
movq (%r14), %r15
testq %r15, %r15
je 0x3acc
leaq 0x564a(%rip), %r14      # 0x90ef
movl 0x4(%r15), %edi
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
callq 0x2090
cmpl $-0x1, %eax
jne 0x3ad3
movq %r14, %rdi
callq 0x21c0
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x3aa5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x3b27
movl %eax, %ebp
leaq 0x4(%rsp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x23d0
cmpl $-0x1, %eax
je 0x3ba3
movq 0x18(%r15), %rsi
movl 0x10(%r15), %edx
movl %ebp, %edi
callq 0x2080
cmpl $-0x1, %eax
je 0x3ba8
movl %ebp, %edi
movl $0x10, %esi
callq 0x2270
cmpl $-0x1, %eax
je 0x3bad
movq 0x8(%rsp), %rdi
callq 0x2300
cmpl $-0x1, %ebp
je 0x3b88
movl %ebp, (%rbx)
xorl %edi, %edi
callq 0x2310
movl %eax, 0x4(%rbx)
cmpl $-0x1, %eax
je 0x3b9e
leaq 0x10(%rsp), %rcx
movq $0x0, (%rcx)
movl $0x0, 0x8(%rcx)
movl $0x1, (%rcx)
movl %ebp, 0x4(%rcx)
movl %eax, %edi
movl $0x1, %esi
movl %ebp, %edx
callq 0x2320
leaq 0x5620(%rip), %rdi      # 0x9198
callq 0x2370
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5631(%rip), %rdi      # 0x91c0
callq 0x2370
movl $0x1, %edi
callq 0x22c0
callq 0x2543
callq 0x252e
callq 0x2519
callq 0x2504
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0xa6e1(%rip), %al       # 0xe2a0
testb %al, %al
je 0x3bde
leaq 0x4(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2584
movl (%r14), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xa6bb(%rip), %rdi      # 0xe2a0
callq 0x23f0
testl %eax, %eax
je 0x3bc3
leaq 0xa693(%rip), %rdi      # 0xe288
leaq 0x3(%rsp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x3c64
leaq 0x3(%rsp), %rdi
callq 0x2558
jmp 0x3bc3
movq %rax, %rbx
leaq 0xa686(%rip), %rdi      # 0xe2a0
callq 0x2150
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7(%rsp), %rax
movb %dl, (%rax)
leaq 0x20(%rsp), %r15
movl $0x9, (%r15)
movq $0x1, 0x8(%r15)
movq %rax, 0x10(%r15)
movl 0x201c(%rsi), %esi
movq %r15, %rdi
callq 0x5200
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x8022
movl (%r12), %eax
cmpl (%r15), %eax
jne 0x4977
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
cmpq $0x0, 0x10(%rsp)
je 0x4959
xorl %r14d, %r14d
movq 0x18(%rsp), %rax
movsbl (%rax,%r14), %esi
movq %rbx, %rdi
callq 0x21d0
incq %r14
cmpq 0x10(%rsp), %r14
jb 0x493d
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x4968
callq 0x22f0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x4884(%rip), %rdi      # 0x9202
leaq 0x4893(%rip), %rsi      # 0x9218
leaq 0x48f0(%rip), %rcx      # 0x927c
movl $0x44, %edx
callq 0x2170
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x49ac
movq (%r15), %rsi
incq %rsi
callq 0x2230
movq %r14, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movl $0x6, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movl 0x201c(%rsi), %esi
movq %r15, %rdi
callq 0x5200
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x8022
movl (%r12), %eax
cmpl (%r15), %eax
jne 0x4ae1
cmpq $0x1, 0x10(%rsp)
jne 0x4b00
movq 0x18(%rsp), %rax
movzbl (%rax), %esi
movq %rbx, %rdi
callq 0x5aa4
movq 0x2040(%r14), %r15
movq 0x2048(%r14), %r12
cmpq %r12, %r15
je 0x4adc
xorl %ebp, %ebp
movl $0x1, %r13d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5b54
movzbl %bpl, %ebp
testb %al, %al
cmovnel %r13d, %ebp
addq $0x8, %r15
cmpq %r12, %r15
jne 0x4a42
testb $0x1, %bpl
je 0x4adc
movq 0x2040(%r14), %rdi
movq 0x2048(%r14), %rsi
movq %rbx, %rdx
callq 0x56ee
addq $0x8, %rax
movq 0x2048(%r14), %rcx
cmpq %rcx, %rax
je 0x4ab3
subq %rax, %rcx
sarq $0x3, %rcx
testq %rcx, %rcx
jle 0x4ab3
incq %rcx
movb 0x4(%rax), %dl
movb %dl, -0x4(%rax)
movl (%rax), %edx
movl %edx, -0x8(%rax)
addq $0x8, %rax
decq %rcx
cmpq $0x1, %rcx
jg 0x4a9b
addq $-0x8, 0x2048(%r14)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x4aca
callq 0x22f0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x26ad
leaq 0x471a(%rip), %rdi      # 0x9202
leaq 0x4729(%rip), %rsi      # 0x9218
leaq 0x4731(%rip), %rcx      # 0x9227
movl $0x1a, %edx
callq 0x2170
leaq 0x4741(%rip), %rdi      # 0x9248
leaq 0x470a(%rip), %rsi      # 0x9218
leaq 0x4712(%rip), %rcx      # 0x9227
movl $0x1c, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq (%rsi), %r14
movq 0x8(%rsi), %r12
cmpq %r12, %r14
je 0x4b69
leaq 0x7(%rsp), %r15
movq %r14, %rdi
callq 0x5cf4
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x55d0
addq $0x8, %r14
cmpq %r12, %r14
jne 0x4b49
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4b8f
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2230
movq %r14, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x4b1f
leaq 0x30(%rsp), %rdi
movl $0x0, (%rdi)
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movl 0x201c(%rbx), %esi
callq 0x5200
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x8022
movl 0x18(%rsp), %eax
cmpl 0x30(%rsp), %eax
jne 0x4c19
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x4bfb
callq 0x22f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4c11
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
addq $0x48, %rsp
popq %rbx
popq %r14
retq
leaq 0x45e2(%rip), %rdi      # 0x9202
leaq 0x45f1(%rip), %rsi      # 0x9218
leaq 0x4679(%rip), %rcx      # 0x92a7
movl $0x5a, %edx
callq 0x2170
jmp 0x4c3a
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4c53
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movl $0x5, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movl 0x201c(%rdi), %esi
movq %r14, %rdi
callq 0x5200
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8022
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4caa
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4551(%rip), %rdi      # 0x9202
leaq 0x4560(%rip), %rsi      # 0x9218
leaq 0x461e(%rip), %rcx      # 0x92dd
movl $0x66, %edx
callq 0x2170
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x8(%rsi), %rsi
subq (%r14), %rsi
callq 0x544c
movq (%r14), %r15
movq 0x8(%r14), %r12
cmpq %r12, %r15
je 0x4d4e
movq %rsp, %r14
movl (%r15), %eax
bswapl %eax
movl %eax, 0x20(%rsp)
xorl %r13d, %r13d
leaq (%rsp,%r13), %rdx
addq $0x20, %rdx
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x4d34
movb (%rdx), %al
movb %al, (%rsi)
incq 0x8(%rsp)
jmp 0x4d3c
movq %r14, %rdi
callq 0x54de
incq %r13
cmpq $0x4, %r13
jne 0x4d15
addq $0x4, %r15
cmpq %r12, %r15
jne 0x4d09
leaq 0x20(%rsp), %rdi
movl $0x2, (%rdi)
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movl 0x201c(%rbx), %esi
callq 0x5200
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0x8022
movl 0x38(%rsp), %eax
cmpl 0x20(%rsp), %eax
jne 0x4dc2
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x4d9e
callq 0x22f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4db4
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x4439(%rip), %rdi      # 0x9202
leaq 0x4448(%rip), %rsi      # 0x9218
leaq 0x4521(%rip), %rcx      # 0x92f8
movl $0x7c, %edx
callq 0x2170
jmp 0x4de7
jmp 0x4de7
jmp 0x4de7
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4e00
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movl $0xa, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movl 0x201c(%rdi), %esi
movq %r14, %rdi
callq 0x5200
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8022
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4e65
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4e5b
callq 0x22f0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4396(%rip), %rdi      # 0x9202
leaq 0x43a5(%rip), %rsi      # 0x9218
leaq 0x44b4(%rip), %rcx      # 0x932e
movl $0x88, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movl $0x3, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movl 0x201c(%rdi), %esi
movq %r14, %rdi
callq 0x5200
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8022
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4f28
cmpq $0x1, 0x8(%rsp)
jne 0x4f47
movq 0x10(%rsp), %rdi
movb (%rdi), %bl
callq 0x22f0
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x42d3(%rip), %rdi      # 0x9202
leaq 0x42e2(%rip), %rsi      # 0x9218
leaq 0x440c(%rip), %rcx      # 0x9349
movl $0x9b, %edx
callq 0x2170
leaq 0x42fa(%rip), %rdi      # 0x9248
leaq 0x42c3(%rip), %rsi      # 0x9218
leaq 0x43ed(%rip), %rcx      # 0x9349
movl $0x9c, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0xf(%rsp), %rax
movb %sil, (%rax)
leaq 0x28(%rsp), %r14
movl $0x4, (%r14)
movq $0x1, 0x8(%r14)
movq %rax, 0x10(%r14)
movl 0x201c(%rdi), %esi
movq %r14, %rdi
callq 0x5200
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8022
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4fd1
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x4fc7
callq 0x22f0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x422a(%rip), %rdi      # 0x9202
leaq 0x4239(%rip), %rsi      # 0x9218
leaq 0x4387(%rip), %rcx      # 0x936d
movl $0xaa, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movl $0x7, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movl 0x201c(%rdi), %esi
movq %r14, %rdi
callq 0x5200
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8022
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x5058
cmpq $0x1, 0x8(%rsp)
jne 0x5077
movq 0x10(%rsp), %rdi
cmpb $0x0, (%rdi)
setne %bl
callq 0x22f0
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x41a3(%rip), %rdi      # 0x9202
leaq 0x41b2(%rip), %rsi      # 0x9218
leaq 0x4329(%rip), %rcx      # 0x9396
movl $0xb6, %edx
callq 0x2170
leaq 0x41ca(%rip), %rdi      # 0x9248
leaq 0x4193(%rip), %rsi      # 0x9218
leaq 0x430a(%rip), %rcx      # 0x9396
movl $0xb7, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x4b1f
leaq 0x38(%rsp), %rdi
movl $0x1, (%rdi)
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movl 0x201c(%rbx), %esi
callq 0x5200
leaq 0x2040(%rbx), %rdi
movq %r14, %rsi
callq 0x3e2a
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x8022
movl 0x20(%rsp), %eax
cmpl 0x38(%rsp), %eax
jne 0x5130
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x510f
callq 0x22f0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5126
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x40cb(%rip), %rdi      # 0x9202
leaq 0x40da(%rip), %rsi      # 0x9218
leaq 0x4270(%rip), %rcx      # 0x93b5
movl $0xc8, %edx
callq 0x2170
jmp 0x5151
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x516b
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
bswapl %esi
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
leaq 0x28(%rsp), %r14
movl $0x8, (%r14)
movq $0x4, 0x8(%r14)
movq %rax, 0x10(%r14)
movl 0x201c(%rdi), %esi
movq %r14, %rdi
callq 0x5200
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8022
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x51e1
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x51d7
callq 0x22f0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x401a(%rip), %rdi      # 0x9202
leaq 0x4029(%rip), %rsi      # 0x9218
leaq 0x41f4(%rip), %rcx      # 0x93ea
movl $0xd8, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x5d04
callq 0x2070
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movl %eax, %ecx
movabsq $0x200000005, %rdx      # imm = 0x200000005
movq %rcx, %rax
mulq %rdx
movq %rdx, %rax
shlq $0x1f, %rax
subq %rax, %rdx
leaq (%rcx,%rdx), %rax
cmpq $0x1, %rax
adcq %rcx, %rdx
movq %rsp, %rax
movq %rdx, (%rax)
movq %rax, %rdx
callq 0x6fe6
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rax
je 0x6747
movq 0x20(%rsp), %r15
xorl %r12d, %r12d
movq %rsp, %r14
movabsq $-0x34307aae9fc8985d, %r13 # imm = 0xCBCF8551603767A3
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
xorl %ebp, %ebp
leaq (%r15,%rbp), %rsi
movq %r14, %rdi
callq 0x6fba
addq $0x8, %rbp
cmpl $0x40, %ebp
jne 0x66ee
imulq $0x2058, %r12, %rdi     # imm = 0x2058
addq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x5096
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x672c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
addq %rbp, %r15
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
incq %r12
sarq $0x3, %rax
imulq %r13, %rax
cmpq %rax, %r12
jb 0x66dc
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x675e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x678d
jmp 0x6774
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x678d
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x67a4
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x764e(%rip), %rdi      # 0xdfc8
leaq 0x2cf8(%rip), %rsi      # 0x9679
movl $0x8, %edx
callq 0x2290
movq 0x8(%rbx), %rdi
cmpq %rdi, 0x10(%rbx)
je 0x6ab3
leaq 0x40(%rbx), %r14
leaq 0x18(%rsp), %r12
xorl %r13d, %r13d
leaq 0x28(%rsp), %r15
xorl %ebp, %ebp
addq %r13, %rdi
movq %r14, %rsi
callq 0x4cca
movq 0x8(%rbx), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x4e84
movq %r15, %rdi
leaq 0x2754(%rip), %rsi      # 0x9124
callq 0x2410
movq %r12, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x69f8
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x6a00
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x759f(%rip), %rdi      # 0xdfc8
callq 0x2290
movq (%r14), %rcx
movl (%rcx,%rbp,4), %esi
movq %rax, %rdi
callq 0x23b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2b4f(%rip), %rsi      # 0x959a
callq 0x2290
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6a67
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6a83
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2230
incq %rbp
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
movabsq $-0x34307aae9fc8985d, %rcx # imm = 0xCBCF8551603767A3
imulq %rcx, %rax
addq $0x2058, %r13           # imm = 0x2058
cmpq %rax, %rbp
jb 0x69ac
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x6ae1
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6ae1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6afd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rsi, 0x10(%rdi)
je 0x6db0
movq %rbx, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x6b06
addq $0x2058, %r15           # imm = 0x2058
cmpq 0x10(%r14), %r15
jne 0x6d98
movq 0x8(%r14), %r15
cmpq %rbx, %r15
je 0x6dcd
movq %r14, %rdi
movq %r15, %rsi
callq 0x6b06
addq $0x2058, %r15           # imm = 0x2058
jmp 0x6db4
movq 0x71f4(%rip), %rbx      # 0xdfc8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2180
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movq 0x18(%r14), %rbx
movl 0x8(%r14), %r15d
addq 0x10(%r14), %r15
cmpq %r15, %rbx
jae 0x24cd
leaq 0x1(%rbx), %rcx
movq %rbx, %rax
lock
cmpxchgq %rcx, 0x18(%r14)
sete %al
testb %al, %al
je 0x248e
movl $0x4, %edi
callq 0x2130
movl %ebp, (%rax)
movq 0x20(%r14), %rcx
movl 0x28(%r14), %edx
andl %ebx, %edx
movq %rax, (%rcx,%rdx,8)
cmpq %r15, %rbx
setb %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %r14
movq 0x18(%rdi), %r15
cmpq %r15, %r14
je 0x2533
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movl 0x28(%rdi), %ecx
andl %r14d, %ecx
movq (%rax,%rcx,8), %rcx
movl (%rcx), %ecx
movl %ecx, (%rsi)
movl 0x28(%rdi), %ecx
andl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x2519
callq 0x2120
movq 0x20(%rbx), %rax
movl 0x28(%rbx), %ecx
andl %r14d, %ecx
movq $0x0, (%rax,%rcx,8)
leaq 0x1(%r14), %rax
movq %rax, 0x10(%rbx)
cmpq %r15, %r14
setne %al
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
leaq 0x28(%rdi), %rbx
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
jne 0x273c
movq 0x18(%r14), %r15
movq %r15, %r12
subq 0x10(%r14), %r12
movl 0x8(%r14), %r13d
cmpq %r13, %r12
jae 0x271c
movl $0x4, %edi
callq 0x2130
movq %rax, %rcx
movl %ebp, (%rax)
movq 0x20(%r14), %rsi
movq %r15, %rax
xorl %edx, %edx
divq %r13
movq %rcx, (%rsi,%rdx,8)
incq %r15
movq %r15, 0x18(%r14)
cmpq %r13, %r12
setb %bpl
movq %rbx, %rdi
callq 0x20d0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x2080
movq %rax, %rbx
leaq 0x191a(%rip), %rsi      # 0x406a
movq %rax, %rdi
callq 0x2060
movq 0x4899(%rip), %rsi      # 0x6ff8
movq 0x4862(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %r14
leaq 0x28(%rdi), %rbx
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
jne 0x282b
movq 0x10(%r14), %r15
movq 0x18(%r14), %r13
cmpq %r15, %r13
je 0x280b
movq 0x20(%r14), %rcx
movl 0x8(%r14), %esi
movq %r15, %rax
xorl %edx, %edx
divq %rsi
movq (%rcx,%rdx,8), %rax
movl (%rax), %eax
movl %eax, (%r12)
movl 0x8(%r14), %esi
movq %r15, %rax
xorl %edx, %edx
divq %rsi
movq (%rcx,%rdx,8), %rdi
testq %rdi, %rdi
je 0x27e8
callq 0x2120
movq 0x20(%r14), %rsi
movq 0x10(%r14), %rcx
movl 0x8(%r14), %edi
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
movq $0x0, (%rsi,%rdx,8)
incq %rcx
movq %rcx, 0x10(%r14)
cmpq %r15, %r13
setne %bpl
movq %rbx, %rdi
callq 0x20d0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x2080
movq %rax, %rbx
leaq 0x184a(%rip), %rsi      # 0x4089
movq %rax, %rdi
callq 0x2060
movq 0x47aa(%rip), %rsi      # 0x6ff8
movq 0x4773(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x28(%rdi), %rbx
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
jne 0x289e
movl 0x18(%r14), %ebp
subl 0x10(%r14), %ebp
movq %rbx, %rdi
callq 0x20d0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0x10, %edi
callq 0x2080
movq %rax, %rbx
leaq 0x17f6(%rip), %rsi      # 0x40a8
movq %rax, %rdi
callq 0x2060
movq 0x4737(%rip), %rsi      # 0x6ff8
movq 0x4700(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rbx
subq $0xd8, %rsp
leaq 0x30(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x25fc
leaq 0x80(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x29fc
movq %rsp, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x244c
leaq 0x30(%rsp), %rdi
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x3, %edx
callq 0x2c1c
movl %eax, %ebx
leaq 0x80(%rsp), %rdi
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x3, %edx
callq 0x2c1c
movl %eax, %ebp
movq %rsp, %rdi
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x3, %edx
callq 0x2c1c
xorb $0x1, %bl
movzbl %bl, %ecx
xorb $0x1, %bpl
movzbl %bpl, %edx
addl %ecx, %edx
xorb $0x1, %al
movzbl %al, %eax
xorl %ebx, %ebx
orl %edx, %eax
sete %bl
movq %rsp, %rdi
callq 0x246a
leaq 0x80(%rsp), %rdi
callq 0x2a82
leaq 0x30(%rsp), %rdi
callq 0x267a
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
jmp 0x29dc
movq %rax, %rbx
jmp 0x29e9
movq %rax, %rbx
movq %rsp, %rdi
callq 0x246a
leaq 0x80(%rsp), %rdi
callq 0x2a82
leaq 0x30(%rsp), %rdi
callq 0x267a
movq %rbx, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq %r14, %rdi
callq 0x21c0
testl %eax, %eax
jne 0x2b45
movq 0x18(%rbx), %r13
movq %r13, %r15
subq 0x10(%rbx), %r15
movl 0x8(%rbx), %r12d
cmpq %r12, %r15
jae 0x2b28
leaq 0x1(%r13), %rax
movq %rax, 0x18(%rbx)
movq %r14, %rdi
callq 0x20d0
movl $0x4, %edi
callq 0x2130
movl %ebp, (%rax)
movq 0x20(%rbx), %rcx
andl 0x50(%rbx), %r13d
movq %rax, (%rcx,%r13,8)
jmp 0x2b30
movq %r14, %rdi
callq 0x20d0
cmpq %r12, %r15
setb %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x2080
movq %rax, %rbx
leaq 0x1511(%rip), %rsi      # 0x406a
movq %rax, %rdi
callq 0x2060
movq 0x4490(%rip), %rsi      # 0x6ff8
movq 0x4459(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %r14
movq 0x18(%rdi), %r15
cmpq %r14, %r15
je 0x2be1
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movl 0x50(%rdi), %ecx
andl %r14d, %ecx
movq (%rax,%rcx,8), %rcx
movl (%rcx), %ecx
movl %ecx, (%rsi)
movl 0x50(%rdi), %ecx
andl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x2bc5
callq 0x2120
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
movl 0x50(%rbx), %edx
andl %eax, %edx
movq $0x0, (%rcx,%rdx,8)
incq %rax
movq %rax, 0x10(%rbx)
cmpq %r14, %r15
setne %al
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2150
decl %eax
cmpl $-0x3, %eax
jbe 0x32ae
cmpb $0x1, 0x18(%rbx)
jne 0x32a6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x330e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x2080
movq %rax, %rbx
leaq 0x103f(%rip), %rsi      # 0x4301
movq %rax, %rdi
callq 0x2060
movq 0x3d27(%rip), %rsi      # 0x6ff8
movq 0x3cf0(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpb $0x1, 0x18(%rdi)
jne 0x3350
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %ebp
incl %ebp
decl %ebp
je 0x334a
cmpb $0x1, 0x18(%rbx)
jne 0x3344
movq 0x10(%rbx), %rdi
movl (%rbx), %esi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x3344
callq 0x21b0
cmpb $0x0, 0x18(%rbx)
jne 0x3329
cmpb $0x0, 0x18(%rbx)
jne 0x331f
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/enfiskutensykkel[P]lamport/src/queue.cpp
// Function: Queue::Queue(unsigned int)
Queue::Queue(uint32_t slots)
	: capacity(nearest_pow(slots - 1))
	, head(0), tail(0)
	, buffer(nullptr)
{
	buffer = new int*[capacity];
	if (buffer == nullptr)
	{
		throw std::runtime_error("failed to allocate queue buffer");
	}

	for (uint32_t i = 0; i < capacity; ++i)
	{
		buffer[i] = nullptr;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x36a2(%rip), %rax      # 0x6d68
movq %rax, (%rdi)
decl %esi
js 0x36ed
movl $0x80000000, %eax       # imm = 0x80000000
xorl %ecx, %ecx
shrl %eax
leal 0x1(%rcx), %edx
testl %esi, %eax
jne 0x36e4
cmpl $0x1f, %ecx
movl %edx, %ecx
jb 0x36d4
movl $0x20, %ecx
subl %edx, %ecx
jmp 0x36f2
movl $0x20, %ecx
movl $0x1, %r14d
shll %cl, %r14d
movl %r14d, 0x8(%rbx)
leaq (,%r14,8), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
callq 0x2030
movq %rax, 0x20(%rbx)
xorl %eax, %eax
movq 0x20(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpq %rax, %r14
jne 0x3721
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/CodyNault[P]Image-Filter-Dataflow/src/image.cpp
// Function: Image::Image(int, int, Pixel*)
Image::Image(int width, int height, Pixel *data)
{
	this->width = width;
	this->height = height;
	this->data = data;
	lastSource = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x4f3d(%rip), %rax      # 0x8830
movq %rax, (%rdi)
movl %esi, 0x8(%rdi)
movl %edx, 0xc(%rdi)
movq %rcx, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/CodyNault[P]Image-Filter-Dataflow/src/image.cpp
// Function: Image::Image(Image&)
Image::Image(Image &im)
{
	width = im.GetWidth();
	height = im.GetHeight();
	data = new Pixel[width * height];
	Pixel *originalBuffer = im.GetBuffer();
        std::memcpy(data, originalBuffer, width * height * sizeof(Pixel));
	lastSource = im.lastSource;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4f0f(%rip), %rax      # 0x8830
movq %rax, (%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
movl 0xc(%rsi), %ecx
movl %ecx, 0xc(%rdi)
imull %eax, %ecx
movslq %ecx, %r15
movl $0x3, %ecx
movq %r15, %rax
mulq %rcx
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
movq 0x10(%r14), %rsi
leaq (%r15,%r15,2), %rdx
movq %rax, %rdi
callq 0x30b0
movq 0x18(%r14), %rax
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/CodyNault[P]Image-Filter-Dataflow/src/sink.cpp
// Function: Sink::TwoInputCheck()
void Sink::TwoInputCheck()
{
    if(inputImg1 == NULL){
	char msg[1028];
        sprintf(msg, "%s: no input1!", SinkName());
        DataFlowException except(SinkName(), msg);
        throw except;
    }
    if(inputImg2 == NULL){
	char msg[1028];
        sprintf(msg, "%s: no input2!", SinkName());
        DataFlowException except(SinkName(), msg);
        throw except;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x810, %rsp            # imm = 0x810
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x3b1d
cmpq $0x0, 0x10(%rbx)
je 0x3ba3
addq $0x810, %rsp            # imm = 0x810
popq %rbx
popq %r14
popq %rbp
retq
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq 0x252a(%rip), %rsi      # 0x6057
leaq -0x820(%rbp), %r14
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3050
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq -0x418(%rbp), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x5ae8
movl $0x408, %edi            # imm = 0x408
callq 0x3090
movq %rax, %rbx
leaq 0x4d40(%rip), %rax      # 0x88b0
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq -0x410(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x30b0
leaq 0x4cf9(%rip), %rsi      # 0x8888
movq 0x544a(%rip), %rdx      # 0x8fe0
movq %rbx, %rdi
callq 0x31a0
jmp 0x3c24
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq 0x24b3(%rip), %rsi      # 0x6066
leaq -0x820(%rbp), %r14
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3050
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq -0x418(%rbp), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x5ae8
movl $0x408, %edi            # imm = 0x408
callq 0x3090
movq %rax, %rbx
leaq 0x4cba(%rip), %rax      # 0x88b0
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq -0x410(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x30b0
leaq 0x4c73(%rip), %rsi      # 0x8888
movq 0x53c4(%rip), %rdx      # 0x8fe0
movq %rbx, %rdi
callq 0x31a0
jmp 0x3c26
movq %rax, %rbx
leaq -0x418(%rbp), %rdi
callq 0x31e8
movq %rbx, %rdi
callq 0x31b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/CodyNault[P]Image-Filter-Dataflow/src/source.cpp
// Function: Source::updateSourceRefs(Source*)
void Source::updateSourceRefs(Source *ref)
{
	if(Source::sourceRefLog.count(ref) > 0){
		DataFlowException except("Source", "Circular Reference in DataFlow");
                throw except;
	}
	Source::sourceRefLog.insert(ref);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rdi, -0x10(%rbp)
movq 0x54af(%rip), %rdx      # 0x9140
leaq 0x54a0(%rip), %rcx      # 0x9138
movq %rcx, %rax
testq %rdx, %rdx
je 0x3cbf
leaq 0x5491(%rip), %rax      # 0x9138
xorl %esi, %esi
cmpq %rdi, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rax
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x3ca7
cmpq %rcx, %rax
je 0x3cca
cmpq %rdi, 0x20(%rax)
jbe 0x3ce4
leaq 0x545f(%rip), %rdi      # 0x9130
leaq -0x10(%rbp), %rsi
callq 0x3dfc
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %rbp
retq
leaq 0x23a4(%rip), %rsi      # 0x608f
leaq 0x23a4(%rip), %rdx      # 0x6096
leaq -0x418(%rbp), %rdi
callq 0x5ae8
movl $0x408, %edi            # imm = 0x408
callq 0x3090
movq %rax, %rbx
leaq 0x4b9e(%rip), %rax      # 0x88b0
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq -0x410(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x30b0
leaq 0x4b57(%rip), %rsi      # 0x8888
movq 0x52a8(%rip), %rdx      # 0x8fe0
movq %rbx, %rdi
callq 0x31a0
movq %rax, %rbx
leaq -0x418(%rbp), %rdi
callq 0x31e8
movq %rbx, %rdi
callq 0x31b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/CodyNault[P]Image-Filter-Dataflow/src/PNMreader.cpp
// Function: PNMreader::Execute()
void PNMreader::Execute()
{
	FILE *f_in = NULL;
	char magicNum[3];
	int i = 0;
	int width = 0;
	int height = 0;
	int maxval = 0;
	unsigned char val[1];

	f_in = fopen(filename, "rb");
	if(f_in == NULL){
		fprintf(stderr, "Failure opening input file");
		exit(EXIT_FAILURE);
	}
	fscanf(f_in,"%s\n%d %d\n%d\n",magicNum,&width,&height,&maxval);

	Pixel *data = new Pixel[width * height];
	fread(data, sizeof(Pixel), width * height , f_in);
	fclose(f_in);
	outputImg.ResetSize(width,height);
	outputImg.SetBuffer(data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
movl %eax, -0x34(%rbp)
movl %eax, -0x30(%rbp)
movq 0x28(%rdi), %rdi
leaq 0x1f53(%rip), %rsi      # 0x60b5
callq 0x3130
testq %rax, %rax
je 0x420e
movq %rax, %r14
leaq 0x1f59(%rip), %rsi      # 0x60d3
leaq -0x37(%rbp), %rdx
leaq -0x2c(%rbp), %r15
leaq -0x34(%rbp), %r12
leaq -0x30(%rbp), %r9
movq %rax, %rdi
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x31c0
movslq (%r15), %rax
movslq (%r12), %r13
imulq %rax, %r13
movl $0x3, %ecx
movq %r13, %rax
mulq %rcx
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x3030
movq %rax, %r15
movl $0x3, %esi
movq %rax, %rdi
movq %r13, %rdx
movq %r14, %rcx
callq 0x3170
movq %r14, %rdi
callq 0x30e0
addq $0x8, %rbx
leaq -0x2c(%rbp), %rax
movl (%rax), %esi
movl (%r12), %edx
movq %rbx, %rdi
callq 0x39ea
movq %rbx, %rdi
movq %r15, %rsi
callq 0x39f6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x31f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/CodyNault[P]Image-Filter-Dataflow/src/PNMreader.cpp
// Function: PNMreader::Update()
void PNMreader::Update(){
        char msg[128];
        sprintf(msg, "%s: about to execute", SourceName());
        Logger::LogEvent(msg);
        try{
                Execute();
        }catch(DataFlowException& except){
                sprintf(msg, "Throwing exception: (%s): %s", SourceName(), except.what());
                Logger::LogEvent(msg);
                throw except;
        }
        sprintf(msg, "%s: done executing", SourceName());
        Logger::LogEvent(msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r14
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x1eac(%rip), %rsi      # 0x60e0
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3050
movq %rbx, %rdi
callq 0x5b04
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq 0x1eaa(%rip), %rsi      # 0x6112
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3050
movq %rbx, %rdi
callq 0x5b04
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x4327
movq %rbx, %rdi
callq 0x3070
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq 0x1e37(%rip), %rsi      # 0x60f5
leaq -0xa0(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x3050
movq %r15, %rdi
callq 0x5b04
movl $0x408, %edi            # imm = 0x408
callq 0x3090
movq %rax, %r14
leaq 0x45bf(%rip), %rax      # 0x88b0
movq %rax, (%r14)
leaq 0x8(%r14), %rdi
addq $0x8, %rbx
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0x30b0
leaq 0x4578(%rip), %rsi      # 0x8888
movq 0x4cc9(%rip), %rdx      # 0x8fe0
movq %r14, %rdi
callq 0x31a0
movq %rax, %rbx
callq 0x3190
movq %rbx, %rdi
callq 0x31b0
movq %rax, %rdi
callq 0x3d90
nop
// File: /workspace/github_cpp_makefile_star2_O1/CodyNault[P]Image-Filter-Dataflow/src/PNMwriter.cpp
// Function: PNMwriter::Write(char const*)
void PNMwriter::Write(const char *filename)
{
	FILE *f_out;
	f_out = fopen(filename, "w+");
	if(f_out == NULL){
		fprintf(stderr, "Failure opening output file");
		exit(EXIT_FAILURE);
	}
	fprintf( f_out, "P6\n%d %d\n255\n", inputImg1->GetWidth(), inputImg1->GetHeight());
	fwrite (inputImg1->GetBuffer() , sizeof(Pixel), inputImg1->GetHeight() * inputImg1->GetWidth() , f_out);
	fclose(f_out);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rax
movq %rdi, %r14
leaq 0x1dda(%rip), %rsi      # 0x613a
movq %rax, %rdi
callq 0x3130
testq %rax, %rax
je 0x43e3
movq %rax, %rbx
movq 0x8(%r14), %rdi
callq 0x3978
movl %eax, %r15d
movq 0x8(%r14), %rdi
callq 0x3982
leaq 0x1dcd(%rip), %rsi      # 0x6159
movq %rbx, %rdi
movl %r15d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x3160
movq 0x8(%r14), %rdi
callq 0x398c
movq %rax, %r15
movq 0x8(%r14), %rdi
callq 0x3982
movl %eax, %r12d
movq 0x8(%r14), %rdi
callq 0x3978
imull %r12d, %eax
movslq %eax, %rdx
movl $0x3, %esi
movq %r15, %rdi
movq %rbx, %rcx
callq 0x31d0
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x30e0
callq 0x3218