s.smali

.class final Lrx/internal/operators/s;
.super Lrx/o;
.source "OperatorMerge.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lrx/o",
        "<",
        "Lrx/e",
        "<+TT;>;>;"
    }
.end annotation


# static fields
.field private static caW:[Lrx/internal/operators/r;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "[",
            "Lrx/internal/operators/r",
            "<*>;"
        }
    .end annotation
.end field


# instance fields
.field private volatile ahX:Lrx/g/b;

.field bTk:Z

.field private caL:I

.field caR:Lrx/internal/operators/OperatorMerge$MergeProducer;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lrx/internal/operators/OperatorMerge$MergeProducer",
            "<TT;>;"
        }
    .end annotation
.end field

.field private volatile caS:Ljava/util/concurrent/ConcurrentLinkedQueue;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentLinkedQueue",
            "<",
            "Ljava/lang/Throwable;",
            ">;"
        }
    .end annotation
.end field

.field caT:Z

.field private caU:Ljava/lang/Object;

.field private volatile caV:[Lrx/internal/operators/r;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "[",
            "Lrx/internal/operators/r",
            "<*>;"
        }
    .end annotation
.end field

.field private caX:I

.field private caY:I

.field child:Lrx/o;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lrx/o",
            "<-TT;>;"
        }
    .end annotation
.end field

.field delayErrors:Z

.field private volatile done:Z

.field private lastId:J

.field private lastIndex:I

.field private volatile queue:Ljava/util/Queue;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Queue",
            "<",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation
.end field

