// File: /workspace/github_cpp_makefile_star2_O2/ttencate[P]pickomino/game.cc
// Function: Game::takeTurn(Strategy&) const
Dice Game::takeTurn(Strategy &strategy) const {
  strategy.prepareTurn(*this);
  Dice taken;
  while (canRoll(taken) && strategy.chooseWhetherToRoll(*this, taken)) {
    Dice roll = randomRoll(NUM_DICE - taken.count());
    cout << currentPlayer().name() << " rolled " << roll << '\n';

    if (!canTakeAny(taken, roll)) {
      cout << currentPlayer().name() << " died\n";
      return Dice();
    }

    DieSide const *side = strategy.chooseSideToTake(*this, taken, roll);
    taken[side] = roll[side];
    cout << currentPlayer().name() << " took " << side->toString() << ", now has " << taken << '\n';
  }
  cout << "Quit\n";
  return taken;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdx), %rax
movq %rdx, %rdi
callq *0x10(%rax)
xorps %xmm0, %xmm0
movq %rsp, %r12
movaps %xmm0, (%r12)
andq $0x0, 0x10(%r12)
leaq 0x20(%rsp), %r13
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movq %r13, %rdi
callq 0x3226
cmpl $0x7, %eax
jg 0x2ce8
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq *0x18(%rax)
testb %al, %al
je 0x2ce8
movq %r12, %rdi
callq 0x3226
pushq $0x8
popq %rsi
subl %eax, %esi
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
callq 0x59ed
movl 0x18(%r14), %eax
movq (%r14), %rcx
imulq $0x28, %rax, %rax
movq (%rcx,%rax), %rsi
addq $0x8, %rsi
movq 0x9441(%rip), %rdi      # 0xbfd0
callq 0x2140
movq %rax, %rdi
leaq 0x4565(%rip), %rsi      # 0x7103
callq 0x2160
movq %rax, %rdi
movq %rbp, %rsi
callq 0x263c
movq %rax, %rdi
pushq $0xa
popq %rsi
callq 0x21a0
movq 0x10(%rsp), %rax
movq %rax, 0x60(%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
movups 0x38(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
leaq 0x9601(%rip), %rcx      # 0xc1e8
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
cmpq %rcx, %rax
je 0x2c9d
movq (%rax), %rdx
movl (%rdx), %edx
cmpl $0x0, 0x20(%rsp,%rdx,4)
jle 0x2c0a
cmpl $0x0, 0x50(%rsp,%rdx,4)
jle 0x2c10
addq $0x8, %rax
jmp 0x2bee
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
leaq 0x38(%rsp), %rcx
callq *0x20(%rax)
movq %r13, %rbp
movq %rax, %r13
movl (%rax), %eax
movl 0x38(%rsp,%rax,4), %ecx
movl %ecx, (%rsp,%rax,4)
movl 0x18(%r14), %eax
movq (%r14), %rcx
imulq $0x28, %rax, %rax
movq (%rcx,%rax), %rsi
addq $0x8, %rsi
movq 0x9383(%rip), %rdi      # 0xbfd0
callq 0x2140
movq %rax, %rdi
leaq 0x44b7(%rip), %rsi      # 0x7113
callq 0x2160
movq 0x8(%r13), %rsi
movq %rbp, %r13
movq %rsp, %r12
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
leaq 0x449d(%rip), %rsi      # 0x711a
callq 0x2160
movq %rax, %rdi
movq %r12, %rsi
callq 0x263c
movq %rax, %rdi
pushq $0xa
popq %rsi
callq 0x21a0
jmp 0x2b20
movl 0x18(%r14), %eax
movq (%r14), %rcx
imulq $0x28, %rax, %rax
movq (%rcx,%rax), %rsi
addq $0x8, %rsi
movq 0x9319(%rip), %rdi      # 0xbfd0
callq 0x2140
leaq 0x4449(%rip), %rsi      # 0x710c
movq %rax, %rdi
callq 0x2160
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x92e1(%rip), %rdi      # 0xbfd0
leaq 0x442f(%rip), %rsi      # 0x7125
callq 0x2160
movaps (%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x2cd6
nop