SegmentPool.smali

.class public final Lokio/SegmentPool;
.super Ljava/lang/Object;


# static fields
.field private static a:Lokio/Segment;

.field private static b:J

.field public static final c:Lokio/SegmentPool;


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

    new-instance v0, Lokio/SegmentPool;

    invoke-direct {v0}, Lokio/SegmentPool;-><init>()V

    sput-object v0, Lokio/SegmentPool;->c:Lokio/SegmentPool;

    return-void
.end method

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

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

    return-void
.end method


# virtual methods
.method public final a(Lokio/Segment;)V
    .registers 10

    const-string v0, "segment"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->c(Ljava/lang/Object;Ljava/lang/String;)V

    iget-object v0, p1, Lokio/Segment;->f:Lokio/Segment;

    const/4 v1, 0x0

    if-nez v0, :cond_10

    iget-object v0, p1, Lokio/Segment;->g:Lokio/Segment;

    if-nez v0, :cond_10

    const/4 v0, 0x1

    goto :goto_11

    :cond_10
    const/4 v0, 0x0

    :goto_11
    if-eqz v0, :cond_3e

    iget-boolean v0, p1, Lokio/Segment;->d:Z

    if-eqz v0, :cond_18

    return-void

    :cond_18
    monitor-enter p0

    :try_start_19
    sget-wide v2, Lokio/SegmentPool;->b:J
    :try_end_1b
    .catchall {:try_start_19 .. :try_end_1b} :catchall_3b

    const/16 v0, 0x2000

    int-to-long v4, v0

    add-long/2addr v2, v4

    const-wide/32 v6, 0x10000

    cmp-long v0, v2, v6

    if-lez v0, :cond_28

    monitor-exit p0

    return-void

    :cond_28
    :try_start_28
    sget-wide v2, Lokio/SegmentPool;->b:J

    add-long/2addr v2, v4

    sput-wide v2, Lokio/SegmentPool;->b:J

    sget-object v0, Lokio/SegmentPool;->a:Lokio/Segment;

    iput-object v0, p1, Lokio/Segment;->f:Lokio/Segment;

    iput v1, p1, Lokio/Segment;->c:I

    iput v1, p1, Lokio/Segment;->b:I

    sput-object p1, Lokio/SegmentPool;->a:Lokio/Segment;

    sget-object p1, Lkotlin/Unit;->a:Lkotlin/Unit;
    :try_end_39
    .catchall {:try_start_28 .. :try_end_39} :catchall_3b

    monitor-exit p0

    return-void

    :catchall_3b
    move-exception p1

    monitor-exit p0

    throw p1

    :cond_3e
    const-string p1, "Failed requirement."

    new-instance v0, Ljava/lang/IllegalArgumentException;

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

    move-result-object p1

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

    throw v0
.end method

.method public final b()Lokio/Segment;
    .registers 6

    monitor-enter p0

    :try_start_1
    sget-object v0, Lokio/SegmentPool;->a:Lokio/Segment;

    if-eqz v0, :cond_16

    iget-object v1, v0, Lokio/Segment;->f:Lokio/Segment;

    sput-object v1, Lokio/SegmentPool;->a:Lokio/Segment;

    const/4 v1, 0x0

    iput-object v1, v0, Lokio/Segment;->f:Lokio/Segment;

    sget-wide v1, Lokio/SegmentPool;->b:J

    const/16 v3, 0x2000

    int-to-long v3, v3

    sub-long/2addr v1, v3

    sput-wide v1, Lokio/SegmentPool;->b:J
    :try_end_14
    .catchall {:try_start_1 .. :try_end_14} :catchall_1d

    monitor-exit p0

    return-object v0

    :cond_16
    monitor-exit p0

    new-instance v0, Lokio/Segment;

    invoke-direct {v0}, Lokio/Segment;-><init>()V

    return-object v0

    :catchall_1d
    move-exception v0

    monitor-exit p0

    throw v0
.end method