Amended and Restated Master Repurchase Agreement