package o; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import o.C13372fYk; /* renamed from: o.fYn, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C13375fYn extends AbstractC13175fSw { private fSD[] a; final fSS b; public C13375fYn(fSD[] fsdArr, fSS fss) { this.a = fsdArr; this.b = fss; } @Override // o.AbstractC13175fSw public final void e(InterfaceC13176fSx interfaceC13176fSx) { fSD[] fsdArr = this.a; int length = fsdArr.length; if (length == 1) { fsdArr[0].c(new C13372fYk.RVV(interfaceC13176fSx, new HBt(this))); return; } RVV rvv = new RVV(interfaceC13176fSx, length, this.b); interfaceC13176fSx.onSubscribe(rvv); for (int i = 0; i < length && !rvv.isDisposed(); i++) { fSD fsd = fsdArr[i]; if (fsd == null) { rvv.b(new NullPointerException("One of the sources is null"), i); return; } fsd.c(rvv.e[i]); } } /* renamed from: o.fYn$RVV */ /* loaded from: classes6.dex */ static final class RVV extends AtomicInteger implements fSJ { Object[] a; final fSS c; final InterfaceC13176fSx d; final Sts[] e; RVV(InterfaceC13176fSx interfaceC13176fSx, int i, fSS fss) { super(i); this.d = interfaceC13176fSx; this.c = fss; Sts[] stsArr = new Sts[i]; for (int i2 = 0; i2 < i; i2++) { stsArr[i2] = new Sts<>(this, i2); } this.e = stsArr; this.a = new Object[i]; } @Override // o.fSJ public final boolean isDisposed() { return get() <= 0; } @Override // o.fSJ public final void dispose() { if (getAndSet(0) > 0) { for (Sts sts : this.e) { EnumC13192fTf.e(sts); } this.a = null; } } private void e(int i) { Sts[] stsArr = this.e; int length = stsArr.length; for (int i2 = 0; i2 < i; i2++) { EnumC13192fTf.e(stsArr[i2]); } while (true) { i++; if (i >= length) { return; } else { EnumC13192fTf.e(stsArr[i]); } } } final void b(Throwable th, int i) { if (getAndSet(0) > 0) { e(i); this.a = null; this.d.onError(th); return; } C13418fZu.c(th); } } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.fYn$Sts */ /* loaded from: classes6.dex */ public static final class Sts extends AtomicReference implements InterfaceC13176fSx { private RVV a; private int d; Sts(RVV rvv, int i) { this.a = rvv; this.d = i; } @Override // o.InterfaceC13176fSx public final void onSubscribe(fSJ fsj) { EnumC13192fTf.a(this, fsj); } @Override // o.InterfaceC13176fSx public final void e(T t) { RVV rvv = this.a; int i = this.d; Object[] objArr = rvv.a; if (objArr != null) { objArr[i] = t; } if (rvv.decrementAndGet() == 0) { try { Object requireNonNull = Objects.requireNonNull(rvv.c.a(objArr), "The zipper returned a null value"); rvv.a = null; rvv.d.e(requireNonNull); } catch (Throwable th) { C13147fSI.c(th); rvv.a = null; rvv.d.onError(th); } } } @Override // o.InterfaceC13176fSx public final void onError(Throwable th) { this.a.b(th, this.d); } } /* renamed from: o.fYn$HBt */ /* loaded from: classes6.dex */ final class HBt implements fSS { private C13375fYn c; HBt(C13375fYn c13375fYn) { this.c = c13375fYn; } @Override // o.fSS public final R a(T t) throws Throwable { return (R) Objects.requireNonNull(this.c.b.a(new Object[]{t}), "The zipper returned a null value"); } } }