package j2;

import j2.g0;
import j2.l0;
import j2.z0;

/* loaded from: classes.dex */
public final class w extends z0 {

    /* renamed from: k0, reason: collision with root package name */
    public static final a f23803k0 = new a(null);

    /* renamed from: l0, reason: collision with root package name */
    private static final s1.d1 f23804l0;

    /* renamed from: i0, reason: collision with root package name */
    private final v1 f23805i0;

    /* renamed from: j0, reason: collision with root package name */
    private q0 f23806j0;

    /* loaded from: classes.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(kotlin.jvm.internal.k kVar) {
            this();
        }
    }

    /* loaded from: classes.dex */
    private final class b extends q0 {
        public b() {
            super(w.this);
        }

        @Override // j2.q0, h2.n
        public int T(int i10) {
            return w1().d1(i10);
        }

        @Override // j2.q0, h2.n
        public int X(int i10) {
            return w1().Z0(i10);
        }

        @Override // h2.d0
        public h2.p0 Y(long j10) {
            q0.Q1(this, j10);
            a1.b w02 = w1().w0();
            int q10 = w02.q();
            if (q10 > 0) {
                Object[] p10 = w02.p();
                int i10 = 0;
                do {
                    l0.a a02 = ((g0) p10[i10]).a0();
                    kotlin.jvm.internal.t.d(a02);
                    a02.Q1(g0.g.NotUsed);
                    i10++;
                } while (i10 < q10);
            }
            q0.R1(this, w1().f0().f(this, w1().F(), j10));
            return this;
        }

        @Override // j2.q0
        protected void Y1() {
            l0.a a02 = w1().a0();
            kotlin.jvm.internal.t.d(a02);
            a02.L1();
        }

        @Override // j2.p0
        public int n1(h2.a aVar) {
            Integer num = (Integer) S1().x().get(aVar);
            int intValue = num != null ? num.intValue() : Integer.MIN_VALUE;
            U1().put(aVar, Integer.valueOf(intValue));
            return intValue;
        }

        @Override // j2.q0, h2.n
        public int s(int i10) {
            return w1().Y0(i10);
        }

        @Override // j2.q0, h2.n
        public int v0(int i10) {
            return w1().c1(i10);
        }
    }

    static {
        s1.d1 a10 = s1.l.a();
        a10.G(s1.g0.f35254b.d());
        a10.I(1.0f);
        a10.F(s1.e1.f35240a.b());
        f23804l0 = a10;
    }

    public w(g0 g0Var) {
        super(g0Var);
        this.f23805i0 = new v1();
        z2().g2(this);
        this.f23806j0 = g0Var.b0() != null ? new b() : null;
    }

    private final void u3() {
        if (L1()) {
            return;
        }
        T2();
        w1().d0().R1();
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x0083  */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0088  */
    /* JADX WARN: Removed duplicated region for block: B:22:0x008c A[EDGE_INSN: B:22:0x008c->B:28:0x008c BREAK  A[LOOP:0: B:10:0x0057->B:21:?], SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:31:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:7:0x003f  */
    @Override // j2.z0
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void J2(z0.f fVar, long j10, u uVar, boolean z10, boolean z11) {
        boolean z12;
        boolean z13;
        int i10;
        boolean z14;
        boolean z15;
        if (fVar.b(w1())) {
            if (s3(j10)) {
                z12 = z11;
                z13 = true;
            } else if (z10) {
                float h22 = h2(j10, w2());
                if ((Float.isInfinite(h22) || Float.isNaN(h22)) ? false : true) {
                    z13 = true;
                    z12 = false;
                }
            }
            if (z13) {
                return;
            }
            i10 = uVar.f23790r;
            a1.b v02 = w1().v0();
            int q10 = v02.q();
            if (q10 > 0) {
                Object[] p10 = v02.p();
                int i11 = q10 - 1;
                do {
                    g0 g0Var = (g0) p10[i11];
                    if (g0Var.q()) {
                        fVar.d(g0Var, j10, uVar, z10, z12);
                        if (uVar.E()) {
                            if (!uVar.C()) {
                                z15 = false;
                                if (!z15) {
                                    z14 = true;
                                    if (!z14) {
                                        break;
                                    } else {
                                        i11--;
                                    }
                                }
                            } else {
                                uVar.e();
                            }
                        }
                        z15 = true;
                        if (!z15) {
                        }
                    }
                    z14 = false;
                    if (!z14) {
                    }
                } while (i11 >= 0);
            }
            uVar.f23790r = i10;
            return;
        }
        z12 = z11;
        z13 = false;
        if (z13) {
        }
    }

    @Override // h2.n
    public int T(int i10) {
        return w1().b1(i10);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // j2.z0, h2.p0
    public void V0(long j10, float f10, dn.l lVar) {
        super.V0(j10, f10, lVar);
        u3();
    }

    @Override // j2.z0
    public void V2(s1.a0 a0Var, v1.c cVar) {
        j1 b10 = k0.b(w1());
        a1.b v02 = w1().v0();
        int q10 = v02.q();
        if (q10 > 0) {
            Object[] p10 = v02.p();
            int i10 = 0;
            do {
                g0 g0Var = (g0) p10[i10];
                if (g0Var.q()) {
                    g0Var.B(a0Var, cVar);
                }
                i10++;
            } while (i10 < q10);
        }
        if (b10.getShowLayoutBounds()) {
            j2(a0Var, f23804l0);
        }
    }

    @Override // h2.n
    public int X(int i10) {
        return w1().X0(i10);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // j2.z0, h2.p0
    public void X0(long j10, float f10, v1.c cVar) {
        super.X0(j10, f10, cVar);
        u3();
    }

    @Override // h2.d0
    public h2.p0 Y(long j10) {
        if (r2()) {
            q0 v22 = v2();
            kotlin.jvm.internal.t.d(v22);
            j10 = v22.V1();
        }
        d1(j10);
        a1.b w02 = w1().w0();
        int q10 = w02.q();
        if (q10 > 0) {
            Object[] p10 = w02.p();
            int i10 = 0;
            do {
                ((g0) p10[i10]).d0().X1(g0.g.NotUsed);
                i10++;
            } while (i10 < q10);
        }
        c3(w1().f0().f(this, w1().G(), j10));
        S2();
        return this;
    }

    @Override // j2.z0
    public void l2() {
        if (v2() == null) {
            v3(new b());
        }
    }

    @Override // j2.p0
    public int n1(h2.a aVar) {
        q0 v22 = v2();
        if (v22 != null) {
            return v22.n1(aVar);
        }
        Integer num = (Integer) q2().x().get(aVar);
        if (num != null) {
            return num.intValue();
        }
        return Integer.MIN_VALUE;
    }

    @Override // h2.n
    public int s(int i10) {
        return w1().W0(i10);
    }

    @Override // j2.z0
    /* renamed from: t3, reason: merged with bridge method [inline-methods] */
    public v1 z2() {
        return this.f23805i0;
    }

    @Override // h2.n
    public int v0(int i10) {
        return w1().a1(i10);
    }

    @Override // j2.z0
    public q0 v2() {
        return this.f23806j0;
    }

    protected void v3(q0 q0Var) {
        this.f23806j0 = q0Var;
    }
}
