.class public final Lha/m;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lha/z;


# instance fields
.field public r:B

.field public final s:Lha/t;

.field public final t:Ljava/util/zip/Inflater;

.field public final u:Lha/n;

.field public final v:Ljava/util/zip/CRC32;


# direct methods
.method public constructor <init>(Lha/z;)V
    .registers 4

    const-string v0, "source"

    invoke-static {p1, v0}, Lx/e;->f(Ljava/lang/Object;Ljava/lang/String;)V

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

    new-instance v0, Lha/t;

    invoke-direct {v0, p1}, Lha/t;-><init>(Lha/z;)V

    iput-object v0, p0, Lha/m;->s:Lha/t;

    new-instance p1, Ljava/util/zip/Inflater;

    const/4 v1, 0x1

    invoke-direct {p1, v1}, Ljava/util/zip/Inflater;-><init>(Z)V

    iput-object p1, p0, Lha/m;->t:Ljava/util/zip/Inflater;

    new-instance v1, Lha/n;

    invoke-direct {v1, v0, p1}, Lha/n;-><init>(Lha/h;Ljava/util/zip/Inflater;)V

    iput-object v1, p0, Lha/m;->u:Lha/n;

    new-instance p1, Ljava/util/zip/CRC32;

    invoke-direct {p1}, Ljava/util/zip/CRC32;-><init>()V

    iput-object p1, p0, Lha/m;->v:Ljava/util/zip/CRC32;

    return-void
.end method


