It is the biggest “what if?” after a dramatic year in politics: if David Cameron had delayed his EU referendum until after the US Presidential election, would Britain have voted to stay in the EU?

Cameron is unrepentant about calling the referendum, telling an audience in Indiana two weeks ago the Europe issue had to be resolved because it was “poisoning” British politics and the Conservative Party. His closest ally George Osborne disagreed, warning him prophetically in 2012 that a referendum would unleash uncontrollable “anti-government sentiment, opportunism, genuine concern – and then you lose.”

Cameron didn’t have to hold the referendum this year; the law he pushed through gave him until the end of 2017. He was so confident of repeating his success at the 2014 Scottish referendum and 2015 election that he gambled on securing a quick EU deal and relatively short referendum campaign. He judged that French and German elections in 2017 would complicate his renegotiation of Britain’s EU membership terms, and tried to bounce his EU counterparts into concessions.

Theresa May refuses to rule out making payments to the EU after Brexit

With hindsight, it would have been much better to play it long. Although Nigel Farage believes the Brexit vote in June paved the way for Donald Trump’s election in November, it is unlikely to have made much difference; Americans were not going to install Hillary Clinton in the White House.

Trump’s arrival on the world stage would have transformed Cameron’s prospects of winning the EU referendum. With a cloud of uncertainty hanging over the UK-US relationship, I can hear Cameron telling voters: “Now is not the time to walk away from our alliance with our European neighbours and closest trading partners.” A Trump victory might have made Cameron less hubristic, try harder for an EU deal and work more closely with Remainers in other parties rather than dictate the referendum campaign from Downing Street.

Similarly, EU leaders would surely have adopted a different attitude towards the British renegotiation. With Trump threatening to weaken NATO, Europe would become more dependent on the UK for its security. EU leaders, who never believed that the British people would vote to leave their club, might have been shaken out of their complacency by Trump’s win.

If Cameron were now in the middle of his renegotiation ahead of a 2017 referendum, his EU counterparts would have seen the rise of populists in Italy, France and the Netherlands as well as the US, and would be taking the prospect of a Brexit vote more seriously. Crucially, they might realise that, to preserve their cherished EU project and halt the populists' march, they need to reform EU rules on free movement.

So Cameron might have got what he really wanted from the renegotiation – an emergency brake allowing the UK to call a temporary halt to EU migration, which he did not even ask for because Angela Merkel made clear it was off limits. An emergency brake might have been an EU-wide measure but could have been hailed by Cameron as a major victory. It would have protected his Achilles heel in the referendum campaign – that he had nothing to say about immigration. It might even have persuaded some newspapers who backed Leave to reluctantly support Remain.

A longer referendum campaign delayed until 2017 would have given the Remain camp longer to make the case for EU membership and counter 30 years of poisonous headlines since the Thatcher era. It is not impossible that the result would have been 52-48 to Remain rather than Leave.

At one level, this is academic and irrelevant to the task facing Theresa May – making Brexit work. But she might be able to salvage something positive out of the ashes of Cameron’s failed renegotiation. Because Britain is walking out, EU leaders insist that their “four freedoms,” including free movement, are non-negotiable if the UK wants single market access. Yet despite this tough rhetoric, things are changing quietly. The European Commission is proposing new curbs on access to social security benefits, saying that no migrant should have a “legal right to residence” if they do not work or actively seek a job. The rising terrorism threat, which has now spread from France and Belgium to Germany, is another reason why free movement reform is on the EU agenda.

So some UK politicians see an outside chance that EU-wide restrictions to free movement – even an emergency brake – might just be combined with a soft Brexit deal allowing the UK to keep much of its single market access. If free movement were no longer sacrosanct, it might be easier for EU leaders to put mutual trade benefits first in the Brexit talks.