code: public static InsnList saveVar(Variable variable) {
          Validate.notNull(variable);
  
          InsnList ret = new InsnList();
          switch (variable.getType().getSort()) {
              case Type.BOOLEAN:
              case Type.BYTE:
              case Type.CHAR:
              case Type.SHORT:
              case Type.INT:
                  ret.add(new VarInsnNode(Opcodes.ISTORE, variable.getIndex()));
                  break;
              case Type.LONG:
                  ret.add(new VarInsnNode(Opcodes.LSTORE, variable.getIndex()));
                  break;
              case Type.FLOAT:
                  ret.add(new VarInsnNode(Opcodes.FSTORE, variable.getIndex()));
                  break;
              case Type.DOUBLE:
                  ret.add(new VarInsnNode(Opcodes.DSTORE, variable.getIndex()));
                  break;
              case Type.OBJECT:
              case Type.ARRAY:
                  ret.add(new VarInsnNode(Opcodes.ASTORE, variable.getIndex()));
                  break;
              default:
                  throw new IllegalStateException(); // should never happen, there is code in Variable/VariableTable to make sure invalid
                                                     // types aren't set
          }
  
          return ret;
      }
docs: Pops the stack in to the the local variable table. You may run in to problems if the item on top of the stack isn't of the same type
  as the variable it's being put in to.
  @param variable variable within the local variable table to save to
  @return instructions to pop an item off the top of the stack and save it to {@code variable}
  @throws NullPointerException if any argument is {@code null}
  @throws IllegalArgumentException if {@code variable} has been released