# Path: pykit/parsing/cirparser.py
# def from_c(source, filename="<string>"):
#     # TODO: process metadata
#     # metadata = preprocess(source)
# 
#     # Preprocess...
#     f = tempfile.NamedTemporaryFile('w+t')
#     try:
#         f.write(source)
#         f.flush()
#         source = preprocess_file(f.name, cpp_args=['-I' + ir_root])
#     finally:
#         f.close()
# 
#     # Parse
#     ast = parse(source, filename)
#     # ast.show()
#     visitor = PykitIRVisitor(dict(type_env))
#     visitor.visit(ast)
#     return visitor.mod
# 
# Path: pykit/transform/ret.py
# def run(func, env=None, return_block=None):
# 
# Path: pykit/ir/utils.py
# @listify
# def opcodes(container):
#     """Returns [opcode] for all operations"""
#     for op in _getops(container):
#         yield op.opcode


import unittest
from pykit.environment import fresh_env
from pykit.parsing import from_c
from pykit.transform import ret
from pykit.ir import opcodes
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import



testfunc = """
int func(int i) {
    int y = 2;
    return y;
    while (i < 10) {
        i = i + 1;
        return i * 2;

# Path: pykit/parsing/cirparser.py
# def from_c(source, filename="<string>"):
#     # TODO: process metadata
#     # metadata = preprocess(source)
# 
#     # Preprocess...
#     f = tempfile.NamedTemporaryFile('w+t')
#     try:
#         f.write(source)
#         f.flush()
#         source = preprocess_file(f.name, cpp_args=['-I' + ir_root])
#     finally:
#         f.close()
# 
#     # Parse
#     ast = parse(source, filename)
#     # ast.show()
#     visitor = PykitIRVisitor(dict(type_env))
#     visitor.visit(ast)
#     return visitor.mod
# 
# Path: pykit/transform/ret.py
# def run(func, env=None, return_block=None):
# 
# Path: pykit/ir/utils.py
# @listify
# def opcodes(container):
#     """Returns [opcode] for all operations"""
#     for op in _getops(container):
#         yield op.opcode


# Path: pykit/transform/tests/test_ret_normalization.py
import unittest
from pykit.environment import fresh_env
from pykit.parsing import from_c
from pykit.transform import ret
from pykit.ir import opcodes

# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import



testfunc = """
int func(int i) {
    int y = 2;
    return y;
    while (i < 10) {
        i = i + 1;
        return i * 2;

    }