Utf8.smali

.class final Lcom/google/protobuf/Utf8;
.super Ljava/lang/Object;
.source "Utf8.java"


# static fields
.field private static final boi:Lcom/google/protobuf/ez;


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

    .prologue
    .line 2995
    invoke-static {}, Lcom/google/protobuf/ey;->Fw()Z

    move-result v0

    if-eqz v0, :cond_17

    invoke-static {}, Lcom/google/protobuf/ey;->Fx()Z

    move-result v0

    if-eqz v0, :cond_17

    const/4 v0, 0x1

    .line 87
    :goto_d
    if-eqz v0, :cond_19

    new-instance v0, Lcom/google/protobuf/fb;

    invoke-direct {v0}, Lcom/google/protobuf/fb;-><init>()V

    :goto_14
    sput-object v0, Lcom/google/protobuf/Utf8;->boi:Lcom/google/protobuf/ez;

    .line 86
    return-void

    .line 2995
    :cond_17
    const/4 v0, 0x0

    goto :goto_d

    .line 87
    :cond_19
    new-instance v0, Lcom/google/protobuf/fa;

    invoke-direct {v0}, Lcom/google/protobuf/fa;-><init>()V

    goto :goto_14
.end method

.method private static P(III)I
    .registers 5

    .prologue
    const/16 v1, -0x41

    .line 202
    const/16 v0, -0xc

    if-gt p0, v0, :cond_a

    if-gt p1, v1, :cond_a

    if-le p2, v1, :cond_c

    :cond_a
    const/4 v0, -0x1

    :goto_b
    return v0

    :cond_c
    shl-int/lit8 v0, p1, 0x8

    xor-int/2addr v0, p0

    shl-int/lit8 v1, p2, 0x10

    xor-int/2addr v0, v1

    goto :goto_b
.end method

.method static synthetic Q(III)I
    .registers 4

    .prologue
    .line 79
    invoke-static {p0, p1, p2}, Lcom/google/protobuf/Utf8;->P(III)I

    move-result v0

    return v0
.end method

