Fifth Amendment dated July 28, 2011 to Second Amended and Restated Credit Agmt.



 Exhibit 10.4 
 FIFTH AMENDMENT TO SECOND AMENDED AND RESTATED CREDIT AGREEMENT 
 This Fifth Amendment to Second Amended and Restated Credit Agreement (as the same may from time to time be amended, restated, modified or otherwise supplemented, this “Fifth Amendment”)
is dated this 28th day of July, 2011 by and among Green
Plains Grain Company LLC, a Delaware limited liability company (“IA Borrower”), Green Plains Grain Company TN LLC, a Delaware limited liability company (“TN Borrower”, together with IA Borrower and their successors
and assigns, each a “Borrower” and collectively, the “Borrowers”), and First National Bank of Omaha, a national banking association (together with its successors and assigns, the “Lender”).
Capitalized terms used herein and not otherwise defined have the meanings ascribed to them in the Credit Agreement (as defined below). 
 RECITALS 
 WHEREAS, Borrowers and Lender entered into that certain Second
Amended and Restated Credit Agreement dated April 19, 2010, First Amendment to Second Amended and Restated Credit Agreement dated June 18, 2010, Second Amendment to Second Amended and Restated Credit Agreement dated November 18, 2010,
Third Amendment to Second Amended and Restated Credit Agreement dated February 28, 2011 and Fourth Amendment to Second Amended and Restated Credit Agreement dated May 31, 2011 (as the same may from time to time be amended, restated,
modified or otherwise supplemented, collectively the “Credit Agreement”), pursuant to which Lender agreed to make loans to Borrowers; and 
 WHEREAS, Borrowers and Lender desire to amend and modify certain terms and conditions of the Credit Agreement. 
 NOW, THEREFORE, for and in consideration of the Recitals set forth above, which are incorporated herein by this reference, and other good and valuable consideration, the receipt and sufficiency of which
is hereby acknowledged, the parties hereto agree as follows: 
 AGREEMENT 

1. Section 1.1 of the Credit Agreement is hereby amended by adding the following definition in alphabetical order: 

“Macquarie Agreements” means agreements between Borrowers and Macquarie Commodities (USA) Inc. evidencing one or more
purchase and sale transactions involving Grain Inventory; provided, that (a) the obligations of Borrowers thereunder do not exceed fifty million dollars ($50,000,000) in the aggregate at any one time outstanding and (b) an intercreditor
agreement between Lender and Macquarie Commodities (USA) Inc. is in full force and effect. 
 2. Section 1.1 of the Credit
Agreement is hereby amended by deleting the definition of “Revolving Credit Commitment” in its entirety and substituting the following definition in its place: 
 “Revolving Credit Commitment” means an amount equal to one hundred million dollars ($100,000,000) for the Base Facility, Seasonal Facility and Bulge Facility from the date hereof through
the Revolving Credit Maturity Date. 

  
 1 








 3. Section 2.1 of the Credit Agreement is hereby amended by deleting paragraphs
(a) and (d) in their entirety and substituting the following paragraph (a) and (d) in their place: 
  

	 	(a)	Subject to the other terms and conditions of this Agreement, Lender hereby agrees to make loans available for the benefit of Borrowers of up to one hundred twenty
million dollars ($120,000,000) consisting of (i) a one hundred million dollar ($100,000,000) revolving credit facility (the “Revolving Credit Facility”) and (ii) a twenty million dollar ($20,000,000) term loan facility
(the “Term Loan Facility”). The Revolving Credit Facility shall consist of (i) a forty-five million dollar ($45,000,000) base facility (the “Base Facility”), (ii) a twenty million dollar ($20,000,000)
seasonal facility (the “Seasonal Facility”) and (iii) a thirty-five million dollar ($35,000,000) bulge facility (the “Bulge Facility”). Subject to the other terms and conditions of this Agreement, the
periods during which the Base Facility, Seasonal Facility and Bulge Facility are available shall be determined in accordance with the Revolving Credit Commitment and this Section 2.1(a). 


 

	 	(d)	The term of the Revolving Credit Facility shall expire on November 1, 2011. All Revolving Credit Loans under the Revolving Credit Facility shall be repaid on or
before the earlier of (i) November 1, 2011, (ii) termination of the Revolving Credit Facility and (iii) termination of this Agreement (the earliest of such dates, the “Revolving Credit Maturity Date”). After the
Revolving Credit Maturity Date, no further Advances under the Revolving Credit Facility shall be available from Lender. The term of the Term Loan Facility shall expire on August 1, 2013. Any Term Loan under the Term Loan Facility shall be
repaid on or before the earlier of (i) August 1, 2013, (ii) termination of the Term Loan Facility and (iii) termination of this Agreement (the earliest of such dates, the “Term Loan Maturity Date”).


 4. Section 5.1(a) of the Credit Agreement is hereby amended by deleting paragraph (v) in its entirety
and substituting the following paragraph (v) in its place: 
  

	 	(v)	 as soon as available, but in any event within (A) three (3) days after the entry into each purchase or sale transaction pursuant to the
Macquarie Agreements, a Borrowing Base Report as of the date of each such transaction which is estimated in good faith based upon the information then available to Borrowers, (B) ten (10) days after the fifteenth (15th) of each month, a Borrowing Base Report as of the fifteenth
(15th) of each such month which is estimated in good
faith based upon the information then available to Borrowers and (C) fifteen (15) days after the end of each month, a Borrowing Base Report which is actual as of the end of each such month; 



5. Section 5 of the Credit Agreement is hereby amended by adding the following Section 5.12 in its place: 

