_Utf8Kt.smali

.class public final Lokio/internal/_Utf8Kt;
.super Ljava/lang/Object;
.source "-Utf8.kt"


# annotations
.annotation system Ldalvik/annotation/SourceDebugExtension;
    value = "SMAP\n-Utf8.kt\nKotlin\n*S Kotlin\n*F\n+ 1 -Utf8.kt\nokio/internal/_Utf8Kt\n+ 2 Utf8.kt\nokio/Utf8\n+ 3 -Util.kt\nokio/-Util\n*L\n1#1,60:1\n256#2,16:61\n273#2:78\n393#2,9:79\n127#2:88\n402#2,18:90\n275#2:108\n277#2:110\n434#2,4:111\n127#2:115\n440#2,10:117\n127#2:127\n450#2,5:129\n127#2:134\n455#2,22:136\n279#2:158\n281#2:160\n492#2,3:161\n282#2,12:164\n495#2:176\n127#2:177\n498#2,2:179\n127#2:181\n502#2,10:183\n127#2:193\n512#2,5:195\n127#2:200\n517#2,5:202\n127#2:207\n522#2,26:209\n298#2,6:235\n138#2,64:241\n60#3:77\n66#3:89\n60#3:109\n66#3:116\n66#3:128\n66#3:135\n60#3:159\n66#3:178\n66#3:182\n66#3:194\n66#3:201\n66#3:208\n*E\n*S KotlinDebug\n*F\n+ 1 -Utf8.kt\nokio/internal/_Utf8Kt\n*L\n34#1,16:61\n34#1:78\n34#1,9:79\n34#1:88\n34#1,18:90\n34#1:108\n34#1:110\n34#1,4:111\n34#1:115\n34#1,10:117\n34#1:127\n34#1,5:129\n34#1:134\n34#1,22:136\n34#1:158\n34#1:160\n34#1,3:161\n34#1,12:164\n34#1:176\n34#1:177\n34#1,2:179\n34#1:181\n34#1,10:183\n34#1:193\n34#1,5:195\n34#1:200\n34#1,5:202\n34#1:207\n34#1,26:209\n34#1,6:235\n50#1,64:241\n34#1:77\n34#1:89\n34#1:109\n34#1:116\n34#1:128\n34#1:135\n34#1:159\n34#1:178\n34#1:182\n34#1:194\n34#1:201\n34#1:208\n*E\n"
.end annotation

.annotation runtime Lkotlin/Metadata;
    bv = {
        0x1,
        0x0,
        0x3
    }
    d1 = {
        "\u0000\u0016\n\u0000\n\u0002\u0010\u0012\n\u0002\u0010\u000e\n\u0002\u0008\u0002\n\u0002\u0010\u0008\n\u0002\u0008\u0002\u001a\n\u0010\u0000\u001a\u00020\u0001*\u00020\u0002\u001a\u001e\u0010\u0003\u001a\u00020\u0002*\u00020\u00012\u0008\u0008\u0002\u0010\u0004\u001a\u00020\u00052\u0008\u0008\u0002\u0010\u0006\u001a\u00020\u0005\u00a8\u0006\u0007"
    }
    d2 = {
        "commonAsUtf8ToByteArray",
        "",
        "",
        "commonToUtf8String",
        "beginIndex",
        "",
        "endIndex",
        "okio"
    }
    k = 0x2
    mv = {
        0x1,
        0x1,
        0xf
    }
.end annotation


