codegen: start migrating out of C functions for arith ops