// File: /workspace/github_cpp_makefile_star2_O1/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 0x4b98
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x49b4
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rbx, 0x8(%rsp)
movq %rbx, %rsi
callq 0x4e84
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x746d(%rip), %rdi      # 0xdfc8
callq 0x2290
movq %rax, %r12
leaq 0x2adc(%rip), %rsi      # 0x9646
movl $0x8, %edx
movq %rax, %rdi
callq 0x2290
movq %rsp, %rsi
movq %r12, %rdi
callq 0x5c22
leaq 0x2a11(%rip), %rsi      # 0x959a
movl $0x1, %edx
movq %rax, %rdi
callq 0x2290
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6bb1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rax
subq %rsi, %rax
cmpq $0x9, %rax
jb 0x6cec
movq %rsp, %rdi
callq 0x5c18
testb %al, %al
jne 0x6cec
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %rsi
callq 0x4eae
movq (%r12), %r15
movq 0x8(%r12), %r14
cmpq %r14, %r15
je 0x6cd5
leaq 0x48(%rsp), %rbx
leaq 0x70(%rsp), %r12
leaq 0x18(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x5abc
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq %r12, %rsi
callq 0x5c18
movl %eax, %ebp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x4e84
movq %r13, %rdi
leaq 0x2a12(%rip), %rsi      # 0x964f
callq 0x2410
movq %rbx, 0x38(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6c65
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x6c6b
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 0x7cfc
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6cac
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x6cc8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2230
addq $0x8, %r15
cmpq %r14, %r15
jne 0x6c09
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6cec
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rsp, %rsi
movq 0x10(%rsp), %rdi
callq 0x6fba
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 0x6d7c
movq 0x28(%rsp), %rsi
incq %rsi
jmp 0x6d77
jmp 0x6d62
movq %rax, %r14
jmp 0x6d44
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6d44
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x6d65
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x6d65
movq %rax, %r14
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6d7c
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %r14, %rdi
callq 0x23c0