alexandroid/decompiled/jadx/sources/kotlin/UnsignedKt.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

174 lines
8.4 KiB
Java

package kotlin;
import kotlin.internal.InlineOnly;
import kotlin.jvm.JvmName;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.CharsKt;
import org.jetbrains.annotations.NotNull;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@Metadata(d1 = {"\u00008\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\b\n\u0000\n\u0002\u0010\t\n\u0002\b\u0005\n\u0002\u0010\u0007\n\u0002\b\u0003\n\u0002\u0010\u0006\n\u0002\b\t\n\u0002\u0010\u000e\n\u0002\b\u0003\u001a\u001f\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00012\u0006\u0010\u0003\u001a\u00020\u0001H\u0001¢\u0006\u0004\b\u0004\u0010\u0005\u001a\u001f\u0010\u0006\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00012\u0006\u0010\u0003\u001a\u00020\u0001H\u0001¢\u0006\u0004\b\u0007\u0010\u0005\u001a\u001f\u0010\b\u001a\u00020\t2\u0006\u0010\u0002\u001a\u00020\t2\u0006\u0010\u0003\u001a\u00020\tH\u0001¢\u0006\u0004\b\n\u0010\u000b\u001a\u001f\u0010\f\u001a\u00020\t2\u0006\u0010\u0002\u001a\u00020\t2\u0006\u0010\u0003\u001a\u00020\tH\u0001¢\u0006\u0004\b\r\u0010\u000b\u001a\u0018\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0002\u001a\u00020\u000f2\u0006\u0010\u0003\u001a\u00020\u000fH\u0001\u001a\u0018\u0010\u0010\u001a\u00020\u000f2\u0006\u0010\u0002\u001a\u00020\u00112\u0006\u0010\u0003\u001a\u00020\u0011H\u0001\u001a\u0016\u0010\u0012\u001a\u00020\t2\u0006\u0010\u0013\u001a\u00020\u000fH\u0081\b¢\u0006\u0002\u0010\u0014\u001a\u0011\u0010\u0015\u001a\u00020\u00112\u0006\u0010\u0013\u001a\u00020\u000fH\u0081\b\u001a\u0011\u0010\u0016\u001a\u00020\u00172\u0006\u0010\u0013\u001a\u00020\u000fH\u0081\b\u001a\u0016\u0010\u0018\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u0017H\u0081\b¢\u0006\u0002\u0010\u0019\u001a\u0010\u0010\u001a\u001a\u00020\u001b2\u0006\u0010\u0013\u001a\u00020\u000fH\u0001\u001a\u0015\u0010\u001c\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u001bH\u0001¢\u0006\u0002\u0010\u001d\u001a\u0011\u0010\u001e\u001a\u00020\u00172\u0006\u0010\u0013\u001a\u00020\u0011H\u0081\b\u001a\u0016\u0010\u001f\u001a\u00020\t2\u0006\u0010\u0013\u001a\u00020\u0017H\u0081\b¢\u0006\u0002\u0010 \u001a\u0010\u0010!\u001a\u00020\u001b2\u0006\u0010\u0013\u001a\u00020\u0011H\u0001\u001a\u0015\u0010\"\u001a\u00020\t2\u0006\u0010\u0013\u001a\u00020\u001bH\u0001¢\u0006\u0002\u0010#\u001a\u0011\u0010$\u001a\u00020%2\u0006\u0010\u0013\u001a\u00020\u000fH\u0081\b\u001a\u0019\u0010$\u001a\u00020%2\u0006\u0010\u0013\u001a\u00020\u000f2\u0006\u0010&\u001a\u00020\u000fH\u0081\b\u001a\u0011\u0010'\u001a\u00020%2\u0006\u0010\u0013\u001a\u00020\u0011H\u0081\b\u001a\u0018\u0010'\u001a\u00020%2\u0006\u0010\u0013\u001a\u00020\u00112\u0006\u0010&\u001a\u00020\u000fH\u0000¨\u0006("}, d2 = {"uintRemainder", "Lkotlin/UInt;", "v1", "v2", "uintRemainder-J1ME1BU", "(II)I", "uintDivide", "uintDivide-J1ME1BU", "ulongDivide", "Lkotlin/ULong;", "ulongDivide-eb3DHEI", "(JJ)J", "ulongRemainder", "ulongRemainder-eb3DHEI", "uintCompare", "", "ulongCompare", "", "uintToULong", "value", "(I)J", "uintToLong", "uintToFloat", "", "floatToUInt", "(F)I", "uintToDouble", "", "doubleToUInt", "(D)I", "ulongToFloat", "floatToULong", "(F)J", "ulongToDouble", "doubleToULong", "(D)J", "uintToString", "", "base", "ulongToString", "kotlin-stdlib"}, k = 2, mv = {2, 2, 0}, xi = 48)
@JvmName(name = "UnsignedKt")
/* loaded from: classes10.dex */
public final class UnsignedKt {
@PublishedApi
public static final int doubleToUInt(double d) {
if (Double.isNaN(d) || d <= uintToDouble(0)) {
return 0;
}
if (d >= uintToDouble(-1)) {
return -1;
}
if (d <= 2.147483647E9d) {
return UInt.m25389constructorimpl((int) d);
}
return UInt.m25389constructorimpl(UInt.m25389constructorimpl(Integer.MAX_VALUE) + UInt.m25389constructorimpl((int) (d - Integer.MAX_VALUE)));
}
@PublishedApi
public static final long doubleToULong(double d) {
if (Double.isNaN(d) || d <= ulongToDouble(0L)) {
return 0L;
}
if (d >= ulongToDouble(-1L)) {
return -1L;
}
return d < 9.223372036854776E18d ? ULong.m25468constructorimpl((long) d) : ULong.m25468constructorimpl(ULong.m25468constructorimpl((long) (d - 9.223372036854776E18d)) - Long.MIN_VALUE);
}
@PublishedApi
@InlineOnly
private static final int floatToUInt(float f) {
return doubleToUInt(f);
}
@PublishedApi
@InlineOnly
private static final long floatToULong(float f) {
return doubleToULong(f);
}
@PublishedApi
public static final int uintCompare(int i, int i2) {
return Intrinsics.compare(i ^ Integer.MIN_VALUE, i2 ^ Integer.MIN_VALUE);
}
@PublishedApi
/* renamed from: uintDivide-J1ME1BU, reason: not valid java name */
public static final int m25645uintDivideJ1ME1BU(int i, int i2) {
return UInt.m25389constructorimpl((int) ((i & 4294967295L) / (i2 & 4294967295L)));
}
@PublishedApi
/* renamed from: uintRemainder-J1ME1BU, reason: not valid java name */
public static final int m25646uintRemainderJ1ME1BU(int i, int i2) {
return UInt.m25389constructorimpl((int) ((i & 4294967295L) % (i2 & 4294967295L)));
}
@PublishedApi
public static final double uintToDouble(int i) {
return (((i >>> 31) << 30) * 2) + (Integer.MAX_VALUE & i);
}
@PublishedApi
@InlineOnly
private static final float uintToFloat(int i) {
return (float) uintToDouble(i);
}
@PublishedApi
@InlineOnly
private static final long uintToLong(int i) {
return i & 4294967295L;
}
@InlineOnly
private static final String uintToString(int i) {
return String.valueOf(i & 4294967295L);
}
@PublishedApi
@InlineOnly
private static final long uintToULong(int i) {
return ULong.m25468constructorimpl(i & 4294967295L);
}
@PublishedApi
public static final int ulongCompare(long j, long j2) {
return Intrinsics.compare(j ^ Long.MIN_VALUE, j2 ^ Long.MIN_VALUE);
}
@PublishedApi
/* renamed from: ulongDivide-eb3DHEI, reason: not valid java name */
public static final long m25647ulongDivideeb3DHEI(long j, long j2) {
if (j2 < 0) {
return Long.compareUnsigned(j, j2) < 0 ? ULong.m25468constructorimpl(0L) : ULong.m25468constructorimpl(1L);
}
if (j >= 0) {
return ULong.m25468constructorimpl(j / j2);
}
long j3 = ((j >>> 1) / j2) << 1;
return ULong.m25468constructorimpl(j3 + (Long.compareUnsigned(ULong.m25468constructorimpl(j - (j3 * j2)), ULong.m25468constructorimpl(j2)) < 0 ? 0 : 1));
}
@PublishedApi
/* renamed from: ulongRemainder-eb3DHEI, reason: not valid java name */
public static final long m25648ulongRemaindereb3DHEI(long j, long j2) {
if (j2 < 0) {
return Long.compareUnsigned(j, j2) < 0 ? j : ULong.m25468constructorimpl(j - j2);
}
if (j >= 0) {
return ULong.m25468constructorimpl(j % j2);
}
long j3 = j - ((((j >>> 1) / j2) << 1) * j2);
if (Long.compareUnsigned(ULong.m25468constructorimpl(j3), ULong.m25468constructorimpl(j2)) < 0) {
j2 = 0;
}
return ULong.m25468constructorimpl(j3 - j2);
}
@PublishedApi
public static final double ulongToDouble(long j) {
return ((j >>> 11) * 2048) + (j & 2047);
}
@PublishedApi
@InlineOnly
private static final float ulongToFloat(long j) {
return (float) ulongToDouble(j);
}
@NotNull
public static final String ulongToString(long j, int i) {
if (j >= 0) {
String l = Long.toString(j, CharsKt.checkRadix(i));
l.getClass();
return l;
}
long j2 = i;
long j3 = ((j >>> 1) / j2) << 1;
long j4 = j - (j3 * j2);
if (j4 >= j2) {
j4 -= j2;
j3++;
}
StringBuilder sb = new StringBuilder();
String l2 = Long.toString(j3, CharsKt.checkRadix(i));
l2.getClass();
sb.append(l2);
String l3 = Long.toString(j4, CharsKt.checkRadix(i));
l3.getClass();
sb.append(l3);
return sb.toString();
}
@InlineOnly
private static final String uintToString(int i, int i2) {
return ulongToString(i & 4294967295L, i2);
}
@InlineOnly
private static final String ulongToString(long j) {
return ulongToString(j, 10);
}
}