127 lines
4.1 KiB
Java
127 lines
4.1 KiB
Java
|
package com.google.android.libraries.places.internal;
|
||
|
|
||
|
import java.math.RoundingMode;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class zzacl {
|
||
|
public static int zzb(int i, RoundingMode roundingMode) {
|
||
|
if (i > 0) {
|
||
|
switch (zzack.zza[roundingMode.ordinal()]) {
|
||
|
case 1:
|
||
|
zzacm.zza(((i + (-1)) & i) == 0);
|
||
|
break;
|
||
|
case 2:
|
||
|
case 3:
|
||
|
break;
|
||
|
case 4:
|
||
|
case 5:
|
||
|
return 32 - Integer.numberOfLeadingZeros(i - 1);
|
||
|
case 6:
|
||
|
case 7:
|
||
|
case 8:
|
||
|
int numberOfLeadingZeros = Integer.numberOfLeadingZeros(i);
|
||
|
return (31 - numberOfLeadingZeros) + ((((-1257966797) >>> numberOfLeadingZeros) - i) >>> 31);
|
||
|
default:
|
||
|
throw new AssertionError();
|
||
|
}
|
||
|
return 31 - Integer.numberOfLeadingZeros(i);
|
||
|
}
|
||
|
throw new IllegalArgumentException("x (0) must be > 0");
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:18:0x003b, code lost:
|
||
|
|
||
|
if (((r0 & 1) & (r7 != java.math.RoundingMode.HALF_EVEN ? 0 : 1)) != 0) goto L26;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:19:0x003e, code lost:
|
||
|
|
||
|
if (r1 > 0) goto L26;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:20:0x0041, code lost:
|
||
|
|
||
|
if (r5 > 0) goto L26;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:21:0x0044, code lost:
|
||
|
|
||
|
if (r5 < 0) goto L26;
|
||
|
*/
|
||
|
/* JADX WARN: Failed to find 'out' block for switch in B:7:0x0019. Please report as an issue. */
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
public static int zza(int r5, int r6, java.math.RoundingMode r7) {
|
||
|
/*
|
||
|
if (r6 == 0) goto L4c
|
||
|
int r0 = r5 / r6
|
||
|
int r1 = r6 * r0
|
||
|
int r1 = r5 - r1
|
||
|
if (r1 != 0) goto Lb
|
||
|
return r0
|
||
|
Lb:
|
||
|
int[] r2 = com.google.android.libraries.places.internal.zzack.zza
|
||
|
int r3 = r7.ordinal()
|
||
|
r2 = r2[r3]
|
||
|
r5 = r5 ^ r6
|
||
|
int r5 = r5 >> 31
|
||
|
r3 = 1
|
||
|
r5 = r5 | r3
|
||
|
r4 = 0
|
||
|
switch(r2) {
|
||
|
case 1: goto L48;
|
||
|
case 2: goto L4b;
|
||
|
case 3: goto L44;
|
||
|
case 4: goto L46;
|
||
|
case 5: goto L41;
|
||
|
case 6: goto L22;
|
||
|
case 7: goto L22;
|
||
|
case 8: goto L22;
|
||
|
default: goto L1c;
|
||
|
}
|
||
|
L1c:
|
||
|
java.lang.AssertionError r5 = new java.lang.AssertionError
|
||
|
r5.<init>()
|
||
|
throw r5
|
||
|
L22:
|
||
|
int r1 = java.lang.Math.abs(r1)
|
||
|
int r6 = java.lang.Math.abs(r6)
|
||
|
int r6 = r6 - r1
|
||
|
int r1 = r1 - r6
|
||
|
if (r1 != 0) goto L3e
|
||
|
java.math.RoundingMode r6 = java.math.RoundingMode.HALF_UP
|
||
|
if (r7 == r6) goto L46
|
||
|
java.math.RoundingMode r6 = java.math.RoundingMode.HALF_EVEN
|
||
|
if (r7 != r6) goto L37
|
||
|
goto L38
|
||
|
L37:
|
||
|
r3 = r4
|
||
|
L38:
|
||
|
r6 = r0 & 1
|
||
|
r6 = r6 & r3
|
||
|
if (r6 == 0) goto L4b
|
||
|
goto L46
|
||
|
L3e:
|
||
|
if (r1 <= 0) goto L4b
|
||
|
goto L46
|
||
|
L41:
|
||
|
if (r5 <= 0) goto L4b
|
||
|
goto L46
|
||
|
L44:
|
||
|
if (r5 >= 0) goto L4b
|
||
|
L46:
|
||
|
int r0 = r0 + r5
|
||
|
return r0
|
||
|
L48:
|
||
|
com.google.android.libraries.places.internal.zzacm.zza(r4)
|
||
|
L4b:
|
||
|
return r0
|
||
|
L4c:
|
||
|
java.lang.ArithmeticException r5 = new java.lang.ArithmeticException
|
||
|
java.lang.String r6 = "/ by zero"
|
||
|
r5.<init>(r6)
|
||
|
throw r5
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: com.google.android.libraries.places.internal.zzacl.zza(int, int, java.math.RoundingMode):int");
|
||
|
}
|
||
|
}
|