package c.q.a.k; import android.annotation.TargetApi; import android.content.Context; import android.graphics.RectF; import android.hardware.Camera; import android.opengl.EGL14; import android.opengl.EGLConfig; import android.opengl.EGLContext; import android.opengl.EGLDisplay; import android.opengl.EGLSurface; import android.opengl.GLES20; import android.view.Display; import android.view.WindowManager; import d0.d0.f; import d0.g0.s; import d0.g0.w; import d0.k; import d0.l; import d0.w.d; import d0.w.h.a.d; import d0.w.h.a.e; import d0.z.d.e0; import d0.z.d.m; import f0.f0.f.d; import g0.n; import g0.p; import g0.u; import g0.x; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.IDN; import java.net.InetAddress; import java.net.Socket; import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.Objects; import java.util.concurrent.CancellationException; import java.util.concurrent.atomic.AtomicLong; import java.util.logging.Logger; import kotlin.TypeCastException; import kotlin.Unit; import kotlin.coroutines.Continuation; import kotlin.coroutines.CoroutineContext; import kotlin.jvm.functions.Function1; import kotlin.jvm.functions.Function2; import kotlinx.coroutines.CoroutineExceptionHandler; import kotlinx.coroutines.CoroutineScope; import kotlinx.coroutines.CoroutineStart; import kotlinx.coroutines.Job; import kotlinx.coroutines.internal.UndeliveredElementException; import rx.exceptions.CompositeException; import rx.exceptions.OnCompletedFailedException; import rx.exceptions.OnErrorFailedException; import rx.exceptions.OnErrorNotImplementedException; import rx.exceptions.OnErrorThrowable; import s.a.a.g; import s.a.a.h; import s.a.a.r; import s.a.a0; import s.a.d; import s.a.d0; import s.a.e1; import s.a.f0; import s.a.g0; import s.a.h0; import s.a.h1; import s.a.i0; import s.a.i1; import s.a.j0; import s.a.j1; import s.a.l0; import s.a.q1; import s.a.r1; import s.a.t; import s.a.v; import s.a.w1; import s.a.y; /* compiled from: EglUtils */ public class a { /* compiled from: Await.kt */ @e(c = "kotlinx.coroutines.AwaitKt", f = "Await.kt", l = {26}, m = "awaitAll") /* renamed from: c.q.a.k.a$a reason: collision with other inner class name */ public static final class C0172a extends d { public Object L$0; public int label; public /* synthetic */ Object result; public C0172a(Continuation continuation) { super(continuation); } @Override // d0.w.h.a.a public final Object invokeSuspend(Object obj) { this.result = obj; this.label |= Integer.MIN_VALUE; return a.g(null, this); } } /* compiled from: KotlinExtensions.kt */ public static final class b implements Runnable { public final /* synthetic */ Continuation i; public final /* synthetic */ Exception j; public b(Continuation continuation, Exception exc) { this.i = continuation; this.j = exc; } @Override // java.lang.Runnable public final void run() { Continuation intercepted = d0.w.g.b.intercepted(this.i); Exception exc = this.j; k.a aVar = k.i; intercepted.resumeWith(k.m78constructorimpl(l.createFailure(exc))); } } /* compiled from: KotlinExtensions.kt */ @e(c = "retrofit2.KotlinExtensions", f = "KotlinExtensions.kt", l = {113}, m = "suspendAndThrow") public static final class c extends d { public Object L$0; public int label; public /* synthetic */ Object result; public c(Continuation continuation) { super(continuation); } @Override // d0.w.h.a.a public final Object invokeSuspend(Object obj) { this.result = obj; this.label |= Integer.MIN_VALUE; return a.U(null, this); } } public static final boolean A(CoroutineScope coroutineScope) { Job job = (Job) coroutineScope.getCoroutineContext().get(Job.h); if (job != null) { return job.a(); } return true; } public static final boolean B(AssertionError assertionError) { m.checkParameterIsNotNull(assertionError, "$this$isAndroidGetsocknameError"); if (assertionError.getCause() == null) { return false; } String message = assertionError.getMessage(); return message != null ? w.contains$default(message, "getsockname failed", false, 2, null) : false; } public static final boolean C(int i) { return i == 1 || i == 2; } public static boolean D(Camera camera) { List supportedFlashModes; if (camera != null) { Camera.Parameters parameters = camera.getParameters(); if (parameters.getFlashMode() != null && (supportedFlashModes = parameters.getSupportedFlashModes()) != null && !supportedFlashModes.isEmpty() && (supportedFlashModes.size() != 1 || !supportedFlashModes.get(0).equals("off"))) { return true; } } return false; } public static final boolean E(g0.e eVar) { m.checkParameterIsNotNull(eVar, "$this$isProbablyUtf8"); try { g0.e eVar2 = new g0.e(); eVar.p(eVar2, 0, f.coerceAtMost(eVar.j, 64)); for (int i = 0; i < 16; i++) { if (eVar2.v()) { return true; } int I = eVar2.I(); if (Character.isISOControl(I) && !Character.isWhitespace(I)) { return false; } } return true; } catch (EOFException unused) { return false; } } public static final Job F(CoroutineScope coroutineScope, CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2, ? extends Object> function2) { CoroutineContext a = y.a(coroutineScope, coroutineContext); Objects.requireNonNull(coroutineStart); s.a.b j1Var = coroutineStart == CoroutineStart.LAZY ? new j1(a, function2) : new q1(a, true); j1Var.a0(coroutineStart, j1Var, function2); return j1Var; } public static /* synthetic */ Job G(CoroutineScope coroutineScope, CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2 function2, int i, Object obj) { if ((i & 1) != 0) { coroutineContext = d0.w.f.i; } return F(coroutineScope, coroutineContext, (i & 2) != 0 ? CoroutineStart.DEFAULT : null, function2); } public static int H(CharSequence charSequence, int i, int i2, int i3) { int i4 = i + i2; int i5 = i; int i6 = i3; int i7 = 0; int i8 = 0; int i9 = 0; while (i5 < i4) { int i10 = i5 + 1; int charAt = charSequence.charAt(i5); int i11 = 24; if (charAt < 128) { i11 = 8; } else if (charAt < 2048) { charAt = (((charAt & 63) | 128) << 8) | (charAt >> 6) | 192; i11 = 16; } else if (charAt < 55296 || charAt > 57343 || i10 >= i4) { charAt = (((charAt & 63) | 128) << 16) | (charAt >> 12) | 224 | ((((charAt >> 6) & 63) | 128) << 8); } else { int charAt2 = ((charAt - 55232) << 10) + (charSequence.charAt(i10) & 1023); charAt = (((charAt2 & 63) | 128) << 24) | ((((charAt2 >> 12) & 63) | 128) << 8) | (((charAt2 >> 18) | 240) & 255) | ((((charAt2 >> 6) & 63) | 128) << 16); i10++; i11 = 32; } int i12 = (charAt << i7) | i9; i7 += i11; if (i7 >= 32) { int i13 = i12 * -862048943; int i14 = (((i13 >>> 17) | (i13 << 15)) * 461845907) ^ i6; i7 -= 32; i8 += 4; i6 = (((i14 >>> 19) | (i14 << 13)) * 5) - 430675100; i9 = i7 != 0 ? charAt >>> (i11 - i7) : 0; } else { i9 = i12; } i5 = i10; } if (i7 > 0) { i8 += i7 >> 3; int i15 = i9 * -862048943; i6 ^= ((i15 << 15) | (i15 >>> 17)) * 461845907; } int i16 = i6 ^ i8; int i17 = (i16 ^ (i16 >>> 16)) * -2048144789; int i18 = (i17 ^ (i17 >>> 13)) * -1028477387; return i18 ^ (i18 >>> 16); } public static long I(AtomicLong atomicLong, long j) { long j2; long j3; do { j2 = atomicLong.get(); if (j2 == Long.MAX_VALUE) { return Long.MAX_VALUE; } j3 = j2 - j; if (j3 < 0) { throw new IllegalStateException(c.d.b.a.a.p("More produced than requested: ", j3)); } } while (!atomicLong.compareAndSet(j2, j3)); return j3; } public static RuntimeException J(Throwable th) { if (th instanceof RuntimeException) { throw ((RuntimeException) th); } else if (th instanceof Error) { throw ((Error) th); } else { throw new RuntimeException(th); } } /* JADX ERROR: JadxRuntimeException in pass: RegionMakerVisitor jadx.core.utils.exceptions.JadxRuntimeException: Failed to find switch 'out' block at jadx.core.dex.visitors.regions.RegionMaker.processSwitch(RegionMaker.java:821) at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:157) at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:94) at jadx.core.dex.visitors.regions.RegionMaker.processSwitch(RegionMaker.java:860) at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:157) at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:94) at jadx.core.dex.visitors.regions.RegionMaker.processIf(RegionMaker.java:731) at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:152) at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:94) at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:50) */ public static void K(int r2, h0.a.a.c r3) { /* int r0 = r2 >>> 24 if (r0 == 0) goto L_0x0025 r1 = 1 if (r0 == r1) goto L_0x0025 switch(r0) { case 16: goto L_0x001b; case 17: goto L_0x001b; case 18: goto L_0x001b; case 19: goto L_0x0013; case 20: goto L_0x0013; case 21: goto L_0x0013; case 22: goto L_0x0025; case 23: goto L_0x001b; default: goto L_0x000a; } L_0x000a: switch(r0) { case 66: goto L_0x001b; case 67: goto L_0x001b; case 68: goto L_0x001b; case 69: goto L_0x001b; case 70: goto L_0x001b; case 71: goto L_0x0017; case 72: goto L_0x0017; case 73: goto L_0x0017; case 74: goto L_0x0017; case 75: goto L_0x0017; default: goto L_0x000d; } L_0x000d: java.lang.IllegalArgumentException r2 = new java.lang.IllegalArgumentException r2.() throw r2 L_0x0013: r3.g(r0) goto L_0x002a L_0x0017: r3.i(r2) goto L_0x002a L_0x001b: r1 = 16776960(0xffff00, float:2.3509528E-38) r2 = r2 & r1 int r2 = r2 >> 8 r3.e(r0, r2) goto L_0x002a L_0x0025: int r2 = r2 >>> 16 r3.j(r2) L_0x002a: return switch-data {16->0x001b, 17->0x001b, 18->0x001b, 19->0x0013, 20->0x0013, 21->0x0013, 22->0x0025, 23->0x001b, } switch-data {66->0x001b, 67->0x001b, 68->0x001b, 69->0x001b, 70->0x001b, 71->0x0017, 72->0x0017, 73->0x0017, 74->0x0017, 75->0x0017, } */ throw new UnsupportedOperationException("Method not decompiled: c.q.a.k.a.K(int, h0.a.a.c):void"); } public static final Object L(Object obj, Continuation continuation) { if (obj instanceof v) { k.a aVar = k.i; return k.m78constructorimpl(l.createFailure(((v) obj).b)); } k.a aVar2 = k.i; return k.m78constructorimpl(obj); } public static final void M(i0 i0Var, Continuation continuation, boolean z2) { Object obj; Object n = i0Var.n(); Throwable f = i0Var.f(n); if (f != null) { k.a aVar = k.i; obj = l.createFailure(f); } else { k.a aVar2 = k.i; obj = i0Var.l(n); } Object r2 = k.m78constructorimpl(obj); if (z2) { Objects.requireNonNull(continuation, "null cannot be cast to non-null type kotlinx.coroutines.internal.DispatchedContinuation"); g gVar = (g) continuation; CoroutineContext context = gVar.getContext(); Object b2 = s.a.a.a.b(context, gVar.o); try { gVar.q.resumeWith(r2); } finally { s.a.a.a.a(context, b2); } } else { continuation.resumeWith(r2); } } public static int N(int i) { return 1 << (32 - Integer.numberOfLeadingZeros(i - 1)); } public static final int O(u uVar, int i) { int i2; m.checkParameterIsNotNull(uVar, "$this$segment"); int[] iArr = uVar.n; int i3 = i + 1; int length = uVar.m.length; m.checkParameterIsNotNull(iArr, "$this$binarySearch"); int i4 = length - 1; int i5 = 0; while (true) { if (i5 <= i4) { i2 = (i5 + i4) >>> 1; int i6 = iArr[i2]; if (i6 >= i3) { if (i6 <= i3) { break; } i4 = i2 - 1; } else { i5 = i2 + 1; } } else { i2 = (-i5) - 1; break; } } return i2 >= 0 ? i2 : ~i2; } public static final g0.v P(Socket socket) throws IOException { m.checkParameterIsNotNull(socket, "$this$sink"); g0.w wVar = new g0.w(socket); OutputStream outputStream = socket.getOutputStream(); m.checkExpressionValueIsNotNull(outputStream, "getOutputStream()"); p pVar = new p(outputStream, wVar); m.checkParameterIsNotNull(pVar, "sink"); return new g0.c(wVar, pVar); } public static final x Q(Socket socket) throws IOException { m.checkParameterIsNotNull(socket, "$this$source"); g0.w wVar = new g0.w(socket); InputStream inputStream = socket.getInputStream(); m.checkExpressionValueIsNotNull(inputStream, "getInputStream()"); n nVar = new n(inputStream, wVar); m.checkParameterIsNotNull(nVar, "source"); return new g0.d(wVar, nVar); } public static final void R(Continuation continuation, Continuation continuation2) { try { Continuation intercepted = d0.w.g.b.intercepted(continuation); k.a aVar = k.i; h.b(intercepted, k.m78constructorimpl(Unit.a), null, 2); } catch (Throwable th) { k.a aVar2 = k.i; ((s.a.b) continuation2).resumeWith(k.m78constructorimpl(l.createFailure(th))); } } public static void S(Function2 function2, Object obj, Continuation continuation, Function1 function1, int i) { int i2 = i & 4; try { Continuation intercepted = d0.w.g.b.intercepted(d0.w.g.b.createCoroutineUnintercepted(function2, obj, continuation)); k.a aVar = k.i; h.a(intercepted, k.m78constructorimpl(Unit.a), null); } catch (Throwable th) { k.a aVar2 = k.i; continuation.resumeWith(k.m78constructorimpl(l.createFailure(th))); } } public static final Object T(r rVar, R r, Function2, ? extends Object> function2) { Object obj; rVar.Y(); if (function2 != null) { try { obj = ((Function2) e0.beforeCheckcastToFunctionOfArity(function2, 2)).invoke(r, rVar); } catch (Throwable th) { obj = new v(th, false, 2); } if (obj == d0.w.g.c.getCOROUTINE_SUSPENDED()) { return d0.w.g.c.getCOROUTINE_SUSPENDED(); } Object L = rVar.L(obj); if (L == h1.b) { return d0.w.g.c.getCOROUTINE_SUSPENDED(); } if (!(L instanceof v)) { return h1.a(L); } throw ((v) L).b; } throw new NullPointerException("null cannot be cast to non-null type (R, kotlin.coroutines.Continuation) -> kotlin.Any?"); } /* JADX WARNING: Removed duplicated region for block: B:12:0x0035 */ /* JADX WARNING: Removed duplicated region for block: B:8:0x0023 */ public static final Object U(Exception exc, Continuation continuation) { c cVar; int i; if (continuation instanceof c) { cVar = (c) continuation; int i2 = cVar.label; if ((i2 & Integer.MIN_VALUE) != 0) { cVar.label = i2 - Integer.MIN_VALUE; Object obj = cVar.result; Object coroutine_suspended = d0.w.g.c.getCOROUTINE_SUSPENDED(); i = cVar.label; if (i != 0) { l.throwOnFailure(obj); cVar.L$0 = exc; cVar.label = 1; j0.a.dispatch(cVar.getContext(), new b(cVar, exc)); Object coroutine_suspended2 = d0.w.g.c.getCOROUTINE_SUSPENDED(); if (coroutine_suspended2 == d0.w.g.c.getCOROUTINE_SUSPENDED()) { d0.w.h.a.g.probeCoroutineSuspended(cVar); } if (coroutine_suspended2 == coroutine_suspended) { return coroutine_suspended; } } else if (i == 1) { Exception exc2 = (Exception) cVar.L$0; l.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } return Unit.a; } } cVar = new c(continuation); Object obj = cVar.result; Object coroutine_suspended = d0.w.g.c.getCOROUTINE_SUSPENDED(); i = cVar.label; if (i != 0) { } return Unit.a; } public static final long V(String str, long j, long j2, long j3) { String W = W(str); if (W == null) { return j; } Long longOrNull = s.toLongOrNull(W); if (longOrNull != null) { long longValue = longOrNull.longValue(); if (j2 <= longValue && j3 >= longValue) { return longValue; } throw new IllegalStateException(("System property '" + str + "' should be in range " + j2 + ".." + j3 + ", but is '" + longValue + '\'').toString()); } throw new IllegalStateException(("System property '" + str + "' has unrecognized value '" + W + '\'').toString()); } public static final String W(String str) { int i = s.a.a.u.a; try { return System.getProperty(str); } catch (SecurityException unused) { return null; } } public static int X(String str, int i, int i2, int i3, int i4, Object obj) { if ((i4 & 4) != 0) { i2 = 1; } if ((i4 & 8) != 0) { i3 = Integer.MAX_VALUE; } return (int) V(str, (long) i, (long) i2, (long) i3); } public static /* synthetic */ long Y(String str, long j, long j2, long j3, int i, Object obj) { if ((i & 4) != 0) { j2 = 1; } if ((i & 8) != 0) { j3 = Long.MAX_VALUE; } return V(str, j, j2, j3); } public static void Z(List list) { if (list != null && !list.isEmpty()) { if (list.size() == 1) { Throwable th = (Throwable) list.get(0); if (th instanceof RuntimeException) { throw ((RuntimeException) th); } else if (th instanceof Error) { throw ((Error) th); } else { throw new RuntimeException(th); } } else { throw new CompositeException(list); } } } public static final CoroutineScope a(CoroutineContext coroutineContext) { if (coroutineContext.get(Job.h) == null) { coroutineContext = coroutineContext.plus(new e1(null)); } return new s.a.a.f(coroutineContext); } public static void a0(Throwable th) { if (th instanceof OnErrorNotImplementedException) { throw ((OnErrorNotImplementedException) th); } else if (th instanceof OnErrorFailedException) { throw ((OnErrorFailedException) th); } else if (th instanceof OnCompletedFailedException) { throw ((OnCompletedFailedException) th); } else if (th instanceof VirtualMachineError) { throw ((VirtualMachineError) th); } else if (th instanceof ThreadDeath) { throw ((ThreadDeath) th); } else if (th instanceof LinkageError) { throw ((LinkageError) th); } } public static t b(Job job, int i) { int i2 = i & 1; return new r1(null); } public static void b0(Throwable th, j0.g gVar, Object obj) { a0(th); gVar.onError(OnErrorThrowable.a(th, obj)); } public static final void c(f0.f0.f.a aVar, f0.f0.f.c cVar, String str) { d.b bVar = f0.f0.f.d.f2719c; Logger logger = f0.f0.f.d.b; StringBuilder sb = new StringBuilder(); sb.append(cVar.f); sb.append(' '); String format = String.format("%-22s", Arrays.copyOf(new Object[]{str}, 1)); m.checkExpressionValueIsNotNull(format, "java.lang.String.format(format, *args)"); sb.append(format); sb.append(": "); sb.append(aVar.f2717c); logger.fine(sb.toString()); } /* JADX WARNING: Code restructure failed: missing block: B:66:0x010b, code lost: r1 = 1; */ public static final String c0(String str) { m.checkParameterIsNotNull(str, "$this$toCanonicalHost"); int i = 0; int i2 = -1; if (w.contains$default((CharSequence) str, (CharSequence) ":", false, 2, (Object) null)) { InetAddress m = (!d0.g0.t.startsWith$default(str, "[", false, 2, null) || !d0.g0.t.endsWith$default(str, "]", false, 2, null)) ? m(str, 0, str.length()) : m(str, 1, str.length() - 1); if (m == null) { return null; } byte[] address = m.getAddress(); if (address.length == 16) { m.checkExpressionValueIsNotNull(address, "address"); int i3 = 0; int i4 = 0; while (i3 < address.length) { int i5 = i3; while (i5 < 16 && address[i5] == 0 && address[i5 + 1] == 0) { i5 += 2; } int i6 = i5 - i3; if (i6 > i4 && i6 >= 4) { i2 = i3; i4 = i6; } i3 = i5 + 2; } g0.e eVar = new g0.e(); while (i < address.length) { if (i == i2) { eVar.T(58); i += i4; if (i == 16) { eVar.T(58); } } else { if (i > 0) { eVar.T(58); } byte b2 = address[i]; byte[] bArr = f0.f0.c.a; eVar.P((long) (((b2 & 255) << 8) | (address[i + 1] & 255))); i += 2; } } return eVar.G(); } else if (address.length == 4) { return m.getHostAddress(); } else { throw new AssertionError("Invalid IPv6 address: '" + str + '\''); } } else { try { String ascii = IDN.toASCII(str); m.checkExpressionValueIsNotNull(ascii, "IDN.toASCII(host)"); Locale locale = Locale.US; m.checkExpressionValueIsNotNull(locale, "Locale.US"); if (ascii != null) { String lowerCase = ascii.toLowerCase(locale); m.checkExpressionValueIsNotNull(lowerCase, "(this as java.lang.String).toLowerCase(locale)"); if (lowerCase.length() == 0) { return null; } int length = lowerCase.length(); int i7 = 0; while (true) { if (i7 >= length) { break; } char charAt = lowerCase.charAt(i7); if (charAt <= 31) { break; } else if (charAt >= 127) { break; } else if (w.indexOf$default((CharSequence) " #%/:?@[\\]", charAt, 0, false, 6, (Object) null) != -1) { break; } else { i7++; } } if (i != 0) { return null; } return lowerCase; } throw new TypeCastException("null cannot be cast to non-null type java.lang.String"); } catch (IllegalArgumentException unused) { return null; } } } public static long d(long j, long j2) { long j3 = j + j2; if (j3 < 0) { return Long.MAX_VALUE; } return j3; } public static final String d0(Continuation continuation) { Object obj; if (continuation instanceof g) { return continuation.toString(); } try { k.a aVar = k.i; obj = k.m78constructorimpl(continuation + '@' + u(continuation)); } catch (Throwable th) { k.a aVar2 = k.i; obj = k.m78constructorimpl(l.createFailure(th)); } if (k.m80exceptionOrNullimpl(obj) != null) { obj = continuation.getClass().getName() + '@' + u(continuation); } return (String) obj; } public static final boolean e(byte[] bArr, int i, byte[] bArr2, int i2, int i3) { m.checkParameterIsNotNull(bArr, "a"); m.checkParameterIsNotNull(bArr2, "b"); for (int i4 = 0; i4 < i3; i4++) { if (bArr[i4 + i] != bArr2[i4 + i2]) { return false; } } return true; } public static final String e0(byte b2) { char[] cArr = g0.z.b.a; return new String(new char[]{cArr[(b2 >> 4) & 15], cArr[b2 & 15]}); } public static s.a.e0 f(CoroutineScope coroutineScope, CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2 function2, int i, Object obj) { CoroutineStart coroutineStart2 = null; d0.w.f fVar = (i & 1) != 0 ? d0.w.f.i : null; if ((i & 2) != 0) { coroutineStart2 = CoroutineStart.DEFAULT; } CoroutineContext a = y.a(coroutineScope, fVar); Objects.requireNonNull(coroutineStart2); f0 i1Var = coroutineStart2 == CoroutineStart.LAZY ? new i1(a, function2) : new f0(a, true); i1Var.a0(coroutineStart2, i1Var, function2); return i1Var; } public static final Object f0(Object obj, Function1 function1) { Throwable r0 = k.m80exceptionOrNullimpl(obj); return r0 == null ? function1 != null ? new s.a.w(obj, function1) : obj : new v(r0, false, 2); } /* JADX WARNING: Removed duplicated region for block: B:12:0x0036 */ /* JADX WARNING: Removed duplicated region for block: B:8:0x0023 */ public static final Object g(s.a.e0[] e0VarArr, Continuation> continuation) { C0172a aVar; int i; if (continuation instanceof C0172a) { aVar = (C0172a) continuation; int i2 = aVar.label; if ((i2 & Integer.MIN_VALUE) != 0) { aVar.label = i2 - Integer.MIN_VALUE; Object obj = aVar.result; Object coroutine_suspended = d0.w.g.c.getCOROUTINE_SUSPENDED(); i = aVar.label; if (i != 0) { l.throwOnFailure(obj); if (e0VarArr.length == 0) { return d0.t.n.emptyList(); } s.a.d dVar = new s.a.d(e0VarArr); aVar.L$0 = e0VarArr; aVar.label = 1; s.a.k kVar = new s.a.k(d0.w.g.b.intercepted(aVar), 1); kVar.A(); int length = e0VarArr.length; d.a[] aVarArr = new d.a[length]; for (int i3 = 0; i3 < length; i3++) { s.a.e0 e0Var = dVar.b[d0.w.h.a.b.boxInt(i3).intValue()]; e0Var.start(); d.a aVar2 = new d.a(kVar, e0Var); aVar2.m = e0Var.t(aVar2); aVarArr[i3] = aVar2; } d.b bVar = new d.b(dVar, aVarArr); for (int i4 = 0; i4 < length; i4++) { aVarArr[i4]._disposer = bVar; } if (kVar.v()) { bVar.b(); } else { kVar.e(bVar); } obj = kVar.u(); if (obj == d0.w.g.c.getCOROUTINE_SUSPENDED()) { d0.w.h.a.g.probeCoroutineSuspended(aVar); } if (obj == coroutine_suspended) { return coroutine_suspended; } } else if (i == 1) { s.a.e0[] e0VarArr2 = (s.a.e0[]) aVar.L$0; l.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } return (List) obj; } } aVar = new C0172a(continuation); Object obj = aVar.result; Object coroutine_suspended = d0.w.g.c.getCOROUTINE_SUSPENDED(); i = aVar.label; if (i != 0) { } return (List) obj; } public static RectF g0(float[] fArr) { RectF rectF = new RectF(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY); for (int i = 1; i < fArr.length; i += 2) { float round = ((float) Math.round(fArr[i - 1] * 10.0f)) / 10.0f; float round2 = ((float) Math.round(fArr[i] * 10.0f)) / 10.0f; float f = rectF.left; if (round < f) { f = round; } rectF.left = f; float f2 = rectF.top; if (round2 < f2) { f2 = round2; } rectF.top = f2; float f3 = rectF.right; if (round <= f3) { round = f3; } rectF.right = round; float f4 = rectF.bottom; if (round2 <= f4) { round2 = f4; } rectF.bottom = round2; } rectF.sort(); return rectF; } public static final UndeliveredElementException h(Function1 function1, E e, UndeliveredElementException undeliveredElementException) { try { function1.invoke(e); } catch (Throwable th) { if (undeliveredElementException == null || undeliveredElementException.getCause() == th) { return new UndeliveredElementException(c.d.b.a.a.s("Exception in undelivered element handler for ", e), th); } d0.b.addSuppressed(undeliveredElementException, th); } return undeliveredElementException; } public static boolean h0(long j) { int i = (j > 0 ? 1 : (j == 0 ? 0 : -1)); if (i >= 0) { return i != 0; } throw new IllegalArgumentException(c.d.b.a.a.p("n >= 0 required but it was ", j)); } public static final void i(CoroutineScope coroutineScope, CancellationException cancellationException) { Job job = (Job) coroutineScope.getCoroutineContext().get(Job.h); if (job != null) { job.B(cancellationException); return; } throw new IllegalStateException(("Scope cannot be cancelled because it does not have a job: " + coroutineScope).toString()); } /* JADX INFO: finally extract failed */ /* JADX DEBUG: Multi-variable search result rejected for r3v11, resolved type: java.util.concurrent.atomic.AtomicIntegerFieldUpdater */ /* JADX WARN: Multi-variable type inference failed */ public static final Object i0(CoroutineContext coroutineContext, Function2, ? extends Object> function2, Continuation continuation) { Object obj; boolean z2; CoroutineContext context = continuation.getContext(); CoroutineContext plus = context.plus(coroutineContext); Job job = (Job) plus.get(Job.h); if (job == null || job.a()) { if (plus == context) { r rVar = new r(plus, continuation); obj = T(rVar, rVar, function2); } else { int i = d0.w.d.e; d.b bVar = d.b.a; if (m.areEqual((d0.w.d) plus.get(bVar), (d0.w.d) context.get(bVar))) { w1 w1Var = new w1(plus, continuation); Object b2 = s.a.a.a.b(plus, null); try { Object T = T(w1Var, w1Var, function2); s.a.a.a.a(plus, b2); obj = T; } catch (Throwable th) { s.a.a.a.a(plus, b2); throw th; } } else { h0 h0Var = new h0(plus, continuation); h0Var.Y(); S(function2, h0Var, h0Var, null, 4); while (true) { int i2 = h0Var._decision; z2 = false; if (i2 == 0) { if (h0.m.compareAndSet(h0Var, 0, 1)) { z2 = true; break; } } else if (i2 != 2) { throw new IllegalStateException("Already suspended".toString()); } } if (z2) { obj = d0.w.g.c.getCOROUTINE_SUSPENDED(); } else { obj = h1.a(h0Var.F()); if (obj instanceof v) { throw ((v) obj).b; } } } } if (obj == d0.w.g.c.getCOROUTINE_SUSPENDED()) { d0.w.h.a.g.probeCoroutineSuspended(continuation); } return obj; } throw job.p(); } public static void j(CoroutineContext coroutineContext, CancellationException cancellationException, int i, Object obj) { int i2 = i & 1; Job job = (Job) coroutineContext.get(Job.h); if (job != null) { job.B(null); } } public static /* synthetic */ void k(Job job, CancellationException cancellationException, int i, Object obj) { int i2 = i & 1; job.B(null); } public static final void l(long j, long j2, long j3) { if ((j2 | j3) < 0 || j2 > j || j - j2 < j3) { StringBuilder O = c.d.b.a.a.O("size=", j, " offset="); O.append(j2); O.append(" byteCount="); O.append(j3); throw new ArrayIndexOutOfBoundsException(O.toString()); } } /* JADX WARNING: Code restructure failed: missing block: B:40:0x00a0, code lost: if ((r2 - r15) != 0) goto L_0x00a3; */ /* JADX WARNING: Code restructure failed: missing block: B:61:0x00ea, code lost: return null; */ public static final InetAddress m(String str, int i, int i2) { boolean z2; int i3; int i4; byte[] bArr = new byte[16]; int i5 = i; int i6 = 0; int i7 = -1; int i8 = -1; while (true) { if (i5 >= i2) { break; } else if (i6 == 16) { return null; } else { int i9 = i5 + 2; if (i9 > i2 || !d0.g0.t.startsWith$default(str, "::", i5, false, 4, null)) { if (i6 != 0) { if (d0.g0.t.startsWith$default(str, ":", i5, false, 4, null)) { i5++; } else if (!d0.g0.t.startsWith$default(str, ".", i5, false, 4, null)) { return null; } else { int i10 = i6 - 2; int i11 = i10; loop1: while (true) { if (i8 < i2) { if (i11 == 16) { break; } if (i11 != i10) { if (str.charAt(i8) != '.') { break; } i8++; } i3 = i8; i4 = 0; while (true) { if (i3 < i2) { char charAt = str.charAt(i3); if (charAt >= '0' && charAt <= '9') { if ((i4 == 0 && i8 != i3) || (i4 = ((i4 * 10) + charAt) - 48) > 255) { break loop1; } i3++; } else { break; } } else { break; } } } else if (i11 == i10 + 4) { z2 = true; } bArr[i11] = (byte) i4; i8 = i3; i11++; } z2 = false; if (!z2) { return null; } i6 += 2; } } i8 = i5; } else if (i7 != -1) { return null; } else { i6 += 2; if (i9 == i2) { i7 = i6; break; } i8 = i9; i7 = i6; } i5 = i8; int i12 = 0; while (i5 < i2) { int r = f0.f0.c.r(str.charAt(i5)); if (r == -1) { break; } i12 = (i12 << 4) + r; i5++; } int i13 = i5 - i8; if (i13 == 0 || i13 > 4) { break; } int i14 = i6 + 1; bArr[i6] = (byte) ((i12 >>> 8) & 255); i6 = i14 + 1; bArr[i14] = (byte) (i12 & 255); } } if (i6 != 16) { if (i7 == -1) { return null; } int i15 = i6 - i7; System.arraycopy(bArr, i7, bArr, 16 - i15, i15); Arrays.fill(bArr, i7, (16 - i6) + i7, (byte) 0); } return InetAddress.getByAddress(bArr); } public static final Object n(long j, Continuation continuation) { if (j <= 0) { return Unit.a; } s.a.k kVar = new s.a.k(d0.w.g.b.intercepted(continuation), 1); kVar.A(); if (j < Long.MAX_VALUE) { t(kVar.n).b(j, kVar); } Object u = kVar.u(); if (u == d0.w.g.c.getCOROUTINE_SUSPENDED()) { d0.w.h.a.g.probeCoroutineSuspended(continuation); } return u; } public static final String o(long j) { String str; if (j <= ((long) -999500000)) { str = ((j - ((long) 500000000)) / ((long) 1000000000)) + " s "; } else if (j <= ((long) -999500)) { str = ((j - ((long) 500000)) / ((long) 1000000)) + " ms"; } else if (j <= 0) { str = ((j - ((long) 500)) / ((long) 1000)) + " µs"; } else if (j < ((long) 999500)) { str = ((j + ((long) 500)) / ((long) 1000)) + " µs"; } else if (j < ((long) 999500000)) { str = ((j + ((long) 500000)) / ((long) 1000000)) + " ms"; } else { str = ((j + ((long) 500000000)) / ((long) 1000000000)) + " s "; } String format = String.format("%6s", Arrays.copyOf(new Object[]{str}, 1)); m.checkExpressionValueIsNotNull(format, "java.lang.String.format(format, *args)"); return format; } public static long p(AtomicLong atomicLong, long j) { long j2; do { j2 = atomicLong.get(); } while (!atomicLong.compareAndSet(j2, d(j2, j))); return j2; } public static float[] q(RectF rectF) { return new float[]{rectF.centerX(), rectF.centerY()}; } public static final String r(Object obj) { return obj.getClass().getSimpleName(); } public static float[] s(RectF rectF) { float f = rectF.left; float f2 = rectF.top; float f3 = rectF.right; float f4 = rectF.bottom; return new float[]{f, f2, f3, f2, f3, f4, f, f4}; } public static final g0 t(CoroutineContext coroutineContext) { int i = d0.w.d.e; CoroutineContext.Element element = coroutineContext.get(d.b.a); if (!(element instanceof g0)) { element = null; } g0 g0Var = (g0) element; return g0Var != null ? g0Var : d0.a; } public static final String u(Object obj) { return Integer.toHexString(System.identityHashCode(obj)); } @TargetApi(17) public static int v() { EGLDisplay eglGetDisplay = EGL14.eglGetDisplay(0); int[] iArr = new int[2]; EGL14.eglInitialize(eglGetDisplay, iArr, 0, iArr, 1); EGLConfig[] eGLConfigArr = new EGLConfig[1]; int[] iArr2 = new int[1]; EGL14.eglChooseConfig(eglGetDisplay, new int[]{12351, 12430, 12329, 0, 12352, 4, 12339, 1, 12344}, 0, eGLConfigArr, 0, 1, iArr2, 0); if (iArr2[0] == 0) { return 0; } EGLConfig eGLConfig = eGLConfigArr[0]; EGLSurface eglCreatePbufferSurface = EGL14.eglCreatePbufferSurface(eglGetDisplay, eGLConfig, new int[]{12375, 64, 12374, 64, 12344}, 0); EGLContext eglCreateContext = EGL14.eglCreateContext(eglGetDisplay, eGLConfig, EGL14.EGL_NO_CONTEXT, new int[]{12440, 2, 12344}, 0); EGL14.eglMakeCurrent(eglGetDisplay, eglCreatePbufferSurface, eglCreatePbufferSurface, eglCreateContext); int[] iArr3 = new int[1]; GLES20.glGetIntegerv(3379, iArr3, 0); EGLSurface eGLSurface = EGL14.EGL_NO_SURFACE; EGL14.eglMakeCurrent(eglGetDisplay, eGLSurface, eGLSurface, EGL14.EGL_NO_CONTEXT); EGL14.eglDestroySurface(eglGetDisplay, eglCreatePbufferSurface); EGL14.eglDestroyContext(eglGetDisplay, eglCreateContext); EGL14.eglTerminate(eglGetDisplay); return iArr3[0]; } public static int w(Context context) { Display defaultDisplay = ((WindowManager) context.getSystemService("window")).getDefaultDisplay(); if (defaultDisplay.getWidth() == defaultDisplay.getHeight()) { return 3; } return defaultDisplay.getWidth() < defaultDisplay.getHeight() ? 1 : 2; } public static final void x(CoroutineContext coroutineContext, Throwable th) { try { int i = CoroutineExceptionHandler.g; CoroutineExceptionHandler coroutineExceptionHandler = (CoroutineExceptionHandler) coroutineContext.get(CoroutineExceptionHandler.a.a); if (coroutineExceptionHandler != null) { coroutineExceptionHandler.handleException(coroutineContext, th); } else { a0.a(coroutineContext, th); } } catch (Throwable th2) { if (th != th2) { RuntimeException runtimeException = new RuntimeException("Exception while trying to handle coroutine exception", th2); d0.b.addSuppressed(runtimeException, th); th = runtimeException; } a0.a(coroutineContext, th); } } public static /* synthetic */ l0 y(Job job, boolean z2, boolean z3, Function1 function1, int i, Object obj) { if ((i & 1) != 0) { z2 = false; } if ((i & 2) != 0) { z3 = true; } return job.f(z2, z3, function1); } public static l0 z(long j, Runnable runnable, CoroutineContext coroutineContext) { return d0.a.w(j, runnable, coroutineContext); } }