package defpackage;

import java.util.ArrayDeque;

/* renamed from: ʽˌᵸٴ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractC0114 implements InterfaceC5100 {

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

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

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

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

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

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

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

    public AbstractC0114() {
        for (int i = 0; i < 10; i++) {
            this.f1423.add(new C1647());
        }
        this.f1424 = new ArrayDeque();
        for (int i2 = 0; i2 < 2; i2++) {
            ArrayDeque arrayDeque = this.f1424;
            ʾᵛ r3 = new ʾᵛ(4, this);
            C3878 c3878 = new C3878(0);
            c3878.f14417 = r3;
            arrayDeque.add(c3878);
        }
        this.f1422 = new ArrayDeque();
        this.f1420 = -9223372036854775807L;
    }

    @Override // defpackage.InterfaceC3574
    public void flush() {
        ArrayDeque arrayDeque;
        this.f1421 = 0L;
        this.f1419 = 0L;
        while (true) {
            ArrayDeque arrayDeque2 = this.f1422;
            boolean zIsEmpty = arrayDeque2.isEmpty();
            arrayDeque = this.f1423;
            if (zIsEmpty) {
                break;
            }
            C1647 c1647 = (C1647) arrayDeque2.poll();
            String str = AbstractC3558.f13329;
            c1647.mo6221();
            arrayDeque.add(c1647);
        }
        C1647 c16472 = this.f1425;
        if (c16472 != null) {
            c16472.mo6221();
            arrayDeque.add(c16472);
            this.f1425 = null;
        }
    }

    @Override // defpackage.InterfaceC3574
    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final Object mo1214() {
        ᵛᵾˏ.ᵿʗᵝʽ(this.f1425 == null);
        ArrayDeque arrayDeque = this.f1423;
        if (arrayDeque.isEmpty()) {
            return null;
        }
        C1647 c1647 = (C1647) arrayDeque.pollFirst();
        this.f1425 = c1647;
        return c1647;
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public abstract C0410 mo1215();

    /* JADX WARN: Removed duplicated region for block: B:15:0x0033  */
    @Override // defpackage.InterfaceC3574
    /* 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 mo1216(defpackage.C3481 r7) {
        /*
            r6 = this;
            ˌᵲᵷ r0 = r6.f1425
            if (r7 != r0) goto L6
            r0 = 1
            goto L7
        L6:
            r0 = 0
        L7:
            ᵛᵾˏ.ᵯٴᵦ(r0)
            ˌᵲᵷ r7 = (defpackage.C1647) r7
            r0 = 4
            boolean r0 = r7.m9873(r0)
            if (r0 != 0) goto L33
            long r0 = r7.f9512
            r2 = -9223372036854775808
            int r2 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
            if (r2 == 0) goto L33
            long r2 = r6.f1420
            r4 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)
            int r4 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1))
            if (r4 == 0) goto L33
            int r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
            if (r0 >= 0) goto L33
            r7.mo6221()
            java.util.ArrayDeque r0 = r6.f1423
            r0.add(r7)
            goto L41
        L33:
            long r0 = r6.f1421
            r2 = 1
            long r2 = r2 + r0
            r6.f1421 = r2
            r7.f6574 = r0
            java.util.ArrayDeque r0 = r6.f1422
            r0.add(r7)
        L41:
            r7 = 0
            r6.f1425 = r7
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC0114.mo1216(ᵥʗˉ):void");
    }

    @Override // defpackage.InterfaceC5100
    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final void mo1217(long j) {
        this.f1419 = j;
    }

    @Override // defpackage.InterfaceC3574
    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters and merged with bridge method [inline-methods] */
    public AbstractC2880 mo1222() {
        ArrayDeque arrayDeque = this.f1424;
        if (arrayDeque.isEmpty()) {
            return null;
        }
        while (true) {
            ArrayDeque arrayDeque2 = this.f1422;
            if (arrayDeque2.isEmpty()) {
                return null;
            }
            C1647 c1647 = (C1647) arrayDeque2.peek();
            String str = AbstractC3558.f13329;
            if (c1647.f9512 > this.f1419) {
                return null;
            }
            C1647 c16472 = (C1647) arrayDeque2.poll();
            boolean zM9873 = c16472.m9873(4);
            ArrayDeque arrayDeque3 = this.f1423;
            if (zM9873) {
                AbstractC2880 abstractC2880 = (AbstractC2880) arrayDeque.pollFirst();
                abstractC2880.m9874(4);
                c16472.mo6221();
                arrayDeque3.add(c16472);
                return abstractC2880;
            }
            mo1221(c16472);
            if (mo1220()) {
                C0410 c0410Mo1215 = mo1215();
                AbstractC2880 abstractC28802 = (AbstractC2880) arrayDeque.pollFirst();
                long j = c16472.f9512;
                abstractC28802.f2897 = j;
                abstractC28802.f11148 = c0410Mo1215;
                abstractC28802.f11147 = j;
                c16472.mo6221();
                arrayDeque3.add(c16472);
                return abstractC28802;
            }
            c16472.mo6221();
            arrayDeque3.add(c16472);
        }
    }

    @Override // defpackage.InterfaceC3574
    /* renamed from: ᵥᵯˎ */
    public void mo364() {
    }

    @Override // defpackage.InterfaceC3574
    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final void mo1219(long j) {
        this.f1420 = j;
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public abstract boolean mo1220();

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public abstract void mo1221(C1647 c1647);
}
