def get_slice_bounds(builder, slicestruct):
 start = slicestruct.start
 stop = slicestruct.stop
 zero = start.type(0)
 one = start.type(1)
 is_step_negative = builder.icmp_signed('<', slicestruct.step, zero)
 lower = builder.select(is_step_negative, builder.add(stop, one), start)
 upper = builder.select(is_step_negative, builder.add(start, one), stop)
 return (lower, upper)

def get_slice_bounds ( builder , slicestruct ) : start = slicestruct . start stop = slicestruct . stop zero = start . type ( 0 ) one = start . type ( 1 ) is_step_negative = builder . icmp_signed ( '<' , slicestruct . step , zero ) lower = builder . select ( is_step_negative , builder . add ( stop , one ) , start ) upper = builder . select ( is_step_negative , builder . add ( start , one ) , stop ) return ( lower , upper )
return the [lower .