The transformer and R58 form an impedance divider. Impedance changes in the secondary also show up as impedance changes in the primary. This circuit also provides galvanic isolation between the electronics and the medium under test. When building a structural object, like a bridge, the fasteners, like bolts, are usually chosen to be of a material that is slightly more anodic than the structural materials. Anodic materials will corrode due to galvanic action.
Fasteners are replaceable on a preventative maintenance schedule.
If structural members corrode, maintenance becomes very expensive. The following code will reverse the order of bits in an 'unsigned long'. The function works by first exchanging adjacent bits, then it exchanges adjacent bit pairs, then it exchanges adjacent nibbles, then it exchanges adjacent bytes and finally, it exchanges adjacent 16-bit values. I think it is clearer the old way, but this way it is simpler. A more obvious solution to the bit counting problem would be to count individual bits using a loop.