package o; import java.util.concurrent.atomic.AtomicInteger; /* renamed from: o.fXf, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C13332fXf extends AbstractC13163fSk { private InterfaceC13169fSq a; private fSN b; private InterfaceC13169fSq d; private int e; public C13332fXf(InterfaceC13169fSq interfaceC13169fSq, InterfaceC13169fSq interfaceC13169fSq2, fSN fsn, int i) { this.d = interfaceC13169fSq; this.a = interfaceC13169fSq2; this.b = fsn; this.e = i; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { HBt hBt = new HBt(interfaceC13174fSv, this.e, this.d, this.a, this.b); interfaceC13174fSv.onSubscribe(hBt); Sts[] stsArr = hBt.c; hBt.a.subscribe(stsArr[0]); hBt.e.subscribe(stsArr[1]); } /* renamed from: o.fXf$HBt */ /* loaded from: classes6.dex */ static final class HBt extends AtomicInteger implements fSJ { final InterfaceC13169fSq a; final C13190fTd b; final Sts[] c; private volatile boolean d; final InterfaceC13169fSq e; private InterfaceC13174fSv f; private T g; private fSN i; private T j; HBt(InterfaceC13174fSv interfaceC13174fSv, int i, InterfaceC13169fSq interfaceC13169fSq, InterfaceC13169fSq interfaceC13169fSq2, fSN fsn) { this.f = interfaceC13174fSv; this.a = interfaceC13169fSq; this.e = interfaceC13169fSq2; this.i = fsn; this.c = r1; Sts[] stsArr = {new Sts<>(this, 0, i), new Sts<>(this, 1, i)}; this.b = new C13190fTd(); } @Override // o.fSJ public final void dispose() { if (this.d) { return; } this.d = true; this.b.dispose(); if (getAndIncrement() == 0) { Sts[] stsArr = this.c; stsArr[0].e.e(); stsArr[1].e.e(); } } final void b() { Throwable th; Throwable th2; if (getAndIncrement() != 0) { return; } Sts[] stsArr = this.c; Sts sts = stsArr[0]; C13416fZs c13416fZs = sts.e; Sts sts2 = stsArr[1]; C13416fZs c13416fZs2 = sts2.e; int i = 1; while (!this.d) { boolean z = sts.a; if (z && (th2 = sts.b) != null) { this.d = true; c13416fZs.e(); c13416fZs2.e(); this.f.onError(th2); return; } boolean z2 = sts2.a; if (z2 && (th = sts2.b) != null) { this.d = true; c13416fZs.e(); c13416fZs2.e(); this.f.onError(th); return; } if (this.j == null) { this.j = c13416fZs.b(); } boolean z3 = this.j == null; if (this.g == null) { this.g = c13416fZs2.b(); } T t = this.g; boolean z4 = t == null; if (z && z2 && z3 && z4) { this.f.onNext(Boolean.TRUE); this.f.onComplete(); return; } if (z && z2 && z3 != z4) { this.d = true; c13416fZs.e(); c13416fZs2.e(); this.f.onNext(Boolean.FALSE); this.f.onComplete(); return; } if (!z3 && !z4) { try { if (!this.i.d(this.j, t)) { this.d = true; c13416fZs.e(); c13416fZs2.e(); this.f.onNext(Boolean.FALSE); this.f.onComplete(); return; } this.j = null; this.g = null; } catch (Throwable th3) { C13147fSI.c(th3); this.d = true; c13416fZs.e(); c13416fZs2.e(); this.f.onError(th3); return; } } if (z3 || z4) { i = addAndGet(-i); if (i == 0) { return; } } } c13416fZs.e(); c13416fZs2.e(); } @Override // o.fSJ public final boolean isDisposed() { return this.d; } } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.fXf$Sts */ /* loaded from: classes6.dex */ public static final class Sts implements InterfaceC13174fSv { volatile boolean a; Throwable b; private int c; private HBt d; final C13416fZs e; Sts(HBt hBt, int i, int i2) { this.d = hBt; this.c = i; this.e = new C13416fZs<>(i2); } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { HBt hBt = this.d; hBt.b.e(this.c, fsj); } @Override // o.InterfaceC13174fSv public final void onNext(T t) { this.e.b(t); this.d.b(); } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { this.b = th; this.a = true; this.d.b(); } @Override // o.InterfaceC13174fSv public final void onComplete() { this.a = true; this.d.b(); } } }