c$c.smali

.class public final Lwp/c$c;
.super Lwp/c$a;
.source "FlowableObserveOn.java"

# interfaces
.implements Lnp/f;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lwp/c;
.end annotation

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

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lwp/c$a<",
        "TT;>;",
        "Lnp/f<",
        "TT;>;"
    }
.end annotation


# instance fields
.field public final n:Lmq/b;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lmq/b<",
            "-TT;>;"
        }
    .end annotation
.end field


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

    return-void
.end method

.method public constructor <init>(Lmq/b;Lnp/l$a;ZI)V
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lmq/b<",
            "-TT;>;",
            "Lnp/l$a;",
            "ZI)V"
        }
    .end annotation

    invoke-direct {p0, p2, p3, p4}, Lwp/c$a;-><init>(Lnp/l$a;ZI)V

    iput-object p1, p0, Lwp/c$c;->n:Lmq/b;

    return-void
.end method


# virtual methods
.method public a()V
    .registers 12

    iget-object v0, p0, Lwp/c$c;->n:Lmq/b;

    iget-object v1, p0, Lwp/c$a;->g:Lvp/f;

    iget-wide v2, p0, Lwp/c$a;->l:J

    const/4 v4, 0x1

    const/4 v5, 0x1

    :cond_8
    :goto_8
    iget-object v6, p0, Lwp/c$a;->e:Ljava/util/concurrent/atomic/AtomicLong;

    invoke-virtual {v6}, Ljava/util/concurrent/atomic/AtomicLong;->get()J

    move-result-wide v6

    :cond_e
    :goto_e
    cmp-long v8, v2, v6

    if-eqz v8, :cond_61

    iget-boolean v8, p0, Lwp/c$a;->i:Z

    :try_start_14
    invoke-interface {v1}, Lvp/f;->poll()Ljava/lang/Object;

    move-result-object v9
    :try_end_18
    .catchall {:try_start_14 .. :try_end_18} :catchall_4c

    if-nez v9, :cond_1c

    const/4 v10, 0x1

    goto :goto_1d

    :cond_1c
    const/4 v10, 0x0

    :goto_1d
    invoke-virtual {p0, v8, v10, v0}, Lwp/c$a;->a(ZZLmq/b;)Z

    move-result v8

    if-eqz v8, :cond_24

    return-void

    :cond_24
    if-eqz v10, :cond_27

    goto :goto_61

    :cond_27
    invoke-interface {v0, v9}, Lmq/b;->onNext(Ljava/lang/Object;)V

    const-wide/16 v8, 0x1

    add-long/2addr v2, v8

    iget v8, p0, Lwp/c$a;->d:I

    int-to-long v8, v8

    cmp-long v10, v2, v8

    if-nez v10, :cond_e

    const-wide v8, 0x7fffffffffffffffL

    cmp-long v10, v6, v8

    if-eqz v10, :cond_44

    iget-object v6, p0, Lwp/c$a;->e:Ljava/util/concurrent/atomic/AtomicLong;

    neg-long v7, v2

    invoke-virtual {v6, v7, v8}, Ljava/util/concurrent/atomic/AtomicLong;->addAndGet(J)J

    move-result-wide v6

    :cond_44
    iget-object v8, p0, Lwp/c$a;->f:Lmq/c;

    invoke-interface {v8, v2, v3}, Lmq/c;->request(J)V

    const-wide/16 v2, 0x0

    goto :goto_e

    :catchall_4c
    move-exception v2

    invoke-static {v2}, Lrp/b;->b(Ljava/lang/Throwable;)V

    iget-object v3, p0, Lwp/c$a;->f:Lmq/c;

    invoke-interface {v3}, Lmq/c;->cancel()V

    invoke-interface {v1}, Lvp/f;->clear()V

    invoke-interface {v0, v2}, Lmq/b;->onError(Ljava/lang/Throwable;)V

    iget-object v0, p0, Lwp/c$a;->a:Lnp/l$a;

    invoke-interface {v0}, Lqp/b;->dispose()V

    return-void

    :cond_61
    :goto_61
    cmp-long v8, v2, v6

    if-nez v8, :cond_72

    iget-boolean v6, p0, Lwp/c$a;->i:Z

    invoke-interface {v1}, Lvp/f;->isEmpty()Z

    move-result v7

    invoke-virtual {p0, v6, v7, v0}, Lwp/c$a;->a(ZZLmq/b;)Z

    move-result v6

    if-eqz v6, :cond_72

    return-void

    :cond_72
    invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I

    move-result v6

    if-ne v5, v6, :cond_82

    iput-wide v2, p0, Lwp/c$a;->l:J

    neg-int v5, v5

    invoke-virtual {p0, v5}, Ljava/util/concurrent/atomic/AtomicInteger;->addAndGet(I)I

    move-result v5

    if-nez v5, :cond_8

    return-void

    :cond_82
    move v5, v6

    goto :goto_8
