// File: /workspace/github_cpp_makefile_star2_O2/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 $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rax
movl (%rax), %r12d
testq %r12, %r12
leaq 0xa8ef(%rip), %r15      # 0x16ee8
leaq 0xa8ee(%rip), %rax      # 0x16eee
movq %rax, %rsi
cmoveq %r15, %rsi
cmoveq %rax, %r15
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x40d0
leaq 0x8(%rsp), %rdi
leaq 0x3(%rsp), %rdx
movq %r15, %rsi
callq 0x40d0
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), %r15d
movss (%r14), %xmm0
movss %xmm0, 0x4(%rsp)
subl 0x31c(%rsi,%rcx,8), %r15d
movq %rbx, %rdi
callq 0x13a3f
leaq 0xa887(%rip), %rsi      # 0x16ef4
movq %rax, %rdi
callq 0x4240
leaq 0xa8b7(%rip), %rsi      # 0x16f33
movq %rax, %rdi
callq 0x4240
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x41e0
leaq 0xa8b3(%rip), %rsi      # 0x16f4b
movq %rax, %rdi
callq 0x4240
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x41e0
leaq 0xa8a1(%rip), %rsi      # 0x16f55
movq %rax, %rdi
callq 0x4240
leaq 0xa831(%rip), %rsi      # 0x16ef4
movq %rax, %rdi
callq 0x4240
leaq 0xa898(%rip), %rsi      # 0x16f6a
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x2c(%r14,%r12,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa3d7(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
xorl %r13d, %r13d
testq %r12, %r12
sete %r13b
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x2c(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa3a1(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x2c(%r14,%r12,4), %esi
subl 0x2c(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa802(%rip), %rsi      # 0x16f67
movq %rax, %rdi
callq 0x4240
leaq 0xa780(%rip), %rsi      # 0x16ef4
movq %rax, %rdi
callq 0x4240
leaq 0xa7fb(%rip), %rsi      # 0x16f7e
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x14(%r14,%r12,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa326(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x14(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa2fa(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x14(%r14,%r12,4), %esi
subl 0x14(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa75b(%rip), %rsi      # 0x16f67
movq %rax, %rdi
callq 0x4240
leaq 0xa6d9(%rip), %rsi      # 0x16ef4
movq %rax, %rdi
callq 0x4240
leaq 0xa768(%rip), %rsi      # 0x16f92
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x24(%r14,%r12,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa27f(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x24(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa253(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x24(%r14,%r12,4), %esi
subl 0x24(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa6b4(%rip), %rsi      # 0x16f67
movq %rax, %rdi
callq 0x4240
leaq 0xa632(%rip), %rsi      # 0x16ef4
movq %rax, %rdi
callq 0x4240
leaq 0xa6d5(%rip), %rsi      # 0x16fa6
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x1c(%r14,%r12,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa1d8(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x1c(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa1ac(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x1c(%r14,%r12,4), %esi
subl 0x1c(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa60d(%rip), %rsi      # 0x16f67
movq %rax, %rdi
callq 0x4240
leaq 0xa58b(%rip), %rsi      # 0x16ef4
movq %rax, %rdi
callq 0x4240
leaq 0xa642(%rip), %rsi      # 0x16fba
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x34(%r14,%r12,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa131(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x34(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa105(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x34(%r14,%r12,4), %esi
subl 0x34(%r14,%r13,4), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa566(%rip), %rsi      # 0x16f67
movq %rax, %rdi
callq 0x4240
leaq 0xa4e4(%rip), %rsi      # 0x16ef4
movq %rax, %rdi
callq 0x4240
leaq 0xa5af(%rip), %rsi      # 0x16fce
movq %rax, %rdi
callq 0x4240
cvtsi2ss %ebp, %xmm0
movss 0xa4ad(%rip), %xmm1     # 0x16ee0
subss 0x4(%rsp), %xmm1
mulss %xmm0, %xmm1
mulss 0xa49f(%rip), %xmm1     # 0x16ee4
cvttss2si %xmm1, %ebp
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x43c0
leaq 0xa06b(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
cvtsi2ss %r15d, %xmm0
movss 0x4(%rsp), %xmm1
mulss %xmm0, %xmm1
mulss 0xa45b(%rip), %xmm1     # 0x16ee4
cvttss2si %xmm1, %r15d
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %r15d, %esi
callq 0x43c0
leaq 0xa025(%rip), %rsi      # 0x16ad5
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
addl %ebp, %r15d
movq %rax, %rdi
movl %r15d, %esi
callq 0x43c0
leaq 0xa48a(%rip), %rsi      # 0x16f67
movq %rax, %rdi
callq 0x4240
leaq 0xa408(%rip), %rsi      # 0x16ef4
movq %rax, %rdi
callq 0x4240
leaq 0xa4e7(%rip), %rsi      # 0x16fe2
movq %rax, %rdi
callq 0x4240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movl 0x10(%r14), %esi
movq %rax, %rdi
callq 0x43c0
leaq 0xa441(%rip), %rsi      # 0x16f67
movq %rax, %rdi
callq 0x4240
leaq 0xa3bf(%rip), %rsi      # 0x16ef4
movq %rax, %rdi
callq 0x4240
leaq 0x8(%rsp), %rdi
callq 0x4418
leaq 0x28(%rsp), %rdi
callq 0x4418
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xcb75
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4418
leaq 0x28(%rsp), %rdi
callq 0x4418
movq %rbx, %rdi
callq 0x43d0
nop