let iosh_get_useful_def iosh vi =
  if IH.mem iosh vi.vid then
    let ios = IH.find iosh vi.vid in
    let ios' = RD.IOS.filter (fun ido  ->
      match ido with None -> true | Some(id) ->
        match time "getDefRhs" getDefRhs id with
            Some(RD.RDExp({enode = Lval(Var vi',NoOffset)}),_,_)
        | Some(RD.RDExp
                 ({enode = CastE(_,{enode = Lval(Var vi',NoOffset)})}),_,_) ->
            not(vi.vid = vi'.vid) (* false if they are the same *)
        | _ -> true) ios
    in
    if not(RD.IOS.cardinal ios' = 1)
    then (if !debug then (Cilmsg.debug "iosh_get_useful_def: multiple different defs of %d:%s(%d)"
                                  vi.vid vi.vname (RD.IOS.cardinal ios'));
          None)
    else RD.IOS.choose ios'
  else (if !debug then (Cilmsg.debug "iosh_get_useful_def: no def of %s reaches here" vi.vname);
        None)