package o;

import java.util.Arrays;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class VJ implements InterfaceC0330Mt {
    public final UJ a;

    public VJ(UJ uj) {
        this.a = uj;
    }

    @Override // o.InterfaceC0330Mt, o.R6
    /* renamed from: f, reason: merged with bridge method [inline-methods] */
    public final C1601jj0 a(C1597jh0 c1597jh0) {
        int[] iArr;
        Object[] objArr;
        int[] iArr2;
        Object[] objArr2;
        int i;
        UJ uj = this.a;
        IQ iq = uj.b;
        HQ hq = new HQ(iq.e + 2);
        IQ iq2 = new IQ(iq.e);
        int[] iArr3 = iq.b;
        Object[] objArr3 = iq.c;
        long[] jArr = iq.a;
        int length = jArr.length - 2;
        if (length >= 0) {
            int i2 = 0;
            while (true) {
                long j = jArr[i2];
                if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) {
                    int i3 = 8;
                    int i4 = 8 - ((~(i2 - length)) >>> 31);
                    int i5 = 0;
                    while (i5 < i4) {
                        if ((j & 255) < 128) {
                            int i6 = (i2 << 3) + i5;
                            int i7 = iArr3[i6];
                            i = i3;
                            TJ tj = (TJ) objArr3[i6];
                            hq.a(i7);
                            iArr2 = iArr3;
                            objArr2 = objArr3;
                            iq2.h(i7, new C1506ij0((Y6) c1597jh0.a.g(tj.a), tj.b));
                        } else {
                            iArr2 = iArr3;
                            objArr2 = objArr3;
                            i = i3;
                        }
                        j >>= i;
                        i5++;
                        iArr3 = iArr2;
                        i3 = i;
                        objArr3 = objArr2;
                    }
                    iArr = iArr3;
                    objArr = objArr3;
                    if (i4 != i3) {
                        break;
                    }
                } else {
                    iArr = iArr3;
                    objArr = objArr3;
                }
                if (i2 == length) {
                    break;
                }
                i2++;
                iArr3 = iArr;
                objArr3 = objArr;
            }
        }
        if (!iq.a(0)) {
            int i8 = hq.b;
            if (i8 < 0) {
                AbstractC2841wm0.J("Index must be between 0 and size");
                throw null;
            }
            hq.b(i8 + 1);
            int[] iArr4 = hq.a;
            int i9 = hq.b;
            if (i9 != 0) {
                AbstractC2219q9.I(1, 0, i9, iArr4, iArr4);
            }
            iArr4[0] = 0;
            hq.b++;
        }
        if (!iq.a(uj.a)) {
            hq.a(uj.a);
        }
        int i10 = hq.b;
        if (i10 != 0) {
            Arrays.sort(hq.a, 0, i10);
        }
        return new C1601jj0(hq, iq2, uj.a, AbstractC0590Wt.b);
    }
}
