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