move function bodies to auto_common.h; create ir file
attempt at writing IR. DONT TOUCH, ISAAC