// File: kmyk[P]procon26/beam_search.cpp
// Function: beam_search_solver::evaluate(photon_t const&)
double evaluate(photon_t const & a) {
        double p = a.bix /(double) n;
        double q = 1 - p;
        return
            - a.circumference * (8 * q)
            - a.score * (12 * p)
            - max(0.0, a.score - a.remaining_stone * 0.8) * 64
            - max(0, a.isolated[0] - remaining_small_blks[0][a.bix]) * 32 * q
            - max(0, a.isolated[1] - remaining_small_blks[1][a.bix]) * 32 * q
            - a.isolated[0] * 16 * (q + 0.3)
            - a.isolated[1] *  8 * (q + 0.3)
            - a.isolated[2] *  6 * (q + 0.3)
            - a.isolated[3] *  4 * (q + 0.3)
            - a.stone_count * 0.00001;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rcx
cvtsi2sdl 0x20e0(%rcx), %xmm0
cvtsi2sdl 0x20ec(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x1e8db(%rip), %xmm0    # 0x21038
subsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
subl 0x20b8(%rcx), %eax
cvtsi2sd %eax, %xmm0
movsd 0x1e8b1(%rip), %xmm2    # 0x21030
mulsd -0x20(%rbp), %xmm2
movq -0x10(%rbp), %rax
cvtsi2sdl 0x20b0(%rax), %xmm1
movsd 0x1e890(%rip), %xmm3    # 0x21028
mulsd -0x18(%rbp), %xmm3
mulsd %xmm3, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cvtsi2sdl 0x20b0(%rax), %xmm1
movq -0x10(%rbp), %rax
cvtsi2sdl 0x20c0(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x1e81c(%rip), %xmm2    # 0x21020
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x52f0
movsd -0x70(%rbp), %xmm1
movq -0x58(%rbp), %rdi
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x1e7ce(%rip), %xmm2    # 0x21018
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movl 0x20e4(%rax), %eax
movl %eax, -0x64(%rbp)
addq $0x2120, %rdi           # imm = 0x2120
xorl %eax, %eax
movl %eax, %esi
callq 0x5370
movq %rax, %rdi
movq -0x10(%rbp), %rax
movslq 0x20e0(%rax), %rsi
callq 0x53a0
movq %rax, %rcx
movl -0x64(%rbp), %eax
subl (%rcx), %eax
movl %eax, -0x38(%rbp)
leaq -0x34(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5330
movsd -0x60(%rbp), %xmm1
movq -0x58(%rbp), %rdi
movl (%rax), %eax
shll $0x5, %eax
cvtsi2sd %eax, %xmm0
movsd -0x20(%rbp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movl 0x20e8(%rax), %eax
movl %eax, -0x4c(%rbp)
addq $0x2120, %rdi           # imm = 0x2120
movl $0x1, %esi
callq 0x5370
movq %rax, %rdi
movq -0x10(%rbp), %rax
movslq 0x20e0(%rax), %rsi
callq 0x53a0
movq %rax, %rcx
movl -0x4c(%rbp), %eax
subl (%rcx), %eax
movl %eax, -0x40(%rbp)
leaq -0x3c(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5330
movsd -0x48(%rbp), %xmm0
movl (%rax), %eax
shll $0x5, %eax
cvtsi2sd %eax, %xmm1
movsd -0x20(%rbp), %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq -0x10(%rbp), %rax
movl 0x20e4(%rax), %eax
shll $0x4, %eax
cvtsi2sd %eax, %xmm0
movsd 0x1e694(%rip), %xmm2    # 0x21010
addsd -0x20(%rbp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movl 0x20e8(%rax), %eax
shll $0x3, %eax
cvtsi2sd %eax, %xmm1
movsd 0x1e657(%rip), %xmm2    # 0x21010
addsd -0x20(%rbp), %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq -0x10(%rbp), %rax
imull $0x6, 0x20ec(%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0x1e61c(%rip), %xmm2    # 0x21010
addsd -0x20(%rbp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movl 0x20f0(%rax), %eax
shll $0x2, %eax
cvtsi2sd %eax, %xmm1
movsd 0x1e5df(%rip), %xmm2    # 0x21010
addsd -0x20(%rbp), %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq -0x10(%rbp), %rax
cvtsi2sdl 0x20b4(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x1e588(%rip), %xmm2    # 0x21008
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addq $0x70, %rsp
popq %rbp
retq
nop