Rabbit-R1/switch port/smali/smali_classes3/kotlin/random/Random.smali
2024-05-21 17:08:36 -04:00

831 lines
16 KiB
Smali

.class public abstract Lkotlin/random/Random;
.super Ljava/lang/Object;
.source "Random.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lkotlin/random/Random$Default;
}
.end annotation
.annotation system Ldalvik/annotation/SourceDebugExtension;
value = "SMAP\nRandom.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Random.kt\nkotlin/random/Random\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,383:1\n1#2:384\n*E\n"
.end annotation
.annotation runtime Lkotlin/Metadata;
d1 = {
"\u0000:\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0008\u0002\n\u0002\u0010\u0008\n\u0002\u0008\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0012\n\u0002\u0008\u0005\n\u0002\u0010\u0006\n\u0002\u0008\u0003\n\u0002\u0010\u0007\n\u0002\u0008\u0002\n\u0002\u0010\t\n\u0002\u0008\u0002\u0008\'\u0018\u0000 \u00172\u00020\u0001:\u0001\u0017B\u0005\u00a2\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0004H&J\u0008\u0010\u0006\u001a\u00020\u0007H\u0016J\u0010\u0010\u0008\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\tH\u0016J$\u0010\u0008\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\t2\u0008\u0008\u0002\u0010\u000b\u001a\u00020\u00042\u0008\u0008\u0002\u0010\u000c\u001a\u00020\u0004H\u0016J\u0010\u0010\u0008\u001a\u00020\t2\u0006\u0010\r\u001a\u00020\u0004H\u0016J\u0008\u0010\u000e\u001a\u00020\u000fH\u0016J\u0010\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u000fH\u0016J\u0018\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0011\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u000fH\u0016J\u0008\u0010\u0012\u001a\u00020\u0013H\u0016J\u0008\u0010\u0014\u001a\u00020\u0004H\u0016J\u0010\u0010\u0014\u001a\u00020\u00042\u0006\u0010\u0010\u001a\u00020\u0004H\u0016J\u0018\u0010\u0014\u001a\u00020\u00042\u0006\u0010\u0011\u001a\u00020\u00042\u0006\u0010\u0010\u001a\u00020\u0004H\u0016J\u0008\u0010\u0015\u001a\u00020\u0016H\u0016J\u0010\u0010\u0015\u001a\u00020\u00162\u0006\u0010\u0010\u001a\u00020\u0016H\u0016J\u0018\u0010\u0015\u001a\u00020\u00162\u0006\u0010\u0011\u001a\u00020\u00162\u0006\u0010\u0010\u001a\u00020\u0016H\u0016\u00a8\u0006\u0018"
}
d2 = {
"Lkotlin/random/Random;",
"",
"()V",
"nextBits",
"",
"bitCount",
"nextBoolean",
"",
"nextBytes",
"",
"array",
"fromIndex",
"toIndex",
"size",
"nextDouble",
"",
"until",
"from",
"nextFloat",
"",
"nextInt",
"nextLong",
"",
"Default",
"kotlin-stdlib"
}
k = 0x1
mv = {
0x1,
0x9,
0x0
}
xi = 0x30
.end annotation
# static fields
.field public static final Default:Lkotlin/random/Random$Default;
.field private static final defaultRandom:Lkotlin/random/Random;
# direct methods
.method static constructor <clinit>()V
.locals 2
new-instance v0, Lkotlin/random/Random$Default;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lkotlin/random/Random$Default;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lkotlin/random/Random;->Default:Lkotlin/random/Random$Default;
.line 271
sget-object v0, Lkotlin/internal/PlatformImplementationsKt;->IMPLEMENTATIONS:Lkotlin/internal/PlatformImplementations;
invoke-virtual {v0}, Lkotlin/internal/PlatformImplementations;->defaultPlatformRandom()Lkotlin/random/Random;
move-result-object v0
sput-object v0, Lkotlin/random/Random;->defaultRandom:Lkotlin/random/Random;
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 19
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static final synthetic access$getDefaultRandom$cp()Lkotlin/random/Random;
.locals 1
sget-object v0, Lkotlin/random/Random;->defaultRandom:Lkotlin/random/Random;
return-object v0
.end method
.method public static synthetic nextBytes$default(Lkotlin/random/Random;[BIIILjava/lang/Object;)[B
.locals 0
if-nez p5, :cond_2
and-int/lit8 p5, p4, 0x2
if-eqz p5, :cond_0
const/4 p2, 0x0
:cond_0
and-int/lit8 p4, p4, 0x4
if-eqz p4, :cond_1
.line 221
array-length p3, p1
:cond_1
invoke-virtual {p0, p1, p2, p3}, Lkotlin/random/Random;->nextBytes([BII)[B
move-result-object p0
return-object p0
:cond_2
new-instance p0, Ljava/lang/UnsupportedOperationException;
const-string p1, "Super calls with default arguments not supported in this target, function: nextBytes"
invoke-direct {p0, p1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
throw p0
.end method
# virtual methods
.method public abstract nextBits(I)I
.end method
.method public nextBoolean()Z
.locals 1
const/4 v0, 0x1
.line 163
invoke-virtual {p0, v0}, Lkotlin/random/Random;->nextBits(I)I
move-result p0
if-eqz p0, :cond_0
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
.method public nextBytes(I)[B
.locals 0
.line 260
new-array p1, p1, [B
invoke-virtual {p0, p1}, Lkotlin/random/Random;->nextBytes([B)[B
move-result-object p0
return-object p0
.end method
.method public nextBytes([B)[B
.locals 2
const-string v0, "array"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const/4 v0, 0x0
.line 253
array-length v1, p1
invoke-virtual {p0, p1, v0, v1}, Lkotlin/random/Random;->nextBytes([BII)[B
move-result-object p0
return-object p0
.end method
.method public nextBytes([BII)[B
.locals 6
const-string v0, "array"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 222
new-instance v0, Lkotlin/ranges/IntRange;
array-length v1, p1
const/4 v2, 0x0
invoke-direct {v0, v2, v1}, Lkotlin/ranges/IntRange;-><init>(II)V
invoke-virtual {v0, p2}, Lkotlin/ranges/IntRange;->contains(I)Z
move-result v0
const-string v1, "fromIndex ("
if-eqz v0, :cond_3
new-instance v0, Lkotlin/ranges/IntRange;
array-length v3, p1
invoke-direct {v0, v2, v3}, Lkotlin/ranges/IntRange;-><init>(II)V
invoke-virtual {v0, p3}, Lkotlin/ranges/IntRange;->contains(I)Z
move-result v0
if-eqz v0, :cond_3
if-gt p2, p3, :cond_2
sub-int v0, p3, p2
.line 225
div-int/lit8 v0, v0, 0x4
move v1, v2
:goto_0
if-ge v1, v0, :cond_0
.line 229
invoke-virtual {p0}, Lkotlin/random/Random;->nextInt()I
move-result v3
int-to-byte v4, v3
.line 230
aput-byte v4, p1, p2
add-int/lit8 v4, p2, 0x1
ushr-int/lit8 v5, v3, 0x8
int-to-byte v5, v5
.line 231
aput-byte v5, p1, v4
add-int/lit8 v4, p2, 0x2
ushr-int/lit8 v5, v3, 0x10
int-to-byte v5, v5
.line 232
aput-byte v5, p1, v4
add-int/lit8 v4, p2, 0x3
ushr-int/lit8 v3, v3, 0x18
int-to-byte v3, v3
.line 233
aput-byte v3, p1, v4
add-int/lit8 p2, p2, 0x4
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_0
sub-int/2addr p3, p2
mul-int/lit8 v0, p3, 0x8
.line 238
invoke-virtual {p0, v0}, Lkotlin/random/Random;->nextBits(I)I
move-result p0
:goto_1
if-ge v2, p3, :cond_1
add-int v0, p2, v2
mul-int/lit8 v1, v2, 0x8
ushr-int v1, p0, v1
int-to-byte v1, v1
.line 240
aput-byte v1, p1, v0
add-int/lit8 v2, v2, 0x1
goto :goto_1
:cond_1
return-object p1
.line 223
:cond_2
new-instance p0, Ljava/lang/StringBuilder;
invoke-direct {p0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object p0
const-string p1, ") must be not greater than toIndex ("
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object p0
const-string p1, ")."
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.line 222
:cond_3
new-instance p0, Ljava/lang/StringBuilder;
invoke-direct {p0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object p0
const-string p2, ") or toIndex ("
invoke-virtual {p0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object p0
const-string p2, ") are out of range: 0.."
invoke-virtual {p0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
array-length p1, p1
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object p0
const/16 p1, 0x2e
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public nextDouble()D
.locals 2
const/16 v0, 0x1a
.line 170
invoke-virtual {p0, v0}, Lkotlin/random/Random;->nextBits(I)I
move-result v0
const/16 v1, 0x1b
invoke-virtual {p0, v1}, Lkotlin/random/Random;->nextBits(I)I
move-result p0
invoke-static {v0, p0}, Lkotlin/random/PlatformRandomKt;->doubleFromParts(II)D
move-result-wide v0
return-wide v0
.end method
.method public nextDouble(D)D
.locals 2
const-wide/16 v0, 0x0
.line 181
invoke-virtual {p0, v0, v1, p1, p2}, Lkotlin/random/Random;->nextDouble(DD)D
move-result-wide p0
return-wide p0
.end method
.method public nextDouble(DD)D
.locals 6
.line 195
invoke-static {p1, p2, p3, p4}, Lkotlin/random/RandomKt;->checkRangeBounds(DD)V
sub-double v0, p3, p1
.line 197
invoke-static {v0, v1}, Ljava/lang/Double;->isInfinite(D)Z
move-result v2
if-eqz v2, :cond_0
invoke-static {p1, p2}, Ljava/lang/Double;->isInfinite(D)Z
move-result v2
if-nez v2, :cond_0
invoke-static {p1, p2}, Ljava/lang/Double;->isNaN(D)Z
move-result v2
if-nez v2, :cond_0
invoke-static {p3, p4}, Ljava/lang/Double;->isInfinite(D)Z
move-result v2
if-nez v2, :cond_0
invoke-static {p3, p4}, Ljava/lang/Double;->isNaN(D)Z
move-result v2
if-nez v2, :cond_0
.line 198
invoke-virtual {p0}, Lkotlin/random/Random;->nextDouble()D
move-result-wide v0
const/4 p0, 0x2
int-to-double v2, p0
div-double v4, p3, v2
div-double v2, p1, v2
sub-double/2addr v4, v2
mul-double/2addr v0, v4
add-double/2addr p1, v0
add-double/2addr p1, v0
goto :goto_0
.line 201
:cond_0
invoke-virtual {p0}, Lkotlin/random/Random;->nextDouble()D
move-result-wide v2
mul-double/2addr v2, v0
add-double/2addr p1, v2
:goto_0
cmpl-double p0, p1, p3
if-ltz p0, :cond_1
const-wide/high16 p0, -0x10000000000000L # Double.NEGATIVE_INFINITY
.line 203
invoke-static {p3, p4, p0, p1}, Ljava/lang/Math;->nextAfter(DD)D
move-result-wide p1
:cond_1
return-wide p1
.end method
.method public nextFloat()F
.locals 1
const/16 v0, 0x18
.line 211
invoke-virtual {p0, v0}, Lkotlin/random/Random;->nextBits(I)I
move-result p0
int-to-float p0, p0
const/high16 v0, 0x4b800000 # 1.6777216E7f
div-float/2addr p0, v0
return p0
.end method
.method public nextInt()I
.locals 1
const/16 v0, 0x20
.line 40
invoke-virtual {p0, v0}, Lkotlin/random/Random;->nextBits(I)I
move-result p0
return p0
.end method
.method public nextInt(I)I
.locals 1
const/4 v0, 0x0
.line 53
invoke-virtual {p0, v0, p1}, Lkotlin/random/Random;->nextInt(II)I
move-result p0
return p0
.end method
.method public nextInt(II)I
.locals 3
.line 65
invoke-static {p1, p2}, Lkotlin/random/RandomKt;->checkRangeBounds(II)V
sub-int v0, p2, p1
if-gtz v0, :cond_1
const/high16 v1, -0x80000000
if-ne v0, v1, :cond_0
goto :goto_0
.line 82
:cond_0
invoke-virtual {p0}, Lkotlin/random/Random;->nextInt()I
move-result v0
if-gt p1, v0, :cond_0
if-ge v0, p2, :cond_0
return v0
:cond_1
:goto_0
neg-int p2, v0
and-int/2addr p2, v0
if-ne p2, v0, :cond_2
.line 69
invoke-static {v0}, Lkotlin/random/RandomKt;->fastLog2(I)I
move-result p2
.line 70
invoke-virtual {p0, p2}, Lkotlin/random/Random;->nextBits(I)I
move-result p0
goto :goto_1
.line 74
:cond_2
invoke-virtual {p0}, Lkotlin/random/Random;->nextInt()I
move-result p2
ushr-int/lit8 p2, p2, 0x1
.line 75
rem-int v1, p2, v0
sub-int/2addr p2, v1
add-int/lit8 v2, v0, -0x1
add-int/2addr p2, v2
if-ltz p2, :cond_2
move p0, v1
:goto_1
add-int/2addr p1, p0
return p1
.end method
.method public nextLong()J
.locals 4
.line 95
invoke-virtual {p0}, Lkotlin/random/Random;->nextInt()I
move-result v0
int-to-long v0, v0
const/16 v2, 0x20
shl-long/2addr v0, v2
invoke-virtual {p0}, Lkotlin/random/Random;->nextInt()I
move-result p0
int-to-long v2, p0
add-long/2addr v0, v2
return-wide v0
.end method
.method public nextLong(J)J
.locals 2
const-wide/16 v0, 0x0
.line 108
invoke-virtual {p0, v0, v1, p1, p2}, Lkotlin/random/Random;->nextLong(JJ)J
move-result-wide p0
return-wide p0
.end method
.method public nextLong(JJ)J
.locals 9
.line 120
invoke-static {p1, p2, p3, p4}, Lkotlin/random/RandomKt;->checkRangeBounds(JJ)V
sub-long v0, p3, p1
const-wide/16 v2, 0x0
cmp-long v4, v0, v2
if-lez v4, :cond_3
neg-long p3, v0
and-long/2addr p3, v0
cmp-long p3, p3, v0
const/4 v4, 0x1
if-nez p3, :cond_2
long-to-int p3, v0
const/16 p4, 0x20
ushr-long/2addr v0, p4
long-to-int v0, v0
const-wide v1, 0xffffffffL
if-eqz p3, :cond_0
.line 129
invoke-static {p3}, Lkotlin/random/RandomKt;->fastLog2(I)I
move-result p3
.line 131
invoke-virtual {p0, p3}, Lkotlin/random/Random;->nextBits(I)I
move-result p0
:goto_0
int-to-long p3, p0
and-long/2addr p3, v1
goto :goto_1
:cond_0
if-ne v0, v4, :cond_1
.line 135
invoke-virtual {p0}, Lkotlin/random/Random;->nextInt()I
move-result p0
goto :goto_0
.line 137
:cond_1
invoke-static {v0}, Lkotlin/random/RandomKt;->fastLog2(I)I
move-result p3
.line 138
invoke-virtual {p0, p3}, Lkotlin/random/Random;->nextBits(I)I
move-result p3
int-to-long v3, p3
shl-long p3, v3, p4
invoke-virtual {p0}, Lkotlin/random/Random;->nextInt()I
move-result p0
int-to-long v3, p0
and-long v0, v3, v1
add-long/2addr p3, v0
goto :goto_1
.line 144
:cond_2
invoke-virtual {p0}, Lkotlin/random/Random;->nextLong()J
move-result-wide p3
ushr-long/2addr p3, v4
.line 145
rem-long v5, p3, v0
sub-long/2addr p3, v5
const-wide/16 v7, 0x1
sub-long v7, v0, v7
add-long/2addr p3, v7
cmp-long p3, p3, v2
if-ltz p3, :cond_2
move-wide p3, v5
:goto_1
add-long/2addr p1, p3
return-wide p1
.line 152
:cond_3
invoke-virtual {p0}, Lkotlin/random/Random;->nextLong()J
move-result-wide v0
cmp-long v2, p1, v0
if-gtz v2, :cond_3
cmp-long v2, v0, p3
if-gez v2, :cond_3
return-wide v0
.end method