package o; import io.reactivex.rxjava3.exceptions.CompositeException; import java.util.concurrent.atomic.AtomicReference; /* loaded from: classes6.dex */ public final class fTU extends AtomicReference implements InterfaceC13174fSv, fSJ { private fSQ a; private boolean b; private InterfaceC13193fTg c; private fSP e; public fTU(InterfaceC13193fTg interfaceC13193fTg, fSQ fsq, fSP fsp) { this.c = interfaceC13193fTg; this.a = fsq; this.e = fsp; } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { EnumC13192fTf.a(this, fsj); } @Override // o.InterfaceC13174fSv public final void onNext(T t) { if (this.b) { return; } try { if (this.c.a(t)) { return; } dispose(); onComplete(); } catch (Throwable th) { C13147fSI.c(th); dispose(); onError(th); } } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.b) { C13418fZu.c(th); return; } this.b = true; try { this.a.c(th); } catch (Throwable th2) { C13147fSI.c(th2); C13418fZu.c(new CompositeException(th, th2)); } } @Override // o.InterfaceC13174fSv public final void onComplete() { if (this.b) { return; } this.b = true; try { this.e.c(); } catch (Throwable th) { C13147fSI.c(th); C13418fZu.c(th); } } @Override // o.fSJ public final void dispose() { EnumC13192fTf.e(this); } @Override // o.fSJ public final boolean isDisposed() { return EnumC13192fTf.c(get()); } }