moved more ASM to C wrapper