.class public final Lz5/p60;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lz5/sd;


# static fields
.field public static final q:Ljava/util/regex/Pattern;

.field public static final r:Ljava/util/concurrent/atomic/AtomicReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/atomic/AtomicReference<",
            "[B>;"
        }
    .end annotation
.end field


# instance fields
.field public final a:Ljavax/net/ssl/SSLSocketFactory;

.field public final b:I

.field public final c:I

.field public final d:Ljava/lang/String;

.field public final e:Lz5/rd;

.field public final f:Lz5/vd;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lz5/vd<",
            "-",
            "Lz5/p60;",
            ">;"
        }
    .end annotation
.end field

.field public g:Lz5/nd;

.field public h:Ljava/net/HttpURLConnection;

.field public i:Ljava/io/InputStream;

.field public j:Z

.field public k:J

.field public l:J

.field public m:J

.field public n:J

.field public o:I

.field public final p:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set<",
            "Ljava/net/Socket;",
            ">;"
        }
    .end annotation
.end field


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

    const-string v0, "^bytes (\\d+)-(\\d+)/(\\d+)$"

    invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

    move-result-object v0

    sput-object v0, Lz5/p60;->q:Ljava/util/regex/Pattern;

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

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

    sput-object v0, Lz5/p60;->r:Ljava/util/concurrent/atomic/AtomicReference;

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Lz5/vd;III)V
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Lz5/vd<",
            "-",
            "Lz5/p60;",
            ">;III)V"
        }
    .end annotation

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

    new-instance v0, Lz5/o60;

    invoke-direct {v0, p0}, Lz5/o60;-><init>(Lz5/p60;)V

    iput-object v0, p0, Lz5/p60;->a:Ljavax/net/ssl/SSLSocketFactory;

    new-instance v0, Ljava/util/HashSet;

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

    iput-object v0, p0, Lz5/p60;->p:Ljava/util/Set;

    .line 1
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_29

    .line 2
    iput-object p1, p0, Lz5/p60;->d:Ljava/lang/String;

    iput-object p2, p0, Lz5/p60;->f:Lz5/vd;

    new-instance p1, Lz5/rd;

    invoke-direct {p1}, Lz5/rd;-><init>()V

    iput-object p1, p0, Lz5/p60;->e:Lz5/rd;

    iput p3, p0, Lz5/p60;->b:I

    iput p4, p0, Lz5/p60;->c:I

    iput p5, p0, Lz5/p60;->o:I

    return-void

    .line 3
    :cond_29
    new-instance p1, Ljava/lang/IllegalArgumentException;

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

    throw p1
.end method


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

    iget-object v0, p0, Lz5/p60;->h:Ljava/net/HttpURLConnection;

    if-eqz v0, :cond_11

    :try_start_4
    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V
    :try_end_7
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_7} :catch_8

    goto :goto_e

    :catch_8
    move-exception v0

    const-string v1, "Unexpected error while disconnecting"

    invoke-static {v1, v0}, Lz5/d50;->zzg(Ljava/lang/String;Ljava/lang/Throwable;)V

    :goto_e
    const/4 v0, 0x0

    iput-object v0, p0, Lz5/p60;->h:Ljava/net/HttpURLConnection;

    :cond_11
    return-void
.end method