# virtual methods
.method public final b(Ljava/lang/String;II)V
    .registers 8

    if-ne p3, p2, :cond_3

    return-void

    :cond_3
    new-instance v0, Ljava/io/IOException;

    const/4 v1, 0x3

    new-array v2, v1, [Ljava/lang/Object;

    const/4 v3, 0x0

    aput-object p1, v2, v3

    const/4 p1, 0x1

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

    move-result-object p3

    aput-object p3, v2, p1

    const/4 p1, 0x2

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

    move-result-object p2

    aput-object p2, v2, p1

    invoke-static {v2, v1}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;

    move-result-object p1

    const-string p2, "%s: actual 0x%08x != expected 0x%08x"

    invoke-static {p2, p1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    const-string p2, "java.lang.String.format(this, *args)"

    invoke-static {p1, p2}, Lx/e;->e(Ljava/lang/Object;Ljava/lang/String;)V

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

    throw v0
.end method

.method public close()V
    .registers 2

    iget-object v0, p0, Lha/m;->u:Lha/n;

    invoke-virtual {v0}, Lha/n;->close()V

    return-void
.end method

.method public d()Lha/a0;
    .registers 2

    iget-object v0, p0, Lha/m;->s:Lha/t;

    invoke-virtual {v0}, Lha/t;->d()Lha/a0;

    move-result-object v0

    return-object v0
.end method

.method public final e(Lha/e;JJ)V
    .registers 10

    iget-object p1, p1, Lha/e;->r:Lha/u;

    :goto_2
    invoke-static {p1}, Lx/e;->d(Ljava/lang/Object;)V

    iget v0, p1, Lha/u;->c:I

    iget v1, p1, Lha/u;->b:I

    sub-int v2, v0, v1

    int-to-long v2, v2

    cmp-long v2, p2, v2

    if-ltz v2, :cond_16

    sub-int/2addr v0, v1

    int-to-long v0, v0

    sub-long/2addr p2, v0

    iget-object p1, p1, Lha/u;->f:Lha/u;

    goto :goto_2

    :cond_16
    const-wide/16 v0, 0x0

    :goto_18
    cmp-long v2, p4, v0

    if-lez v2, :cond_3a

    iget v2, p1, Lha/u;->b:I

    int-to-long v2, v2

    add-long/2addr v2, p2

    long-to-int p2, v2

    iget p3, p1, Lha/u;->c:I

    sub-int/2addr p3, p2

    int-to-long v2, p3

    invoke-static {v2, v3, p4, p5}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v2

    long-to-int p3, v2

    iget-object v2, p0, Lha/m;->v:Ljava/util/zip/CRC32;

    iget-object v3, p1, Lha/u;->a:[B

    invoke-virtual {v2, v3, p2, p3}, Ljava/util/zip/CRC32;->update([BII)V

    int-to-long p2, p3

    sub-long/2addr p4, p2

    iget-object p1, p1, Lha/u;->f:Lha/u;

    invoke-static {p1}, Lx/e;->d(Ljava/lang/Object;)V

    move-wide p2, v0

    goto :goto_18

    :cond_3a
    return-void
.end method

.method public x(Lha/e;J)J
    .registers 28

    move-object/from16 v6, p0

    move-object/from16 v7, p1

    move-wide/from16 v8, p2

    const-string v0, "sink"

    invoke-static {v7, v0}, Lx/e;->f(Ljava/lang/Object;Ljava/lang/String;)V

    const-wide/16 v0, 0x0

    cmp-long v2, v8, v0

    const/4 v10, 0x0

    const/4 v11, 0x1

    if-ltz v2, :cond_15

    move v3, v11

    goto :goto_16

    :cond_15
    move v3, v10

    :goto_16
    if-eqz v3, :cond_19a

    if-nez v2, :cond_1b

    return-wide v0

    :cond_1b
    iget-byte v0, v6, Lha/m;->r:B

    const-wide/16 v12, -0x1

    if-nez v0, :cond_141

    .line 1
    iget-object v0, v6, Lha/m;->s:Lha/t;

    const-wide/16 v1, 0xa

    invoke-virtual {v0, v1, v2}, Lha/t;->N(J)V

    iget-object v0, v6, Lha/m;->s:Lha/t;

    iget-object v0, v0, Lha/t;->r:Lha/e;

    const-wide/16 v1, 0x3

    invoke-virtual {v0, v1, v2}, Lha/e;->q(J)B

    move-result v14

    shr-int/lit8 v0, v14, 0x1

    and-int/2addr v0, v11

    if-ne v0, v11, :cond_39

    move v15, v11

    goto :goto_3a

    :cond_39
    move v15, v10

    :goto_3a
    if-eqz v15, :cond_49

    iget-object v0, v6, Lha/m;->s:Lha/t;

    iget-object v1, v0, Lha/t;->r:Lha/e;

    const-wide/16 v2, 0x0

    const-wide/16 v4, 0xa

    move-object/from16 v0, p0

    invoke-virtual/range {v0 .. v5}, Lha/m;->e(Lha/e;JJ)V

    :cond_49
    iget-object v0, v6, Lha/m;->s:Lha/t;

    const-wide/16 v1, 0x2

    .line 2
    invoke-virtual {v0, v1, v2}, Lha/t;->N(J)V

    iget-object v0, v0, Lha/t;->r:Lha/e;

    invoke-virtual {v0}, Lha/e;->readShort()S

    move-result v0

    const/16 v3, 0x1f8b

    const-string v4, "ID1ID2"

    .line 3
    invoke-virtual {v6, v4, v3, v0}, Lha/m;->b(Ljava/lang/String;II)V

    iget-object v0, v6, Lha/m;->s:Lha/t;

    const-wide/16 v3, 0x8

    invoke-virtual {v0, v3, v4}, Lha/t;->a(J)V

    shr-int/lit8 v0, v14, 0x2

    and-int/2addr v0, v11

    if-ne v0, v11, :cond_6b

    move v0, v11

    goto :goto_6c

    :cond_6b
    move v0, v10

    :goto_6c
    if-eqz v0, :cond_a9

    iget-object v0, v6, Lha/m;->s:Lha/t;

    invoke-virtual {v0, v1, v2}, Lha/t;->N(J)V

    if-eqz v15, :cond_82

    iget-object v0, v6, Lha/m;->s:Lha/t;

    iget-object v1, v0, Lha/t;->r:Lha/e;

    const-wide/16 v2, 0x0

    const-wide/16 v4, 0x2

    move-object/from16 v0, p0

    invoke-virtual/range {v0 .. v5}, Lha/m;->e(Lha/e;JJ)V

    :cond_82
    iget-object v0, v6, Lha/m;->s:Lha/t;

    iget-object v0, v0, Lha/t;->r:Lha/e;

    invoke-virtual {v0}, Lha/e;->P()S

    move-result v0

    int-to-long v4, v0

    iget-object v0, v6, Lha/m;->s:Lha/t;

    invoke-virtual {v0, v4, v5}, Lha/t;->N(J)V

    if-eqz v15, :cond_a0

    iget-object v0, v6, Lha/m;->s:Lha/t;

    iget-object v1, v0, Lha/t;->r:Lha/e;

    const-wide/16 v2, 0x0

    move-object/from16 v0, p0

    move-wide/from16 v16, v4

    invoke-virtual/range {v0 .. v5}, Lha/m;->e(Lha/e;JJ)V

    goto :goto_a2

    :cond_a0
    move-wide/from16 v16, v4

    :goto_a2
    iget-object v0, v6, Lha/m;->s:Lha/t;

    move-wide/from16 v1, v16

    invoke-virtual {v0, v1, v2}, Lha/t;->a(J)V

    :cond_a9
    shr-int/lit8 v0, v14, 0x3

    and-int/2addr v0, v11

    if-ne v0, v11, :cond_b0

    move v0, v11

    goto :goto_b1

    :cond_b0
    move v0, v10

    :goto_b1
    const-wide/16 v16, 0x1

    if-eqz v0, :cond_e7

    iget-object v0, v6, Lha/m;->s:Lha/t;

    const/16 v19, 0x0

    const-wide/16 v20, 0x0

    const-wide v22, 0x7fffffffffffffffL

    move-object/from16 v18, v0

    .line 4
    invoke-virtual/range {v18 .. v23}, Lha/t;->b(BJJ)J

    move-result-wide v18

    cmp-long v0, v18, v12

    if-eqz v0, :cond_e1

    if-eqz v15, :cond_d9

    .line 5
    iget-object v0, v6, Lha/m;->s:Lha/t;

    iget-object v1, v0, Lha/t;->r:Lha/e;

    const-wide/16 v2, 0x0

    add-long v4, v18, v16

    move-object/from16 v0, p0

    invoke-virtual/range {v0 .. v5}, Lha/m;->e(Lha/e;JJ)V

    :cond_d9
    iget-object v0, v6, Lha/m;->s:Lha/t;

    add-long v1, v18, v16

    invoke-virtual {v0, v1, v2}, Lha/t;->a(J)V

    goto :goto_e7

    :cond_e1
    new-instance v0, Ljava/io/EOFException;

    invoke-direct {v0}, Ljava/io/EOFException;-><init>()V

    throw v0

    :cond_e7
    :goto_e7
    shr-int/lit8 v0, v14, 0x4

    and-int/2addr v0, v11

    if-ne v0, v11, :cond_ed

    move v10, v11

    :cond_ed
    if-eqz v10, :cond_11e

    iget-object v0, v6, Lha/m;->s:Lha/t;

    const/4 v1, 0x0

    const-wide/16 v2, 0x0

    const-wide v4, 0x7fffffffffffffffL

    .line 6
    invoke-virtual/range {v0 .. v5}, Lha/t;->b(BJJ)J

    move-result-wide v18

    cmp-long v0, v18, v12

    if-eqz v0, :cond_118

    if-eqz v15, :cond_110

    .line 7
    iget-object v0, v6, Lha/m;->s:Lha/t;

    iget-object v1, v0, Lha/t;->r:Lha/e;

    const-wide/16 v2, 0x0

    add-long v4, v18, v16

    move-object/from16 v0, p0

    invoke-virtual/range {v0 .. v5}, Lha/m;->e(Lha/e;JJ)V

    :cond_110
    iget-object v0, v6, Lha/m;->s:Lha/t;

    add-long v1, v18, v16

    invoke-virtual {v0, v1, v2}, Lha/t;->a(J)V

    goto :goto_11e

    :cond_118
    new-instance v0, Ljava/io/EOFException;

    invoke-direct {v0}, Ljava/io/EOFException;-><init>()V

    throw v0

    :cond_11e
    :goto_11e
    if-eqz v15, :cond_13f

    iget-object v0, v6, Lha/m;->s:Lha/t;

    const-wide/16 v1, 0x2

    .line 8
    invoke-virtual {v0, v1, v2}, Lha/t;->N(J)V

    iget-object v0, v0, Lha/t;->r:Lha/e;

    invoke-virtual {v0}, Lha/e;->P()S

    move-result v0

    .line 9
    iget-object v1, v6, Lha/m;->v:Ljava/util/zip/CRC32;

    invoke-virtual {v1}, Ljava/util/zip/CRC32;->getValue()J

    move-result-wide v1

    long-to-int v1, v1

    int-to-short v1, v1

    const-string v2, "FHCRC"

    invoke-virtual {v6, v2, v0, v1}, Lha/m;->b(Ljava/lang/String;II)V

    iget-object v0, v6, Lha/m;->v:Ljava/util/zip/CRC32;

    invoke-virtual {v0}, Ljava/util/zip/CRC32;->reset()V

    .line 10
    :cond_13f
    iput-byte v11, v6, Lha/m;->r:B

    :cond_141
    iget-byte v0, v6, Lha/m;->r:B

    const/4 v1, 0x2

    if-ne v0, v11, :cond_15d

    .line 11
    iget-wide v2, v7, Lha/e;->s:J

    .line 12
    iget-object v0, v6, Lha/m;->u:Lha/n;

    invoke-virtual {v0, v7, v8, v9}, Lha/n;->x(Lha/e;J)J

    move-result-wide v8

    cmp-long v0, v8, v12

    if-eqz v0, :cond_15b

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-wide v4, v8

    invoke-virtual/range {v0 .. v5}, Lha/m;->e(Lha/e;JJ)V

    return-wide v8

    :cond_15b
    iput-byte v1, v6, Lha/m;->r:B

    :cond_15d
    iget-byte v0, v6, Lha/m;->r:B

    if-ne v0, v1, :cond_199

    .line 13
    iget-object v0, v6, Lha/m;->s:Lha/t;

    invoke-virtual {v0}, Lha/t;->e()I

    move-result v0

    iget-object v1, v6, Lha/m;->v:Ljava/util/zip/CRC32;

    invoke-virtual {v1}, Ljava/util/zip/CRC32;->getValue()J

    move-result-wide v1

    long-to-int v1, v1

    const-string v2, "CRC"

    invoke-virtual {v6, v2, v0, v1}, Lha/m;->b(Ljava/lang/String;II)V

    iget-object v0, v6, Lha/m;->s:Lha/t;

    invoke-virtual {v0}, Lha/t;->e()I

    move-result v0

    iget-object v1, v6, Lha/m;->t:Ljava/util/zip/Inflater;

    invoke-virtual {v1}, Ljava/util/zip/Inflater;->getBytesWritten()J

    move-result-wide v1

    long-to-int v1, v1

    const-string v2, "ISIZE"

    invoke-virtual {v6, v2, v0, v1}, Lha/m;->b(Ljava/lang/String;II)V

    const/4 v0, 0x3

    .line 14
    iput-byte v0, v6, Lha/m;->r:B

    iget-object v0, v6, Lha/m;->s:Lha/t;

    invoke-virtual {v0}, Lha/t;->v()Z

    move-result v0

    if-eqz v0, :cond_191

    goto :goto_199

    :cond_191
    new-instance v0, Ljava/io/IOException;

    const-string v1, "gzip finished without exhausting source"

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

    throw v0

    :cond_199
    :goto_199
    return-wide v12

    :cond_19a
    const-string v0, "byteCount < 0: "

    invoke-static {v0, v8, v9}, Lv0/a;->a(Ljava/lang/String;J)Ljava/lang/String;

    move-result-object v0

    new-instance v1, Ljava/lang/IllegalArgumentException;

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

    move-result-object v0

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

    throw v1
.end method
