List<Instruction> (@NotNull List<Instruction> instructions) { List<Instruction> simplified = new ArrayList<>(); for (Instruction instruction : instructions) { Check check = tryCast(instruction, Check.class); if (check != null && !check.hasElseBranch()) { Boolean res = check.myInstructions.isEmpty() ? Boolean.FALSE : DfaUtil.evaluateCondition(check.myCondition); if (Boolean.FALSE.equals(res)) continue; check.myInstructions = run(check.myInstructions); if (check.myInstructions.isEmpty() || Boolean.TRUE.equals(res)) { simplified.addAll(check.myInstructions); continue; } } simplified.add(instruction); } return simplified; }