+/**
+ * returns whether the cmp evaluates to true or false, or can't be evaluated!
+ * 1: true, 0: false, -1: can't evaluate
+ *
+ * @param env the environment
+ * @param cand the candidate node, either a Const or a Confirm
+ */
+static int eval_cmp(condeval_env_t *env, ir_node *cand) {
+ if (is_Const(cand)) {
+ tarval *tv_cand = get_Const_tarval(cand);
+ tarval *tv_cmp = get_Const_tarval(env->cnst);
+
+ return eval_cmp_tv(env->pnc, tv_cand, tv_cmp);
+ } else { /* a Confirm */
+ tarval *res = computed_value_Cmp_Confirm(env->cmp, cand, env->cnst, env->pnc);
+
+ if (res == tarval_bad)
+ return -1;
+ return res == tarval_b_true;
+ }
+}
+
+/**
+ * Check for Const or Confirm with Const.
+ */
+static int is_Const_or_Confirm(const ir_node *node) {
+ if (is_Confirm(node))
+ node = get_Confirm_bound(node);
+ return is_Const(node);
+}
+
+/**
+ * get the tarval of a Const or Confirm with
+ */
+static tarval *get_Const_or_Confirm_tarval(const ir_node *node) {
+ if (is_Confirm(node)) {
+ if (get_Confirm_bound(node))
+ node = get_Confirm_bound(node);
+ }
+ return get_Const_tarval(node);
+}
+
+static ir_node *find_const_or_confirm(condeval_env_t *env, ir_node *jump, ir_node *value)