package defpackage;

import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.upstream.CmcdData;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.function.BiFunction;
import java.util.function.Function;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\b6\u0018\u0000*\u0004\b\u0000\u0010\u0001*\u0004\b\u0001\u0010\u00022\u00020\u0003:\u0001\u0004\u0082\u0001\u0001\u0005¨\u0006\u0006"}, d2 = {"Lkb8;", "K", "V", "", CmcdData.OBJECT_TYPE_AUDIO_ONLY, "Lcg6;", "collection"}, k = 1, mv = {1, 8, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@vx8
public abstract class kb8<K, V> {
    public long[] a;
    public Object[] b;
    public Object[] c;
    public int d;

    @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010$\n\u0000\b\u0090\u0004\u0018\u00002\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0001¨\u0006\u0002"}, d2 = {"Lkb8$a;", "", "collection"}, k = 1, mv = {1, 8, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public class a implements Map<K, V>, f25 {
        public Set a() {
            return new fb8();
        }

        public Set b() {
            return new hb8();
        }

        public Collection c() {
            return new jb8();
        }

        @Override // java.util.Map
        public void clear() {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public final Object compute(Object obj, BiFunction biFunction) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public final Object computeIfAbsent(Object obj, Function function) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public final Object computeIfPresent(Object obj, BiFunction biFunction) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public final boolean containsKey(Object obj) {
            throw null;
        }

        @Override // java.util.Map
        public final boolean containsValue(Object obj) {
            throw null;
        }

        @Override // java.util.Map
        public final /* bridge */ Set entrySet() {
            return a();
        }

        @Override // java.util.Map
        public final Object get(Object obj) {
            throw null;
        }

        @Override // java.util.Map
        public final boolean isEmpty() {
            throw null;
        }

        @Override // java.util.Map
        public final /* bridge */ Set keySet() {
            return b();
        }

        @Override // java.util.Map
        public final Object merge(Object obj, Object obj2, BiFunction biFunction) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public Object put(Object obj, Object obj2) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public void putAll(Map map) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public final Object putIfAbsent(Object obj, Object obj2) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public Object remove(Object obj) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public final Object replace(Object obj, Object obj2) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public final void replaceAll(BiFunction biFunction) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public final int size() {
            throw null;
        }

        @Override // java.util.Map
        public final /* bridge */ Collection values() {
            return c();
        }

        @Override // java.util.Map
        public final boolean remove(Object obj, Object obj2) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }

