After disassembling a program, I see the following asm code generated :
.text:004D5911 mov [ebp+var_4], ecx
.text:004D5914 mov ecx, [ebp+var_4]
.text:004D5917 test ecx, ecx
.text:004D5919 jnz short loc_4D591F
I don't get why [ebp+var_4]
is copied back to ecx
.
Is this an artifact (missed optimization) from the compiler which requires test to take registers as operands?