.end method

.method public b()V
    .registers 5

    const/4 v0, 0x1

    :cond_1
    iget-boolean v1, p0, Lwp/c$a;->h:Z

    if-eqz v1, :cond_6

    return-void

    :cond_6
    iget-boolean v1, p0, Lwp/c$a;->i:Z

    iget-object v2, p0, Lwp/c$c;->n:Lmq/b;

    const/4 v3, 0x0

    invoke-interface {v2, v3}, Lmq/b;->onNext(Ljava/lang/Object;)V

    if-eqz v1, :cond_25

    iget-object v0, p0, Lwp/c$a;->j:Ljava/lang/Throwable;

    if-eqz v0, :cond_1a

    iget-object v1, p0, Lwp/c$c;->n:Lmq/b;

    invoke-interface {v1, v0}, Lmq/b;->onError(Ljava/lang/Throwable;)V

    goto :goto_1f

    :cond_1a
    iget-object v0, p0, Lwp/c$c;->n:Lmq/b;

    invoke-interface {v0}, Lmq/b;->onComplete()V

    :goto_1f
    iget-object v0, p0, Lwp/c$a;->a:Lnp/l$a;

    invoke-interface {v0}, Lqp/b;->dispose()V

    return-void

    :cond_25
    neg-int v0, v0

    invoke-virtual {p0, v0}, Ljava/util/concurrent/atomic/AtomicInteger;->addAndGet(I)I

    move-result v0

    if-nez v0, :cond_1

    return-void
.end method

.method public c()V
    .registers 10

    iget-object v0, p0, Lwp/c$c;->n:Lmq/b;

    iget-object v1, p0, Lwp/c$a;->g:Lvp/f;

    iget-wide v2, p0, Lwp/c$a;->l:J

    const/4 v4, 0x1

    :cond_7
    :goto_7
    iget-object v5, p0, Lwp/c$a;->e:Ljava/util/concurrent/atomic/AtomicLong;

    invoke-virtual {v5}, Ljava/util/concurrent/atomic/AtomicLong;->get()J

    move-result-wide v5

    :goto_d
    cmp-long v7, v2, v5

    if-eqz v7, :cond_3e

    :try_start_11
    invoke-interface {v1}, Lvp/f;->poll()Ljava/lang/Object;

    move-result-object v7
    :try_end_15
    .catchall {:try_start_11 .. :try_end_15} :catchall_2c

    iget-boolean v8, p0, Lwp/c$a;->h:Z

    if-eqz v8, :cond_1a

    return-void

    :cond_1a
    if-nez v7, :cond_25

    invoke-interface {v0}, Lmq/b;->onComplete()V

    iget-object v0, p0, Lwp/c$a;->a:Lnp/l$a;

    invoke-interface {v0}, Lqp/b;->dispose()V

    return-void

    :cond_25
    invoke-interface {v0, v7}, Lmq/b;->onNext(Ljava/lang/Object;)V

    const-wide/16 v7, 0x1

    add-long/2addr v2, v7

    goto :goto_d

    :catchall_2c
    move-exception v1

    invoke-static {v1}, Lrp/b;->b(Ljava/lang/Throwable;)V

    iget-object v2, p0, Lwp/c$a;->f:Lmq/c;

    invoke-interface {v2}, Lmq/c;->cancel()V

    invoke-interface {v0, v1}, Lmq/b;->onError(Ljava/lang/Throwable;)V

    iget-object v0, p0, Lwp/c$a;->a:Lnp/l$a;

    invoke-interface {v0}, Lqp/b;->dispose()V

    return-void

    :cond_3e
    iget-boolean v5, p0, Lwp/c$a;->h:Z

    if-eqz v5, :cond_43

    return-void

    :cond_43
    invoke-interface {v1}, Lvp/f;->isEmpty()Z

    move-result v5

    if-eqz v5, :cond_52

    invoke-interface {v0}, Lmq/b;->onComplete()V

    iget-object v0, p0, Lwp/c$a;->a:Lnp/l$a;

    invoke-interface {v0}, Lqp/b;->dispose()V

    return-void

    :cond_52
    invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I

    move-result v5

    if-ne v4, v5, :cond_62

    iput-wide v2, p0, Lwp/c$a;->l:J

    neg-int v4, v4

    invoke-virtual {p0, v4}, Ljava/util/concurrent/atomic/AtomicInteger;->addAndGet(I)I

    move-result v4

    if-nez v4, :cond_7

    return-void

    :cond_62
    move v4, v5

    goto :goto_7
