LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/Thomas1995[P]Rentz/src/score.cpp
// Function: Table::ScoreTotals(int&)
void Table::ScoreTotals(int& scoreToAdd) {
    ScoreKingOfHearts(scoreToAdd);
    ScoreQueens(scoreToAdd);
    ScoreDiamonds(scoreToAdd);
    ScoreAcool(scoreToAdd);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x33c6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x341e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x346a
addl $-0xa, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5761(%rip), %rsi      # 0x91d8
xorl %r14d, %r14d
leaq 0x8(%rsp), %r15
xorl %edi, %edi
movq %r15, %rcx
callq 0x22e0
movl %ebp, 0x4(%rsp)
movq (%r15), %r15
testq %r15, %r15
je 0x3ac8
leaq 0x5653(%rip), %r14      # 0x90ef
movl 0x4(%r15), %edi
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
callq 0x2090
cmpl $-0x1, %eax
jne 0x3ae6
movq %r14, %rdi
callq 0x21c0
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x3a9c
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x2300
leaq 0x56e9(%rip), %rdi      # 0x91c0
callq 0x2370
movl $0x1, %edi
callq 0x22c0
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 0x3b83
movq 0x18(%r15), %rsi
movl 0x10(%r15), %edx
movl %ebp, %edi
callq 0x2080
cmpl $-0x1, %eax
je 0x3b88
movl %ebp, %edi
movl $0x10, %esi
callq 0x2270
cmpl $-0x1, %eax
je 0x3b8d
movq 0x8(%rsp), %rdi
callq 0x2300
movl %ebp, (%rbx)
xorl %edi, %edi
callq 0x2310
movl %eax, 0x4(%rbx)
cmpl $-0x1, %eax
je 0x3b92
leaq 0x14(%rsp), %rcx
movl $0x0, 0x8(%rcx)
movl $0x1, (%rcx)
movl %ebp, 0x4(%rcx)
movl %eax, %edi
movl $0x1, %esi
movl %ebp, %edx
callq 0x2320
leaq 0x5625(%rip), %rdi      # 0x9198
callq 0x2370
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2543
callq 0x252e
callq 0x2519
callq 0x2504
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa6fb(%rip), %al       # 0xe2a0
testb %al, %al
je 0x3bc4
leaq 0x4(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2584
movl (%r14), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xa6d5(%rip), %rdi      # 0xe2a0
callq 0x23f0
testl %eax, %eax
je 0x3ba9
leaq 0xa6ad(%rip), %rdi      # 0xe288
leaq 0x3(%rsp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x3c4a
leaq 0x3(%rsp), %rdi
callq 0x2558
jmp 0x3ba9
movq %rax, %rbx
leaq 0xa6a0(%rip), %rdi      # 0xe2a0
callq 0x2150
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x521a
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x83da
movl (%r12), %eax
cmpl (%r15), %eax
jne 0x4993
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
cmpq $0x0, 0x10(%rsp)
je 0x4975
xorl %r14d, %r14d
movq 0x18(%rsp), %rax
movsbl (%rax,%r14), %esi
movq %rbx, %rdi
callq 0x21d0
incq %r14
cmpq 0x10(%rsp), %r14
jb 0x4959
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x4984
callq 0x22f0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x4868(%rip), %rdi      # 0x9202
leaq 0x4877(%rip), %rsi      # 0x9218
leaq 0x48d4(%rip), %rcx      # 0x927c
movl $0x44, %edx
callq 0x2170
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x49c8
movq (%r15), %rsi
incq %rsi
callq 0x2230
movq %r14, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movl $0x6, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movl 0x201c(%rsi), %esi
movq %r15, %rdi
callq 0x521a
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x83da
movl (%r12), %eax
cmpl (%r15), %eax
jne 0x4afb
cmpq $0x1, 0x8(%rsp)
jne 0x4b1a
movq 0x10(%rsp), %rax
movzbl (%rax), %esi
movq %rbx, %rdi
callq 0x5adc
movq 0x2040(%r14), %r15
movq 0x2048(%r14), %r12
cmpq %r12, %r15
je 0x4af6
xorl %ebp, %ebp
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5b8c
orb %al, %bpl
addq $0x8, %r15
cmpq %r12, %r15
jne 0x4a54
testb $0x1, %bpl
je 0x4af6
movq 0x2040(%r14), %rdi
movq 0x2048(%r14), %rsi
movq %rbx, %rdx
callq 0x571c
addq $0x8, %rax
movq 0x2048(%r14), %rdx
cmpq %rdx, %rax
je 0x4acc
movq %rdx, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
testq %rcx, %rcx
jle 0x4acc
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
ja 0x4aad
movq 0x2048(%r14), %rdx
addq $-0x8, %rdx
movq %rdx, 0x2048(%r14)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4ae6
callq 0x22f0
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x26ad
leaq 0x4700(%rip), %rdi      # 0x9202
leaq 0x470f(%rip), %rsi      # 0x9218
leaq 0x4717(%rip), %rcx      # 0x9227
movl $0x1a, %edx
callq 0x2170
leaq 0x4727(%rip), %rdi      # 0x9248
leaq 0x46f0(%rip), %rsi      # 0x9218
leaq 0x46f8(%rip), %rcx      # 0x9227
movl $0x1c, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4b83
leaq 0x7(%rsp), %r15
movq %r14, %rdi
callq 0x5d1a
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x55f6
addq $0x8, %r14
cmpq %r12, %r14
jne 0x4b63
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 0x4ba9
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2230
movq %r14, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4b39
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 0x521a
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x83da
movl 0x18(%rsp), %eax
cmpl 0x30(%rsp), %eax
jne 0x4c33
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x4c15
callq 0x22f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4c2b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
addq $0x48, %rsp
popq %rbx
popq %r14
retq
leaq 0x45c8(%rip), %rdi      # 0x9202
leaq 0x45d7(%rip), %rsi      # 0x9218
leaq 0x465f(%rip), %rcx      # 0x92a7
movl $0x5a, %edx
callq 0x2170
jmp 0x4c54
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4c6d
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x521a
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x83da
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4cc4
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4537(%rip), %rdi      # 0x9202
leaq 0x4546(%rip), %rsi      # 0x9218
leaq 0x4604(%rip), %rcx      # 0x92dd
movl $0x66, %edx
callq 0x2170
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5472
movq (%r14), %r15
movq 0x8(%r14), %r12
cmpq %r12, %r15
je 0x4d68
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 0x4d4e
movb (%rdx), %al
movb %al, (%rsi)
incq 0x8(%rsp)
jmp 0x4d56
movq %r14, %rdi
callq 0x5504
incq %r13
cmpq $0x4, %r13
jne 0x4d2f
addq $0x4, %r15
cmpq %r12, %r15
jne 0x4d23
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 0x521a
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0x83da
movl 0x38(%rsp), %eax
cmpl 0x20(%rsp), %eax
jne 0x4ddc
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x4db8
callq 0x22f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4dce
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x441f(%rip), %rdi      # 0x9202
leaq 0x442e(%rip), %rsi      # 0x9218
leaq 0x4507(%rip), %rcx      # 0x92f8
movl $0x7c, %edx
callq 0x2170
jmp 0x4e01
jmp 0x4e01
jmp 0x4e01
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4e1a
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x521a
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x83da
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4e7f
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4e75
callq 0x22f0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x437c(%rip), %rdi      # 0x9202
leaq 0x438b(%rip), %rsi      # 0x9218
leaq 0x449a(%rip), %rcx      # 0x932e
movl $0x88, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O3/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 0x521a
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x83da
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4f42
cmpq $0x1, 0x8(%rsp)
jne 0x4f61
movq 0x10(%rsp), %rdi
movb (%rdi), %bl
callq 0x22f0
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x42b9(%rip), %rdi      # 0x9202
leaq 0x42c8(%rip), %rsi      # 0x9218
leaq 0x43f2(%rip), %rcx      # 0x9349
movl $0x9b, %edx
callq 0x2170
leaq 0x42e0(%rip), %rdi      # 0x9248
leaq 0x42a9(%rip), %rsi      # 0x9218
leaq 0x43d3(%rip), %rcx      # 0x9349
movl $0x9c, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O3/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 0x521a
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x83da
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4feb
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x4fe1
callq 0x22f0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4210(%rip), %rdi      # 0x9202
leaq 0x421f(%rip), %rsi      # 0x9218
leaq 0x436d(%rip), %rcx      # 0x936d
movl $0xaa, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O3/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 0x521a
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x83da
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x5072
cmpq $0x1, 0x8(%rsp)
jne 0x5091
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 0x4189(%rip), %rdi      # 0x9202
leaq 0x4198(%rip), %rsi      # 0x9218
leaq 0x430f(%rip), %rcx      # 0x9396
movl $0xb6, %edx
callq 0x2170
leaq 0x41b0(%rip), %rdi      # 0x9248
leaq 0x4179(%rip), %rsi      # 0x9218
leaq 0x42f0(%rip), %rcx      # 0x9396
movl $0xb7, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4b39
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 0x521a
leaq 0x2040(%rbx), %rdi
movq %r14, %rsi
callq 0x3e20
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x83da
movl 0x20(%rsp), %eax
cmpl 0x38(%rsp), %eax
jne 0x514a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x5129
callq 0x22f0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5140
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x40b1(%rip), %rdi      # 0x9202
leaq 0x40c0(%rip), %rsi      # 0x9218
leaq 0x4256(%rip), %rcx      # 0x93b5
movl $0xc8, %edx
callq 0x2170
jmp 0x516b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5185
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x521a
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x83da
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x51fb
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x51f1
callq 0x22f0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4000(%rip), %rdi      # 0x9202
leaq 0x400f(%rip), %rsi      # 0x9218
leaq 0x41da(%rip), %rcx      # 0x93ea
movl $0xd8, %edx
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5d2a
callq 0x2070
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movl %eax, %ecx
leaq (%rcx,%rcx,2), %rcx
shrq $0x20, %rcx
movl %eax, %edx
subl %ecx, %edx
shrl %edx
addl %ecx, %edx
shrl $0x1e, %edx
movl %edx, %ecx
shll $0x1f, %ecx
orl %edx, %ecx
leal (%rax,%rcx), %edx
cmpl $0x1, %edx
adcl %eax, %ecx
movq %rsp, %rdx
movq %rcx, (%rdx)
callq 0x6fe4
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rax
je 0x6743
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 0x6fb8
addq $0x8, %rbp
cmpl $0x40, %ebp
jne 0x66ea
imulq $0x2058, %r12, %rdi     # imm = 0x2058
addq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x50b0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x6728
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 0x66d8
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x675a
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 0x6789
jmp 0x6770
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x6789
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x67a0
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7654(%rip), %rdi      # 0xdfc8
leaq 0x2d2e(%rip), %rsi      # 0x96a9
movl $0x8, %edx
callq 0x2290
movq 0x8(%rbx), %rdi
cmpq %rdi, 0x10(%rbx)
je 0x6aad
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 0x4ce4
movq 0x8(%rbx), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x4e9e
movq %r15, %rdi
leaq 0x275a(%rip), %rsi      # 0x9124
callq 0x2410
movq %r12, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x69f2
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x69fa
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 0x75a5(%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 0x2b85(%rip), %rsi      # 0x95ca
callq 0x2290
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6a61
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6a7d
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 0x69a6
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x6adb
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6adb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6af7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6dae
movq %rbx, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x6b00
addq $0x2058, %r15           # imm = 0x2058
cmpq 0x10(%r14), %r15
jne 0x6d96
movq 0x8(%r14), %r15
cmpq %rbx, %r15
je 0x6dcb
movq %r14, %rdi
movq %r15, %rsi
callq 0x6b00
addq $0x2058, %r15           # imm = 0x2058
jmp 0x6db2
movq 0x71f6(%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_O3/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 0x252e
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
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
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2822
movq 0x10(%r14), %r15
movq 0x18(%r14), %r13
cmpq %r15, %r13
je 0x2802
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
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 0x1853(%rip), %rsi      # 0x4089
movq %rax, %rdi
callq 0x2060
movq 0x47b3(%rip), %rsi      # 0x6ff8
movq 0x477c(%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_O3/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 0x2896
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 0x17fe(%rip), %rsi      # 0x40a8
movq %rax, %rdi
callq 0x2060
movq 0x473f(%rip), %rsi      # 0x6ff8
movq 0x4708(%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_O3/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 0x29f4
movq %rsp, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x244c
leaq 0x30(%rsp), %rdi
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x3, %edx
callq 0x2c0c
movl %eax, %ebx
leaq 0x80(%rsp), %rdi
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x3, %edx
callq 0x2c0c
movl %eax, %ebp
movq %rsp, %rdi
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x3, %edx
callq 0x2c0c
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 0x2a7a
leaq 0x30(%rsp), %rdi
callq 0x267a
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
jmp 0x29d4
movq %rax, %rbx
jmp 0x29e1
movq %rax, %rbx
movq %rsp, %rdi
callq 0x246a
leaq 0x80(%rsp), %rdi
callq 0x2a7a
leaq 0x30(%rsp), %rdi
callq 0x267a
movq %rbx, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2b3d
movq 0x18(%rbx), %r13
movq %r13, %r15
subq 0x10(%rbx), %r15
movl 0x8(%rbx), %r12d
cmpq %r12, %r15
jae 0x2b20
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 0x2b28
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 0x1519(%rip), %rsi      # 0x406a
movq %rax, %rdi
callq 0x2060
movq 0x4498(%rip), %rsi      # 0x6ff8
movq 0x4461(%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_O3/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 0x2bd4
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
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
// File: /workspace/github_cpp_makefile_star2_O3/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 0x32a2
cmpb $0x1, 0x18(%rbx)
jne 0x329a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3302
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x2080
movq %rax, %rbx
leaq 0x104b(%rip), %rsi      # 0x4301
movq %rax, %rdi
callq 0x2060
movq 0x3d33(%rip), %rsi      # 0x6ff8
movq 0x3cfc(%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_O3/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:
movb 0x18(%rdi), %al
cmpb $0x1, %al
jne 0x3346
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %ebp
incl %ebp
decl %ebp
je 0x3340
testb $0x1, %al
je 0x3340
movq 0x10(%rbx), %rdi
movl (%rbx), %esi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x3339
callq 0x21b0
cmpb $0x0, 0x18(%rbx)
jne 0x331c
jmp 0x3340
movb 0x18(%rbx), %al
testb $0x1, %al
jne 0x3314
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x36c6(%rip), %rax      # 0x6d68
movq %rax, (%rdi)
decl %esi
js 0x36c9
movl $0x80000000, %eax       # imm = 0x80000000
xorl %ecx, %ecx
shrl %eax
leal 0x1(%rcx), %edx
testl %esi, %eax
jne 0x36c0
cmpl $0x1f, %ecx
movl %edx, %ecx
jb 0x36b0
movl $0x20, %ecx
subl %edx, %ecx
jmp 0x36ce
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 0x36fd
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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, %rax
movl $0x3, %ecx
mulq %rcx
movq %rax, %r15
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
movq 0x10(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x30b0
movq 0x18(%r14), %rax
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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), %rcx      # 0x9140
testq %rcx, %rcx
je 0x3cc6
leaq 0x549b(%rip), %rax      # 0x9138
xorl %edx, %edx
cmpq %rdi, 0x20(%rcx)
setb %dl
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0x3c9d
leaq 0x547d(%rip), %rcx      # 0x9138
cmpq %rcx, %rax
je 0x3cc6
cmpq %rdi, 0x20(%rax)
jbe 0x3ce0
leaq 0x5463(%rip), %rdi      # 0x9130
leaq -0x10(%rbp), %rsi
callq 0x3df8
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %rbp
retq
leaq 0x23a8(%rip), %rsi      # 0x608f
leaq 0x23a8(%rip), %rdx      # 0x6096
leaq -0x418(%rbp), %rdi
callq 0x5ae8
movl $0x408, %edi            # imm = 0x408
callq 0x3090
movq %rax, %rbx
leaq 0x4ba2(%rip), %rax      # 0x88b0
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq -0x410(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x30b0
leaq 0x4b5b(%rip), %rsi      # 0x8888
movq 0x52ac(%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_O3/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 0x1eb4(%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 0x1eb2(%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 0x431f
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 0x1e3f(%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 0x45c7(%rip), %rax      # 0x88b0
movq %rax, (%r14)
leaq 0x8(%r14), %rdi
addq $0x8, %rbx
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0x30b0
leaq 0x4580(%rip), %rsi      # 0x8888
movq 0x4cd1(%rip), %rdx      # 0x8fe0
movq %r14, %rdi
callq 0x31a0
movq %rax, %rbx
callq 0x3190
movq %rbx, %rdi
callq 0x31b0
movq %rax, %rdi
callq 0x3d8c
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1de2(%rip), %rsi      # 0x613a
movq %rax, %rdi
callq 0x3130
testq %rax, %rax
je 0x43db
movq %rax, %rbx
movq 0x8(%r14), %rdi
callq 0x3978
movl %eax, %r15d
movq 0x8(%r14), %rdi
callq 0x3982
leaq 0x1dd5(%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
// File: /workspace/github_cpp_makefile_star2_O3/CodyNault[P]Image-Filter-Dataflow/src/filters.cpp
// Function: Shrinker::Execute()
void Shrinker::Execute()
{
	OneInputCheck();
	Pixel *data = inputImg1->GetBuffer();
	int oldWidth = inputImg1->GetWidth();
	int newWidth = oldWidth / 2;
	int newHeight = inputImg1->GetHeight() / 2;
	Pixel *smallerData = new Pixel[ newWidth * newHeight];
	for(int i = 0; i < newHeight; i++)
	{
		for(int j = 0; j < newWidth; j++)
		{
			smallerData[i * newWidth + j] = data[2* i * oldWidth + 2 * j];
		}
	}
	outputImg.ResetSize(newWidth,newHeight);
	outputImg.SetBuffer(smallerData);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x3a5c
movq 0x30(%rbx), %rdi
callq 0x398c
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0x3978
movl %eax, %r12d
movl %eax, %r15d
shrl $0x1f, %r15d
addl %eax, %r15d
sarl %r15d
movq %rbx, -0x40(%rbp)
movq 0x30(%rbx), %rdi
callq 0x3982
movl %eax, %r13d
shrl $0x1f, %eax
addl %r13d, %eax
sarl %eax
movl %eax, -0x2c(%rbp)
movl %r15d, -0x30(%rbp)
imull %r15d, %eax
cltq
movl $0x3, %ecx
mulq %rcx
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x3030
movq %rax, -0x38(%rbp)
cmpl $0x2, %r13d
jl 0x44c6
movslq -0x30(%rbp), %rdx
movl -0x2c(%rbp), %eax
movl %edx, %ecx
leaq (%rdx,%rdx,2), %rdx
leal (%r12,%r12), %esi
xorl %edi, %edi
movq -0x38(%rbp), %r8
xorl %r9d, %r9d
movq %rcx, %r10
movl %edi, %r11d
movq %r8, %r13
cmpl $0x2, %r12d
jl 0x44b9
movslq %r11d, %r11
leaq (%r11,%r11,2), %r15
movb 0x2(%r14,%r15), %bl
movb %bl, 0x2(%r13)
movzwl (%r14,%r15), %ebx
movw %bx, (%r13)
addq $0x3, %r13
addl $0x2, %r11d
decq %r10
jne 0x4492
incq %r9
addq %rdx, %r8
addl %esi, %edi
cmpq %rax, %r9
jne 0x4483
movq -0x40(%rbp), %rbx
addq $0x8, %rbx
movq %rbx, %rdi
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x39ea
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x39f6
// File: /workspace/github_cpp_makefile_star2_O3/CodyNault[P]Image-Filter-Dataflow/src/logging.cpp
// Function: Logger::LogEvent(char const*)
void Logger::LogEvent(const char *event)
{
	if(logger == NULL){
		logger = fopen("log/log_file", "w");
        	if(logger == NULL){
			logger = fopen("../log/log_file", "w");
        		if(logger == NULL){
                		DataFlowException except("Logger", "Cannot lock log file!");
                		throw except;
			}
        	}
	}	
        fprintf(logger, "%s\n", event);
//	fprintf(stderr,"%s\n", event);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
movq 0x364a(%rip), %rdi      # 0x9168
testq %rdi, %rdi
jne 0x5b64
leaq 0x8e8(%rip), %rdi       # 0x6412
leaq 0x582(%rip), %rsi       # 0x60b3
callq 0x3130
movq %rax, 0x362b(%rip)      # 0x9168
testq %rax, %rax
jne 0x5b61
leaq 0x8c6(%rip), %rdi       # 0x640f
leaq 0x563(%rip), %rsi       # 0x60b3
callq 0x3130
movq %rax, 0x360c(%rip)      # 0x9168
testq %rax, %rax
je 0x5b82
movq %rax, %rdi
leaq 0x8ca(%rip), %rsi       # 0x6435
movq %rbx, %rdx
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3160
leaq 0x2d27(%rip), %r15      # 0x88b0
leaq -0x418(%rbp), %rbx
movq %r15, -0x8(%rbx)
movups 0x884(%rip), %xmm0      # 0x641f
movups %xmm0, (%rbx)
movabsq $0x21656c69662067, %rax # imm = 0x21656C69662067
movq %rax, 0xe(%rbx)
movl $0x408, %edi            # imm = 0x408
callq 0x3090
movq %rax, %r14
movq %r15, (%rax)
leaq 0x8(%rax), %rdi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0x30b0
leaq 0x2cb4(%rip), %rsi      # 0x8888
movq 0x3405(%rip), %rdx      # 0x8fe0
movq %r14, %rdi
callq 0x31a0
movq %rax, %rbx
leaq -0x420(%rbp), %rdi
callq 0x31e8
movq %rbx, %rdi
callq 0x31b0
// File: /workspace/github_cpp_makefile_star2_O3/BhanuPrakashN[P]sparse_chol/main.cpp
// Function: main
int main(){
	sm *A;
	FILE *f;
	f=fopen("input.txt","r");
	A=load(f);
	fclose(f);
	sm *B=TripletToCC(A);
	int n=B->n;
	printf("given matrix A:\n");

	

	clock_t t = clock();

	et *e=buildTree(B);

	map<int,vector<int>* > * col_strut=col_structure(e,B);

	sm *L=sm_chol(B,e,col_strut);

	printf("\nTime taken: %.4fs\n", (float)(clock() - t)/CLOCKS_PER_SEC);


	printf("chol factor L:\n");
	for(int j=0;j<n;j++){
		for(int p=L->p[j];p<L->p[j+1];p++){
			printf("%d %d %g\n",L->i[p]+1,j+1,L->x[p]);
		}
	}

	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1b4a(%rip), %rdi      # 0x3037
leaq 0x1b4d(%rip), %rsi      # 0x3041
callq 0x1130
movq %rax, %rbx
movq %rax, %rdi
callq 0x1869
movq %rax, %r14
movq %rbx, %rdi
callq 0x10f0
movq %r14, %rdi
callq 0x197b
movq %rax, %rbx
movslq 0x8(%rax), %r12
leaq 0x1b8e(%rip), %rdi      # 0x30b3
callq 0x11a0
callq 0x10b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x1ab9
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1c67
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x22e1
movq %rax, %rbx
callq 0x10b0
subq %r14, %rax
cvtsi2ss %rax, %xmm0
divss 0x1a96(%rip), %xmm0     # 0x3004
cvtss2sd %xmm0, %xmm0
leaq 0x1aca(%rip), %rdi      # 0x3043
movb $0x1, %al
callq 0x1030
leaq 0x1b3c(%rip), %rdi      # 0x30c3
callq 0x11a0
testq %r12, %r12
jle 0x15e6
movq 0x10(%rbx), %rax
xorl %r15d, %r15d
leaq 0x1ab8(%rip), %r14      # 0x3057
movq %r15, %rcx
movslq (%rax,%r15,4), %r13
incq %r15
cmpl 0x4(%rax,%rcx,4), %r13d
jge 0x15e1
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
movl (%rax,%r13,4), %esi
incl %esi
movsd (%rcx,%r13,8), %xmm0
movq %r14, %rdi
movl %r15d, %edx
movb $0x1, %al
callq 0x1030
incq %r13
movq 0x10(%rbx), %rax
movslq (%rax,%r15,4), %rcx
cmpq %rcx, %r13
jl 0x15b0
cmpq %r12, %r15
jne 0x159f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop