If Congress fails to increase the debt ceiling before October, the federal government could struggle to pay nearly 25% of the country's bills for the month.

And those owed money would face increasing delays in getting paid.

That's according to a new analysis by the Bipartisan Policy Center.

Treasury Secretary Steven Mnuchin would face a host of chaotic, legally questionable, and technically difficult decisions of who to pay on time and who to put off until lawmakers act.

The reason: Without an increase or suspension of the debt limit, the Treasury Department would lack legal authority to resume borrowing. And because the government spends more than it takes in, it must borrow to make up the difference.

"Due to the unpredictability of cash flows," the bipartisan think tank said, "policymakers would need to act in advance of October if they intend to ensure that all obligations of the U.S. government are paid in full and on time."

Defaulting on any U.S. legal obligations is a treacherous prospect without real precedent. Markets likely would buck, and if the impasse isn't resolved quickly, the economy would suffer.

Absent action on the debt ceiling, the Bipartisan Policy Center calculates that Treasury would fall short by $80 billion in October, meaning it couldn't pay 23% of all its bills for that month.

That assumes that the so-called X date hits on October 2. The X date is the first day that Treasury won't have enough money on hand to pay all the bills due that day.

The exact X date is unknown, since it's not clear yet how much revenue will flow into Treasury in September. The Bipartisan Policy Center and the Congressional Budget Office have estimated it will occur between early and mid-October.

When it does, one thing is very certain. "On a day-to-day basis, handling all payments for important and popular programs (e.g., Social Security, Medicare, Medicaid, defense, military active duty pay) would quickly become impossible," the report notes.

The choices facing Mnuchin would be unpalatable.

Say he chose to pay what the government owes bond holders, Social Security and Medicare recipients, the military, defense contractors and education programs for October -- that's a total of $267 billion. He still wouldn't be able to pay tax refunds, federal workers, veterans benefits, health and human services grants and other bills coming due.

It shouldn't have to come to that. Republican leaders keep promising that the debt ceiling will be raised in time. But their caucus can't agree on how to do so.

Related: What if lawmakers or Trump fail on the debt ceiling?

Among their disagreements is whether to pass a "clean" debt ceiling increase -- meaning no other measures are attached to the bill -- or tie any increase to spending cuts that many conservatives are calling for.

If they can't resolve their differences, House Speaker Paul Ryan and Senate Majority Leader Mitch McConnell will have to lean on Democrats to get an increase or suspension of the debt ceiling across the finish line. Then, President Trump must sign the bill.

Trump tweeted about the issue Thursday morning.

"I requested that Mitch M. & Paul R tie the Debt Ceiling legislation into the popular V.A. bill (which just passed) for easy approval. They didn't do it so now we have a big deal with Dems holding them up (as usual) on Debt Ceiling approval. Could have been so easy-now a mess!"

...didn't do it so now we have a big deal with Dems holding them up (as usual) on Debt Ceiling approval. Could have been so easy-now a mess! — Donald J. Trump (@realDonaldTrump) August 24, 2017

Never mind that attaching an increase to the Department of Veterans Affairs bill could have caused conservatives to balk and jeopardized passage.

Despite the fracas, the expectation is still that lawmakers will avert default.

Nevertheless waiting until the last minute has a cost. Past debt ceiling showdowns raised the country's borrowing costs by hundreds of millions of dollars because investors hate uncertainty. It's starting to happen again.

And just this week, the credit ratings agency Fitch said it would review the United States' sterling AAA credit rating "if the debt limit is not raised in a timely manner prior to the so-called 'X date.'"

In the wake of the 2011 debt ceiling crisis, S&P stripped the country of its AAA rating, citing what it said was a decrease in the stability of America's governance and policymaking.

-- CNN's Ted Barrett contributed to this report.