private static boolean replaceObjValue(@Nonnull InsnList instructions,
	                                       @Nonnull AbstractInsnNode stackValueProducerInsn,
	                                       @Nonnull ReValue stackTopValue,
	                                       @Nonnull JumpInsnNode jump,
	                                       @Nonnull Predicate<ObjectValue> gotoCondition) {
		if (stackTopValue instanceof ObjectValue objectValue) {
			AbstractInsnNode replacement = gotoCondition.test(objectValue) ?
					new JumpInsnNode(GOTO, jump.label) :
					new InsnNode(NOP);
			instructions.set(jump, replacement);
			instructions.set(stackValueProducerInsn, new InsnNode(NOP));
			return true;
		}
		return false;
	}
A transformer that folds opaque predicates into single-path control flows.

@author Matt Coley
recaf-core/src/main/java/software/coley/recaf/services/deobfuscation/transform/generic/OpaquePredicateFoldingTransformer.java