// File: jswaff[P]prophet3/src/evalp.cpp
// Function: init_evalp_bitboards()
void init_evalp_bitboards() {

    // isolated pawn masks
    for (int i=0;i<64;i++) {
        bb_isolated[i] = 0;
        file_t f = get_file((square_t)i);

        if (f > FILE_A) {
            bb_isolated[i] |= bb_files[f-1];
        }
        if (f < FILE_H) {
            bb_isolated[i] |= bb_files[f+1];
        }
    }

    // passed pawn masks
    for (int i=0;i<64;i++) {
        file_t f = get_file((square_t)i);

        bb_passed[i][WHITE] = bb_rays[i][NORTH];
        bb_passed[i][BLACK] = bb_rays[i][SOUTH];

        if (f > FILE_A) {
            bb_passed[i][WHITE] |= bb_rays[i-1][NORTH];
            bb_passed[i][BLACK] |= bb_rays[i-1][SOUTH];
        }
        if (f < FILE_H) {
            bb_passed[i][WHITE] |= bb_rays[i+1][NORTH];
            bb_passed[i][BLACK] |= bb_rays[i+1][SOUTH];
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x40, -0x4(%rbp)
jge 0x7fdf
movslq -0x4(%rbp), %rcx
leaq 0xc756c(%rip), %rax     # 0xcf4c0
movq $0x0, (%rax,%rcx,8)
movl -0x4(%rbp), %edi
callq 0x12070
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jle 0x7f9b
movl -0x8(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xfd673(%rip), %rax     # 0x1055f0
movq (%rax,%rcx,8), %rdx
movslq -0x4(%rbp), %rcx
leaq 0xc7534(%rip), %rax     # 0xcf4c0
orq (%rax,%rcx,8), %rdx
leaq 0xc7529(%rip), %rax     # 0xcf4c0
movq %rdx, (%rax,%rcx,8)
cmpl $0x7, -0x8(%rbp)
jge 0x7fcf
movl -0x8(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0xfd63f(%rip), %rax     # 0x1055f0
movq (%rax,%rcx,8), %rdx
movslq -0x4(%rbp), %rcx
leaq 0xc7500(%rip), %rax     # 0xcf4c0
orq (%rax,%rcx,8), %rdx
leaq 0xc74f5(%rip), %rax     # 0xcf4c0
movq %rdx, (%rax,%rcx,8)
jmp 0x7fd1
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x7f3f
movl $0x0, -0xc(%rbp)
cmpl $0x40, -0xc(%rbp)
jge 0x813b
movl -0xc(%rbp), %edi
callq 0x12070
movl %eax, -0x10(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0xfe06a(%rip), %rax     # 0x106070
shlq $0x6, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movslq -0xc(%rbp), %rdx
leaq 0xc76a5(%rip), %rax     # 0xcf6c0
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movslq -0xc(%rbp), %rcx
leaq 0xfe03f(%rip), %rax     # 0x106070
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rcx
movslq -0xc(%rbp), %rdx
leaq 0xc7679(%rip), %rax     # 0xcf6c0
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
cmpl $0x0, -0x10(%rbp)
jle 0x80be
movl -0xc(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xfe009(%rip), %rax     # 0x106070
shlq $0x6, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movslq -0xc(%rbp), %rdx
leaq 0xc7644(%rip), %rax     # 0xcf6c0
shlq $0x4, %rdx
addq %rdx, %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movl -0xc(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xfdfd5(%rip), %rax     # 0x106070
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rcx
movslq -0xc(%rbp), %rdx
leaq 0xc760f(%rip), %rax     # 0xcf6c0
shlq $0x4, %rdx
addq %rdx, %rax
orq (%rax), %rcx
movq %rcx, (%rax)
cmpl $0x7, -0x10(%rbp)
jge 0x812b
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0xfdf9c(%rip), %rax     # 0x106070
shlq $0x6, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movslq -0xc(%rbp), %rdx
leaq 0xc75d7(%rip), %rax     # 0xcf6c0
shlq $0x4, %rdx
addq %rdx, %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0xfdf68(%rip), %rax     # 0x106070
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rcx
movslq -0xc(%rbp), %rdx
leaq 0xc75a2(%rip), %rax     # 0xcf6c0
shlq $0x4, %rdx
addq %rdx, %rax
orq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x812d
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7fe6
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)