package androidx.collection; import androidx.annotation.IntRange; import androidx.collection.internal.ContainerHelpersKt; import com.ironsource.v8; import java.util.Collection; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.Set; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.CollectionToArray; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.SourceDebugExtension; import kotlin.jvm.internal.markers.KMappedMarker; import kotlin.sequences.SequencesKt__SequenceBuilderKt; @SourceDebugExtension({"SMAP\nScatterSet.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ScatterSet.kt\nandroidx/collection/ScatterSet\n+ 2 ScatterMap.kt\nandroidx/collection/ScatterMapKt\n*L\n1#1,1100:1\n267#1,4:1101\n237#1,7:1105\n248#1,3:1113\n251#1,2:1117\n272#1,2:1119\n254#1,6:1121\n274#1:1127\n267#1,4:1128\n237#1,7:1132\n248#1,3:1140\n251#1,2:1144\n272#1,2:1146\n254#1,6:1148\n274#1:1154\n267#1,4:1155\n237#1,7:1159\n248#1,3:1167\n251#1,2:1171\n272#1,2:1173\n254#1,6:1175\n274#1:1181\n237#1,7:1184\n248#1,3:1192\n251#1,9:1196\n267#1,4:1205\n237#1,7:1209\n248#1,3:1217\n251#1,2:1221\n272#1,2:1223\n254#1,6:1225\n274#1:1231\n267#1,4:1232\n237#1,7:1236\n248#1,3:1244\n251#1,2:1248\n272#1,2:1250\n254#1,6:1252\n274#1:1258\n267#1,4:1259\n237#1,7:1263\n248#1,3:1271\n251#1,2:1275\n272#1,2:1277\n254#1,6:1279\n274#1:1285\n433#1:1286\n434#1:1290\n436#1,2:1292\n438#1,3:1295\n441#1:1301\n442#1:1305\n443#1:1307\n444#1,4:1310\n450#1:1315\n451#1,8:1317\n267#1,4:1325\n237#1,7:1329\n248#1,3:1337\n251#1,2:1341\n272#1,2:1343\n254#1,6:1345\n274#1:1351\n267#1,4:1352\n237#1,7:1356\n248#1,3:1364\n251#1,2:1368\n272#1,2:1370\n254#1,6:1372\n274#1:1378\n267#1,4:1379\n237#1,7:1383\n248#1,3:1391\n251#1,2:1395\n272#1,2:1397\n254#1,6:1399\n274#1:1405\n1826#2:1112\n1688#2:1116\n1826#2:1139\n1688#2:1143\n1826#2:1166\n1688#2:1170\n1826#2:1182\n1688#2:1183\n1826#2:1191\n1688#2:1195\n1826#2:1216\n1688#2:1220\n1826#2:1243\n1688#2:1247\n1826#2:1270\n1688#2:1274\n1605#2,3:1287\n1619#2:1291\n1615#2:1294\n1795#2,3:1298\n1809#2,3:1302\n1733#2:1306\n1721#2:1308\n1715#2:1309\n1728#2:1314\n1818#2:1316\n1826#2:1336\n1688#2:1340\n1826#2:1363\n1688#2:1367\n1826#2:1390\n1688#2:1394\n1605#2,3:1406\n1619#2:1409\n1615#2:1410\n1795#2,3:1411\n1809#2,3:1414\n1733#2:1417\n1721#2:1418\n1715#2:1419\n1728#2:1420\n1818#2:1421\n*S KotlinDebug\n*F\n+ 1 ScatterSet.kt\nandroidx/collection/ScatterSet\n*L\n201#1:1101,4\n201#1:1105,7\n201#1:1113,3\n201#1:1117,2\n201#1:1119,2\n201#1:1121,6\n201#1:1127\n214#1:1128,4\n214#1:1132,7\n214#1:1140,3\n214#1:1144,2\n214#1:1146,2\n214#1:1148,6\n214#1:1154\n227#1:1155,4\n227#1:1159,7\n227#1:1167,3\n227#1:1171,2\n227#1:1173,2\n227#1:1175,6\n227#1:1181\n270#1:1184,7\n270#1:1192,3\n270#1:1196,9\n284#1:1205,4\n284#1:1209,7\n284#1:1217,3\n284#1:1221,2\n284#1:1223,2\n284#1:1225,6\n284#1:1231\n297#1:1232,4\n297#1:1236,7\n297#1:1244,3\n297#1:1248,2\n297#1:1250,2\n297#1:1252,6\n297#1:1258\n318#1:1259,4\n318#1:1263,7\n318#1:1271,3\n318#1:1275,2\n318#1:1277,2\n318#1:1279,6\n318#1:1285\n329#1:1286\n329#1:1290\n329#1:1292,2\n329#1:1295,3\n329#1:1301\n329#1:1305\n329#1:1307\n329#1:1310,4\n329#1:1315\n329#1:1317,8\n352#1:1325,4\n352#1:1329,7\n352#1:1337,3\n352#1:1341,2\n352#1:1343,2\n352#1:1345,6\n352#1:1351\n378#1:1352,4\n378#1:1356,7\n378#1:1364,3\n378#1:1368,2\n378#1:1370,2\n378#1:1372,6\n378#1:1378\n407#1:1379,4\n407#1:1383,7\n407#1:1391,3\n407#1:1395,2\n407#1:1397,2\n407#1:1399,6\n407#1:1405\n201#1:1112\n201#1:1116\n214#1:1139\n214#1:1143\n227#1:1166\n227#1:1170\n243#1:1182\n250#1:1183\n270#1:1191\n270#1:1195\n284#1:1216\n284#1:1220\n297#1:1243\n297#1:1247\n318#1:1270\n318#1:1274\n329#1:1287,3\n329#1:1291\n329#1:1294\n329#1:1298,3\n329#1:1302,3\n329#1:1306\n329#1:1308\n329#1:1309\n329#1:1314\n329#1:1316\n352#1:1336\n352#1:1340\n378#1:1363\n378#1:1367\n407#1:1390\n407#1:1394\n433#1:1406,3\n434#1:1409\n437#1:1410\n440#1:1411,3\n441#1:1414,3\n442#1:1417\n443#1:1418\n443#1:1419\n447#1:1420\n450#1:1421\n*E\n"}) /* loaded from: classes.dex */ public abstract class ScatterSet { public int _capacity; public int _size; public Object[] elements; public long[] metadata; public /* synthetic */ ScatterSet(DefaultConstructorMarker defaultConstructorMarker) { this(); } public static /* synthetic */ void getElements$annotations() { } public static /* synthetic */ void getMetadata$annotations() { } public final boolean any() { return this._size != 0; } @IntRange(from = 0) public final int getCapacity() { return this._capacity; } @IntRange(from = 0) public final int getSize() { return this._size; } public final boolean isEmpty() { return this._size == 0; } public final boolean isNotEmpty() { return this._size != 0; } public final String joinToString() { return joinToString$default(this, null, null, null, 0, null, null, 63, null); } public final String joinToString(CharSequence separator) { Intrinsics.checkNotNullParameter(separator, "separator"); return joinToString$default(this, separator, null, null, 0, null, null, 62, null); } public final String joinToString(CharSequence separator, CharSequence prefix) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); return joinToString$default(this, separator, prefix, null, 0, null, null, 60, null); } public final String joinToString(CharSequence separator, CharSequence prefix, CharSequence postfix) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); Intrinsics.checkNotNullParameter(postfix, "postfix"); return joinToString$default(this, separator, prefix, postfix, 0, null, null, 56, null); } public final String joinToString(CharSequence separator, CharSequence prefix, CharSequence postfix, int i) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); Intrinsics.checkNotNullParameter(postfix, "postfix"); return joinToString$default(this, separator, prefix, postfix, i, null, null, 48, null); } public final String joinToString(CharSequence separator, CharSequence prefix, CharSequence postfix, int i, CharSequence truncated) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); Intrinsics.checkNotNullParameter(postfix, "postfix"); Intrinsics.checkNotNullParameter(truncated, "truncated"); return joinToString$default(this, separator, prefix, postfix, i, truncated, null, 32, null); } public final boolean none() { return this._size == 0; } private ScatterSet() { this.metadata = ScatterMapKt.EmptyGroup; this.elements = ContainerHelpersKt.EMPTY_OBJECTS; } public final boolean all(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; if (length < 0) { return true; } int i = 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 && !((Boolean) predicate.invoke(objArr[(i << 3) + i3])).booleanValue()) { return false; } j >>= 8; } if (i2 != 8) { return true; } } if (i == length) { return true; } i++; } } public final boolean any(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; if (length >= 0) { int i = 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 && ((Boolean) predicate.invoke(objArr[(i << 3) + i3])).booleanValue()) { return true; } j >>= 8; } if (i2 != 8) { break; } } if (i == length) { break; } i++; } } return false; } @IntRange(from = 0) public final int count(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; int i = 0; if (length >= 0) { int i2 = 0; int i3 = 0; while (true) { long j = jArr[i2]; if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) { int i4 = 8 - ((~(i2 - length)) >>> 31); for (int i5 = 0; i5 < i4; i5++) { if ((255 & j) < 128 && ((Boolean) predicate.invoke(objArr[(i2 << 3) + i5])).booleanValue()) { i3++; } j >>= 8; } if (i4 != 8) { return i3; } } if (i2 == length) { i = i3; break; } i2++; } } return i; } public final E first() { Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; if (length >= 0) { int i = 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) { return (E) objArr[(i << 3) + i3]; } j >>= 8; } if (i2 != 8) { break; } } if (i == length) { break; } i++; } } throw new NoSuchElementException("The ScatterSet is empty"); } public final E first(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; if (length >= 0) { int i = 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) { E e = (E) objArr[(i << 3) + i3]; if (((Boolean) predicate.invoke(e)).booleanValue()) { return e; } } j >>= 8; } if (i2 != 8) { break; } } if (i == length) { break; } i++; } } throw new NoSuchElementException("Could not find a match"); } public final E firstOrNull(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; if (length < 0) { return null; } int i = 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) { E e = (E) objArr[(i << 3) + i3]; if (((Boolean) predicate.invoke(e)).booleanValue()) { return e; } } j >>= 8; } if (i2 != 8) { return null; } } if (i == length) { return null; } i++; } } public final void forEach(Function1 block) { Intrinsics.checkNotNullParameter(block, "block"); Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; if (length < 0) { return; } int i = 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) { block.invoke(objArr[(i << 3) + i3]); } j >>= 8; } if (i2 != 8) { return; } } if (i == length) { return; } else { i++; } } } public final void forEachIndex(Function1 block) { Intrinsics.checkNotNullParameter(block, "block"); long[] jArr = this.metadata; int length = jArr.length - 2; if (length < 0) { return; } int i = 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) { block.invoke(Integer.valueOf((i << 3) + i3)); } j >>= 8; } if (i2 != 8) { return; } } if (i == length) { return; } else { i++; } } } public int hashCode() { Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; int i = 0; if (length >= 0) { int i2 = 0; int i3 = 0; while (true) { long j = jArr[i2]; if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) { int i4 = 8 - ((~(i2 - length)) >>> 31); for (int i5 = 0; i5 < i4; i5++) { if ((255 & j) < 128) { Object obj = objArr[(i2 << 3) + i5]; i3 += obj != null ? obj.hashCode() : 0; } j >>= 8; } if (i4 != 8) { return i3; } } if (i2 == length) { i = i3; break; } i2++; } } return i; } @IntRange(from = 0) public final int count() { return getSize(); } public static /* synthetic */ String joinToString$default(ScatterSet scatterSet, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, Function1 function1, int i2, Object obj) { if (obj != null) { throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: joinToString"); } if ((i2 & 1) != 0) { charSequence = ", "; } CharSequence charSequence5 = (i2 & 2) != 0 ? "" : charSequence2; CharSequence charSequence6 = (i2 & 4) == 0 ? charSequence3 : ""; if ((i2 & 8) != 0) { i = -1; } int i3 = i; if ((i2 & 16) != 0) { charSequence4 = "..."; } CharSequence charSequence7 = charSequence4; if ((i2 & 32) != 0) { function1 = null; } return scatterSet.joinToString(charSequence, charSequence5, charSequence6, i3, charSequence7, function1); } public final String joinToString(CharSequence separator, CharSequence prefix, CharSequence postfix, int i, CharSequence truncated, Function1 function1) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); Intrinsics.checkNotNullParameter(postfix, "postfix"); Intrinsics.checkNotNullParameter(truncated, "truncated"); StringBuilder sb = new StringBuilder(); sb.append(prefix); Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; if (length >= 0) { int i2 = 0; int i3 = 0; loop0: while (true) { long j = jArr[i2]; if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) { int i4 = 8; int i5 = 8 - ((~(i2 - length)) >>> 31); for (int i6 = 0; i6 < i5; i6++) { if ((j & 255) < 128) { Object obj = objArr[(i2 << 3) + i6]; if (i3 == i) { sb.append(truncated); break loop0; } if (i3 != 0) { sb.append(separator); } if (function1 == null) { sb.append(obj); } else { sb.append((CharSequence) function1.invoke(obj)); } i3++; i4 = 8; } j >>= i4; } if (i5 != i4) { break; } } if (i2 == length) { break; } i2++; } } sb.append(postfix); String sb2 = sb.toString(); Intrinsics.checkNotNullExpressionValue(sb2, "StringBuilder().apply(builderAction).toString()"); return sb2; } /* JADX WARN: Multi-variable type inference failed */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ScatterSet)) { return false; } ScatterSet scatterSet = (ScatterSet) obj; if (scatterSet.getSize() != getSize()) { return false; } Object[] objArr = this.elements; long[] jArr = this.metadata; int length = jArr.length - 2; if (length >= 0) { int i = 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 && !scatterSet.contains(objArr[(i << 3) + i3])) { return false; } j >>= 8; } if (i2 != 8) { break; } } if (i == length) { break; } i++; } } return true; } public String toString() { return joinToString$default(this, null, v8.i.d, v8.i.e, 0, null, new Function1(this) { // from class: androidx.collection.ScatterSet$toString$1 final /* synthetic */ ScatterSet this$0; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(1); this.this$0 = this; } @Override // kotlin.jvm.functions.Function1 public /* bridge */ /* synthetic */ Object invoke(Object obj) { return invoke((ScatterSet$toString$1) obj); } @Override // kotlin.jvm.functions.Function1 public final CharSequence invoke(E e) { return e == this.this$0 ? "(this)" : String.valueOf(e); } }, 25, null); } public final Set asSet() { return new SetWrapper(); } @SourceDebugExtension({"SMAP\nScatterSet.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ScatterSet.kt\nandroidx/collection/ScatterSet$SetWrapper\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,1100:1\n1855#2,2:1101\n*S KotlinDebug\n*F\n+ 1 ScatterSet.kt\nandroidx/collection/ScatterSet$SetWrapper\n*L\n478#1:1101,2\n*E\n"}) public class SetWrapper implements Set, KMappedMarker { @Override // java.util.Set, java.util.Collection public boolean add(E e) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.Set, java.util.Collection public boolean addAll(Collection collection) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.Set, java.util.Collection public void clear() { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.Set, java.util.Collection public boolean remove(Object obj) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.Set, java.util.Collection public boolean removeAll(Collection collection) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.Set, java.util.Collection public boolean retainAll(Collection collection) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.Set, java.util.Collection public Object[] toArray() { return CollectionToArray.toArray(this); } @Override // java.util.Set, java.util.Collection public T[] toArray(T[] array) { Intrinsics.checkNotNullParameter(array, "array"); return (T[]) CollectionToArray.toArray(this, array); } public SetWrapper() { } @Override // java.util.Set, java.util.Collection public final /* bridge */ int size() { return getSize(); } public int getSize() { return ScatterSet.this._size; } /* JADX WARN: Multi-variable type inference failed */ @Override // java.util.Set, java.util.Collection public boolean containsAll(Collection elements) { Intrinsics.checkNotNullParameter(elements, "elements"); ScatterSet scatterSet = ScatterSet.this; Iterator it = elements.iterator(); while (it.hasNext()) { if (!scatterSet.contains(it.next())) { return false; } } return true; } @Override // java.util.Set, java.util.Collection public boolean contains(Object obj) { return ScatterSet.this.contains(obj); } @Override // java.util.Set, java.util.Collection public boolean isEmpty() { return ScatterSet.this.isEmpty(); } @Override // java.util.Set, java.util.Collection, java.lang.Iterable public Iterator iterator() { Iterator it; it = SequencesKt__SequenceBuilderKt.iterator(new ScatterSet$SetWrapper$iterator$1(ScatterSet.this, null)); return it; } } public final boolean contains(E e) { int hashCode = (e != null ? e.hashCode() : 0) * ScatterMapKt.MurmurHashC1; int i = hashCode ^ (hashCode << 16); int i2 = i & 127; int i3 = this._capacity; int i4 = (i >>> 7) & i3; int i5 = 0; while (true) { long[] jArr = this.metadata; int i6 = i4 >> 3; int i7 = (i4 & 7) << 3; long j = ((jArr[i6 + 1] << (64 - i7)) & ((-i7) >> 63)) | (jArr[i6] >>> i7); long j2 = (i2 * ScatterMapKt.BitmaskLsb) ^ j; for (long j3 = (~j2) & (j2 - ScatterMapKt.BitmaskLsb) & (-9187201950435737472L); j3 != 0; j3 &= j3 - 1) { int numberOfTrailingZeros = ((Long.numberOfTrailingZeros(j3) >> 3) + i4) & i3; if (Intrinsics.areEqual(this.elements[numberOfTrailingZeros], e)) { return numberOfTrailingZeros >= 0; } } if ((j & ((~j) << 6) & (-9187201950435737472L)) != 0) { return false; } i5 += 8; i4 = (i4 + i5) & i3; } } public final int findElementIndex$collection(E e) { int i = 0; int hashCode = (e != null ? e.hashCode() : 0) * ScatterMapKt.MurmurHashC1; int i2 = hashCode ^ (hashCode << 16); int i3 = i2 & 127; int i4 = this._capacity; int i5 = i2 >>> 7; while (true) { int i6 = i5 & i4; long[] jArr = this.metadata; int i7 = i6 >> 3; int i8 = (i6 & 7) << 3; long j = ((jArr[i7 + 1] << (64 - i8)) & ((-i8) >> 63)) | (jArr[i7] >>> i8); long j2 = (i3 * ScatterMapKt.BitmaskLsb) ^ j; for (long j3 = (~j2) & (j2 - ScatterMapKt.BitmaskLsb) & (-9187201950435737472L); j3 != 0; j3 &= j3 - 1) { int numberOfTrailingZeros = ((Long.numberOfTrailingZeros(j3) >> 3) + i6) & i4; if (Intrinsics.areEqual(this.elements[numberOfTrailingZeros], e)) { return numberOfTrailingZeros; } } if ((j & ((~j) << 6) & (-9187201950435737472L)) != 0) { return -1; } i += 8; i5 = i6 + i; } } }