// File: jswaff[P]prophet3/test/eval__test.cpp
// Function: test_double_and_isolated_pawns()
void test_double_and_isolated_pawns() {
    position pos;

    set_pos(&pos,"k7/p1p3p1/3p3p/1P5P/1PP1P3/8/8/K7 b - - 0 1");
    int32_pair npmat = eval_nonpawn_material(&pos);
    assert(0==npmat.val1);
    assert(0==npmat.val2);

    int32_pair pmat = eval_pawn_material(&pos);
    assert(pawn_val*5==pmat.val1);
    assert(pawn_val*5==pmat.val2);

    int32 expected = king_endgame_pst[fliprank[A8]]
           + pawn_pst[fliprank[A7]] + pawn_pst[fliprank[C7]] + pawn_pst[fliprank[D6]]
           + pawn_pst[fliprank[G7]] + pawn_pst[fliprank[H6]]
           + isolated_pawn // black pawn on a7
           - king_endgame_pst[A1]
           - pawn_pst[B5] - pawn_pst[B4] - pawn_pst[C4] - pawn_pst[E4] - pawn_pst[H5]
           - isolated_pawn*2 // white pawns on e4 and h1
           - doubled_pawn*2;  // white pawns on b4 and b5
    assert(eval(&pos,false)==expected);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
leaq -0x1c8(%rbp), %rdi
leaq 0x216c9(%rip), %rsi     # 0x3c332
callq 0xf3e0
leaq -0x1c8(%rbp), %rdi
callq 0x73f0
movq %rax, -0x1d0(%rbp)
xorl %eax, %eax
cmpl -0x1d0(%rbp), %eax
jne 0x1ac8d
jmp 0x1acac
leaq 0x216ca(%rip), %rdi     # 0x3c35e
leaq 0x203b5(%rip), %rsi     # 0x3b050
movl $0x111, %edx            # imm = 0x111
leaq 0x216c5(%rip), %rcx     # 0x3c36c
callq 0x20c0
xorl %eax, %eax
cmpl -0x1cc(%rbp), %eax
jne 0x1acb8
jmp 0x1acd7
leaq 0x20fc2(%rip), %rdi     # 0x3bc81
leaq 0x2038a(%rip), %rsi     # 0x3b050
movl $0x112, %edx            # imm = 0x112
leaq 0x2169a(%rip), %rcx     # 0x3c36c
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0x7580
movq %rax, -0x1d8(%rbp)
movl $0x1f4, %eax            # imm = 0x1F4
cmpl -0x1d8(%rbp), %eax
jne 0x1acf9
jmp 0x1ad18
leaq 0x21692(%rip), %rdi     # 0x3c392
leaq 0x20349(%rip), %rsi     # 0x3b050
movl $0x115, %edx            # imm = 0x115
leaq 0x21659(%rip), %rcx     # 0x3c36c
callq 0x20c0
movl $0x1f4, %eax            # imm = 0x1F4
cmpl -0x1d4(%rbp), %eax
jne 0x1ad27
jmp 0x1ad46
leaq 0x2167a(%rip), %rdi     # 0x3c3a8
leaq 0x2031b(%rip), %rsi     # 0x3b050
movl $0x116, %edx            # imm = 0x116
leaq 0x2162b(%rip), %rcx     # 0x3c36c
callq 0x20c0
movslq 0x22063(%rip), %rcx     # 0x3cdb0
leaq 0x2265c(%rip), %rax     # 0x3d3b0
movl (%rax,%rcx,4), %eax
movslq 0x22072(%rip), %rdx     # 0x3cdd0
leaq 0x2234b(%rip), %rcx     # 0x3d0b0
addl (%rcx,%rdx,4), %eax
movslq 0x22069(%rip), %rdx     # 0x3cdd8
leaq 0x2233a(%rip), %rcx     # 0x3d0b0
addl (%rcx,%rdx,4), %eax
movslq 0x2207c(%rip), %rdx     # 0x3cdfc
leaq 0x22329(%rip), %rcx     # 0x3d0b0
addl (%rcx,%rdx,4), %eax
movslq 0x22057(%rip), %rdx     # 0x3cde8
leaq 0x22318(%rip), %rcx     # 0x3d0b0
addl (%rcx,%rdx,4), %eax
movslq 0x2206a(%rip), %rdx     # 0x3ce0c
leaq 0x22307(%rip), %rcx     # 0x3d0b0
addl (%rcx,%rdx,4), %eax
addl $-0x14, %eax
subl 0x226db(%rip), %eax     # 0x3d490
subl 0x22359(%rip), %eax     # 0x3d114
subl 0x22373(%rip), %eax     # 0x3d134
subl 0x22371(%rip), %eax     # 0x3d138
subl 0x22373(%rip), %eax     # 0x3d140
subl 0x22359(%rip), %eax     # 0x3d12c
subl $-0x28, %eax
subl $-0x14, %eax
movl %eax, -0x1dc(%rbp)
leaq -0x1c8(%rbp), %rdi
xorl %esi, %esi
callq 0x7630
cmpl -0x1dc(%rbp), %eax
jne 0x1adf7
jmp 0x1ae16
leaq 0x209dc(%rip), %rdi     # 0x3b7da
leaq 0x2024b(%rip), %rsi     # 0x3b050
movl $0x120, %edx            # imm = 0x120
leaq 0x2155b(%rip), %rcx     # 0x3c36c
callq 0x20c0
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nop