.class public final Lq9/n;
.super Lq9/n0;
.source ""


# static fields
.field private static volatile pool:Ljava/util/concurrent/Executor;

.field public static final s:Lq9/n;

.field public static final t:I


# direct methods
.method public static constructor <clinit>()V
    .registers 4

    new-instance v0, Lq9/n;

    invoke-direct {v0}, Lq9/n;-><init>()V

    sput-object v0, Lq9/n;->s:Lq9/n;

    :try_start_7
    const-string v0, "kotlinx.coroutines.default.parallelism"

    invoke-static {v0}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0
    :try_end_d
    .catchall {:try_start_7 .. :try_end_d} :catchall_e

    goto :goto_f

    :catchall_e
    const/4 v0, 0x0

    :goto_f
    if-nez v0, :cond_13

    const/4 v0, -0x1

    goto :goto_24

    :cond_13
    invoke-static {v0}, Lp9/g;->p(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v1

    if-eqz v1, :cond_27

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v2

    const/4 v3, 0x1

    if-lt v2, v3, :cond_27

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v0

    :goto_24
    sput v0, Lq9/n;->t:I

    return-void

    :cond_27
    const-string v1, "Expected positive number in kotlinx.coroutines.default.parallelism, but has "

    invoke-static {v1, v0}, Lx/e;->k(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    new-instance v1, Ljava/lang/IllegalStateException;

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method public constructor <init>()V
    .registers 1

    invoke-direct {p0}, Lq9/n0;-><init>()V

    return-void
.end method


# virtual methods
.method public Y(Lb9/f;Ljava/lang/Runnable;)V
    .registers 3

    :try_start_0
    sget-object p1, Lq9/n;->pool:Ljava/util/concurrent/Executor;

    if-nez p1, :cond_14

    .line 1
    monitor-enter p0
    :try_end_5
    .catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_0 .. :try_end_5} :catch_18

    :try_start_5
    sget-object p1, Lq9/n;->pool:Ljava/util/concurrent/Executor;

    if-nez p1, :cond_f

    invoke-virtual {p0}, Lq9/n;->b0()Ljava/util/concurrent/ExecutorService;

    move-result-object p1

    sput-object p1, Lq9/n;->pool:Ljava/util/concurrent/Executor;
    :try_end_f
    .catchall {:try_start_5 .. :try_end_f} :catchall_11

    :cond_f
    :try_start_f
    monitor-exit p0

    goto :goto_14

    :catchall_11
    move-exception p1

    monitor-exit p0

    throw p1

    .line 2
    :cond_14
    :goto_14
    invoke-interface {p1, p2}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
    :try_end_17
    .catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_f .. :try_end_17} :catch_18

    goto :goto_1d

    :catch_18
    sget-object p1, Lq9/z;->x:Lq9/z;

    invoke-virtual {p1, p2}, Lq9/j0;->h0(Ljava/lang/Runnable;)V

    :goto_1d
    return-void
.end method

