content: package kotlin.random;
  
  import java.io.Serializable;
  import kotlin.Metadata;
  import kotlin.internal.PlatformImplementationsKt;
  import kotlin.jvm.internal.DefaultConstructorMarker;
  import kotlin.jvm.internal.Intrinsics;
  import kotlin.ranges.IntRange;
  
  @Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0005\n\u0002\u0010\u0006\n\u0002\b\u0003\n\u0002\u0010\u0007\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0002\b'\u0018\u0000 \u00172\u00020\u0001:\u0001\u0017B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0004H&J\b\u0010\u0006\u001a\u00020\u0007H\u0016J\u0010\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\tH\u0016J$\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\t2\b\b\u0002\u0010\u000b\u001a\u00020\u00042\b\b\u0002\u0010\f\u001a\u00020\u0004H\u0016J\u0010\u0010\b\u001a\u00020\t2\u0006\u0010\r\u001a\u00020\u0004H\u0016J\b\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\b\u0010\u0012\u001a\u00020\u0013H\u0016J\b\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\b\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¨\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 = 1, mv = {1, 7, 1}, xi = 48)
  /* compiled from: Random.kt */
  public abstract class Random {
      public static final Default Default = new Default((DefaultConstructorMarker) null);
      /* access modifiers changed from: private */
      public static final Random defaultRandom = PlatformImplementationsKt.IMPLEMENTATIONS.defaultPlatformRandom();
  
      @Metadata(d1 = {"\u0000H\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0005\n\u0002\u0010\u0006\n\u0002\b\u0003\n\u0002\u0010\u0007\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0002\b\u0003\u0018\u00002\u00020\u00012\u00060\u0002j\u0002`\u0003:\u0001\u001cB\u0007\b\u0002¢\u0006\u0002\u0010\u0004J\u0010\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\u0007H\u0016J\b\u0010\t\u001a\u00020\nH\u0016J\u0010\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\fH\u0016J \u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\u000e\u001a\u00020\u00072\u0006\u0010\u000f\u001a\u00020\u0007H\u0016J\u0010\u0010\u000b\u001a\u00020\f2\u0006\u0010\u0010\u001a\u00020\u0007H\u0016J\b\u0010\u0011\u001a\u00020\u0012H\u0016J\u0010\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u0012H\u0016J\u0018\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0014\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u0012H\u0016J\b\u0010\u0015\u001a\u00020\u0016H\u0016J\b\u0010\u0017\u001a\u00020\u0007H\u0016J\u0010\u0010\u0017\u001a\u00020\u00072\u0006\u0010\u0013\u001a\u00020\u0007H\u0016J\u0018\u0010\u0017\u001a\u00020\u00072\u0006\u0010\u0014\u001a\u00020\u00072\u0006\u0010\u0013\u001a\u00020\u0007H\u0016J\b\u0010\u0018\u001a\u00020\u0019H\u0016J\u0010\u0010\u0018\u001a\u00020\u00192\u0006\u0010\u0013\u001a\u00020\u0019H\u0016J\u0018\u0010\u0018\u001a\u00020\u00192\u0006\u0010\u0014\u001a\u00020\u00192\u0006\u0010\u0013\u001a\u00020\u0019H\u0016J\b\u0010\u001a\u001a\u00020\u001bH\u0002R\u000e\u0010\u0005\u001a\u00020\u0001X\u0004¢\u0006\u0002\n\u0000¨\u0006\u001d"}, d2 = {"Lkotlin/random/Random$Default;", "Lkotlin/random/Random;", "Ljava/io/Serializable;", "Lkotlin/io/Serializable;", "()V", "defaultRandom", "nextBits", "", "bitCount", "nextBoolean", "", "nextBytes", "", "array", "fromIndex", "toIndex", "size", "nextDouble", "", "until", "from", "nextFloat", "", "nextInt", "nextLong", "", "writeReplace", "", "Serialized", "kotlin-stdlib"}, k = 1, mv = {1, 7, 1}, xi = 48)
      /* compiled from: Random.kt */
      public static final class Default extends Random implements Serializable {
  
          @Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u0000\n\u0000\bÂ\u0002\u0018\u00002\u00060\u0001j\u0002`\u0002B\u0007\b\u0002¢\u0006\u0002\u0010\u0003J\b\u0010\u0006\u001a\u00020\u0007H\u0002R\u000e\u0010\u0004\u001a\u00020\u0005XT¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Lkotlin/random/Random$Default$Serialized;", "Ljava/io/Serializable;", "Lkotlin/io/Serializable;", "()V", "serialVersionUID", "", "readResolve", "", "kotlin-stdlib"}, k = 1, mv = {1, 7, 1}, xi = 48)
          /* compiled from: Random.kt */
          private static final class Serialized implements Serializable {
              public static final Serialized INSTANCE = new Serialized();
              private static final long serialVersionUID = 0;
  
              private Serialized() {
              }
  
              private final Object readResolve() {
                  return Random.Default;
              }
          }
  
          private Default() {
          }
  
          public /* synthetic */ Default(DefaultConstructorMarker defaultConstructorMarker) {
              this();
          }
  
          private final Object writeReplace() {
              return Serialized.INSTANCE;
          }
  
          public int nextBits(int bitCount) {
              return Random.defaultRandom.nextBits(bitCount);
          }
  
          public boolean nextBoolean() {
              return Random.defaultRandom.nextBoolean();
          }
  
          public byte[] nextBytes(int size) {
              return Random.defaultRandom.nextBytes(size);
          }
  
          public byte[] nextBytes(byte[] array) {
              Intrinsics.checkNotNullParameter(array, "array");
              return Random.defaultRandom.nextBytes(array);
          }
  
          public byte[] nextBytes(byte[] array, int fromIndex, int toIndex) {
              Intrinsics.checkNotNullParameter(array, "array");
              return Random.defaultRandom.nextBytes(array, fromIndex, toIndex);
          }
  
          public double nextDouble() {
              return Random.defaultRandom.nextDouble();
          }
  
          public double nextDouble(double until) {
              return Random.defaultRandom.nextDouble(until);
          }
  
          public double nextDouble(double from, double until) {
              return Random.defaultRandom.nextDouble(from, until);
          }
  
          public float nextFloat() {
              return Random.defaultRandom.nextFloat();
          }
  
          public int nextInt() {
              return Random.defaultRandom.nextInt();
          }
  
          public int nextInt(int until) {
              return Random.defaultRandom.nextInt(until);
          }
  
          public int nextInt(int from, int until) {
              return Random.defaultRandom.nextInt(from, until);
          }
  
          public long nextLong() {
              return Random.defaultRandom.nextLong();
          }
  
          public long nextLong(long until) {
              return Random.defaultRandom.nextLong(until);
          }
  
          public long nextLong(long from, long until) {
              return Random.defaultRandom.nextLong(from, until);
          }
      }
  
      public static /* synthetic */ byte[] nextBytes$default(Random random, byte[] bArr, int i, int i2, int i3, Object obj) {
          if (obj == null) {
              if ((i3 & 2) != 0) {
                  i = 0;
              }
              if ((i3 & 4) != 0) {
                  i2 = bArr.length;
              }
              return random.nextBytes(bArr, i, i2);
          }
          throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: nextBytes");
      }
  
      public abstract int nextBits(int i);
  
      public boolean nextBoolean() {
          return nextBits(1) != 0;
      }
  
      public byte[] nextBytes(int size) {
          return nextBytes(new byte[size]);
      }
  
      public byte[] nextBytes(byte[] array) {
          Intrinsics.checkNotNullParameter(array, "array");
          return nextBytes(array, 0, array.length);
      }
  
      public byte[] nextBytes(byte[] array, int fromIndex, int toIndex) {
          Intrinsics.checkNotNullParameter(array, "array");
          boolean z = true;
          if (new IntRange(0, array.length).contains(fromIndex) && new IntRange(0, array.length).contains(toIndex)) {
              if (fromIndex > toIndex) {
                  z = false;
              }
              if (z) {
                  int i = (toIndex - fromIndex) / 4;
                  int i2 = fromIndex;
                  for (int i3 = 0; i3 < i; i3++) {
                      int i4 = i3;
                      int nextInt = nextInt();
                      array[i2] = (byte) nextInt;
                      array[i2 + 1] = (byte) (nextInt >>> 8);
                      array[i2 + 2] = (byte) (nextInt >>> 16);
                      array[i2 + 3] = (byte) (nextInt >>> 24);
                      i2 += 4;
                  }
                  int i5 = toIndex - i2;
                  int nextBits = nextBits(i5 * 8);
                  for (int i6 = 0; i6 < i5; i6++) {
                      array[i2 + i6] = (byte) (nextBits >>> (i6 * 8));
                  }
                  return array;
              }
              throw new IllegalArgumentException(("fromIndex (" + fromIndex + ") must be not greater than toIndex (" + toIndex + ").").toString());
          }
          throw new IllegalArgumentException(("fromIndex (" + fromIndex + ") or toIndex (" + toIndex + ") are out of range: 0.." + array.length + '.').toString());
      }
  
      public double nextDouble() {
          return PlatformRandomKt.doubleFromParts(nextBits(26), nextBits(27));
      }
  
      public double nextDouble(double until) {
          return nextDouble(0.0d, until);
      }
  
      /* JADX WARNING: Removed duplicated region for block: B:19:0x004a  */
      /* JADX WARNING: Removed duplicated region for block: B:20:0x0051  */
      /* Code decompiled incorrectly, please refer to instructions dump. */
      public double nextDouble(double r9, double r11) {
          /*
              r8 = this;
              kotlin.random.RandomKt.checkRangeBounds((double) r9, (double) r11)
              double r0 = r11 - r9
              boolean r2 = java.lang.Double.isInfinite(r0)
              if (r2 == 0) goto L_0x003e
              boolean r2 = java.lang.Double.isInfinite(r9)
              r3 = 1
              r4 = 0
              if (r2 != 0) goto L_0x001b
              boolean r2 = java.lang.Double.isNaN(r9)
              if (r2 != 0) goto L_0x001b
              r2 = r3
              goto L_0x001c
          L_0x001b:
              r2 = r4
          L_0x001c:
              if (r2 == 0) goto L_0x003e
              boolean r2 = java.lang.Double.isInfinite(r11)
              if (r2 != 0) goto L_0x002b
              boolean r2 = java.lang.Double.isNaN(r11)
              if (r2 != 0) goto L_0x002b
              goto L_0x002c
          L_0x002b:
              r3 = r4
          L_0x002c:
              if (r3 == 0) goto L_0x003e
              double r2 = r8.nextDouble()
              r4 = 2
              double r4 = (double) r4
              double r6 = r11 / r4
              double r4 = r9 / r4
              double r6 = r6 - r4
              double r2 = r2 * r6
              double r4 = r9 + r2
              double r4 = r4 + r2
              goto L_0x0045
          L_0x003e:
              double r2 = r8.nextDouble()
              double r2 = r2 * r0
              double r4 = r9 + r2
          L_0x0045:
              r2 = r4
              int r4 = (r2 > r11 ? 1 : (r2 == r11 ? 0 : -1))
              if (r4 < 0) goto L_0x0051
              r4 = -4503599627370496(0xfff0000000000000, double:-Infinity)
              double r4 = java.lang.Math.nextAfter(r11, r4)
              goto L_0x0052
          L_0x0051:
              r4 = r2
          L_0x0052:
              return r4
          */
          throw new UnsupportedOperationException("Method not decompiled: kotlin.random.Random.nextDouble(double, double):double");
      }
  
      public float nextFloat() {
          return ((float) nextBits(24)) / 1.6777216E7f;
      }
  
      public int nextInt() {
          return nextBits(32);
      }
  
      public int nextInt(int until) {
          return nextInt(0, until);
      }
  
      public int nextInt(int from, int until) {
          int i;
          int nextInt;
          int i2;
          int nextInt2;
          boolean z;
          RandomKt.checkRangeBounds(from, until);
          int i3 = until - from;
          if (i3 > 0 || i3 == Integer.MIN_VALUE) {
              if (((-i3) & i3) == i3) {
                  i = nextBits(RandomKt.fastLog2(i3));
              } else {
                  do {
                      nextInt = nextInt() >>> 1;
                      i2 = nextInt % i3;
                  } while ((nextInt - i2) + (i3 - 1) < 0);
                  i = i2;
              }
              return from + i;
          }
          do {
              nextInt2 = nextInt();
              z = false;
              if (from <= nextInt2 && nextInt2 < until) {
                  z = true;
                  continue;
              }
          } while (!z);
          return nextInt2;
      }
  
      public long nextLong() {
          return (((long) nextInt()) << 32) + ((long) nextInt());
      }
  
      public long nextLong(long until) {
          return nextLong(0, until);
      }
  
      public long nextLong(long from, long until) {
          long nextLong;
          boolean z;
          long j;
          long nextLong2;
          long j2;
          long j3;
          RandomKt.checkRangeBounds(from, until);
          long j4 = until - from;
          if (j4 > 0) {
              if (((-j4) & j4) == j4) {
                  int i = (int) j4;
                  int i2 = (int) (j4 >>> 32);
                  if (i != 0) {
                      j3 = 4294967295L & ((long) nextBits(RandomKt.fastLog2(i)));
                  } else if (i2 == 1) {
                      j3 = 4294967295L & ((long) nextInt());
                  } else {
                      j3 = (4294967295L & ((long) nextInt())) + (((long) nextBits(RandomKt.fastLog2(i2))) << 32);
                  }
                  j = j3;
              } else {
                  do {
                      nextLong2 = nextLong() >>> 1;
                      j2 = nextLong2 % j4;
                  } while ((nextLong2 - j2) + (j4 - 1) < 0);
                  j = j2;
              }
              return from + j;
          }
          do {
              nextLong = nextLong();
              z = false;
              if (from <= nextLong && nextLong < until) {
                  z = true;
                  continue;
              }
          } while (!z);
          return nextLong;
      }
  }
  