public static int getSizeProduced(AbstractInsnNode insn) {
		int op = insn.getOpcode();
		int type = insn.getType();
		if (type == AbstractInsnNode.METHOD_INSN) {
			Type methodType = Type.getMethodType(((MethodInsnNode) insn).desc);
			return methodType.getReturnType().getSize();
		} else if (type == AbstractInsnNode.INVOKE_DYNAMIC_INSN) {
			Type methodType = Type.getMethodType(((InvokeDynamicInsnNode) insn).desc);
			return methodType.getReturnType().getSize();
		} else if (type == AbstractInsnNode.FIELD_INSN) {
			FieldInsnNode fin = (FieldInsnNode) insn;
			Type fieldtype = Type.getType(fin.desc);
			if (op == GETSTATIC)
				return fieldtype.getSize(); // field type can be wide
			if (op == GETFIELD)
				return fieldtype.getSize(); // field type can be wide
			if (op == PUTSTATIC || op == PUTFIELD)
				return 0;
		} else if (type == AbstractInsnNode.LDC_INSN) {
			Object cst = ((LdcInsnNode) insn).cst;
			return (cst instanceof Double || cst instanceof Long) ? 2 : 1;
		} else if (type == AbstractInsnNode.FRAME ||
				type == AbstractInsnNode.LABEL ||
				type == AbstractInsnNode.LINE) {
			return 0;
		} else if (type == AbstractInsnNode.JUMP_INSN) {
			return op == JSR ? 1 : 0;
		}
		// noinspection EnhancedSwitchMigration
		switch (op) {
			// visitInsn
			case NOP:
				return 0;
			case ACONST_NULL:
			case ICONST_M1:
			case ICONST_0:
			case ICONST_1:
			case ICONST_2:
			case ICONST_3:
			case ICONST_4:
			case ICONST_5:
			case FCONST_0:
			case FCONST_1:
			case FCONST_2:
				return 1; // value
			case LCONST_0:
			case LCONST_1:
			case DCONST_0:
			case DCONST_1:
				return 2; // wide-value
			// visitIntInsn
			case BIPUSH:
			case SIPUSH:
				return 1; // value
			// visitVarInsn
			case ILOAD:
			case FLOAD:
			case ALOAD:
				return 1; // value
			case LLOAD:
			case DLOAD:
				return 2; // wide-value
			// visitInsn
			case IALOAD:
			case FALOAD:
			case AALOAD:
			case BALOAD:
			case CALOAD:
			case SALOAD:
				return 1; // value
			case LALOAD:
			case DALOAD:
				return 2; // wide-value
			// visitVarInsn
			case ISTORE:
			case LSTORE:
			case FSTORE:
			case DSTORE:
			case ASTORE:
				return 0;
			// visitInsn
			case IASTORE:
			case LASTORE:
			case FASTORE:
			case DASTORE:
			case AASTORE:
			case BASTORE:
			case CASTORE:
			case SASTORE:
				return 0;
			case POP:
			case POP2:
				return 0;
			case DUP:
			case DUP_X1:
			case DUP_X2:
				return 1; // stack stuff
			case DUP2:
			case DUP2_X1:
			case DUP2_X2:
				return 2; // stack stuff
			case SWAP:
				return 0; // technically does not introduce
			case IADD:
			case FADD:
			case ISUB:
			case FSUB:
			case IMUL:
			case FMUL:
			case IDIV:
			case FDIV:
			case IREM:
			case FREM:
			case INEG:
			case FNEG:
			case ISHL:
			case ISHR:
			case IUSHR:
			case IAND:
			case IOR:
			case IXOR:
				return 1; // result
			case LDIV:
			case LMUL:
			case LSUB:
			case LADD:
			case LREM:
			case LNEG:
			case LSHL:
			case LSHR:
			case LUSHR:
			case LAND:
			case LOR:
			case LXOR:
			case DADD:
			case DSUB:
			case DMUL:
			case DDIV:
			case DREM:
			case DNEG:
				return 2; // wide-result
			// visitIincInsn
			case IINC:
				return 0;
			// visitInsn
			case I2F:
			case L2I:
			case L2F:
			case F2I:
			case D2I:
			case D2F:
			case I2B:
			case I2C:
			case I2S:
				return 1; // result
			case I2D:
			case L2D:
			case F2D:
			case F2L:
			case D2L:
			case I2L:
				return 2; // wide-result
			case LCMP:
			case FCMPL:
			case FCMPG:
			case DCMPL:
			case DCMPG:
				return 1; // result
			// visitVarInsn
			case RET:
				return 0;
			// visiTableSwitchInsn/visitLookupSwitch
			case TABLESWITCH:
			case LOOKUPSWITCH:
				return 0;
			// visitInsn
			case IRETURN:
			case LRETURN:
			case FRETURN:
			case DRETURN:
			case ARETURN:
			case RETURN:
				return 0;
			// visitTypeInsn
			case NEW:
				return 1; // uninitialized value
			// visitIntInsn
			case NEWARRAY:
				return 1;
			// visitTypeInsn
			case ANEWARRAY:
				return 1;
			// visitInsn
			case ARRAYLENGTH:
				return 1;
			case ATHROW:
				return 0;
			// visitTypeInsn
			case CHECKCAST:
				return 0; // technically does not introduce
			case INSTANCEOF:
				return 1; // result
			// visitInsn
			case MONITORENTER:
				return 0;
			case MONITOREXIT:
				return 0;
			// visitMultiANewArrayInsn
			case MULTIANEWARRAY:
				return 1; // array
			default:
				throw new IllegalArgumentException("Unhandled instruction: " + op);
		}
	}
Computes the size of stack items produced for the given operation of the instruction.
This considers {@code long} and {@code double} types taking two spaces.

@param insn
		Instruction to compute for.

@return Size of stack produced. Never negative.

@see #getSizeConsumed(AbstractInsnNode)
@see <a href="https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-6.html#jvms-6.5">JVMS 6.5</a>
recaf-core/src/main/java/software/coley/recaf/util/AsmInsnUtil.java