private ConditionLogicalConstruct CreateComplexCondition(ConditionLogicalConstruct conditionNode) { V_0 = conditionNode.get_ConditionExpression(); V_1 = new HashSet <ILogicalConstruct>(); V_2 = conditionNode; dummyVar0 = V_1.Add(V_2); V_3 = V_2.get_TrueSuccessor(); V_4 = V_2.get_FalseSuccessor(); while (true) { if (!this.CanBePartOfComplexCondition(V_3, V_1, V_2.get_FalseCFGSuccessor())) { if (!this.CanBePartOfComplexCondition(V_4, V_1, V_2.get_TrueCFGSuccessor())) { break; } V_6 = V_4 as ConditionLogicalConstruct; if (V_6.get_TrueSuccessor() != V_3) { V_6.Negate(this.typeSystem); } V_8 = 11; } else { V_6 = V_3 as ConditionLogicalConstruct; if (V_6.get_FalseSuccessor() != V_4) { V_6.Negate(this.typeSystem); } V_8 = 12; } V_0 = new BinaryExpression(V_8, V_0, V_6.get_ConditionExpression(), this.typeSystem, null, false); V_0.set_ExpressionType(this.booleanTypeReference); V_2 = V_6; V_3 = V_2.get_TrueSuccessor(); V_4 = V_2.get_FalseSuccessor(); dummyVar1 = V_1.Add(V_2); } if (V_1.get_Count() == 1) { return(conditionNode); } V_5 = new HashSet <ConditionLogicalConstruct>(); V_9 = V_1.GetEnumerator(); try { while (V_9.MoveNext()) { V_10 = (ConditionLogicalConstruct)V_9.get_Current(); dummyVar2 = V_5.Add(V_10); } } finally { ((IDisposable)V_9).Dispose(); } return(new ConditionLogicalConstruct(conditionNode, V_2, V_5, V_0)); }
private bool TryBuildIfConstruct(ConditionLogicalConstruct condition, DominatorTree dominatorTree, DFSTree dfsTree) { V_0 = condition.get_FalseSuccessor(); V_1 = condition.get_TrueSuccessor(); V_2 = dominatorTree.GetDominanceFrontier(V_0); V_3 = dominatorTree.GetDominanceFrontier(V_1); stackVariable15 = this.CheckSuccessor(condition, V_1, V_2, dfsTree); if (stackVariable15 == null) { dummyVar0 = stackVariable15; stackVariable15 = this.CheckSuccessor(condition, V_0, V_3, dfsTree); } V_4 = new HashSet <ISingleEntrySubGraph>(V_3); V_4.IntersectWith(V_2); if (stackVariable15 == null && V_2.get_Count() > 0 && V_3.get_Count() > 0 && V_4.get_Count() == 0) { return(false); } V_5 = this.GetBlockBody(dominatorTree, V_1, condition); V_6 = this.GetBlockBody(dominatorTree, V_0, condition); if (V_5 == null && V_6 == null) { return(false); } if (V_5 == null) { condition.Negate(this.typeSystem); stackVariable86 = V_1; V_1 = V_0; V_0 = stackVariable86; V_5 = V_6; V_6 = null; } if (V_6 == null && !this.CheckSuccessors(V_5, V_0)) { return(false); } if (this.ShouldInvertIfAndRemoveElse(V_5, V_1, V_6, V_0)) { condition.Negate(this.typeSystem); stackVariable73 = V_1; V_1 = V_0; V_0 = stackVariable73; stackVariable75 = V_5; V_5 = V_6; V_6 = stackVariable75; V_6 = null; } if (V_6 != null && !this.HasSuccessors(V_5)) { stackVariable61 = V_1.get_FirstBlock().get_TheBlock(); stackVariable63 = new Code[2]; stackVariable63[0] = 41; stackVariable63[1] = 119; if (this.SubtreeEndsInInstructionCode(stackVariable61, stackVariable63)) { V_6 = null; } } V_7 = new BlockLogicalConstruct(V_1, V_5); if (V_6 != null) { stackVariable46 = new BlockLogicalConstruct(V_0, V_6); } else { stackVariable46 = null; } this.UpdateDominatorTree(dominatorTree, IfLogicalConstruct.GroupInIfConstruct(condition, V_7, stackVariable46)); return(true); }