package defpackage;

import java.util.Arrays;

/* renamed from: ᵚᵨᵬˈ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2690 {

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final ᵧˉʙ f10422;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C5247 f10425;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public int f10424 = 0;

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

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public int[] f10419 = new int[8];

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public int[] f10421 = new int[8];

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public float[] f10420 = new float[8];

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public int f10427 = -1;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public int f10423 = -1;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public boolean f10426 = false;

    public C2690(C5247 c5247, ᵧˉʙ r5) {
        this.f10425 = c5247;
        this.f10422 = r5;
    }

    public final String toString() {
        int i = this.f10427;
        String string = "";
        for (int i2 = 0; i != -1 && i2 < this.f10424; i2++) {
            StringBuilder sbM4096 = AbstractC1327.m4096(string.concat(" -> "));
            sbM4096.append(this.f10420[i]);
            sbM4096.append(" : ");
            StringBuilder sbM40962 = AbstractC1327.m4096(sbM4096.toString());
            sbM40962.append(((C0868[]) this.f10422.ᵾᵬ)[this.f10419[i]]);
            string = sbM40962.toString();
            i = this.f10421[i];
        }
        return string;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final C0868 m6683(int i) {
        int i2 = this.f10427;
        for (int i3 = 0; i2 != -1 && i3 < this.f10424; i3++) {
            if (i3 == i) {
                return ((C0868[]) this.f10422.ᵾᵬ)[this.f10419[i2]];
            }
            i2 = this.f10421[i2];
        }
        return null;
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final void m6684(C0868 c0868, float f) {
        if (f == 0.0f) {
            m6689(c0868, true);
            return;
        }
        int i = this.f10427;
        C5247 c5247 = this.f10425;
        if (i == -1) {
            this.f10427 = 0;
            this.f10420[0] = f;
            this.f10419[0] = c0868.f3951;
            this.f10421[0] = -1;
            c0868.f3955++;
            c0868.m2990(c5247);
            this.f10424++;
            if (this.f10426) {
                return;
            }
            int i2 = this.f10423 + 1;
            this.f10423 = i2;
            int[] iArr = this.f10419;
            if (i2 >= iArr.length) {
                this.f10426 = true;
                this.f10423 = iArr.length - 1;
                return;
            }
            return;
        }
        int i3 = -1;
        for (int i4 = 0; i != -1 && i4 < this.f10424; i4++) {
            int i5 = this.f10419[i];
            int i6 = c0868.f3951;
            if (i5 == i6) {
                this.f10420[i] = f;
                return;
            }
            if (i5 < i6) {
                i3 = i;
            }
            i = this.f10421[i];
        }
        int length = this.f10423;
        int i7 = length + 1;
        if (this.f10426) {
            int[] iArr2 = this.f10419;
            if (iArr2[length] != -1) {
                length = iArr2.length;
            }
        } else {
            length = i7;
        }
        int[] iArr3 = this.f10419;
        if (length >= iArr3.length && this.f10424 < iArr3.length) {
            int i8 = 0;
            while (true) {
                int[] iArr4 = this.f10419;
                if (i8 >= iArr4.length) {
                    break;
                }
                if (iArr4[i8] == -1) {
                    length = i8;
                    break;
                }
                i8++;
            }
        }
        int[] iArr5 = this.f10419;
        if (length >= iArr5.length) {
            length = iArr5.length;
            int i9 = this.f10428 * 2;
            this.f10428 = i9;
            this.f10426 = false;
            this.f10423 = length - 1;
            this.f10420 = Arrays.copyOf(this.f10420, i9);
            this.f10419 = Arrays.copyOf(this.f10419, this.f10428);
            this.f10421 = Arrays.copyOf(this.f10421, this.f10428);
        }
        this.f10419[length] = c0868.f3951;
        this.f10420[length] = f;
        int[] iArr6 = this.f10421;
        if (i3 != -1) {
            iArr6[length] = iArr6[i3];
            iArr6[i3] = length;
        } else {
            iArr6[length] = this.f10427;
            this.f10427 = length;
        }
        c0868.f3955++;
        c0868.m2990(c5247);
        int i10 = this.f10424 + 1;
        this.f10424 = i10;
        if (!this.f10426) {
            this.f10423++;
        }
        int[] iArr7 = this.f10419;
        if (i10 >= iArr7.length) {
            this.f10426 = true;
        }
        if (this.f10423 >= iArr7.length) {
            this.f10426 = true;
            this.f10423 = iArr7.length - 1;
        }
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final float m6685(int i) {
        int i2 = this.f10427;
        for (int i3 = 0; i2 != -1 && i3 < this.f10424; i3++) {
            if (i3 == i) {
                return this.f10420[i2];
            }
            i2 = this.f10421[i2];
        }
        return 0.0f;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final float m6686(C0868 c0868) {
        int i = this.f10427;
        for (int i2 = 0; i != -1 && i2 < this.f10424; i2++) {
            if (this.f10419[i] == c0868.f3951) {
                return this.f10420[i];
            }
            i = this.f10421[i];
        }
        return 0.0f;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m6687(C0868 c0868, float f, boolean z) {
        if (f <= -0.001f || f >= 0.001f) {
            int i = this.f10427;
            C5247 c5247 = this.f10425;
            if (i == -1) {
                this.f10427 = 0;
                this.f10420[0] = f;
                this.f10419[0] = c0868.f3951;
                this.f10421[0] = -1;
                c0868.f3955++;
                c0868.m2990(c5247);
                this.f10424++;
                if (this.f10426) {
                    return;
                }
                int i2 = this.f10423 + 1;
                this.f10423 = i2;
                int[] iArr = this.f10419;
                if (i2 >= iArr.length) {
                    this.f10426 = true;
                    this.f10423 = iArr.length - 1;
                    return;
                }
                return;
            }
            int i3 = -1;
            for (int i4 = 0; i != -1 && i4 < this.f10424; i4++) {
                int i5 = this.f10419[i];
                int i6 = c0868.f3951;
                if (i5 == i6) {
                    float[] fArr = this.f10420;
                    float f2 = fArr[i] + f;
                    if (f2 > -0.001f && f2 < 0.001f) {
                        f2 = 0.0f;
                    }
                    fArr[i] = f2;
                    if (f2 == 0.0f) {
                        int i7 = this.f10427;
                        int[] iArr2 = this.f10421;
                        if (i == i7) {
                            this.f10427 = iArr2[i];
                        } else {
                            iArr2[i3] = iArr2[i];
                        }
                        if (z) {
                            c0868.m2991(c5247);
                        }
                        if (this.f10426) {
                            this.f10423 = i;
                        }
                        c0868.f3955--;
                        this.f10424--;
                        return;
                    }
                    return;
                }
                if (i5 < i6) {
                    i3 = i;
                }
                i = this.f10421[i];
            }
            int length = this.f10423;
            int i8 = length + 1;
            if (this.f10426) {
                int[] iArr3 = this.f10419;
                if (iArr3[length] != -1) {
                    length = iArr3.length;
                }
            } else {
                length = i8;
            }
            int[] iArr4 = this.f10419;
            if (length >= iArr4.length && this.f10424 < iArr4.length) {
                int i9 = 0;
                while (true) {
                    int[] iArr5 = this.f10419;
                    if (i9 >= iArr5.length) {
                        break;
                    }
                    if (iArr5[i9] == -1) {
                        length = i9;
                        break;
                    }
                    i9++;
                }
            }
            int[] iArr6 = this.f10419;
            if (length >= iArr6.length) {
                length = iArr6.length;
                int i10 = this.f10428 * 2;
                this.f10428 = i10;
                this.f10426 = false;
                this.f10423 = length - 1;
                this.f10420 = Arrays.copyOf(this.f10420, i10);
                this.f10419 = Arrays.copyOf(this.f10419, this.f10428);
                this.f10421 = Arrays.copyOf(this.f10421, this.f10428);
            }
            this.f10419[length] = c0868.f3951;
            this.f10420[length] = f;
            int[] iArr7 = this.f10421;
            if (i3 != -1) {
                iArr7[length] = iArr7[i3];
                iArr7[i3] = length;
            } else {
                iArr7[length] = this.f10427;
                this.f10427 = length;
            }
            c0868.f3955++;
            c0868.m2990(c5247);
            this.f10424++;
            if (!this.f10426) {
                this.f10423++;
            }
            int i11 = this.f10423;
            int[] iArr8 = this.f10419;
            if (i11 >= iArr8.length) {
                this.f10426 = true;
                this.f10423 = iArr8.length - 1;
            }
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final void m6688() {
        int i = this.f10427;
        for (int i2 = 0; i != -1 && i2 < this.f10424; i2++) {
            C0868 c0868 = ((C0868[]) this.f10422.ᵾᵬ)[this.f10419[i]];
            if (c0868 != null) {
                c0868.m2991(this.f10425);
            }
            i = this.f10421[i];
        }
        this.f10427 = -1;
        this.f10423 = -1;
        this.f10426 = false;
        this.f10424 = 0;
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final float m6689(C0868 c0868, boolean z) {
        int i = this.f10427;
        if (i == -1) {
            return 0.0f;
        }
        int i2 = 0;
        int i3 = -1;
        while (i != -1 && i2 < this.f10424) {
            if (this.f10419[i] == c0868.f3951) {
                int i4 = this.f10427;
                int[] iArr = this.f10421;
                if (i == i4) {
                    this.f10427 = iArr[i];
                } else {
                    iArr[i3] = iArr[i];
                }
                if (z) {
                    c0868.m2991(this.f10425);
                }
                c0868.f3955--;
                this.f10424--;
                this.f10419[i] = -1;
                if (this.f10426) {
                    this.f10423 = i;
                }
                return this.f10420[i];
            }
            i2++;
            i3 = i;
            i = this.f10421[i];
        }
        return 0.0f;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final int m6690() {
        return this.f10424;
    }
}
