package o;

import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.qU, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2241qU extends HU {
    public static final C2241qU c = new C2241qU(1, 0, 2);

    @Override // o.HU
    public final void a(C2642ui c2642ui, T8 t8, C1365h90 c1365h90, C0312Mb c0312Mb, IU iu) {
        G2 g2;
        int iC;
        int iF = c2642ui.f(0);
        if (c1365h90.n != 0) {
            AbstractC0373Ok.c("Cannot move a group while inserting");
        }
        if (iF < 0) {
            AbstractC0373Ok.c("Parameter offset is out of bounds");
        }
        if (iF == 0) {
            return;
        }
        int i = c1365h90.t;
        int i2 = c1365h90.v;
        int i3 = c1365h90.u;
        int i4 = i;
        while (iF > 0) {
            i4 += c1365h90.b[(c1365h90.q(i4) * 5) + 3];
            if (i4 > i3) {
                AbstractC0373Ok.c("Parameter offset is out of bounds");
            }
            iF--;
        }
        int i5 = c1365h90.b[(c1365h90.q(i4) * 5) + 3];
        int iG = c1365h90.g(c1365h90.b, c1365h90.q(c1365h90.t));
        int iG2 = c1365h90.g(c1365h90.b, c1365h90.q(i4));
        int i6 = i4 + i5;
        int iG3 = c1365h90.g(c1365h90.b, c1365h90.q(i6));
        int i7 = iG3 - iG2;
        c1365h90.v(i7, Math.max(c1365h90.t - 1, 0));
        c1365h90.u(i5);
        int[] iArr = c1365h90.b;
        int iQ = c1365h90.q(i6) * 5;
        AbstractC2219q9.I(c1365h90.q(i) * 5, iQ, (i5 * 5) + iQ, iArr, iArr);
        if (i7 > 0) {
            Object[] objArr = c1365h90.c;
            int iH = c1365h90.h(iG2 + i7);
            System.arraycopy(objArr, iH, objArr, iG, c1365h90.h(iG3 + i7) - iH);
        }
        int i8 = iG2 + i7;
        int i9 = i8 - iG;
        int i10 = c1365h90.k;
        int i11 = c1365h90.l;
        int length = c1365h90.c.length;
        int i12 = c1365h90.m;
        int i13 = i + i5;
        int i14 = i;
        while (i14 < i13) {
            int iQ2 = c1365h90.q(i14);
            int i15 = i9;
            int[] iArr2 = iArr;
            iArr2[(iQ2 * 5) + 4] = C1365h90.i(C1365h90.i(c1365h90.g(iArr, iQ2) - i15, i12 < iQ2 ? 0 : i10, i11, length), c1365h90.k, c1365h90.l, c1365h90.c.length);
            i14++;
            i9 = i15;
            iArr = iArr2;
            i10 = i10;
        }
        int i16 = i6 + i5;
        int iO = c1365h90.o();
        int iB = AbstractC1269g90.b(c1365h90.d, i6, iO);
        ArrayList arrayList = new ArrayList();
        if (iB >= 0) {
            while (iB < c1365h90.d.size() && (iC = c1365h90.c((g2 = (G2) c1365h90.d.get(iB)))) >= i6 && iC < i16) {
                arrayList.add(g2);
            }
        }
        int i17 = i - i6;
        int size = arrayList.size();
        for (int i18 = 0; i18 < size; i18++) {
            G2 g22 = (G2) arrayList.get(i18);
            int iC2 = c1365h90.c(g22) + i17;
            if (iC2 >= c1365h90.g) {
                g22.a = -(iO - iC2);
            } else {
                g22.a = iC2;
            }
            c1365h90.d.add(AbstractC1269g90.b(c1365h90.d, iC2, iO), g22);
        }
        if (c1365h90.G(i6, i5)) {
            AbstractC0373Ok.c("Unexpectedly removed anchors");
        }
        c1365h90.m(i2, c1365h90.u, i);
        if (i7 > 0) {
            c1365h90.H(i8, i7, i6 - 1);
        }
    }
}
