financial reporting purposes and the amounts used for income tax purposes, as well as the tax effect of carryforwards. We have recorded a $10.2 million valuation allowance in the U.S. against certain tax credits and state net operating losses due to the uncertainty of their realization. Realization of our net deferred tax assets is dependent on future taxable income. We believe it is more likely than not that such assets will be realized; however, ultimate realization could be impacted by market conditions and other variables not known or anticipated at this time.
Liquidity and Capital Resources
We had $271.1 million in unrestricted cash and cash equivalents at September 30, 2021, in addition to $0.8 million in restricted cash. Management believes that maintaining a strong cash balance is necessary to provide funding for potential ramps in our business which can require significant cash investment to meet sudden demand. Additionally, we are using cash in our 2021 stock repurchase program and are considering both organic and inorganic opportunities to drive future growth, for which cash resources will be necessary.
Our liquidity is affected by many factors. Some of these relate specifically to the operations of our business, for example, the rate of sale of our products, and others relate to the uncertainties of global economic conditions, including the availability of credit and the condition of the overall semiconductor equipment industry. Our established cost structure, other than cost of goods sold, does not vary significantly with changes in volume. We experience fluctuations in operating results and cash flows depending on these factors. Stock repurchases, as discussed below, also reduce our cash balances.
During the nine months ended September 30, 2021 and 2020, we generated $112.1 million and $75.7 million, respectively, of cash related to operating activities.
Investing activities for the nine months ended September 30, 2021 and 2020 resulted in cash outflows of $5.7 million and $5.6 million, respectively, used for capital expenditures.
Financing activities for the nine months ended September 30, 2021 resulted in a cash usage of $40.7 million. During the first nine months of 2021, $37.5 million in cash was used to repurchase our common stock and $6.5 million was used for payments to government tax authorities for income tax withholding on employee compensation arising from the vesting of RSUs, where units are withheld by the Company for taxes, as well as $0.6 million relating to the reduction of the liability under the finance lease of our corporate headquarters. These amounts were partially offset by $3.9 million of proceeds from the exercise of stock options and purchase of shares under our 2020 ESPP during the first nine months of 2021. In comparison, financing activities for the nine months ended September 30, 2020 resulted in cash usage of $3.4 million, $7.5 million of which related to the repurchase of our common stock and $3.9 million related to payments made to government tax authorities for income tax withholding on employee compensation arising from the vesting of RSUs, as well as $0.3 million relating to the reduction of our financing lease liability. These amounts were partially offset by $8.3 million of proceeds related to the exercise of stock options and purchase of shares under our prior employee stock purchase plan during the first nine months of 2020.
Under the rules of the U.S. Securities and Exchange Commission (the “SEC”), we qualify as a “well-known seasoned issuer,” which allows us to file shelf registration statements to register an unspecified amount of securities that are effective upon filing. On May 29, 2020, we filed such a shelf registration statement with the SEC for the issuance of an unspecified amount of common stock, preferred stock, various series of debt securities and/or warrants to purchase any of such securities, either individually or in units, from time to time at prices and on terms to be determined at the time of any such offering. This registration statement was effective upon filing and will remain in effect for up to three years from filing, prior to which time we may file another shelf registration statement to maintain the availability of this financing option.
On July 31, 2020, we entered into a Senior Secured Credit Facilities Credit Agreement (the “Credit Agreement”) with Silicon Valley Bank. The Credit Agreement provides for a revolving credit facility in an aggregate principal amount not to exceed $40.0 million. Our obligations under the Credit Agreement are secured by a security interest, senior to any current and future debts and to any security interest, in all of our rights, title, and interest in, to and under substantially all of our assets, subject to limited exceptions, including permitted liens. The revolving credit facility terminates on July 31, 2023. As of September 30, 2021, we were in compliance with all covenant requirements of the Credit Agreement. As of such date, no borrowings had been made under the Credit Agreement, although a letter of credit for $5.9 million reduces the funds available for borrowing under the credit line. We have no immediate plans to borrow under the Credit Agreement, but