package defpackage;

import android.os.Looper;
import android.util.AndroidRuntimeException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

/* renamed from: ˌᵭ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C1635 extends AbstractC1144 implements InterfaceC1739 {

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public static final C4544 f6524 = new C4544(2);

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public AbstractC2717 f6526;

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public int f6527;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public long f6528;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public C3205 f6529;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public boolean f6530;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public long f6532;

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public boolean f6533;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public C2255 f6535;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public long f6538;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public C4098 f6539;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public long f6540;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public InterfaceC4625 f6541;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public boolean f6543;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public ArrayList f6542 = new ArrayList();

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public C2771 f6537 = new C2771(0);

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public ArrayList f6536 = new ArrayList();

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public ArrayList f6525 = new ArrayList();

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public boolean f6534 = false;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public boolean f6531 = false;

    public C1635() {
        C3205 c3205M7553 = C3205.m7553(0.0f, 1.0f);
        c3205M7553.mo3587(0L);
        this.f6529 = c3205M7553;
        C4098 c4098 = new C4098(c3205M7553);
        this.f6539 = c4098;
        this.f6538 = -1L;
        this.f6541 = null;
        this.f6532 = 0L;
        this.f6540 = -1L;
        this.f6527 = -1;
        this.f6543 = false;
        this.f6533 = true;
        this.f6535 = new C2255(this);
        this.f6530 = false;
        this.f6528 = -1L;
        this.f6526 = new C2724(this, 0);
        this.f6537.put(c3205M7553, c4098);
        this.f6525.add(this.f6539);
    }

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public static boolean m4674(C1635 c1635) {
        for (int i = 0; i < c1635.m4684().size(); i++) {
            AbstractC1144 abstractC1144 = (AbstractC1144) c1635.m4684().get(i);
            if (!(abstractC1144 instanceof C1635) || !m4674((C1635) abstractC1144)) {
                return false;
            }
        }
        return true;
    }

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public static void m4675(long j, C4098 c4098) {
        if (c4098.f15321) {
            return;
        }
        c4098.f15321 = c4098.f15319.mo3581((long) (j * 1.0f));
    }

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public static void m4676(C4098 c4098, ArrayList arrayList) {
        if (arrayList.contains(c4098)) {
            return;
        }
        arrayList.add(c4098);
        if (c4098.f15320 == null) {
            return;
        }
        for (int i = 0; i < c4098.f15320.size(); i++) {
            m4676((C4098) c4098.f15320.get(i), arrayList);
        }
    }

    @Override // defpackage.AbstractC1144
    public final void cancel() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (this.f6531) {
            ArrayList arrayList = this.f4898;
            if (arrayList != null) {
                ArrayList arrayList2 = (ArrayList) arrayList.clone();
                int size = arrayList2.size();
                for (int i = 0; i < size; i++) {
                    ((InterfaceC0793) arrayList2.get(i)).mo2897();
                }
            }
            ArrayList arrayList3 = new ArrayList(this.f6542);
            int size2 = arrayList3.size();
            for (int i2 = 0; i2 < size2; i2++) {
                ((C4098) arrayList3.get(i2)).f15319.cancel();
            }
            this.f6542.clear();
            m4683();
        }
    }

    public final String toString() {
        String str = "AnimatorSet@" + Integer.toHexString(hashCode()) + "{";
        int size = this.f6525.size();
        for (int i = 0; i < size; i++) {
            str = str + "\n    " + ((C4098) this.f6525.get(i)).f15319.toString();
        }
        return str.concat("\n}");
    }

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final long m4677(long j, C4098 c4098) {
        if (!this.f6543) {
            return j - c4098.f15315;
        }
        return c4098.f15314 - (mo3584() - j);
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ˌᵜᵹᵩ */
    public final boolean mo3581(long j) {
        return mo4687(j);
    }

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final void m4678() {
        if (this.f6541 != null) {
            for (int i = 0; i < this.f6525.size(); i++) {
                ((C4098) this.f6525.get(i)).f15319.mo3589(this.f6541);
            }
        }
        m4680();
        m4685();
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ˑᵱ, reason: contains not printable characters and merged with bridge method [inline-methods] and merged with bridge method [inline-methods] */
    public final C1635 mo3582() {
        C1635 c1635 = (C1635) super.mo3582();
        int size = this.f6525.size();
        c1635.f6531 = false;
        c1635.f6540 = -1L;
        c1635.f6527 = -1;
        c1635.f6528 = -1L;
        c1635.f6535 = new C2255(this);
        c1635.f6533 = true;
        c1635.f6542 = new ArrayList();
        c1635.f6537 = new C2771(0);
        c1635.f6525 = new ArrayList(size);
        c1635.f6536 = new ArrayList();
        c1635.f6526 = new C2724(c1635, 1);
        c1635.f6543 = false;
        c1635.f6534 = true;
        HashMap map = new HashMap(size);
        for (int i = 0; i < size; i++) {
            C4098 c4098 = (C4098) this.f6525.get(i);
            C4098 c4098Clone = c4098.clone();
            AbstractC1144 abstractC1144 = c4098Clone.f15319;
            AbstractC2717 abstractC2717 = this.f6526;
            ArrayList arrayList = abstractC1144.f4898;
            if (arrayList != null) {
                arrayList.remove(abstractC2717);
                if (abstractC1144.f4898.size() == 0) {
                    abstractC1144.f4898 = null;
                }
            }
            map.put(c4098, c4098Clone);
            c1635.f6525.add(c4098Clone);
            c1635.f6537.put(c4098Clone.f15319, c4098Clone);
        }
        C4098 c40982 = (C4098) map.get(this.f6539);
        c1635.f6539 = c40982;
        c1635.f6529 = (C3205) c40982.f15319;
        for (int i2 = 0; i2 < size; i2++) {
            C4098 c40983 = (C4098) this.f6525.get(i2);
            C4098 c40984 = (C4098) map.get(c40983);
            C4098 c40985 = c40983.f15316;
            c40984.f15316 = c40985 == null ? null : (C4098) map.get(c40985);
            ArrayList arrayList2 = c40983.f15317;
            int size2 = arrayList2 == null ? 0 : arrayList2.size();
            for (int i3 = 0; i3 < size2; i3++) {
                c40984.f15317.set(i3, (C4098) map.get(c40983.f15317.get(i3)));
            }
            ArrayList arrayList3 = c40983.f15320;
            int size3 = arrayList3 == null ? 0 : arrayList3.size();
            for (int i4 = 0; i4 < size3; i4++) {
                c40984.f15320.set(i4, (C4098) map.get(c40983.f15320.get(i4)));
            }
            ArrayList arrayList4 = c40983.f15318;
            int size4 = arrayList4 == null ? 0 : arrayList4.size();
            for (int i5 = 0; i5 < size4; i5++) {
                c40984.f15318.set(i5, (C4098) map.get(c40983.f15318.get(i5)));
            }
        }
        return c1635;
    }

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final void m4680() {
        if (this.f6538 >= 0) {
            int size = this.f6525.size();
            for (int i = 0; i < size; i++) {
                ((C4098) this.f6525.get(i)).f15319.mo3587(this.f6538);
            }
        }
        this.f6529.mo3587(0L);
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵝᵵᵺ */
    public final long mo3584() {
        m4680();
        m4685();
        return this.f6532;
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵡʠ */
    public final void mo3585(boolean z) {
        if (this.f6533 && !mo3590()) {
            C0190.m1432("Children must be initialized.");
            return;
        }
        m4678();
        if (z) {
            for (int size = this.f6536.size() - 1; size >= 0; size--) {
                if (((C1638) this.f6536.get(size)).f6546 == 1) {
                    ((C1638) this.f6536.get(size)).f6545.f15319.mo3585(true);
                }
            }
            return;
        }
        for (int i = 0; i < this.f6536.size(); i++) {
            if (((C1638) this.f6536.get(i)).f6546 == 2) {
                ((C1638) this.f6536.get(i)).f6545.f15319.mo3585(false);
            }
        }
    }

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final void m4681(int i, int i2, long j) {
        if (!this.f6543) {
            for (int i3 = i + 1; i3 <= i2; i3++) {
                C1638 c1638 = (C1638) this.f6536.get(i3);
                C4098 c4098 = c1638.f6545;
                int i4 = c1638.f6546;
                if (i4 == 0) {
                    this.f6542.add(c4098);
                    if (c4098.f15319.mo3592()) {
                        c4098.f15319.cancel();
                    }
                    c4098.f15321 = false;
                    c4098.f15319.mo3586(false);
                    m4675(0L, c4098);
                } else if (i4 == 2 && !c4098.f15321) {
                    m4675(m4677(j, c4098), c4098);
                }
            }
            return;
        }
        if (i == -1) {
            i = this.f6536.size();
        }
        for (int i5 = i - 1; i5 >= i2; i5--) {
            C1638 c16382 = (C1638) this.f6536.get(i5);
            C4098 c40982 = c16382.f6545;
            int i6 = c16382.f6546;
            if (i6 == 2) {
                if (c40982.f15319.mo3592()) {
                    c40982.f15319.cancel();
                }
                c40982.f15321 = false;
                this.f6542.add(c16382.f6545);
                c40982.f15319.mo3586(true);
                m4675(0L, c40982);
            } else if (i6 == 1 && !c40982.f15321) {
                m4675(m4677(j, c40982), c40982);
            }
        }
    }

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final C4098 m4682(AbstractC1144 abstractC1144) {
        C4098 c4098 = (C4098) this.f6537.get(abstractC1144);
        if (c4098 == null) {
            c4098 = new C4098(abstractC1144);
            this.f6537.put(abstractC1144, c4098);
            this.f6525.add(c4098);
            if (abstractC1144 instanceof C1635) {
                ((C1635) abstractC1144).f6533 = false;
            }
        }
        return c4098;
    }

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final void m4683() {
        C3539 c3539M8077;
        ArrayList arrayList;
        int iIndexOf;
        this.f6531 = false;
        this.f6540 = -1L;
        this.f6527 = -1;
        this.f6528 = -1L;
        C2255 c2255 = this.f6535;
        c2255.f8825 = -1L;
        c2255.f8826 = false;
        this.f6542.clear();
        if (this.f6533 && (iIndexOf = (arrayList = (c3539M8077 = C3539.m8077()).f13273).indexOf(this)) >= 0) {
            arrayList.set(iIndexOf, null);
            c3539M8077.f13271 = true;
        }
        ArrayList arrayList2 = this.f4898;
        if (arrayList2 != null) {
            ArrayList arrayList3 = (ArrayList) arrayList2.clone();
            int size = arrayList3.size();
            for (int i = 0; i < size; i++) {
                ((InterfaceC0793) arrayList3.get(i)).mo2899(this, this.f6543);
            }
        }
        for (int i2 = 1; i2 < this.f6525.size(); i2++) {
            AbstractC1144 abstractC1144 = ((C4098) this.f6525.get(i2)).f15319;
            AbstractC2717 abstractC2717 = this.f6526;
            ArrayList arrayList4 = abstractC1144.f4898;
            if (arrayList4 != null) {
                arrayList4.remove(abstractC2717);
                if (abstractC1144.f4898.size() == 0) {
                    abstractC1144.f4898 = null;
                }
            }
        }
        this.f6533 = true;
        this.f6543 = false;
    }

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final ArrayList m4684() {
        ArrayList arrayList = new ArrayList();
        int size = this.f6525.size();
        for (int i = 0; i < size; i++) {
            C4098 c4098 = (C4098) this.f6525.get(i);
            if (c4098 != this.f6539) {
                arrayList.add(c4098.f15319);
            }
        }
        return arrayList;
    }

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final void m4685() {
        boolean z;
        if (!this.f6534) {
            for (int i = 0; i < this.f6525.size(); i++) {
                if (((C4098) this.f6525.get(i)).f15313 == ((C4098) this.f6525.get(i)).f15319.mo3584()) {
                }
            }
            return;
        }
        this.f6534 = false;
        int size = this.f6525.size();
        for (int i2 = 0; i2 < size; i2++) {
            ((C4098) this.f6525.get(i2)).f15312 = false;
        }
        for (int i3 = 0; i3 < size; i3++) {
            C4098 c4098 = (C4098) this.f6525.get(i3);
            if (!c4098.f15312) {
                c4098.f15312 = true;
                ArrayList arrayList = c4098.f15320;
                if (arrayList != null) {
                    m4676(c4098, arrayList);
                    c4098.f15320.remove(c4098);
                    int size2 = c4098.f15320.size();
                    for (int i4 = 0; i4 < size2; i4++) {
                        ArrayList arrayList2 = ((C4098) c4098.f15320.get(i4)).f15318;
                        if (arrayList2 != null) {
                            int size3 = arrayList2.size();
                            for (int i5 = 0; i5 < size3; i5++) {
                                c4098.m8979((C4098) arrayList2.get(i5));
                            }
                        }
                    }
                    for (int i6 = 0; i6 < size2; i6++) {
                        C4098 c40982 = (C4098) c4098.f15320.get(i6);
                        ArrayList arrayList3 = c4098.f15318;
                        c40982.getClass();
                        if (arrayList3 != null) {
                            int size4 = arrayList3.size();
                            for (int i7 = 0; i7 < size4; i7++) {
                                c40982.m8979((C4098) arrayList3.get(i7));
                            }
                        }
                        c40982.f15312 = true;
                    }
                }
            }
        }
        for (int i8 = 0; i8 < size; i8++) {
            C4098 c40983 = (C4098) this.f6525.get(i8);
            C4098 c40984 = this.f6539;
            if (c40983 != c40984 && c40983.f15318 == null) {
                c40983.m8979(c40984);
            }
        }
        ArrayList arrayList4 = new ArrayList(this.f6525.size());
        C4098 c40985 = this.f6539;
        c40985.f15315 = 0L;
        c40985.f15314 = this.f6529.f12114;
        m4688(c40985, arrayList4);
        this.f6536.clear();
        for (int i9 = 1; i9 < this.f6525.size(); i9++) {
            C4098 c40986 = (C4098) this.f6525.get(i9);
            this.f6536.add(new C1638(c40986, 0));
            this.f6536.add(new C1638(c40986, 1));
            this.f6536.add(new C1638(c40986, 2));
        }
        Collections.sort(this.f6536, f6524);
        int size5 = this.f6536.size();
        int i10 = 0;
        while (true) {
            ArrayList arrayList5 = this.f6536;
            if (i10 >= size5) {
                if (!arrayList5.isEmpty() && ((C1638) this.f6536.get(0)).f6546 != 0) {
                    C0190.m1432("Sorting went bad, the start event should always be at index 0");
                    return;
                }
                this.f6536.add(0, new C1638(this.f6539, 0));
                this.f6536.add(1, new C1638(this.f6539, 1));
                this.f6536.add(2, new C1638(this.f6539, 2));
                if (((C1638) AbstractC1327.m4111(1, this.f6536)).f6546 == 0 || ((C1638) AbstractC1327.m4111(1, this.f6536)).f6546 == 1) {
                    C0190.m1432("Something went wrong, the last event is not an end event");
                    return;
                } else {
                    this.f6532 = ((C1638) AbstractC1327.m4111(1, this.f6536)).m4693();
                    return;
                }
            }
            C1638 c1638 = (C1638) arrayList5.get(i10);
            int i11 = c1638.f6546;
            C4098 c40987 = c1638.f6545;
            if (i11 == 2) {
                long j = c40987.f15315;
                long j2 = c40987.f15314;
                if (j == j2) {
                    z = true;
                } else {
                    c40987.f15319.getClass();
                    if (j2 == j) {
                        z = false;
                    }
                }
                int i12 = i10 + 1;
                int i13 = size5;
                int i14 = i13;
                for (int i15 = i12; i15 < size5 && (i13 >= size5 || i14 >= size5); i15++) {
                    if (((C1638) this.f6536.get(i15)).f6545 == c40987) {
                        if (((C1638) this.f6536.get(i15)).f6546 == 0) {
                            i13 = i15;
                        } else if (((C1638) this.f6536.get(i15)).f6546 == 1) {
                            i14 = i15;
                        }
                    }
                }
                if (z && i13 == this.f6536.size()) {
                    C0190.m1432("Something went wrong, no start isfound after stop for an animation that has the same start and endtime.");
                    return;
                }
                if (i14 == this.f6536.size()) {
                    C0190.m1432("Something went wrong, no startdelay end is found after stop for an animation");
                    return;
                }
                if (z) {
                    this.f6536.add(i10, (C1638) this.f6536.remove(i13));
                    i10 = i12;
                }
                this.f6536.add(i10, (C1638) this.f6536.remove(i14));
                i10 += 2;
            }
            i10++;
        }
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵨᵳʝ */
    public final void mo3586(boolean z) {
        m4689(z, false);
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵪʩ */
    public final AbstractC1144 mo3587(long j) {
        if (j < 0) {
            ᵹˉᵞ.ˌᵜᵹᵩ("duration must be a value of zero or greater");
            return null;
        }
        this.f6534 = true;
        this.f6538 = j;
        return this;
    }

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final void m4686(AbstractC1144... abstractC1144Arr) {
        AbstractC1144 abstractC1144 = abstractC1144Arr[0];
        this.f6534 = true;
        C4098 c4098M4682 = m4682(abstractC1144);
        for (int i = 1; i < abstractC1144Arr.length; i++) {
            c4098M4682.m8980(m4682(abstractC1144Arr[i]));
        }
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵯٴᵦ */
    public final void mo3588() {
        m4689(true, true);
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵳٴᵶ */
    public final void mo3589(InterfaceC4625 interfaceC4625) {
        this.f6541 = interfaceC4625;
    }

    @Override // defpackage.InterfaceC1739
    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final boolean mo4687(long j) {
        ArrayList arrayList;
        if (this.f6540 < 0) {
            this.f6540 = j;
        }
        long j2 = this.f6528;
        if (j2 > 0) {
            this.f6540 = (j - j2) + this.f6540;
            this.f6528 = -1L;
        }
        C2255 c2255 = this.f6535;
        if (c2255.f8825 != -1) {
            c2255.m5931(this.f6543);
            boolean z = this.f6543;
            C2255 c22552 = this.f6535;
            if (z) {
                this.f6540 = j - ((long) (c22552.f8825 * 1.0f));
            } else {
                this.f6540 = j - ((long) (c22552.f8825 * 1.0f));
            }
            mo3585(!z);
            this.f6542.clear();
            for (int size = this.f6525.size() - 1; size >= 0; size--) {
                ((C4098) this.f6525.get(size)).f15321 = false;
            }
            this.f6527 = -1;
            C2255 c22553 = this.f6535;
            c22553.f8825 = -1L;
            c22553.f8826 = false;
        }
        if (this.f6543 || j >= this.f6540) {
            long j3 = (long) ((j - this.f6540) / 1.0f);
            int iM4690 = m4690(j3);
            m4681(this.f6527, iM4690, j3);
            this.f6527 = iM4690;
            int i = 0;
            while (true) {
                int size2 = this.f6542.size();
                arrayList = this.f6542;
                if (i >= size2) {
                    break;
                }
                C4098 c4098 = (C4098) arrayList.get(i);
                if (!c4098.f15321) {
                    m4675(m4677(j3, c4098), c4098);
                }
                i++;
            }
            for (int size3 = arrayList.size() - 1; size3 >= 0; size3--) {
                if (((C4098) this.f6542.get(size3)).f15321) {
                    this.f6542.remove(size3);
                }
            }
            boolean z2 = this.f6543;
            ArrayList arrayList2 = this.f6542;
            boolean z3 = !z2 ? !(arrayList2.isEmpty() && this.f6527 == this.f6536.size() - 1) : !(arrayList2.size() == 1 && this.f6542.get(0) == this.f6539) && (!this.f6542.isEmpty() || this.f6527 >= 3);
            if (this.f4899 != null) {
                for (int i2 = 0; i2 < this.f4899.size(); i2++) {
                    ((InterfaceC4008) this.f4899.get(i2)).m8848(this);
                }
            }
            if (z3) {
                m4683();
                return true;
            }
        }
        return false;
    }

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final void m4688(C4098 c4098, ArrayList arrayList) {
        int i = 0;
        if (c4098.f15317 == null) {
            if (c4098 == this.f6539) {
                while (i < this.f6525.size()) {
                    C4098 c40982 = (C4098) this.f6525.get(i);
                    if (c40982 != this.f6539) {
                        c40982.f15315 = -1L;
                        c40982.f15314 = -1L;
                    }
                    i++;
                }
                return;
            }
            return;
        }
        arrayList.add(c4098);
        int size = c4098.f15317.size();
        while (i < size) {
            C4098 c40983 = (C4098) c4098.f15317.get(i);
            c40983.f15313 = c40983.f15319.mo3584();
            int iIndexOf = arrayList.indexOf(c40983);
            if (iIndexOf >= 0) {
                while (iIndexOf < arrayList.size()) {
                    ((C4098) arrayList.get(iIndexOf)).f15316 = null;
                    ((C4098) arrayList.get(iIndexOf)).f15315 = -1L;
                    ((C4098) arrayList.get(iIndexOf)).f15314 = -1L;
                    iIndexOf++;
                }
                c40983.f15315 = -1L;
                c40983.f15314 = -1L;
                c40983.f15316 = null;
                toString();
            } else {
                long j = c40983.f15315;
                if (j != -1) {
                    long j2 = c4098.f15314;
                    if (j2 == -1) {
                        c40983.f15316 = c4098;
                        c40983.f15315 = -1L;
                        c40983.f15314 = -1L;
                    } else {
                        if (j2 >= j) {
                            c40983.f15316 = c4098;
                            c40983.f15315 = j2;
                        }
                        long j3 = c40983.f15313;
                        c40983.f15314 = j3 == -1 ? -1L : c40983.f15315 + j3;
                    }
                }
                m4688(c40983, arrayList);
            }
            i++;
        }
        arrayList.remove(c4098);
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵶᵷᵕ */
    public final boolean mo3590() {
        boolean z = true;
        if (this.f6530) {
            return true;
        }
        int i = 0;
        while (true) {
            if (i >= this.f6525.size()) {
                break;
            }
            if (!((C4098) this.f6525.get(i)).f15319.mo3590()) {
                z = false;
                break;
            }
            i++;
        }
        this.f6530 = z;
        return z;
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵸʓᵠ */
    public final void mo3591() {
        m4689(false, true);
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵸˑ */
    public final boolean mo3592() {
        return this.f6531;
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵹᵝᵶ */
    public final void mo3593() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (this.f6531) {
            if (this.f6543) {
                int size = this.f6527;
                if (size == -1) {
                    size = this.f6536.size();
                }
                this.f6527 = size;
                while (true) {
                    int i = this.f6527;
                    if (i <= 0) {
                        break;
                    }
                    int i2 = i - 1;
                    this.f6527 = i2;
                    C1638 c1638 = (C1638) this.f6536.get(i2);
                    AbstractC1144 abstractC1144 = c1638.f6545.f15319;
                    if (!((C4098) this.f6537.get(abstractC1144)).f15321) {
                        int i3 = c1638.f6546;
                        if (i3 == 2) {
                            abstractC1144.mo3588();
                        } else if (i3 == 1 && abstractC1144.mo3592()) {
                            abstractC1144.mo3593();
                        }
                    }
                }
            } else {
                while (this.f6527 < this.f6536.size() - 1) {
                    int i4 = this.f6527 + 1;
                    this.f6527 = i4;
                    C1638 c16382 = (C1638) this.f6536.get(i4);
                    AbstractC1144 abstractC11442 = c16382.f6545.f15319;
                    if (!((C4098) this.f6537.get(abstractC11442)).f15321) {
                        int i5 = c16382.f6546;
                        if (i5 == 0) {
                            abstractC11442.mo3591();
                        } else if (i5 == 2 && abstractC11442.mo3592()) {
                            abstractC11442.mo3593();
                        }
                    }
                }
            }
            this.f6542.clear();
        }
        m4683();
    }

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public final void m4689(boolean z, boolean z2) {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        this.f6531 = true;
        this.f6533 = z2;
        this.f6528 = -1L;
        int size = this.f6525.size();
        for (int i = 0; i < size; i++) {
            ((C4098) this.f6525.get(i)).f15321 = false;
        }
        m4678();
        if (z && mo3584() == -1) {
            C0190.m1432("Cannot reverse infinite AnimatorSet");
            return;
        }
        this.f6543 = z;
        boolean zM4674 = m4674(this);
        if (!zM4674) {
            for (int i2 = 1; i2 < this.f6525.size(); i2++) {
                ((C4098) this.f6525.get(i2)).f15319.m3580(this.f6526);
            }
            C2255 c2255 = this.f6535;
            C1635 c1635 = c2255.f8824;
            long j = 0;
            if ((c1635.f6543 ? c1635.mo3584() - c2255.f8825 : c2255.f8825) == 0 && this.f6543) {
                C2255 c22552 = this.f6535;
                c22552.f8825 = -1L;
                c22552.f8826 = false;
            }
            boolean zMo3590 = mo3590();
            boolean z3 = this.f6543;
            if (zMo3590) {
                mo3585(!z3);
            } else if (z3) {
                if (!mo3590()) {
                    this.f6530 = true;
                    mo3585(false);
                }
                mo3585(!this.f6543);
            } else {
                for (int size2 = this.f6536.size() - 1; size2 >= 0; size2--) {
                    if (((C1638) this.f6536.get(size2)).f6546 == 1) {
                        AbstractC1144 abstractC1144 = ((C1638) this.f6536.get(size2)).f6545.f15319;
                        if (abstractC1144.mo3590()) {
                            abstractC1144.mo3585(true);
                        }
                    }
                }
            }
            C2255 c22553 = this.f6535;
            if (c22553.f8825 != -1) {
                c22553.m5931(this.f6543);
                j = this.f6535.f8825;
            }
            int iM4690 = m4690(j);
            m4681(-1, iM4690, j);
            for (int size3 = this.f6542.size() - 1; size3 >= 0; size3--) {
                if (((C4098) this.f6542.get(size3)).f15321) {
                    this.f6542.remove(size3);
                }
            }
            this.f6527 = iM4690;
            if (this.f6533) {
                AbstractC1144.m3579(this);
            }
        }
        ArrayList arrayList = this.f4898;
        if (arrayList != null) {
            ArrayList arrayList2 = (ArrayList) arrayList.clone();
            int size4 = arrayList2.size();
            for (int i3 = 0; i3 < size4; i3++) {
                ((InterfaceC0793) arrayList2.get(i3)).mo2896(this);
            }
        }
        if (zM4674) {
            mo3593();
        }
    }

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final int m4690(long j) {
        int size = this.f6536.size();
        int i = this.f6527;
        if (!this.f6543) {
            for (int i2 = i + 1; i2 < size; i2++) {
                C1638 c1638 = (C1638) this.f6536.get(i2);
                if (c1638.m4693() != -1 && c1638.m4693() <= j) {
                    i = i2;
                }
            }
            return i;
        }
        long jMo3584 = mo3584() - j;
        int i3 = this.f6527;
        if (i3 != -1) {
            size = i3;
        }
        this.f6527 = size;
        for (int i4 = size - 1; i4 >= 0; i4--) {
            if (((C1638) this.f6536.get(i4)).m4693() >= jMo3584) {
                i = i4;
            }
        }
        return i;
    }
}
