Your requirement is a little bit different as the original.
In the original data file a, the was no space after the seached string(cool: ), and no other texte after the the seached keyword string.
Try the following script :
awk '
NR==FNR {
keys[$1]++;
next;
}
/^\/\* -+[[:space:]]*.*[[:space:]]*-+ \*\/[[:space:]]*$/ {
k = $0;
gsub(/^\/\* --*[[:space:]]*|[[:space:]]*--* \*\/[[:space:]]*$/, "", k)
display = (k in keys ? 1 : 0);
}
display
' b a