_Utf8Kt.smali

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


# annotations
.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,
        0x10
    }
.end annotation


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

    return-void
.end method

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

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

    move-result v0

    mul-int/lit8 v0, v0, 0x4

    new-array v0, v0, [B

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

    move-result v1

    const/4 v2, 0x0

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

    if-ge v2, v1, :cond_e0

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

    move-result v4

    const/16 v5, 0x80

    if-lt v4, v5, :cond_d9

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

    move-result v1

    move v4, v2

    :goto_1e
    if-ge v2, v1, :cond_d1

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

    move-result v6

    if-ge v6, v5, :cond_45

    int-to-byte v6, v6

    add-int/lit8 v7, v4, 0x1

    aput-byte v6, v0, v4

    add-int/lit8 v2, v2, 0x1

    :goto_2d
    if-ge v2, v1, :cond_43

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

    move-result v4

    if-ge v4, v5, :cond_43

    add-int/lit8 v4, v2, 0x1

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

    move-result v2

    int-to-byte v2, v2

    add-int/lit8 v6, v7, 0x1

    aput-byte v2, v0, v7

    move v2, v4

    move v7, v6

    goto :goto_2d

    :cond_43
    move v4, v7

    goto :goto_1e

    :cond_45
    const/16 v7, 0x800

    if-ge v6, v7, :cond_5e

    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_5a
    add-int/lit8 v2, v2, 0x1

    :goto_5c
    move v4, v6

    goto :goto_1e

    :cond_5e
    const v7, 0xd800

    const/16 v8, 0x3f

    if-gt v7, v6, :cond_b6

    const v7, 0xdfff

    if-ge v7, v6, :cond_6b

    goto :goto_b6

    :cond_6b
    const v9, 0xdbff

    if-gt v6, v9, :cond_b1

    add-int/lit8 v9, v2, 0x1

    if-le v1, v9, :cond_b1

    const v10, 0xdc00

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

    move-result v11

    if-gt v10, v11, :cond_b1

    if-ge v7, v11, :cond_80

    goto :goto_b1

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

    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

    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_5c

    :cond_b1
    :goto_b1
    add-int/lit8 v6, v4, 0x1

    aput-byte v8, v0, v4

    goto :goto_5a

    :cond_b6
    :goto_b6
    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_5a

    :cond_d1
    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_d9
    int-to-byte v3, v4

    aput-byte v3, v0, v2

    add-int/lit8 v2, v2, 0x1

    goto/16 :goto_d

    :cond_e0
    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

    if-ltz v1, :cond_1a5

    array-length v3, v0

    if-gt v2, v3, :cond_1a5

    if-gt v1, v2, :cond_1a5

    sub-int v3, v2, v1

    new-array v3, v3, [C

    const/4 v4, 0x0

    const/4 v5, 0x0

    :goto_13
    if-ge v1, v2, :cond_19f

    aget-byte v6, v0, v1

    if-ltz v6, :cond_34

    int-to-char v6, v6

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    add-int/lit8 v1, v1, 0x1

    :goto_20
    if-ge v1, v2, :cond_32

    aget-byte v5, v0, v1

    if-ltz v5, :cond_32

    add-int/lit8 v5, v1, 0x1

    aget-byte v1, v0, v1

    int-to-char v1, v1

    add-int/lit8 v6, v7, 0x1

    aput-char v1, v3, v7

    move v1, v5

    move v7, v6

    goto :goto_20

    :cond_32
    :goto_32
    move v5, v7

    goto :goto_13

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

    const/4 v8, -0x2

    const/16 v10, 0x80

    const v11, 0xfffd

    if-ne v7, v8, :cond_71

    add-int/lit8 v6, v1, 0x1

    if-gt v2, v6, :cond_49

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    :cond_47
    :goto_47
    const/4 v9, 0x1

    goto :goto_6f

    :cond_49
    aget-byte v7, v0, v1

    aget-byte v6, v0, v6

    and-int/lit16 v8, v6, 0xc0

    if-ne v8, v10, :cond_53

    const/4 v8, 0x1

    goto :goto_54

    :cond_53
    const/4 v8, 0x0

    :goto_54
    if-nez v8, :cond_5c

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    goto :goto_47

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

    shl-int/lit8 v7, v7, 0x6

    xor-int/2addr v6, v7

    if-ge v6, v10, :cond_69

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    goto :goto_6e

    :cond_69
    int-to-char v6, v6

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    :cond_6e
    :goto_6e
    const/4 v9, 0x2

    :goto_6f
    add-int/2addr v1, v9

    goto :goto_32

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

    const v13, 0xd800

    const v14, 0xdfff

    const/4 v15, 0x3

    if-ne v7, v8, :cond_e1

    add-int/lit8 v6, v1, 0x2

    if-gt v2, v6, :cond_95

    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_47

    aget-byte v5, v0, v5

    and-int/lit16 v5, v5, 0xc0

    if-ne v5, v10, :cond_91

    const/4 v5, 0x1

    goto :goto_92

    :cond_91
    const/4 v5, 0x0

    :goto_92
    if-nez v5, :cond_6e

    goto :goto_47

    :cond_95
    aget-byte v7, v0, v1

    add-int/lit8 v8, v1, 0x1

    aget-byte v8, v0, v8

    and-int/lit16 v9, v8, 0xc0

    if-ne v9, v10, :cond_a1

    const/4 v9, 0x1

    goto :goto_a2

    :cond_a1
    const/4 v9, 0x0

    :goto_a2
    if-nez v9, :cond_aa

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    goto :goto_47

    :cond_aa
    aget-byte v6, v0, v6

    and-int/lit16 v9, v6, 0xc0

    if-ne v9, v10, :cond_b2

    const/4 v12, 0x1

    goto :goto_b3

    :cond_b2
    const/4 v12, 0x0

    :goto_b3
    if-nez v12, :cond_bb

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    goto :goto_6e

    :cond_bb
    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_cf

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    goto :goto_df

    :cond_cf
    if-le v13, v6, :cond_d2

    goto :goto_da

    :cond_d2
    if-lt v14, v6, :cond_da

    int-to-char v6, v11

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    goto :goto_df

    :cond_da
    :goto_da
    int-to-char v6, v6

    add-int/lit8 v7, v5, 0x1

    aput-char v6, v3, v5

    :goto_df
    const/4 v9, 0x3

    goto :goto_6f

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

    if-ne v6, v8, :cond_196

    add-int/lit8 v6, v1, 0x3

    if-gt v2, v6, :cond_116

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    add-int/lit8 v5, v1, 0x1

    if-le v2, v5, :cond_113

    aget-byte v5, v0, v5

    and-int/lit16 v5, v5, 0xc0

    if-ne v5, v10, :cond_f9

    const/4 v5, 0x1

    goto :goto_fa

    :cond_f9
    const/4 v5, 0x0

    :goto_fa
    if-nez v5, :cond_fd

    goto :goto_113

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

    if-le v2, v5, :cond_110

    aget-byte v5, v0, v5

    and-int/lit16 v5, v5, 0xc0

    if-ne v5, v10, :cond_109

    const/4 v12, 0x1

    goto :goto_10a

    :cond_109
    const/4 v12, 0x0

    :goto_10a
    if-nez v12, :cond_10d

    goto :goto_110

    :cond_10d
    :goto_10d
    const/4 v9, 0x3

    goto/16 :goto_194

    :cond_110
    :goto_110
    const/4 v9, 0x2

    goto/16 :goto_194

    :cond_113
    :goto_113
    const/4 v9, 0x1

    goto/16 :goto_194

    :cond_116
    aget-byte v7, v0, v1

    add-int/lit8 v8, v1, 0x1

    aget-byte v8, v0, v8

    and-int/lit16 v9, v8, 0xc0

    if-ne v9, v10, :cond_122

    const/4 v9, 0x1

    goto :goto_123

    :cond_122
    const/4 v9, 0x0

    :goto_123
    if-nez v9, :cond_12a

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    goto :goto_113

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

    aget-byte v9, v0, v9

    and-int/lit16 v12, v9, 0xc0

    if-ne v12, v10, :cond_134

    const/4 v12, 0x1

    goto :goto_135

    :cond_134
    const/4 v12, 0x0

    :goto_135
    if-nez v12, :cond_13c

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    goto :goto_110

    :cond_13c
    aget-byte v6, v0, v6

    and-int/lit16 v12, v6, 0xc0

    if-ne v12, v10, :cond_144

    const/4 v12, 0x1

    goto :goto_145

    :cond_144
    const/4 v12, 0x0

    :goto_145
    if-nez v12, :cond_14c

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    goto :goto_10d

    :cond_14c
    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_163

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    goto :goto_193

    :cond_163
    if-le v13, v6, :cond_166

    goto :goto_16d

    :cond_166
    if-lt v14, v6, :cond_16d

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    goto :goto_193

    :cond_16d
    :goto_16d
    const/high16 v7, 0x10000

    if-ge v6, v7, :cond_176

    add-int/lit8 v6, v5, 0x1

    aput-char v11, v3, v5

    goto :goto_193

    :cond_176
    if-eq v6, v11, :cond_18f

    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_193

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

    aput-char v11, v3, v5

    :goto_193
    const/4 v9, 0x4

    :goto_194
    add-int/2addr v1, v9

    goto :goto_19c

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

    aput-char v11, v3, v5

    add-int/lit8 v1, v1, 0x1

    :goto_19c
    move v5, v6

    goto/16 :goto_13

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

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

    return-object v0

    :cond_1a5
    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

    goto :goto_1ce

    :goto_1cd
    throw v3

    :goto_1ce
    goto :goto_1cd
.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

    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