awk help

hi,

I'm quite new to awk programs. I'm trying to understand the logic behind a awk program. Can someone help me what the below script mean?

I've basic knowledge fo scripting, so im just finding it difficult to understand the highlighted codes.

Thanks!

reading this might help you, see what does the gsub function : global substitution (global=even if more than 1 occurrence in the line)