s{ \A (\S+) \s+ (\S+) \z }{@{[ $2 eq 'WR' ? 'wire' : 'reg' ]} $1}xms or die "bad input: '$_'" for @lines;