def _calcMinimumPositions(instrs):
    posd = {}
    pos = 0
    for ins in instrs:
        posd[ins] = pos
        if isinstance(ins, ir.LazyJumpBase):
            pos += ins.min
        elif isinstance(ins, ir.Switch):
            pad = (-pos-1) % 4
            pos += pad + ins.nopad_size
        else:
            pos += len(ins.bytecode)
    return posd, pos
dataset/ETHPy150Open ajinabraham/Mobile-Security-Framework-MobSF/StaticAnalyzer/tools/enjarify/enjarify/jvm/optimization/jumps.py/_calcMinimumPositions/original