.method public final d([BII)I
    .registers 12

    :try_start_0
    iget-wide v0, p0, Lz5/p60;->m:J

    iget-wide v2, p0, Lz5/p60;->k:J

    cmp-long v0, v0, v2

    const/4 v1, 0x0

    const/4 v2, -0x1

    if-nez v0, :cond_b

    goto :goto_59

    :cond_b
    sget-object v0, Lz5/p60;->r:Ljava/util/concurrent/atomic/AtomicReference;

    const/4 v3, 0x0

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

    move-result-object v0

    check-cast v0, [B

    if-nez v0, :cond_1a

    const/16 v0, 0x1000

    new-array v0, v0, [B

    :cond_1a
    :goto_1a
    iget-wide v3, p0, Lz5/p60;->m:J

    iget-wide v5, p0, Lz5/p60;->k:J

    cmp-long v7, v3, v5

    if-eqz v7, :cond_54

    sub-long/2addr v5, v3

    array-length v3, v0

    int-to-long v3, v3

    invoke-static {v5, v6, v3, v4}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v3

    long-to-int v3, v3

    iget-object v4, p0, Lz5/p60;->i:Ljava/io/InputStream;

    invoke-virtual {v4, v0, v1, v3}, Ljava/io/InputStream;->read([BII)I

    move-result v3

    invoke-static {}, Ljava/lang/Thread;->interrupted()Z

    move-result v4

    if-nez v4, :cond_4e

    if-eq v3, v2, :cond_48

    iget-wide v4, p0, Lz5/p60;->m:J

    int-to-long v6, v3

    add-long/2addr v4, v6

    iput-wide v4, p0, Lz5/p60;->m:J

    iget-object v4, p0, Lz5/p60;->f:Lz5/vd;

    if-eqz v4, :cond_1a

    check-cast v4, Lcom/google/android/gms/internal/ads/d2;

    invoke-virtual {v4, v3}, Lcom/google/android/gms/internal/ads/d2;->V(I)V

    goto :goto_1a

    :cond_48
    new-instance p1, Ljava/io/EOFException;

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

    throw p1

    :cond_4e
    new-instance p1, Ljava/io/InterruptedIOException;

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

    throw p1

    :cond_54
    sget-object v3, Lz5/p60;->r:Ljava/util/concurrent/atomic/AtomicReference;

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

    :goto_59
    if-nez p3, :cond_5c

    goto :goto_99

    :cond_5c
    iget-wide v0, p0, Lz5/p60;->l:J

    const-wide/16 v3, -0x1

    cmp-long v5, v0, v3

    if-eqz v5, :cond_75

    iget-wide v5, p0, Lz5/p60;->n:J

    sub-long/2addr v0, v5

    const-wide/16 v5, 0x0

    cmp-long v5, v0, v5

    if-nez v5, :cond_6f

    :goto_6d
    move v1, v2

    goto :goto_99

    :cond_6f
    int-to-long v5, p3

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

    move-result-wide v0

    long-to-int p3, v0

    :cond_75
    iget-object v0, p0, Lz5/p60;->i:Ljava/io/InputStream;

    invoke-virtual {v0, p1, p2, p3}, Ljava/io/InputStream;->read([BII)I

    move-result v1

    if-ne v1, v2, :cond_8a

    iget-wide p1, p0, Lz5/p60;->l:J

    cmp-long p1, p1, v3

    if-nez p1, :cond_84

    goto :goto_6d

    :cond_84
    new-instance p1, Ljava/io/EOFException;

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

    throw p1

    :cond_8a
    iget-wide p1, p0, Lz5/p60;->n:J

    int-to-long v2, v1

    add-long/2addr p1, v2

    iput-wide p1, p0, Lz5/p60;->n:J

    iget-object p1, p0, Lz5/p60;->f:Lz5/vd;

    if-eqz p1, :cond_99

    check-cast p1, Lcom/google/android/gms/internal/ads/d2;

    invoke-virtual {p1, v1}, Lcom/google/android/gms/internal/ads/d2;->V(I)V
    :try_end_99
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_99} :catch_9a

    :cond_99
    :goto_99
    return v1

    :catch_9a
    move-exception p1

    new-instance p2, Lz5/pd;

    iget-object p3, p0, Lz5/p60;->g:Lz5/nd;

    invoke-direct {p2, p1, p3}, Lz5/pd;-><init>(Ljava/io/IOException;Lz5/nd;)V

    throw p2
.end method

.method public final e(Lz5/nd;)J
    .registers 24

    move-object/from16 v1, p0

    move-object/from16 v2, p1

    const-string v3, "Unable to connect to "

    iput-object v2, v1, Lz5/p60;->g:Lz5/nd;

    const-wide/16 v4, 0x0

    iput-wide v4, v1, Lz5/p60;->n:J

    iput-wide v4, v1, Lz5/p60;->m:J

    :try_start_e
    new-instance v0, Ljava/net/URL;

    iget-object v6, v2, Lz5/nd;->a:Landroid/net/Uri;

    invoke-virtual {v6}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v0, v6}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    iget-wide v6, v2, Lz5/nd;->c:J

    iget-wide v8, v2, Lz5/nd;->d:J

    const/4 v11, 0x0

    :goto_1e
    add-int/lit8 v12, v11, 0x1

    const/16 v13, 0x14

    if-gt v11, v13, :cond_29b

    invoke-virtual {v0}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v11

    check-cast v11, Ljava/net/HttpURLConnection;

    instance-of v14, v11, Ljavax/net/ssl/HttpsURLConnection;

    if-eqz v14, :cond_36

    move-object v14, v11

    check-cast v14, Ljavax/net/ssl/HttpsURLConnection;

    iget-object v15, v1, Lz5/p60;->a:Ljavax/net/ssl/SSLSocketFactory;

    invoke-virtual {v14, v15}, Ljavax/net/ssl/HttpsURLConnection;->setSSLSocketFactory(Ljavax/net/ssl/SSLSocketFactory;)V

    :cond_36
    iget v14, v1, Lz5/p60;->b:I

    invoke-virtual {v11, v14}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V

    iget v14, v1, Lz5/p60;->c:I

    invoke-virtual {v11, v14}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V

    iget-object v14, v1, Lz5/p60;->e:Lz5/rd;

    invoke-virtual {v14}, Lz5/rd;->a()Ljava/util/Map;

    move-result-object v14

    invoke-interface {v14}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v14

    invoke-interface {v14}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v14

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

    move-result v15

    if-eqz v15, :cond_6c

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

    move-result-object v15

    check-cast v15, Ljava/util/Map$Entry;

    invoke-interface {v15}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v16

    move-object/from16 v10, v16

    check-cast v10, Ljava/lang/String;

    invoke-interface {v15}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v15

    check-cast v15, Ljava/lang/String;

    invoke-virtual {v11, v10, v15}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_4e

    :cond_6c
    cmp-long v10, v6, v4

    const-wide/16 v14, -0x1

    const/16 v4, 0x1b

    if-nez v10, :cond_7c

    cmp-long v5, v8, v14

    if-eqz v5, :cond_79

    goto :goto_7c

    :cond_79
    move-wide/from16 v20, v6

    goto :goto_b8

    :cond_7c
    :goto_7c
    new-instance v5, Ljava/lang/StringBuilder;

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

    const-string v10, "bytes="

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

    invoke-virtual {v5, v6, v7}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v10, "-"

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

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

    move-result-object v5

    cmp-long v10, v8, v14

    if-eqz v10, :cond_b1

    add-long v18, v6, v8

    move-wide/from16 v20, v6

    add-long v6, v18, v14

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

    move-result v10

    add-int/2addr v10, v13

    new-instance v13, Ljava/lang/StringBuilder;

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

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

    invoke-virtual {v13, v6, v7}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

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

    move-result-object v5

    goto :goto_b3

    :cond_b1
    move-wide/from16 v20, v6

    :goto_b3
    const-string v6, "Range"

    invoke-virtual {v11, v6, v5}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    :goto_b8
    const-string v5, "User-Agent"

    iget-object v6, v1, Lz5/p60;->d:Ljava/lang/String;

    invoke-virtual {v11, v5, v6}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    const-string v5, "Accept-Encoding"

    const-string v6, "identity"

    invoke-virtual {v11, v5, v6}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v5, 0x0

    invoke-virtual {v11, v5}, Ljava/net/HttpURLConnection;->setInstanceFollowRedirects(Z)V

    invoke-virtual {v11, v5}, Ljava/net/HttpURLConnection;->setDoOutput(Z)V

    invoke-virtual {v11}, Ljava/net/HttpURLConnection;->connect()V

    invoke-virtual {v11}, Ljava/net/HttpURLConnection;->getResponseCode()I

    move-result v6

    const/16 v7, 0x12c

    if-eq v6, v7, :cond_249

    const/16 v7, 0x12d

    if-eq v6, v7, :cond_249

    const/16 v7, 0x12e

    if-eq v6, v7, :cond_249

    const/16 v7, 0x12f

    if-eq v6, v7, :cond_249

    const/16 v7, 0x133

    if-eq v6, v7, :cond_249

    const/16 v7, 0x134

    if-ne v6, v7, :cond_ee

    goto/16 :goto_249

    :cond_ee
    iput-object v11, v1, Lz5/p60;->h:Ljava/net/HttpURLConnection;
    :try_end_f0
    .catch Ljava/io/IOException; {:try_start_e .. :try_end_f0} :catch_2b4

    :try_start_f0
    invoke-virtual {v11}, Ljava/net/HttpURLConnection;->getResponseCode()I

    move-result v0
    :try_end_f4
    .catch Ljava/io/IOException; {:try_start_f0 .. :try_end_f4} :catch_223

    const/16 v3, 0xc8

    if-lt v0, v3, :cond_208

    const/16 v5, 0x12b

    if-le v0, v5, :cond_fe

    goto/16 :goto_208

    :cond_fe
    if-ne v0, v3, :cond_109

    iget-wide v5, v2, Lz5/nd;->c:J

    const-wide/16 v7, 0x0

    cmp-long v0, v5, v7

    if-eqz v0, :cond_109

    goto :goto_10b

    :cond_109
    const-wide/16 v5, 0x0

    :goto_10b
    iput-wide v5, v1, Lz5/p60;->k:J

    iget-wide v5, v2, Lz5/nd;->d:J

    cmp-long v0, v5, v14

    const/4 v3, 0x1

    if-eqz v0, :cond_116

    goto/16 :goto_1e6

    :cond_116
    iget-object v0, v1, Lz5/p60;->h:Ljava/net/HttpURLConnection;

    const-string v5, "Content-Length"

    invoke-virtual {v0, v5}, Ljava/net/HttpURLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v6

    const-string v7, "]"

    if-nez v6, :cond_14c

    :try_start_126
    invoke-static {v5}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v8
    :try_end_12a
    .catch Ljava/lang/NumberFormatException; {:try_start_126 .. :try_end_12a} :catch_12b

    goto :goto_14d

    :catch_12b
    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

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

    move-result v6

    new-instance v8, Ljava/lang/StringBuilder;

    add-int/lit8 v6, v6, 0x1c

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

    const-string v6, "Unexpected Content-Length ["

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

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

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

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

    move-result-object v6

    invoke-static {v6}, Lz5/d50;->zzf(Ljava/lang/String;)V

    :cond_14c
    move-wide v8, v14

    :goto_14d
    const-string v6, "Content-Range"

    invoke-virtual {v0, v6}, Ljava/net/HttpURLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v6

    if-nez v6, :cond_1dd

    sget-object v6, Lz5/p60;->q:Ljava/util/regex/Pattern;

    invoke-virtual {v6, v0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v6

    invoke-virtual {v6}, Ljava/util/regex/Matcher;->find()Z

    move-result v10

    if-eqz v10, :cond_1dd

    const/4 v10, 0x2

    :try_start_166
    invoke-virtual {v6, v10}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v10

    invoke-static {v10}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v10

    invoke-virtual {v6, v3}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v6

    invoke-static {v6}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v12

    sub-long/2addr v10, v12

    const-wide/16 v12, 0x1

    add-long/2addr v10, v12

    const-wide/16 v16, 0x0

    cmp-long v6, v8, v16

    if-gez v6, :cond_182

    move-wide v8, v10

    goto :goto_1dd

    :cond_182
    cmp-long v6, v8, v10

    if-eqz v6, :cond_1dd

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

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

    move-result v6

    add-int/lit8 v6, v6, 0x1a

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v12

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

    move-result v12

    add-int/2addr v6, v12

    new-instance v12, Ljava/lang/StringBuilder;

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

    const-string v6, "Inconsistent headers ["

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

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

    const-string v5, "] ["

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

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

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

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

    move-result-object v5

    invoke-static {v5}, Lz5/d50;->zzi(Ljava/lang/String;)V

    invoke-static {v8, v9, v10, v11}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v8
    :try_end_1bc
    .catch Ljava/lang/NumberFormatException; {:try_start_166 .. :try_end_1bc} :catch_1bd

    goto :goto_1dd

    :catch_1bd
    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

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

    move-result v5

    new-instance v6, Ljava/lang/StringBuilder;

    add-int/2addr v5, v4

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

    const-string v4, "Unexpected Content-Range ["

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

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

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

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

    move-result-object v0

    invoke-static {v0}, Lz5/d50;->zzf(Ljava/lang/String;)V

    :cond_1dd
    :goto_1dd
    cmp-long v0, v8, v14

    if-eqz v0, :cond_1e5

    iget-wide v4, v1, Lz5/p60;->k:J

    sub-long v14, v8, v4

    :cond_1e5
    move-wide v5, v14

    :goto_1e6
    iput-wide v5, v1, Lz5/p60;->l:J

    :try_start_1e8
    iget-object v0, v1, Lz5/p60;->h:Ljava/net/HttpURLConnection;

    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;

    move-result-object v0

    iput-object v0, v1, Lz5/p60;->i:Ljava/io/InputStream;
    :try_end_1f0
    .catch Ljava/io/IOException; {:try_start_1e8 .. :try_end_1f0} :catch_1fe

    iput-boolean v3, v1, Lz5/p60;->j:Z

    iget-object v0, v1, Lz5/p60;->f:Lz5/vd;

    if-eqz v0, :cond_1fb

    check-cast v0, Lcom/google/android/gms/internal/ads/d2;

    invoke-virtual {v0, v1, v2}, Lcom/google/android/gms/internal/ads/d2;->U(Lz5/kd;Lz5/nd;)V

    :cond_1fb
    iget-wide v2, v1, Lz5/p60;->l:J

    return-wide v2

    :catch_1fe
    move-exception v0

    invoke-virtual/range {p0 .. p0}, Lz5/p60;->a()V

    new-instance v3, Lz5/pd;

    invoke-direct {v3, v0, v2}, Lz5/pd;-><init>(Ljava/io/IOException;Lz5/nd;)V

    throw v3

    :cond_208
    :goto_208
    iget-object v3, v1, Lz5/p60;->h:Ljava/net/HttpURLConnection;

    invoke-virtual {v3}, Ljava/net/HttpURLConnection;->getHeaderFields()Ljava/util/Map;

    move-result-object v3

    invoke-virtual/range {p0 .. p0}, Lz5/p60;->a()V

    new-instance v4, Lz5/qd;

    invoke-direct {v4, v0, v3, v2}, Lz5/qd;-><init>(ILjava/util/Map;Lz5/nd;)V

    const/16 v2, 0x1a0

    if-ne v0, v2, :cond_222

    new-instance v0, Lz5/md;

    invoke-direct {v0}, Lz5/md;-><init>()V

    invoke-virtual {v4, v0}, Ljava/io/IOException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;

    :cond_222
    throw v4

    :catch_223
    move-exception v0

    move-object v4, v0

    invoke-virtual/range {p0 .. p0}, Lz5/p60;->a()V

    new-instance v0, Lz5/pd;

    iget-object v5, v2, Lz5/nd;->a:Landroid/net/Uri;

    invoke-virtual {v5}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

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

    move-result v6

    if-eqz v6, :cond_23f

    invoke-virtual {v3, v5}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    goto :goto_245

    :cond_23f
    new-instance v5, Ljava/lang/String;

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

    move-object v3, v5

    :goto_245
    invoke-direct {v0, v3, v4, v2}, Lz5/pd;-><init>(Ljava/lang/String;Ljava/io/IOException;Lz5/nd;)V

    throw v0

    :cond_249
    :goto_249
    const-wide/16 v16, 0x0

    :try_start_24b
    const-string v4, "Location"

    invoke-virtual {v11, v4}, Ljava/net/HttpURLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v11}, Ljava/net/HttpURLConnection;->disconnect()V

    if-eqz v4, :cond_293

    new-instance v6, Ljava/net/URL;

    invoke-direct {v6, v0, v4}, Ljava/net/URL;-><init>(Ljava/net/URL;Ljava/lang/String;)V

    invoke-virtual {v6}, Ljava/net/URL;->getProtocol()Ljava/lang/String;

    move-result-object v0

    const-string v4, "https"

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

    move-result v4

    if-nez v4, :cond_28b

    const-string v4, "http"

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

    move-result v4

    if-nez v4, :cond_28b

    new-instance v4, Ljava/net/ProtocolException;

    const-string v5, "Unsupported protocol redirect: "

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

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

    move-result v6

    if-eqz v6, :cond_282

    invoke-virtual {v5, v0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_287

    :cond_282
    new-instance v0, Ljava/lang/String;

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

    :goto_287
    invoke-direct {v4, v0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V

    throw v4

    :cond_28b
    move-object v0, v6

    move v11, v12

    move-wide/from16 v4, v16

    move-wide/from16 v6, v20

    goto/16 :goto_1e

    :cond_293
    new-instance v0, Ljava/net/ProtocolException;

    const-string v4, "Null location redirect"

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

    throw v0

    :cond_29b
    new-instance v0, Ljava/net/NoRouteToHostException;

    new-instance v4, Ljava/lang/StringBuilder;

    const/16 v5, 0x1f

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

    const-string v5, "Too many redirects: "

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

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

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

    move-result-object v4

    invoke-direct {v0, v4}, Ljava/net/NoRouteToHostException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_2b4
    .catch Ljava/io/IOException; {:try_start_24b .. :try_end_2b4} :catch_2b4

    :catch_2b4
    move-exception v0

    new-instance v4, Lz5/pd;

    iget-object v5, v2, Lz5/nd;->a:Landroid/net/Uri;

    invoke-virtual {v5}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

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

    move-result v6

    if-eqz v6, :cond_2cc

    invoke-virtual {v3, v5}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    goto :goto_2d2

    :cond_2cc
    new-instance v5, Ljava/lang/String;

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

    move-object v3, v5

    :goto_2d2
    invoke-direct {v4, v3, v0, v2}, Lz5/pd;-><init>(Ljava/lang/String;Ljava/io/IOException;Lz5/nd;)V

    throw v4
.end method

.method public final zzc()Landroid/net/Uri;
    .registers 2

    iget-object v0, p0, Lz5/p60;->h:Ljava/net/HttpURLConnection;

    if-nez v0, :cond_6

    const/4 v0, 0x0

    return-object v0

    :cond_6
    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getURL()Ljava/net/URL;

    move-result-object v0

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

    move-result-object v0

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    return-object v0
.end method

.method public final zzd()V
    .registers 10

    const/4 v0, 0x0

    const/4 v1, 0x0

    :try_start_2
    iget-object v2, p0, Lz5/p60;->i:Ljava/io/InputStream;

    if-eqz v2, :cond_76

    iget-object v2, p0, Lz5/p60;->h:Ljava/net/HttpURLConnection;

    iget-wide v3, p0, Lz5/p60;->l:J

    const-wide/16 v5, -0x1

    cmp-long v7, v3, v5

    if-nez v7, :cond_11

    goto :goto_14

    :cond_11
    iget-wide v7, p0, Lz5/p60;->n:J

    sub-long/2addr v3, v7

    :goto_14
    sget v7, Lz5/be;->a:I
    :try_end_16
    .catchall {:try_start_2 .. :try_end_16} :catchall_87

    const/16 v8, 0x13

    if-eq v7, v8, :cond_1f

    const/16 v8, 0x14

    if-eq v7, v8, :cond_1f

    goto :goto_67

    :cond_1f
    :try_start_1f
    invoke-virtual {v2}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;

    move-result-object v2

    cmp-long v5, v3, v5

    if-nez v5, :cond_2f

    invoke-virtual {v2}, Ljava/io/InputStream;->read()I

    move-result v3

    const/4 v4, -0x1

    if-eq v3, v4, :cond_67

    goto :goto_36

    :cond_2f
    const-wide/16 v5, 0x800

    cmp-long v3, v3, v5

    if-gtz v3, :cond_36

    goto :goto_67

    :cond_36
    :goto_36
    invoke-virtual {v2}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "com.android.okhttp.internal.http.HttpTransport$ChunkedInputStream"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_4e

    const-string v4, "com.android.okhttp.internal.http.HttpTransport$FixedLengthInputStream"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_67

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

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;

    move-result-object v3

    const-string v4, "unexpectedEndOfInput"

    new-array v5, v1, [Ljava/lang/Class;

    invoke-virtual {v3, v4, v5}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v3

    const/4 v4, 0x1

    invoke-virtual {v3, v4}, Ljava/lang/reflect/Method;->setAccessible(Z)V

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

    invoke-virtual {v3, v2, v4}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_67
    .catch Ljava/lang/Exception; {:try_start_1f .. :try_end_67} :catch_67
    .catchall {:try_start_1f .. :try_end_67} :catchall_87

    :catch_67
    :cond_67
    :goto_67
    :try_start_67
    iget-object v2, p0, Lz5/p60;->i:Ljava/io/InputStream;

    invoke-virtual {v2}, Ljava/io/InputStream;->close()V
    :try_end_6c
    .catch Ljava/io/IOException; {:try_start_67 .. :try_end_6c} :catch_6d
    .catchall {:try_start_67 .. :try_end_6c} :catchall_87

    goto :goto_76

    :catch_6d
    move-exception v2

    :try_start_6e
    new-instance v3, Lz5/pd;

    iget-object v4, p0, Lz5/p60;->g:Lz5/nd;

    invoke-direct {v3, v2, v4}, Lz5/pd;-><init>(Ljava/io/IOException;Lz5/nd;)V

    throw v3
    :try_end_76
    .catchall {:try_start_6e .. :try_end_76} :catchall_87

    :cond_76
    :goto_76
    iput-object v0, p0, Lz5/p60;->i:Ljava/io/InputStream;

    invoke-virtual {p0}, Lz5/p60;->a()V

    iget-boolean v0, p0, Lz5/p60;->j:Z

    if-eqz v0, :cond_81

    iput-boolean v1, p0, Lz5/p60;->j:Z

    :cond_81
    iget-object v0, p0, Lz5/p60;->p:Ljava/util/Set;

    invoke-interface {v0}, Ljava/util/Set;->clear()V

    return-void

    :catchall_87
    move-exception v2

    iput-object v0, p0, Lz5/p60;->i:Ljava/io/InputStream;

    invoke-virtual {p0}, Lz5/p60;->a()V

    iget-boolean v0, p0, Lz5/p60;->j:Z

    if-eqz v0, :cond_93

    iput-boolean v1, p0, Lz5/p60;->j:Z

    :cond_93
    iget-object v0, p0, Lz5/p60;->p:Ljava/util/Set;

    invoke-interface {v0}, Ljava/util/Set;->clear()V

    throw v2
.end method

.method public final zze()Ljava/util/Map;
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;>;"
        }
    .end annotation

    iget-object v0, p0, Lz5/p60;->h:Ljava/net/HttpURLConnection;

    if-nez v0, :cond_6

    const/4 v0, 0x0

    return-object v0

    :cond_6
    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getHeaderFields()Ljava/util/Map;

    move-result-object v0

    return-object v0
.end method
