package defpackage;

import java.util.ArrayList;

/* renamed from: ᵝᵽⁱ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2936 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final ʾᵛ f11376;

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public long f11377;

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public C0950 f11378;

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

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public long f11380;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final C0422 f11381;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public C0950 f11382;

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public int f11385;

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public C0950 f11386;

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public Object f11387;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public C0950 f11389;

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public C0950 f11390;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public boolean f11391;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final C5073 f11392;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C4479 f11384 = new C4479();

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C3254 f11388 = new C3254();

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public ArrayList f11383 = new ArrayList();

    public C2936(C0422 c0422, C5073 c5073, ʾᵛ r3, C3933 c3933) {
        this.f11381 = c0422;
        this.f11392 = c5073;
        this.f11376 = r3;
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public static C2477 m7147(AbstractC0488 abstractC0488, Object obj, long j, long j2, C3254 c3254, C4479 c4479) {
        abstractC0488.mo2117(obj, c4479);
        abstractC0488.m2122(c4479.f16708, c3254);
        abstractC0488.mo2125(obj);
        int i = c4479.f16706.f19278;
        if (i != 0) {
            if (i == 1) {
                c4479.m9526(0);
            }
            c4479.f16706.getClass();
            c4479.m9525(0);
        }
        abstractC0488.mo2117(obj, c4479);
        int iM9527 = c4479.m9527(j);
        return iM9527 == -1 ? new C2477(obj, j2, c4479.m9529(j)) : new C2477(obj, iM9527, c4479.m9524(iM9527), j2, -1);
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final C5418 m7148(AbstractC0488 abstractC0488, Object obj, int i, int i2, long j, long j2, boolean z) {
        C2477 c2477 = new C2477(obj, i, i2, j2, -1);
        C4479 c4479 = this.f11384;
        long jM9528 = abstractC0488.mo2117(obj, c4479).m9528(i, i2);
        if (i2 == c4479.m9524(i)) {
            c4479.f16706.getClass();
        }
        c4479.m9525(i);
        long jMax = 0;
        if (jM9528 != -9223372036854775807L && 0 >= jM9528) {
            jMax = Math.max(0L, jM9528 - 1);
        }
        return new C5418(c2477, jMax, -9223372036854775807L, j, -9223372036854775807L, jM9528, z, false, false, false, false);
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final C2477 m7149(AbstractC0488 abstractC0488, Object obj, long j) {
        long jM7156;
        int iMo2125;
        Object obj2 = obj;
        C4479 c4479 = this.f11384;
        int i = abstractC0488.mo2117(obj2, c4479).f16708;
        Object obj3 = this.f11387;
        if (obj3 == null || (iMo2125 = abstractC0488.mo2125(obj3)) == -1 || abstractC0488.mo2118(iMo2125, c4479, false).f16708 != i) {
            C0950 c0950 = this.f11382;
            while (true) {
                if (c0950 == null) {
                    C0950 c09502 = this.f11382;
                    while (true) {
                        if (c09502 != null) {
                            int iMo21252 = abstractC0488.mo2125(c09502.f4283);
                            if (iMo21252 != -1 && abstractC0488.mo2118(iMo21252, c4479, false).f16708 == i) {
                                jM7156 = c09502.f4275.f20311.f9685;
                                break;
                            }
                            c09502 = c09502.f4281;
                        } else {
                            jM7156 = m7156(obj2);
                            if (jM7156 == -1) {
                                jM7156 = this.f11380;
                                this.f11380 = 1 + jM7156;
                                if (this.f11382 == null) {
                                    this.f11387 = obj2;
                                    this.f11377 = jM7156;
                                }
                            }
                        }
                    }
                } else {
                    if (c0950.f4283.equals(obj2)) {
                        jM7156 = c0950.f4275.f20311.f9685;
                        break;
                    }
                    c0950 = c0950.f4281;
                }
            }
        } else {
            jM7156 = this.f11377;
        }
        abstractC0488.mo2117(obj2, c4479);
        int i2 = c4479.f16708;
        C3254 c3254 = this.f11388;
        abstractC0488.m2122(i2, c3254);
        boolean z = false;
        for (int iMo21253 = abstractC0488.mo2125(obj); iMo21253 >= c3254.f12263; iMo21253--) {
            abstractC0488.mo2118(iMo21253, c4479, true);
            boolean z2 = c4479.f16706.f19278 > 0;
            z |= z2;
            if (c4479.m9527(c4479.f16711) != -1) {
                obj2 = c4479.f16710;
                obj2.getClass();
            }
            if (z && (!z2 || c4479.f16711 != 0)) {
                break;
            }
        }
        return m7147(abstractC0488, obj2, j, jM7156, this.f11388, this.f11384);
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final void m7150() {
        C4704 c4704M6701 = AbstractC2692.m6701();
        for (C0950 c0950 = this.f11382; c0950 != null; c0950 = c0950.f4281) {
            c4704M6701.m3197(c0950.f4275.f20311);
        }
        C0950 c09502 = this.f11389;
        this.f11392.m10539(new RunnableC2331(this, c4704M6701, c09502 == null ? null : c09502.f4275.f20311, 9));
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final C0950 m7151() {
        return this.f11390;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final C5418 m7152(AbstractC0488 abstractC0488, Object obj, long j, long j2, long j3, long j4, boolean z) {
        long j5;
        C4479 c4479 = this.f11384;
        abstractC0488.mo2117(obj, c4479);
        int iM9529 = c4479.m9529(j);
        boolean z2 = false;
        if (iM9529 != -1) {
            c4479.m9525(iM9529);
        } else if (c4479.f16706.f19278 > 0) {
            c4479.m9525(0);
        }
        C2477 c2477 = new C2477(obj, j4, iM9529);
        if (!c2477.m6321() && iM9529 == -1) {
            z2 = true;
        }
        boolean zM7161 = m7161(abstractC0488, c2477);
        boolean zM7154 = m7154(abstractC0488, c2477, z2);
        if (iM9529 != -1) {
            c4479.m9525(iM9529);
        }
        if (iM9529 != -1) {
            c4479.m9526(iM9529);
        }
        if (iM9529 != -1) {
            c4479.m9531(iM9529);
            j5 = 0;
        } else {
            j5 = -9223372036854775807L;
        }
        long j6 = (j5 == -9223372036854775807L || j5 == Long.MIN_VALUE) ? c4479.f16711 : j5;
        return new C5418(c2477, (j6 == -9223372036854775807L || j < j6) ? j : Math.max(0L, j6 - 1), j2, j3, j5, j6, z, false, z2, zM7161, zM7154);
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x008a  */
    /* renamed from: ˏᵙ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final defpackage.C5418 m7153(defpackage.AbstractC0488 r21, defpackage.C0950 r22, long r23) {
        /*
            Method dump skipped, instructions count: 490
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C2936.m7153(ʿᵿᵛᵠ, ˇᵕᵔ, long):ᵾᴵᵵ");
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final boolean m7154(AbstractC0488 abstractC0488, C2477 c2477, boolean z) {
        int iMo2125 = abstractC0488.mo2125(c2477.f9683);
        if (!abstractC0488.mo2123(abstractC0488.mo2118(iMo2125, this.f11384, false).f16708, this.f11388, 0L).f12268) {
            if (abstractC0488.m2129(iMo2125, this.f11384, this.f11388, this.f11379, this.f11391) == -1 && z) {
                return true;
            }
        }
        return false;
    }

    /* JADX WARN: Removed duplicated region for block: B:61:0x00c9  */
    /* renamed from: ᵞʡ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final int m7155(defpackage.AbstractC0488 r23, long r24, long r26, long r28) {
        /*
            Method dump skipped, instructions count: 235
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C2936.m7155(ʿᵿᵛᵠ, long, long, long):int");
    }

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public final long m7156(Object obj) {
        for (int i = 0; i < this.f11383.size(); i++) {
            C0950 c0950 = (C0950) this.f11383.get(i);
            if (c0950.f4283.equals(obj)) {
                return c0950.f4275.f20311.f9685;
            }
        }
        return -1L;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C0950 m7157() {
        C0950 c0950 = this.f11382;
        if (c0950 == null) {
            return null;
        }
        if (c0950 == this.f11389) {
            this.f11389 = c0950.f4281;
        }
        if (c0950 == this.f11390) {
            this.f11390 = c0950.f4281;
        }
        c0950.m3210();
        int i = this.f11385 - 1;
        this.f11385 = i;
        if (i == 0) {
            this.f11378 = null;
            C0950 c09502 = this.f11382;
            this.f11387 = c09502.f4283;
            this.f11377 = c09502.f4275.f20311.f9685;
        }
        this.f11382 = this.f11382.f4281;
        m7150();
        return this.f11382;
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final int m7158(C0950 c0950) {
        c0950.getClass();
        int i = 0;
        if (c0950 != this.f11378) {
            this.f11378 = c0950;
            while (true) {
                c0950 = c0950.f4281;
                if (c0950 == null) {
                    break;
                }
                if (c0950 == this.f11389) {
                    C0950 c09502 = this.f11382;
                    this.f11389 = c09502;
                    this.f11390 = c09502;
                    i = 3;
                }
                if (c0950 == this.f11390) {
                    this.f11390 = this.f11389;
                    i |= 2;
                }
                c0950.m3210();
                this.f11385--;
            }
            C0950 c09503 = this.f11378;
            c09503.getClass();
            if (c09503.f4281 != null) {
                c09503.m3212();
                c09503.f4281 = null;
                c09503.m3209();
            }
            m7150();
        }
        return i;
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final void m7159(long j) {
        C0950 c0950 = this.f11378;
        if (c0950 != null) {
            ᵛᵾˏ.ᵿʗᵝʽ(c0950.f4281 == null);
            if (c0950.f4272) {
                c0950.f4279.mo1664(j - c0950.f4273);
            }
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final void m7160() {
        if (this.f11385 == 0) {
            return;
        }
        C0950 c0950 = this.f11382;
        c0950.getClass();
        this.f11387 = c0950.f4283;
        this.f11377 = c0950.f4275.f20311.f9685;
        while (c0950 != null) {
            c0950.m3210();
            c0950 = c0950.f4281;
        }
        this.f11382 = null;
        this.f11378 = null;
        this.f11389 = null;
        this.f11390 = null;
        this.f11385 = 0;
        m7150();
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final boolean m7161(AbstractC0488 abstractC0488, C2477 c2477) {
        boolean z = !c2477.m6321() && c2477.f9681 == -1;
        Object obj = c2477.f9683;
        if (z) {
            if (abstractC0488.mo2123(abstractC0488.mo2117(obj, this.f11384).f16708, this.f11388, 0L).f12262 == abstractC0488.mo2125(obj)) {
                return true;
            }
        }
        return false;
    }

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public final int m7162(AbstractC0488 abstractC0488) {
        AbstractC0488 abstractC04882;
        C0950 c0950;
        C0950 c09502 = this.f11382;
        if (c09502 == null) {
            return 0;
        }
        int iMo2125 = abstractC0488.mo2125(c09502.f4283);
        while (true) {
            abstractC04882 = abstractC0488;
            iMo2125 = abstractC04882.m2129(iMo2125, this.f11384, this.f11388, this.f11379, this.f11391);
            while (true) {
                c0950 = c09502.f4281;
                if (c0950 == null || c09502.f4275.f20310) {
                    break;
                }
                c09502 = c0950;
            }
            if (iMo2125 == -1 || c0950 == null || abstractC04882.mo2125(c0950.f4283) != iMo2125) {
                break;
            }
            c09502 = c0950;
            abstractC0488 = abstractC04882;
        }
        int iM7158 = m7158(c09502);
        c09502.f4275 = m7164(abstractC04882, c09502.f4275);
        return iM7158;
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final void m7163() {
        C0950 c0950 = this.f11386;
        if (c0950 == null || c0950.m3215()) {
            this.f11386 = null;
            for (int i = 0; i < this.f11383.size(); i++) {
                C0950 c09502 = (C0950) this.f11383.get(i);
                if (!c09502.m3215()) {
                    this.f11386 = c09502;
                    return;
                }
            }
        }
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final C5418 m7164(AbstractC0488 abstractC0488, C5418 c5418) {
        long j;
        C2477 c2477 = c5418.f20311;
        boolean zM6321 = c2477.m6321();
        int i = c2477.f9681;
        boolean z = !zM6321 && i == -1;
        int i2 = c2477.f9684;
        boolean zM7161 = m7161(abstractC0488, c2477);
        boolean zM7154 = m7154(abstractC0488, c2477, z);
        Object obj = c2477.f9683;
        C4479 c4479 = this.f11384;
        abstractC0488.mo2117(obj, c4479);
        if (c2477.m6321() || i == -1) {
            j = -9223372036854775807L;
        } else {
            c4479.m9531(i);
            j = 0;
        }
        long jM9528 = c2477.m6321() ? c4479.m9528(i2, c2477.f9682) : (j == -9223372036854775807L || j == Long.MIN_VALUE) ? c4479.f16711 : j;
        if (c2477.m6321()) {
            c4479.m9525(i2);
        } else if (i != -1) {
            c4479.m9525(i);
        }
        return new C5418(c2477, c5418.f20312, c5418.f20309, c5418.f20316, j, jM9528, c5418.f20307, false, z, zM7161, zM7154);
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final C5418 m7165(AbstractC0488 abstractC0488, C2477 c2477, long j, long j2, long j3) {
        abstractC0488.mo2117(c2477.f9683, this.f11384);
        boolean zM6321 = c2477.m6321();
        Object obj = c2477.f9683;
        return zM6321 ? m7148(abstractC0488, obj, c2477.f9684, c2477.f9682, j, c2477.f9685, false) : m7152(abstractC0488, obj, j2, j3, j, c2477.f9685, false);
    }
}
