s$a.smali

.class public final Lio/reactivex/internal/operators/observable/s$a;
.super Ljava/util/concurrent/atomic/AtomicReference;
.source "SourceFile"

# interfaces
.implements Lio/reactivex/s;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lio/reactivex/internal/operators/observable/s;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "a"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        "R:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/util/concurrent/atomic/AtomicReference<",
        "Lio/reactivex/disposables/b;",
        ">;",
        "Lio/reactivex/s<",
        "TT;>;"
    }
.end annotation


# static fields
.field private static final serialVersionUID:J = -0x42f1490d3f05c855L


# instance fields
.field public final a:Lio/reactivex/internal/operators/observable/s$b;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lio/reactivex/internal/operators/observable/s$b<",
            "TT;TR;>;"
        }
    .end annotation
.end field

.field public final b:I


# direct methods
.method public constructor <init>(Lio/reactivex/internal/operators/observable/s$b;I)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lio/reactivex/internal/operators/observable/s$b<",
            "TT;TR;>;I)V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V

    .line 2
    iput-object p1, p0, Lio/reactivex/internal/operators/observable/s$a;->a:Lio/reactivex/internal/operators/observable/s$b;

    .line 3
    iput p2, p0, Lio/reactivex/internal/operators/observable/s$a;->b:I

    return-void
.end method


