Fix basic block output ordering - handle previous blocks properly

This makes sure all blocks prior to the one currently being emitted,
have already been emitted - this fixes problems with debug scope
labelling and function-end-returns embedded part way through a
function's asm.
Explain dead-code-elimination condition
Test debug label emission with local variables