Optimize X86#set_register to avoid \x00 bytes in the assembled output when setting a register to a 8bit or 16bit immediate value.
mov reg32, imm8 and mov reg32, imm16 instructions encode the immediate value as a 32bit value with extra \x00 bytes. Instead set_register should clear the register using clear_register and set a sub-register of the register to the immediate value.
Example
Expands to: