package p138.p176.p177.p190.p226.p227;

import java.util.ArrayDeque;
import java.util.PriorityQueue;
import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.p226.AbstractC3954;
import p138.p176.p177.p190.p226.C3953;
import p138.p176.p177.p190.p226.InterfaceC3949;
import p138.p176.p177.p190.p226.InterfaceC3950;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໟ.މ.ށ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC3964 implements InterfaceC3950 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final ArrayDeque<C3966> f12490 = new ArrayDeque<>();

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final ArrayDeque<AbstractC3954> f12491;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final PriorityQueue<C3966> f12492;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public C3966 f12493;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public long f12494;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public long f12495;

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໟ.މ.ށ$ؠ, reason: contains not printable characters */
    public static final class C3966 extends C3953 implements Comparable<C3966> {

        /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
        public long f12496;

        public C3966() {
        }

        public /* synthetic */ C3966(C3965 c3965) {
        }

        @Override // java.lang.Comparable
        public int compareTo(C3966 c3966) {
            C3966 c39662 = c3966;
            if (m5805() == c39662.m5805()) {
                long j = this.f10463 - c39662.f10463;
                if (j == 0) {
                    j = this.f12496 - c39662.f12496;
                    if (j == 0) {
                        return 0;
                    }
                }
                if (j > 0) {
                    return 1;
                }
            } else if (m5805()) {
                return 1;
            }
            return -1;
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໟ.މ.ށ$ހ, reason: contains not printable characters */
    public final class C3967 extends AbstractC3954 {
        public /* synthetic */ C3967(C3965 c3965) {
        }

        @Override // p138.p176.p177.p190.p193.AbstractC3512
        /* JADX INFO: renamed from: މ */
        public final void mo5814() {
            AbstractC3964 abstractC3964 = AbstractC3964.this;
            if (abstractC3964 == null) {
                throw null;
            }
            this.f10443 = 0;
            this.f12393 = null;
            abstractC3964.f12491.add(this);
        }
    }

    public AbstractC3964() {
        C3965 c3965;
        int i = 0;
        while (true) {
            c3965 = null;
            if (i >= 10) {
                break;
            }
            this.f12490.add(new C3966(c3965));
            i++;
        }
        this.f12491 = new ArrayDeque<>();
        for (int i2 = 0; i2 < 2; i2++) {
            this.f12491.add(new C3967(c3965));
        }
        this.f12492 = new PriorityQueue<>();
    }

    @Override // p138.p176.p177.p190.p193.InterfaceC3509
    public void flush() {
        this.f12495 = 0L;
        this.f12494 = 0L;
        while (!this.f12492.isEmpty()) {
            m6408(this.f12492.poll());
        }
        C3966 c3966 = this.f12493;
        if (c3966 != null) {
            m6408(c3966);
            this.f12493 = null;
        }
    }

    @Override // p138.p176.p177.p190.p193.InterfaceC3509
    /* JADX INFO: renamed from: ֏ */
    public void mo1134() {
    }

    @Override // p138.p176.p177.p190.p226.InterfaceC3950
    /* JADX INFO: renamed from: ֏ */
    public void mo6373(long j) {
        this.f12494 = j;
    }

    @Override // p138.p176.p177.p190.p193.InterfaceC3509
    /* JADX INFO: renamed from: ֏ */
    public void mo5806(C3953 c3953) {
        C3953 c39532 = c3953;
        C0567.m1896(c39532 == this.f12493);
        if (c39532.m5804()) {
            m6408(this.f12493);
        } else {
            C3966 c3966 = this.f12493;
            long j = this.f12495;
            this.f12495 = 1 + j;
            c3966.f12496 = j;
            this.f12492.add(c3966);
        }
        this.f12493 = null;
    }

    /* JADX WARN: Can't rename method to resolve collision */
    /* JADX INFO: renamed from: ֏ */
    public abstract void mo6386(C3953 c3953);

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m6408(C3966 c3966) {
        c3966.mo5803();
        this.f12490.add(c3966);
    }

    @Override // p138.p176.p177.p190.p193.InterfaceC3509
    /* JADX INFO: renamed from: ހ */
    public AbstractC3954 mo5807() {
        if (this.f12491.isEmpty()) {
            return null;
        }
        while (!this.f12492.isEmpty() && this.f12492.peek().f10463 <= this.f12494) {
            C3966 c3966Poll = this.f12492.poll();
            if (c3966Poll.m5805()) {
                AbstractC3954 abstractC3954PollFirst = this.f12491.pollFirst();
                abstractC3954PollFirst.m5801(4);
                m6408(c3966Poll);
                return abstractC3954PollFirst;
            }
            mo6386((C3953) c3966Poll);
            if (mo6389()) {
                InterfaceC3949 interfaceC3949Mo6388 = mo6388();
                if (!c3966Poll.m5804()) {
                    AbstractC3954 abstractC3954PollFirst2 = this.f12491.pollFirst();
                    long j = c3966Poll.f10463;
                    abstractC3954PollFirst2.f10466 = j;
                    abstractC3954PollFirst2.f12393 = interfaceC3949Mo6388;
                    abstractC3954PollFirst2.f12394 = j;
                    m6408(c3966Poll);
                    return abstractC3954PollFirst2;
                }
            }
            m6408(c3966Poll);
        }
        return null;
    }

    @Override // p138.p176.p177.p190.p193.InterfaceC3509
    /* JADX INFO: renamed from: ށ */
    public C3953 mo5808() {
        C0567.m1932(this.f12493 == null);
        if (this.f12490.isEmpty()) {
            return null;
        }
        C3966 c3966PollFirst = this.f12490.pollFirst();
        this.f12493 = c3966PollFirst;
        return c3966PollFirst;
    }

    /* JADX INFO: renamed from: ނ */
    public abstract InterfaceC3949 mo6388();

    /* JADX INFO: renamed from: ރ */
    public abstract boolean mo6389();
}
