private void addInst(final Instruction inst) {
		// Build the tree, trying to convert dup-stores

		if (last == null) {
			last = inst;

		} else {
			switch (last.opcodeClass()) {
			case opcx_dup:
				switch (inst.opcodeClass()) {
				case opcx_astore:
				case opcx_fstore:
				case opcx_istore:
				case opcx_putstatic:
					addInst(inst, true);
					last = null;
					break;
				}
				break;
			case opcx_dup2:
				switch (inst.opcodeClass()) {
				case opcx_dstore:
				case opcx_lstore:
				case opcx_putstatic:
					addInst(inst, true);
					last = null;
					break;
				}
				break;
			case opcx_dup_x1:
				switch (inst.opcodeClass()) {
				case opcx_putfield:
				case opcx_putfield_nowb:
					addInst(inst, true);
					last = null;
					break;
				}
				break;
			case opcx_dup2_x1:
				switch (inst.opcodeClass()) {
				case opcx_putfield:
				case opcx_putfield_nowb:
					addInst(inst, true);
					last = null;
					break;
				}
				break;
			case opcx_dup_x2:
				switch (inst.opcodeClass()) {
				case opcx_aastore:
				case opcx_bastore:
				case opcx_castore:
				case opcx_fastore:
				case opcx_iastore:
				case opcx_sastore:
					addInst(inst, true);
					last = null;
					break;
				}
				break;
			case opcx_dup2_x2:
				switch (inst.opcodeClass()) {
				case opcx_dastore:
				case opcx_lastore:
					addInst(inst, true);
					last = null;
					break;
				}
				break;
			}

			if (last != null) {
				addInst(last, false);
				last = inst;
			}
		}

		// We should have dealt with the old last instruction
		Assert.isTrue((last == null) || (last == inst));

		if (inst.isJump() || inst.isSwitch() || inst.isThrow()
				|| inst.isReturn() || inst.isJsr() || inst.isRet()) {
			addInst(inst, false);
			last = null;
		}
	}