IF code generation. Works towards #36