Ranbaxy posts loss after write-offs on U.S. import bans