':param s: the string address/offset
:param state: SimState
:param region: memory, file, etc
:param base: the base to use to interpret the number
note: all numbers may start with +/- and base 16 may start with 0x
:param signed: boolean, true means the result will be signed, otherwise unsigned
:param read_length: int, the number of bytes parsed in strtol
:return: expression, value, num_bytes
the returned expression is a symbolic boolean indicating success, value will be set to 0 on failure
value is the returned value (set to min/max on overflow)
num_bytes is the number of bytes read in the string'

@staticmethod
def strtol_inner(s, state, region, base, signed, read_length=None):

    if ((base < 2) or (base > 36)):
        raise SimProcedureError('base    should    be    in    the    range    [2,36]')
    prefixes = ['-', '+', '']
    if (base == 16):
        prefixes = (['0x', '-0x', '+0x'] + prefixes)
    cases = []
    conditions = []
    possible_num_bytes = []
    for prefix in prefixes:
        (condition, value, num_bytes) = strtol._load_num_with_prefix(prefix, s, region, state, base, signed, read_length)
        conditions.append(condition)
        cases.append((condition, value))
        possible_num_bytes.append(num_bytes)
    result = state.se.ite_cases(cases[:(-1)], cases[(-1)][1])
    expression = state.se.Or(*conditions)
    num_bytes = state.se.ite_cases(zip(conditions, possible_num_bytes), 0)
    return (expression, result, num_bytes)
