General Motors Co plans to file its registration for an initial public offering during the week of August 16, just after the expected date for its second quarter results, according to two people with direct knowledge of the preparations.

A GM filing with the U.S. Securities and Exchange Commission would be the first step toward an IPO to reduce the U.S. government's ownership in the automaker after a $50 billion bailout in 2009.

By filing with the SEC in August, GM is aiming to complete its IPO before the November U.S. elections, according to the sources, who asked not to be named because the closed-door preparations remain confidential.

GM also remains in talks with Bank of America Corp, JPMorgan Chase & Co, and Wells Fargo & Co for dealer and consumer financing for more credit-worthy borrowers, one of the sources said.

One concern for potential investors has been whether GM dealers and potential car buyers have the same kind of access to financing as competitors with in-house financing operations like Ford Motor Co.

General Motors on Thursday said it would buy auto finance company AmeriCredit Corp for $3.5 billion in cash to form what it called the core of a captive finance operation. The move marks a reversal of the position GM took when it sold control of its former in-house financing arm GMAC in 2006.

Any additional financing partnership agreement GM reaches would be complementary to the AmeriCredit transaction, one of the sources said. Many GM dealers have complained that lack of consumer financing has cost them sales.

An IPO for the U.S. automaker, which was restructured in bankruptcy last year, would be the biggest U.S. stock offering since Visa Inc's $19.7 billion March 2008 IPO and one of the biggest IPOs of all time.

GM's second-quarter earnings report is expected to show the automaker generated cash for a second consecutive earnings period, according to one of the sources.

GM Chief Financial Officer Chris Liddell told CNBC on Thursday that the automaker would report results in about three weeks.

GM spokeswoman Renee Rashid-Merem told Reuters on Thursday the automaker would report second quarter results in mid-August.

Beyond that, we aren't commenting on matters relating to an IPO. We will launch an IPO when the conditions are right and the company is ready, she said.

U.S. officials have said repeatedly that GM's board of directors have a free hand to run the company to try to improve the return for taxpayers.

The automaker posted its first quarterly profit since 2007 in the first quarter. In the June-ended quarter, industry-wide U.S. auto sales were above 11 million vehicles on an annualized and adjusted basis.

But GM's lower cost structure coming out of bankruptcy has allowed the automaker to break even with industry-wide U.S. sales as low as about 10.5 million vehicles, the sources said.

UAW, CANADA SALES PROPORTIONAL

GM's biggest shareholder is the U.S. Treasury, which owns nearly 61 percent of the automaker. The Treasury is expected to sell between 20 and 24 percent of its stake, sources said earlier this month.

The United Auto Workers healthcare trust, which owns 17.5 percent of GM, and the governments of Canada and Ontario, which own 11.7 percent, are expected to sell the same share of their holdings as the U.S. government, one of the sources said on Thursday.

GM, which is not expected to pay dividends on its newly-issued common stock, also plans to sell $3 billion worth of mandatory convertible securities, a source said earlier this month.

The U.S. automaker also is in the process of finalizing a $5 billion revolving credit line, several sources have said.

(Reporting by Clare Baldwin in New York and Soyoung Kim in Detroit, additional reporting by Kevin Krolicki in Detroit; editing by Carol Bishopric)