Portugal’s stunning comeback in a 2-2 draw Sunday night denied the United States not only its second win of group play but also, for now, a place in the round of 16.

Every member of Group G now enters Thursday’s round-robin finales with something to play for, as you can see.

Below are the various scenarios under which the United States, which plays Germany at noon Thursday, can advance out of the group stage. Remember that a win is worth three points, a tie one and a loss none.

WIN

A win over Germany would secure first place in Group G and passage to the round of 16. The United States would face the second-place finisher in Group H. Belgium leads the group with six points and will face South Korea (one point) Thursday while Algeria (three points) plays Russia (one point).

TIE

A tie with Germany would send both teams to the round of 16. Because of goal differential, the United States would finish second and face the winner of Group H.

LOSS

A loss to Germany would leave the United States’ fate in the hands of Portugal and Ghana, which also face off at noon Thursday.

A Portugal-Ghana tie would give both teams two points overall, two short of the U.S. total of four, sealing the United States’ place in the round of 16.

A Ghana win would introduce all kinds of tiebreaking variables. With both teams having four points overall, goal differential would be used to determine which team advances. The United States has a plus-one margin, Ghana a minus-one. If the United States were to lose to Germany, 2-0, Ghana would need to win by only one to advance.

In the case of equal goal differentials, goals scored would be the next tiebreaker.  The United States has four goals so far, Ghana three.

In the case of equal goals scored, head-to-head results would be used, with the United States advancing based on its earlier 1-0 win over Ghana.

A Portugal win, meanwhile, invokes the same tiebreakers but affords the United States greater wiggle room. Because Portugal has a minus-four goal differential, it would need a big win and big U.S. loss to clear the five-goal margin.

In the unlikely event that all U.S.-Portugal tiebreakers are exhausted, because of Sunday’s 2-2 tie, the teams would draw lots. The luckiest team moves on.