Technology and Labor Regulations: Theory and Evidence