.end method

.method public onSubscribe(Lmq/c;)V
    .registers 5

    iget-object v0, p0, Lwp/c$a;->f:Lmq/c;

    invoke-static {v0, p1}, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->validate(Lmq/c;Lmq/c;)Z

    move-result v0

    if-eqz v0, :cond_4c

    iput-object p1, p0, Lwp/c$a;->f:Lmq/c;

    instance-of v0, p1, Lvp/d;

    if-eqz v0, :cond_38

    move-object v0, p1

    check-cast v0, Lvp/d;

    const/4 v1, 0x7

    invoke-interface {v0, v1}, Lvp/c;->requestFusion(I)I

    move-result v1

    const/4 v2, 0x1

    if-ne v1, v2, :cond_25

    iput v2, p0, Lwp/c$a;->k:I

    iput-object v0, p0, Lwp/c$a;->g:Lvp/f;

    iput-boolean v2, p0, Lwp/c$a;->i:Z

    iget-object p1, p0, Lwp/c$c;->n:Lmq/b;

    invoke-interface {p1, p0}, Lmq/b;->onSubscribe(Lmq/c;)V

    return-void

    :cond_25
    const/4 v2, 0x2

    if-ne v1, v2, :cond_38

    iput v2, p0, Lwp/c$a;->k:I

    iput-object v0, p0, Lwp/c$a;->g:Lvp/f;

    iget-object v0, p0, Lwp/c$c;->n:Lmq/b;

    invoke-interface {v0, p0}, Lmq/b;->onSubscribe(Lmq/c;)V

    iget v0, p0, Lwp/c$a;->c:I

    int-to-long v0, v0

    invoke-interface {p1, v0, v1}, Lmq/c;->request(J)V

    return-void

    :cond_38
    new-instance v0, Lzp/a;

    iget v1, p0, Lwp/c$a;->c:I

    invoke-direct {v0, v1}, Lzp/a;-><init>(I)V

    iput-object v0, p0, Lwp/c$a;->g:Lvp/f;

    iget-object v0, p0, Lwp/c$c;->n:Lmq/b;

    invoke-interface {v0, p0}, Lmq/b;->onSubscribe(Lmq/c;)V

    iget v0, p0, Lwp/c$a;->c:I

    int-to-long v0, v0

    invoke-interface {p1, v0, v1}, Lmq/c;->request(J)V

    :cond_4c
    return-void
.end method

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

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    iget-object v0, p0, Lwp/c$a;->g:Lvp/f;

    invoke-interface {v0}, Lvp/f;->poll()Ljava/lang/Object;

    move-result-object v0

    if-eqz v0, :cond_25

    iget v1, p0, Lwp/c$a;->k:I

    const/4 v2, 0x1

    if-eq v1, v2, :cond_25

    iget-wide v1, p0, Lwp/c$a;->l:J

    const-wide/16 v3, 0x1

    add-long/2addr v1, v3

    iget v3, p0, Lwp/c$a;->d:I

    int-to-long v3, v3

    cmp-long v5, v1, v3

    if-nez v5, :cond_23

    const-wide/16 v3, 0x0

    iput-wide v3, p0, Lwp/c$a;->l:J

    iget-object v3, p0, Lwp/c$a;->f:Lmq/c;

    invoke-interface {v3, v1, v2}, Lmq/c;->request(J)V

    goto :goto_25

    :cond_23
    iput-wide v1, p0, Lwp/c$a;->l:J

    :cond_25
    :goto_25
    return-object v0
.end method