package o; /* renamed from: o.fVK, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C13252fVK extends fUX { private fSP e; public C13252fVK(InterfaceC13169fSq interfaceC13169fSq, fSP fsp) { super(interfaceC13169fSq); this.e = fsp; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { this.c.subscribe(new HBt(interfaceC13174fSv, this.e)); } /* renamed from: o.fVK$HBt */ /* loaded from: classes6.dex */ static final class HBt extends AbstractC13183fTH implements InterfaceC13174fSv { private boolean a; private InterfaceC13174fSv b; private InterfaceC13412fZo c; private fSP d; private fSJ e; HBt(InterfaceC13174fSv interfaceC13174fSv, fSP fsp) { this.b = interfaceC13174fSv; this.d = fsp; } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { if (EnumC13192fTf.d(this.e, fsj)) { this.e = fsj; if (fsj instanceof InterfaceC13412fZo) { this.c = (InterfaceC13412fZo) fsj; } this.b.onSubscribe(this); } } @Override // o.InterfaceC13174fSv public final void onNext(T t) { this.b.onNext(t); } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { this.b.onError(th); if (compareAndSet(0, 1)) { try { this.d.c(); } catch (Throwable th2) { C13147fSI.c(th2); C13418fZu.c(th2); } } } @Override // o.InterfaceC13174fSv public final void onComplete() { this.b.onComplete(); if (compareAndSet(0, 1)) { try { this.d.c(); } catch (Throwable th) { C13147fSI.c(th); C13418fZu.c(th); } } } @Override // o.fSJ public final void dispose() { this.e.dispose(); if (compareAndSet(0, 1)) { try { this.d.c(); } catch (Throwable th) { C13147fSI.c(th); C13418fZu.c(th); } } } @Override // o.fSJ public final boolean isDisposed() { return this.e.isDisposed(); } @Override // o.InterfaceC13413fZp public final int b(int i) { InterfaceC13412fZo interfaceC13412fZo = this.c; if (interfaceC13412fZo == null || (i & 4) != 0) { return 0; } int b = interfaceC13412fZo.b(i); if (b != 0) { this.a = b == 1; } return b; } @Override // o.InterfaceC13414fZq public final void e() { this.c.e(); } @Override // o.InterfaceC13414fZq public final boolean c() { return this.c.c(); } @Override // o.InterfaceC13414fZq public final T b() throws Throwable { T b = this.c.b(); if (b == null && this.a && compareAndSet(0, 1)) { try { this.d.c(); } catch (Throwable th) { C13147fSI.c(th); C13418fZu.c(th); } } return b; } } }