Convert D3_DASM2.ASM to C