boolean (Exprent first, Exprent second) { if (first.type != Exprent.EXPRENT_ASSIGNMENT || second.type != Exprent.EXPRENT_ASSIGNMENT) { return false; } AssignmentExprent af = (AssignmentExprent)first; AssignmentExprent as = (AssignmentExprent)second; if (as.getRight().type != Exprent.EXPRENT_FUNCTION) { return false; } FunctionExprent func = (FunctionExprent)as.getRight(); if (func.getFuncType() != FunctionExprent.FUNCTION_ADD && func.getFuncType() != FunctionExprent.FUNCTION_SUB) { return false; } Exprent econd = func.getLstOperands().get(0); Exprent econst = func.getLstOperands().get(1); if (econst.type != Exprent.EXPRENT_CONST && econd.type == Exprent.EXPRENT_CONST && func.getFuncType() == FunctionExprent.FUNCTION_ADD) { econd = econst; econst = func.getLstOperands().get(0); } if (econst.type == Exprent.EXPRENT_CONST && ((ConstExprent)econst).hasValueOne() && af.getLeft().equals(econd) && af.getRight().equals(as.getLeft()) && (af.getLeft().getExprentUse() & Exprent.MULTIPLE_USES) != 0) { int type = func.getFuncType() == FunctionExprent.FUNCTION_ADD ? FunctionExprent.FUNCTION_IPP : FunctionExprent.FUNCTION_IMM; FunctionExprent ret = new FunctionExprent(type, af.getRight(), func.bytecode); ret.setImplicitType(VarType.VARTYPE_INT); af.setRight(ret); return true; } return false; }