if ((it.getConstant() != null) && it2.getConstant() != null) { if (seen == IADD) push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() + ((Integer)it.getConstant()).intValue()))); else if (seen == ISUB) push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() - ((Integer)it.getConstant()).intValue()))); else if (seen == IMUL) push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() * ((Integer)it.getConstant()).intValue()))); else if (seen == IDIV) push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() / ((Integer)it.getConstant()).intValue()))); else if (seen == IAND) push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() & ((Integer)it.getConstant()).intValue()))); else if (seen == IOR) push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() | ((Integer)it.getConstant()).intValue()))); else if (seen == IXOR) push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() ^ ((Integer)it.getConstant()).intValue()))); else if (seen == ISHL) push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() << ((Integer)it.getConstant()).intValue()))); else if (seen == ISHR) push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() >> ((Integer)it.getConstant()).intValue()))); } else { push(new Item("I")); }
pushByIntMath(seen, it, it2);
 	public void sawOpcode(DismantleBytecode dbc, int seen) { 		int register; 		LocalVariableTable lvt; 		LocalVariable lv; 		JavaClass cls; 		String signature; 		Method m; 		Item it, it2; 		Constant cons; 		 		try 		{ 			//It would be nice to also track field values, but this currently isn't done. 			//It would also be nice to track array values, but this currently isn't done. 				 		switch (seen) {	 			case ALOAD:	 				register = dbc.getRegisterOperand();	 				m = dbc.getMethod();	 				lvt = m.getLocalVariableTable();	 				if (lvt != null) {	 					lv = lvt.getLocalVariable(register); 						signature = lv.getSignature(); 						pushBySignature(signature);	  				} else {	  					pushBySignature("");	  				}	 			break;	 				 			case ALOAD_0:	 			case ALOAD_1:	 			case ALOAD_2:	 			case ALOAD_3:	 				register = seen - ALOAD_0;	 				m = dbc.getMethod();	 				lvt = m.getLocalVariableTable();	 				if (lvt != null) {	 					lv = lvt.getLocalVariable(register); 						signature = lv.getSignature(); 						pushBySignature(signature);	  				} else {	  					pushBySignature("");	  				}	 			break;	 				 			case LLOAD:	 			case LLOAD_0:	 			case LLOAD_1:	 			case LLOAD_2:	 			case LLOAD_3:	 				push(new Item("L"));	 				 			case GETSTATIC:	 				pushBySignature(dbc.getSigConstantOperand());	 			break;	 				 			case LDC:				case LDC2_W:	 				cons = dbc.getConstantRefOperand();	 				pushByConstant(dbc, cons);				break;								case INSTANCEOF:					pop();					push(new Item("I"));				break;	 				 			case ARETURN:	 			case ASTORE:	 			case ASTORE_0:	 			case ASTORE_1:	 			case ASTORE_2:	 			case ASTORE_3:	 			case DRETURN:	 			case DSTORE:	 			case DSTORE_0:	 			case DSTORE_1:	 			case DSTORE_2:	 			case DSTORE_3:	 			case FRETURN:	 			case FSTORE:	 			case FSTORE_0:	 			case FSTORE_1:	 			case FSTORE_2:	 			case FSTORE_3:	 			case IFEQ:	 			case IFNE:	 			case IFLT:	 			case IFLE:	 			case IFGT:	 			case IFGE:	 			case IFNONNULL:	 			case IFNULL:	 			case IRETURN:	 			case ISTORE:	 			case ISTORE_0:	 			case ISTORE_1:	 			case ISTORE_2:	 			case ISTORE_3:	 			case LOOKUPSWITCH:	 			case LRETURN:	 			case LSTORE:	 			case LSTORE_0:	 			case LSTORE_1:	 			case LSTORE_2:	 			case LSTORE_3:	 			case MONITORENTER:	 			case MONITOREXIT:	 			case POP:	 			case PUTSTATIC:	 			case TABLESWITCH:	 				pop();	 			break;	 				 			case IF_ACMPEQ:	 			case IF_ACMPNE:	 			case IF_ICMPEQ:	 			case IF_ICMPNE:	 			case IF_ICMPLT:	 			case IF_ICMPLE:	 			case IF_ICMPGT:	 			case IF_ICMPGE:	 			case POP2:	 			case PUTFIELD:	 				pop(2);	 			break;	 				 			case IALOAD:	 			case SALOAD:	 				pop(2);	 				push(new Item("I"));	 			break;	 				 			case DUP:	 				it = pop();	 				push(it);	 				push(it);	 			break;	 				 			case DUP2:	 				it = pop();	 				it2 = pop();	 				push(it2);	 				push(it);	 				push(it2);	 				push(it);	 			break;	 				 			case DUP_X1:	 				it = pop();	 				it2 = pop();	 				push(it);	 				push(it2);	 				push(it);	 			break;	 				 				 			case ATHROW:	 			case CHECKCAST:	 			case GOTO:	 			case GOTO_W:	 			case IINC:	 			case NOP:	 			case RET:	 			case RETURN:	 			break;	 				 			case SWAP:	 				Item i1 = pop();	 				Item i2 = pop();	 				push(i1);	 				push(i2);	 			break;	 				 			case ICONST_M1:	 			case ICONST_0:	 			case ICONST_1:	 			case ICONST_2:	 			case ICONST_3:	 			case ICONST_4:	 			case ICONST_5:	 				push(new Item("I", new Integer(seen-ICONST_0)));	 			break;	 				 			case LCONST_0:	 			case LCONST_1:	 				push(new Item("J", new Integer(seen-LCONST_0)));	 			break;	 				 			case ACONST_NULL:	 				push(new Item());	 			break;	 				 			case ILOAD:	 			case ILOAD_0:	 			case ILOAD_1:	 			case ILOAD_2:	 			case ILOAD_3:	 				push(new Item("I"));	 			break;	 				 			case GETFIELD:	 				pop();	 				push(new Item(dbc.getSigConstantOperand()));	 			break;	 				 			case ARRAYLENGTH:	 				pop();	 				push(new Item("I"));	 			break;	 				 			case BALOAD:	 				it = pop();	 				pop();	 				signature = it.getSignature();	 				push(new Item(signature));	 			break;	 				 			case AASTORE:	 			case BASTORE:	 			case IASTORE:	 				pop(3);	 			break;	 				 			case BIPUSH:	 			case SIPUSH:	 				push(new Item("I", new Integer((int)dbc.getIntConstant())));	 			break;	 				 			case IADD:	 			case ISUB:	 			case IMUL:	 			case IDIV:	 			case IAND:	 			case IOR:	 			case IXOR:	 			case ISHL:	 			case ISHR:	 				it = pop();	 				it2 = pop();	 				if ((it.getConstant() != null) && it2.getConstant() != null) {						if (seen == IADD)	 						push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() + ((Integer)it.getConstant()).intValue())));	 					else if (seen == ISUB)	 						push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() - ((Integer)it.getConstant()).intValue())));						else if (seen == IMUL)	 						push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() * ((Integer)it.getConstant()).intValue())));						else if (seen == IDIV)	 						push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() / ((Integer)it.getConstant()).intValue())));						else if (seen == IAND)	 						push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() & ((Integer)it.getConstant()).intValue())));						else if (seen == IOR)	 						push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() | ((Integer)it.getConstant()).intValue())));						else if (seen == IXOR)	 						push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() ^ ((Integer)it.getConstant()).intValue())));						else if (seen == ISHL)	 						push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() << ((Integer)it.getConstant()).intValue())));						else if (seen == ISHR)	 						push(new Item("I", new Integer(((Integer)it2.getConstant()).intValue() >> ((Integer)it.getConstant()).intValue())));	 				} else {	 					push(new Item("I"));	 				}	 			break;	 				 			case INEG:	 				it = pop();	 				if (it.getConstant() != null) {	 					push(new Item("I", new Integer(-((Integer)it.getConstant()).intValue())));	 				} else {	 					push(new Item("I"));	 				}	 			break;	 				 			case LADD:	 			case LSUB:	 			case LMUL:	 			case LDIV:	 			case LAND:	 			case LOR:	 			case LXOR:	 				it = pop();	 				it2 = pop();	 				if ((it.getConstant() != null) && it2.getConstant() != null) {						if (seen == LADD)	 						push(new Item("J", new Long(((Long)it2.getConstant()).longValue() + ((Long)it.getConstant()).longValue())));	 					else if (seen == LSUB)	 						push(new Item("J", new Long(((Long)it2.getConstant()).longValue() - ((Long)it.getConstant()).longValue())));						else if (seen == LMUL)	 						push(new Item("J", new Long(((Long)it2.getConstant()).longValue() * ((Long)it.getConstant()).longValue())));						else if (seen == LDIV)	 						push(new Item("J", new Long(((Long)it2.getConstant()).longValue() / ((Long)it.getConstant()).longValue())));						else if (seen == LAND)	 						push(new Item("J", new Long(((Long)it2.getConstant()).longValue() & ((Long)it.getConstant()).longValue())));						else if (seen == LOR)	 						push(new Item("J", new Long(((Long)it2.getConstant()).longValue() | ((Long)it.getConstant()).longValue())));						else if (seen == LXOR)	 						push(new Item("J", new Long(((Long)it2.getConstant()).longValue() ^ ((Long)it.getConstant()).longValue())));	 				} else {	 					push(new Item("J"));	 				}	 			break;/*	 				 			case LCMP:	 				it = pop();	 				it2 = pop();	 				if ((it.getConstant() != null) && it2.getConstant() != null) {	 					long l = ((Long)it.getConstant()).longValue();	 					long l2 = ((Long)it.getConstant()).longValue();	 					if (l2 < l)	 						push(new Item("I", new Integer(-1)));	 					else if (l2 > l)	 						push(new Item("I", new Integer(1)));	 					else	 						push(new Item("I", new Integer(0)));	 				} else {	 					push(new Item("I"));	 				}	 			break;*/	 					 			case DADD:	 			case DSUB:	 			case DMUL:	 			case DDIV:	 				it = pop();	 				it2 = pop();	 				if ((it.getConstant() != null) && it2.getConstant() != null) {	 					if (seen == DADD)	 						push(new Item("D", new Double(((Double)it2.getConstant()).doubleValue() + ((Double)it.getConstant()).doubleValue())));	 					else if (seen == DSUB)	 						push(new Item("D", new Double(((Double)it2.getConstant()).doubleValue() - ((Double)it.getConstant()).doubleValue())));	 					else if (seen == DMUL)	 						push(new Item("D", new Double(((Double)it2.getConstant()).doubleValue() * ((Double)it.getConstant()).doubleValue())));	 					else if (seen == DDIV)	 						push(new Item("D", new Double(((Double)it2.getConstant()).doubleValue() / ((Double)it.getConstant()).doubleValue())));	 				} else {	 					push(new Item("D"));	 				}	 			break;	 				 			case I2B:	 				it = pop();	 				if (it.getConstant() != null) {	 					push(new Item("I", new Integer((int)((byte)((Integer)it.getConstant()).intValue()))));	 				} else {	 					push(new Item("I"));	 				}	 			break;	 			case I2C:	 				it = pop();	 				if (it.getConstant() != null) {	 					push(new Item("I", new Integer((int)((char)((Integer)it.getConstant()).intValue()))));	 				} else {	 					push(new Item("I"));	 				}	 			break;	 			case I2D:	 				it = pop();	 				if (it.getConstant() != null) {	 					push(new Item("D", new Double((double)((Integer)it.getConstant()).intValue())));	 				} else {	 					push(new Item("D"));	 				}	 			break;	 				 			case I2F:	 				it = pop();	 				if (it.getConstant() != null) {	 					push(new Item("F", new Float((float)((Integer)it.getConstant()).intValue())));	 				} else {	 					push(new Item("F"));	 				}	 			break;	 				 			case I2L:	 				it = pop();	 				if (it.getConstant() != null) {	 					push(new Item("J", new Long((long)((Integer)it.getConstant()).intValue())));	 				} else {	 					push(new Item("J"));	 				}	 			break;	 			case I2S:	 				it = pop();	 				if (it.getConstant() != null) {	 					push(new Item("I", new Integer((int)((short)((Integer)it.getConstant()).intValue()))));	 				} else {	 					push(new Item("I"));	 				}	 			break;	 				 			case D2I:	 				it = pop();	 				if (it.getConstant() != null) {	 					push(new Item("I", new Integer((int)((Integer)it.getConstant()).intValue())));	 				} else {	 					push(new Item("I"));	 				}	 			break;	 				 			case NEW:	 				pushBySignature(dbc.getClassConstantOperand());	 			break;	 				 			case NEWARRAY:	 				pop();	 				signature = BasicType.getType((byte)dbc.getIntConstant()).getSignature();	 				pushBySignature(signature);	 			break;	 				 			case ANEWARRAY:	 				pop();	 				pushBySignature("L"+dbc.getClassConstantOperand()+";");	 			break;	 					 			case AALOAD:	 				pop();	 				it = pop();	 				pushBySignature(it.getElementSignature());	 			break;	 				 			case DLOAD:	 				push(new Item("D"));	 			break;	 							case INVOKEINTERFACE:	 			case INVOKESPECIAL:	 			case INVOKESTATIC:	 			case INVOKEVIRTUAL:	 				signature = dbc.getSigConstantOperand();	 				Type[] argTypes = Type.getArgumentTypes(signature);	 				pop(argTypes.length);	 				pushBySignature(Type.getReturnType(signature).getSignature());	 			break;	 					 			default:	 				throw new UnsupportedOperationException("OpCode not supported yet" );	 		}	 	}	 	catch (Exception e) {	 		//If an error occurs, we clear the stack. one of two things will occur. Either the client will expect more stack	 		//items than really exist, and so they're condition check will fail, or the stack will resync with the code.	 		//But hopefully not false positives	 		stack.clear();	 	} 	}