The largest clothing manufacturer in North America is hanging by a thread.

American Apparel, less than nine months after emerging from Chapter 11 and losing sales and bleeding cash, has been slashing payroll at its Los Angeles factory — but it may not be enough to keep it afloat through the holidays.

Working with a restructuring expert, the company, famous for its provocative ads and Made in the USA apparel, has had talks with licensing firms and could agree to be sold in a deal that would precipitate another trip through bankruptcy court.

That the once-thriving apparel maker is flailing so soon after reorganization is a black eye to US manufacturing. Whispers around Los Angeles suggest that the company will soon exit its downtown factory, once home to 4,000 jobs, and either drop manufacturing altogether or move to a state where labor is less expensive — say, North Carolina — where it would contract out its work.

While presidential candidates Hillary Clinton and Donald Trump talk about wooing manufacturing jobs back to the US, the largest domestic apparel maker can’t make a go of it.

“The city couldn’t care if the garment manufacturing industry leaves,” Ilse Metchek, president of the California Fashion Association, told The Post. “It wants to use industry space for high-tech and biotech industries.”

American Apparel founder and ousted chief executive Dov Charney told The Post that, with the company’s sales downturn, it is “hard to see how they support the manufacturing operation.”

While Charney’s views could be dismissed as those of a jilted founder — one openly hostile to the company since being pushed out — even the local union has stopped trying to organize the company and the factory’s owner is looking to move on.

American Apparel’s headquarters at 747 Warehouse St. is part of a 30-acre development project called Row DTLA, which is being marketed as a destination for “art and culture.” The company’s lease is up in 2019 and its landlord, Atlas Capital Group, is not interested in renewing, according to sources familiar with the situation.

A spokesperson for Atlas declined to comment.

The once-hip teen retailer founded by Charney is being eyed now by licensers, including Authentic Brands Group and Sequential Brands Group, according to sources.

American Apparel would not be the first to leave LA, where the minimum wage will hit $15 an hour by 2020.

There are fewer than 200,000 indirect and direct apparel workers in LA, down from 300,000 in 1995, according to the CFA.

This year alone, the number of active sewing machines shrank by 4,500, to 25,500, Metchek said, and the number of labor-intensive denim jobs is declining as well. About 60 percent of the denim industry in LA has left for Mexico, Texas and other lower-wage areas over the past five years, with another 10 percent of the industry “thinking about leaving,” Metchek said.

“We started to move to Mexico from LA five years ago,” said Jamie Gorman of Only Nine Apparel, “and since the past 18 months, we don’t have anything left in LA.”