The headquarters of the National Oil Corporation in Tripoli are gleaming, the floors marble, the offices decked out with black leather chairs and fake flowers. It seems far from the fighting going on over oil terminals around the country.

But the man in charge looks at production and knows the future is bleak.

"We cannot produce. We are losing 80 percent of our production," says Mustapha Sanallah, the chairman of Libya's National Oil Corporation.

He looks like a typical executive, decked out in a suit and glasses. But beneath his calm veneer, he's worried.

"Now we have two problems: low production and low price," he says.

At the current rate, he expects that the country won't even earn 10 percent of the budget money Libya had in 2012, before militias started taking oil infrastructure hostage.

"If there is security in Libya, we can resume production within a few days," Sanallah says.

If there's one thing that has a chance of keeping Libya from totally falling apart, it's oil. It provides nearly all the country's revenue. It's what militias are fighting over. And it's the prize coveted by the two rival governments — one in Tripoli, the other in Libya's east — that claim to be running the country.

The Tripoli faction is seen as Islamist, the eastern government as anti-Islamist — but the fighting is mainly over turf and resources like oil, rather than ideology.

The international community has recognized the eastern government, but it opposes what it sees as the east's divisive attempt to set up a rival national oil company and take control of the industry, something Sanallah says is impossible anyway.

"We are still the NOC [National Oil Company]; the legal NOC is here. I am the chairman of NOC," he says. "[The east] nominated a new chairman of NOC, but there's no staff, there's no people, there's no hardware, there's no software."

International mediators are trying to keep the oil company independent of either side, but oil fields are under attack. One tanker was bombed, and another one was threatened.

Sanallah says he wants to keep oil out of the fight.

"I hope so. I hope so," he says — but he doesn't sound convinced.

His employees are fighting fires at major oil terminals, and with no real security forces, it only takes a few gunmen to shut things down or hold them hostage.

"I think the message was clear to the oil company: There is no security, good security. Otherwise a few people cannot control the vein of the blood of Libya," he says.

And with the terminals closing, Libya's battered economy is taking even more blows because foreign oil companies are pulling out. Libya is only producing about 330,000 barrels a day, increasing the economic burden.

"When you are closing the terminals, it means you cannot produce oil, and if you cannot produce oil, then you cannot produce gas. So we are making up the gas by importing diesel. This is another burden on the shoulders of NOC," he says.

Again, oil is basically what pays for any central Libyan government. How much? "All — 90 to 95 percent. There is no revenue but oil," he says.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.