ivory-backend-c: simplify some gnarly code