Image copyright Getty Images Image caption Bringing the Withdrawal Agreement Bill to Parliament is the last roll of the dice for the prime minister

Labour has finally pulled the plug on the Brexit talks with the government, at the end of a week in which they appeared to be on life support.

So is it, as some suggest, time to read the last rites on Theresa May's Withdrawal Agreement Bill?

Let's be clear - it will be challenging, to say the least, for the legislation to get through the Commons.

But reports of its demise may well have been exaggerated. It may not go down to immediate defeat. And this is why.

Fight another day

A leaked memo from the government side, not agreed by Labour or the cabinet, contained a wheeze that could have been attractive to both leaderships.

Even before the Withdrawal Agreement Bill makes its appearance, the memo suggested there could be a "free vote" in Parliament on another referendum.

This is rather different from what the shadow Brexit secretary, Sir Keir Starmer, was suggesting - that there ought to be a "confirmatory" vote, as part of a package, on any agreed deal.

The leaders of both the main parties aren't keen on another public vote, to say the least. So a stand-alone Commons vote on the issue, divorced from the deal, would be more likely to go down to defeat - as it has on previous occasions.

Jeremy Corbyn could say to People's Vote supporters in his ranks: "Oh, I did try for a referendum, but oops, it didn't work - so now let's just leave with the best possible deal."

But it would seem that this approach has been scuppered by Labour's wider negotiating team and, presumably, by the cabinet. I have had a strong steer that this proposal in the leaked government memo won't go ahead in this form.

End of the line?

But this might not be the setback it seems for the prime minister because supporters of another referendum may have no option but to vote initially for her bill.

There will be a vote at what's called, in parliamentary speak, second reading in the first week in June. If the prime minister is defeated at this point, it's basically the end of the road for her deal and her premiership.

Image copyright EPA Image caption Theresa May's immediate fate could be in the hands of Labour MPs

But if MPs vote for the bill at second reading, they then get an opportunity to change it - and that would include an amendment on another referendum.

So it's not impossible that some people who hate Theresa May's deal give it their temporary backing so they can discuss improving it, or putting it to a public vote.

Talks with Labour are over - but efforts to win over individual Labour MPs are not. Note the wording of Downing Street's statement that "complete agreement" hasn't been reached.

So expect to see some incentives in - or around - the Brexit bill for opposition MPs to back the government. For example, a commitment to stay in step with the EU on workers' rights and environmental protection.

Labour of love

Allies of Sir Keir have blamed the breakdown of the talks on the PM's inability to get a customs union compromise past her cabinet.

But if she keeps Conservative MPs on board in the legislation by eschewing a customs union but delivers a "comprehensive" (trust me, this word is important to some Labour MPs) temporary arrangement to last until the next election, some soft opposition to her deal may crumble.

Then there is the argument put forward by the former Conservative minister Nick Boles, echoed off the record by some in Downing Street.

If the prime minister's bill gets shot down in flames there is no other readily available vehicle to prevent the default option of no deal. Indeed, No 10 insiders expect to see "vociferous" arguments for no deal if Theresa May's legislation falls.

Some unions, such as the GMB and Unison, favour another referendum. But the leadership of Unite, which is closest to Mr Corbyn, essentially favours leaving with a deal - and Labour MPs will be made well aware of this.

So even if Labour formally opposes the bill at second reading, there could be a sizeable rebellion from those former Remainers representing Leave areas - safe in the knowledge that they wouldn't exactly be upsetting some powerful forces in the party.

And the MPs who support what's called Common Market 2.0 could be crucial to the outcome. These are, broadly speaking, Labour MPs who are neither Corbynistas nor in favour of another referendum - such as Lucy Powell and Stephen Kinnock - and they are very keen to avoid no deal.

However, if the Labour whip is to oppose, expect it to be rigorously enforced irrespective of the views of the party leader's office. So Mrs May's immediate fate may still be in the hands of opposition MPs

Don't tell anyone

The forthcoming leadership contest may firm up opposition to Theresa May's bill on the Conservative benches

By putting the Withdrawal Agreement Bill out of its misery almost as soon as it appears, the prime minister's critics know she will vacate office sooner rather than later.

But some candidates will be keener for her to get Brexit over the line, even with a less than optimal deal, so they don't immediately get bogged down with difficult votes. It would also allow them to make their pitch based on the future relationship with the EU.

So could some of their supporters - irrespective of their public criticism of the deal - quietly vote to get it over the line?

Set against all this, there is plenty of analysis in the public domain which will tell you how impossible it is for a deal to go through.

But right now, No 10 might well see "highly improbable" as grounds for optimism. Hope dies last, does it not?