.class public final Lba/b$c;
.super Lba/b$a;
.source ""


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

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


# instance fields
.field public u:J

.field public v:Z

.field public final w:Lv9/w;

.field public final synthetic x:Lba/b;


# direct methods
.method public constructor <init>(Lba/b;Lv9/w;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lv9/w;",
            ")V"
        }
    .end annotation

    const-string v0, "url"

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

    iput-object p1, p0, Lba/b$c;->x:Lba/b;

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

    iput-object p2, p0, Lba/b$c;->w:Lv9/w;

    const-wide/16 p1, -0x1

    iput-wide p1, p0, Lba/b$c;->u:J

    const/4 p1, 0x1

    iput-boolean p1, p0, Lba/b$c;->v:Z

    return-void
.end method


# virtual methods
.method public close()V
    .registers 3

    .line 1
    iget-boolean v0, p0, Lba/b$a;->s:Z

    if-eqz v0, :cond_5

    return-void

    .line 2
    :cond_5
    iget-boolean v0, p0, Lba/b$c;->v:Z

    if-eqz v0, :cond_1d

    const/16 v0, 0x64

    sget-object v1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-static {p0, v0, v1}, Lw9/c;->h(Lha/z;ILjava/util/concurrent/TimeUnit;)Z

    move-result v0

    if-nez v0, :cond_1d

    iget-object v0, p0, Lba/b$c;->x:Lba/b;

    .line 3
    iget-object v0, v0, Lba/b;->e:Lz9/h;

    .line 4
    invoke-virtual {v0}, Lz9/h;->l()V

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

    :cond_1d
    const/4 v0, 0x1

    .line 5
    iput-boolean v0, p0, Lba/b$a;->s:Z

    return-void
