SECOND AMENDED AND RESTATED CREDIT AGREEMENT DATED AS OF OCTOBER 27, 2017