Shuffle some code around in the emit_tex() and emit_move() instructions.
Shuffle some code around in the emit_tex() and emit_move() instructions.

Note that the inst ptr returned by new_instruction() may become invalid
after calling emit_() since the emit functions may allocate new instructions
which is done vial realloc().
Also, add some new assertions to try to catch this kind of bug.

jbarczak/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,mapbox/glsl-optimizer,adobe/glsl2agal,bkaradzic/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,metora/MesaGLSLCompiler,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,mcanthony/glsl-optimizer,KTXSoftware/glsl2agal,zz85/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,dellis1972/glsl-optimizer,adobe/glsl2agal,adobe/glsl2agal,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,wolf96/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,KTXSoftware/glsl2agal,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,zeux/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,mcanthony/glsl-optimizer,KTXSoftware/glsl2agal,mapbox/glsl-optimizer,dellis1972/glsl-optimizer,metora/MesaGLSLCompiler,zeux/glsl-optimizer,adobe/glsl2agal,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer,djreep81/glsl-optimizer,adobe/glsl2agal,zeux/glsl-optimizer,mcanthony/glsl-optimizer,metora/MesaGLSLCompiler,KTXSoftware/glsl2agal,zz85/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,KTXSoftware/glsl2agal