.class public final Lha/v;
.super Ljava/lang/Object;
.source ""


# static fields
.field public static final a:Lha/u;

.field public static final b:I

.field public static final c:[Ljava/util/concurrent/atomic/AtomicReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "[",
            "Ljava/util/concurrent/atomic/AtomicReference<",
            "Lokio/Segment;",
            ">;"
        }
    .end annotation
.end field

.field public static final d:Lha/v;


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

    new-instance v0, Lha/v;

    invoke-direct {v0}, Lha/v;-><init>()V

    sput-object v0, Lha/v;->d:Lha/v;

    new-instance v0, Lha/u;

    const/4 v7, 0x0

    new-array v2, v7, [B

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    move-object v1, v0

    invoke-direct/range {v1 .. v6}, Lha/u;-><init>([BIIZZ)V

    sput-object v0, Lha/v;->a:Lha/u;

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

    move-result-object v0

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

    move-result v0

    mul-int/lit8 v0, v0, 0x2

    add-int/lit8 v0, v0, -0x1

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

    move-result v0

    sput v0, Lha/v;->b:I

    new-array v1, v0, [Ljava/util/concurrent/atomic/AtomicReference;

    :goto_2a
    if-ge v7, v0, :cond_36

    new-instance v2, Ljava/util/concurrent/atomic/AtomicReference;

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

    aput-object v2, v1, v7

    add-int/lit8 v7, v7, 0x1

    goto :goto_2a

    :cond_36
    sput-object v1, Lha/v;->c:[Ljava/util/concurrent/atomic/AtomicReference;

    return-void
.end method

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

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static final b(Lha/u;)V
    .registers 6

    iget-object v0, p0, Lha/u;->f:Lha/u;

    const/4 v1, 0x0

    if-nez v0, :cond_b

    iget-object v0, p0, Lha/u;->g:Lha/u;

    if-nez v0, :cond_b

    const/4 v0, 0x1

    goto :goto_c

    :cond_b
    move v0, v1

    :goto_c
    if-eqz v0, :cond_41

    iget-boolean v0, p0, Lha/u;->d:Z

    if-eqz v0, :cond_13

    return-void

    :cond_13
    sget-object v0, Lha/v;->d:Lha/v;

    invoke-virtual {v0}, Lha/v;->a()Ljava/util/concurrent/atomic/AtomicReference;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lha/u;

    sget-object v3, Lha/v;->a:Lha/u;

    if-ne v2, v3, :cond_24

    return-void

    :cond_24
    if-eqz v2, :cond_29

    iget v3, v2, Lha/u;->c:I

    goto :goto_2a

    :cond_29
    move v3, v1

    :goto_2a
    const/high16 v4, 0x10000

    if-lt v3, v4, :cond_2f

    return-void

    :cond_2f
    iput-object v2, p0, Lha/u;->f:Lha/u;

    iput v1, p0, Lha/u;->b:I

    add-int/lit16 v3, v3, 0x2000

    iput v3, p0, Lha/u;->c:I

    invoke-virtual {v0, v2, p0}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_40

    const/4 v0, 0x0

    iput-object v0, p0, Lha/u;->f:Lha/u;

    :cond_40
    return-void

    :cond_41
    new-instance p0, Ljava/lang/IllegalArgumentException;

    const-string v0, "Failed requirement."

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

    move-result-object v0

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

    throw p0
.end method

.method public static final c()Lha/u;
    .registers 4

    sget-object v0, Lha/v;->d:Lha/v;

    invoke-virtual {v0}, Lha/v;->a()Ljava/util/concurrent/atomic/AtomicReference;

    move-result-object v0

    sget-object v1, Lha/v;->a:Lha/u;

    invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicReference;->getAndSet(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lha/u;

    if-ne v2, v1, :cond_16

    new-instance v0, Lha/u;

    invoke-direct {v0}, Lha/u;-><init>()V

    return-object v0

    :cond_16
    const/4 v1, 0x0

    if-nez v2, :cond_22

    invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicReference;->set(Ljava/lang/Object;)V

    new-instance v0, Lha/u;

    invoke-direct {v0}, Lha/u;-><init>()V

    return-object v0

    :cond_22
    iget-object v3, v2, Lha/u;->f:Lha/u;

    invoke-virtual {v0, v3}, Ljava/util/concurrent/atomic/AtomicReference;->set(Ljava/lang/Object;)V

    iput-object v1, v2, Lha/u;->f:Lha/u;

    const/4 v0, 0x0

    iput v0, v2, Lha/u;->c:I

    return-object v2
.end method


# virtual methods
.method public final a()Ljava/util/concurrent/atomic/AtomicReference;
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/concurrent/atomic/AtomicReference<",
            "Lha/u;",
            ">;"
        }
    .end annotation

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v0

    const-string v1, "Thread.currentThread()"

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

    invoke-virtual {v0}, Ljava/lang/Thread;->getId()J

    move-result-wide v0

    sget v2, Lha/v;->b:I

    int-to-long v2, v2

    const-wide/16 v4, 0x1

    sub-long/2addr v2, v4

    and-long/2addr v0, v2

    long-to-int v0, v0

    sget-object v1, Lha/v;->c:[Ljava/util/concurrent/atomic/AtomicReference;

    aget-object v0, v1, v0

    return-object v0
.end method
