b$f.smali

.class public final Lwp/b$f;
.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 = "f"
.end annotation

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


# instance fields
.field public final c:Ljava/util/concurrent/atomic/AtomicReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/atomic/AtomicReference<",
            "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;)V
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lmq/b<",
            "-TT;>;)V"
        }
    .end annotation

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

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

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

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

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

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

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

    return-void
.end method


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

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

    return-void
.end method

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

    iget-boolean v0, p0, Lwp/b$f;->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_17

    new-instance v0, Ljava/lang/NullPointerException;

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

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

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

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

    const/4 p1, 0x1

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

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

    return p1

    :cond_20
    :goto_20
    const/4 p1, 0x0

    return p1
.end method

.method public d()V
    .registers 3

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

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

    move-result v0

    if-nez v0, :cond_e

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

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V

    :cond_e
    return-void
.end method

.method public e()V
    .registers 16

    iget-object v0, p0, Lwp/b$f;->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$f;->c:Ljava/util/concurrent/atomic/AtomicReference;

    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
    const/4 v10, 0x0

    const/4 v11, 0x0

    cmp-long v12, v8, v4

    if-eqz v12, :cond_4b

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

    move-result v12

    if-eqz v12, :cond_26

    invoke-virtual {v1, v11}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V

    return-void

    :cond_26
    iget-boolean v12, p0, Lwp/b$f;->e:Z

    invoke-virtual {v1, v11}, Ljava/util/concurrent/atomic/AtomicReference;->getAndSet(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v13

    if-nez v13, :cond_30

    const/4 v14, 0x1

    goto :goto_31

    :cond_30
    const/4 v14, 0x0

    :goto_31
    if-eqz v12, :cond_41

    if-eqz v14, :cond_41

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

    if-eqz v0, :cond_3d

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

    goto :goto_40

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

    :goto_40
    return-void

    :cond_41
    if-eqz v14, :cond_44

    goto :goto_4b

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

    const-wide/16 v10, 0x1

    add-long/2addr v8, v10

    goto :goto_16

    :cond_4b
    :goto_4b
    cmp-long v12, v8, v4

    if-nez v12, :cond_72

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

    move-result v4

    if-eqz v4, :cond_59

    invoke-virtual {v1, v11}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V

    return-void

    :cond_59
    iget-boolean v4, p0, Lwp/b$f;->e:Z

    invoke-virtual {v1}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;

    move-result-object v5

    if-nez v5, :cond_62

    const/4 v10, 0x1

    :cond_62
    if-eqz v4, :cond_72

    if-eqz v10, :cond_72

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

    if-eqz v0, :cond_6e

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

    goto :goto_71

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

    :goto_71
    return-void

    :cond_72
    cmp-long v4, v8, v6

    if-eqz v4, :cond_79

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

    :cond_79
    iget-object v4, p0, Lwp/b$f;->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$f;->e:Z

    invoke-virtual {p0}, Lwp/b$f;->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$f;->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$f;->c:Ljava/util/concurrent/atomic/AtomicReference;

    invoke-virtual {v0, p1}, Ljava/util/concurrent/atomic/AtomicReference;->set(Ljava/lang/Object;)V

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

    :cond_20
    :goto_20
    return-void
.end method