@Override
	public void clearRegister(Register reg) {
		if (reg == null) {
			return;
		}

		// Start new register space
		String spaceName = reg.getName() + "-" + currentAddress;
		int spaceId = getAddressSpace(spaceName,reg.getBitLength());

		Varnode registerVarnode = getRegisterVarnode(reg);
		putMemoryValue(this.regVals, registerVarnode,
			createVarnode(0, spaceId, registerVarnode.getSize()));
	}
Extend a constant value if it can be extended.

@param out varnode to extend into (for size)
@param in varnode value to extend the size
@return new sign extended varnode
Ghidra/Features/Base/src/main/java/ghidra/program/util/VarnodeContext.java