The company that owns the Chilean mine 33 men were trapped in for more than two months has agreed to sell its assets to avoid bankruptcy .