# Path: krakatau-lib/src/main/resources/Lib/Krakatau/ssa/ssa_types.py
# SSA_INT = 'int', 32
# SSA_LONG = 'int', 64
# SSA_FLOAT = 'float', fu.FLOAT_SIZE
# SSA_DOUBLE = 'float', fu.DOUBLE_SIZE
# SSA_OBJECT = 'obj',
# SSA_MONAD = 'monad',
# def verifierToSSAType(vtype):
#     def __init__(self, key):
#     def getSuccessors(self):
#     def filterVarConstraints(self, keepvars):
#     def removePredPair(self, pair):
#     def replacePredPair(self, oldp, newp):
#     def __str__(self):
# class BasicBlock(object):


import collections, itertools
from ..ssa import ssa_types
            assert(not entryNode and not invars) #shouldn't have more than one entryBlock and entryBlock shouldn't have phis
            entryNode = n
            invars = ssagraph.inputArgs #store them in the node so we don't have to keep track seperately
            invars = [x for x in invars if x is not None] #will have None placeholders for Long and Double arguments
        n.invars = [v for v in invars if v.type != ssa_types.SSA_MONAD]

    lookup = {}
    for n in nodes:
        assert(len(intypes[n.bkey]) != 2) #should have been handled by graph.splitDualInedges()
        if len(intypes[n.bkey]) == 2: #both normal and exceptional inedges
            n2 = n.newIndirect()
            allnodes.append(n2)
        else:
            n2 = n

        if False in intypes[n.bkey]:
            lookup[n.bkey, False] = n
        if True in intypes[n.bkey]:
            lookup[n2.bkey, True] = n2
    assert(unique(lookup.values()))

    for n in nodes:
        if n.block is None:
            n.blockdict = None
            continue

        n.blockdict = lookup
        block = n.block
        for (block2, t) in block.jump.getSuccessorPairs():
            out = [phi.get((block, t)) for phi in block2.phis]

# Path: krakatau-lib/src/main/resources/Lib/Krakatau/ssa/ssa_types.py
# SSA_INT = 'int', 32
# SSA_LONG = 'int', 64
# SSA_FLOAT = 'float', fu.FLOAT_SIZE
# SSA_DOUBLE = 'float', fu.DOUBLE_SIZE
# SSA_OBJECT = 'obj',
# SSA_MONAD = 'monad',
# def verifierToSSAType(vtype):
#     def __init__(self, key):
#     def getSuccessors(self):
#     def filterVarConstraints(self, keepvars):
#     def removePredPair(self, pair):
#     def replacePredPair(self, oldp, newp):
#     def __str__(self):
# class BasicBlock(object):


# Path: krakatau-lib/src/main/resources/Lib/Krakatau/java/graphproxy.py
import collections, itertools
from ..ssa import ssa_types

            assert(not entryNode and not invars) #shouldn't have more than one entryBlock and entryBlock shouldn't have phis
            entryNode = n
            invars = ssagraph.inputArgs #store them in the node so we don't have to keep track seperately
            invars = [x for x in invars if x is not None] #will have None placeholders for Long and Double arguments
        n.invars = [v for v in invars if v.type != ssa_types.SSA_MONAD]

    lookup = {}
    for n in nodes:
        assert(len(intypes[n.bkey]) != 2) #should have been handled by graph.splitDualInedges()
        if len(intypes[n.bkey]) == 2: #both normal and exceptional inedges
            n2 = n.newIndirect()
            allnodes.append(n2)
        else:
            n2 = n

        if False in intypes[n.bkey]:
            lookup[n.bkey, False] = n
        if True in intypes[n.bkey]:
            lookup[n2.bkey, True] = n2
    assert(unique(lookup.values()))

    for n in nodes:
        if n.block is None:
            n.blockdict = None
            continue

        n.blockdict = lookup
        block = n.block
        for (block2, t) in block.jump.getSuccessorPairs():
            out = [phi.get((block, t)) for phi in block2.phis]

            out = [v for v in out if v.type != ssa_types.SSA_MONAD]