let frama_C_is_base_aligned state actuals =
  try begin
      match actuals with
        [_,x,_; _,y,_] ->
          let i = Cvalue.V.project_ival y in
          begin match i with
            Ival.Set si ->
              let si = Ival.set_of_array si in
              Location_Bytes.fold_i
                (fun b _o () ->
                  Ival.O.iter
                    (fun int ->
                      if not (Base.is_aligned_by b int)
                      then raise Found_misaligned_base)
                    si)
                x
                ();
              (wrap_int Cvalue.V.singleton_one),
              state,
              Location_Bits.Top_Param.bottom
          | _ -> raise Found_misaligned_base
          end
      | _ -> raise Base_aligned_error
    end
  with
  | Base_aligned_error ->
    Kernel.error "Invalid arguments for Frama_C_is_base_aligned function" ;
    do_degenerate None;
    raise Db.Value.Aborted
  | Found_misaligned_base
  | Not_found (* from project_ival *)
  | Location_Bytes.Error_Top (* from fold_i *) ->
      (wrap_int Cvalue.V.zero_or_one),
      state,
      Location_Bits.Top_Param.bottom