package z;

import android.view.View;
import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.util.Arrays;

/* JADX INFO: loaded from: classes.dex */
public abstract class k {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public v.d f36997a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int[] f36998b = new int[10];

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public float[] f36999c = new float[10];

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f37000d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public String f37001e;

    public final float a(float f10) {
        return (float) this.f36997a.e(f10);
    }

    public void b(float f10, int i10) {
        int[] iArr = this.f36998b;
        if (iArr.length < this.f37000d + 1) {
            this.f36998b = Arrays.copyOf(iArr, iArr.length * 2);
            float[] fArr = this.f36999c;
            this.f36999c = Arrays.copyOf(fArr, fArr.length * 2);
        }
        int[] iArr2 = this.f36998b;
        int i11 = this.f37000d;
        iArr2[i11] = i10;
        this.f36999c[i11] = f10;
        this.f37000d = i11 + 1;
    }

    public abstract void c(float f10, View view);

    /* JADX WARN: Removed duplicated region for block: B:31:0x009b  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void d(int i10) {
        int i11 = this.f37000d;
        if (i11 == 0) {
            return;
        }
        int[] iArr = this.f36998b;
        float[] fArr = this.f36999c;
        int[] iArr2 = new int[iArr.length + 10];
        iArr2[0] = i11 - 1;
        iArr2[1] = 0;
        int i12 = 2;
        while (i12 > 0) {
            int i13 = i12 - 1;
            int i14 = iArr2[i13];
            int i15 = i12 - 2;
            int i16 = iArr2[i15];
            if (i14 < i16) {
                int i17 = iArr[i16];
                int i18 = i14;
                int i19 = i18;
                while (i18 < i16) {
                    int i20 = iArr[i18];
                    if (i20 <= i17) {
                        int i21 = iArr[i19];
                        iArr[i19] = i20;
                        iArr[i18] = i21;
                        float f10 = fArr[i19];
                        fArr[i19] = fArr[i18];
                        fArr[i18] = f10;
                        i19++;
                    }
                    i18++;
                }
                int i22 = iArr[i19];
                iArr[i19] = iArr[i16];
                iArr[i16] = i22;
                float f11 = fArr[i19];
                fArr[i19] = fArr[i16];
                fArr[i16] = f11;
                iArr2[i15] = i19 - 1;
                iArr2[i13] = i14;
                int i23 = i12 + 1;
                iArr2[i12] = i16;
                i12 += 2;
                iArr2[i23] = i19 + 1;
            } else {
                i12 = i15;
            }
        }
        int i24 = 1;
        for (int i25 = 1; i25 < this.f37000d; i25++) {
            int[] iArr3 = this.f36998b;
            if (iArr3[i25 - 1] != iArr3[i25]) {
                i24++;
            }
        }
        double[] dArr = new double[i24];
        double[][] dArr2 = (double[][]) Array.newInstance((Class<?>) Double.TYPE, i24, 1);
        int i26 = 0;
        for (int i27 = 0; i27 < this.f37000d; i27++) {
            if (i27 > 0) {
                int[] iArr4 = this.f36998b;
                if (iArr4[i27] != iArr4[i27 - 1]) {
                    dArr[i26] = ((double) this.f36998b[i27]) * 0.01d;
                    dArr2[i26][0] = this.f36999c[i27];
                    i26++;
                }
            }
        }
        this.f36997a = v.d.d(i10, dArr, dArr2);
    }

    /* JADX INFO: renamed from: e, reason: merged with bridge method [inline-methods] */
    public final String toString() {
        String string = this.f37001e;
        DecimalFormat decimalFormat = new DecimalFormat("##.##");
        for (int i10 = 0; i10 < this.f37000d; i10++) {
            StringBuilder sbD = u.a.d(string, "[");
            sbD.append(this.f36998b[i10]);
            sbD.append(" , ");
            sbD.append(decimalFormat.format(this.f36999c[i10]));
            sbD.append("] ");
            string = sbD.toString();
        }
        return string;
    }
}
