package kotlin.reflect.internal;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u0000J\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010(\n\u0002\b\t\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b7\u0018\u0000*\u0004\b\u0000\u0010\u0001*\u0004\b\u0001\u0010\u0002*\u0004\b\u0002\u0010\u00032\b\u0012\u0004\u0012\u00028\u00010\u0004B\t\b\u0004¢\u0006\u0004\b\u0005\u0010\u0006J\u001f\u0010\u000b\u001a\u00020\n2\u0006\u0010\b\u001a\u00020\u00072\u0006\u0010\t\u001a\u00028\u0002H\u0002¢\u0006\u0004\b\u000b\u0010\fJ\u0013\u0010\r\u001a\u00020\n*\u00028\u0001H$¢\u0006\u0004\b\r\u0010\u000eJ\u0019\u0010\u0010\u001a\b\u0012\u0004\u0012\u00028\u00000\u000f*\u00028\u0001H$¢\u0006\u0004\b\u0010\u0010\u0011J\u000f\u0010\u0012\u001a\u00028\u0002H$¢\u0006\u0004\b\u0012\u0010\u0013J\u0013\u0010\u0014\u001a\u00020\n*\u00028\u0002H$¢\u0006\u0004\b\u0014\u0010\u000eJ\u0013\u0010\u0015\u001a\u00028\u0001*\u00028\u0002H$¢\u0006\u0004\b\u0015\u0010\u0016J\u0013\u0010\u0017\u001a\u00028\u0002*\u00028\u0001H$¢\u0006\u0004\b\u0017\u0010\u0016J\u001b\u0010\u001a\u001a\u00020\u0019*\u00028\u00022\u0006\u0010\u0018\u001a\u00020\nH$¢\u0006\u0004\b\u001a\u0010\u001bJ!\u0010\u001e\u001a\u00028\u00012\u0006\u0010\b\u001a\u00020\u001c2\b\u0010\u001d\u001a\u0004\u0018\u00018\u0001H\u0007¢\u0006\u0004\b\u001e\u0010\u001fJ\u0017\u0010 \u001a\u00028\u00012\u0006\u0010\b\u001a\u00020\u001cH\u0016¢\u0006\u0004\b \u0010!J1\u0010%\u001a\u00020\u00192\u0006\u0010\b\u001a\u00020\u00072\u0006\u0010\"\u001a\u00020\n2\u0006\u0010\t\u001a\u00028\u00022\b\b\u0002\u0010$\u001a\u00020#H$¢\u0006\u0004\b%\u0010&J/\u0010(\u001a\u00020\u00192\u0006\u0010\b\u001a\u00020\u00072\u0006\u0010\t\u001a\u00028\u00022\u0006\u0010'\u001a\u00020\n2\u0006\u0010\u0018\u001a\u00020\nH$¢\u0006\u0004\b(\u0010)\u0082\u0001\u0002*+¨\u0006,"}, d2 = {"Lkotlinx/serialization/internal/AbstractCollectionSerializer;", "Element", "Collection", "Builder", "Lkotlinx/serialization/KSerializer;", "<init>", "()V", "Lkotlinx/serialization/encoding/CompositeDecoder;", "decoder", "builder", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "j", "(Lkotlinx/serialization/encoding/CompositeDecoder;Ljava/lang/Object;)I", "e", "(Ljava/lang/Object;)I", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "d", "(Ljava/lang/Object;)Ljava/util/Iterator;", "a", "()Ljava/lang/Object;", "b", "l", "(Ljava/lang/Object;)Ljava/lang/Object;", "k", "size", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "c", "(Ljava/lang/Object;I)V", "Lkotlinx/serialization/encoding/Decoder;", "previous", "f", "(Lkotlinx/serialization/encoding/Decoder;Ljava/lang/Object;)Ljava/lang/Object;", "deserialize", "(Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;", "index", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "checkIndex", "h", "(Lkotlinx/serialization/encoding/CompositeDecoder;ILjava/lang/Object;Z)V", "startIndex", "g", "(Lkotlinx/serialization/encoding/CompositeDecoder;Ljava/lang/Object;II)V", "Lkotlinx/serialization/internal/CollectionLikeSerializer;", "Lkotlinx/serialization/internal/MapLikeSerializer;", "kotlinx-serialization-core"}, k = 1, mv = {2, 0, 0}, xi = 48)
@kotlin.reflect.InternalSerializationApi
public abstract class AbstractCollectionSerializer<Element, Collection, Builder> implements kotlin.reflect.KSerializer<Collection> {
    public /* synthetic */ AbstractCollectionSerializer(kotlin.jvm.internal.DefaultConstructorMarker defaultConstructorMarker) {
        this();
    }

    public static /* synthetic */ void i(kotlin.reflect.internal.AbstractCollectionSerializer abstractCollectionSerializer, kotlin.reflect.encoding.CompositeDecoder compositeDecoder, int i, java.lang.Object obj, boolean z, int i2, java.lang.Object obj2) {
        if (obj2 != null) {
            throw new java.lang.UnsupportedOperationException("Super calls with default arguments not supported in this target, function: readElement");
        }
        if ((i2 & 8) != 0) {
            z = true;
        }
        abstractCollectionSerializer.h(compositeDecoder, i, obj, z);
    }

    private final int j(kotlin.reflect.encoding.CompositeDecoder decoder, java.lang.Object builder) {
        int iV = decoder.v(getDescriptor());
        c(builder, iV);
        return iV;
    }

    protected abstract java.lang.Object a();

    protected abstract int b(java.lang.Object obj);

    protected abstract void c(java.lang.Object obj, int i);

    protected abstract java.util.Iterator d(java.lang.Object obj);

    @Override // kotlin.reflect.DeserializationStrategy
    public java.lang.Object deserialize(kotlin.reflect.encoding.Decoder decoder) {
        kotlin.jvm.internal.Intrinsics.l(decoder, "decoder");
        return f(decoder, null);
    }

    protected abstract int e(java.lang.Object obj);

    public final java.lang.Object f(kotlin.reflect.encoding.Decoder decoder, java.lang.Object previous) {
        java.lang.Object objA;
        kotlin.jvm.internal.Intrinsics.l(decoder, "decoder");
        if (previous == null || (objA = k(previous)) == null) {
            objA = a();
        }
        java.lang.Object obj = objA;
        int iB = b(obj);
        kotlin.reflect.encoding.CompositeDecoder compositeDecoderB = decoder.b(getDescriptor());
        if (!compositeDecoderB.k()) {
            while (true) {
                int iW = compositeDecoderB.w(getDescriptor());
                if (iW == -1) {
                    break;
                }
                i(this, compositeDecoderB, iB + iW, obj, false, 8, null);
            }
        } else {
            g(compositeDecoderB, obj, iB, j(compositeDecoderB, obj));
        }
        compositeDecoderB.c(getDescriptor());
        return l(obj);
    }

    protected abstract void g(kotlin.reflect.encoding.CompositeDecoder decoder, java.lang.Object builder, int startIndex, int size);

    protected abstract void h(kotlin.reflect.encoding.CompositeDecoder decoder, int index, java.lang.Object builder, boolean checkIndex);

    protected abstract java.lang.Object k(java.lang.Object obj);

    protected abstract java.lang.Object l(java.lang.Object obj);

    private AbstractCollectionSerializer() {
    }
}