.method public final a0()Ljava/util/concurrent/ExecutorService;
    .registers 4

    new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>()V

    invoke-virtual {p0}, Lq9/n;->c0()I

    move-result v1

    new-instance v2, Landroidx/emoji2/text/a;

    invoke-direct {v2, v0}, Landroidx/emoji2/text/a;-><init>(Ljava/util/concurrent/atomic/AtomicInteger;)V

    invoke-static {v1, v2}, Ljava/util/concurrent/Executors;->newFixedThreadPool(ILjava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    return-object v0
.end method

.method public final b0()Ljava/util/concurrent/ExecutorService;
    .registers 8

    invoke-static {}, Ljava/lang/System;->getSecurityManager()Ljava/lang/SecurityManager;

    move-result-object v0

    if-eqz v0, :cond_b

    invoke-virtual {p0}, Lq9/n;->a0()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    return-object v0

    :cond_b
    const/4 v0, 0x0

    :try_start_c
    const-string v1, "java.util.concurrent.ForkJoinPool"

    invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1
    :try_end_12
    .catchall {:try_start_c .. :try_end_12} :catchall_13

    goto :goto_14

    :catchall_13
    move-object v1, v0

    :goto_14
    if-nez v1, :cond_1b

    invoke-virtual {p0}, Lq9/n;->a0()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    return-object v0

    :cond_1b
    sget v2, Lq9/n;->t:I

    const/4 v3, 0x1

    const/4 v4, 0x0

    if-gez v2, :cond_6e

    :try_start_21
    const-string v2, "commonPool"

    new-array v5, v4, [Ljava/lang/Class;

    invoke-virtual {v1, v2, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v2

    new-array v5, v4, [Ljava/lang/Object;

    invoke-virtual {v2, v0, v5}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    instance-of v5, v2, Ljava/util/concurrent/ExecutorService;

    if-eqz v5, :cond_36

    check-cast v2, Ljava/util/concurrent/ExecutorService;
    :try_end_35
    .catchall {:try_start_21 .. :try_end_35} :catchall_36

    goto :goto_37

    :catchall_36
    :cond_36
    move-object v2, v0

    :goto_37
    if-nez v2, :cond_3a

    goto :goto_6e

    :cond_3a
    sget-object v5, Lq9/n;->s:Lq9/n;

    invoke-static {v5}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 1
    sget-object v5, Lq9/m;->r:Lq9/m;

    invoke-interface {v2, v5}, Ljava/util/concurrent/ExecutorService;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;

    :try_start_44
    const-string v5, "getPoolSize"

    new-array v6, v4, [Ljava/lang/Class;

    invoke-virtual {v1, v5, v6}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v5

    new-array v6, v4, [Ljava/lang/Object;

    invoke-virtual {v5, v2, v6}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    instance-of v6, v5, Ljava/lang/Integer;

    if-eqz v6, :cond_59

    check-cast v5, Ljava/lang/Integer;
    :try_end_58
    .catchall {:try_start_44 .. :try_end_58} :catchall_59

    goto :goto_5a

    :catchall_59
    :cond_59
    move-object v5, v0

    :goto_5a
    if-nez v5, :cond_5d

    goto :goto_65

    :cond_5d
    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v5

    if-lt v5, v3, :cond_65

    move v5, v3

    goto :goto_66

    :cond_65
    :goto_65
    move v5, v4

    :goto_66
    if-eqz v5, :cond_69

    goto :goto_6a

    :cond_69
    move-object v2, v0

    :goto_6a
    if-nez v2, :cond_6d

    goto :goto_6e

    :cond_6d
    return-object v2

    :cond_6e
    :goto_6e
    :try_start_6e
    new-array v2, v3, [Ljava/lang/Class;

    .line 2
    sget-object v5, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;

    aput-object v5, v2, v4

    invoke-virtual {v1, v2}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;

    move-result-object v1

    new-array v2, v3, [Ljava/lang/Object;

    sget-object v3, Lq9/n;->s:Lq9/n;

    invoke-virtual {v3}, Lq9/n;->c0()I

    move-result v3

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v4

    invoke-virtual {v1, v2}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    instance-of v2, v1, Ljava/util/concurrent/ExecutorService;

    if-eqz v2, :cond_91

    check-cast v1, Ljava/util/concurrent/ExecutorService;
    :try_end_90
    .catchall {:try_start_6e .. :try_end_90} :catchall_91

    move-object v0, v1

    :catchall_91
    :cond_91
    if-nez v0, :cond_97

    invoke-virtual {p0}, Lq9/n;->a0()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    :cond_97
    return-object v0
.end method

.method public final c0()I
    .registers 4

    sget v0, Lq9/n;->t:I

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Number;->intValue()I

    move-result v1

    const/4 v2, 0x1

    if-lez v1, :cond_f

    move v1, v2

    goto :goto_10

    :cond_f
    const/4 v1, 0x0

    :goto_10
    if-eqz v1, :cond_13

    goto :goto_14

    :cond_13
    const/4 v0, 0x0

    :goto_14
    if-nez v0, :cond_24

    invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Runtime;->availableProcessors()I

    move-result v0

    sub-int/2addr v0, v2

    if-ge v0, v2, :cond_22

    goto :goto_28

    :cond_22
    move v2, v0

    goto :goto_28

    :cond_24
    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v2

    :goto_28
    return v2
.end method

.method public close()V
    .registers 3

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "Close cannot be invoked on CommonPool"

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public toString()Ljava/lang/String;
    .registers 2

    const-string v0, "CommonPool"

    return-object v0
.end method
