LONDON (Reuters) - Prime Minister Theresa May must win a vote in parliament on Dec. 11 to get her Brexit deal approved or risk seeing Britain’s exit from the European Union descend into chaos four months before it is due to leave.

To try to get that approval, May and her ministers will spend five days debating the issue in parliament, where they will have to overcome opposition from across the political spectrum, and defeat attempts to alter or delay her Brexit process or derail it altogether.

Here’s how the voting will work:

WHO?

The debate will take place among the 650 elected lawmakers in the lower house of parliament, the House of Commons. May does not have an outright majority in the house, and the DUP, the small Northern Irish party that usually props up her government, is opposed to the deal.

WHEN?

The debate is scheduled for Dec. 4, 5, 6, 10 and 11. Each day’s debate will last up to eight hours, with start and finish times likely to vary.

The final day’s debate is expected to end at 1900 GMT, when the process of voting on amendments to the government’s motion, and then the final motion, will begin, according to the opposition Labour Party.

WHAT?

The debate will be on whether to approve a motion stating that parliament has approved the Withdrawal Agreement - a legal text setting out the terms of departure - and a separate political declaration outlining the long-term relationship Britain will have with the EU.

WHAT ARE AMENDMENTS?

Lawmakers will be able to put forward amendments to this motion in writing ahead of the debate. John Bercow, the Speaker of the House, chooses no more than six of these amendments for debate on the final day, which will be voted on unless the proposers opt to withdraw them.

If approved, these amendments would not bind the government to comply with them, but would be politically hard to ignore and could dictate May’s next steps.

Amendments likely to be up for debate include making ratification of the deal contingent on the government agreeing to a second public referendum, or altering the terms of the deal to keep Britain in a customs union.

The opposition Labour Party has submitted an amendment designed to ensure that the government cannot, under any circumstances, leave the EU without an exit agreement, and must consider all alternatives to doing so.

Ministers have expressed concerns that if any amendment is passed by parliament, it could prevent the deal being ratified because the final vote may not then provide the legally necessary clear and unequivocal approval of May’s deal.

The amendments will be voted on before the deciding ballot on whether to approve the original motion - meaning May has to win a series of votes, rather than just one, each with the potential to scupper her plan.

HOW WILL THE RESULT BE ANNOUNCED?

Once the debate is finished, the speaker will typically ask those in favor of each amendment to shout “aye”, and then those against to say “no”. As long as some lawmakers shout “no”, the speaker will call for a formal vote, known as a division.

Votes are registered by lawmakers walking through different doorways, out of sight of television cameras and onlookers. Once the headcount is complete - which can take up to 15 minutes - lawmakers return to the debating chamber.

Four appointed tellers will assemble in front of the speaker, and one will read the result out loud.

Once all the amendments have been voted upon, the main motion is put to a vote using the same process.

WHAT HAPPENS IF SHE LOSES?

By law, if the deal is rejected, ministers have 21 days to state how they intend to proceed. The government has previously said that if the agreement is rejected, Britain will leave the EU without a deal.

The reality is that the huge uncertainty in the world’s fifth largest economy and the likely adverse reaction of financial markets would demand a much quicker political reaction.

For more on possible next steps, see: