package com.google.android.gms.internal.ads;

import android.os.SystemClock;
import java.util.LinkedHashMap;
import java.util.Objects;
import java.util.concurrent.CancellationException;
import java.util.concurrent.TimeoutException;

/* JADX INFO: loaded from: classes2.dex */
public final class oy0 implements zu1 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ long f15199a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ za1 f15200b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ wa1 f15201c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ String f15202d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ qe1 f15203e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ eb1 f15204f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final /* synthetic */ qy0 f15205g;

    public oy0(qy0 qy0Var, long j10, za1 za1Var, wa1 wa1Var, String str, qe1 qe1Var, eb1 eb1Var) {
        this.f15199a = j10;
        this.f15200b = za1Var;
        this.f15201c = wa1Var;
        this.f15202d = str;
        this.f15203e = qe1Var;
        this.f15204f = eb1Var;
        Objects.requireNonNull(qy0Var);
        this.f15205g = qy0Var;
    }

    /* JADX WARN: Removed duplicated region for block: B:28:0x0065 A[PHI: r8
      0x0065: PHI (r8v1 int) = (r8v0 int), (r8v3 int), (r8v3 int), (r8v3 int) binds: [B:16:0x0032, B:21:0x004d, B:23:0x0051, B:25:0x005a] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:59:0x0068 A[EXC_TOP_SPLITTER, SYNTHETIC] */
    @Override // com.google.android.gms.internal.ads.zu1
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void zza(Throwable th) {
        Integer numValueOf;
        int i10;
        n7.l2 l2VarB;
        n7.l2 l2Var;
        qy0 qy0Var = this.f15205g;
        ((i8.d) qy0Var.f15888a).getClass();
        long jElapsedRealtime = SystemClock.elapsedRealtime() - this.f15199a;
        if (th instanceof TimeoutException) {
            i10 = 2;
        } else if (th instanceof zzemz) {
            i10 = 3;
        } else if (th instanceof CancellationException) {
            i10 = 4;
        } else {
            if (!(th instanceof zzfjr)) {
                if (th instanceof zzecr) {
                    i = sb1.a(th).f30997a == 3 ? 1 : 6;
                    if (((Boolean) n7.y.f31093e.f31096c.b(ao.Z1)).booleanValue() && (th instanceof zzekk) && (l2VarB = ((zzekk) th).b()) != null) {
                        numValueOf = Integer.valueOf(l2VarB.f30997a);
                    }
                    i10 = i;
                } else {
                    numValueOf = null;
                    i10 = i;
                }
                synchronized (qy0Var) {
                    try {
                        if (qy0Var.f15892e) {
                            qy0Var.f15889b.a(this.f15200b, this.f15201c, i10, th instanceof zzekk ? (zzekk) th : null, jElapsedRealtime);
                        }
                        if (((Boolean) n7.y.f31093e.f31096c.b(ao.f9119v9)).booleanValue()) {
                            re1 re1Var = qy0Var.f15890c;
                            qe1 qe1Var = this.f15203e;
                            eb1 eb1Var = this.f15204f;
                            wa1 wa1Var = this.f15201c;
                            re1Var.zza(qe1Var.zza(eb1Var, wa1Var, wa1Var.f17995m), wa1Var.zzax);
                        }
                        if (qy0Var.f15894g) {
                            return;
                        }
                        LinkedHashMap linkedHashMap = qy0Var.f15891d;
                        wa1 wa1Var2 = this.f15201c;
                        linkedHashMap.put(wa1Var2, new py0(this.f15202d, wa1Var2.f17972a0, i10, jElapsedRealtime, numValueOf));
                        n7.l2 l2VarA = sb1.a(th);
                        int i11 = l2VarA.f30997a;
                        if ((i11 == 3 || i11 == 0) && (l2Var = l2VarA.zzd) != null && !l2Var.f30999c.equals("com.google.android.gms.ads")) {
                            l2VarA = sb1.a(new zzekk(13, l2VarA.zzd));
                        }
                        qy0Var.f15893f.zze(wa1Var2, jElapsedRealtime, l2VarA);
                        return;
                    } catch (Throwable th2) {
                        throw th2;
                    }
                }
            }
            i10 = 5;
        }
        numValueOf = null;
        synchronized (qy0Var) {
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:17:0x0037 A[Catch: all -> 0x0022, DONT_GENERATE, TRY_ENTER, TRY_LEAVE, TryCatch #0 {all -> 0x0022, blocks: (B:4:0x0011, B:6:0x0015, B:9:0x0024, B:11:0x0028, B:13:0x002a, B:14:0x002c, B:17:0x0037, B:24:0x004b, B:25:0x005d, B:26:0x0063, B:22:0x003f, B:23:0x0040, B:29:0x0066, B:30:0x0067, B:15:0x002d, B:19:0x0039), top: B:33:0x0011, inners: #1 }] */
    @Override // com.google.android.gms.internal.ads.zu1
    /* JADX INFO: renamed from: zzb */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void mo3zzb(Object obj) {
        qy0 qy0Var = this.f15205g;
        ((i8.d) qy0Var.f15888a).getClass();
        long jElapsedRealtime = SystemClock.elapsedRealtime() - this.f15199a;
        synchronized (qy0Var) {
            try {
                if (qy0Var.f15892e) {
                    qy0Var.f15889b.a(this.f15200b, this.f15201c, 0, null, jElapsedRealtime);
                }
                if (qy0Var.f15894g) {
                    return;
                }
                wa1 wa1Var = this.f15201c;
                synchronized (qy0Var) {
                    py0 py0Var = (py0) qy0Var.f15891d.get(wa1Var);
                    if (py0Var == null) {
                        qy0Var.f15891d.put(wa1Var, new py0(this.f15202d, wa1Var.f17972a0, 0, jElapsedRealtime, null));
                    } else if (py0Var.f15549c == 8) {
                        ((py0) qy0Var.f15891d.get(wa1Var)).f15550d = jElapsedRealtime;
                    }
                    qy0Var.f15893f.zzd(wa1Var, jElapsedRealtime, null);
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }
}
