@Test
	public void testCallotherCallOverride() throws AddressFormatException {
		//verify the instructions need for the test
		Address userTwoAddr = defaultSpace.getAddress(USER_TWO_R0_100020);
		Instruction userTwo = program.getListing().getInstructionAt(userTwoAddr);
		assertNotNull(userTwo);
		assertEquals("user_two r0", userTwo.toString());

		PcodeOp[] unmodified = userTwo.getPcode(false);
		assertNull(unmodified[0].getOutput());
		assertTrue(unmodified[0].getOpcode() == PcodeOp.CALLOTHER); //pcodeop_two(rs)
		assertTrue(unmodified[0].getNumInputs() == 2);              //callother op index, rs
		assertNull(unmodified[1].getOutput());
		assertTrue(unmodified[1].getOpcode() == PcodeOp.CALLOTHER); //pcodeop_three()
		assertTrue(unmodified[1].getNumInputs() == 1);              //callother op index

		//lay down CALLOTHER_OVERRIDE_CALL ref as non-primary
		int id = program.startTransaction("test");
		Reference callotherOverrideRef1 = refManager.addMemoryReference(userTwoAddr, func1Addr,
			RefType.CALLOTHER_OVERRIDE_CALL, SourceType.USER_DEFINED, -1);
		refManager.setPrimary(callotherOverrideRef1, false);
		program.endTransaction(id, true);

		//nothing should change regardless of whether overrides are requested
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(true)));

		//make the reference primary
		id = program.startTransaction("test");
		refManager.setPrimary(callotherOverrideRef1, true);
		program.endTransaction(id, true);

		//nothing should change without requesting overrides
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));

		PcodeOp[] modified = userTwo.getPcode(true);
		//first CALLOTHER op should be changed to a CALL call target as the only input
		assertNull(modified[0].getOutput());
		assertTrue(modified[0].getOpcode() == PcodeOp.CALL);
		assertTrue(modified[0].getNumInputs() == 1);
		assertTrue(modified[0].getInput(0).isAddress());
		assertTrue(modified[0].getInput(0).getOffset() == func1Addr.getOffset());
		//second CALLOTHER op should be unchanged
		assertTrue(equalPcodeOps(modified[1], unmodified[1]));

		//add a primary simple call ref
		id = program.startTransaction("test");
		Reference simpleCallRef = refManager.addMemoryReference(userTwoAddr, func2Addr,
			RefType.UNCONDITIONAL_CALL, SourceType.USER_DEFINED, 0);
		refManager.setPrimary(simpleCallRef, true);
		program.endTransaction(id, true);

		//verify that nothing changes when overrides are not requested
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));

		//verify that this reference does not change the call target
		assertTrue(equalPcodeOpArrays(modified, userTwo.getPcode(true)));

		//remove simpleCallRef and add a CALL_OVERRIDE_UNCONDITIONAL reference
		id = program.startTransaction("test");
		Reference overrideCallRef = refManager.addMemoryReference(userTwoAddr, func2Addr,
			RefType.CALL_OVERRIDE_UNCONDITIONAL, SourceType.USER_DEFINED, 0);
		refManager.delete(simpleCallRef);
		refManager.setPrimary(overrideCallRef, true);
		program.endTransaction(id, true);

		//verify that nothing changes when overrides are not requested
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));

		//verify that this reference does not change the call target
		assertTrue(equalPcodeOpArrays(modified, userTwo.getPcode(true)));

		//remove overrideCallRef and add another primary CALLOTHER_OVERRIDE_CALL reference
		id = program.startTransaction("test");
		Reference callotherOverrideRef2 = refManager.addMemoryReference(userTwoAddr, func1Addr,
			RefType.CALLOTHER_OVERRIDE_CALL, SourceType.USER_DEFINED, 0);
		refManager.delete(overrideCallRef);
		refManager.setPrimary(callotherOverrideRef2, true);
		program.endTransaction(id, true);

		//two primary references CALLOTHER_OVERRIDE_CALL references: overrides should not happen
		assertTrue(equalPcodeOpArrays(userTwo.getPcode(true), unmodified));

		//verify that nothing changes if no overrides are requested
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));
	}
Tests that a single primary CALLOTHER_OVERRIDE_CALL reference:
  1) Changes the first CALLOTHER op encountered as follows:
    a) CALLOTHER op -> CALL op
    b) this new CALL op is not affected by simple reference overrides
       or CALL_OVERRIDE_UNCONDITIONAL references
    c) input 0 becomes the CALL target
    d) other inputs destroyed
  2) Does not change subsequent CALLOTHER ops associated with the same instruction
@throws AddressFormatException if {@code AddressSpace.getAddress()} throws it
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/program/model/pcode/PcodeEmitContextTest.java