static bool OriginsMatch (MethodDefinition method, Instruction lhs, Instruction rhs) { bool match = false; object operand1 = lhs.GetOperand (method); object operand2 = rhs.GetOperand (method); if (lhs.OpCode.Code == rhs.OpCode.Code) { if (lhs.IsLoadArgument ()) match = operand1.Equals (operand2); else if (lhs.IsLoadElement ()) match = LoadElementMatch (method, lhs, rhs); else if (lhs.IsLoadIndirect ()) match = LoadIndirectMatch (method, lhs, rhs); else if (lhs.IsLoadLocal ()) match = LocalsMatch (operand1, operand2); } else if (lhs.IsStoreLocal () && rhs.IsLoadLocal ()) match = LocalsMatch (operand1, operand2); else if (lhs.IsLoadLocal () && rhs.IsStoreLocal ()) match = LocalsMatch (operand1, operand2); return match; }