In fact it's even worse - it's so broken I don't even know where to begin. The assignments from
$1 don't depend on the purportedly associated pattern's success, so if there's nothing looking like an IP in
$b both lines will be considered equivalent even though one of them doesn't even have an IP. Worse yet, if
$a doesn't match, it will compare
$b against a random previous IP - that is, if
$b matches, otherwise it will accidentally do the right thing (two lines both without any IP-like patterns will be considered equal). And so on..
Makeshifts last the longest.