A federal appeals court upheld a controversial Illinois law that largely bans so-called assault weapons, though a judge dissented from the decision.