package defpackage;

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

/* JADX INFO: renamed from: ˌᵜˇˎ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1606 extends AbstractC3014 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public boolean f6425;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final /* synthetic */ C0737 f6426;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public boolean f6427;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public C2107 f6428;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public Runnable f6430;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final C1404 f6432;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public long f6429 = -1;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public int f6431 = 0;

    public C1606(C0737 c0737) {
        this.f6426 = c0737;
        C1404 c1404 = new C1404((char) 0, 19);
        long[] jArr = new long[20];
        c1404.f5807 = jArr;
        c1404.f5809 = new float[20];
        c1404.f5808 = 0;
        Arrays.fill(jArr, Long.MIN_VALUE);
        this.f6432 = c1404;
    }

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final void m4453() {
        if (this.f6425) {
            m4454();
            this.f6428.m5618(this.f6426.f13767 + 1);
        } else {
            this.f6431 = 1;
            this.f6430 = null;
        }
    }

    @Override // defpackage.AbstractC3014, defpackage.InterfaceC0119
    /* JADX INFO: renamed from: ᵵᵽ */
    public final void mo1213(AbstractC3629 abstractC3629) {
        this.f6427 = true;
    }

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final void m4454() {
        char c;
        float f;
        if (this.f6428 != null) {
            return;
        }
        long jCurrentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
        float f2 = this.f6429;
        C1404 c1404 = this.f6432;
        int i = c1404.f5808;
        float[] fArr = (float[]) c1404.f5809;
        long[] jArr = (long[]) c1404.f5807;
        char c2 = 20;
        int i2 = (i + 1) % 20;
        c1404.f5808 = i2;
        jArr[i2] = jCurrentAnimationTimeMillis;
        fArr[i2] = f2;
        C3873 c3873 = new C3873();
        float fSqrt = 0.0f;
        c3873.f14785 = 0.0f;
        this.f6428 = new C2107(c3873);
        C5256 c5256 = new C5256();
        c5256.m10828(1.0f);
        c5256.m10826(200.0f);
        C2107 c2107 = this.f6428;
        c2107.f8383 = c5256;
        c2107.f8379 = this.f6429;
        c2107.f8382 = true;
        ArrayList arrayList = c2107.f8386;
        if (c2107.f8393) {
            C4468.m9515("Error: Update listeners must be added beforethe animation.");
            return;
        }
        if (!arrayList.contains(this)) {
            arrayList.add(this);
        }
        C2107 c21072 = this.f6428;
        int i3 = c1404.f5808;
        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 = c1404.f5808;
                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)) * ((double) 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) * ((double) Math.signum(f7)))) * f4;
                }
            }
        }
        c21072.f8388 = fSqrt;
        C2107 c21073 = this.f6428;
        c21073.f8389 = this.f6426.f13767 + 1;
        c21073.f8380 = -1.0f;
        c21073.f8387 = 4.0f;
        C0269 c0269 = new C0269(this);
        ArrayList arrayList2 = c21073.f8390;
        if (arrayList2.contains(c0269)) {
            return;
        }
        arrayList2.add(c0269);
    }
}
