board_copy(board, copy);
if (!move_make(move, copy, 0)) continue;
if (shared->depth != 1) {
perft_driver(copy, moveList, shared->depth - 1, &result);
} else {
result.node++;
#ifdef USE_FULL_COUNT
if (board_isCheck(copy)) result.check++;
if (move_capture(move)) result.capture++;
if (move_enpassant(move)) result.enpassant++;
if (move_castle(move)) result.castle++;
if (move_promote(move)) result.promote++;
if (board_isCheck(copy)) result.check++;
if (move_capture(move)) result.capture++;
if (move_enpassant(move)) result.enpassant++;
if (move_castle(move)) result.castle++;
if (move_promote(move)) result.promote++;
#endif
perft_driver(copy, moveList, shared->depth, &result);
}
}
board_free(&board);
sem_post(&shared->finish);
return NULL;
}