LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4ca0
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x742c
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x493c
movq %rsp, %rdi
callq 0x4e56
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x38cd(%rip), %rdi      # 0x8210
leaq 0x38dc(%rip), %rsi      # 0x8226
leaq 0x39eb(%rip), %rcx      # 0x833c
movl $0x88, %edx
callq 0x21b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4ca0
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x742c
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x49ee
cmpq $0x1, 0x8(%rsp)
jne 0x4a0d
movq %rsp, %rdi
movq 0x10(%rdi), %rax
movb (%rax), %bl
callq 0x4e56
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x381b(%rip), %rdi      # 0x8210
leaq 0x382a(%rip), %rsi      # 0x8226
leaq 0x3954(%rip), %rcx      # 0x8357
movl $0x9b, %edx
callq 0x21b0
leaq 0x3842(%rip), %rdi      # 0x8256
leaq 0x380b(%rip), %rsi      # 0x8226
leaq 0x3935(%rip), %rcx      # 0x8357
movl $0x9c, %edx
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4ca0
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x742c
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4a92
leaq 0x10(%rsp), %rdi
callq 0x4e56
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3777(%rip), %rdi      # 0x8210
leaq 0x3786(%rip), %rsi      # 0x8226
leaq 0x38d4(%rip), %rcx      # 0x837b
movl $0xaa, %edx
callq 0x21b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4ca0
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x742c
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4b1c
cmpq $0x1, 0x8(%rsp)
jne 0x4b3b
movq %rsp, %rdi
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax)
setne %bl
callq 0x4e56
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x36ed(%rip), %rdi      # 0x8210
leaq 0x36fc(%rip), %rsi      # 0x8226
leaq 0x3873(%rip), %rcx      # 0x83a4
movl $0xb6, %edx
callq 0x21b0
leaq 0x3714(%rip), %rdi      # 0x8256
leaq 0x36dd(%rip), %rsi      # 0x8226
leaq 0x3854(%rip), %rcx      # 0x83a4
movl $0xb7, %edx
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x4676
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 0x4ca0
leaq 0x2040(%rbx), %rdi
movq %r14, %rsi
callq 0x3a98
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x742c
movl 0x8(%rsp), %eax
cmpl 0x38(%rsp), %eax
jne 0x4be2
leaq 0x8(%rsp), %rdi
callq 0x4e56
leaq 0x20(%rsp), %rdi
callq 0x4f7c
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3627(%rip), %rdi      # 0x8210
leaq 0x3636(%rip), %rsi      # 0x8226
leaq 0x37cc(%rip), %rcx      # 0x83c3
movl $0xc8, %edx
callq 0x21b0
jmp 0x4c03
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4f7c
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4ca0
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x742c
movl (%r15), %eax
cmpl (%r14), %eax
jne 0x4c80
leaq 0x10(%rsp), %rdi
callq 0x4e56
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3589(%rip), %rdi      # 0x8210
leaq 0x3598(%rip), %rsi      # 0x8226
leaq 0x3763(%rip), %rcx      # 0x83f8
movl $0xd8, %edx
callq 0x21b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x55f6
callq 0x2060
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
divl %ecx
cmpl $0x1, %edx
adcl $0x0, %edx
movq %rsp, %rax
movq %rdx, (%rax)
movq %rax, %rdx
callq 0x650a
movq 0x20(%rsp), %rbp
xorl %r12d, %r12d
movq %rsp, %r14
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
cqto
movl $0x2058, %ecx           # imm = 0x2058
idivq %rcx
cmpq %rax, %r12
jae 0x5e8b
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq %rbp, %r15
addq %r13, %r15
cmpl $0x40, %r13d
je 0x5e68
movq %r14, %rdi
movq %r15, %rsi
callq 0x64de
addq $0x8, %r13
jmp 0x5e4b
imulq $0x2058, %r12, %rdi     # imm = 0x2058
addq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4b5a
movq %r14, %rdi
callq 0x3f16
incq %r12
movq %r15, %rbp
jmp 0x5e24
leaq 0x20(%rsp), %rdi
callq 0x3f16
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x5eb6
jmp 0x5eab
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3f16
leaq 0x20(%rsp), %rdi
callq 0x3f16
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/table.cpp
// Function: Table::PlayRound()
void Table::PlayRound() {
  std::cout << "\nStarting new round!\n\n";

  // For each of the 8 turns
  for(int roundstep = 1; roundstep <= 8; ++roundstep) {
    cardStack.clear();

    // Play the turn
    PlayTurn(firstPlayer);

    // Trigger EndTurn to all players
    for(size_t i=0;i<players.size();++i) {
      players[i].sendCards(cardStack);
      players[i].turnEnd();
    }

    // check for winner
    int winnerIndex = 0;
    Card winnerCard = cardStack[winnerIndex];

    for(size_t i=1;i<cardStack.size();++i) {
      if(winnerCard.isBeatenBy(cardStack[i])) {
        winnerCard = cardStack[i];
        winnerIndex = i;
      }
    }

    // change the first connection to go
    while(winnerIndex--) {
      ++firstPlayer;
      if(firstPlayer == players.end())
        firstPlayer = players.begin();
    }

    // change score
    ChangeScore();
  }

  std::cout << "Round over!\n\n";

  // print the final scores
  printScores();
  std::cout << "\n--------------------------\n";

  std::cout << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x70e8(%rip), %rdi      # 0xcfc8
leaq 0x27ab(%rip), %rsi      # 0x8692
callq 0x2230
leaq 0x28(%rbx), %r14
pushq $0x1
popq %rax
movl $0x2058, %ebp           # imm = 0x2058
leaq 0x10(%rsp), %r15
cmpl $0x9, %eax
je 0x5ff7
movl %eax, 0xc(%rsp)
movq 0x28(%rbx), %rax
cmpq %rax, 0x30(%rbx)
je 0x5f18
movq %rax, 0x30(%rbx)
movq 0x20(%rbx), %rsi
movq %rbx, %rdi
callq 0x62de
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rax
subq %rdi, %rax
cqto
idivq %rbp
cmpq %rax, %r13
jae 0x5f62
addq %r12, %rdi
movq %r14, %rsi
callq 0x46dc
movq 0x8(%rbx), %rdi
addq %r12, %rdi
callq 0x477a
incq %r13
addq $0x2058, %r12           # imm = 0x2058
jmp 0x5f2a
movq (%r14), %rsi
movq %r15, %rdi
callq 0x544c
xorl %r13d, %r13d
pushq $0x8
popq %rbp
pushq $0x1
popq %r12
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rax
subq %rsi, %rax
sarq $0x3, %rax
cmpq %rax, %r12
jae 0x5fba
addq %rbp, %rsi
movq %r15, %rdi
callq 0x553c
testb %al, %al
je 0x5fb1
movq (%r14), %rax
movb 0x4(%rax,%r12,8), %cl
movb %cl, 0x14(%rsp)
movl (%rax,%r12,8), %eax
movl %eax, 0x10(%rsp)
movl %r12d, %r13d
incq %r12
addq $0x8, %rbp
jmp 0x5f77
movq 0x20(%rbx), %rax
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
movl $0x2058, %ebp           # imm = 0x2058
subl $0x1, %r13d
jb 0x5fe4
addq $0x2058, %rax           # imm = 0x2058
cmpq %rdx, %rax
cmoveq %rcx, %rax
movq %rax, 0x20(%rbx)
jmp 0x5fcb
movq %rbx, %rdi
callq 0x2e3c
movl 0xc(%rsp), %eax
incl %eax
jmp 0x5efd
movq 0x6fca(%rip), %r14      # 0xcfc8
leaq 0x26a4(%rip), %rsi      # 0x86a9
movq %r14, %rdi
callq 0x2230
movq %rbx, %rdi
callq 0x603c
leaq 0x269b(%rip), %rsi      # 0x86b7
movq %r14, %rdi
callq 0x2230
movq %r14, %rdi
callq 0x2130
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6f74(%rip), %rdi      # 0xcfc8
leaq 0x262e(%rip), %rsi      # 0x8689
callq 0x2230
leaq 0x40(%rbx), %r15
xorl %r13d, %r13d
leaq 0x8(%rsp), %r12
leaq 0x28(%rsp), %rbp
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rax
subq %rdi, %rax
cqto
movl $0x2058, %ecx           # imm = 0x2058
idivq %rcx
cmpq %rax, %r14
jae 0x6106
addq %r13, %rdi
movq %r15, %rsi
callq 0x47e6
movq 0x8(%rbx), %rsi
addq %r13, %rsi
movq %r12, %rdi
callq 0x495c
movq %rbp, %rdi
movq %r12, %rsi
leaq 0x207d(%rip), %rdx      # 0x8132
callq 0x649d
movq 0x6f07(%rip), %rdi      # 0xcfc8
movq %rbp, %rsi
callq 0x2220
movq (%r15), %rcx
movl (%rcx,%r14,4), %esi
movq %rax, %rdi
callq 0x23d0
movq %rax, %rdi
leaq 0x24c8(%rip), %rsi      # 0x85aa
callq 0x2230
movq %rbp, %rdi
callq 0x2110
movq %r12, %rdi
callq 0x2110
incq %r14
addq $0x2058, %r13           # imm = 0x2058
jmp 0x6074
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x6127
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2110
leaq 0x8(%rsp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x23e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Thomas1995[P]Rentz/src/table.cpp
// Function: Table::PlayerAction(Connection&)
void Table::PlayerAction(Connection &connection) {
  // send connection the cards that were played and get his played card
  connection.sendCards(cardStack);

  Card playedCard = connection.getCardChoice();

  std::cout << connection.getName() << " played " << playedCard << "\n";

  // check if the played card can be played
  if(cardStack.size() > 1) {
    if(!playedCard.isSameSuite(cardStack.front())) {
      auto cards = connection.getHand();
      for(auto c : cards)
        require(!cardStack.front().isSameSuite(c),
            connection.getName() + " had chosen a card of a different suite.\n");
    }
  }

  // push the card in play
  cardStack.push_back(playedCard);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x28(%rdi), %rsi
movq %r14, %rdi
movq %rsi, 0x10(%rsp)
callq 0x46dc
movq %rsp, %rdi
movq %r14, %rsi
callq 0x4532
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %r14, 0x8(%rsp)
movq %r14, %rsi
callq 0x495c
movq 0x6e42(%rip), %rdi      # 0xcfc8
movq %rbx, %rsi
callq 0x2220
leaq 0x24c1(%rip), %rsi      # 0x8656
movq %rax, %rdi
callq 0x2230
movq %rsp, %rsi
movq %rax, %rdi
callq 0x555a
leaq 0x23fb(%rip), %rsi      # 0x85aa
movq %rax, %rdi
callq 0x2230
leaq 0x18(%rsp), %rdi
callq 0x2110
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rax
subq %rsi, %rax
cmpq $0x9, %rax
jb 0x627d
movq %rsp, %rdi
callq 0x5550
testb %al, %al
jne 0x627d
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0x4972
movq (%rbx), %r15
movq 0x8(%rbx), %r14
leaq 0x50(%rsp), %r12
leaq 0x18(%rsp), %r13
leaq 0x58(%rsp), %rbp
cmpq %r14, %r15
je 0x6273
movq %r12, %rdi
movq %r15, %rsi
callq 0x544c
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq %r12, %rsi
callq 0x5550
movl %eax, %ebx
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x495c
movq %rbp, %rdi
movq %r13, %rsi
leaq 0x2415(%rip), %rdx      # 0x865f
callq 0x649d
xorb $0x1, %bl
movzbl %bl, %edi
movq %rbp, %rsi
callq 0x7154
movq %rbp, %rdi
callq 0x2110
movq %r13, %rdi
callq 0x2110
addq $0x8, %r15
jmp 0x620e
leaq 0x38(%rsp), %rdi
callq 0x3f16
movq %rsp, %rsi
movq 0x10(%rsp), %rdi
callq 0x64de
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2110
jmp 0x62d5
jmp 0x62c8
movq %rax, %rbx
jmp 0x62bc
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2110
leaq 0x18(%rsp), %rdi
callq 0x2110
jmp 0x62cb
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3f16
movq %rbx, %rdi
callq 0x23e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rsi, %r15
cmpq 0x10(%r14), %r15
je 0x6306
movq %r14, %rdi
movq %r15, %rsi
callq 0x613a
addq $0x2058, %r15           # imm = 0x2058
jmp 0x62ec
movq 0x8(%r14), %r15
cmpq %rbx, %r15
je 0x6323
movq %r14, %rdi
movq %r15, %rsi
callq 0x613a
addq $0x2058, %r15           # imm = 0x2058
jmp 0x630a
movq 0x6c9e(%rip), %rdi      # 0xcfc8
popq %rbx
popq %r14
popq %r15
jmp 0x2130
// File: /workspace/github_cpp_makefile_star2_O2/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 0x23bb
leaq 0x1(%rbx), %rcx
movq %rbx, %rax
lock
cmpxchgq %rcx, 0x18(%r14)
sete %al
testb %al, %al
je 0x237e
pushq $0x4
popq %rdi
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_O2/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 0x2419
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
andq $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_O2/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 0x2576
movq 0x18(%r14), %r15
movq %r15, %r12
subq 0x10(%r14), %r12
movl 0x8(%r14), %r13d
cmpq %r13, %r12
jae 0x2556
pushq $0x4
popq %rdi
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 0x20e0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x1ab8(%rip), %rsi      # 0x4040
movq %rax, %rdi
callq 0x2060
movq 0x4a61(%rip), %rsi      # 0x6ff8
movq 0x4a2a(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2657
movq 0x10(%r14), %r15
movq 0x18(%r14), %r13
cmpq %r15, %r13
je 0x2637
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
andq $0x0, (%rsi,%rdx,8)
incq %rcx
movq %rcx, 0x10(%r14)
cmpq %r15, %r13
setne %bpl
movq %rbx, %rdi
callq 0x20e0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x19f6(%rip), %rsi      # 0x405f
movq %rax, %rdi
callq 0x2060
movq 0x4980(%rip), %rsi      # 0x6ff8
movq 0x4949(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/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 0x26c8
movl 0x18(%r14), %ebp
subl 0x10(%r14), %ebp
movq %rbx, %rdi
callq 0x20e0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x19a4(%rip), %rsi      # 0x407e
movq %rax, %rdi
callq 0x2060
movq 0x490f(%rip), %rsi      # 0x6ff8
movq 0x48d8(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2450
leaq 0x80(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2820
movq %rsp, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x233c
leaq 0x30(%rsp), %rdi
pushq $0x3
popq %rdx
movl $0x1312d00, %esi        # imm = 0x1312D00
callq 0x2a18
movl %eax, %ebx
leaq 0x80(%rsp), %rdi
pushq $0x3
popq %rdx
movl $0x1312d00, %esi        # imm = 0x1312D00
callq 0x2a18
movl %eax, %ebp
movq %rsp, %rdi
pushq $0x3
popq %rdx
movl $0x1312d00, %esi        # imm = 0x1312D00
callq 0x2a18
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 0x235a
leaq 0x80(%rsp), %rdi
callq 0x28a4
leaq 0x30(%rsp), %rdi
callq 0x24cc
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
jmp 0x27fe
movq %rax, %rbx
jmp 0x280b
movq %rax, %rbx
movq %rsp, %rdi
callq 0x235a
leaq 0x80(%rsp), %rdi
callq 0x28a4
leaq 0x30(%rsp), %rdi
callq 0x24cc
movq %rbx, %rdi
callq 0x2210
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/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 0x294f
movq 0x18(%rbx), %r13
movq %r13, %r15
subq 0x10(%rbx), %r15
movl 0x8(%rbx), %r12d
cmpq %r12, %r15
jae 0x2932
leaq 0x1(%r13), %rax
movq %rax, 0x18(%rbx)
movq %r14, %rdi
callq 0x20e0
pushq $0x4
popq %rdi
callq 0x2130
movl %ebp, (%rax)
movq 0x20(%rbx), %rcx
andl 0x50(%rbx), %r13d
movq %rax, (%rcx,%r13,8)
jmp 0x293a
movq %r14, %rdi
callq 0x20e0
cmpq %r12, %r15
setb %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x16df(%rip), %rsi      # 0x4040
movq %rax, %rdi
callq 0x2060
movq 0x4688(%rip), %rsi      # 0x6ff8
movq 0x4651(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/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 0x29e1
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
andq $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_O2/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 0x30b4
cmpb $0x1, 0x18(%rbx)
jne 0x30ac
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3112
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x120b(%rip), %rsi      # 0x42d1
movq %rax, %rdi
callq 0x2060
movq 0x3f23(%rip), %rsi      # 0x6ff8
movq 0x3eec(%rip), %rdx      # 0x6fc8
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O2/enfiskutensykkel[P]lamport/src/producer.cpp
// Function: Producer::run()
void Producer::run()
{
	unsigned remaining = repetitions + 1;

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %ebp
incl %ebp
movb 0x18(%rbx), %al
cmpb $0x1, %al
jne 0x3146
decl %ebp
je 0x3146
testb $0x1, %al
je 0x311d
movq 0x10(%rbx), %rdi
movl (%rbx), %esi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x311d
callq 0x21b0
movb 0x18(%rbx), %al
jmp 0x3128
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x385e(%rip), %rax      # 0x6d68
movq %rax, (%rdi)
decl %esi
xorl %ecx, %ecx
movl $0x80000000, %eax       # imm = 0x80000000
testl %esi, %eax
jne 0x3525
cmpl $0x1f, %ecx
ja 0x3525
shrl %eax
incl %ecx
jmp 0x3516
negb %cl
pushq $0x1
popq %r14
shll %cl, %r14d
movl %r14d, 0x8(%rbx)
leaq (,%r14,8), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
andq $0x0, 0x20(%rbx)
callq 0x2030
movq %rax, 0x20(%rbx)
xorl %eax, %eax
cmpq %rax, %r14
je 0x3564
movq 0x20(%rbx), %rcx
andq $0x0, (%rcx,%rax,8)
incq %rax
jmp 0x3551
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb_load.c
// Function: unhex
static int unhex(unsigned char *c2)
{
	int x, c;
	x = *c2++ & 0x4f;
	if (x & 0x40)
		x -= 55;
	c = x << 4;
	x = *c2 & 0x4f;
	if (x & 0x40)
		x -= 55;
	c |= x;
	return c;
}

// Assembly:
movzbl (%rdi), %ecx
andl $0x4f, %ecx
movzbl 0x1(%rdi), %eax
andl $0x4f, %eax
leal -0x37(%rax), %edx
cmpb $0x40, %al
cmovbl %eax, %edx
movl %ecx, %esi
shll $0x4, %esi
leal -0x370(%rsi), %eax
cmpb $0x40, %cl
cmovbl %esi, %eax
orl %edx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/StanHash[P]nesdump/nesdump.cc
// Function: parse_item(std::basic_string_view<char, std::char_traits<char>>)
Item parse_item(std::string_view item_str)
{
    std::size_t const colon_pos = item_str.find_first_of(':');

    std::string_view const item_name = (colon_pos == std::string_view::npos)
        ? item_str
        : item_str.substr(0, colon_pos);

    std::string_view const item_part = (colon_pos == std::string_view::npos)
        ? ""
        : item_str.substr(colon_pos+1);

    if (item_name.compare("info") == 0)
    {
        Item result = ItemInfo {};
        return result;
    }

    if (item_name.compare("prg") == 0)
    {
        int bank = -1;

        if (!item_part.empty())
            bank = std::stoi(std::string { item_part }, nullptr, 0);

        Item result = ItemPrg { bank };
        return result;
    }

    if (item_name.compare("chr") == 0)
    {
        int bank = -1;

        if (!item_part.empty())
            bank = std::stoi(std::string { item_part }, nullptr, 0);

        Item result = ItemChr { bank };
        return result;
    }

    Item result = ItemError {};
    return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
leaq 0x58(%rsp), %rax
movq %rdi, (%rax)
movq %rsi, 0x8(%rax)
pushq $0x3a
popq %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x2ac6
cmpq $-0x1, %rax
je 0x23e7
movq %rax, %rbx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x2a10
movq %rax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
incq %rbx
pushq $-0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2a10
movq %rax, %rbx
jmp 0x23fa
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x1caf(%rip), %rdx      # 0x40a7
xorl %ebx, %ebx
movq %rbx, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
leaq 0x1bf9(%rip), %rsi      # 0x4004
leaq 0x10(%rsp), %rdi
callq 0x2a46
testl %eax, %eax
je 0x2448
leaq 0x1be9(%rip), %rsi      # 0x4009
leaq 0x10(%rsp), %rdi
callq 0x2a46
testl %eax, %eax
je 0x2454
leaq 0x1bd8(%rip), %rsi      # 0x400d
leaq 0x10(%rsp), %rdi
callq 0x2a46
testl %eax, %eax
je 0x2487
xorl %r14d, %r14d
jmp 0x2452
movabsq $0x100000000, %r14      # imm = 0x100000000
jmp 0x24cc
movabsq $0x200000000, %r14      # imm = 0x200000000
testq %rbx, %rbx
je 0x24c9
leaq 0x38(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0xf(%rsp), %rdx
callq 0x2a8a
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2a6d
jmp 0x24bb
movabsq $0x300000000, %r14      # imm = 0x300000000
cmpq $0x0, 0x28(%rsp)
je 0x24c9
leaq 0x38(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0xf(%rsp), %rdx
callq 0x2a8a
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2a6d
movl %eax, %ebx
leaq 0x38(%rsp), %rdi
callq 0x20c0
jmp 0x24cc
pushq $-0x1
popq %rbx
movl %ebx, %eax
orq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
jmp 0x24dd
jmp 0x24ec
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x20c0
jmp 0x24ef
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5fd5(%rip), %rax      # 0x9830
movq %rax, (%rdi)
movl %esi, 0x8(%rdi)
movl %edx, 0xc(%rdi)
movq %rcx, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5fa9(%rip), %rax      # 0x9830
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
pushq $0x3
popq %rcx
mulq %rcx
movq %rax, %r15
pushq $-0x1
popq %rdi
cmovnoq %rax, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
movq 0x10(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x30d0
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_O2/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 0x3a69
cmpq $0x0, 0x10(%rbx)
je 0x3aef
addq $0x810, %rsp            # imm = 0x810
popq %rbx
popq %r14
popq %rbp
retq
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq 0x25de(%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 0x5b4c
movl $0x408, %edi            # imm = 0x408
callq 0x30a0
movq %rax, %rbx
leaq 0x5df4(%rip), %rax      # 0x98b0
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq -0x410(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x30d0
leaq 0x5dad(%rip), %rsi      # 0x9888
movq 0x64fe(%rip), %rdx      # 0x9fe0
movq %rbx, %rdi
callq 0x31c0
jmp 0x3b70
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq 0x2567(%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 0x5b4c
movl $0x408, %edi            # imm = 0x408
callq 0x30a0
movq %rax, %rbx
leaq 0x5d6e(%rip), %rax      # 0x98b0
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq -0x410(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x30d0
leaq 0x5d27(%rip), %rsi      # 0x9888
movq 0x6478(%rip), %rdx      # 0x9fe0
movq %rbx, %rdi
callq 0x31c0
jmp 0x3b72
movq %rax, %rbx
leaq -0x418(%rbp), %rdi
callq 0x3208
movq %rbx, %rdi
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
leaq -0x10(%rbp), %rsi
movq %rdi, (%rsi)
leaq 0x6560(%rip), %rdi      # 0xa140
callq 0x3ca4
testq %rax, %rax
jne 0x3c04
leaq 0x654f(%rip), %rdi      # 0xa140
leaq -0x10(%rbp), %rsi
callq 0x3d8e
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %rbp
retq
leaq 0x2484(%rip), %rsi      # 0x608f
leaq 0x2484(%rip), %rdx      # 0x6096
leaq -0x418(%rbp), %rdi
callq 0x5b4c
movl $0x408, %edi            # imm = 0x408
callq 0x30a0
movq %rax, %rbx
leaq 0x5c7e(%rip), %rax      # 0x98b0
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq -0x410(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x30d0
leaq 0x5c37(%rip), %rsi      # 0x9888
movq 0x6388(%rip), %rdx      # 0x9fe0
movq %rbx, %rdi
callq 0x31c0
movq %rax, %rbx
leaq -0x418(%rbp), %rdi
callq 0x3208
movq %rbx, %rdi
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
andl $0x0, -0x30(%rbp)
movq %rdi, %rbx
andl $0x0, -0x2c(%rbp)
andl $0x0, -0x34(%rbp)
movq 0x28(%rdi), %rdi
leaq 0x1ef6(%rip), %rsi      # 0x60b5
callq 0x3150
testq %rax, %rax
je 0x4266
movq %rax, %r14
leaq 0x1efc(%rip), %rsi      # 0x60d3
leaq -0x37(%rbp), %rdx
leaq -0x30(%rbp), %r15
leaq -0x2c(%rbp), %r12
leaq -0x34(%rbp), %r9
movq %rax, %rdi
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x31e0
movslq (%r15), %rax
movslq (%r12), %r13
imulq %rax, %r13
pushq $0x3
popq %r15
movq %r13, %rax
mulq %r15
pushq $-0x1
popq %rdi
cmovnoq %rax, %rdi
callq 0x3030
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x3190
movq %r14, %rdi
callq 0x3100
addq $0x8, %rbx
leaq -0x30(%rbp), %rax
movl (%rax), %esi
leaq -0x2c(%rbp), %rax
movl (%rax), %edx
movq %rbx, %rdi
callq 0x3936
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3942
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5d63(%rip), %rax      # 0x9fd0
movq (%rax), %rcx
leaq 0x1e41(%rip), %rdi      # 0x60b8
pushq $0x1a
popq %rsi
pushq $0x1
popq %rdx
callq 0x31f0
pushq $0x1
popq %rdi
callq 0x3160
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1e36(%rip), %rsi      # 0x60e0
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3050
movq %rbx, %rdi
callq 0x5b68
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq 0x1e34(%rip), %rsi      # 0x6112
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3050
movq %rbx, %rdi
callq 0x5b68
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x439d
movq %rbx, %rdi
callq 0x3080
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 0x1dc1(%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 0x5b68
movl $0x408, %edi            # imm = 0x408
callq 0x30a0
movq %rax, %r14
leaq 0x5549(%rip), %rax      # 0x98b0
movq %rax, (%r14)
leaq 0x8(%r14), %rdi
addq $0x8, %rbx
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0x30d0
leaq 0x5502(%rip), %rsi      # 0x9888
movq 0x5c53(%rip), %rdx      # 0x9fe0
movq %r14, %rdi
callq 0x31c0
movq %rax, %rbx
callq 0x31b0
movq %rbx, %rdi
callq 0x31d0
movq %rax, %rdi
callq 0x3cc8
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1d66(%rip), %rsi      # 0x613a
movq %rax, %rdi
callq 0x3150
testq %rax, %rax
je 0x4455
movq %rax, %rbx
movq 0x8(%r14), %rdi
callq 0x38d8
movl %eax, %r15d
movq 0x8(%r14), %rdi
callq 0x38e2
leaq 0x1d59(%rip), %rsi      # 0x6159
movq %rbx, %rdi
movl %r15d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x3180
movq 0x8(%r14), %rdi
callq 0x38ec
movq %rax, %r15
movq 0x8(%r14), %rdi
callq 0x38e2
movl %eax, %r12d
movq 0x8(%r14), %rdi
callq 0x38d8
imull %r12d, %eax
movslq %eax, %rdx
pushq $0x3
popq %rsi
movq %r15, %rdi
movq %rbx, %rcx
callq 0x31f0
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3100
movq 0x5b74(%rip), %rax      # 0x9fd0
movq (%rax), %rcx
leaq 0x1cd7(%rip), %rdi      # 0x613d
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x31f0
pushq $0x1
popq %rdi
callq 0x3160
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/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 0x39a8
movq 0x30(%rbx), %rdi
callq 0x38ec
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0x38d8
movl %eax, %r12d
pushq $0x2
popq %r13
cltd
idivl %r13d
movl %eax, %r15d
movq 0x30(%rbx), %rdi
callq 0x38e2
cltd
idivl %r13d
movl %eax, %r13d
imull %r15d, %eax
cltq
pushq $0x3
popq %rcx
mulq %rcx
pushq $-0x1
popq %rdi
cmovnoq %rax, %rdi
callq 0x3030
movq %rax, %rdi
xorl %eax, %eax
testl %r15d, %r15d
movl $0x0, %esi
cmovgl %r15d, %esi
movslq %r15d, %rdx
testl %r13d, %r13d
movl %r13d, -0x2c(%rbp)
movl %r13d, %ecx
cmovlel %eax, %ecx
leaq (%rdx,%rdx,2), %rdx
leaq (%rsi,%rsi,2), %rsi
addl %r12d, %r12d
movq %rdi, -0x38(%rbp)
xorl %r8d, %r8d
cmpq %rcx, %r8
je 0x4557
movl %eax, %r9d
xorl %r10d, %r10d
cmpq %r10, %rsi
je 0x454c
movslq %r9d, %r9
leaq (%r9,%r9,2), %r11
movb 0x2(%r14,%r11), %r13b
movb %r13b, 0x2(%rdi,%r10)
movzwl (%r14,%r11), %r11d
movw %r11w, (%rdi,%r10)
addq $0x3, %r10
addl $0x2, %r9d
jmp 0x4522
incq %r8
addq %rdx, %rdi
addl %r12d, %eax
jmp 0x4517
addq $0x8, %rbx
movq %rbx, %rdi
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x3936
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3942
nop
// File: /workspace/github_cpp_makefile_star2_O2/CodyNault[P]Image-Filter-Dataflow/src/filters.cpp
// Function: Transpose::Execute()
void Transpose::Execute()
{
	OneInputCheck();
        int oldHeight = inputImg1->GetHeight();
        int oldWidth = inputImg1->GetWidth();
        int newHeight = oldWidth;
        int newWidth = oldHeight;
	Pixel *outBuffer = new Pixel[newHeight * newWidth];
	Pixel *inBuffer1 = inputImg1->GetBuffer();
	for (int h = 0 ; h < oldHeight ; h++){
        	for (int w = 0 ; w < oldWidth ; w++){
			outBuffer[w * oldHeight + h] = inBuffer1[h * oldWidth + w];
                }
        }
        outputImg.ResetSize(newWidth, newHeight);
        outputImg.SetBuffer(outBuffer);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x39a8
movq 0x30(%rbx), %rdi
callq 0x38e2
movl %eax, %r14d
movq 0x30(%rbx), %rdi
callq 0x38d8
movl %eax, %r15d
imull %r14d, %eax
cltq
pushq $0x3
popq %rcx
mulq %rcx
pushq $-0x1
popq %rdi
cmovnoq %rax, %rdi
callq 0x3030
movq %rax, %r12
movq 0x30(%rbx), %rdi
callq 0x38ec
movslq %r14d, %r8
xorl %ecx, %ecx
testl %r15d, %r15d
movl $0x0, %edi
cmovgl %r15d, %edi
movslq %r15d, %rsi
testl %r8d, %r8d
movl $0x0, %edx
cmovgl %r8d, %edx
leaq (%rsi,%rsi,2), %rsi
leaq (%rdi,%rdi,2), %rdi
leaq (%r8,%r8,2), %r8
movq %r12, %r9
cmpq %rdx, %rcx
je 0x5202
movq %r9, %r10
xorl %r11d, %r11d
cmpq %r11, %rdi
je 0x51f6
movb 0x2(%rax,%r11), %r13b
movb %r13b, 0x2(%r10)
movzwl (%rax,%r11), %r13d
movw %r13w, (%r10)
addq $0x3, %r11
addq %r8, %r10
jmp 0x51d6
incq %rcx
addq %rsi, %rax
addq $0x3, %r9
jmp 0x51cb
addq $0x8, %rbx
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x3936
movq %rbx, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3942
nop
// File: /workspace/github_cpp_makefile_star2_O2/CodyNault[P]Image-Filter-Dataflow/src/filters.cpp
// Function: Invert::Execute()
void Invert::Execute()
{
        OneInputCheck();
        int height = inputImg1->GetHeight();
        int width = inputImg1->GetWidth();
        Pixel *outBuffer = new Pixel[height * width];
        Pixel *inBuffer1 = inputImg1->GetBuffer();
        for (int h = 0 ; h < height ; h++){
                for (int w = 0 ; w < width ; w++){
                        outBuffer[h * width + w].red = 255 - inBuffer1[h * width + w].red;
                        outBuffer[h * width + w].green = 255 - inBuffer1[h * width + w].green;
                        outBuffer[h * width + w].blue = 255 - inBuffer1[h * width + w].blue;
                }
        }
        outputImg.ResetSize(width, height);
        outputImg.SetBuffer(outBuffer);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x39a8
movq 0x30(%rbx), %rdi
callq 0x38e2
movl %eax, %r14d
movq 0x30(%rbx), %rdi
callq 0x38d8
movl %eax, %r15d
imull %r14d, %eax
cltq
pushq $0x3
popq %rcx
mulq %rcx
pushq $-0x1
popq %rdi
cmovnoq %rax, %rdi
callq 0x3030
movq %rax, %r12
movq 0x30(%rbx), %rdi
callq 0x38ec
xorl %ecx, %ecx
testl %r15d, %r15d
movl $0x0, %esi
cmovgl %r15d, %esi
movslq %r15d, %rdi
testl %r14d, %r14d
movl %r14d, %edx
cmovlel %ecx, %edx
leaq (%rsi,%rsi,2), %rsi
addq $0x2, %rax
leaq (%rdi,%rdi,2), %rdi
movq %r12, %r8
addq $0x2, %r8
cmpq %rdx, %rcx
je 0x52f1
xorl %r9d, %r9d
cmpq %r9, %rsi
je 0x52e6
movb -0x2(%rax,%r9), %r10b
notb %r10b
movb %r10b, -0x2(%r8,%r9)
movb -0x1(%rax,%r9), %r10b
notb %r10b
movb %r10b, -0x1(%r8,%r9)
movb (%rax,%r9), %r10b
notb %r10b
movb %r10b, (%r8,%r9)
addq $0x3, %r9
jmp 0x52b6
incq %rcx
addq %rdi, %rax
addq %rdi, %r8
jmp 0x52ae
addq $0x8, %rbx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x3936
movq %rbx, %rdi
movq %r12, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3942