private int remap(final int var, final Type type) {
		if (var + type.getSize() <= firstLocal) {
			return var;
		}
		int key = 2 * var + type.getSize() - 1;
		int size = mapping.length;
		if (key >= size) {
			int[] newMapping = new int[Math.max(2 * size, key + 1)];
			System.arraycopy(mapping, 0, newMapping, 0, size);
			mapping = newMapping;
		}
		int value = mapping[key];
		if (value == 0) {
			value = newLocalMapping(type);
			setLocalType(value, type);
			mapping[key] = value + 1;
		} else {
			value--;
		}
		if (value != var) {
			changed = true;
		}
		return value;
	}