package defpackage;

import java.util.ArrayList;
import java.util.HashSet;

/* renamed from: ˎˏ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C1716 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public ArrayList f6827;

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

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

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public boolean f6830;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public C1968 f6831;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public boolean f6832;

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

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public C1968 f6834;

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final void m4900(AbstractC2841 abstractC2841, int i, ArrayList arrayList) {
        C3563 c3563 = abstractC2841.f10932;
        C3563 c35632 = abstractC2841.f10928;
        ArrayList arrayList2 = c3563.f13353;
        int size = arrayList2.size();
        int i2 = 0;
        int i3 = 0;
        while (i3 < size) {
            Object obj = arrayList2.get(i3);
            i3++;
            InterfaceC0145 interfaceC0145 = (InterfaceC0145) obj;
            if (interfaceC0145 instanceof C3563) {
                m4904((C3563) interfaceC0145, i, arrayList, null);
            } else if (interfaceC0145 instanceof AbstractC2841) {
                m4904(((AbstractC2841) interfaceC0145).f10932, i, arrayList, null);
            }
        }
        ArrayList arrayList3 = c35632.f13353;
        int size2 = arrayList3.size();
        int i4 = 0;
        while (i4 < size2) {
            Object obj2 = arrayList3.get(i4);
            i4++;
            InterfaceC0145 interfaceC01452 = (InterfaceC0145) obj2;
            if (interfaceC01452 instanceof C3563) {
                m4904((C3563) interfaceC01452, i, arrayList, null);
            } else if (interfaceC01452 instanceof AbstractC2841) {
                m4904(((AbstractC2841) interfaceC01452).f10928, i, arrayList, null);
            }
        }
        if (i == 1) {
            ArrayList arrayList4 = ((C2343) abstractC2841).f9177.f13353;
            int size3 = arrayList4.size();
            while (i2 < size3) {
                Object obj3 = arrayList4.get(i2);
                i2++;
                InterfaceC0145 interfaceC01453 = (InterfaceC0145) obj3;
                if (interfaceC01453 instanceof C3563) {
                    m4904((C3563) interfaceC01453, i, arrayList, null);
                }
            }
        }
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final void m4901() {
        C1683 c1683;
        C1716 c1716 = this;
        ArrayList arrayList = c1716.f6831.f7910;
        int size = arrayList.size();
        int i = 0;
        while (i < size) {
            int i2 = i + 1;
            C0425 c0425 = (C0425) arrayList.get(i);
            if (!c0425.f2394) {
                int[] iArr = c0425.f2382;
                int i3 = iArr[0];
                int i4 = iArr[1];
                int i5 = c0425.f2410;
                int i6 = c0425.f2381;
                boolean z = i3 == 2 || (i3 == 3 && i5 == 1);
                boolean z2 = i4 == 2 || (i4 == 3 && i6 == 1);
                C2995 c2995 = c0425.f2415.f10924;
                boolean z3 = c2995.f13352;
                C2995 c29952 = c0425.f2361.f10924;
                boolean z4 = c29952.f13352;
                boolean z5 = z;
                if (z3 && z4) {
                    c1716.m4902(1, c2995.f13346, 1, c29952.f13346, c0425);
                    c0425.f2394 = true;
                } else if (z3 && z2) {
                    m4902(1, c2995.f13346, 2, c29952.f13346, c0425);
                    C2343 c2343 = c0425.f2361;
                    if (i4 == 3) {
                        c2343.f10924.f11555 = c0425.m2010();
                    } else {
                        c2343.f10924.mo7338(c0425.m2010());
                        c0425.f2394 = true;
                    }
                } else if (z4 && z5) {
                    m4902(2, c2995.f13346, 1, c29952.f13346, c0425);
                    C0650 c0650 = c0425.f2415;
                    if (i3 == 3) {
                        c0650.f10924.f11555 = c0425.m1994();
                    } else {
                        c0650.f10924.mo7338(c0425.m1994());
                        c0425.f2394 = true;
                    }
                }
                if (c0425.f2394 && (c1683 = c0425.f2361.f9176) != null) {
                    c1683.mo7338(c0425.f2355);
                }
                c1716 = this;
            }
            i = i2;
        }
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final void m4902(int i, int i2, int i3, int i4, C0425 c0425) {
        C4267 c4267 = this.f6828;
        c4267.f15998 = i;
        c4267.f15999 = i3;
        c4267.f15996 = i2;
        c4267.f16002 = i4;
        this.f6829.m4171(c0425, c4267);
        c0425.m1987(c4267.f15993);
        c0425.m2015(c4267.f15995);
        c0425.f2370 = c4267.f16001;
        c0425.m1990(c4267.f15994);
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final void m4903() {
        C1968 c1968 = this.f6831;
        ArrayList arrayList = this.f6833;
        ArrayList arrayList2 = this.f6827;
        arrayList2.clear();
        C1968 c19682 = this.f6834;
        c19682.f2415.mo2583();
        c19682.f2361.mo2583();
        arrayList2.add(c19682.f2415);
        arrayList2.add(c19682.f2361);
        ArrayList arrayList3 = c19682.f7910;
        int size = arrayList3.size();
        HashSet hashSet = null;
        int i = 0;
        while (i < size) {
            Object obj = arrayList3.get(i);
            i++;
            C0425 c0425 = (C0425) obj;
            if (c0425 instanceof C4454) {
                C4766 c4766 = new C4766(c0425);
                c0425.f2415.mo2583();
                c0425.f2361.mo2583();
                c4766.f10926 = ((C4454) c0425).f16618;
                arrayList2.add(c4766);
            } else {
                if (c0425.m2014()) {
                    if (c0425.f2406 == null) {
                        c0425.f2406 = new C0861(c0425, 0);
                    }
                    if (hashSet == null) {
                        hashSet = new HashSet();
                    }
                    hashSet.add(c0425.f2406);
                } else {
                    arrayList2.add(c0425.f2415);
                }
                if (c0425.m2013()) {
                    if (c0425.f2373 == null) {
                        c0425.f2373 = new C0861(c0425, 1);
                    }
                    if (hashSet == null) {
                        hashSet = new HashSet();
                    }
                    hashSet.add(c0425.f2373);
                } else {
                    arrayList2.add(c0425.f2361);
                }
                if (c0425 instanceof AbstractC1133) {
                    arrayList2.add(new C1052(c0425));
                }
            }
        }
        if (hashSet != null) {
            arrayList2.addAll(hashSet);
        }
        int size2 = arrayList2.size();
        int i2 = 0;
        while (i2 < size2) {
            Object obj2 = arrayList2.get(i2);
            i2++;
            ((AbstractC2841) obj2).mo2583();
        }
        int size3 = arrayList2.size();
        int i3 = 0;
        while (i3 < size3) {
            Object obj3 = arrayList2.get(i3);
            i3++;
            AbstractC2841 abstractC2841 = (AbstractC2841) obj3;
            if (abstractC2841.f10930 != c19682) {
                abstractC2841.mo2586();
            }
        }
        arrayList.clear();
        m4900(c1968.f2415, 0, arrayList);
        m4900(c1968.f2361, 1, arrayList);
        this.f6832 = false;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m4904(C3563 c3563, int i, ArrayList arrayList, C3418 c3418) {
        AbstractC2841 abstractC2841 = c3563.f13355;
        C3418 c34182 = abstractC2841.f10927;
        C3563 c35632 = abstractC2841.f10928;
        C3563 c35633 = abstractC2841.f10932;
        if (c34182 == null) {
            C1968 c1968 = this.f6831;
            if (abstractC2841 == c1968.f2415 || abstractC2841 == c1968.f2361) {
                return;
            }
            if (c3418 == null) {
                c3418 = new C3418();
                c3418.f12714 = null;
                c3418.f12715 = new ArrayList();
                c3418.f12714 = abstractC2841;
                arrayList.add(c3418);
            }
            abstractC2841.f10927 = c3418;
            c3418.f12715.add(abstractC2841);
            ArrayList arrayList2 = c35633.f13353;
            int size = arrayList2.size();
            int i2 = 0;
            int i3 = 0;
            while (i3 < size) {
                Object obj = arrayList2.get(i3);
                i3++;
                InterfaceC0145 interfaceC0145 = (InterfaceC0145) obj;
                if (interfaceC0145 instanceof C3563) {
                    m4904((C3563) interfaceC0145, i, arrayList, c3418);
                }
            }
            ArrayList arrayList3 = c35632.f13353;
            int size2 = arrayList3.size();
            int i4 = 0;
            while (i4 < size2) {
                Object obj2 = arrayList3.get(i4);
                i4++;
                InterfaceC0145 interfaceC01452 = (InterfaceC0145) obj2;
                if (interfaceC01452 instanceof C3563) {
                    m4904((C3563) interfaceC01452, i, arrayList, c3418);
                }
            }
            if (i == 1 && (abstractC2841 instanceof C2343)) {
                ArrayList arrayList4 = ((C2343) abstractC2841).f9177.f13353;
                int size3 = arrayList4.size();
                int i5 = 0;
                while (i5 < size3) {
                    Object obj3 = arrayList4.get(i5);
                    i5++;
                    InterfaceC0145 interfaceC01453 = (InterfaceC0145) obj3;
                    if (interfaceC01453 instanceof C3563) {
                        m4904((C3563) interfaceC01453, i, arrayList, c3418);
                    }
                }
            }
            ArrayList arrayList5 = c35633.f13345;
            int size4 = arrayList5.size();
            int i6 = 0;
            while (i6 < size4) {
                Object obj4 = arrayList5.get(i6);
                i6++;
                m4904((C3563) obj4, i, arrayList, c3418);
            }
            ArrayList arrayList6 = c35632.f13345;
            int size5 = arrayList6.size();
            int i7 = 0;
            while (i7 < size5) {
                Object obj5 = arrayList6.get(i7);
                i7++;
                m4904((C3563) obj5, i, arrayList, c3418);
            }
            if (i == 1 && (abstractC2841 instanceof C2343)) {
                ArrayList arrayList7 = ((C2343) abstractC2841).f9177.f13345;
                int size6 = arrayList7.size();
                while (i2 < size6) {
                    Object obj6 = arrayList7.get(i2);
                    i2++;
                    m4904((C3563) obj6, i, arrayList, c3418);
                }
            }
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:68:0x00c9, code lost:
    
        if (r6 == 2) goto L69;
     */
    /* JADX WARN: Removed duplicated region for block: B:102:0x01ba  */
    /* JADX WARN: Removed duplicated region for block: B:134:0x029a  */
    /* JADX WARN: Removed duplicated region for block: B:136:0x02a1 A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:148:0x02e8  */
    /* JADX WARN: Removed duplicated region for block: B:152:0x0311  */
    /* JADX WARN: Removed duplicated region for block: B:155:0x0324  */
    /* JADX WARN: Removed duplicated region for block: B:156:0x0337  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00c2  */
    /* 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 void m4905(defpackage.C1968 r25) {
        /*
            Method dump skipped, instructions count: 860
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1716.m4905(ːᵙ):void");
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final int m4906(C1968 c1968, int i) {
        ArrayList arrayList;
        int i2;
        long jMax;
        float f;
        C1968 c19682 = c1968;
        ArrayList arrayList2 = this.f6833;
        int size = arrayList2.size();
        long j = 0;
        int i3 = 0;
        long jMax2 = 0;
        while (i3 < size) {
            AbstractC2841 abstractC2841 = ((C3418) arrayList2.get(i3)).f12714;
            if (!(abstractC2841 instanceof C0861) ? !(i != 0 ? (abstractC2841 instanceof C2343) : (abstractC2841 instanceof C0650)) : ((C0861) abstractC2841).f10926 != i) {
                C3563 c3563 = (i == 0 ? c19682.f2415 : c19682.f2361).f10932;
                C3563 c35632 = (i == 0 ? c19682.f2415 : c19682.f2361).f10928;
                C3563 c35633 = abstractC2841.f10932;
                C3563 c35634 = abstractC2841.f10928;
                boolean zContains = c35633.f13345.contains(c3563);
                boolean zContains2 = c35634.f13345.contains(c35632);
                long jMo2983 = abstractC2841.mo2983();
                if (zContains && zContains2) {
                    long jM7782 = C3418.m7782(c35633, j);
                    arrayList = arrayList2;
                    long jM7781 = C3418.m7781(c35634, j);
                    long j2 = jM7782 - jMo2983;
                    int i4 = c35634.f13347;
                    i2 = i3;
                    if (j2 >= (-i4)) {
                        j2 += i4;
                    }
                    long j3 = c35633.f13347;
                    long j4 = ((-jM7781) - jMo2983) - j3;
                    if (j4 >= j3) {
                        j4 -= j3;
                    }
                    C0425 c0425 = abstractC2841.f10930;
                    if (i == 0) {
                        f = c0425.f2368;
                    } else if (i == 1) {
                        f = c0425.f2383;
                    } else {
                        c0425.getClass();
                        f = -1.0f;
                    }
                    float f2 = f > 0.0f ? (long) ((j2 / (1.0f - f)) + (j4 / f)) : 0L;
                    jMax = (c35633.f13347 + ((((long) ((f2 * f) + 0.5f)) + jMo2983) + ((long) (((1.0f - f) * f2) + 0.5f)))) - c35634.f13347;
                } else {
                    arrayList = arrayList2;
                    i2 = i3;
                    jMax = zContains ? Math.max(C3418.m7782(c35633, c35633.f13347), c35633.f13347 + jMo2983) : zContains2 ? Math.max(-C3418.m7781(c35634, c35634.f13347), (-c35634.f13347) + jMo2983) : (abstractC2841.mo2983() + c35633.f13347) - c35634.f13347;
                }
            } else {
                arrayList = arrayList2;
                jMax = j;
                i2 = i3;
            }
            jMax2 = Math.max(jMax2, jMax);
            i3 = i2 + 1;
            arrayList2 = arrayList;
            c19682 = c1968;
            j = 0;
        }
        return (int) jMax2;
    }
}
