if (operand1 instanceof Constant && operand2 instanceof Constant) { Constant c1 = (Constant) operand1; Constant c2 = (Constant) operand2;
if (refs[0] instanceof Constant && refs[1] instanceof Constant) { Constant c1 = (Constant) refs[0]; Constant c2 = (Constant) refs[1];
	public Quad foldConstants() {		if (operand1 instanceof Constant && operand2 instanceof Constant) {			Constant c1 = (Constant) operand1;			Constant c2 = (Constant) operand2;			switch (operation) {				case IADD:					return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),						this.getLHS().getIndex(), c1.iAdd(c2));				case ISUB:					return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),						this.getLHS().getIndex(), c1.iSub(c2));				case IMUL:					return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),						this.getLHS().getIndex(), c1.iMul(c2));				case IDIV:					return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),						this.getLHS().getIndex(), c1.iDiv(c2));                case IREM:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.iRem(c2));                case IAND:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.iAnd(c2));                case IOR:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.iOr(c2));                case IXOR:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.iXor(c2));                case ISHL:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.iShl(c2));                case ISHR:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.iShr(c2));                case IUSHR:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.iUshr(c2));                case LADD:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lAdd(c2));                case LSUB:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lSub(c2));                case LMUL:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lMul(c2));                case LDIV:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lDiv(c2));                case LREM:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lRem(c2));                case LAND:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lAnd(c2));                case LOR:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lOr(c2));                case LXOR:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lXor(c2));                case LSHL:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lShl(c2));                case LSHR:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lShr(c2));                case LUSHR:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.lUshr(c2));                case FADD:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.fAdd(c2));                case FSUB:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.fSub(c2));                case FMUL:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.fMul(c2));                case FDIV:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.fDiv(c2));                case FREM:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.fRem(c2));                case DADD:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.dAdd(c2));                case DSUB:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.dSub(c2));                case DMUL:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.dMul(c2));                case DDIV:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.dDiv(c2));                case DREM:                    return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(),                        this.getLHS().getIndex(), c1.dRem(c2));				default:					throw new IllegalArgumentException("Don't know how to fold those yet...");			}		}		return this;	}