class GeneratorAdapter extends LocalVariablesSorter {

  public void ifCmp(final Type type, final int mode, final Label label) {
    switch (type.getSort()) {
      case Type.LONG:
        mv.visitInsn(Opcodes.LCMP);
        break;
      case Type.DOUBLE:
        mv.visitInsn(mode == GE || mode == GT ? Opcodes.DCMPL : Opcodes.DCMPG);
        break;
      case Type.FLOAT:
        mv.visitInsn(mode == GE || mode == GT ? Opcodes.FCMPL : Opcodes.FCMPG);
        break;
      case Type.ARRAY:
      case Type.OBJECT:
        if (mode == EQ) {
          mv.visitJumpInsn(Opcodes.IF_ACMPEQ, label);
          return;
        } else if (mode == NE) {
          mv.visitJumpInsn(Opcodes.IF_ACMPNE, label);
          return;
        } else {
          throw new IllegalArgumentException("Bad comparison for type " + type);
        }
      default:
        int intOp = -1;
        switch (mode) {
          case EQ:
            intOp = Opcodes.IF_ICMPEQ;
            break;
          case NE:
            intOp = Opcodes.IF_ICMPNE;
            break;
          case GE:
            intOp = Opcodes.IF_ICMPGE;
            break;
          case LT:
            intOp = Opcodes.IF_ICMPLT;
            break;
          case LE:
            intOp = Opcodes.IF_ICMPLE;
            break;
          case GT:
            intOp = Opcodes.IF_ICMPGT;
            break;
          default:
            throw new IllegalArgumentException("Bad comparison mode " + mode);
        }
        mv.visitJumpInsn(intOp, label);
        return;
    }
    mv.visitJumpInsn(mode, label);
  }

  public  GeneratorAdapter(
      final MethodVisitor methodVisitor,
      final int access,
      final String name,
      final String descriptor);
  protected  GeneratorAdapter(
      final int api,
      final MethodVisitor methodVisitor,
      final int access,
      final String name,
      final String descriptor);
  public  GeneratorAdapter(
      final int access, final Method method, final MethodVisitor methodVisitor);
  public  GeneratorAdapter(
      final int access,
      final Method method,
      final String signature,
      final Type[] exceptions,
      final ClassVisitor classVisitor);

}