package d0.x; import d0.g0.w; import d0.z.d.m; /* compiled from: PlatformImplementations.kt */ /* loaded from: classes3.dex */ public final class b { public static final a a; static { a aVar; Object newInstance; Object newInstance2; String property = System.getProperty("java.specification.version"); int i = 65542; if (property != null) { int indexOf$default = w.indexOf$default((CharSequence) property, '.', 0, false, 6, (Object) null); try { if (indexOf$default < 0) { i = Integer.parseInt(property) * 65536; } else { int i2 = indexOf$default + 1; int indexOf$default2 = w.indexOf$default((CharSequence) property, '.', i2, false, 4, (Object) null); if (indexOf$default2 < 0) { indexOf$default2 = property.length(); } String substring = property.substring(0, indexOf$default); m.checkNotNullExpressionValue(substring, "(this as java.lang.Strin…ing(startIndex, endIndex)"); String substring2 = property.substring(i2, indexOf$default2); m.checkNotNullExpressionValue(substring2, "(this as java.lang.Strin…ing(startIndex, endIndex)"); i = (Integer.parseInt(substring) * 65536) + Integer.parseInt(substring2); } } catch (NumberFormatException unused) { } } if (i >= 65544) { try { newInstance = Class.forName("d0.x.e.a").newInstance(); m.checkNotNullExpressionValue(newInstance, "Class.forName(\"kotlin.in…entations\").newInstance()"); try { try { } catch (ClassCastException e) { ClassLoader classLoader = newInstance.getClass().getClassLoader(); ClassLoader classLoader2 = a.class.getClassLoader(); Throwable initCause = new ClassCastException("Instance classloader: " + classLoader + ", base type classloader: " + classLoader2).initCause(e); m.checkNotNullExpressionValue(initCause, "ClassCastException(\"Inst…baseTypeCL\").initCause(e)"); throw initCause; } } catch (ClassNotFoundException unused2) { } } catch (ClassNotFoundException unused3) { Object newInstance3 = Class.forName("kotlin.internal.JRE8PlatformImplementations").newInstance(); m.checkNotNullExpressionValue(newInstance3, "Class.forName(\"kotlin.in…entations\").newInstance()"); try { if (newInstance3 != null) { aVar = (a) newInstance3; } else { throw new NullPointerException("null cannot be cast to non-null type kotlin.internal.PlatformImplementations"); } } catch (ClassCastException e2) { ClassLoader classLoader3 = newInstance3.getClass().getClassLoader(); ClassLoader classLoader4 = a.class.getClassLoader(); Throwable initCause2 = new ClassCastException("Instance classloader: " + classLoader3 + ", base type classloader: " + classLoader4).initCause(e2); m.checkNotNullExpressionValue(initCause2, "ClassCastException(\"Inst…baseTypeCL\").initCause(e)"); throw initCause2; } } if (newInstance != null) { aVar = (a) newInstance; a = aVar; } throw new NullPointerException("null cannot be cast to non-null type kotlin.internal.PlatformImplementations"); } if (i >= 65543) { try { try { newInstance2 = Class.forName("d0.x.d.a").newInstance(); m.checkNotNullExpressionValue(newInstance2, "Class.forName(\"kotlin.in…entations\").newInstance()"); try { } catch (ClassCastException e3) { ClassLoader classLoader5 = newInstance2.getClass().getClassLoader(); ClassLoader classLoader6 = a.class.getClassLoader(); Throwable initCause3 = new ClassCastException("Instance classloader: " + classLoader5 + ", base type classloader: " + classLoader6).initCause(e3); m.checkNotNullExpressionValue(initCause3, "ClassCastException(\"Inst…baseTypeCL\").initCause(e)"); throw initCause3; } } catch (ClassNotFoundException unused4) { Object newInstance4 = Class.forName("kotlin.internal.JRE7PlatformImplementations").newInstance(); m.checkNotNullExpressionValue(newInstance4, "Class.forName(\"kotlin.in…entations\").newInstance()"); try { if (newInstance4 != null) { aVar = (a) newInstance4; } else { throw new NullPointerException("null cannot be cast to non-null type kotlin.internal.PlatformImplementations"); } } catch (ClassCastException e4) { ClassLoader classLoader7 = newInstance4.getClass().getClassLoader(); ClassLoader classLoader8 = a.class.getClassLoader(); Throwable initCause4 = new ClassCastException("Instance classloader: " + classLoader7 + ", base type classloader: " + classLoader8).initCause(e4); m.checkNotNullExpressionValue(initCause4, "ClassCastException(\"Inst…baseTypeCL\").initCause(e)"); throw initCause4; } } } catch (ClassNotFoundException unused5) { } if (newInstance2 != null) { aVar = (a) newInstance2; a = aVar; } throw new NullPointerException("null cannot be cast to non-null type kotlin.internal.PlatformImplementations"); } aVar = new a(); a = aVar; } }