package defpackage;

import android.view.animation.AnimationUtils;
import java.util.ArrayList;
import java.util.Arrays;

/* renamed from: ᵜᵦˎʔ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2844 extends AbstractC3489 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public C4671 f10949;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public Runnable f10950;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final C4782 f10951;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public boolean f10952;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public boolean f10954;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final /* synthetic */ C2058 f10955;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public long f10953 = -1;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public int f10956 = 0;

    public C2844(C2058 c2058) {
        this.f10955 = c2058;
        C4782 c4782 = new C4782((char) 0, 19);
        long[] jArr = new long[20];
        c4782.f17768 = jArr;
        c4782.f17767 = new float[20];
        c4782.f17765 = 0;
        Arrays.fill(jArr, Long.MIN_VALUE);
        this.f10951 = c4782;
    }

    @Override // defpackage.AbstractC3489, defpackage.InterfaceC4048
    /* renamed from: ˎˏʜʾ */
    public final void mo1755(AbstractC0140 abstractC0140) {
        this.f10952 = true;
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final void m6950() {
        char c;
        float f;
        if (this.f10949 != null) {
            return;
        }
        long jCurrentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
        float f2 = this.f10953;
        C4782 c4782 = this.f10951;
        int i = c4782.f17765;
        float[] fArr = (float[]) c4782.f17767;
        long[] jArr = (long[]) c4782.f17768;
        char c2 = 20;
        int i2 = (i + 1) % 20;
        c4782.f17765 = i2;
        jArr[i2] = jCurrentAnimationTimeMillis;
        fArr[i2] = f2;
        C4141 c4141 = new C4141();
        float fSqrt = 0.0f;
        c4141.f15470 = 0.0f;
        this.f10949 = new C4671(c4141);
        C1107 c1107 = new C1107();
        c1107.m3525(1.0f);
        c1107.m3526(200.0f);
        C4671 c4671 = this.f10949;
        c4671.f17290 = c1107;
        c4671.f17292 = this.f10953;
        c4671.f17286 = true;
        ArrayList arrayList = c4671.f17283;
        if (c4671.f17285) {
            C0190.m1432("Error: Update listeners must be added beforethe animation.");
            return;
        }
        if (!arrayList.contains(this)) {
            arrayList.add(this);
        }
        C4671 c46712 = this.f10949;
        int i3 = c4782.f17765;
        long j = Long.MIN_VALUE;
        if (i3 != 0 || jArr[i3] != Long.MIN_VALUE) {
            long j2 = jArr[i3];
            int i4 = 0;
            long j3 = j2;
            while (true) {
                long j4 = jArr[i3];
                if (j4 == j) {
                    break;
                }
                float f3 = j2 - j4;
                float fAbs = Math.abs(j4 - j3);
                if (f3 > 100.0f || fAbs > 40.0f) {
                    break;
                }
                if (i3 == 0) {
                    i3 = 20;
                }
                i3--;
                i4++;
                if (i4 >= 20) {
                    break;
                }
                j3 = j4;
                j = Long.MIN_VALUE;
            }
            if (i4 >= 2) {
                int i5 = c4782.f17765;
                float f4 = 1000.0f;
                if (i4 == 2) {
                    int i6 = i5 == 0 ? 19 : i5 - 1;
                    float f5 = jArr[i5] - jArr[i6];
                    if (f5 != 0.0f) {
                        fSqrt = ((fArr[i5] - fArr[i6]) / f5) * 1000.0f;
                    }
                } else {
                    int i7 = ((i5 - i4) + 21) % 20;
                    int i8 = (i5 + 21) % 20;
                    long j5 = jArr[i7];
                    float f6 = fArr[i7];
                    int i9 = i7 + 1;
                    int i10 = i9 % 20;
                    float f7 = 0.0f;
                    while (i10 != i8) {
                        long j6 = jArr[i10];
                        float f8 = fSqrt;
                        int i11 = i8;
                        float f9 = j6 - j5;
                        if (f9 == f8) {
                            c = c2;
                            f = f4;
                        } else {
                            float f10 = fArr[i10];
                            c = c2;
                            f = f4;
                            float f11 = (f10 - f6) / f9;
                            float fAbs2 = (Math.abs(f11) * (f11 - ((float) (Math.sqrt(2.0f * Math.abs(f7)) * Math.signum(f7))))) + f7;
                            if (i10 == i9) {
                                fAbs2 *= 0.5f;
                            }
                            f7 = fAbs2;
                            f6 = f10;
                            j5 = j6;
                        }
                        i10 = (i10 + 1) % 20;
                        fSqrt = f8;
                        i8 = i11;
                        c2 = c;
                        f4 = f;
                    }
                    fSqrt = ((float) (Math.sqrt(Math.abs(f7) * 2.0f) * Math.signum(f7))) * f4;
                }
            }
        }
        c46712.f17288 = fSqrt;
        C4671 c46713 = this.f10949;
        c46713.f17284 = this.f10955.f1499 + 1;
        c46713.f17295 = -1.0f;
        c46713.f17293 = 4.0f;
        C1735 c1735 = new C1735(this);
        ArrayList arrayList2 = c46713.f17294;
        if (arrayList2.contains(c1735)) {
            return;
        }
        arrayList2.add(c1735);
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final void m6951() {
        if (this.f10954) {
            m6950();
            this.f10949.m9857(this.f10955.f1499 + 1);
        } else {
            this.f10956 = 1;
            this.f10950 = null;
        }
    }
}
