package v;

import d5.AbstractC0844a;
import java.util.ArrayList;
import n4.u0;
import u.AbstractC1563h;
import u.C1558c;
import u.C1560e;

/* JADX INFO: loaded from: classes.dex */
public final class h extends d {

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public float f17990d0 = -1.0f;

    /* JADX INFO: renamed from: e0, reason: collision with root package name */
    public int f17991e0 = -1;

    /* JADX INFO: renamed from: f0, reason: collision with root package name */
    public int f17992f0 = -1;

    /* JADX INFO: renamed from: g0, reason: collision with root package name */
    public c f17993g0 = this.f17923y;

    /* JADX INFO: renamed from: h0, reason: collision with root package name */
    public int f17994h0 = 0;

    public h() {
        this.f17879G.clear();
        this.f17879G.add(this.f17993g0);
        int length = this.f17878F.length;
        for (int i = 0; i < length; i++) {
            this.f17878F[i] = this.f17993g0;
        }
    }

    @Override // v.d
    public final void A(C1560e c1560e) {
        if (this.f17880I == null) {
            return;
        }
        c cVar = this.f17993g0;
        c1560e.getClass();
        int iM = C1560e.m(cVar);
        if (this.f17994h0 == 1) {
            this.f17885N = iM;
            this.f17886O = 0;
            v(this.f17880I.i());
            y(0);
            return;
        }
        this.f17885N = 0;
        this.f17886O = iM;
        y(this.f17880I.l());
        v(0);
    }

    public final void B(int i) {
        if (this.f17994h0 == i) {
            return;
        }
        this.f17994h0 = i;
        ArrayList arrayList = this.f17879G;
        arrayList.clear();
        if (this.f17994h0 == 1) {
            this.f17993g0 = this.f17922x;
        } else {
            this.f17993g0 = this.f17923y;
        }
        arrayList.add(this.f17993g0);
        c[] cVarArr = this.f17878F;
        int length = cVarArr.length;
        for (int i5 = 0; i5 < length; i5++) {
            cVarArr[i5] = this.f17993g0;
        }
    }

    @Override // v.d
    public final void a(C1560e c1560e) {
        e eVar = (e) this.f17880I;
        if (eVar == null) {
            return;
        }
        c cVarG = eVar.g(2);
        c cVarG2 = eVar.g(4);
        d dVar = this.f17880I;
        boolean z8 = dVar != null && dVar.f17902c0[0] == 2;
        if (this.f17994h0 == 0) {
            cVarG = eVar.g(3);
            cVarG2 = eVar.g(5);
            d dVar2 = this.f17880I;
            z8 = dVar2 != null && dVar2.f17902c0[1] == 2;
        }
        if (this.f17991e0 != -1) {
            u.i iVarJ = c1560e.j(this.f17993g0);
            c1560e.e(iVarJ, c1560e.j(cVarG), this.f17991e0, 8);
            if (z8) {
                c1560e.f(c1560e.j(cVarG2), iVarJ, 0, 5);
                return;
            }
            return;
        }
        if (this.f17992f0 != -1) {
            u.i iVarJ2 = c1560e.j(this.f17993g0);
            u.i iVarJ3 = c1560e.j(cVarG2);
            c1560e.e(iVarJ2, iVarJ3, -this.f17992f0, 8);
            if (z8) {
                c1560e.f(iVarJ2, c1560e.j(cVarG), 0, 5);
                c1560e.f(iVarJ3, iVarJ2, 0, 5);
                return;
            }
            return;
        }
        if (this.f17990d0 != -1.0f) {
            u.i iVarJ4 = c1560e.j(this.f17993g0);
            u.i iVarJ5 = c1560e.j(cVarG2);
            float f3 = this.f17990d0;
            C1558c c1558cK = c1560e.k();
            c1558cK.f17054d.e(iVarJ4, -1.0f);
            c1558cK.f17054d.e(iVarJ5, f3);
            c1560e.c(c1558cK);
        }
    }

    @Override // v.d
    public final boolean b() {
        return true;
    }

    @Override // v.d
    public final c g(int i) {
        switch (AbstractC1563h.c(i)) {
            case u0.f15495q /* 0 */:
            case 5:
            case Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
            case Z.g.DOUBLE_FIELD_NUMBER /* 7 */:
            case Z.g.BYTES_FIELD_NUMBER /* 8 */:
                return null;
            case 1:
            case 3:
                if (this.f17994h0 == 1) {
                    return this.f17993g0;
                }
                break;
            case 2:
            case 4:
                if (this.f17994h0 == 0) {
                    return this.f17993g0;
                }
                break;
        }
        throw new AssertionError(AbstractC0844a.y(i));
    }
}
