Source: DonkeyHotey.

In less than eight months from now, voters will head to the polls for the 2014 midterm elections. The results of this election will help shape U.S. policies for at least the next couple years, and looking at recent polls, this election is a dead heat.

Few investors have more to gain or lose from this election than those of Fannie Mae (FNMA -6.96%) and Freddie Mac (FMCC -6.62%). With this in mind, it's time to evaluate a few election scenarios and their effects on these companies.

What we know
No matter your political opinions on President Obama, he's sticking around through the 2014 midterms since he's not up for election. Obama's position favors a wind-down of Fannie and Freddie and their replacement by a new government entity to provide insurance to residential mortgages.

He has noted his support for the Corker-Warner bill, which is nearly identical to the latest Johnson-Crapo proposal, and has also noted an intention to replace the GSEs as part of housing reform. If a bill like this came to his desk, it would be expected to receive the chief executive's signature, thereby dealing a major setback to Fannie and Freddie shareholders.

But to get a piece of legislation to Obama's desk, it will first need to pass both houses of Congress, and that's why the midterm elections matter.

Scenario: Democratic Senate, Republican House
This scenario has a fairly good chance of happening based on current polls and results from past elections. A Washington Post/ABC News poll gave the democratic candidate a 1% advantage in the generic House and Senate races; an amount well within the margin of error signaling a close race.

In 2012, Congressional district boundaries gave republicans the edge in the House where the GOP retained control despite democrats getting more than one million more combined votes in House elections. So with the Senate race so close and republicans holding the advantage in House elections based on districts, a democratic senate and republican house is one of the most likely scenarios.

With this outcome, political alignments would be very similar to present ones. Legislation similar to the Johnson-Crapo proposal would have a reasonable chance of passing the Senate with bipartisan support, but it would find House support difficult as House republicans are opposed to such a government role in housing.

Since housing reform legislation would need passage of both the Senate and House, a democratic senate and republican house looks to keep housing reform gridlocked for the near term.

Scenario: Republican Senate, Republican House
This is another one of the most likely scenarios. As mentioned in the last scenario, district alignments give republicans the edge for retaining control of the House while the Senate remains a dead heat.

If republicans can take the senate, legislation like the Johnson-Crapo proposal could become even more difficult to pass since the proposal is centered on the creation of a federal housing entity -- an idea opposed by most republicans.

With the House and Senate both under republican control, there is a possibility Congress could send a bill to the president. However, republican positions on housing reform have major differences from the president's own position, and a republican-written bill would have little chance of obtaining Obama's signature.

This situation likely produces more delay for any wind-down of Fannie and Freddie and, like the first scenario, gives the courts more time to weigh in on the future of the GSE investors.

Scenario: Republican Senate, Democratic House
This scenario seems far less likely since it would require the democrats to lose the race seen as closer and win the one that's more of an uphill battle. But even if it did happen, the divided government here would make passage of a housing reform bill difficult.

The only way a housing reform bill passing in this situation is with a slim republican Senate majority that creates a largely bipartisan bill that can also win over democrats in the House. However, this election scenario is unlikely, and even if it did happen, gridlock could still have a good chance.

Scenario: Democratic Senate, Democratic House
Past trends make this scenario seem less likely as the party controlling the executive usually has a disadvantage in midterm elections. But with a sweep by the democrats, Fannie and Freddie investors could come under threat.

If bipartisan legislation similar to the Johnson-Crapo proposal can pass the Senate, the House would not have the same principled objection to such a federal role in the housing market. And with support of the ideas behind Johnson-Crapo indicated by Obama, this bill could get Congressional and presidential approval.

But with the current polls showing such a close race, the democrats would have to pull ahead and buck historical trends for this to happen. With so much time between now and election day, I won't rule this scenario out, but I wouldn't count on it either.

Investing in gridlock
Blame whoever you want for Congressional gridlock, but one key beneficiary of the disagreement are investors in Fannie Mae and Freddie Mac. For over five years, these investors have watched as the GSEs have changed from cash burners to cash cows.

Now with lawsuits to return Fannie and Freddie to their investors making their way through the courts, the best things GSE investors can hope for is more gridlock in the years ahead. And looking at the most likely outcomes from the 2014 midterm elections, gridlock may very well continue to be the name of the game.