178 lines
5.5 KiB
Java
178 lines
5.5 KiB
Java
package d0.c0;
|
|
|
|
import d0.x.b;
|
|
import d0.z.d.m;
|
|
import java.io.Serializable;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: Random.kt */
|
|
/* loaded from: classes3.dex */
|
|
public abstract class c {
|
|
public static final a k = new a(null);
|
|
public static final c j = b.a.defaultPlatformRandom();
|
|
|
|
/* compiled from: Random.kt */
|
|
/* loaded from: classes3.dex */
|
|
public static final class a extends c implements Serializable {
|
|
|
|
/* compiled from: Random.kt */
|
|
/* renamed from: d0.c0.c$a$a reason: collision with other inner class name */
|
|
/* loaded from: classes3.dex */
|
|
public static final class C0266a implements Serializable {
|
|
public static final C0266a j = new C0266a();
|
|
private static final long serialVersionUID = 0;
|
|
|
|
private final Object readResolve() {
|
|
return c.k;
|
|
}
|
|
}
|
|
|
|
public a() {
|
|
}
|
|
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
|
|
private final Object writeReplace() {
|
|
return C0266a.j;
|
|
}
|
|
|
|
@Override // d0.c0.c
|
|
public int nextBits(int i) {
|
|
return c.access$getDefaultRandom$cp().nextBits(i);
|
|
}
|
|
|
|
@Override // d0.c0.c
|
|
public byte[] nextBytes(int i) {
|
|
return c.access$getDefaultRandom$cp().nextBytes(i);
|
|
}
|
|
|
|
@Override // d0.c0.c
|
|
public byte[] nextBytes(byte[] bArr) {
|
|
m.checkNotNullParameter(bArr, "array");
|
|
return c.access$getDefaultRandom$cp().nextBytes(bArr);
|
|
}
|
|
|
|
@Override // d0.c0.c
|
|
public byte[] nextBytes(byte[] bArr, int i, int i2) {
|
|
m.checkNotNullParameter(bArr, "array");
|
|
return c.access$getDefaultRandom$cp().nextBytes(bArr, i, i2);
|
|
}
|
|
|
|
@Override // d0.c0.c
|
|
public int nextInt() {
|
|
return c.access$getDefaultRandom$cp().nextInt();
|
|
}
|
|
|
|
@Override // d0.c0.c
|
|
public int nextInt(int i) {
|
|
return c.access$getDefaultRandom$cp().nextInt(i);
|
|
}
|
|
|
|
@Override // d0.c0.c
|
|
public int nextInt(int i, int i2) {
|
|
return c.access$getDefaultRandom$cp().nextInt(i, i2);
|
|
}
|
|
|
|
@Override // d0.c0.c
|
|
public long nextLong() {
|
|
return c.access$getDefaultRandom$cp().nextLong();
|
|
}
|
|
}
|
|
|
|
public static final /* synthetic */ c access$getDefaultRandom$cp() {
|
|
return j;
|
|
}
|
|
|
|
public abstract int nextBits(int i);
|
|
|
|
public byte[] nextBytes(int i) {
|
|
return nextBytes(new byte[i]);
|
|
}
|
|
|
|
public byte[] nextBytes(byte[] bArr) {
|
|
m.checkNotNullParameter(bArr, "array");
|
|
return nextBytes(bArr, 0, bArr.length);
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:12:0x001a */
|
|
/* JADX WARN: Removed duplicated region for block: B:24:0x0084 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public byte[] nextBytes(byte[] bArr, int i, int i2) {
|
|
boolean z2;
|
|
m.checkNotNullParameter(bArr, "array");
|
|
int length = bArr.length;
|
|
boolean z3 = true;
|
|
if (i >= 0 && length >= i) {
|
|
int length2 = bArr.length;
|
|
if (i2 >= 0 && length2 >= i2) {
|
|
z2 = true;
|
|
if (!z2) {
|
|
if (i > i2) {
|
|
z3 = false;
|
|
}
|
|
if (z3) {
|
|
int i3 = (i2 - i) / 4;
|
|
for (int i4 = 0; i4 < i3; i4++) {
|
|
int nextInt = nextInt();
|
|
bArr[i] = (byte) nextInt;
|
|
bArr[i + 1] = (byte) (nextInt >>> 8);
|
|
bArr[i + 2] = (byte) (nextInt >>> 16);
|
|
bArr[i + 3] = (byte) (nextInt >>> 24);
|
|
i += 4;
|
|
}
|
|
int i5 = i2 - i;
|
|
int nextBits = nextBits(i5 * 8);
|
|
for (int i6 = 0; i6 < i5; i6++) {
|
|
bArr[i + i6] = (byte) (nextBits >>> (i6 * 8));
|
|
}
|
|
return bArr;
|
|
}
|
|
throw new IllegalArgumentException(("fromIndex (" + i + ") must be not greater than toIndex (" + i2 + ").").toString());
|
|
}
|
|
throw new IllegalArgumentException(b.d.b.a.a.z(b.d.b.a.a.U("fromIndex (", i, ") or toIndex (", i2, ") are out of range: 0.."), bArr.length, '.').toString());
|
|
}
|
|
}
|
|
z2 = false;
|
|
if (!z2) {
|
|
}
|
|
}
|
|
|
|
public abstract int nextInt();
|
|
|
|
public int nextInt(int i) {
|
|
return nextInt(0, i);
|
|
}
|
|
|
|
public int nextInt(int i, int i2) {
|
|
int i3;
|
|
int nextInt;
|
|
int i4;
|
|
d.checkRangeBounds(i, i2);
|
|
int i5 = i2 - i;
|
|
if (i5 > 0 || i5 == Integer.MIN_VALUE) {
|
|
if (((-i5) & i5) == i5) {
|
|
i3 = nextBits(d.fastLog2(i5));
|
|
} else {
|
|
do {
|
|
nextInt = nextInt() >>> 1;
|
|
i4 = nextInt % i5;
|
|
} while ((i5 - 1) + (nextInt - i4) < 0);
|
|
i3 = i4;
|
|
}
|
|
return i + i3;
|
|
}
|
|
while (true) {
|
|
int nextInt2 = nextInt();
|
|
if (i <= nextInt2 && i2 > nextInt2) {
|
|
return nextInt2;
|
|
}
|
|
}
|
|
}
|
|
|
|
public long nextLong() {
|
|
return (nextInt() << 32) + nextInt();
|
|
}
|
|
}
|