package o; import io.reactivex.rxjava3.exceptions.CompositeException; import java.util.concurrent.atomic.AtomicInteger; /* renamed from: o.fWV, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C13291fWV extends fUX { private fSN d; public C13291fWV(AbstractC13163fSk abstractC13163fSk, fSN fsn) { super(abstractC13163fSk); this.d = fsn; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { C13197fTk c13197fTk = new C13197fTk(); interfaceC13174fSv.onSubscribe(c13197fTk); new Sts(interfaceC13174fSv, this.d, c13197fTk, this.c).c(); } /* renamed from: o.fWV$Sts */ /* loaded from: classes6.dex */ static final class Sts extends AtomicInteger implements InterfaceC13174fSv { private InterfaceC13174fSv a; private int b; private InterfaceC13169fSq c; private fSN d; private C13197fTk e; Sts(InterfaceC13174fSv interfaceC13174fSv, fSN fsn, C13197fTk c13197fTk, InterfaceC13169fSq interfaceC13169fSq) { this.a = interfaceC13174fSv; this.e = c13197fTk; this.c = interfaceC13169fSq; this.d = fsn; } @Override // o.InterfaceC13174fSv public final void onNext(T t) { this.a.onNext(t); } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { try { fSN fsn = this.d; int i = this.b + 1; this.b = i; if (!fsn.d(Integer.valueOf(i), th)) { this.a.onError(th); } else { c(); } } catch (Throwable th2) { C13147fSI.c(th2); this.a.onError(new CompositeException(th, th2)); } } @Override // o.InterfaceC13174fSv public final void onComplete() { this.a.onComplete(); } final void c() { if (getAndIncrement() == 0) { int i = 1; while (!this.e.isDisposed()) { this.c.subscribe(this); i = addAndGet(-i); if (i == 0) { return; } } } } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { EnumC13192fTf.c(this.e, fsj); } } }