package o; /* renamed from: o.fXr, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C13344fXr extends fUX { private long b; public C13344fXr(InterfaceC13169fSq interfaceC13169fSq, long j) { super(interfaceC13169fSq); this.b = j; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { this.c.subscribe(new Sts(interfaceC13174fSv, this.b)); } /* renamed from: o.fXr$Sts */ /* loaded from: classes6.dex */ static final class Sts implements InterfaceC13174fSv, fSJ { private boolean a; private fSJ c; private long d; private InterfaceC13174fSv e; Sts(InterfaceC13174fSv interfaceC13174fSv, long j) { this.e = interfaceC13174fSv; this.d = j; } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { if (EnumC13192fTf.d(this.c, fsj)) { this.c = fsj; if (this.d == 0) { this.a = true; fsj.dispose(); EnumC13195fTi.e(this.e); return; } this.e.onSubscribe(this); } } @Override // o.InterfaceC13174fSv public final void onNext(T t) { if (this.a) { return; } long j = this.d; long j2 = j - 1; this.d = j2; if (j > 0) { boolean z = j2 == 0; this.e.onNext(t); if (z) { onComplete(); } } } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.a) { C13418fZu.c(th); return; } this.a = true; this.c.dispose(); this.e.onError(th); } @Override // o.InterfaceC13174fSv public final void onComplete() { if (this.a) { return; } this.a = true; this.c.dispose(); this.e.onComplete(); } @Override // o.fSJ public final void dispose() { this.c.dispose(); } @Override // o.fSJ public final boolean isDisposed() { return this.c.isDisposed(); } } }