def METHOD_NAME(loop_ir):
    if isinstance(loop_ir, ir.If):
        if contains_recursive_call(loop_ir.cond):
            raise TypeError("branch condition can't contain recursive call!")
        METHOD_NAME(loop_ir.cnsq)
        METHOD_NAME(loop_ir.altr)
    elif isinstance(loop_ir, ir.Let):
        if contains_recursive_call(loop_ir.value):
            raise TypeError("bound value used in other expression can't contain recursive call!")
        METHOD_NAME(loop_ir.body)
    elif isinstance(loop_ir, ir.TailLoop):
        if any(contains_recursive_call(x) for n, x in loop_ir.params):
            raise TypeError("parameters passed to inner loop can't contain recursive call!")
    elif not isinstance(loop_ir, ir.Recur) and contains_recursive_call(loop_ir):
        raise TypeError("found recursive expression outside of tail position!")