let rec lift_offset ty = function
| Index(idx1,(Index(_idx2, _off) as suboff)) ->
let subty = direct_element_type ty in
let siz = array_size subty in
begin match lift_offset subty suboff with
| Index(idx, off) ->
let mulidx = new_exp (BinOp(Mult,idx1,constant_expr siz,intType)) in
let addidx =
map_under_info (fun _e ->
new_exp (BinOp(PlusA,mulidx,idx,intType))) idx1
in
Index(addidx,off)
| _ -> assert false
end
| Index(idx1,NoOffset) as off ->
let subty = direct_element_type ty in
if isArrayType subty then
let siz = array_size subty in
let mulidx =
map_under_info
(fun _e -> new_exp (BinOp(Mult,idx1,constant_expr siz,intType))) idx1
in
Index(mulidx,NoOffset)
else off
| off -> off