package defpackage;

import java.util.List;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0004\u001a\u00020\u0002*\u000e\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u00020\u00002\u0006\u0010\u0003\u001a\u00020\u0001H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Lj77;", "Lrd4;", "Le6a;", "response", "<anonymous>", "(Lj77;Lrd4;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "io.ktor.client.plugins.cache.HttpCache$Companion$install$2", f = "HttpCache.kt", i = {1, 1, 3, 3}, l = {205, 211, 218, 226, 231}, m = "invokeSuspend", n = {"$this$intercept", "response", "$this$intercept", "response"}, s = {"L$0", "L$1", "L$0", "L$1"})
@vx8
final class j94 extends SuspendLambda implements ir3<j77<rd4, e6a>, rd4, Continuation<? super e6a>, Object> {
    public int a;
    public /* synthetic */ j77 b;
    public /* synthetic */ rd4 c;
    public final /* synthetic */ k94 d;
    public final /* synthetic */ ta4 e;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public j94(k94 k94Var, ta4 ta4Var, Continuation continuation) {
        super(3, continuation);
        this.d = k94Var;
        this.e = ta4Var;
    }

    @Override // defpackage.ir3
    public final Object invoke(Object obj, Object obj2, Object obj3) {
        j94 j94Var = new j94(this.d, this.e, (Continuation) obj3);
        j94Var.b = (j77) obj;
        j94Var.c = (rd4) obj2;
        return j94Var.invokeSuspend(e6a.a);
    }

    /* JADX WARN: Removed duplicated region for block: B:50:0x00fe  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x0144  */
    /* JADX WARN: Removed duplicated region for block: B:61:0x0157 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:62:0x0158  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x016a A[RETURN] */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        j77 j77Var;
        rd4 rd4Var;
        j77 j77Var2;
        j77 j77Var3;
        rd4 rd4Var2;
        ck1 ck1Var = ck1.a;
        int i = this.a;
        ta4 ta4Var = this.e;
        k94 k94Var = this.d;
        e6a e6aVar = e6a.a;
        if (i == 0) {
            s38.b(obj);
            j77Var = this.b;
            rd4Var = this.c;
            if (cr4.b(rd4Var.getA().e().getA(), wc4.b)) {
                k94Var.getClass();
                if (qe4.a(rd4Var.getC())) {
                    jh5 jh5Var = w94.a;
                    if (rh5.a(jh5Var)) {
                        jh5Var.h("Caching response for " + rd4Var.getA().e().getB());
                    }
                    this.b = j77Var;
                    this.c = rd4Var;
                    this.a = 2;
                    ed4 ed4VarE = rd4Var.getA().e();
                    List listA = vc4.a(rd4Var);
                    List listA2 = vc4.a(ed4VarE);
                    m7a m7aVar = listA.contains(sq0.c) ? k94Var.d : k94Var.c;
                    b14 b14Var = sq0.a;
                    Object objB = (listA.contains(b14Var) || listA2.contains(b14Var)) ? null : ja4.b(m7aVar, rd4Var, v94.c(rd4Var), this);
                    if (objB != ck1Var) {
                        Object obj2 = objB;
                        j77Var2 = j77Var;
                        obj = obj2;
                    }
                } else if (cr4.b(rd4Var.getC(), pe4.k)) {
                    jh5 jh5Var2 = w94.a;
                    if (rh5.a(jh5Var2)) {
                        jh5Var2.h("Not modified response for " + rd4Var.getA().e().getB() + ", replying from cache");
                    }
                    ed4 ed4VarE2 = rd4Var.getA().e();
                    this.b = j77Var;
                    this.c = rd4Var;
                    this.a = 4;
                    Object objA = k94.a(k94Var, ed4VarE2, rd4Var, this);
                    if (objA != ck1Var) {
                        j77Var3 = j77Var;
                        obj = objA;
                        rd4Var2 = (rd4) obj;
                        if (rd4Var2 != null) {
                        }
                    }
                }
            }
        }
        if (i == 1) {
            s38.b(obj);
            return e6aVar;
        }
        if (i != 2) {
            if (i == 3) {
                s38.b(obj);
                return e6aVar;
            }
            if (i != 4) {
                if (i != 5) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                return e6aVar;
            }
            rd4Var = this.c;
            j77Var3 = this.b;
            s38.b(obj);
            rd4Var2 = (rd4) obj;
            if (rd4Var2 != null) {
                throw new rr4(rd4Var.getA().e().getB());
            }
            ta4Var.l.a(k94.f, rd4Var2);
            this.b = null;
            this.c = null;
            this.a = 5;
            return j77Var3.h(rd4Var2, this) == ck1Var ? ck1Var : e6aVar;
        }
        rd4Var = this.c;
        j77Var2 = this.b;
        s38.b(obj);
        er0 er0Var = (er0) obj;
        if (er0Var == null) {
            j77Var = j77Var2;
            if (cr4.b(rd4Var.getC(), pe4.k)) {
            }
        }
        rd4 rd4VarA = ja4.a(er0Var, ta4Var, yd4.b(rd4Var), rd4Var.getA());
        this.b = null;
        this.c = null;
        this.a = 3;
        if (j77Var2.h(rd4VarA, this) == ck1Var) {
        }
    }
}