.field private uniqueId:J


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

    .prologue
    .line 182
    const/4 v0, 0x0

    new-array v0, v0, [Lrx/internal/operators/r;

    sput-object v0, Lrx/internal/operators/s;->caW:[Lrx/internal/operators/r;

    return-void
.end method

.method public constructor <init>(Lrx/o;I)V
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lrx/o",
            "<-TT;>;I)V"
        }
    .end annotation

    .prologue
    const v1, 0x7fffffff

    .line 188
    invoke-direct {p0}, Lrx/o;-><init>()V

    .line 189
    iput-object p1, p0, Lrx/internal/operators/s;->child:Lrx/o;

    .line 190
    const/4 v0, 0x0

    iput-boolean v0, p0, Lrx/internal/operators/s;->delayErrors:Z

    .line 191
    iput p2, p0, Lrx/internal/operators/s;->caL:I

    .line 192
    new-instance v0, Ljava/lang/Object;

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

    iput-object v0, p0, Lrx/internal/operators/s;->caU:Ljava/lang/Object;

    .line 193
    sget-object v0, Lrx/internal/operators/s;->caW:[Lrx/internal/operators/r;

    iput-object v0, p0, Lrx/internal/operators/s;->caV:[Lrx/internal/operators/r;

    .line 194
    if-ne p2, v1, :cond_25

    .line 195
    iput v1, p0, Lrx/internal/operators/s;->caX:I

    .line 196
    const-wide v0, 0x7fffffffffffffffL

    invoke-virtual {p0, v0, v1}, Lrx/internal/operators/s;->request(J)V

    .line 201
    :goto_24
    return-void

    .line 198
    :cond_25
    const/4 v0, 0x1

    shr-int/lit8 v1, p2, 0x1

    invoke-static {v0, v1}, Ljava/lang/Math;->max(II)I

    move-result v0

    iput v0, p0, Lrx/internal/operators/s;->caX:I

    .line 199
    int-to-long v0, p2

    invoke-virtual {p0, v0, v1}, Lrx/internal/operators/s;->request(J)V

    goto :goto_24
.end method

.method private SS()Lrx/g/b;
    .registers 4

    .prologue
    .line 217
    iget-object v0, p0, Lrx/internal/operators/s;->ahX:Lrx/g/b;

    .line 218
    if-nez v0, :cond_1b

    .line 219
    const/4 v0, 0x0

    .line 220
    monitor-enter p0

    .line 221
    :try_start_6
    iget-object v1, p0, Lrx/internal/operators/s;->ahX:Lrx/g/b;

    .line 222
    if-nez v1, :cond_1f

    .line 223
    new-instance v1, Lrx/g/b;

    invoke-direct {v1}, Lrx/g/b;-><init>()V

    .line 224
    iput-object v1, p0, Lrx/internal/operators/s;->ahX:Lrx/g/b;

    .line 225
    const/4 v0, 0x1

    move v2, v0

    move-object v0, v1

    move v1, v2

    .line 227
    :goto_15
    monitor-exit p0
    :try_end_16
    .catchall {:try_start_6 .. :try_end_16} :catchall_1c

    .line 228
    if-eqz v1, :cond_1b

    .line 229
    invoke-virtual {p0, v0}, Lrx/internal/operators/s;->add(Lrx/p;)V

    .line 232
    :cond_1b
    return-object v0

    .line 227
    :catchall_1c
    move-exception v0

    :try_start_1d
    monitor-exit p0
    :try_end_1e
    .catchall {:try_start_1d .. :try_end_1e} :catchall_1c

    throw v0

    :cond_1f
    move v2, v0

    move-object v0, v1

    move v1, v2

    goto :goto_15
.end method

.method private ST()V
    .registers 4

    .prologue
    .line 264
    new-instance v0, Ljava/util/ArrayList;

    iget-object v1, p0, Lrx/internal/operators/s;->caS:Ljava/util/concurrent/ConcurrentLinkedQueue;

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    .line 265
    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    const/4 v2, 0x1

    if-ne v1, v2, :cond_1b

    .line 266
    iget-object v1, p0, Lrx/internal/operators/s;->child:Lrx/o;

    const/4 v2, 0x0

    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Throwable;

    invoke-virtual {v1, v0}, Lrx/o;->onError(Ljava/lang/Throwable;)V

    .line 270
    :goto_1a
    return-void

    .line 268
    :cond_1b
    iget-object v1, p0, Lrx/internal/operators/s;->child:Lrx/o;

    new-instance v2, Lrx/exceptions/CompositeException;

    invoke-direct {v2, v0}, Lrx/exceptions/CompositeException;-><init>(Ljava/util/Collection;)V

    invoke-virtual {v1, v2}, Lrx/o;->onError(Ljava/lang/Throwable;)V

    goto :goto_1a
.end method

.method static a(Lrx/internal/operators/r;Ljava/lang/Object;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lrx/internal/operators/r",
            "<TT;>;TT;)V"
        }
    .end annotation

    .prologue
    .line 372
    iget-object v0, p0, Lrx/internal/operators/r;->caO:Lrx/internal/util/c;

    .line 373
    if-nez v0, :cond_d

    .line 374
    invoke-static {}, Lrx/internal/util/c;->Ta()Lrx/internal/util/c;

    move-result-object v0

    .line 375
    invoke-virtual {p0, v0}, Lrx/internal/operators/r;->add(Lrx/p;)V

    .line 376
    iput-object v0, p0, Lrx/internal/operators/r;->caO:Lrx/internal/util/c;

    .line 379
    :cond_d
    :try_start_d
    invoke-static {p1}, Lrx/internal/operators/NotificationLite;->next(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    invoke-virtual {v0, v1}, Lrx/internal/util/c;->onNext(Ljava/lang/Object;)V
    :try_end_14
    .catch Lrx/exceptions/MissingBackpressureException; {:try_start_d .. :try_end_14} :catch_15
    .catch Ljava/lang/IllegalStateException; {:try_start_d .. :try_end_14} :catch_1d

    .line 389
    :cond_14
    :goto_14
    return-void

    .line 380
    :catch_15
    move-exception v0

    .line 381
    invoke-virtual {p0}, Lrx/internal/operators/r;->unsubscribe()V

    .line 382
    invoke-virtual {p0, v0}, Lrx/internal/operators/r;->onError(Ljava/lang/Throwable;)V

    goto :goto_14

    .line 383
    :catch_1d
    move-exception v0

    .line 384
    invoke-virtual {p0}, Lrx/internal/operators/r;->isUnsubscribed()Z

    move-result v1

    if-nez v1, :cond_14

    .line 385
    invoke-virtual {p0}, Lrx/internal/operators/r;->unsubscribe()V

    .line 386
    invoke-virtual {p0, v0}, Lrx/internal/operators/r;->onError(Ljava/lang/Throwable;)V

    goto :goto_14
.end method

.method private aP(Ljava/lang/Object;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 483
    iget-object v0, p0, Lrx/internal/operators/s;->queue:Ljava/util/Queue;

    .line 484
    if-nez v0, :cond_14

    .line 485
    iget v1, p0, Lrx/internal/operators/s;->caL:I

    .line 486
    const v0, 0x7fffffff

    if-ne v1, v0, :cond_2e

    .line 487
    new-instance v0, Lrx/internal/util/atomic/d;

    sget v1, Lrx/internal/util/c;->SIZE:I

    invoke-direct {v0, v1}, Lrx/internal/util/atomic/d;-><init>(I)V

    .line 499
    :goto_12
    iput-object v0, p0, Lrx/internal/operators/s;->queue:Ljava/util/Queue;

    .line 501
    :cond_14
    invoke-static {p1}, Lrx/internal/operators/NotificationLite;->next(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Queue;->offer(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_2d

    .line 502
    invoke-virtual {p0}, Lrx/internal/operators/s;->unsubscribe()V

    .line 503
    new-instance v0, Lrx/exceptions/MissingBackpressureException;

    invoke-direct {v0}, Lrx/exceptions/MissingBackpressureException;-><init>()V

    invoke-static {v0, p1}, Lrx/exceptions/OnErrorThrowable;->addValueAsLastCause(Ljava/lang/Throwable;Ljava/lang/Object;)Ljava/lang/Throwable;

    move-result-object v0

    invoke-virtual {p0, v0}, Lrx/internal/operators/s;->onError(Ljava/lang/Throwable;)V

    .line 505
    :cond_2d
    return-void

    .line 7042
    :cond_2e
    add-int/lit8 v0, v1, -0x1

    and-int/2addr v0, v1

    if-nez v0, :cond_42

    const/4 v0, 0x1

    .line 489
    :goto_34
    if-eqz v0, :cond_4a

    .line 490
    invoke-static {}, Lrx/internal/util/a/k;->Te()Z

    move-result v0

    if-eqz v0, :cond_44

    .line 491
    new-instance v0, Lrx/internal/util/a/d;

    invoke-direct {v0, v1}, Lrx/internal/util/a/d;-><init>(I)V

    goto :goto_12

    .line 7042
    :cond_42
    const/4 v0, 0x0

    goto :goto_34

    .line 493
    :cond_44
    new-instance v0, Lrx/internal/util/atomic/b;

    invoke-direct {v0, v1}, Lrx/internal/util/atomic/b;-><init>(I)V

    goto :goto_12

    .line 496
    :cond_4a
    new-instance v0, Lrx/internal/util/atomic/SpscExactAtomicArrayQueue;

    invoke-direct {v0, v1}, Lrx/internal/util/atomic/SpscExactAtomicArrayQueue;-><init>(I)V

    goto :goto_12
.end method

.method private checkTerminate()Z
    .registers 3

    .prologue
    const/4 v0, 0x1

    .line 812
    iget-object v1, p0, Lrx/internal/operators/s;->child:Lrx/o;

    invoke-virtual {v1}, Lrx/o;->isUnsubscribed()Z

    move-result v1

    if-eqz v1, :cond_a

    .line 824
    :goto_9
    return v0

    .line 815
    :cond_a
    iget-object v1, p0, Lrx/internal/operators/s;->caS:Ljava/util/concurrent/ConcurrentLinkedQueue;

    .line 816
    if-eqz v1, :cond_20

    invoke-interface {v1}, Ljava/util/Queue;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_20

    .line 818
    :try_start_14
    invoke-direct {p0}, Lrx/internal/operators/s;->ST()V
    :try_end_17
    .catchall {:try_start_14 .. :try_end_17} :catchall_1b

    .line 820
    invoke-virtual {p0}, Lrx/internal/operators/s;->unsubscribe()V

    goto :goto_9

    :catchall_1b
    move-exception v0

    invoke-virtual {p0}, Lrx/internal/operators/s;->unsubscribe()V

    throw v0

    .line 824
    :cond_20
    const/4 v0, 0x0

    goto :goto_9
.end method


# virtual methods
.method final Qd()V
    .registers 24

    .prologue
    .line 574
    const/4 v3, 0x0

    .line 576
    :try_start_1
    move-object/from16 v0, p0

    iget-object v14, v0, Lrx/internal/operators/s;->child:Lrx/o;

    .line 579
    :cond_5
    :goto_5
    invoke-direct/range {p0 .. p0}, Lrx/internal/operators/s;->checkTerminate()Z

    move-result v2

    if-eqz v2, :cond_c

    .line 801
    :cond_b
    :goto_b
    return-void

    .line 583
    :cond_c
    move-object/from16 v0, p0

    iget-object v9, v0, Lrx/internal/operators/s;->queue:Ljava/util/Queue;

    .line 585
    move-object/from16 v0, p0

    iget-object v2, v0, Lrx/internal/operators/s;->caR:Lrx/internal/operators/OperatorMerge$MergeProducer;

    invoke-virtual {v2}, Lrx/internal/operators/OperatorMerge$MergeProducer;->get()J

    move-result-wide v4

    .line 586
    const-wide v6, 0x7fffffffffffffffL

    cmp-long v2, v4, v6

    if-nez v2, :cond_4b

    const/4 v2, 0x1

    move v11, v2

    .line 589
    :goto_23
    const/4 v2, 0x0

    .line 592
    if-eqz v9, :cond_76

    .line 594
    :cond_26
    const/4 v7, 0x0

    .line 595
    const/4 v6, 0x0

    .line 596
    :goto_28
    const-wide/16 v12, 0x0

    cmp-long v8, v4, v12

    if-lez v8, :cond_65

    .line 597
    invoke-interface {v9}, Ljava/util/Queue;->poll()Ljava/lang/Object;

    move-result-object v6

    .line 599
    invoke-direct/range {p0 .. p0}, Lrx/internal/operators/s;->checkTerminate()Z

    move-result v8

    if-nez v8, :cond_b

    .line 603
    if-eqz v6, :cond_65

    .line 606
    invoke-static {v6}, Lrx/internal/operators/NotificationLite;->getValue(Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_3d
    .catchall {:try_start_1 .. :try_end_3d} :catchall_5a

    move-result-object v8

    .line 609
    :try_start_3e
    invoke-virtual {v14, v8}, Lrx/o;->onNext(Ljava/lang/Object;)V
    :try_end_41
    .catch Ljava/lang/Throwable; {:try_start_3e .. :try_end_41} :catch_4e
    .catchall {:try_start_3e .. :try_end_41} :catchall_5a

    .line 620
    add-int/lit8 v8, v2, 0x1

    .line 621
    add-int/lit8 v2, v7, 0x1

    .line 622
    const-wide/16 v12, 0x1

    sub-long/2addr v4, v12

    move v7, v2

    move v2, v8

    .line 623
    goto :goto_28

    .line 586
    :cond_4b
    const/4 v2, 0x0

    move v11, v2

    goto :goto_23

    .line 610
    :catch_4e
    move-exception v2

    .line 612
    :try_start_4f
    invoke-static {v2}, Lrx/exceptions/d;->throwIfFatal(Ljava/lang/Throwable;)V

    .line 613
    const/4 v3, 0x1

    .line 614
    invoke-virtual/range {p0 .. p0}, Lrx/internal/operators/s;->unsubscribe()V

    .line 615
    invoke-virtual {v14, v2}, Lrx/o;->onError(Ljava/lang/Throwable;)V
    :try_end_59
    .catchall {:try_start_4f .. :try_end_59} :catchall_5a

    goto :goto_b

    .line 798
    :catchall_5a
    move-exception v2

    if-nez v3, :cond_64

    .line 799
    monitor-enter p0

    .line 800
    const/4 v3, 0x0

    :try_start_5f
    move-object/from16 v0, p0

    iput-boolean v3, v0, Lrx/internal/operators/s;->bTk:Z

    .line 801
    monitor-exit p0
    :try_end_64
    .catchall {:try_start_5f .. :try_end_64} :catchall_223

    :cond_64
    throw v2

    .line 624
    :cond_65
    if-lez v7, :cond_6e

    .line 625
    if-eqz v11, :cond_a4

    .line 626
    const-wide v4, 0x7fffffffffffffffL

    .line 631
    :cond_6e
    :goto_6e
    const-wide/16 v12, 0x0

    cmp-long v7, v4, v12

    if-eqz v7, :cond_76

    if-nez v6, :cond_26

    :cond_76
    move-wide v6, v4

    move v5, v2

    .line 643
    :try_start_78
    move-object/from16 v0, p0

    iget-boolean v2, v0, Lrx/internal/operators/s;->done:Z

    .line 646
    move-object/from16 v0, p0

    iget-object v4, v0, Lrx/internal/operators/s;->queue:Ljava/util/Queue;

    .line 648
    move-object/from16 v0, p0

    iget-object v15, v0, Lrx/internal/operators/s;->caV:[Lrx/internal/operators/r;

    .line 649
    array-length v0, v15

    move/from16 v16, v0

    .line 653
    if-eqz v2, :cond_b2

    if-eqz v4, :cond_91

    invoke-interface {v4}, Ljava/util/Queue;->isEmpty()Z

    move-result v2

    if-eqz v2, :cond_b2

    :cond_91
    if-nez v16, :cond_b2

    .line 654
    move-object/from16 v0, p0

    iget-object v2, v0, Lrx/internal/operators/s;->caS:Ljava/util/concurrent/ConcurrentLinkedQueue;

    .line 655
    if-eqz v2, :cond_9f

    invoke-interface {v2}, Ljava/util/Queue;->isEmpty()Z

    move-result v2

    if-eqz v2, :cond_ad

    .line 656
    :cond_9f
    invoke-virtual {v14}, Lrx/o;->SG()V

    goto/16 :goto_b

    .line 628
    :cond_a4
    move-object/from16 v0, p0

    iget-object v4, v0, Lrx/internal/operators/s;->caR:Lrx/internal/operators/OperatorMerge$MergeProducer;

    invoke-virtual {v4, v7}, Lrx/internal/operators/OperatorMerge$MergeProducer;->produced(I)J

    move-result-wide v4

    goto :goto_6e

    .line 658
    :cond_ad
    invoke-direct/range {p0 .. p0}, Lrx/internal/operators/s;->ST()V

    goto/16 :goto_b

    .line 664
    :cond_b2
    const/4 v4, 0x0

    .line 665
    if-lez v16, :cond_229

    .line 667
    move-object/from16 v0, p0

    iget-wide v12, v0, Lrx/internal/operators/s;->lastId:J

    .line 668
    move-object/from16 v0, p0

    iget v2, v0, Lrx/internal/operators/s;->lastIndex:I

    .line 672
    move/from16 v0, v16

    if-le v0, v2, :cond_c9

    aget-object v8, v15, v2

    iget-wide v8, v8, Lrx/internal/operators/r;->id:J

    cmp-long v8, v8, v12

    if-eqz v8, :cond_f3

    .line 673
    :cond_c9
    move/from16 v0, v16

    if-gt v0, v2, :cond_ce

    .line 674
    const/4 v2, 0x0

    .line 678
    :cond_ce
    const/4 v8, 0x0

    :goto_cf
    move/from16 v0, v16

    if-ge v8, v0, :cond_e7

    .line 679
    aget-object v9, v15, v2

    iget-wide v0, v9, Lrx/internal/operators/r;->id:J

    move-wide/from16 v18, v0

    cmp-long v9, v18, v12

    if-eqz v9, :cond_e7

    .line 683
    add-int/lit8 v2, v2, 0x1

    .line 684
    move/from16 v0, v16

    if-ne v2, v0, :cond_e4

    .line 685
    const/4 v2, 0x0

    .line 678
    :cond_e4
    add-int/lit8 v8, v8, 0x1

    goto :goto_cf

    .line 691
    :cond_e7
    move-object/from16 v0, p0

    iput v2, v0, Lrx/internal/operators/s;->lastIndex:I

    .line 692
    aget-object v8, v15, v2

    iget-wide v8, v8, Lrx/internal/operators/r;->id:J

    move-object/from16 v0, p0

    iput-wide v8, v0, Lrx/internal/operators/s;->lastId:J

    .line 697
    :cond_f3
    const/4 v8, 0x0

    move v9, v8

    move v8, v2

    move/from16 v20, v5

    move-wide/from16 v21, v6

    move/from16 v7, v20

    move v6, v4

    move-wide/from16 v4, v21

    :goto_ff
    move/from16 v0, v16

    if-ge v9, v0, :cond_1f0

    .line 699
    invoke-direct/range {p0 .. p0}, Lrx/internal/operators/s;->checkTerminate()Z

    move-result v2

    if-nez v2, :cond_b

    .line 704
    aget-object v17, v15, v8

    .line 706
    const/4 v2, 0x0

    .line 708
    :cond_10c
    const/4 v10, 0x0

    .line 709
    :goto_10d
    const-wide/16 v12, 0x0

    cmp-long v12, v4, v12

    if-lez v12, :cond_147

    .line 711
    invoke-direct/range {p0 .. p0}, Lrx/internal/operators/s;->checkTerminate()Z

    move-result v12

    if-nez v12, :cond_b

    .line 715
    move-object/from16 v0, v17

    iget-object v12, v0, Lrx/internal/operators/r;->caO:Lrx/internal/util/c;

    .line 716
    if-eqz v12, :cond_147

    .line 719
    invoke-virtual {v12}, Lrx/internal/util/c;->poll()Ljava/lang/Object;

    move-result-object v2

    .line 720
    if-eqz v2, :cond_147

    .line 723
    invoke-static {v2}, Lrx/internal/operators/NotificationLite;->getValue(Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_128
    .catchall {:try_start_78 .. :try_end_128} :catchall_5a

    move-result-object v12

    .line 726
    :try_start_129
    invoke-virtual {v14, v12}, Lrx/o;->onNext(Ljava/lang/Object;)V
    :try_end_12c
    .catch Ljava/lang/Throwable; {:try_start_129 .. :try_end_12c} :catch_135
    .catchall {:try_start_129 .. :try_end_12c} :catchall_5a

    .line 737
    const-wide/16 v12, 0x1

    sub-long v12, v4, v12

    .line 738
    add-int/lit8 v4, v10, 0x1

    move v10, v4

    move-wide v4, v12

    .line 739
    goto :goto_10d

    .line 727
    :catch_135
    move-exception v2

    .line 728
    const/4 v3, 0x1

    .line 729
    :try_start_137
    invoke-static {v2}, Lrx/exceptions/d;->throwIfFatal(Ljava/lang/Throwable;)V
    :try_end_13a
    .catchall {:try_start_137 .. :try_end_13a} :catchall_5a

    .line 731
    :try_start_13a
    invoke-virtual {v14, v2}, Lrx/o;->onError(Ljava/lang/Throwable;)V
    :try_end_13d
    .catchall {:try_start_13a .. :try_end_13d} :catchall_142

    .line 733
    :try_start_13d
    invoke-virtual/range {p0 .. p0}, Lrx/internal/operators/s;->unsubscribe()V

    goto/16 :goto_b

    :catchall_142
    move-exception v2

    invoke-virtual/range {p0 .. p0}, Lrx/internal/operators/s;->unsubscribe()V

    throw v2

    .line 740
    :cond_147
    if-lez v10, :cond_159

    .line 741
    if-nez v11, :cond_1ba

    .line 742
    move-object/from16 v0, p0

    iget-object v4, v0, Lrx/internal/operators/s;->caR:Lrx/internal/operators/OperatorMerge$MergeProducer;

    invoke-virtual {v4, v10}, Lrx/internal/operators/OperatorMerge$MergeProducer;->produced(I)J

    move-result-wide v4

    .line 746
    :goto_153
    int-to-long v12, v10

    move-object/from16 v0, v17

    invoke-virtual {v0, v12, v13}, Lrx/internal/operators/r;->af(J)V

    .line 749
    :cond_159
    const-wide/16 v12, 0x0

    cmp-long v10, v4, v12

    if-eqz v10, :cond_161

    if-nez v2, :cond_10c

    .line 753
    :cond_161
    move-object/from16 v0, v17

    iget-boolean v2, v0, Lrx/internal/operators/r;->done:Z

    .line 754
    move-object/from16 v0, v17

    iget-object v10, v0, Lrx/internal/operators/r;->caO:Lrx/internal/util/c;

    .line 755
    if-eqz v2, :cond_1a7

    if-eqz v10, :cond_173

    invoke-virtual {v10}, Lrx/internal/util/c;->isEmpty()Z

    move-result v2

    if-eqz v2, :cond_1a7

    .line 7296
    :cond_173
    move-object/from16 v0, v17

    iget-object v2, v0, Lrx/internal/operators/r;->caO:Lrx/internal/util/c;

    .line 7297
    if-eqz v2, :cond_17c

    .line 7298
    invoke-virtual {v2}, Lrx/internal/util/c;->release()V

    .line 7302
    :cond_17c
    move-object/from16 v0, p0

    iget-object v2, v0, Lrx/internal/operators/s;->ahX:Lrx/g/b;

    move-object/from16 v0, v17

    invoke-virtual {v2, v0}, Lrx/g/b;->e(Lrx/p;)V

    .line 7303
    move-object/from16 v0, p0

    iget-object v10, v0, Lrx/internal/operators/s;->caU:Ljava/lang/Object;

    monitor-enter v10
    :try_end_18a
    .catchall {:try_start_13d .. :try_end_18a} :catchall_5a

    .line 7304
    :try_start_18a
    move-object/from16 v0, p0

    iget-object v12, v0, Lrx/internal/operators/s;->caV:[Lrx/internal/operators/r;

    .line 7305
    array-length v13, v12

    .line 7306
    const/4 v6, -0x1

    .line 7308
    const/4 v2, 0x0

    :goto_191
    if-ge v2, v13, :cond_226

    .line 7309
    aget-object v18, v12, v2

    invoke-virtual/range {v17 .. v18}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v18

    if-eqz v18, :cond_1c0

    .line 7314
    :goto_19b
    if-gez v2, :cond_1c3

    .line 7315
    monitor-exit v10
    :try_end_19e
    .catchall {:try_start_18a .. :try_end_19e} :catchall_1ce

    .line 757
    :goto_19e
    :try_start_19e
    invoke-direct/range {p0 .. p0}, Lrx/internal/operators/s;->checkTerminate()Z
    :try_end_1a1
    .catchall {:try_start_19e .. :try_end_1a1} :catchall_5a

    move-result v2

    if-nez v2, :cond_b

    .line 761
    add-int/lit8 v7, v7, 0x1

    .line 762
    const/4 v6, 0x1

    .line 765
    :cond_1a7
    const-wide/16 v12, 0x0

    cmp-long v2, v4, v12

    if-eqz v2, :cond_1f0

    .line 770
    add-int/lit8 v2, v8, 0x1

    .line 771
    move/from16 v0, v16

    if-ne v2, v0, :cond_1b4

    .line 772
    const/4 v2, 0x0

    .line 697
    :cond_1b4
    add-int/lit8 v8, v9, 0x1

    move v9, v8

    move v8, v2

    goto/16 :goto_ff

    .line 744
    :cond_1ba
    const-wide v4, 0x7fffffffffffffffL

    goto :goto_153

    .line 7308
    :cond_1c0
    add-int/lit8 v2, v2, 0x1

    goto :goto_191

    .line 7317
    :cond_1c3
    const/4 v6, 0x1

    if-ne v13, v6, :cond_1d1

    .line 7318
    :try_start_1c6
    sget-object v2, Lrx/internal/operators/s;->caW:[Lrx/internal/operators/r;

    move-object/from16 v0, p0

    iput-object v2, v0, Lrx/internal/operators/s;->caV:[Lrx/internal/operators/r;

    .line 7319
    monitor-exit v10

    goto :goto_19e

    .line 7325
    :catchall_1ce
    move-exception v2

    monitor-exit v10
    :try_end_1d0
    .catchall {:try_start_1c6 .. :try_end_1d0} :catchall_1ce

    :try_start_1d0
    throw v2
    :try_end_1d1
    .catchall {:try_start_1d0 .. :try_end_1d1} :catchall_5a

    .line 7321
    :cond_1d1
    add-int/lit8 v6, v13, -0x1

    :try_start_1d3
    new-array v6, v6, [Lrx/internal/operators/r;

    .line 7322
    const/16 v17, 0x0

    const/16 v18, 0x0

    move/from16 v0, v17

    move/from16 v1, v18

    invoke-static {v12, v0, v6, v1, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 7323
    add-int/lit8 v17, v2, 0x1

    sub-int/2addr v13, v2

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

    move/from16 v0, v17

    invoke-static {v12, v0, v6, v2, v13}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 7324
    move-object/from16 v0, p0

    iput-object v6, v0, Lrx/internal/operators/s;->caV:[Lrx/internal/operators/r;

    .line 7325
    monitor-exit v10
    :try_end_1ef
    .catchall {:try_start_1d3 .. :try_end_1ef} :catchall_1ce

    goto :goto_19e

    :cond_1f0
    move v2, v6

    move v4, v7

    .line 776
    :try_start_1f2
    move-object/from16 v0, p0

    iput v8, v0, Lrx/internal/operators/s;->lastIndex:I

    .line 777
    aget-object v5, v15, v8

    iget-wide v6, v5, Lrx/internal/operators/r;->id:J

    move-object/from16 v0, p0

    iput-wide v6, v0, Lrx/internal/operators/s;->lastId:J

    .line 780
    :goto_1fe
    if-lez v4, :cond_206

    .line 781
    int-to-long v4, v4

    move-object/from16 v0, p0

    invoke-virtual {v0, v4, v5}, Lrx/internal/operators/s;->request(J)V

    .line 784
    :cond_206
    if-nez v2, :cond_5

    .line 788
    monitor-enter p0
    :try_end_209
    .catchall {:try_start_1f2 .. :try_end_209} :catchall_5a

    .line 789
    :try_start_209
    move-object/from16 v0, p0

    iget-boolean v2, v0, Lrx/internal/operators/s;->caT:Z

    if-nez v2, :cond_21b

    .line 790
    const/4 v3, 0x1

    .line 791
    const/4 v2, 0x0

    move-object/from16 v0, p0

    iput-boolean v2, v0, Lrx/internal/operators/s;->bTk:Z

    .line 792
    monitor-exit p0

    goto/16 :goto_b

    .line 795
    :catchall_218
    move-exception v2

    monitor-exit p0
    :try_end_21a
    .catchall {:try_start_209 .. :try_end_21a} :catchall_218

    :try_start_21a
    throw v2
    :try_end_21b
    .catchall {:try_start_21a .. :try_end_21b} :catchall_5a

    .line 794
    :cond_21b
    const/4 v2, 0x0

    :try_start_21c
    move-object/from16 v0, p0

    iput-boolean v2, v0, Lrx/internal/operators/s;->caT:Z

    .line 795
    monitor-exit p0
    :try_end_221
    .catchall {:try_start_21c .. :try_end_221} :catchall_218

    goto/16 :goto_5

    .line 801
    :catchall_223
    move-exception v2

    :try_start_224
    monitor-exit p0
    :try_end_225
    .catchall {:try_start_224 .. :try_end_225} :catchall_223

    throw v2

    :cond_226
    move v2, v6

    goto/16 :goto_19b

    :cond_229
    move v2, v4

    move v4, v5

    goto :goto_1fe
.end method

.method public final SG()V
    .registers 2

    .prologue
    .line 280
    const/4 v0, 0x1

    iput-boolean v0, p0, Lrx/internal/operators/s;->done:Z

    .line 281
    invoke-virtual {p0}, Lrx/internal/operators/s;->emit()V

    .line 282
    return-void
.end method

.method final SR()Ljava/util/Queue;
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Queue",
            "<",
            "Ljava/lang/Throwable;",
            ">;"
        }
    .end annotation

    .prologue
    .line 204
    iget-object v0, p0, Lrx/internal/operators/s;->caS:Ljava/util/concurrent/ConcurrentLinkedQueue;

    .line 205
    if-nez v0, :cond_11

    .line 206
    monitor-enter p0

    .line 207
    :try_start_5
    iget-object v0, p0, Lrx/internal/operators/s;->caS:Ljava/util/concurrent/ConcurrentLinkedQueue;

    .line 208
    if-nez v0, :cond_10

    .line 209
    new-instance v0, Ljava/util/concurrent/ConcurrentLinkedQueue;

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

    .line 210
    iput-object v0, p0, Lrx/internal/operators/s;->caS:Ljava/util/concurrent/ConcurrentLinkedQueue;

    .line 212
    :cond_10
    monitor-exit p0

    .line 214
    :cond_11
    return-object v0

    .line 212
    :catchall_12
    move-exception v0

    monitor-exit p0
    :try_end_14
    .catchall {:try_start_5 .. :try_end_14} :catchall_12

    throw v0
.end method

.method final emit()V
    .registers 2

    .prologue
    .line 561
    monitor-enter p0

    .line 562
    :try_start_1
    iget-boolean v0, p0, Lrx/internal/operators/s;->bTk:Z

    if-eqz v0, :cond_a

    .line 563
    const/4 v0, 0x1

    iput-boolean v0, p0, Lrx/internal/operators/s;->caT:Z

    .line 564
    monitor-exit p0

    .line 569
    :goto_9
    return-void

    .line 566
    :cond_a
    const/4 v0, 0x1

    iput-boolean v0, p0, Lrx/internal/operators/s;->bTk:Z

    .line 567
    monitor-exit p0
    :try_end_e
    .catchall {:try_start_1 .. :try_end_e} :catchall_12

    .line 568
    invoke-virtual {p0}, Lrx/internal/operators/s;->Qd()V

    goto :goto_9

    .line 567
    :catchall_12
    move-exception v0

    :try_start_13
    monitor-exit p0
    :try_end_14
    .catchall {:try_start_13 .. :try_end_14} :catchall_12

    throw v0
.end method

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

    .prologue
    .line 274
    invoke-virtual {p0}, Lrx/internal/operators/s;->SR()Ljava/util/Queue;

    move-result-object v0

    invoke-interface {v0, p1}, Ljava/util/Queue;->offer(Ljava/lang/Object;)Z

    .line 275
    const/4 v0, 0x1

    iput-boolean v0, p0, Lrx/internal/operators/s;->done:Z

    .line 276
    invoke-virtual {p0}, Lrx/internal/operators/s;->emit()V

    .line 277
    return-void
.end method

.method public final bridge synthetic onNext(Ljava/lang/Object;)V
    .registers 2

    .prologue
    .line 148
    check-cast p1, Lrx/e;

    invoke-virtual {p0, p1}, Lrx/internal/operators/s;->onNext(Lrx/e;)V

    return-void
.end method

.method public final onNext(Lrx/e;)V
    .registers 10
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lrx/e",
            "<+TT;>;)V"
        }
    .end annotation

    .prologue
    const-wide/16 v6, 0x0

    const/4 v2, 0x1

    const/4 v1, 0x0

    .line 237
    if-nez p1, :cond_7

    .line 4547
    :goto_6
    return-void

    .line 2787
    :cond_7
    invoke-static {}, Lrx/internal/operators/EmptyObservableHolder;->instance()Lrx/e;

    move-result-object v0

    .line 240
    if-ne p1, v0, :cond_1f

    .line 3254
    iget v0, p0, Lrx/internal/operators/s;->caY:I

    add-int/lit8 v0, v0, 0x1

    .line 3255
    iget v2, p0, Lrx/internal/operators/s;->caX:I

    if-ne v0, v2, :cond_1c

    .line 3256
    iput v1, p0, Lrx/internal/operators/s;->caY:I

    .line 3257
    int-to-long v0, v0

    .line 3437
    invoke-virtual {p0, v0, v1}, Lrx/internal/operators/s;->request(J)V

    goto :goto_6

    .line 3259
    :cond_1c
    iput v0, p0, Lrx/internal/operators/s;->caY:I

    goto :goto_6

    .line 243
    :cond_1f
    instance-of v0, p1, Lrx/internal/util/ScalarSynchronousObservable;

    if-eqz v0, :cond_bb

    .line 244
    check-cast p1, Lrx/internal/util/ScalarSynchronousObservable;

    .line 4085
    iget-object v3, p1, Lrx/internal/util/ScalarSynchronousObservable;->bPR:Ljava/lang/Object;

    .line 4452
    iget-object v0, p0, Lrx/internal/operators/s;->caR:Lrx/internal/operators/OperatorMerge$MergeProducer;

    invoke-virtual {v0}, Lrx/internal/operators/OperatorMerge$MergeProducer;->get()J

    move-result-wide v4

    .line 4453
    cmp-long v0, v4, v6

    if-eqz v0, :cond_f0

    .line 4454
    monitor-enter p0

    .line 4456
    :try_start_32
    iget-object v0, p0, Lrx/internal/operators/s;->caR:Lrx/internal/operators/OperatorMerge$MergeProducer;

    invoke-virtual {v0}, Lrx/internal/operators/OperatorMerge$MergeProducer;->get()J

    move-result-wide v4

    .line 4457
    iget-boolean v0, p0, Lrx/internal/operators/s;->bTk:Z

    if-nez v0, :cond_ed

    cmp-long v0, v4, v6

    if-eqz v0, :cond_ed

    .line 4458
    const/4 v0, 0x1

    iput-boolean v0, p0, Lrx/internal/operators/s;->bTk:Z

    move v0, v2

    .line 4461
    :goto_44
    monitor-exit p0
    :try_end_45
    .catchall {:try_start_32 .. :try_end_45} :catchall_8b

    .line 4463
    :goto_45
    if-eqz v0, :cond_b3

    .line 4464
    iget-object v0, p0, Lrx/internal/operators/s;->queue:Ljava/util/Queue;

    .line 4465
    if-eqz v0, :cond_51

    invoke-interface {v0}, Ljava/util/Queue;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_ab

    .line 4511
    :cond_51
    :try_start_51
    iget-object v0, p0, Lrx/internal/operators/s;->child:Lrx/o;

    invoke-virtual {v0, v3}, Lrx/o;->onNext(Ljava/lang/Object;)V
    :try_end_56
    .catch Ljava/lang/Throwable; {:try_start_51 .. :try_end_56} :catch_8e
    .catchall {:try_start_51 .. :try_end_56} :catchall_9d

    .line 4522
    const-wide v6, 0x7fffffffffffffffL

    cmp-long v0, v4, v6

    if-eqz v0, :cond_65

    .line 4523
    :try_start_5f
    iget-object v0, p0, Lrx/internal/operators/s;->caR:Lrx/internal/operators/OperatorMerge$MergeProducer;

    const/4 v3, 0x1

    invoke-virtual {v0, v3}, Lrx/internal/operators/OperatorMerge$MergeProducer;->produced(I)J

    .line 4526
    :cond_65
    iget v0, p0, Lrx/internal/operators/s;->caY:I

    add-int/lit8 v0, v0, 0x1

    .line 4527
    iget v3, p0, Lrx/internal/operators/s;->caX:I

    if-ne v0, v3, :cond_9a

    .line 4528
    const/4 v3, 0x0

    iput v3, p0, Lrx/internal/operators/s;->caY:I

    .line 4529
    int-to-long v4, v0

    .line 5437
    invoke-virtual {p0, v4, v5}, Lrx/internal/operators/s;->request(J)V

    .line 4535
    :goto_74
    monitor-enter p0
    :try_end_75
    .catchall {:try_start_5f .. :try_end_75} :catchall_9d

    .line 4537
    :try_start_75
    iget-boolean v0, p0, Lrx/internal/operators/s;->caT:Z

    if-nez v0, :cond_9f

    .line 4538
    const/4 v0, 0x0

    iput-boolean v0, p0, Lrx/internal/operators/s;->bTk:Z

    .line 4539
    monitor-exit p0

    goto :goto_6

    .line 4542
    :catchall_7e
    move-exception v0

    monitor-exit p0
    :try_end_80
    .catchall {:try_start_75 .. :try_end_80} :catchall_7e

    :try_start_80
    throw v0
    :try_end_81
    .catchall {:try_start_80 .. :try_end_81} :catchall_81

    .line 4544
    :catchall_81
    move-exception v0

    move v1, v2

    :goto_83
    if-nez v1, :cond_8a

    .line 4545
    monitor-enter p0

    .line 4546
    const/4 v1, 0x0

    :try_start_87
    iput-boolean v1, p0, Lrx/internal/operators/s;->bTk:Z

    .line 4547
    monitor-exit p0
    :try_end_8a
    .catchall {:try_start_87 .. :try_end_8a} :catchall_a8

    :cond_8a
    throw v0

    .line 4461
    :catchall_8b
    move-exception v0

    :try_start_8c
    monitor-exit p0
    :try_end_8d
    .catchall {:try_start_8c .. :try_end_8d} :catchall_8b

    throw v0

    .line 4512
    :catch_8e
    move-exception v0

    .line 4514
    :try_start_8f
    invoke-static {v0}, Lrx/exceptions/d;->throwIfFatal(Ljava/lang/Throwable;)V
    :try_end_92
    .catchall {:try_start_8f .. :try_end_92} :catchall_9d

    .line 4516
    :try_start_92
    invoke-virtual {p0}, Lrx/internal/operators/s;->unsubscribe()V

    .line 4517
    invoke-virtual {p0, v0}, Lrx/internal/operators/s;->onError(Ljava/lang/Throwable;)V
    :try_end_98
    .catchall {:try_start_92 .. :try_end_98} :catchall_81

    goto/16 :goto_6

    .line 4531
    :cond_9a
    :try_start_9a
    iput v0, p0, Lrx/internal/operators/s;->caY:I
    :try_end_9c
    .catchall {:try_start_9a .. :try_end_9c} :catchall_9d

    goto :goto_74

    .line 4544
    :catchall_9d
    move-exception v0

    goto :goto_83

    .line 4541
    :cond_9f
    const/4 v0, 0x0

    :try_start_a0
    iput-boolean v0, p0, Lrx/internal/operators/s;->caT:Z

    .line 4542
    monitor-exit p0
    :try_end_a3
    .catchall {:try_start_a0 .. :try_end_a3} :catchall_7e

    .line 4557
    invoke-virtual {p0}, Lrx/internal/operators/s;->Qd()V

    goto/16 :goto_6

    .line 4547
    :catchall_a8
    move-exception v0

    :try_start_a9
    monitor-exit p0
    :try_end_aa
    .catchall {:try_start_a9 .. :try_end_aa} :catchall_a8

    throw v0

    .line 4468
    :cond_ab
    invoke-direct {p0, v3}, Lrx/internal/operators/s;->aP(Ljava/lang/Object;)V

    .line 4469
    invoke-virtual {p0}, Lrx/internal/operators/s;->Qd()V

    goto/16 :goto_6

    .line 4472
    :cond_b3
    invoke-direct {p0, v3}, Lrx/internal/operators/s;->aP(Ljava/lang/Object;)V

    .line 4473
    invoke-virtual {p0}, Lrx/internal/operators/s;->emit()V

    goto/16 :goto_6

    .line 246
    :cond_bb
    new-instance v0, Lrx/internal/operators/r;

    iget-wide v2, p0, Lrx/internal/operators/s;->uniqueId:J

    const-wide/16 v4, 0x1

    add-long/2addr v4, v2

    iput-wide v4, p0, Lrx/internal/operators/s;->uniqueId:J

    invoke-direct {v0, p0, v2, v3}, Lrx/internal/operators/r;-><init>(Lrx/internal/operators/s;J)V

    .line 6285
    invoke-direct {p0}, Lrx/internal/operators/s;->SS()Lrx/g/b;

    move-result-object v1

    invoke-virtual {v1, v0}, Lrx/g/b;->add(Lrx/p;)V

    .line 6286
    iget-object v1, p0, Lrx/internal/operators/s;->caU:Ljava/lang/Object;

    monitor-enter v1

    .line 6287
    :try_start_d1
    iget-object v2, p0, Lrx/internal/operators/s;->caV:[Lrx/internal/operators/r;

    .line 6288
    array-length v3, v2

    .line 6289
    add-int/lit8 v4, v3, 0x1

    new-array v4, v4, [Lrx/internal/operators/r;

    .line 6290
    const/4 v5, 0x0

    const/4 v6, 0x0

    invoke-static {v2, v5, v4, v6, v3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 6291
    aput-object v0, v4, v3

    .line 6292
    iput-object v4, p0, Lrx/internal/operators/s;->caV:[Lrx/internal/operators/r;

    .line 6293
    monitor-exit v1
    :try_end_e2
    .catchall {:try_start_d1 .. :try_end_e2} :catchall_ea

    .line 248
    invoke-virtual {p1, v0}, Lrx/e;->a(Lrx/o;)Lrx/p;

    .line 249
    invoke-virtual {p0}, Lrx/internal/operators/s;->emit()V

    goto/16 :goto_6

    .line 6293
    :catchall_ea
    move-exception v0

    :try_start_eb
    monitor-exit v1
    :try_end_ec
    .catchall {:try_start_eb .. :try_end_ec} :catchall_ea

    throw v0

    :cond_ed
    move v0, v1

    goto/16 :goto_44

    :cond_f0
    move-wide v4, v6

    move v0, v1

    goto/16 :goto_45
.end method