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

import java.util.logging.Level;
import java.util.logging.Logger;

/* JADX INFO: loaded from: classes2.dex */
public abstract class gu1 extends pv1 implements com.google.common.util.concurrent.w {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final Object f11883d = new Object();

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final cv1 f11884e = new cv1(0, cu1.class);

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final boolean f11885f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final rb f11886g;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public volatile Object f11887a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public volatile zt1 f11888b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public volatile fu1 f11889c;

    static {
        boolean z10;
        rb ps1Var;
        Throwable th;
        Throwable th2;
        rb eu1Var;
        try {
            z10 = Boolean.parseBoolean(System.getProperty("guava.concurrent.generate_cancellation_cause", "false"));
        } catch (SecurityException unused) {
            z10 = false;
        }
        f11885f = z10;
        String property = System.getProperty("java.runtime.name", "");
        Throwable e10 = null;
        if (property == null || property.contains("Android")) {
            try {
                eu1Var = new eu1(5, 0);
            } catch (Error | Exception e11) {
                try {
                    ps1Var = new du1();
                } catch (Error | Exception e12) {
                    e10 = e12;
                    ps1Var = new ps1();
                }
                th = e11;
                th2 = e10;
                eu1Var = ps1Var;
            }
        } else {
            try {
                eu1Var = new du1();
            } catch (NoClassDefFoundError unused2) {
                eu1Var = new ps1();
            }
        }
        th2 = null;
        th = null;
        f11886g = eu1Var;
        if (th2 != null) {
            cv1 cv1Var = f11884e;
            Logger loggerB = cv1Var.b();
            Level level = Level.SEVERE;
            loggerB.logp(level, "com.google.common.util.concurrent.AbstractFutureState", "<clinit>", "UnsafeAtomicHelper is broken!", th);
            cv1Var.b().logp(level, "com.google.common.util.concurrent.AbstractFutureState", "<clinit>", "AtomicReferenceFieldUpdaterAtomicHelper is broken!", th2);
        }
    }

    public final void b(fu1 fu1Var) {
        fu1Var.f11392a = null;
        while (true) {
            fu1 fu1Var2 = this.f11889c;
            if (fu1Var2 != fu1.f11391c) {
                fu1 fu1Var3 = null;
                while (fu1Var2 != null) {
                    fu1 fu1Var4 = fu1Var2.f11393b;
                    if (fu1Var2.f11392a != null) {
                        fu1Var3 = fu1Var2;
                    } else if (fu1Var3 != null) {
                        fu1Var3.f11393b = fu1Var4;
                        if (fu1Var3.f11392a == null) {
                            break;
                        }
                    } else if (!f11886g.u(this, fu1Var2, fu1Var4)) {
                        break;
                    }
                    fu1Var2 = fu1Var4;
                }
                return;
            }
            return;
        }
    }
}
