# Path: javadecompiler/Krakatau/ssa/objtypes.py
# def isSubtype(env, x, y):
# def commonSupertype(env, tts):
# def verifierToSynthetic_seq(vtypes):
# def verifierToSynthetic(vtype):
# def declTypeToActual(env, decltype):


import collections
import operator
from functools import partial
from ..ssa import objtypes
from .. import graph_util
from ..namegen import NameGen
from ..verifier.descriptors import parseMethodDescriptor
from . import ast, ast2, boolize
from . import graphproxy, structuring, astgen, mergevariables

            if isinstance(item.expr, ast.Assignment) and item.expr.params[0] in replacevars:
                expr_roots = []
                for item2 in newstatements:
                    #Don't inline into a while condition as it may be evaluated more than once
                    if not isinstance(item2, ast.WhileStatement):
                        expr_roots.append((item2, item2.expr))
                    if item2.getScopes():
                        break
                success = doReplacement(item, expr_roots)
                if success:
                    continue
            newstatements.insert(0, item)
        scope.statements = newstatements
    visitReplace(root)

def _createDeclarations(root, predeclared):
    _setScopeParents(root)
    info = findVarDeclInfo(root, predeclared)
    localdefs = collections.defaultdict(list)
    newvars = [var for var in info if isinstance(var, ast.Local) and info[var].declScope is None]
    remaining = set(newvars)

    #The compiler treats statements as if they can throw any exception at any time, so
    #it may think variables are not definitely assigned even when they really are.
    #Therefore, we give an unused initial value to every variable declaration
    #TODO - find a better way to handle this
    _init_d = {objtypes.BoolTT: ast.Literal.FALSE,
            objtypes.IntTT: ast.Literal.ZERO,
            objtypes.LongTT: ast.Literal.LZERO,

# Path: javadecompiler/Krakatau/ssa/objtypes.py
# def isSubtype(env, x, y):
# def commonSupertype(env, tts):
# def verifierToSynthetic_seq(vtypes):
# def verifierToSynthetic(vtype):
# def declTypeToActual(env, decltype):


# Path: javadecompiler/Krakatau/java/javamethod.py
import collections
import operator
from functools import partial
from ..ssa import objtypes
from .. import graph_util
from ..namegen import NameGen
from ..verifier.descriptors import parseMethodDescriptor
from . import ast, ast2, boolize
from . import graphproxy, structuring, astgen, mergevariables


            if isinstance(item.expr, ast.Assignment) and item.expr.params[0] in replacevars:
                expr_roots = []
                for item2 in newstatements:
                    #Don't inline into a while condition as it may be evaluated more than once
                    if not isinstance(item2, ast.WhileStatement):
                        expr_roots.append((item2, item2.expr))
                    if item2.getScopes():
                        break
                success = doReplacement(item, expr_roots)
                if success:
                    continue
            newstatements.insert(0, item)
        scope.statements = newstatements
    visitReplace(root)

def _createDeclarations(root, predeclared):
    _setScopeParents(root)
    info = findVarDeclInfo(root, predeclared)
    localdefs = collections.defaultdict(list)
    newvars = [var for var in info if isinstance(var, ast.Local) and info[var].declScope is None]
    remaining = set(newvars)

    #The compiler treats statements as if they can throw any exception at any time, so
    #it may think variables are not definitely assigned even when they really are.
    #Therefore, we give an unused initial value to every variable declaration
    #TODO - find a better way to handle this
    _init_d = {objtypes.BoolTT: ast.Literal.FALSE,
            objtypes.IntTT: ast.Literal.ZERO,
            objtypes.LongTT: ast.Literal.LZERO,

            objtypes.FloatTT: ast.Literal.FZERO,