// File: /workspace/github_cpp_makefile_star2_O3/SethKasmann[P]clever-girl/src/evaluation.cpp
// Function: operator<<(std::ostream&, Evaluate const&)
std::ostream& operator<<(std::ostream& o, const Evaluate& e)
{
    Color c = e.mState.getOurColor();
    std::string us = c == white ? "White" : "Black";
    std::string them = c == white ? "Black" : "White";
    int pstMid = e.mState.getPstScore(middle) * (256 - e.mGamePhase) / 256;
    int pstLate = e.mState.getPstScore(late) * e.mGamePhase / 256;

    o << e.mState
      << "-------------------------------------------------------------\n"
      << "| Evaluation Type |    " << us << "    |    " << them 
      << "    | Total       |\n"
      << "-------------------------------------------------------------\n"
      << "| Material        |"
      << std::setw(13) << e.mMaterial[ c] << "|"
      << std::setw(13) << e.mMaterial[!c] << "|"
      << std::setw(13) << e.mMaterial[ c] - e.mMaterial[!c] << "|\n"
      << "-------------------------------------------------------------\n"
      << "| Mobility        |" 
      << std::setw(13) << e.mMobility[ c] << "|" 
      << std::setw(13) << e.mMobility[!c] << "|"
      << std::setw(13) << e.mMobility[ c] - e.mMobility[!c] << "|\n"
      << "-------------------------------------------------------------\n"
      << "| Pawn Structure  |"
      << std::setw(13) << e.mPawnStructure[ c] << "|" 
      << std::setw(13) << e.mPawnStructure[!c] << "|"
      << std::setw(13) << e.mPawnStructure[ c] - e.mPawnStructure[!c] 
      << "|\n"
      << "-------------------------------------------------------------\n"
      << "| King Safety     |"
      << std::setw(13) << e.mKingSafety[ c] << "|" 
      << std::setw(13) << e.mKingSafety[!c] << "|"
      << std::setw(13) << e.mKingSafety[ c] - e.mKingSafety[!c] << "|\n"
      << "-------------------------------------------------------------\n"
      << "| Attacks         |"
      << std::setw(13) << e.mAttacks[ c] << "|" 
      << std::setw(13) << e.mAttacks[!c] << "|"
      << std::setw(13) << e.mAttacks[ c] - e.mAttacks[!c] << "|\n"
      << "-------------------------------------------------------------\n"
      << "| PST (mid/late)  |"
      << std::setw(13) << pstMid << "|" 
      << std::setw(13) << pstLate << "|"
      << std::setw(13) << pstMid + pstLate << "|\n"
      << "-------------------------------------------------------------\n"
      << "| Total           |             |             |"
      << std::setw(13) << e.mScore << "|\n"
      << "-------------------------------------------------------------\n";


      return o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %r13
movq 0x8(%rsi), %rax
movl (%rax), %ebx
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
testq %rbx, %rbx
leaq 0xd631(%rip), %r15      # 0x1c510
leaq 0xd630(%rip), %rax      # 0x1c516
movq %rax, %rsi
cmoveq %r15, %rsi
leaq 0xd621(%rip), %r12      # 0x1c515
leaq 0xd620(%rip), %rcx      # 0x1c51b
movq %rcx, %rdx
cmoveq %r12, %rdx
cmoveq %rax, %r15
cmoveq %rcx, %r12
leaq 0x30(%rsp), %rdi
callq 0xf78c
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xf78c
movq 0x8(%r14), %rsi
movl (%rsi), %eax
movl 0x4(%rsi), %ecx
movl 0x318(%rsi,%rax,8), %ebp
subl 0x318(%rsi,%rcx,8), %ebp
movl 0x31c(%rsi,%rax,8), %eax
movss (%r14), %xmm0
movss %xmm0, 0x8(%rsp)
subl 0x31c(%rsi,%rcx,8), %eax
movl %eax, 0xc(%rsp)
movq %r13, 0x50(%rsp)
movq %r13, %rdi
callq 0x18775
movq %rax, %r15
leaq 0xd5a4(%rip), %rsi      # 0x1c51c
movl $0x3e, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd5cf(%rip), %rsi      # 0x1c55b
movl $0x17, %edx
movq %r15, %rdi
callq 0x4290
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r15, %rdi
callq 0x4290
movq %rax, %r15
leaq 0xd5be(%rip), %rsi      # 0x1c573
movl $0x9, %edx
movq %rax, %rdi
callq 0x4290
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r15, %rdi
callq 0x4290
movq %rax, %r15
leaq 0xd59f(%rip), %rsi      # 0x1c57d
movl $0x14, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd52a(%rip), %rsi      # 0x1c51c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd58c(%rip), %rsi      # 0x1c592
movl $0x13, %edx
movq %r15, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x2c(%r14,%rbx,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xce0b(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
xorl %r12d, %r12d
testq %rbx, %rbx
sete %r12b
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x2c(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xcdcd(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x2c(%r14,%rbx,4), %esi
subl 0x2c(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xd4de(%rip), %rsi      # 0x1c58f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd457(%rip), %rsi      # 0x1c51c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd4cd(%rip), %rsi      # 0x1c5a6
movl $0x13, %edx
movq %r15, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x14(%r14,%rbx,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xcd38(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x14(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xcd04(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x14(%r14,%rbx,4), %esi
subl 0x14(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xd415(%rip), %rsi      # 0x1c58f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd38e(%rip), %rsi      # 0x1c51c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd418(%rip), %rsi      # 0x1c5ba
movl $0x13, %edx
movq %r15, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x24(%r14,%rbx,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xcc6f(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x24(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xcc3b(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x24(%r14,%rbx,4), %esi
subl 0x24(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xd34c(%rip), %rsi      # 0x1c58f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd2c5(%rip), %rsi      # 0x1c51c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd363(%rip), %rsi      # 0x1c5ce
movl $0x13, %edx
movq %r15, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x1c(%r14,%rbx,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xcba6(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x1c(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xcb72(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x1c(%r14,%rbx,4), %esi
subl 0x1c(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xd283(%rip), %rsi      # 0x1c58f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd1fc(%rip), %rsi      # 0x1c51c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd2ae(%rip), %rsi      # 0x1c5e2
movl $0x13, %edx
movq %r15, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x34(%r14,%rbx,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xcadd(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x34(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xcaa9(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x34(%r14,%rbx,4), %esi
subl 0x34(%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r15
leaq 0xd1ba(%rip), %rsi      # 0x1c58f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd133(%rip), %rsi      # 0x1c51c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd1f9(%rip), %rsi      # 0x1c5f6
movl $0x13, %edx
movq %r15, %rdi
callq 0x4290
cvtsi2ss %ebp, %xmm0
movss 0xca3a(%rip), %xmm1     # 0x1be50
subss 0x8(%rsp), %xmm1
mulss %xmm0, %xmm1
mulss 0xca2c(%rip), %xmm1     # 0x1be54
cvttss2si %xmm1, %ebp
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movq %r15, %rdi
movl %ebp, %esi
callq 0x43a0
movq %rax, %r12
leaq 0xc9f5(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
xorps %xmm0, %xmm0
cvtsi2ssl 0xc(%rsp), %xmm0
movss 0x8(%rsp), %xmm1
mulss %xmm0, %xmm1
mulss 0xc9dc(%rip), %xmm1     # 0x1be54
cvttss2si %xmm1, %r15d
movq (%r12), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r12,%rax)
movq %r12, %rdi
movl %r15d, %esi
callq 0x43a0
movq %rax, %r12
leaq 0xc9a2(%rip), %rsi      # 0x1be45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq (%r12), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r12,%rax)
addl %ebp, %r15d
movq %r12, %rdi
movl %r15d, %esi
callq 0x43a0
movq %rax, %r15
leaq 0xd0b6(%rip), %rsi      # 0x1c58f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd02f(%rip), %rsi      # 0x1c51c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd109(%rip), %rsi      # 0x1c60a
movl $0x2f, %edx
movq %r15, %rdi
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%r15,%rax)
movl 0x10(%r14), %esi
movq %r15, %rdi
callq 0x43a0
movq %rax, %r14
leaq 0xd05b(%rip), %rsi      # 0x1c58f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xcfd4(%rip), %rsi      # 0x1c51c
movl $0x3e, %edx
movq %r14, %rdi
callq 0x4290
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf571
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4250
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
movq 0x50(%rsp), %rbx
je 0xf592
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4250
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xf5c8
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf5c8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4250
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xf5e4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4250
movq %rbx, %rdi
callq 0x43b0