5.12 Macquarie Agreements. Borrowers shall, promptly after execution or issuance, deliver to Lender copies of the Macquarie
Agreements and any warehouse receipts or other documents issued pursuant to the Macquarie Agreements. 
 6. Section 6.1 of
the Credit Agreement is hereby amended by deleting Section 6.1 in its entirety and substituting the following Section 6.1 in its place: 
 6.1 Debt. Borrowers shall not create, incur, assume or suffer to exist, voluntarily or involuntarily, any Debt, except (a) the Obligations, (b) purchase money obligations, obligations under
Capitalized Leases and obligations under operating leases for rolling stock and equipment in an aggregate amount not to exceed three million dollars ($3,000,000) outstanding at any one time, (c) the Parent Sub Debt – Tranche 1 and Parent Sub
Debt – Tranche 2, (d) the 

  
 2 








 
Parent Sub Debt – Tranche 3 outstanding on or before August 1, 2011; provided, that the proceeds of the Parent Sub Debt – Tranche 3 shall only be used by Borrowers for financing of
inventory, hedging transactions and other working capital matters, (e) unsecured and subordinated obligations owing to TN Sellers for the purchase price of the TN Acquisitions not in excess of three million three hundred thousand dollars
($3,300,000) in the aggregate at any one time outstanding and (f) the Macquarie Agreements. No payment of principal or interest shall be made by Borrowers with respect to the Parent Sub Debt – Tranche 1, Parent Sub Debt – Tranche 2 or
Parent Sub Debt – Tranche 3 if an Unmatured Event of Default or Event of Default would occur as a result of such payment. 

7. The form of the Borrowing Base Report attached to the Credit Agreement as Exhibit D is hereby amended by deleting such form in its
entirety and substituting the form attached hereto as Exhibit A in its place. 
 8. In connection with the execution of
this Fifth Amendment, and as a condition precedent hereto, Borrowers shall execute and / or deliver to Lender the following on the date hereof: 
  

	 	(a)	A Third Amendment to Second Amended and Restated Revolving Credit Note dated July 28, 2011 from Borrowers to Lender (as the same may from time to time be amended,
restated, modified or otherwise supplemented, the “Third Revolving Credit Note Amendment”), amending the Second Amended and Restated Revolving Credit Note dated April 19, 2010, First Amendment to Second Amended and Restated
Revolving Credit Note dated November 18, 2010 and Second Amendment to Second Amended and Restated Revolving Credit Note dated May 31, 2011, in each case, from Borrowers to the order of Lender (as the same may from time to time be amended,
restated, modified or otherwise supplemented, collectively the “Original Revolving Credit Note”). The Third Revolving Credit Note Amendment is incorporated herein by reference, made a part hereof and shall be substantially in the
form of Exhibit B attached hereto. References to “Revolving Credit Note” in the Credit Agreement are hereby amended so that such term includes the Original Revolving Credit Note, the Third Revolving Credit Note Amendment and any
amendments, modifications or replacements of the same. 

  

	 	(b)	Such resolutions, certificates, written opinions of Borrowers’ independent counsel and other instruments, documents, agreements, information and reports as may be
reasonably requested by Lender, in form and substance reasonably satisfactory to Lender. 

 9. Borrowers shall be
responsible for paying all Expenses incurred by Lender in connection with this Fifth Amendment pursuant to Section 8.5 of the Credit Agreement. 
 10. Borrowers hereby represent and warrant that no Event of Default or Unmatured Event of Default has occurred and continues to exist under the Credit Agreement and the other Loan Documents and that all
representations and warranties in the Credit Agreement and the other Loan Documents are reaffirmed to be true and correct as of the date hereof, which representations and warranties shall survive execution of this Fifth Amendment. 

11. Borrowers have previously delivered to Lender all of the relevant organizational and governing documents and agreements of Borrowers
and all such documents and agreements remain in full force and effect and have not been amended or modified since they were delivered to Lender. 

  
 3 








 12. Except as specifically amended herein, the Credit Agreement shall remain in full force
and effect as originally executed. Except for any specific waiver set forth in this Fifth Amendment, nothing herein shall be deemed to be a consent to a waiver or amendment of any covenant or agreement contained in the Credit Agreement or the other
Loan Documents and all such other covenants and agreements contained in the Credit Agreement and the other Loan Documents are hereby confirmed and ratified in all respects and shall remain in full force and effect in accordance with their respective
terms. 
 13. This Fifth Amendment shall be binding on the successors and assigns of the parties hereto. 

14. This Fifth Amendment may be executed in any number of counterparts, each of which when so executed shall be deemed to be an original
and all of which when taken together shall constitute but one and the same agreement. 
 [Signature Page Follows]


  
 4 








 IN WITNESS WHEREOF, the parties have executed this Fifth Amendment as of the day and year
first set forth above. 
  

			
	BORROWERS:
	
	Green Plains Grain Company LLC
		
	 By:
	 	     /s/ Todd Becker

		 	Name: Todd Becker
		 	Title:   President and Chief Executive Officer
	
	Green Plains Grain Company TN LLC
		
	 By:
	 	     /s/ Todd Becker

		 	Name: Todd Becker
		 	Title:   President and Chief Executive Officer
	
	LENDER:
	
	First National Bank of Omaha
		
	 By:
	 	     /s/ Kenneth Feaster 

		 	Name: Kenneth Feaster
		 	Title:   Vice President



  
 5 








 EXHIBIT A 
 Borrowing Base Report 







 EXHIBIT B 
 Third Revolving Credit Note Amendment