Convert CROP ASM to C.

Converted the useful ASM routines to C for portability.