def print_ast(ea): cfunc = idaapi.decompile(ea) printer = ast_printer_t() printer.apply_to_exprs(cfunc.body, None)