package y;

import java.util.Iterator;

/* loaded from: classes.dex */
public final class y1 implements x1 {

    /* renamed from: a, reason: collision with root package name */
    private final s f51455a;

    /* renamed from: b, reason: collision with root package name */
    private q f51456b;

    /* renamed from: c, reason: collision with root package name */
    private q f51457c;

    /* renamed from: d, reason: collision with root package name */
    private q f51458d;

    /* loaded from: classes.dex */
    public static final class a implements s {

        /* renamed from: a, reason: collision with root package name */
        final /* synthetic */ h0 f51459a;

        a(h0 h0Var) {
            this.f51459a = h0Var;
        }

        @Override // y.s
        public h0 get(int i10) {
            return this.f51459a;
        }
    }

    public y1(s sVar) {
        this.f51455a = sVar;
    }

    @Override // y.t1
    public long b(q qVar, q qVar2, q qVar3) {
        jn.i q10;
        q10 = jn.o.q(0, qVar.b());
        Iterator it = q10.iterator();
        long j10 = 0;
        while (it.hasNext()) {
            int a10 = ((sm.k0) it).a();
            j10 = Math.max(j10, this.f51455a.get(a10).c(qVar.a(a10), qVar2.a(a10), qVar3.a(a10)));
        }
        return j10;
    }

    @Override // y.t1
    public q c(long j10, q qVar, q qVar2, q qVar3) {
        if (this.f51456b == null) {
            this.f51456b = r.g(qVar);
        }
        q qVar4 = this.f51456b;
        if (qVar4 == null) {
            kotlin.jvm.internal.t.y("valueVector");
            qVar4 = null;
        }
        int b10 = qVar4.b();
        for (int i10 = 0; i10 < b10; i10++) {
            q qVar5 = this.f51456b;
            if (qVar5 == null) {
                kotlin.jvm.internal.t.y("valueVector");
                qVar5 = null;
            }
            qVar5.e(i10, this.f51455a.get(i10).e(j10, qVar.a(i10), qVar2.a(i10), qVar3.a(i10)));
        }
        q qVar6 = this.f51456b;
        if (qVar6 != null) {
            return qVar6;
        }
        kotlin.jvm.internal.t.y("valueVector");
        return null;
    }

    @Override // y.t1
    public q d(long j10, q qVar, q qVar2, q qVar3) {
        if (this.f51457c == null) {
            this.f51457c = r.g(qVar3);
        }
        q qVar4 = this.f51457c;
        if (qVar4 == null) {
            kotlin.jvm.internal.t.y("velocityVector");
            qVar4 = null;
        }
        int b10 = qVar4.b();
        for (int i10 = 0; i10 < b10; i10++) {
            q qVar5 = this.f51457c;
            if (qVar5 == null) {
                kotlin.jvm.internal.t.y("velocityVector");
                qVar5 = null;
            }
            qVar5.e(i10, this.f51455a.get(i10).b(j10, qVar.a(i10), qVar2.a(i10), qVar3.a(i10)));
        }
        q qVar6 = this.f51457c;
        if (qVar6 != null) {
            return qVar6;
        }
        kotlin.jvm.internal.t.y("velocityVector");
        return null;
    }

    @Override // y.t1
    public q f(q qVar, q qVar2, q qVar3) {
        if (this.f51458d == null) {
            this.f51458d = r.g(qVar3);
        }
        q qVar4 = this.f51458d;
        if (qVar4 == null) {
            kotlin.jvm.internal.t.y("endVelocityVector");
            qVar4 = null;
        }
        int b10 = qVar4.b();
        for (int i10 = 0; i10 < b10; i10++) {
            q qVar5 = this.f51458d;
            if (qVar5 == null) {
                kotlin.jvm.internal.t.y("endVelocityVector");
                qVar5 = null;
            }
            qVar5.e(i10, this.f51455a.get(i10).d(qVar.a(i10), qVar2.a(i10), qVar3.a(i10)));
        }
        q qVar6 = this.f51458d;
        if (qVar6 != null) {
            return qVar6;
        }
        kotlin.jvm.internal.t.y("endVelocityVector");
        return null;
    }

    public y1(h0 h0Var) {
        this(new a(h0Var));
    }
}
