package o;

import com.google.android.gms.common.api.Api;
import java.util.ArrayList;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.p2, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final /* synthetic */ class C2110p2 implements OC {
    public final /* synthetic */ int l = 0;
    public final /* synthetic */ int m;
    public final /* synthetic */ Object n;

    /* renamed from: o, reason: collision with root package name */
    public final /* synthetic */ Object f670o;
    public final /* synthetic */ Object p;

    public /* synthetic */ C2110p2(ArrayList arrayList, InterfaceC2424sO interfaceC2424sO, int i, ArrayList arrayList2) {
        float f = AbstractC2394s2.a;
        this.n = arrayList;
        this.p = interfaceC2424sO;
        this.m = i;
        this.f670o = arrayList2;
    }

    @Override // o.OC
    public final Object g(Object obj) {
        switch (this.l) {
            case 0:
                ArrayList arrayList = (ArrayList) this.n;
                InterfaceC2424sO interfaceC2424sO = (InterfaceC2424sO) this.p;
                float f = AbstractC2394s2.c;
                ArrayList arrayList2 = (ArrayList) this.f670o;
                UW uw = (UW) obj;
                int size = arrayList.size();
                for (int i = 0; i < size; i++) {
                    List list = (List) arrayList.get(i);
                    int size2 = list.size();
                    int[] iArr = new int[size2];
                    int i2 = 0;
                    while (i2 < size2) {
                        iArr[i2] = ((VW) list.get(i2)).l + (i2 < AbstractC0008Ai.R(list) ? interfaceC2424sO.N(f) : 0);
                        i2++;
                    }
                    int[] iArr2 = new int[size2];
                    AbstractC0981d9.b.g(interfaceC2424sO, this.m, iArr, interfaceC2424sO.getLayoutDirection(), iArr2);
                    int size3 = list.size();
                    for (int i3 = 0; i3 < size3; i3++) {
                        UW.g(uw, (VW) list.get(i3), iArr2[i3], ((Number) arrayList2.get(i)).intValue());
                    }
                }
                return Oh0.a;
            case 1:
                C0095Dr c0095Dr = (C0095Dr) this.n;
                C1182fI c1182fI = (C1182fI) this.f670o;
                QQ qq = (QQ) this.p;
                if (obj == c0095Dr) {
                    throw new IllegalStateException("A derived state calculation cannot read itself");
                }
                if (obj instanceof Ga0) {
                    int i4 = c1182fI.a - this.m;
                    int iD = qq.d(obj);
                    qq.h(Math.min(i4, iD >= 0 ? qq.c[iD] : Api.BaseClientBuilder.API_PRIORITY_OTHER), obj);
                }
                return Oh0.a;
            case 2:
                C1846mF c1846mF = (C1846mF) this.n;
                InterfaceC2424sO interfaceC2424sO2 = (InterfaceC2424sO) this.p;
                VW vw = (VW) this.f670o;
                UW uw2 = (UW) obj;
                int i5 = c1846mF.b;
                C1113ee0 c1113ee0 = c1846mF.a;
                C1785lg0 c1785lg0 = c1846mF.c;
                Oe0 oe0 = (Oe0) c1846mF.d.a();
                c1113ee0.a(OU.m, AbstractC2461sm0.a(uw2, i5, c1785lg0, oe0 != null ? oe0.a : null, interfaceC2424sO2.getLayoutDirection() == EnumC1280gK.m, vw.l), this.m, vw.l);
                UW.i(uw2, vw, Math.round(-c1113ee0.a.g()), 0);
                return Oh0.a;
            default:
                VW[] vwArr = (VW[]) this.n;
                C3062z30 c3062z30 = (C3062z30) this.f670o;
                int[] iArr3 = (int[]) this.p;
                UW uw3 = (UW) obj;
                int length = vwArr.length;
                int i6 = 0;
                int i7 = 0;
                while (i6 < length) {
                    VW vw2 = vwArr[i6];
                    int i8 = i7 + 1;
                    Object objK = vw2.k();
                    C2872x30 c2872x30 = objK instanceof C2872x30 ? (C2872x30) objK : null;
                    C0144Fo c0144Fo = c2872x30 != null ? c2872x30.c : null;
                    int i9 = this.m;
                    UW.g(uw3, vw2, iArr3[i7], c0144Fo != null ? c0144Fo.a(i9 - vw2.m, EnumC1280gK.l) : c3062z30.b.a(0, i9 - vw2.m));
                    i6++;
                    i7 = i8;
                }
                return Oh0.a;
        }
    }

    public /* synthetic */ C2110p2(C0095Dr c0095Dr, C1182fI c1182fI, QQ qq, int i) {
        this.n = c0095Dr;
        this.f670o = c1182fI;
        this.p = qq;
        this.m = i;
    }

    public /* synthetic */ C2110p2(C1846mF c1846mF, InterfaceC2424sO interfaceC2424sO, VW vw, int i) {
        this.n = c1846mF;
        this.p = interfaceC2424sO;
        this.f670o = vw;
        this.m = i;
    }

    public /* synthetic */ C2110p2(VW[] vwArr, C3062z30 c3062z30, int i, int[] iArr) {
        this.n = vwArr;
        this.f670o = c3062z30;
        this.m = i;
        this.p = iArr;
    }
}
