package o; import java.util.Objects; import java.util.Optional; /* renamed from: o.fTz, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C13212fTz extends AbstractC13163fSk { private AbstractC13163fSk c; private fSS> d; public C13212fTz(AbstractC13163fSk abstractC13163fSk, fSS> fss) { this.c = abstractC13163fSk; this.d = fss; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { this.c.subscribe(new LWm(interfaceC13174fSv, this.d)); } /* renamed from: o.fTz$LWm */ /* loaded from: classes6.dex */ static final class LWm extends fTA { private fSS> a; LWm(InterfaceC13174fSv interfaceC13174fSv, fSS> fss) { super(interfaceC13174fSv); this.a = fss; } @Override // o.InterfaceC13174fSv public final void onNext(T t) { if (this.c) { return; } if (this.b != 0) { this.d.onNext(null); return; } try { Optional optional = (Optional) Objects.requireNonNull(this.a.a(t), "The mapper returned a null Optional"); if (optional.isPresent()) { this.d.onNext((Object) optional.get()); } } catch (Throwable th) { b(th); } } @Override // o.InterfaceC13413fZp public final int b(int i) { return e(i); } @Override // o.InterfaceC13414fZq public final R b() throws Throwable { Optional optional; do { T b = this.e.b(); if (b == null) { return null; } optional = (Optional) Objects.requireNonNull(this.a.a(b), "The mapper returned a null Optional"); } while (!optional.isPresent()); return (R) optional.get(); } } }