package k9; /* loaded from: classes2.dex */ public abstract class f1 extends g0 { /* renamed from: b, reason: collision with root package name */ private long f11338b; /* renamed from: c, reason: collision with root package name */ private boolean f11339c; /* renamed from: d, reason: collision with root package name */ private kotlinx.coroutines.internal.a f11340d; private final long I0(boolean z10) { return z10 ? 4294967296L : 1L; } public static /* synthetic */ void M0(f1 f1Var, boolean z10, int i10, Object obj) { if (obj != null) { throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: incrementUseCount"); } if ((i10 & 1) != 0) { z10 = false; } f1Var.L0(z10); } public final void H0(boolean z10) { long I0 = this.f11338b - I0(z10); this.f11338b = I0; if (I0 <= 0 && this.f11339c) { shutdown(); } } public final void J0(x0 x0Var) { kotlinx.coroutines.internal.a aVar = this.f11340d; if (aVar == null) { aVar = new kotlinx.coroutines.internal.a(); this.f11340d = aVar; } aVar.a(x0Var); } protected long K0() { kotlinx.coroutines.internal.a aVar = this.f11340d; return (aVar == null || aVar.c()) ? Long.MAX_VALUE : 0L; } public final void L0(boolean z10) { this.f11338b += I0(z10); if (z10) { return; } this.f11339c = true; } public final boolean N0() { return this.f11338b >= I0(true); } public final boolean O0() { kotlinx.coroutines.internal.a aVar = this.f11340d; if (aVar == null) { return true; } return aVar.c(); } public final boolean P0() { x0 x0Var; kotlinx.coroutines.internal.a aVar = this.f11340d; if (aVar == null || (x0Var = (x0) aVar.d()) == null) { return false; } x0Var.run(); return true; } public abstract void shutdown(); }