package defpackage;

/* JADX INFO: renamed from: ᵵᵝᵤ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4739 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final int f18015;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final int f18016;

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public int f18017;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final float f18018;

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public int f18019;

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public int f18020;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final float f18021;

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public int f18022;

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public int f18023;

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public double f18024;

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public int f18025;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final int f18026;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final int f18027;

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public int f18028;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final float f18029;

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final InterfaceC2633 f18030;

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

    public C4739(int i, int i2, float f, float f2, int i3, boolean z) {
        this.f18026 = i;
        this.f18015 = i2;
        this.f18018 = f;
        this.f18029 = f2;
        this.f18021 = i / i3;
        this.f18031 = i / 400;
        int i4 = i / 65;
        this.f18027 = i4;
        this.f18016 = i4 * 2;
        this.f18030 = z ? new C0151(this) : new C2748(this);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m9901() {
        float f;
        int iMo1290;
        double d;
        int i;
        int iRound;
        int i2;
        int i3;
        int iRound2;
        int i4;
        int i5;
        long j;
        long j2;
        int i6 = this.f18028;
        float f2 = this.f18018;
        float f3 = this.f18029;
        double d2 = f2 / f3;
        float f4 = this.f18021 * f3;
        int i7 = this.f18026;
        int i8 = 1;
        InterfaceC2633 interfaceC2633 = this.f18030;
        int i9 = this.f18015;
        if (d2 > 1.0000100135803223d || d2 < 0.9999899864196777d) {
            int i10 = this.f18025;
            int i11 = this.f18016;
            if (i10 >= i11) {
                int i12 = 0;
                while (true) {
                    int i13 = this.f18022;
                    if (i13 > 0) {
                        int iMin = Math.min(i11, i13);
                        m9902(i12, iMin);
                        this.f18022 -= iMin;
                        i12 += iMin;
                        f = f4;
                        d = d2;
                        i2 = i8;
                        i = i11;
                    } else {
                        int i14 = i7 > 4000 ? i7 / 4000 : i8;
                        int i15 = this.f18027;
                        int i16 = this.f18031;
                        if (i9 == i8 && i14 == i8) {
                            iMo1290 = interfaceC2633.mo1287(i12, i16, i15);
                            f = f4;
                        } else {
                            interfaceC2633.mo1295(i12, i14);
                            f = f4;
                            int iMo12902 = interfaceC2633.mo1290(i16 / i14, i15 / i14);
                            if (i14 != i8) {
                                int i17 = iMo12902 * i14;
                                int i18 = i14 * 4;
                                int i19 = i17 - i18;
                                int i20 = i17 + i18;
                                if (i19 >= i16) {
                                    i16 = i19;
                                }
                                if (i20 <= i15) {
                                    i15 = i20;
                                }
                                if (i9 == i8) {
                                    iMo1290 = interfaceC2633.mo1287(i12, i16, i15);
                                } else {
                                    interfaceC2633.mo1295(i12, i8);
                                    iMo1290 = interfaceC2633.mo1290(i16, i15);
                                }
                            } else {
                                iMo1290 = iMo12902;
                            }
                        }
                        int i21 = interfaceC2633.mo1291() ? this.f18020 : iMo1290;
                        interfaceC2633.mo1297();
                        this.f18020 = iMo1290;
                        double d3 = this.f18024;
                        if (d2 > 1.0d) {
                            if (d2 >= 2.0d) {
                                i3 = i8;
                                double d4 = (((double) i21) / (d2 - 1.0d)) + d3;
                                iRound2 = (int) Math.round(d4);
                                d = d2;
                                this.f18024 = d4 - ((double) iRound2);
                                interfaceC2633 = interfaceC2633;
                            } else {
                                d = d2;
                                i3 = i8;
                                double d5 = (((2.0d - d) * ((double) i21)) / (d - 1.0d)) + d3;
                                int iRound3 = (int) Math.round(d5);
                                this.f18022 = iRound3;
                                this.f18024 = d5 - ((double) iRound3);
                                iRound2 = i21;
                            }
                            interfaceC2633.mo1296(iRound2);
                            int i22 = i11;
                            int i23 = iRound2;
                            interfaceC2633.mo1285(i23, this.f18015, this.f18028, i12, i12 + i21);
                            this.f18028 += i23;
                            i12 = i21 + i23 + i12;
                            i = i22;
                            i2 = i3;
                        } else {
                            d = d2;
                            int i24 = i8;
                            int i25 = i11;
                            if (d < 0.5d) {
                                i = i25;
                                double d6 = ((((double) i21) * d) / (1.0d - d)) + d3;
                                iRound = (int) Math.round(d6);
                                this.f18024 = d6 - ((double) iRound);
                            } else {
                                i = i25;
                                double d7 = ((((2.0d * d) - 1.0d) * ((double) i21)) / (1.0d - d)) + d3;
                                int iRound4 = (int) Math.round(d7);
                                this.f18022 = iRound4;
                                this.f18024 = d7 - ((double) iRound4);
                                iRound = i21;
                            }
                            int i26 = i21 + iRound;
                            interfaceC2633.mo1296(i26);
                            i2 = i24;
                            System.arraycopy(interfaceC2633.mo1293(), i12 * i9, interfaceC2633.mo1282(), this.f18028 * i9, i21 * i9);
                            int i27 = i12;
                            interfaceC2633.mo1285(iRound, this.f18015, this.f18028 + i21, i21 + i12, i27);
                            this.f18028 += i26;
                            i12 = i27 + iRound;
                        }
                    }
                    if (i12 + i > i10) {
                        break;
                    }
                    i11 = i;
                    f4 = f;
                    i8 = i2;
                    d2 = d;
                }
                int i28 = this.f18025 - i12;
                System.arraycopy(interfaceC2633.mo1293(), i12 * i9, interfaceC2633.mo1293(), 0, i28 * i9);
                this.f18025 = i28;
            }
            if (f != 1.0f || this.f18028 == i6) {
            }
            long j3 = (long) (i7 / f);
            long j4 = i7;
            while (j3 != 0 && j4 != 0 && j3 % 2 == 0 && j4 % 2 == 0) {
                j3 /= 2;
                j4 /= 2;
            }
            int i29 = this.f18028 - i6;
            interfaceC2633.mo1283(i29);
            System.arraycopy(interfaceC2633.mo1282(), i6 * i9, interfaceC2633.mo1289(), this.f18023 * i9, i29 * i9);
            this.f18028 = i6;
            this.f18023 += i29;
            int i30 = 0;
            while (true) {
                i4 = this.f18023 - 1;
                if (i30 >= i4) {
                    break;
                }
                while (true) {
                    i5 = this.f18019 + 1;
                    j = i5;
                    long j5 = j * j3;
                    j2 = this.f18017;
                    if (j5 <= j2 * j4) {
                        break;
                    }
                    int i31 = i2;
                    interfaceC2633.mo1296(i31);
                    interfaceC2633.mo1294(j4, i30, j3);
                    this.f18017 += i31;
                    this.f18028 += i31;
                }
                int i32 = i2;
                this.f18019 = i5;
                if (j == j4) {
                    this.f18019 = 0;
                    ᵻᵪ.ˌᴵ(j2 == j3 ? i32 : 0);
                    this.f18017 = 0;
                }
                i30++;
                i2 = i32;
            }
            if (i4 == 0) {
                return;
            }
            System.arraycopy(interfaceC2633.mo1289(), i4 * i9, interfaceC2633.mo1289(), 0, (this.f18023 - i4) * i9);
            this.f18023 -= i4;
            return;
        }
        m9902(0, this.f18025);
        this.f18025 = 0;
        f = f4;
        i2 = 1;
        if (f != 1.0f) {
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final void m9902(int i, int i2) {
        InterfaceC2633 interfaceC2633 = this.f18030;
        interfaceC2633.mo1296(i2);
        Object objMo1293 = interfaceC2633.mo1293();
        int i3 = this.f18015;
        System.arraycopy(objMo1293, i * i3, interfaceC2633.mo1282(), this.f18028 * i3, i3 * i2);
        this.f18028 += i2;
    }
}
