As per the Twelfth Amendment, I am of the understanding that in a deadlock situation in a general election, the vote goes to the House of Representatives, with each state getting a single collective vote (totaling 50 votes) for the President and Vice-President of the United States being selected via that vote.
That being said, I have two questions:
1) In a state with numerous representatives, what would the process look like to narrow down a choice to a single vote for their state?
2) Who are the available candidates to vote for? Could the representatives come to a decision to vote for a "write in" candidate (i.e. Bernie Sanders, Ted Cruz), or do they have to stick to the candidates that are on the ballot?