def GetPrevIndex(tag, array_id, idx):
    node = __GetArrayById(array_id)
    try:
        if tag == AR_LONG:
            return __l2m1(node.altprev(idx, tag))
        elif tag == AR_STR:
            return __l2m1(node.supprev(idx, tag))
        else:
            return -1
    except OverflowError:
        # typically: An index of -1 was passed.
        return -1


# -------------------- hashes -----------------------
Get index of the previous existing array element.
dataset/ETHPy150Open EiNSTeiN-/idapython/python/idc.py/GetPrevIndex