// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
movq %rdi, %r15
leaq 0x28(%rdi), %rsi
movq %rbx, %rdi
movq %rsi, 0x10(%rsp)
callq 0x4bb2
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x49d0
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rbx, 0x8(%rsp)
movq %rbx, %rsi
callq 0x4e9e
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x7473(%rip), %rdi      # 0xdfc8
callq 0x2290
movq %rax, %r12
leaq 0x2b12(%rip), %rsi      # 0x9676
movl $0x8, %edx
movq %rax, %rdi
callq 0x2290
movq %rsp, %rsi
movq %r12, %rdi
callq 0x5c68
leaq 0x2a47(%rip), %rsi      # 0x95ca
movl $0x1, %edx
movq %rax, %rdi
callq 0x2290
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6bab
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rax
subq %rsi, %rax
cmpq $0x9, %rax
jb 0x6ce9
movq %rsp, %rdi
callq 0x5c5e
testb %al, %al
jne 0x6ce9
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %rsi
callq 0x4ec8
movq (%r12), %r15
movq 0x8(%r12), %r14
cmpq %r14, %r15
je 0x6cd4
leaq 0x48(%rsp), %rbx
leaq 0x70(%rsp), %r12
leaq 0x18(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x5af4
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq %r12, %rsi
callq 0x5c5e
movl %eax, %ebp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x4e9e
movq %r13, %rdi
leaq 0x2a48(%rip), %rsi      # 0x967f
callq 0x2410
movq %rbx, 0x38(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6c5f
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x6c65
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
xorb $0x1, %bpl
movq 0x8(%rax), %rdx
movq %rdx, 0x40(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movzbl %bpl, %edi
leaq 0x38(%rsp), %rsi
callq 0x80b8
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6ca6
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x6cc2
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2230
addq $0x8, %r15
cmpq %r14, %r15
jne 0x6c03
movq 0x58(%rsp), %r15
testq %r15, %r15
je 0x6ce9
movq 0x68(%rsp), %rsi
subq %r15, %rsi
movq %r15, %rdi
callq 0x2230
movq %rsp, %rsi
movq 0x10(%rsp), %rdi
callq 0x6fb8
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d79
movq 0x28(%rsp), %rsi
incq %rsi
jmp 0x6d74
jmp 0x6d5f
movq %rax, %r14
jmp 0x6d41
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6d41
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x6d62
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x6d62
movq %rax, %r14
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6d79
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %r14, %rdi
callq 0x23c0
nop