# direct methods
.method public static final commonAsUtf8ToByteArray(Ljava/lang/String;)[B
    .registers 13

    const-string v0, "$this$commonAsUtf8ToByteArray"

    invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 42
    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v0

    mul-int/lit8 v0, v0, 0x4

    new-array v0, v0, [B

    .line 46
    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v1

    const/4 v2, 0x0

    :goto_12
    const-string v3, "java.util.Arrays.copyOf(this, newSize)"

    if-ge v2, v1, :cond_e5

    .line 47
    invoke-virtual {p0, v2}, Ljava/lang/String;->charAt(I)C

    move-result v4

    const/16 v5, 0x80

    if-lt v4, v5, :cond_de

    .line 50
    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v1

    move v4, v2

    :goto_23
    if-ge v2, v1, :cond_d6

    .line 243
    invoke-virtual {p0, v2}, Ljava/lang/String;->charAt(I)C

    move-result v6

    if-ge v6, v5, :cond_4a

    int-to-byte v6, v6

    add-int/lit8 v7, v4, 0x1

    .line 51
    aput-byte v6, v0, v4

    add-int/lit8 v2, v2, 0x1

    :goto_32
    if-ge v2, v1, :cond_48

    .line 252
    invoke-virtual {p0, v2}, Ljava/lang/String;->charAt(I)C

    move-result v4

    if-ge v4, v5, :cond_48

    add-int/lit8 v4, v2, 0x1

    .line 253
    invoke-virtual {p0, v2}, Ljava/lang/String;->charAt(I)C

    move-result v2

    int-to-byte v2, v2

    add-int/lit8 v6, v7, 0x1

    .line 51
    aput-byte v2, v0, v7

    move v2, v4

    move v7, v6

    goto :goto_32

    :cond_48
    move v4, v7

    goto :goto_23

    :cond_4a
    const/16 v7, 0x800

    if-ge v6, v7, :cond_63

    shr-int/lit8 v7, v6, 0x6

    or-int/lit16 v7, v7, 0xc0

    int-to-byte v7, v7

    add-int/lit8 v8, v4, 0x1

    aput-byte v7, v0, v4

    and-int/lit8 v4, v6, 0x3f

    or-int/2addr v4, v5

    int-to-byte v4, v4

    add-int/lit8 v6, v8, 0x1

    aput-byte v4, v0, v8

    :goto_5f
    add-int/lit8 v2, v2, 0x1

    :goto_61
    move v4, v6

    goto :goto_23

    :cond_63
    const v7, 0xd800

    const/16 v8, 0x3f

    if-gt v7, v6, :cond_bb

    const v7, 0xdfff

    if-ge v7, v6, :cond_70

    goto :goto_bb

    :cond_70
    const v9, 0xdbff

    if-gt v6, v9, :cond_b6

    add-int/lit8 v9, v2, 0x1

    if-le v1, v9, :cond_b6

    const v10, 0xdc00

    .line 282
    invoke-virtual {p0, v9}, Ljava/lang/String;->charAt(I)C

    move-result v11

    if-gt v10, v11, :cond_b6

    if-ge v7, v11, :cond_85

    goto :goto_b6

    :cond_85
    shl-int/lit8 v6, v6, 0xa

    .line 289
    invoke-virtual {p0, v9}, Ljava/lang/String;->charAt(I)C

    move-result v7

    add-int/2addr v6, v7

    const v7, -0x35fdc00

    add-int/2addr v6, v7

    shr-int/lit8 v7, v6, 0x12

    or-int/lit16 v7, v7, 0xf0

    int-to-byte v7, v7

    add-int/lit8 v9, v4, 0x1

    .line 51
    aput-byte v7, v0, v4

    shr-int/lit8 v4, v6, 0xc

    and-int/2addr v4, v8

    or-int/2addr v4, v5

    int-to-byte v4, v4

    add-int/lit8 v7, v9, 0x1

    aput-byte v4, v0, v9

    shr-int/lit8 v4, v6, 0x6

    and-int/2addr v4, v8

    or-int/2addr v4, v5

    int-to-byte v4, v4

    add-int/lit8 v9, v7, 0x1

    aput-byte v4, v0, v7

    and-int/lit8 v4, v6, 0x3f

    or-int/2addr v4, v5

    int-to-byte v4, v4

    add-int/lit8 v6, v9, 0x1

    aput-byte v4, v0, v9

    add-int/lit8 v2, v2, 0x2

    goto :goto_61

    :cond_b6
    :goto_b6
    add-int/lit8 v6, v4, 0x1

    aput-byte v8, v0, v4

    goto :goto_5f

    :cond_bb
    :goto_bb
    shr-int/lit8 v7, v6, 0xc

    or-int/lit16 v7, v7, 0xe0

    int-to-byte v7, v7

    add-int/lit8 v9, v4, 0x1

    aput-byte v7, v0, v4

    shr-int/lit8 v4, v6, 0x6

    and-int/2addr v4, v8

    or-int/2addr v4, v5

    int-to-byte v4, v4

    add-int/lit8 v7, v9, 0x1

    aput-byte v4, v0, v9

    and-int/lit8 v4, v6, 0x3f

    or-int/2addr v4, v5

    int-to-byte v4, v4

    add-int/lit8 v6, v7, 0x1

    aput-byte v4, v0, v7

    goto :goto_5f

    .line 53
    :cond_d6
    invoke-static {v0, v4}, Ljava/util/Arrays;->copyOf([BI)[B

    move-result-object p0

    invoke-static {p0, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    return-object p0

    :cond_de
    int-to-byte v3, v4

    .line 55
    aput-byte v3, v0, v2

    add-int/lit8 v2, v2, 0x1

    goto/16 :goto_12

    .line 58
    :cond_e5
    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result p0

    invoke-static {v0, p0}, Ljava/util/Arrays;->copyOf([BI)[B

    move-result-object p0

    invoke-static {p0, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    return-object p0
.end method

.method public static final commonToUtf8String([BII)Ljava/lang/String;
    .registers 19

    move-object/from16 v0, p0

    move/from16 v1, p1

    move/from16 v2, p2

    const-string v3, "$this$commonToUtf8String"

    invoke-static {v0, v3}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    if-ltz v1, :cond_1aa

    .line 28
    array-length v3, v0

    if-gt v2, v3, :cond_1aa

    if-gt v1, v2, :cond_1aa

    sub-int v3, v2, v1

    .line 31
    new-array v3, v3, [C

    const/4 v4, 0x0

    const/4 v5, 0x0

    :goto_18
    if-ge v1, v2, :cond_1a4

    .line 63
    aget-byte v6, v0, v1

    if-ltz v6, :cond_39

    int-to-char v6, v6

    add-int/lit8 v7, v5, 0x1

    .line 35
    aput-char v6, v3, v5

    add-int/lit8 v1, v1, 0x1

    :goto_25
    if-ge v1, v2, :cond_37

    .line 72
    aget-byte v5, v0, v1

    if-ltz v5, :cond_37

    add-int/lit8 v5, v1, 0x1

    .line 73
    aget-byte v1, v0, v1

    int-to-char v1, v1

    add-int/lit8 v6, v7, 0x1

    .line 35
    aput-char v1, v3, v7

    move v1, v5

    move v7, v6

    goto :goto_25

    :cond_37
    :goto_37
    move v5, v7

    goto :goto_18

    :cond_39
    shr-int/lit8 v7, v6, 0x5

    const/4 v8, -0x2

    const/16 v10, 0x80

    const v11, 0xfffd

    if-ne v7, v8, :cond_76

    add-int/lit8 v6, v1, 0x1

    if-gt v2, v6, :cond_4e

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    :cond_4c
    :goto_4c
    const/4 v9, 0x1

    goto :goto_74

    .line 85
    :cond_4e
    aget-byte v7, v0, v1

    .line 86
    aget-byte v6, v0, v6

    and-int/lit16 v8, v6, 0xc0

    if-ne v8, v10, :cond_58

    const/4 v8, 0x1

    goto :goto_59

    :cond_58
    const/4 v8, 0x0

    :goto_59
    if-nez v8, :cond_61

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    .line 35
    aput-char v6, v3, v5

    goto :goto_4c

    :cond_61
    xor-int/lit16 v6, v6, 0xf80

    shl-int/lit8 v7, v7, 0x6

    xor-int/2addr v6, v7

    if-ge v6, v10, :cond_6e

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    goto :goto_73

    :cond_6e
    int-to-char v6, v6

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    :cond_73
    :goto_73
    const/4 v9, 0x2

    :goto_74
    add-int/2addr v1, v9

    goto :goto_37

    :cond_76
    shr-int/lit8 v7, v6, 0x4

    const v13, 0xd800

    const v14, 0xdfff

    const/4 v15, 0x3

    if-ne v7, v8, :cond_e6

    add-int/lit8 v6, v1, 0x2

    if-gt v2, v6, :cond_9a

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    add-int/lit8 v5, v1, 0x1

    if-le v2, v5, :cond_4c

    .line 114
    aget-byte v5, v0, v5

    and-int/lit16 v5, v5, 0xc0

    if-ne v5, v10, :cond_96

    const/4 v5, 0x1

    goto :goto_97

    :cond_96
    const/4 v5, 0x0

    :goto_97
    if-nez v5, :cond_73

    goto :goto_4c

    .line 124
    :cond_9a
    aget-byte v7, v0, v1

    add-int/lit8 v8, v1, 0x1

    .line 125
    aget-byte v8, v0, v8

    and-int/lit16 v9, v8, 0xc0

    if-ne v9, v10, :cond_a6

    const/4 v9, 0x1

    goto :goto_a7

    :cond_a6
    const/4 v9, 0x0

    :goto_a7
    if-nez v9, :cond_af

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    .line 35
    aput-char v6, v3, v5

    goto :goto_4c

    .line 132
    :cond_af
    aget-byte v6, v0, v6

    and-int/lit16 v9, v6, 0xc0

    if-ne v9, v10, :cond_b7

    const/4 v12, 0x1

    goto :goto_b8

    :cond_b7
    const/4 v12, 0x0

    :goto_b8
    if-nez v12, :cond_c0

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    .line 35
    aput-char v6, v3, v5

    goto :goto_73

    :cond_c0
    const v9, -0x1e080

    xor-int/2addr v6, v9

    shl-int/lit8 v8, v8, 0x6

    xor-int/2addr v6, v8

    shl-int/lit8 v7, v7, 0xc

    xor-int/2addr v6, v7

    const/16 v7, 0x800

    if-ge v6, v7, :cond_d4

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    goto :goto_e4

    :cond_d4
    if-le v13, v6, :cond_d7

    goto :goto_df

    :cond_d7
    if-lt v14, v6, :cond_df

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    goto :goto_e4

    :cond_df
    :goto_df
    int-to-char v6, v6

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    :goto_e4
    const/4 v9, 0x3

    goto :goto_74

    :cond_e6
    shr-int/lit8 v6, v6, 0x3

    if-ne v6, v8, :cond_19b

    add-int/lit8 v6, v1, 0x3

    if-gt v2, v6, :cond_11b

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    add-int/lit8 v5, v1, 0x1

    if-le v2, v5, :cond_118

    .line 176
    aget-byte v5, v0, v5

    and-int/lit16 v5, v5, 0xc0

    if-ne v5, v10, :cond_fe

    const/4 v5, 0x1

    goto :goto_ff

    :cond_fe
    const/4 v5, 0x0

    :goto_ff
    if-nez v5, :cond_102

    goto :goto_118

    :cond_102
    add-int/lit8 v5, v1, 0x2

    if-le v2, v5, :cond_115

    .line 180
    aget-byte v5, v0, v5

    and-int/lit16 v5, v5, 0xc0

    if-ne v5, v10, :cond_10e

    const/4 v12, 0x1

    goto :goto_10f

    :cond_10e
    const/4 v12, 0x0

    :goto_10f
    if-nez v12, :cond_112

    goto :goto_115

    :cond_112
    :goto_112
    const/4 v9, 0x3

    goto/16 :goto_199

    :cond_115
    :goto_115
    const/4 v9, 0x2

    goto/16 :goto_199

    :cond_118
    :goto_118
    const/4 v9, 0x1

    goto/16 :goto_199

    .line 190
    :cond_11b
    aget-byte v7, v0, v1

    add-int/lit8 v8, v1, 0x1

    .line 191
    aget-byte v8, v0, v8

    and-int/lit16 v9, v8, 0xc0

    if-ne v9, v10, :cond_127

    const/4 v9, 0x1

    goto :goto_128

    :cond_127
    const/4 v9, 0x0

    :goto_128
    if-nez v9, :cond_12f

    add-int/lit8 v6, v5, 0x1

    .line 35
    aput-char v11, v3, v5

    goto :goto_118

    :cond_12f
    add-int/lit8 v9, v1, 0x2

    .line 198
    aget-byte v9, v0, v9

    and-int/lit16 v12, v9, 0xc0

    if-ne v12, v10, :cond_139

    const/4 v12, 0x1

    goto :goto_13a

    :cond_139
    const/4 v12, 0x0

    :goto_13a
    if-nez v12, :cond_141

    add-int/lit8 v6, v5, 0x1

    .line 35
    aput-char v11, v3, v5

    goto :goto_115

    .line 205
    :cond_141
    aget-byte v6, v0, v6

    and-int/lit16 v12, v6, 0xc0

    if-ne v12, v10, :cond_149

    const/4 v12, 0x1

    goto :goto_14a

    :cond_149
    const/4 v12, 0x0

    :goto_14a
    if-nez v12, :cond_151

    add-int/lit8 v6, v5, 0x1

    .line 35
    aput-char v11, v3, v5

    goto :goto_112

    :cond_151
    const v10, 0x381f80

    xor-int/2addr v6, v10

    shl-int/lit8 v9, v9, 0x6

    xor-int/2addr v6, v9

    shl-int/lit8 v8, v8, 0xc

    xor-int/2addr v6, v8

    shl-int/lit8 v7, v7, 0x12

    xor-int/2addr v6, v7

    const v7, 0x10ffff

    if-le v6, v7, :cond_168

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    goto :goto_198

    :cond_168
    if-le v13, v6, :cond_16b

    goto :goto_172

    :cond_16b
    if-lt v14, v6, :cond_172

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    goto :goto_198

    :cond_172
    :goto_172
    const/high16 v7, 0x10000

    if-ge v6, v7, :cond_17b

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    goto :goto_198

    :cond_17b
    if-eq v6, v11, :cond_194

    ushr-int/lit8 v7, v6, 0xa

    const v8, 0xd7c0

    add-int/2addr v7, v8

    int-to-char v7, v7

    add-int/lit8 v8, v5, 0x1

    aput-char v7, v3, v5

    and-int/lit16 v5, v6, 0x3ff

    const v6, 0xdc00

    add-int/2addr v5, v6

    int-to-char v5, v5

    add-int/lit8 v6, v8, 0x1

    aput-char v5, v3, v8

    goto :goto_198

    :cond_194
    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    :goto_198
    const/4 v9, 0x4

    :goto_199
    add-int/2addr v1, v9

    goto :goto_1a1

    :cond_19b
    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    add-int/lit8 v1, v1, 0x1

    :goto_1a1
    move v5, v6

    goto/16 :goto_18

    .line 38
    :cond_1a4
    new-instance v0, Ljava/lang/String;

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

    return-object v0

    .line 29
    :cond_1aa
    new-instance v3, Ljava/lang/ArrayIndexOutOfBoundsException;

    new-instance v4, Ljava/lang/StringBuilder;

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

    const-string v5, "size="

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

    array-length v0, v0

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

    const-string v0, " beginIndex="

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

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

    const-string v0, " endIndex="

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

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

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

    move-result-object v0

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

    check-cast v3, Ljava/lang/Throwable;

    throw v3
.end method

.method public static synthetic commonToUtf8String$default([BIIILjava/lang/Object;)Ljava/lang/String;
    .registers 5

    and-int/lit8 p4, p3, 0x1

    if-eqz p4, :cond_5

    const/4 p1, 0x0

    :cond_5
    and-int/lit8 p3, p3, 0x2

    if-eqz p3, :cond_a

    .line 27
    array-length p2, p0

    :cond_a
    invoke-static {p0, p1, p2}, Lokio/internal/_Utf8Kt;->commonToUtf8String([BII)Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method