h.smali

.class public final Lio/reactivex/internal/operators/observable/h;
.super Lio/reactivex/l;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lio/reactivex/internal/operators/observable/h$b;,
        Lio/reactivex/internal/operators/observable/h$a;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lio/reactivex/l<",
        "TT;>;"
    }
.end annotation


# instance fields
.field public final a:[Lio/reactivex/q;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "[",
            "Lio/reactivex/q<",
            "+TT;>;"
        }
    .end annotation
.end field

.field public final b:Ljava/lang/Iterable;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/Iterable<",
            "+",
            "Lio/reactivex/q<",
            "+TT;>;>;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>([Lio/reactivex/q;Ljava/lang/Iterable;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "([",
            "Lio/reactivex/q<",
            "+TT;>;",
            "Ljava/lang/Iterable<",
            "+",
            "Lio/reactivex/q<",
            "+TT;>;>;)V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Lio/reactivex/l;-><init>()V

    .line 2
    iput-object p1, p0, Lio/reactivex/internal/operators/observable/h;->a:[Lio/reactivex/q;

    .line 3
    iput-object p2, p0, Lio/reactivex/internal/operators/observable/h;->b:Ljava/lang/Iterable;

    return-void
.end method


# virtual methods
.method public final subscribeActual(Lio/reactivex/s;)V
    .registers 10
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lio/reactivex/s<",
            "-TT;>;)V"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/h;->a:[Lio/reactivex/q;

    const/4 v1, 0x0

    if-nez v0, :cond_43

    const/16 v0, 0x8

    new-array v0, v0, [Lio/reactivex/l;

    .line 2
    :try_start_9
    iget-object v2, p0, Lio/reactivex/internal/operators/observable/h;->b:Ljava/lang/Iterable;

    invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object v2

    const/4 v3, 0x0

    :goto_10
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_44

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lio/reactivex/q;

    if-nez v4, :cond_29

    .line 3
    new-instance v0, Ljava/lang/NullPointerException;

    const-string v1, "One of the sources is null"

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

    invoke-static {v0, p1}, Lio/reactivex/internal/disposables/d;->error(Ljava/lang/Throwable;Lio/reactivex/s;)V

    return-void

    .line 4
    :cond_29
    array-length v5, v0

    if-ne v3, v5, :cond_35

    shr-int/lit8 v5, v3, 0x2

    add-int/2addr v5, v3

    .line 5
    new-array v5, v5, [Lio/reactivex/q;

    .line 6
    invoke-static {v0, v1, v5, v1, v3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    move-object v0, v5

    :cond_35
    add-int/lit8 v5, v3, 0x1

    .line 7
    aput-object v4, v0, v3
    :try_end_39
    .catchall {:try_start_9 .. :try_end_39} :catchall_3b

    move v3, v5

    goto :goto_10

    :catchall_3b
    move-exception v0

    .line 8
    invoke-static {v0}, Lcom/shopee/app/dre/codepush/task/a;->m(Ljava/lang/Throwable;)V

    .line 9
    invoke-static {v0, p1}, Lio/reactivex/internal/disposables/d;->error(Ljava/lang/Throwable;Lio/reactivex/s;)V

    return-void

    .line 10
    :cond_43
    array-length v3, v0

    :cond_44
    if-nez v3, :cond_4a

    .line 11
    invoke-static {p1}, Lio/reactivex/internal/disposables/d;->complete(Lio/reactivex/s;)V

    return-void

    :cond_4a
    const/4 v2, 0x1

    if-ne v3, v2, :cond_53

    .line 12
    aget-object v0, v0, v1

    invoke-interface {v0, p1}, Lio/reactivex/q;->subscribe(Lio/reactivex/s;)V

    return-void

    .line 13
    :cond_53
    new-instance v2, Lio/reactivex/internal/operators/observable/h$a;

    invoke-direct {v2, p1, v3}, Lio/reactivex/internal/operators/observable/h$a;-><init>(Lio/reactivex/s;I)V

    .line 14
    iget-object p1, v2, Lio/reactivex/internal/operators/observable/h$a;->b:[Lio/reactivex/internal/operators/observable/h$b;

    .line 15
    array-length v3, p1

    const/4 v4, 0x0

    :goto_5c
    if-ge v4, v3, :cond_6b

    .line 16
    new-instance v5, Lio/reactivex/internal/operators/observable/h$b;

    add-int/lit8 v6, v4, 0x1

    iget-object v7, v2, Lio/reactivex/internal/operators/observable/h$a;->a:Lio/reactivex/s;

    invoke-direct {v5, v2, v6, v7}, Lio/reactivex/internal/operators/observable/h$b;-><init>(Lio/reactivex/internal/operators/observable/h$a;ILio/reactivex/s;)V

    aput-object v5, p1, v4

    move v4, v6

    goto :goto_5c

    .line 17
    :cond_6b
    iget-object v4, v2, Lio/reactivex/internal/operators/observable/h$a;->c:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {v4, v1}, Ljava/util/concurrent/atomic/AtomicInteger;->lazySet(I)V

    .line 18
    iget-object v4, v2, Lio/reactivex/internal/operators/observable/h$a;->a:Lio/reactivex/s;

    invoke-interface {v4, v2}, Lio/reactivex/s;->onSubscribe(Lio/reactivex/disposables/b;)V

    :goto_75
    if-ge v1, v3, :cond_8a

    .line 19
    iget-object v4, v2, Lio/reactivex/internal/operators/observable/h$a;->c:Ljava/util/concurrent/atomic/AtomicInteger;

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

    move-result v4

    if-eqz v4, :cond_80

    goto :goto_8a

    .line 20
    :cond_80
    aget-object v4, v0, v1

    aget-object v5, p1, v1

    invoke-interface {v4, v5}, Lio/reactivex/q;->subscribe(Lio/reactivex/s;)V

    add-int/lit8 v1, v1, 0x1

    goto :goto_75

    :cond_8a
    :goto_8a
    return-void
.end method