remove unnecessary movzx
swap variables to optimize loads
try to inline procedure calls