let frama_c_offset state actuals =
  try begin
      match actuals with
        [_,x,_] ->
          begin
            let value =
              try
                let offsets =
                  Location_Bytes.fold_i
                    (fun _b o a -> Ival.join a o)
                    x
                    Ival.bottom
                in
                Cvalue.V.inject_ival offsets
              with Location_Bytes.Error_Top ->
                Value_parameters.error ~current:true
                  "Builtin Frama_C_offset is applied to a value not guaranteed to be an address";
                Cvalue.V.top_int
            in
            (wrap_int value), state, Location_Bits.Top_Param.bottom
          end
      | _ -> raise Offset_error
    end
  with Offset_error ->
    Value_parameters.error "Invalid arguments for builtin Frama_C_offset";
    do_degenerate None;
    raise Db.Value.Aborted