package k2;

import android.content.Context;
import com.google.android.gms.internal.measurement.C1;
import f2.C0913c;
import java.util.ArrayList;
import p2.AbstractC1420j;
import p2.C1419i;
import p2.C1421k;

/* JADX INFO: renamed from: k2.k, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1096k {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final C1419i f13825a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final ArrayList f13826b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f13827c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final C1419i f13828d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final q2.h f13829e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final C0913c f13830f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final boolean f13831g;

    public C1096k(C1419i c1419i, ArrayList arrayList, int i, C1419i c1419i2, q2.h hVar, C0913c c0913c, boolean z8) {
        this.f13825a = c1419i;
        this.f13826b = arrayList;
        this.f13827c = i;
        this.f13828d = c1419i2;
        this.f13829e = hVar;
        this.f13830f = c0913c;
        this.f13831g = z8;
    }

    public final void a(C1419i c1419i, C1094i c1094i) {
        Context context = c1419i.f16066a;
        C1419i c1419i2 = this.f13825a;
        if (context != c1419i2.f16066a) {
            throw new IllegalStateException(("Interceptor '" + c1094i + "' cannot modify the request's context.").toString());
        }
        if (c1419i.f16067b == C1421k.f16091b) {
            throw new IllegalStateException(("Interceptor '" + c1094i + "' cannot set the request's data to null.").toString());
        }
        if (c1419i.f16068c != c1419i2.f16068c) {
            throw new IllegalStateException(("Interceptor '" + c1094i + "' cannot modify the request's target.").toString());
        }
        if (c1419i.f16085u != c1419i2.f16085u) {
            throw new IllegalStateException(("Interceptor '" + c1094i + "' cannot modify the request's lifecycle.").toString());
        }
        if (c1419i.f16086v == c1419i2.f16086v) {
            return;
        }
        throw new IllegalStateException(("Interceptor '" + c1094i + "' cannot modify the request's size resolver. Use `Interceptor.Chain.withSize` instead.").toString());
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object b(C1419i c1419i, G6.c cVar) throws Throwable {
        C1095j c1095j;
        C1096k c1096k;
        C1094i c1094i;
        if (cVar instanceof C1095j) {
            c1095j = (C1095j) cVar;
            int i = c1095j.f13824x;
            if ((i & Integer.MIN_VALUE) != 0) {
                c1095j.f13824x = i - Integer.MIN_VALUE;
            } else {
                c1095j = new C1095j(this, cVar);
            }
        }
        Object objD = c1095j.f13822v;
        F6.a aVar = F6.a.f2580q;
        int i5 = c1095j.f13824x;
        if (i5 == 0) {
            C1.N(objD);
            ArrayList arrayList = this.f13826b;
            int i8 = this.f13827c;
            if (i8 > 0) {
                a(c1419i, (C1094i) arrayList.get(i8 - 1));
            }
            C1094i c1094i2 = (C1094i) arrayList.get(i8);
            C1096k c1096k2 = new C1096k(this.f13825a, arrayList, i8 + 1, c1419i, this.f13829e, this.f13830f, this.f13831g);
            c1095j.f13820t = this;
            c1095j.f13821u = c1094i2;
            c1095j.f13824x = 1;
            objD = c1094i2.d(c1096k2, c1095j);
            if (objD == aVar) {
                return aVar;
            }
            c1096k = this;
            c1094i = c1094i2;
        } else {
            if (i5 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            c1094i = c1095j.f13821u;
            c1096k = c1095j.f13820t;
            C1.N(objD);
        }
        AbstractC1420j abstractC1420j = (AbstractC1420j) objD;
        c1096k.a(abstractC1420j.b(), c1094i);
        return abstractC1420j;
    }
}