.method static a(Ljava/lang/CharSequence;[BII)I
    .registers 5

    .prologue
    .line 304
    sget-object v0, Lcom/google/protobuf/Utf8;->boi:Lcom/google/protobuf/ez;

    invoke-virtual {v0, p0, p1, p2, p3}, Lcom/google/protobuf/ez;->b(Ljava/lang/CharSequence;[BII)I

    move-result v0

    return v0
.end method

.method public static ad([B)Z
    .registers 4

    .prologue
    .line 152
    sget-object v0, Lcom/google/protobuf/Utf8;->boi:Lcom/google/protobuf/ez;

    const/4 v1, 0x0

    array-length v2, p0

    invoke-virtual {v0, p0, v1, v2}, Lcom/google/protobuf/ez;->i([BII)Z

    move-result v0

    return v0
.end method

.method private static as(II)I
    .registers 3

    .prologue
    .line 196
    const/16 v0, -0xc

    if-gt p0, v0, :cond_8

    const/16 v0, -0x41

    if-le p1, v0, :cond_a

    :cond_8
    const/4 v0, -0x1

    :goto_9
    return v0

    :cond_a
    shl-int/lit8 v0, p1, 0x8

    xor-int/2addr v0, p0

    goto :goto_9
.end method

.method static synthetic at(II)I
    .registers 3

    .prologue
    .line 79
    invoke-static {p0, p1}, Lcom/google/protobuf/Utf8;->as(II)I

    move-result v0

    return v0
.end method

.method public static b(I[BII)I
    .registers 5

    .prologue
    .line 187
    sget-object v0, Lcom/google/protobuf/Utf8;->boi:Lcom/google/protobuf/ez;

    invoke-virtual {v0, p0, p1, p2, p3}, Lcom/google/protobuf/ez;->b(I[BII)I

    move-result v0

    return v0
.end method

.method private static eb(I)I
    .registers 2

    .prologue
    .line 191
    const/16 v0, -0xc

    if-le p0, v0, :cond_5

    const/4 p0, -0x1

    :cond_5
    return p0
.end method

.method static synthetic ec(I)I
    .registers 2

    .prologue
    .line 79
    invoke-static {p0}, Lcom/google/protobuf/Utf8;->eb(I)I

    move-result v0

    return v0
.end method

.method public static i([BII)Z
    .registers 4

    .prologue
    .line 165
    sget-object v0, Lcom/google/protobuf/Utf8;->boi:Lcom/google/protobuf/ez;

    invoke-virtual {v0, p0, p1, p2}, Lcom/google/protobuf/ez;->i([BII)Z

    move-result v0

    return v0
.end method

.method static synthetic j([BII)I
    .registers 6

    .prologue
    .line 79
    .line 2209
    add-int/lit8 v0, p1, -0x1

    aget-byte v0, p0, v0

    .line 2210
    sub-int v1, p2, p1

    packed-switch v1, :pswitch_data_26

    .line 2214
    new-instance v0, Ljava/lang/AssertionError;

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

    throw v0

    .line 2211
    :pswitch_f
    invoke-static {v0}, Lcom/google/protobuf/Utf8;->eb(I)I

    move-result v0

    .line 2213
    :goto_13
    return v0

    .line 2212
    :pswitch_14
    aget-byte v1, p0, p1

    invoke-static {v0, v1}, Lcom/google/protobuf/Utf8;->as(II)I

    move-result v0

    goto :goto_13

    .line 2213
    :pswitch_1b
    aget-byte v1, p0, p1

    add-int/lit8 v2, p1, 0x1

    aget-byte v2, p0, v2

    invoke-static {v0, v1, v2}, Lcom/google/protobuf/Utf8;->P(III)I

    move-result v0

    goto :goto_13

    .line 2210
    :pswitch_data_26
    .packed-switch 0x0
        :pswitch_f
        :pswitch_14
        :pswitch_1b
    .end packed-switch
.end method

.method static r(Ljava/lang/CharSequence;)I
    .registers 9

    .prologue
    const/16 v7, 0x800

    const/4 v0, 0x0

    .line 252
    invoke-interface {p0}, Ljava/lang/CharSequence;->length()I

    move-result v3

    move v1, v0

    .line 257
    :goto_8
    if-ge v1, v3, :cond_78

    invoke-interface {p0, v1}, Ljava/lang/CharSequence;->charAt(I)C

    move-result v2

    const/16 v4, 0x80

    if-ge v2, v4, :cond_78

    .line 258
    add-int/lit8 v1, v1, 0x1

    goto :goto_8

    .line 262
    :goto_15
    if-ge v1, v3, :cond_76

    .line 263
    invoke-interface {p0, v1}, Ljava/lang/CharSequence;->charAt(I)C

    move-result v4

    .line 264
    if-ge v4, v7, :cond_25

    .line 265
    rsub-int/lit8 v4, v4, 0x7f

    ushr-int/lit8 v4, v4, 0x1f

    add-int/2addr v2, v4

    .line 262
    add-int/lit8 v1, v1, 0x1

    goto :goto_15

    .line 1281
    :cond_25
    invoke-interface {p0}, Ljava/lang/CharSequence;->length()I

    move-result v4

    .line 1283
    :goto_29
    if-ge v1, v4, :cond_56

    .line 1284
    invoke-interface {p0, v1}, Ljava/lang/CharSequence;->charAt(I)C

    move-result v5

    .line 1285
    if-ge v5, v7, :cond_39

    .line 1286
    rsub-int/lit8 v5, v5, 0x7f

    ushr-int/lit8 v5, v5, 0x1f

    add-int/2addr v0, v5

    .line 1283
    :cond_36
    :goto_36
    add-int/lit8 v1, v1, 0x1

    goto :goto_29

    .line 1288
    :cond_39
    add-int/lit8 v0, v0, 0x2

    .line 1290
    const v6, 0xd800

    if-gt v6, v5, :cond_36

    const v6, 0xdfff

    if-gt v5, v6, :cond_36

    .line 1292
    invoke-static {p0, v1}, Ljava/lang/Character;->codePointAt(Ljava/lang/CharSequence;I)I

    move-result v5

    .line 1293
    const/high16 v6, 0x10000

    if-ge v5, v6, :cond_53

    .line 1294
    new-instance v0, Lcom/google/protobuf/Utf8$UnpairedSurrogateException;

    invoke-direct {v0, v1, v4}, Lcom/google/protobuf/Utf8$UnpairedSurrogateException;-><init>(II)V

    throw v0

    .line 1296
    :cond_53
    add-int/lit8 v1, v1, 0x1

    goto :goto_36

    .line 267
    :cond_56
    add-int/2addr v0, v2

    .line 272
    :goto_57
    if-ge v0, v3, :cond_75

    .line 274
    new-instance v1, Ljava/lang/IllegalArgumentException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "UTF-8 length does not fit in int: "

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

    int-to-long v4, v0

    const-wide v6, 0x100000000L

    add-long/2addr v4, v6

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

    move-result-object v0

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

    move-result-object v0

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

    throw v1

    .line 277
    :cond_75
    return v0

    :cond_76
    move v0, v2

    goto :goto_57

    :cond_78
    move v2, v3

    goto :goto_15
.end method