        @Override // java.util.Map
        public final boolean replace(Object obj, Object obj2, Object obj3) {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:15:0x0068, code lost:
    
        if (((r4 & ((~r4) << 6)) & (-9187201950435737472L)) == 0) goto L22;
     */
    /* JADX WARN: Code restructure failed: missing block: B:16:0x006a, code lost:
    
        r10 = -1;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object a(Object obj) {
        int iNumberOfTrailingZeros;
        int i = 0;
        int iHashCode = (obj != null ? obj.hashCode() : 0) * (-862048943);
        int i2 = iHashCode ^ (iHashCode << 16);
        int i3 = i2 & 127;
        int i4 = this.d;
        int i5 = i2 >>> 7;
        loop0: while (true) {
            int i6 = i5 & i4;
            long[] jArr = this.a;
            int i7 = i6 >> 3;
            int i8 = (i6 & 7) << 3;
            long j = ((jArr[i7 + 1] << (64 - i8)) & ((-i8) >> 63)) | (jArr[i7] >>> i8);
            long j2 = (((long) i3) * 72340172838076673L) ^ j;
            long j3 = (~j2) & (j2 - 72340172838076673L) & (-9187201950435737472L);
            while (true) {
                if (j3 == 0) {
                    break;
                }
                iNumberOfTrailingZeros = ((Long.numberOfTrailingZeros(j3) >> 3) + i6) & i4;
                if (cr4.b(this.b[iNumberOfTrailingZeros], obj)) {
                    break loop0;
                }
                j3 &= j3 - 1;
            }
            i += 8;
            i5 = i6 + i;
        }
        if (iNumberOfTrailingZeros >= 0) {
            return this.c[iNumberOfTrailingZeros];
        }
        return null;
    }

    /* JADX WARN: Code restructure failed: missing block: B:33:0x00db, code lost:
    
        if (((r3 & ((~r3) << 6)) & (-9187201950435737472L)) == 0) goto L40;
     */
    /* JADX WARN: Code restructure failed: missing block: B:34:0x00dd, code lost:
    
        r26 = -1;
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r13v2 */
    /* JADX WARN: Type inference failed for: r13v3, types: [int] */
    /* JADX WARN: Type inference failed for: r13v5 */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean equals(Object obj) {
        boolean z;
        Object[] objArr;
        boolean z2;
        Object[] objArr2;
        long[] jArr;
        boolean z3;
        Object[] objArr3;
        boolean z4;
        long[] jArr2;
        int i;
        Object[] objArr4;
        int iHashCode;
        int iNumberOfTrailingZeros;
        boolean z5 = true;
        if (obj == this) {
            return true;
        }
        boolean z6 = false;
        if (!(obj instanceof kb8)) {
            return false;
        }
        kb8 kb8Var = (kb8) obj;
        Object[] objArr5 = this.b;
        Object[] objArr6 = this.c;
        long[] jArr3 = this.a;
        int length = jArr3.length - 2;
        if (length < 0) {
            return true;
        }
        int i2 = 0;
        while (true) {
            long j = jArr3[i2];
            if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) {
                int i3 = 8;
                int i4 = 8 - ((~(i2 - length)) >>> 31);
                for (?? r13 = z6; r13 < i4; r13++) {
                    if ((255 & j) < 128) {
                        int i5 = (i2 << 3) + r13;
                        Object obj2 = objArr5[i5];
                        Object obj3 = objArr6[i5];
                        if (obj3 != null) {
                            z3 = z5;
                            objArr3 = objArr5;
                            z4 = z6;
                            jArr2 = jArr3;
                            i = i3;
                            objArr4 = objArr6;
                            if (!obj3.equals(kb8Var.a(obj2))) {
                                return z4;
                            }
                        } else {
                            if (kb8Var.a(obj2) != null) {
                                return z6;
                            }
                            if (obj2 != null) {
                                kb8Var.getClass();
                                iHashCode = obj2.hashCode();
                            } else {
                                iHashCode = 0;
                            }
                            int i6 = iHashCode * (-862048943);
                            int i7 = i6 ^ (i6 << 16);
                            z3 = z5;
                            int i8 = i7 & 127;
                            z4 = z6;
                            int i9 = kb8Var.d;
                            int i10 = (i7 >>> 7) & i9;
                            int i11 = 0;
                            while (true) {
                                long[] jArr4 = kb8Var.a;
                                int i12 = i10 >> 3;
                                i = i3;
                                int i13 = (i10 & 7) << 3;
                                long j2 = jArr4[i12] >>> i13;
                                long j3 = jArr4[i12 + 1] << (64 - i13);
                                objArr3 = objArr5;
                                int i14 = i9;
                                long j4 = j2 | (j3 & ((-i13) >> 63));
                                objArr4 = objArr6;
                                jArr2 = jArr3;
                                long j5 = (((long) i8) * 72340172838076673L) ^ j4;
                                long j6 = (j5 - 72340172838076673L) & (~j5) & (-9187201950435737472L);
                                while (true) {
                                    if (j6 == 0) {
                                        break;
                                    }
                                    iNumberOfTrailingZeros = (i10 + (Long.numberOfTrailingZeros(j6) >> 3)) & i14;
                                    if (cr4.b(kb8Var.b[iNumberOfTrailingZeros], obj2)) {
                                        break;
                                    }
                                    j6 &= j6 - 1;
                                }
                                i11 += 8;
                                i10 = (i10 + i11) & i14;
                                objArr6 = objArr4;
                                i9 = i14;
                                objArr5 = objArr3;
                                i3 = i;
                                jArr3 = jArr2;
                            }
                            if (!(iNumberOfTrailingZeros >= 0)) {
                                return z4;
                            }
                        }
                    } else {
                        z3 = z5;
                        objArr3 = objArr5;
                        z4 = z6;
                        jArr2 = jArr3;
                        i = i3;
                        objArr4 = objArr6;
                    }
                    j >>= i;
                    objArr6 = objArr4;
                    z5 = z3;
                    z6 = z4;
                    objArr5 = objArr3;
                    i3 = i;
                    jArr3 = jArr2;
                }
                z = z5;
                objArr = objArr5;
                z2 = z6;
                jArr = jArr3;
                int i15 = i3;
                objArr2 = objArr6;
                if (i4 != i15) {
                    return z;
                }
            } else {
                z = z5;
                objArr = objArr5;
                z2 = z6;
                objArr2 = objArr6;
                jArr = jArr3;
            }
            if (i2 == length) {
                return z;
            }
            i2++;
            objArr6 = objArr2;
            z5 = z;
            z6 = z2;
            objArr5 = objArr;
            jArr3 = jArr;
        }
    }

    public final int hashCode() {
        Object[] objArr = this.b;
        Object[] objArr2 = this.c;
        long[] jArr = this.a;
        int length = jArr.length - 2;
        if (length < 0) {
            return 0;
        }
        int i = 0;
        int iHashCode = 0;
        while (true) {
            long j = jArr[i];
            if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) {
                int i2 = 8 - ((~(i - length)) >>> 31);
                for (int i3 = 0; i3 < i2; i3++) {
                    if ((255 & j) < 128) {
                        int i4 = (i << 3) + i3;
                        Object obj = objArr[i4];
                        Object obj2 = objArr2[i4];
                        iHashCode += (obj2 != null ? obj2.hashCode() : 0) ^ (obj != null ? obj.hashCode() : 0);
                    }
                    j >>= 8;
                }
                if (i2 != 8) {
                    return iHashCode;
                }
            }
            if (i == length) {
                return iHashCode;
            }
            i++;
        }
    }

    public final String toString() {
        return "{}";
    }
}