.end method

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

    const-string v0, "sink"

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

    const-wide/16 v0, 0x0

    cmp-long v2, p2, v0

    const/4 v3, 0x0

    const/4 v4, 0x1

    if-ltz v2, :cond_f

    move v2, v4

    goto :goto_10

    :cond_f
    move v2, v3

    :goto_10
    if-eqz v2, :cond_102

    .line 1
    iget-boolean v2, p0, Lba/b$a;->s:Z

    xor-int/2addr v2, v4

    if-eqz v2, :cond_f6

    .line 2
    iget-boolean v2, p0, Lba/b$c;->v:Z

    const-wide/16 v5, -0x1

    if-nez v2, :cond_1e

    return-wide v5

    :cond_1e
    iget-wide v7, p0, Lba/b$c;->u:J

    cmp-long v2, v7, v0

    if-eqz v2, :cond_28

    cmp-long v2, v7, v5

    if-nez v2, :cond_97

    :cond_28
    cmp-long v2, v7, v5

    if-eqz v2, :cond_33

    .line 3
    iget-object v2, p0, Lba/b$c;->x:Lba/b;

    .line 4
    iget-object v2, v2, Lba/b;->f:Lha/h;

    .line 5
    invoke-interface {v2}, Lha/h;->u()Ljava/lang/String;

    :cond_33
    :try_start_33
    iget-object v2, p0, Lba/b$c;->x:Lba/b;

    .line 6
    iget-object v2, v2, Lba/b;->f:Lha/h;

    .line 7
    invoke-interface {v2}, Lha/h;->U()J

    move-result-wide v7

    iput-wide v7, p0, Lba/b$c;->u:J

    iget-object v2, p0, Lba/b$c;->x:Lba/b;

    .line 8
    iget-object v2, v2, Lba/b;->f:Lha/h;

    .line 9
    invoke-interface {v2}, Lha/h;->u()Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_e3

    invoke-static {v2}, Lp9/l;->R(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;

    move-result-object v2

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

    move-result-object v2

    iget-wide v7, p0, Lba/b$c;->u:J

    cmp-long v7, v7, v0

    if-ltz v7, :cond_bd

    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v7

    if-lez v7, :cond_5c

    goto :goto_5d

    :cond_5c
    move v4, v3

    :goto_5d
    if-eqz v4, :cond_68

    const-string v4, ";"

    const/4 v7, 0x2

    invoke-static {v2, v4, v3, v7}, Lp9/h;->y(Ljava/lang/String;Ljava/lang/String;ZI)Z

    move-result v4
    :try_end_66
    .catch Ljava/lang/NumberFormatException; {:try_start_33 .. :try_end_66} :catch_eb

    if-eqz v4, :cond_bd

    :cond_68
    iget-wide v7, p0, Lba/b$c;->u:J

    cmp-long v0, v7, v0

    if-nez v0, :cond_92

    iput-boolean v3, p0, Lba/b$c;->v:Z

    iget-object v0, p0, Lba/b$c;->x:Lba/b;

    .line 10
    iget-object v1, v0, Lba/b;->b:Lba/a;

    .line 11
    invoke-virtual {v1}, Lba/a;->a()Lv9/v;

    move-result-object v1

    .line 12
    iput-object v1, v0, Lba/b;->c:Lv9/v;

    .line 13
    iget-object v0, p0, Lba/b$c;->x:Lba/b;

    .line 14
    iget-object v0, v0, Lba/b;->d:Lv9/a0;

    .line 15
    invoke-static {v0}, Lx/e;->d(Ljava/lang/Object;)V

    .line 16
    iget-object v0, v0, Lv9/a0;->A:Lv9/o;

    .line 17
    iget-object v1, p0, Lba/b$c;->w:Lv9/w;

    iget-object v2, p0, Lba/b$c;->x:Lba/b;

    .line 18
    iget-object v2, v2, Lba/b;->c:Lv9/v;

    .line 19
    invoke-static {v2}, Lx/e;->d(Ljava/lang/Object;)V

    invoke-static {v0, v1, v2}, Laa/e;->b(Lv9/o;Lv9/w;Lv9/v;)V

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

    .line 20
    :cond_92
    iget-boolean v0, p0, Lba/b$c;->v:Z

    if-nez v0, :cond_97

    return-wide v5

    :cond_97
    iget-wide v0, p0, Lba/b$c;->u:J

    invoke-static {p2, p3, v0, v1}, Ljava/lang/Math;->min(JJ)J

    move-result-wide p2

    invoke-super {p0, p1, p2, p3}, Lba/b$a;->x(Lha/e;J)J

    move-result-wide p1

    cmp-long p3, p1, v5

    if-eqz p3, :cond_ab

    iget-wide v0, p0, Lba/b$c;->u:J

    sub-long/2addr v0, p1

    iput-wide v0, p0, Lba/b$c;->u:J

    return-wide p1

    :cond_ab
    iget-object p1, p0, Lba/b$c;->x:Lba/b;

    .line 21
    iget-object p1, p1, Lba/b;->e:Lz9/h;

    .line 22
    invoke-virtual {p1}, Lz9/h;->l()V

    new-instance p1, Ljava/net/ProtocolException;

    const-string p2, "unexpected end of stream"

    invoke-direct {p1, p2}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V

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

    throw p1

    .line 23
    :cond_bd
    :try_start_bd
    new-instance p1, Ljava/net/ProtocolException;

    new-instance p2, Ljava/lang/StringBuilder;

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

    const-string p3, "expected chunk size and optional extensions"

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

    const-string p3, " but was \""

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

    iget-wide v0, p0, Lba/b$c;->u:J

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

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

    const/16 p3, 0x22

    invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

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

    move-result-object p2

    invoke-direct {p1, p2}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V

    throw p1

    :cond_e3
    new-instance p1, Ljava/lang/NullPointerException;

    const-string p2, "null cannot be cast to non-null type kotlin.CharSequence"

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

    throw p1
    :try_end_eb
    .catch Ljava/lang/NumberFormatException; {:try_start_bd .. :try_end_eb} :catch_eb

    :catch_eb
    move-exception p1

    new-instance p2, Ljava/net/ProtocolException;

    invoke-virtual {p1}, Ljava/lang/NumberFormatException;->getMessage()Ljava/lang/String;

    move-result-object p1

    invoke-direct {p2, p1}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V

    throw p2

    .line 24
    :cond_f6
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string p2, "closed"

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

    move-result-object p2

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

    throw p1

    :cond_102
    const-string p1, "byteCount < 0: "

    invoke-static {p1, p2, p3}, Lv0/a;->a(Ljava/lang/String;J)Ljava/lang/String;

    move-result-object p1

    new-instance p2, Ljava/lang/IllegalArgumentException;

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

    move-result-object p1

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

    throw p2
.end method