# virtual methods
.method public final onComplete()V
    .registers 6

    .line 1
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/s$a;->a:Lio/reactivex/internal/operators/observable/s$b;

    iget v1, p0, Lio/reactivex/internal/operators/observable/s$a;->b:I

    .line 2
    monitor-enter v0

    .line 3
    :try_start_5
    iget-object v2, v0, Lio/reactivex/internal/operators/observable/s$b;->d:[Ljava/lang/Object;

    if-nez v2, :cond_b

    .line 4
    monitor-exit v0

    goto :goto_28

    .line 5
    :cond_b
    aget-object v1, v2, v1

    const/4 v3, 0x1

    if-nez v1, :cond_12

    const/4 v1, 0x1

    goto :goto_13

    :cond_12
    const/4 v1, 0x0

    :goto_13
    if-nez v1, :cond_1d

    .line 6
    iget v4, v0, Lio/reactivex/internal/operators/observable/s$b;->k:I

    add-int/2addr v4, v3

    iput v4, v0, Lio/reactivex/internal/operators/observable/s$b;->k:I

    array-length v2, v2

    if-ne v4, v2, :cond_1f

    .line 7
    :cond_1d
    iput-boolean v3, v0, Lio/reactivex/internal/operators/observable/s$b;->h:Z

    .line 8
    :cond_1f
    monitor-exit v0
    :try_end_20
    .catchall {:try_start_5 .. :try_end_20} :catchall_29

    if-eqz v1, :cond_25

    .line 9
    invoke-virtual {v0}, Lio/reactivex/internal/operators/observable/s$b;->a()V

    .line 10
    :cond_25
    invoke-virtual {v0}, Lio/reactivex/internal/operators/observable/s$b;->c()V

    :goto_28
    return-void

    :catchall_29
    move-exception v1

    .line 11
    :try_start_2a
    monitor-exit v0
    :try_end_2b
    .catchall {:try_start_2a .. :try_end_2b} :catchall_29

    throw v1
.end method

.method public final onError(Ljava/lang/Throwable;)V
    .registers 6

    .line 1
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/s$a;->a:Lio/reactivex/internal/operators/observable/s$b;

    iget v1, p0, Lio/reactivex/internal/operators/observable/s$a;->b:I

    .line 2
    iget-object v2, v0, Lio/reactivex/internal/operators/observable/s$b;->i:Lio/reactivex/internal/util/c;

    .line 3
    invoke-static {v2, p1}, Lio/reactivex/internal/util/g;->a(Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/Throwable;)Z

    move-result v2

    if-eqz v2, :cond_3a

    .line 4
    iget-boolean p1, v0, Lio/reactivex/internal/operators/observable/s$b;->f:Z

    const/4 v2, 0x1

    if-eqz p1, :cond_31

    .line 5
    monitor-enter v0

    .line 6
    :try_start_12
    iget-object p1, v0, Lio/reactivex/internal/operators/observable/s$b;->d:[Ljava/lang/Object;

    if-nez p1, :cond_18

    .line 7
    monitor-exit v0

    goto :goto_3d

    .line 8
    :cond_18
    aget-object v1, p1, v1

    if-nez v1, :cond_1e

    const/4 v1, 0x1

    goto :goto_1f

    :cond_1e
    const/4 v1, 0x0

    :goto_1f
    if-nez v1, :cond_29

    .line 9
    iget v3, v0, Lio/reactivex/internal/operators/observable/s$b;->k:I

    add-int/2addr v3, v2

    iput v3, v0, Lio/reactivex/internal/operators/observable/s$b;->k:I

    array-length p1, p1

    if-ne v3, p1, :cond_2b

    .line 10
    :cond_29
    iput-boolean v2, v0, Lio/reactivex/internal/operators/observable/s$b;->h:Z

    .line 11
    :cond_2b
    monitor-exit v0

    move v2, v1

    goto :goto_31

    :catchall_2e
    move-exception p1

    monitor-exit v0
    :try_end_30
    .catchall {:try_start_12 .. :try_end_30} :catchall_2e

    throw p1

    :cond_31
    :goto_31
    if-eqz v2, :cond_36

    .line 12
    invoke-virtual {v0}, Lio/reactivex/internal/operators/observable/s$b;->a()V

    .line 13
    :cond_36
    invoke-virtual {v0}, Lio/reactivex/internal/operators/observable/s$b;->c()V

    goto :goto_3d

    .line 14
    :cond_3a
    invoke-static {p1}, Lio/reactivex/plugins/a;->b(Ljava/lang/Throwable;)V

    :goto_3d
    return-void
.end method

.method public final onNext(Ljava/lang/Object;)V
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/s$a;->a:Lio/reactivex/internal/operators/observable/s$b;

    iget v1, p0, Lio/reactivex/internal/operators/observable/s$a;->b:I

    .line 2
    monitor-enter v0

    .line 3
    :try_start_5
    iget-object v2, v0, Lio/reactivex/internal/operators/observable/s$b;->d:[Ljava/lang/Object;

    if-nez v2, :cond_b

    .line 4
    monitor-exit v0

    goto :goto_2c

    .line 5
    :cond_b
    aget-object v3, v2, v1

    .line 6
    iget v4, v0, Lio/reactivex/internal/operators/observable/s$b;->j:I

    if-nez v3, :cond_15

    add-int/lit8 v4, v4, 0x1

    .line 7
    iput v4, v0, Lio/reactivex/internal/operators/observable/s$b;->j:I

    .line 8
    :cond_15
    aput-object p1, v2, v1

    .line 9
    array-length p1, v2

    if-ne v4, p1, :cond_25

    .line 10
    iget-object p1, v0, Lio/reactivex/internal/operators/observable/s$b;->e:Lio/reactivex/internal/queue/c;

    invoke-virtual {v2}, [Ljava/lang/Object;->clone()Ljava/lang/Object;

    move-result-object v1

    invoke-virtual {p1, v1}, Lio/reactivex/internal/queue/c;->offer(Ljava/lang/Object;)Z

    const/4 p1, 0x1

    goto :goto_26

    :cond_25
    const/4 p1, 0x0

    .line 11
    :goto_26
    monitor-exit v0
    :try_end_27
    .catchall {:try_start_5 .. :try_end_27} :catchall_2d

    if-eqz p1, :cond_2c

    .line 12
    invoke-virtual {v0}, Lio/reactivex/internal/operators/observable/s$b;->c()V

    :cond_2c
    :goto_2c
    return-void

    :catchall_2d
    move-exception p1

    .line 13
    :try_start_2e
    monitor-exit v0
    :try_end_2f
    .catchall {:try_start_2e .. :try_end_2f} :catchall_2d

    throw p1
.end method

.method public final onSubscribe(Lio/reactivex/disposables/b;)V
    .registers 2

    invoke-static {p0, p1}, Lio/reactivex/internal/disposables/c;->setOnce(Ljava/util/concurrent/atomic/AtomicReference;Lio/reactivex/disposables/b;)Z

    return-void
.end method