m.smali

.class public Lcom/carrotsearch/hppc/m;
.super Lcom/carrotsearch/hppc/a;
.source "SourceFile"

# interfaces
.implements Lcom/carrotsearch/hppc/q;
.implements Ljava/lang/Cloneable;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/carrotsearch/hppc/m$a;
    }
.end annotation


# static fields
.field static final synthetic e:Z


# instance fields
.field public a:[I

.field public b:I

.field public c:I

.field protected final d:Lcom/carrotsearch/hppc/e;


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

    .line 15
    const-class v0, Lcom/carrotsearch/hppc/m;

    invoke-virtual {v0}, Ljava/lang/Class;->desiredAssertionStatus()Z

    move-result v0

    xor-int/lit8 v0, v0, 0x1

    sput-boolean v0, Lcom/carrotsearch/hppc/m;->e:Z

    return-void
.end method

.method public constructor <init>()V
    .registers 2

    const/4 v0, 0x4

    .line 52
    invoke-direct {p0, v0}, Lcom/carrotsearch/hppc/m;-><init>(I)V

    return-void
.end method

.method public constructor <init>(I)V
    .registers 3

    .line 63
    new-instance v0, Lcom/carrotsearch/hppc/h;

    invoke-direct {v0}, Lcom/carrotsearch/hppc/h;-><init>()V

    invoke-direct {p0, p1, v0}, Lcom/carrotsearch/hppc/m;-><init>(ILcom/carrotsearch/hppc/e;)V

    return-void
.end method

.method public constructor <init>(ILcom/carrotsearch/hppc/e;)V
    .registers 4

    .line 76
    invoke-direct {p0}, Lcom/carrotsearch/hppc/a;-><init>()V

    .line 26
    sget-object v0, Lcom/carrotsearch/hppc/n;->a:[I

    iput-object v0, p0, Lcom/carrotsearch/hppc/m;->a:[I

    .line 77
    sget-boolean v0, Lcom/carrotsearch/hppc/m;->e:Z

    if-nez v0, :cond_14

    if-eqz p2, :cond_e

    goto :goto_14

    :cond_e
    new-instance p1, Ljava/lang/AssertionError;

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

    throw p1

    .line 78
    :cond_14
    :goto_14
    iput-object p2, p0, Lcom/carrotsearch/hppc/m;->d:Lcom/carrotsearch/hppc/e;

    .line 1468
    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->d()I

    move-result p2

    sub-int/2addr p1, p2

    invoke-direct {p0, p1}, Lcom/carrotsearch/hppc/m;->b(I)V

    return-void
.end method

.method public constructor <init>(Lcom/carrotsearch/hppc/p;)V
    .registers 3

    .line 87
    invoke-interface {p1}, Lcom/carrotsearch/hppc/p;->d()I

    move-result v0

    invoke-direct {p0, v0}, Lcom/carrotsearch/hppc/m;-><init>(I)V

    .line 2197
    invoke-interface {p1}, Lcom/carrotsearch/hppc/p;->d()I

    move-result v0

    .line 2198
    invoke-direct {p0, v0}, Lcom/carrotsearch/hppc/m;->b(I)V

    .line 2200
    invoke-interface {p1}, Lcom/carrotsearch/hppc/p;->iterator()Ljava/util/Iterator;

    move-result-object p1

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

    move-result v0

    if-eqz v0, :cond_24

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

    move-result-object v0

    check-cast v0, Lcom/carrotsearch/hppc/a/a;

    .line 2201
    iget v0, v0, Lcom/carrotsearch/hppc/a/a;->b:I

    invoke-virtual {p0, v0}, Lcom/carrotsearch/hppc/m;->a(I)V

    goto :goto_12

    :cond_24
    return-void
.end method

.method protected static a(II)I
    .registers 2

    if-lez p0, :cond_5

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

    return p0

    :cond_5
    add-int/lit8 p1, p1, -0x1

    return p1
.end method

.method private a([I)[I
    .registers 6

    .line 522
    sget-boolean v0, Lcom/carrotsearch/hppc/m;->e:Z

    if-nez v0, :cond_24

    array-length v0, p1

    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->d()I

    move-result v1

    if-lt v0, v1, :cond_c

    goto :goto_24

    :cond_c
    new-instance p1, Ljava/lang/AssertionError;

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Target array must be >= "

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

    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->d()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

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

    throw p1

    .line 524
    :cond_24
    :goto_24
    iget v0, p0, Lcom/carrotsearch/hppc/m;->b:I

    iget v1, p0, Lcom/carrotsearch/hppc/m;->c:I

    const/4 v2, 0x0

    if-ge v0, v1, :cond_35

    .line 526
    iget-object v1, p0, Lcom/carrotsearch/hppc/m;->a:[I

    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->d()I

    move-result v3

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

    goto :goto_45

    :cond_35
    if-le v0, v1, :cond_45

    .line 530
    iget-object v1, p0, Lcom/carrotsearch/hppc/m;->a:[I

    array-length v3, v1

    sub-int/2addr v3, v0

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

    .line 532
    iget-object v0, p0, Lcom/carrotsearch/hppc/m;->a:[I

    iget v1, p0, Lcom/carrotsearch/hppc/m;->c:I

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

    :cond_45
    :goto_45
    return-object p1
.end method

.method protected static b(II)I
    .registers 2

    add-int/lit8 p0, p0, 0x1

    if-ne p0, p1, :cond_5

    const/4 p0, 0x0

    :cond_5
    return p0
.end method

.method private b(I)V
    .registers 7

    .line 476
    iget-object v0, p0, Lcom/carrotsearch/hppc/m;->a:[I

    array-length v0, v0

    .line 477
    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->d()I

    move-result v1

    add-int v2, v1, p1

    if-lt v2, v0, :cond_60

    .line 481
    iget-object v3, p0, Lcom/carrotsearch/hppc/m;->d:Lcom/carrotsearch/hppc/e;

    add-int/lit8 v4, v1, 0x1

    invoke-interface {v3, v0, v4, p1}, Lcom/carrotsearch/hppc/e;->a(III)I

    move-result p1

    .line 482
    sget-boolean v3, Lcom/carrotsearch/hppc/m;->e:Z

    if-nez v3, :cond_38

    add-int/lit8 v3, v2, 0x1

    if-lt p1, v3, :cond_1c

    goto :goto_38

    :cond_1c
    new-instance v0, Ljava/lang/AssertionError;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v3, "Resizer failed to return sensible new size: "

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

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string p1, " <= "

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

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

    throw v0

    :cond_38
    :goto_38
    const/4 v2, 0x0

    .line 486
    :try_start_39
    new-array v3, p1, [I

    if-lez v0, :cond_44

    .line 488
    invoke-direct {p0, v3}, Lcom/carrotsearch/hppc/m;->a([I)[I

    .line 489
    iput v1, p0, Lcom/carrotsearch/hppc/m;->c:I

    .line 490
    iput v2, p0, Lcom/carrotsearch/hppc/m;->b:I

    .line 492
    :cond_44
    iput-object v3, p0, Lcom/carrotsearch/hppc/m;->a:[I
    :try_end_46
    .catch Ljava/lang/OutOfMemoryError; {:try_start_39 .. :try_end_46} :catch_47

    return-void

    :catch_47
    move-exception v1

    .line 494
    new-instance v3, Lcom/carrotsearch/hppc/BufferAllocationException;

    const/4 v4, 0x2

    new-array v4, v4, [Ljava/lang/Object;

    .line 496
    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    aput-object v0, v4, v2

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    const/4 v0, 0x1

    aput-object p1, v4, v0

    const-string p1, "Not enough memory to allocate new buffers: %,d -> %,d"

    invoke-direct {v3, p1, v1, v4}, Lcom/carrotsearch/hppc/BufferAllocationException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V

    throw v3

    :cond_60
    return-void
.end method

.method private e()Lcom/carrotsearch/hppc/m;
    .registers 3

    .line 546
    :try_start_0
    invoke-super {p0}, Ljava/lang/Object;->clone()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/carrotsearch/hppc/m;

    .line 547
    iget-object v1, p0, Lcom/carrotsearch/hppc/m;->a:[I

    invoke-virtual {v1}, [I->clone()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, [I

    iput-object v1, v0, Lcom/carrotsearch/hppc/m;->a:[I
    :try_end_10
    .catch Ljava/lang/CloneNotSupportedException; {:try_start_0 .. :try_end_10} :catch_11

    return-object v0

    :catch_11
    move-exception v0

    .line 550
    new-instance v1, Ljava/lang/RuntimeException;

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

    throw v1
.end method


# virtual methods
.method public final a(I)V
    .registers 5

    .line 161
    iget v0, p0, Lcom/carrotsearch/hppc/m;->c:I

    iget-object v1, p0, Lcom/carrotsearch/hppc/m;->a:[I

    array-length v1, v1

    invoke-static {v0, v1}, Lcom/carrotsearch/hppc/m;->b(II)I

    move-result v0

    .line 162
    iget v1, p0, Lcom/carrotsearch/hppc/m;->b:I

    if-ne v1, v0, :cond_1a

    const/4 v0, 0x1

    .line 163
    invoke-direct {p0, v0}, Lcom/carrotsearch/hppc/m;->b(I)V

    .line 164
    iget v0, p0, Lcom/carrotsearch/hppc/m;->c:I

    iget-object v1, p0, Lcom/carrotsearch/hppc/m;->a:[I

    array-length v1, v1

    invoke-static {v0, v1}, Lcom/carrotsearch/hppc/m;->b(II)I

    move-result v0

    .line 166
    :cond_1a
    iget-object v1, p0, Lcom/carrotsearch/hppc/m;->a:[I

    iget v2, p0, Lcom/carrotsearch/hppc/m;->c:I

    aput p1, v1, v2

    .line 167
    iput v0, p0, Lcom/carrotsearch/hppc/m;->c:I

    return-void
.end method

.method public final a()[I
    .registers 2

    .line 508
    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->d()I

    move-result v0

    .line 509
    new-array v0, v0, [I

    invoke-direct {p0, v0}, Lcom/carrotsearch/hppc/m;->a([I)[I

    move-result-object v0

    return-object v0
.end method

.method public final b()I
    .registers 5

    .line 229
    sget-boolean v0, Lcom/carrotsearch/hppc/m;->e:Z

    if-nez v0, :cond_13

    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->d()I

    move-result v0

    if-lez v0, :cond_b

    goto :goto_13

    :cond_b
    new-instance v0, Ljava/lang/AssertionError;

    const-string v1, "The deque is empty."

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

    throw v0

    .line 231
    :cond_13
    :goto_13
    iget-object v0, p0, Lcom/carrotsearch/hppc/m;->a:[I

    iget v1, p0, Lcom/carrotsearch/hppc/m;->b:I

    aget v2, v0, v1

    const/4 v3, 0x0

    .line 232
    aput v3, v0, v1

    .line 233
    array-length v0, v0

    invoke-static {v1, v0}, Lcom/carrotsearch/hppc/m;->b(II)I

    move-result v0

    iput v0, p0, Lcom/carrotsearch/hppc/m;->b:I

    return v2
.end method

.method public final c()Z
    .registers 2

    .line 415
    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->d()I

    move-result v0

    if-nez v0, :cond_8

    const/4 v0, 0x1

    return v0

    :cond_8
    const/4 v0, 0x0

    return v0
.end method

.method public synthetic clone()Ljava/lang/Object;
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/CloneNotSupportedException;
        }
    .end annotation

    .line 15
    invoke-direct {p0}, Lcom/carrotsearch/hppc/m;->e()Lcom/carrotsearch/hppc/m;

    move-result-object v0

    return-object v0
.end method

.method public final d()I
    .registers 3

    .line 423
    iget v0, p0, Lcom/carrotsearch/hppc/m;->b:I

    iget v1, p0, Lcom/carrotsearch/hppc/m;->c:I

    if-gt v0, v1, :cond_8

    sub-int/2addr v1, v0

    return v1

    :cond_8
    sub-int/2addr v1, v0

    .line 426
    iget-object v0, p0, Lcom/carrotsearch/hppc/m;->a:[I

    array-length v0, v0

    add-int/2addr v1, v0

    return v1
.end method

.method public equals(Ljava/lang/Object;)Z
    .registers 7

    const/4 v0, 0x0

    if-eqz p1, :cond_5b

    .line 834
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2

    if-ne v1, v2, :cond_5b

    .line 835
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/Class;->cast(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/carrotsearch/hppc/m;

    .line 3842
    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->d()I

    move-result v1

    .line 3843
    invoke-virtual {p1}, Lcom/carrotsearch/hppc/m;->d()I

    move-result v2

    const/4 v3, 0x1

    if-ne v2, v1, :cond_57

    .line 3847
    invoke-virtual {p0}, Lcom/carrotsearch/hppc/m;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 3848
    invoke-virtual {p1}, Lcom/carrotsearch/hppc/m;->iterator()Ljava/util/Iterator;

    move-result-object p1

    .line 3850
    :cond_2a
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_49

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

    move-result v2

    if-eqz v2, :cond_49

    .line 3851
    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/carrotsearch/hppc/a/a;

    iget v2, v2, Lcom/carrotsearch/hppc/a/a;->b:I

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

    move-result-object v4

    check-cast v4, Lcom/carrotsearch/hppc/a/a;

    iget v4, v4, Lcom/carrotsearch/hppc/a/a;->b:I

    if-eq v2, v4, :cond_2a

    goto :goto_57

    .line 3856
    :cond_49
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-nez v1, :cond_57

    .line 3857
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result p1

    if-nez p1, :cond_57

    const/4 p1, 0x1

    goto :goto_58

    :cond_57
    :goto_57
    const/4 p1, 0x0

    :goto_58
    if-eqz p1, :cond_5b

    return v3

    :cond_5b
    return v0
.end method

.method public hashCode()I
    .registers 6

    .line 816
    iget v0, p0, Lcom/carrotsearch/hppc/m;->b:I

    .line 817
    iget v1, p0, Lcom/carrotsearch/hppc/m;->c:I

    .line 819
    iget-object v2, p0, Lcom/carrotsearch/hppc/m;->a:[I

    const/4 v3, 0x1

    :goto_7
    if-eq v0, v1, :cond_1a

    mul-int/lit8 v3, v3, 0x1f

    .line 821
    iget-object v4, p0, Lcom/carrotsearch/hppc/m;->a:[I

    aget v4, v4, v0

    .line 3020
    invoke-static {v4}, Lcom/carrotsearch/hppc/f;->a(I)I

    move-result v4

    add-int/2addr v3, v4

    .line 820
    array-length v4, v2

    invoke-static {v0, v4}, Lcom/carrotsearch/hppc/m;->b(II)I

    move-result v0

    goto :goto_7

    :cond_1a
    return v3
.end method

.method public iterator()Ljava/util/Iterator;
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Iterator<",
            "Lcom/carrotsearch/hppc/a/a;",
            ">;"
        }
    .end annotation

    .line 638
    new-instance v0, Lcom/carrotsearch/hppc/m$a;

    invoke-direct {v0, p0}, Lcom/carrotsearch/hppc/m$a;-><init>(Lcom/carrotsearch/hppc/m;)V

    return-object v0
.end method

.method public bridge synthetic toString()Ljava/lang/String;
    .registers 2

    .line 15
    invoke-super {p0}, Lcom/carrotsearch/hppc/a;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method