b$c.smali

.class public final Lwp/b$c;
.super Lwp/b$b;
.source "FlowableCreate.java"


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

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

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


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

.field public d:Ljava/lang/Throwable;

.field public volatile e:Z

.field public final f:Ljava/util/concurrent/atomic/AtomicInteger;


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

    return-void
.end method

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

    invoke-direct {p0, p1}, Lwp/b$b;-><init>(Lmq/b;)V

    new-instance p1, Lzp/b;

    invoke-direct {p1, p2}, Lzp/b;-><init>(I)V

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

    new-instance p1, Ljava/util/concurrent/atomic/AtomicInteger;

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

    iput-object p1, p0, Lwp/b$c;->f:Ljava/util/concurrent/atomic/AtomicInteger;

    return-void
.end method


# virtual methods
.method public c()V
    .registers 1

    invoke-virtual {p0}, Lwp/b$c;->e()V

    return-void
.end method

.method public c(Ljava/lang/Throwable;)Z
    .registers 3

    iget-boolean v0, p0, Lwp/b$c;->e:Z

    if-nez v0, :cond_1d

    invoke-virtual {p0}, Lwp/b$b;->b()Z

    move-result v0

    if-eqz v0, :cond_b

    goto :goto_1d

    :cond_b
    if-nez p1, :cond_14

    new-instance p1, Ljava/lang/NullPointerException;

    const-string v0, "onError called with null. Null values are generally not allowed in 2.x operators and sources."

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

    :cond_14
    iput-object p1, p0, Lwp/b$c;->d:Ljava/lang/Throwable;

    const/4 p1, 0x1

    iput-boolean p1, p0, Lwp/b$c;->e:Z

    invoke-virtual {p0}, Lwp/b$c;->e()V

    return p1

    :cond_1d
    :goto_1d
    const/4 p1, 0x0

    return p1
.end method

.method public d()V
    .registers 2

    iget-object v0, p0, Lwp/b$c;->f:Ljava/util/concurrent/atomic/AtomicInteger;

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

    move-result v0

    if-nez v0, :cond_d

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

    invoke-virtual {v0}, Lzp/b;->clear()V

    :cond_d
    return-void
.end method

.method public e()V
    .registers 14

    iget-object v0, p0, Lwp/b$c;->f:Ljava/util/concurrent/atomic/AtomicInteger;

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

    move-result v0

    if-eqz v0, :cond_9

    return-void

    :cond_9
    iget-object v0, p0, Lwp/b$b;->a:Lmq/b;

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

    const/4 v2, 0x1

    const/4 v3, 0x1

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

    move-result-wide v4

    const-wide/16 v6, 0x0

    move-wide v8, v6

    :goto_16
    cmp-long v10, v8, v4

    if-eqz v10, :cond_49

    invoke-virtual {p0}, Lwp/b$b;->b()Z

    move-result v10

    if-eqz v10, :cond_24

    invoke-virtual {v1}, Lzp/b;->clear()V

    return-void

    :cond_24
    iget-boolean v10, p0, Lwp/b$c;->e:Z

    invoke-virtual {v1}, Lzp/b;->poll()Ljava/lang/Object;

    move-result-object v11

    if-nez v11, :cond_2e

    const/4 v12, 0x1

    goto :goto_2f

    :cond_2e
    const/4 v12, 0x0

    :goto_2f
    if-eqz v10, :cond_3f

    if-eqz v12, :cond_3f

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

    if-eqz v0, :cond_3b

    invoke-virtual {p0, v0}, Lwp/b$b;->a(Ljava/lang/Throwable;)Z

    goto :goto_3e

    :cond_3b
    invoke-virtual {p0}, Lwp/b$b;->a()V

    :goto_3e
    return-void

    :cond_3f
    if-eqz v12, :cond_42

    goto :goto_49

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

    const-wide/16 v10, 0x1

    add-long/2addr v8, v10

    goto :goto_16

    :cond_49
    :goto_49
    cmp-long v10, v8, v4

    if-nez v10, :cond_6d

    invoke-virtual {p0}, Lwp/b$b;->b()Z

    move-result v4

    if-eqz v4, :cond_57

    invoke-virtual {v1}, Lzp/b;->clear()V

    return-void

    :cond_57
    iget-boolean v4, p0, Lwp/b$c;->e:Z

    invoke-virtual {v1}, Lzp/b;->isEmpty()Z

    move-result v5

    if-eqz v4, :cond_6d

    if-eqz v5, :cond_6d

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

    if-eqz v0, :cond_69

    invoke-virtual {p0, v0}, Lwp/b$b;->a(Ljava/lang/Throwable;)Z

    goto :goto_6c

    :cond_69
    invoke-virtual {p0}, Lwp/b$b;->a()V

    :goto_6c
    return-void

    :cond_6d
    cmp-long v4, v8, v6

    if-eqz v4, :cond_74

    invoke-static {p0, v8, v9}, Ldq/a;->b(Ljava/util/concurrent/atomic/AtomicLong;J)J

    :cond_74
    iget-object v4, p0, Lwp/b$c;->f:Ljava/util/concurrent/atomic/AtomicInteger;

    neg-int v3, v3

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

    move-result v3

    if-nez v3, :cond_f

    return-void
.end method

.method public onComplete()V
    .registers 2

    const/4 v0, 0x1

    iput-boolean v0, p0, Lwp/b$c;->e:Z

    invoke-virtual {p0}, Lwp/b$c;->e()V

    return-void
.end method

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

    iget-boolean v0, p0, Lwp/b$c;->e:Z

    if-nez v0, :cond_20

    invoke-virtual {p0}, Lwp/b$b;->b()Z

    move-result v0

    if-eqz v0, :cond_b

    goto :goto_20

    :cond_b
    if-nez p1, :cond_18

    new-instance p1, Ljava/lang/NullPointerException;

    const-string v0, "onNext called with null. Null values are generally not allowed in 2.x operators and sources."

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

    invoke-virtual {p0, p1}, Lwp/b$b;->b(Ljava/lang/Throwable;)V

    return-void

    :cond_18
    iget-object v0, p0, Lwp/b$c;->c:Lzp/b;

    invoke-virtual {v0, p1}, Lzp/b;->offer(Ljava/lang/Object;)Z

    invoke-virtual {p0}, Lwp/b$c;->e()V

    :cond_20
    :goto_20
    return-void
.end method