// File: /workspace/github_cpp_makefile_star2_O1/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 0xd6bb(%rip), %r15      # 0x1c610
leaq 0xd6ba(%rip), %rax      # 0x1c616
movq %rax, %rsi
cmoveq %r15, %rsi
leaq 0xd6ab(%rip), %r12      # 0x1c615
leaq 0xd6aa(%rip), %rcx      # 0x1c61b
movq %rcx, %rdx
cmoveq %r12, %rdx
cmoveq %rax, %r15
cmoveq %rcx, %r12
leaq 0x30(%rsp), %rdi
callq 0xf802
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xf802
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 0x18888
movq %rax, %r15
leaq 0xd62e(%rip), %rsi      # 0x1c61c
movl $0x3e, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd659(%rip), %rsi      # 0x1c65b
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 0xd648(%rip), %rsi      # 0x1c673
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 0xd629(%rip), %rsi      # 0x1c67d
movl $0x14, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd5b4(%rip), %rsi      # 0x1c61c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd616(%rip), %rsi      # 0x1c692
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 0xce95(%rip), %rsi      # 0x1bf45
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 0xce57(%rip), %rsi      # 0x1bf45
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 0xd568(%rip), %rsi      # 0x1c68f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd4e1(%rip), %rsi      # 0x1c61c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd557(%rip), %rsi      # 0x1c6a6
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 0xcdc2(%rip), %rsi      # 0x1bf45
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 0xcd8e(%rip), %rsi      # 0x1bf45
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 0xd49f(%rip), %rsi      # 0x1c68f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd418(%rip), %rsi      # 0x1c61c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd4a2(%rip), %rsi      # 0x1c6ba
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 0xccf9(%rip), %rsi      # 0x1bf45
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 0xccc5(%rip), %rsi      # 0x1bf45
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 0xd3d6(%rip), %rsi      # 0x1c68f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd34f(%rip), %rsi      # 0x1c61c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd3ed(%rip), %rsi      # 0x1c6ce
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 0xcc30(%rip), %rsi      # 0x1bf45
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 0xcbfc(%rip), %rsi      # 0x1bf45
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 0xd30d(%rip), %rsi      # 0x1c68f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd286(%rip), %rsi      # 0x1c61c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd338(%rip), %rsi      # 0x1c6e2
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 0xcb67(%rip), %rsi      # 0x1bf45
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 0xcb33(%rip), %rsi      # 0x1bf45
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 0xd244(%rip), %rsi      # 0x1c68f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd1bd(%rip), %rsi      # 0x1c61c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd283(%rip), %rsi      # 0x1c6f6
movl $0x13, %edx
movq %r15, %rdi
callq 0x4290
cvtsi2ss %ebp, %xmm0
movss 0xcac4(%rip), %xmm1     # 0x1bf50
subss 0x8(%rsp), %xmm1
mulss %xmm0, %xmm1
mulss 0xcab6(%rip), %xmm1     # 0x1bf54
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 0xca7f(%rip), %rsi      # 0x1bf45
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
xorps %xmm0, %xmm0
cvtsi2ssl 0xc(%rsp), %xmm0
movss 0x8(%rsp), %xmm1
mulss %xmm0, %xmm1
mulss 0xca66(%rip), %xmm1     # 0x1bf54
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 0xca2c(%rip), %rsi      # 0x1bf45
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 0xd140(%rip), %rsi      # 0x1c68f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd0b9(%rip), %rsi      # 0x1c61c
movl $0x3e, %edx
movq %r15, %rdi
callq 0x4290
leaq 0xd193(%rip), %rsi      # 0x1c70a
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 0xd0e5(%rip), %rsi      # 0x1c68f
movl $0x2, %edx
movq %rax, %rdi
callq 0x4290
leaq 0xd05e(%rip), %rsi      # 0x1c61c
movl $0x3e, %edx
movq %r14, %rdi
callq 0x4290
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf5e7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4250
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
movq 0x50(%rsp), %rbx
je 0xf608
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 0xf63e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf63e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4250
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xf65a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4250
movq %rbx, %rdi
callq 0x43b0