package jq;

import iq.b;
import java.util.Map;

/* loaded from: classes3.dex */
public abstract class p0 extends a {

    /* renamed from: a, reason: collision with root package name */
    private final fq.b f25251a;

    /* renamed from: b, reason: collision with root package name */
    private final fq.b f25252b;

    public /* synthetic */ p0(fq.b bVar, fq.b bVar2, kotlin.jvm.internal.k kVar) {
        this(bVar, bVar2);
    }

    @Override // fq.b, fq.a
    public abstract hq.e getDescriptor();

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // jq.a
    /* renamed from: k, reason: merged with bridge method [inline-methods] */
    public final void e(iq.b decoder, Map builder, int i10, int i11) {
        jn.i q10;
        jn.g p10;
        kotlin.jvm.internal.t.g(decoder, "decoder");
        kotlin.jvm.internal.t.g(builder, "builder");
        if (!(i11 >= 0)) {
            throw new IllegalArgumentException("Size must be known in advance when using READ_ALL".toString());
        }
        q10 = jn.o.q(0, i11 * 2);
        p10 = jn.o.p(q10, 2);
        int g10 = p10.g();
        int m10 = p10.m();
        int r10 = p10.r();
        if ((r10 <= 0 || g10 > m10) && (r10 >= 0 || m10 > g10)) {
            return;
        }
        while (true) {
            f(decoder, i10 + g10, builder, false);
            if (g10 == m10) {
                return;
            } else {
                g10 += r10;
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // jq.a
    /* renamed from: l, reason: merged with bridge method [inline-methods] */
    public final void f(iq.b decoder, int i10, Map builder, boolean z10) {
        int i11;
        Object c10;
        Object j10;
        kotlin.jvm.internal.t.g(decoder, "decoder");
        kotlin.jvm.internal.t.g(builder, "builder");
        Object c11 = b.a.c(decoder, getDescriptor(), i10, this.f25251a, null, 8, null);
        if (z10) {
            i11 = decoder.F(getDescriptor());
            if (!(i11 == i10 + 1)) {
                throw new IllegalArgumentException(("Value must follow key in a map, index for key: " + i10 + ", returned index for value: " + i11).toString());
            }
        } else {
            i11 = i10 + 1;
        }
        int i12 = i11;
        if (!builder.containsKey(c11) || (this.f25252b.getDescriptor().g() instanceof hq.d)) {
            c10 = b.a.c(decoder, getDescriptor(), i12, this.f25252b, null, 8, null);
        } else {
            hq.e descriptor = getDescriptor();
            fq.b bVar = this.f25252b;
            j10 = sm.q0.j(builder, c11);
            c10 = decoder.s(descriptor, i12, bVar, j10);
        }
        builder.put(c11, c10);
    }

    private p0(fq.b bVar, fq.b bVar2) {
        super(null);
        this.f25251a = bVar;
        this.f25252b = bVar2;
    }
}
