	public static boolean addInstBeforeExpr(Expression expression,
			Instruction instruction, boolean usePreviousJoinNode) {
		Instruction instContainer = EcoreHelper.getContainerOfType(expression,
				Instruction.class);
		Node nodeContainer = EcoreHelper.getContainerOfType(expression,
				Node.class);
		if (instContainer != null) {
			if (usePreviousJoinNode && isWhileJoinNode(nodeContainer)) {
				NodeWhile nodeWhile = EcoreHelper.getContainerOfType(
						nodeContainer, NodeWhile.class);
				addToPreviousNodeBlock(nodeWhile, instruction);
				return false;
			}
			List<Instruction> instructions = EcoreHelper
					.getContainingList(instContainer);
			instructions.add(instructions.indexOf(instContainer), instruction);
			return true;
		} else {
			if (usePreviousJoinNode && nodeContainer.isWhileNode()) {
				NodeBlock joinNode = ((NodeWhile) nodeContainer).getJoinNode();
				joinNode.add(instruction);
				return false;
			} else {
				addToPreviousNodeBlock(nodeContainer, instruction);
				return false;
			}
		}
	}

	public static boolean addInstBeforeExpr(Expression expression,
			Instruction instruction, boolean usePreviousJoinNode) {
		Instruction instContainer = EcoreHelper.getContainerOfType(expression,
				Instruction.class);
		Node nodeContainer = EcoreHelper.getContainerOfType(expression,
				Node.class);
		if (instContainer != null) {
			if (usePreviousJoinNode && instContainer.isPhi()
					&& isWhileJoinNode(nodeContainer)) {
				NodeWhile nodeWhile = EcoreHelper.getContainerOfType(
						nodeContainer, NodeWhile.class);
				addToPreviousNodeBlock(nodeWhile, instruction);
				return false;
			} else {
				List<Instruction> instructions = EcoreHelper
						.getContainingList(instContainer);
				instructions.add(instructions.indexOf(instContainer),
						instruction);
				return true;
			}
		} else {
			if (usePreviousJoinNode && nodeContainer.isWhileNode()) {
				NodeBlock joinNode = ((NodeWhile) nodeContainer).getJoinNode();
				joinNode.add(instruction);
				return false;
			} else {
				addToPreviousNodeBlock(nodeContainer, instruction);
				return false;
			}
		}
	}
