let get_divmod_assertion
    ~simplify_constants:simplify_constants
    ~warning:warning
    divisor_expr =
  (* division or modulo: overflow occurs when divisor is equal to zero *)
  let badValDivisor = My_bigint.zero in
  let assertion () =
    let term = translate_C_expr_to_term divisor_expr in
    Logic_const.prel (Rneq, term, Cil.lconstant badValDivisor)
  in
  if simplify_constants then begin
    match get_expr_val divisor_expr with
    | None -> (* divisor is not a constant (or it's value has not
                 been computed) *)

      [ assertion (), None ]
    | Some v64 ->
      if My_bigint.equal v64 badValDivisor then
        (* divide by 0 *)
        let assertion = assertion () in
        if warning then
          rte_warn fmt_divisor_assert d_predicate_named assertion ;
        [ assertion, Some Property_status.False_if_reachable ]
      else
        (* divide by constant which is not 0 *)
        (* nothing to assert *)
        []
  end else
    [ assertion (), None ]