use arity information of "main" function.
implement tail-call optimization