By Alexandra Ulmer and Diego Oré

CARACAS (Reuters) - Polarized Venezuela heads to the polls this weekend with a punishing recession forecast to rock the ruling Socialists and propel an optimistic opposition to its first legislative majority in 16 years.

Founded by the late Hugo Chavez, the Socialists' long mighty "Chavismo" movement is facing public ire over shortages of goods from medicines to milk and the world's worst inflation under his successor, President Nicolas Maduro.

Defeat for "Chavismo" at Sunday's vote would give the opposition a major platform to combat Maduro and deal a further blow to Latin America's left after Argentina swung to the right in last month's presidential election won by Mauricio Macri.

If the opposition coalition wins a majority in Venezuela's 167-seat National Assembly, it hopes to reduce the Socialists' hegemony and tackle what it deems mismanagement, corruption and authoritarianism during their nearly 17-year rule.

That could bring confrontation given the combative president's strong executive powers and institutions from the Supreme Court and the central bank that are pro-government.

After a heated election run-up marked by insults and gunshots, Maduro was winding up his campaign on Thursday with a street rally of red-shirted supporters while the opposition was holding a concert in affluent east Caracas.

Maduro has warned Venezuelans against betraying Chavez by voting for what he paints as a U.S.-backed elitist clique that would abolish welfare programs.

"Imagine if they dominated the National Assembly. I wouldn't allow it, I swear, I wouldn't let my hands be tied by anyone. I'd take to the street with the people," he roared this week.

The former bus driver and union leader elected in 2013 after Chavez died of cancer has been on state TV every day in rallies across Venezuela's plains, Andes, Caribbean coast and cities.

But in nearly every corner of the OPEC member country, anger is mounting, especially among the poor, the leftist government's traditional bedrock of support, now worst hit by long queues for food and inflation that annihilates incomes.

Story continues

"I'm exhausted. This is a disaster," said pregnant student Dexy Mejia, 21, who has to cue overnight for scarce diapers in Chavez's sweltering savannah hometown of Sabaneta.

Yet "Chavismo" still commands devotion among many, and with Socialist candidates invoking the deceased president in speeches, songs, and dances, some, including Mejia, were on the fence about whom to support on Sunday.

WHAT KIND OF MAJORITY?

With one prominent recent poll showing that 55.6 percent of Venezuelans plan to back the opposition and 36.8 percent the government, analysts say the main issue appears to be not whether the opposition will win but by how much.

With a simple majority, the opposition can pass amnesty laws to try to free incarcerated politicians, embarrass the government with investigations, and wield budget approval.

With three-fifths, it could theoretically fire ministers after a censure vote, and with two-thirds it could try to shake up Chavista-dominated courts and other institutions.

No-one, though, expects "Chavismo" to roll over easily against hated opponents it has outwitted again and again since Chavez's first 1998 presidential win.

"If the result is close, the government could be tempted to sort of barricade the new National Assembly, to use the control it has over the Supreme Court, the state prosecutor, the ombudsman's office, to try to block it off," Democratic Unity coalition head Jesus Torrealba told Reuters.

Opposition hardliners want to use a potential victory to push for a recall referendum next year against Maduro, whose six-year term ends in 2019.

With many rank-and-file "Chavistas" grumbling that Maduro has destroyed his popular predecessor's leftist project, defeat could worsen fissures within the Socialist Party, once united under the charismatic and domineering Chavez.

However, electoral district geography and superior campaign resources favor the government, and officials mock the opposition for premature triumphalism.

Even if the opposition wins, it would largely be reaping the fruits of discontent, as it has yet to coalesce around a leader, articulate economic reforms or connect with poor Venezuelans.

"I belong to the revolution. I don't know the opposition, and they don't know me," said shopkeeper Nataly, 24, who is nevertheless upset at queues, inflation and crime.

"I'm still thinking about it. I'll decide when I go vote."

(Editing by Andrew Cawthorne and James Dalgleish)