c.smali

.class public final Lp4/c;
.super Ljava/lang/Object;
.source "CodedOutputStream.java"

# interfaces
.implements Ljava/io/Flushable;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lp4/c$a;
    }
.end annotation


# instance fields
.field public final a:[B

.field public final b:I

.field public c:I

.field public final d:Ljava/io/OutputStream;


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

    return-void
.end method

.method public constructor <init>(Ljava/io/OutputStream;[B)V
    .registers 3

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

    iput-object p1, p0, Lp4/c;->d:Ljava/io/OutputStream;

    iput-object p2, p0, Lp4/c;->a:[B

    const/4 p1, 0x0

    iput p1, p0, Lp4/c;->c:I

    array-length p1, p2

    iput p1, p0, Lp4/c;->b:I

    return-void
.end method

.method public static a(Ljava/io/OutputStream;)Lp4/c;
    .registers 2

    const/16 v0, 0x1000

    invoke-static {p0, v0}, Lp4/c;->a(Ljava/io/OutputStream;I)Lp4/c;

    move-result-object p0

    return-object p0
.end method

.method public static a(Ljava/io/OutputStream;I)Lp4/c;
    .registers 3

    new-instance v0, Lp4/c;

    new-array p1, p1, [B

    invoke-direct {v0, p0, p1}, Lp4/c;-><init>(Ljava/io/OutputStream;[B)V

    return-object v0
.end method

.method public static b(F)I
    .registers 1

    const/4 p0, 0x4

    return p0
.end method

.method public static b(IF)I
    .registers 2

    invoke-static {p0}, Lp4/c;->l(I)I

    move-result p0

    invoke-static {p1}, Lp4/c;->b(F)I

    move-result p1

    add-int/2addr p0, p1

    return p0
.end method

.method public static b(IJ)I
    .registers 3

    invoke-static {p0}, Lp4/c;->l(I)I

    move-result p0

    invoke-static {p1, p2}, Lp4/c;->d(J)I

    move-result p1

    add-int/2addr p0, p1

    return p0
.end method

.method public static b(ILp4/a;)I
    .registers 2

    invoke-static {p0}, Lp4/c;->l(I)I

    move-result p0

    invoke-static {p1}, Lp4/c;->c(Lp4/a;)I

    move-result p1

    add-int/2addr p0, p1

    return p0
.end method

.method public static b(IZ)I
    .registers 2

    invoke-static {p0}, Lp4/c;->l(I)I

    move-result p0

    invoke-static {p1}, Lp4/c;->b(Z)I

    move-result p1

    add-int/2addr p0, p1

    return p0
.end method

.method public static b(Z)I
    .registers 1

    const/4 p0, 0x1

    return p0
.end method

.method public static c(J)I
    .registers 7

    const-wide/16 v0, -0x80

    and-long/2addr v0, p0

    const-wide/16 v2, 0x0

    cmp-long v4, v0, v2

    if-nez v4, :cond_b

    const/4 p0, 0x1

    return p0

    :cond_b
    const-wide/16 v0, -0x4000

    and-long/2addr v0, p0

    cmp-long v4, v0, v2

    if-nez v4, :cond_14

    const/4 p0, 0x2

    return p0

    :cond_14
    const-wide/32 v0, -0x200000

    and-long/2addr v0, p0

    cmp-long v4, v0, v2

    if-nez v4, :cond_1e

    const/4 p0, 0x3

    return p0

    :cond_1e
    const-wide/32 v0, -0x10000000

    and-long/2addr v0, p0

    cmp-long v4, v0, v2

    if-nez v4, :cond_28

    const/4 p0, 0x4

    return p0

    :cond_28
    const-wide v0, -0x800000000L

    and-long/2addr v0, p0

    cmp-long v4, v0, v2

    if-nez v4, :cond_34

    const/4 p0, 0x5

    return p0

    :cond_34
    const-wide v0, -0x40000000000L

    and-long/2addr v0, p0

    cmp-long v4, v0, v2

    if-nez v4, :cond_40

    const/4 p0, 0x6

    return p0

    :cond_40
    const-wide/high16 v0, -0x2000000000000L

    and-long/2addr v0, p0

    cmp-long v4, v0, v2

    if-nez v4, :cond_49

    const/4 p0, 0x7

    return p0

    :cond_49
    const-wide/high16 v0, -0x100000000000000L

    and-long/2addr v0, p0

    cmp-long v4, v0, v2

    if-nez v4, :cond_53

    const/16 p0, 0x8

    return p0

    :cond_53
    const-wide/high16 v0, -0x8000000000000000L

    and-long/2addr p0, v0

    cmp-long v0, p0, v2

    if-nez v0, :cond_5d

    const/16 p0, 0x9

    return p0

    :cond_5d
    const/16 p0, 0xa

    return p0
.end method

.method public static c(Lp4/a;)I
    .registers 2

    invoke-virtual {p0}, Lp4/a;->b()I

    move-result v0

    invoke-static {v0}, Lp4/c;->j(I)I

    move-result v0

    invoke-virtual {p0}, Lp4/a;->b()I

    move-result p0

    add-int/2addr v0, p0

    return v0
.end method

.method public static d(J)I
    .registers 2

    invoke-static {p0, p1}, Lp4/c;->c(J)I

    move-result p0

    return p0
.end method

.method public static e(II)I
    .registers 2

    invoke-static {p0}, Lp4/c;->l(I)I

    move-result p0

    invoke-static {p1}, Lp4/c;->h(I)I

    move-result p1

    add-int/2addr p0, p1

    return p0
.end method

.method public static f(II)I
    .registers 2

    invoke-static {p0}, Lp4/c;->l(I)I

    move-result p0

    invoke-static {p1}, Lp4/c;->k(I)I

    move-result p1

    add-int/2addr p0, p1

    return p0
.end method

.method public static g(II)I
    .registers 2

    invoke-static {p0}, Lp4/c;->l(I)I

    move-result p0

    invoke-static {p1}, Lp4/c;->m(I)I

    move-result p1

    add-int/2addr p0, p1

    return p0
.end method

.method public static h(I)I
    .registers 1

    invoke-static {p0}, Lp4/c;->i(I)I

    move-result p0

    return p0
.end method

.method public static i(I)I
    .registers 1

    if-ltz p0, :cond_7

    invoke-static {p0}, Lp4/c;->j(I)I

    move-result p0

    return p0

    :cond_7
    const/16 p0, 0xa

    return p0
.end method

.method public static j(I)I
    .registers 2

    and-int/lit8 v0, p0, -0x80

    if-nez v0, :cond_6

    const/4 p0, 0x1

    return p0

    :cond_6
    and-int/lit16 v0, p0, -0x4000

    if-nez v0, :cond_c

    const/4 p0, 0x2

    return p0

    :cond_c
    const/high16 v0, -0x200000

    and-int/2addr v0, p0

    if-nez v0, :cond_13

    const/4 p0, 0x3

    return p0

    :cond_13
    const/high16 v0, -0x10000000

    and-int/2addr p0, v0

    if-nez p0, :cond_1a

    const/4 p0, 0x4

    return p0

    :cond_1a
    const/4 p0, 0x5

    return p0
.end method

.method public static k(I)I
    .registers 1

    invoke-static {p0}, Lp4/c;->n(I)I

    move-result p0

    invoke-static {p0}, Lp4/c;->j(I)I

    move-result p0

    return p0
.end method

.method public static l(I)I
    .registers 2

    const/4 v0, 0x0

    invoke-static {p0, v0}, Lcom/google/firebase/crashlytics/internal/proto/WireFormat;->a(II)I

    move-result p0

    invoke-static {p0}, Lp4/c;->j(I)I

    move-result p0

    return p0
.end method

.method public static m(I)I
    .registers 1

    invoke-static {p0}, Lp4/c;->j(I)I

    move-result p0

    return p0
.end method

.method public static n(I)I
    .registers 2

    shl-int/lit8 v0, p0, 0x1

    shr-int/lit8 p0, p0, 0x1f

    xor-int/2addr p0, v0

    return p0
.end method


# virtual methods
.method public final a()V
    .registers 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    iget-object v0, p0, Lp4/c;->d:Ljava/io/OutputStream;

    if-eqz v0, :cond_f

    iget-object v1, p0, Lp4/c;->a:[B

    iget v2, p0, Lp4/c;->c:I

    const/4 v3, 0x0

    invoke-virtual {v0, v1, v3, v2}, Ljava/io/OutputStream;->write([BII)V

    iput v3, p0, Lp4/c;->c:I

    return-void

    :cond_f
    new-instance v0, Lp4/c$a;

    invoke-direct {v0}, Lp4/c$a;-><init>()V

    throw v0
.end method

.method public a(B)V
    .registers 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    iget v0, p0, Lp4/c;->c:I

    iget v1, p0, Lp4/c;->b:I

    if-ne v0, v1, :cond_9

    invoke-virtual {p0}, Lp4/c;->a()V

    :cond_9
    iget-object v0, p0, Lp4/c;->a:[B

    iget v1, p0, Lp4/c;->c:I

    add-int/lit8 v2, v1, 0x1

    iput v2, p0, Lp4/c;->c:I

    aput-byte p1, v0, v1

    return-void
.end method

.method public a(F)V
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-static {p1}, Ljava/lang/Float;->floatToRawIntBits(F)I

    move-result p1

    invoke-virtual {p0, p1}, Lp4/c;->d(I)V

    return-void
.end method

.method public a(I)V
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-virtual {p0, p1}, Lp4/c;->b(I)V

    return-void
.end method

.method public a(IF)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x5

    invoke-virtual {p0, p1, v0}, Lp4/c;->c(II)V

    invoke-virtual {p0, p2}, Lp4/c;->a(F)V

    return-void
.end method

.method public a(II)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lp4/c;->c(II)V

    invoke-virtual {p0, p2}, Lp4/c;->a(I)V

    return-void
.end method

.method public a(IJ)V
    .registers 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lp4/c;->c(II)V

    invoke-virtual {p0, p2, p3}, Lp4/c;->b(J)V

    return-void
.end method

.method public a(ILp4/a;)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x2

    invoke-virtual {p0, p1, v0}, Lp4/c;->c(II)V

    invoke-virtual {p0, p2}, Lp4/c;->a(Lp4/a;)V

    return-void
.end method

.method public a(IZ)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lp4/c;->c(II)V

    invoke-virtual {p0, p2}, Lp4/c;->a(Z)V

    return-void
.end method

.method public a(J)V
    .registers 8
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    :goto_0
    const-wide/16 v0, -0x80

    and-long/2addr v0, p1

    const-wide/16 v2, 0x0

    cmp-long v4, v0, v2

    if-nez v4, :cond_e

    long-to-int p2, p1

    invoke-virtual {p0, p2}, Lp4/c;->c(I)V

    return-void

    :cond_e
    long-to-int v0, p1

    and-int/lit8 v0, v0, 0x7f

    or-int/lit16 v0, v0, 0x80

    invoke-virtual {p0, v0}, Lp4/c;->c(I)V

    const/4 v0, 0x7

    ushr-long/2addr p1, v0

    goto :goto_0
.end method

.method public a(Lp4/a;)V
    .registers 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-virtual {p1}, Lp4/a;->b()I

    move-result v0

    invoke-virtual {p0, v0}, Lp4/c;->e(I)V

    invoke-virtual {p0, p1}, Lp4/c;->b(Lp4/a;)V

    return-void
.end method

.method public a(Lp4/a;II)V
    .registers 10
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    iget v0, p0, Lp4/c;->b:I

    iget v1, p0, Lp4/c;->c:I

    sub-int v2, v0, v1

    if-lt v2, p3, :cond_13

    iget-object v0, p0, Lp4/c;->a:[B

    invoke-virtual {p1, v0, p2, v1, p3}, Lp4/a;->a([BIII)V

    iget p1, p0, Lp4/c;->c:I

    add-int/2addr p1, p3

    iput p1, p0, Lp4/c;->c:I

    goto :goto_5d

    :cond_13
    sub-int/2addr v0, v1

    iget-object v2, p0, Lp4/c;->a:[B

    invoke-virtual {p1, v2, p2, v1, v0}, Lp4/a;->a([BIII)V

    add-int/2addr p2, v0

    sub-int/2addr p3, v0

    iget v0, p0, Lp4/c;->b:I

    iput v0, p0, Lp4/c;->c:I

    invoke-virtual {p0}, Lp4/c;->a()V

    iget v0, p0, Lp4/c;->b:I

    const/4 v1, 0x0

    if-gt p3, v0, :cond_2f

    iget-object v0, p0, Lp4/c;->a:[B

    invoke-virtual {p1, v0, p2, v1, p3}, Lp4/a;->a([BIII)V

    iput p3, p0, Lp4/c;->c:I

    goto :goto_5d

    :cond_2f
    invoke-virtual {p1}, Lp4/a;->a()Ljava/io/InputStream;

    move-result-object p1

    int-to-long v2, p2

    invoke-virtual {p1, v2, v3}, Ljava/io/InputStream;->skip(J)J

    move-result-wide v4

    cmp-long p2, v2, v4

    if-nez p2, :cond_5e

    :goto_3c
    if-lez p3, :cond_5d

    iget p2, p0, Lp4/c;->b:I

    invoke-static {p3, p2}, Ljava/lang/Math;->min(II)I

    move-result p2

    iget-object v0, p0, Lp4/c;->a:[B

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

    move-result v0

    if-ne v0, p2, :cond_55

    iget-object p2, p0, Lp4/c;->d:Ljava/io/OutputStream;

    iget-object v2, p0, Lp4/c;->a:[B

    invoke-virtual {p2, v2, v1, v0}, Ljava/io/OutputStream;->write([BII)V

    sub-int/2addr p3, v0

    goto :goto_3c

    :cond_55
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string p2, "Read failed."

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

    throw p1

    :cond_5d
    :goto_5d
    return-void

    :cond_5e
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string p2, "Skip failed."

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

    goto :goto_67

    :goto_66
    throw p1

    :goto_67
    goto :goto_66
.end method

.method public a(Z)V
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-virtual {p0, p1}, Lp4/c;->c(I)V

    return-void
.end method

.method public a([B)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    array-length v0, p1

    const/4 v1, 0x0

    invoke-virtual {p0, p1, v1, v0}, Lp4/c;->a([BII)V

    return-void
.end method

.method public a([BII)V
    .registers 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    iget v0, p0, Lp4/c;->b:I

    iget v1, p0, Lp4/c;->c:I

    sub-int v2, v0, v1

    if-lt v2, p3, :cond_13

    iget-object v0, p0, Lp4/c;->a:[B

    invoke-static {p1, p2, v0, v1, p3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    iget p1, p0, Lp4/c;->c:I

    add-int/2addr p1, p3

    iput p1, p0, Lp4/c;->c:I

    goto :goto_34

    :cond_13
    sub-int/2addr v0, v1

    iget-object v2, p0, Lp4/c;->a:[B

    invoke-static {p1, p2, v2, v1, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    add-int/2addr p2, v0

    sub-int/2addr p3, v0

    iget v0, p0, Lp4/c;->b:I

    iput v0, p0, Lp4/c;->c:I

    invoke-virtual {p0}, Lp4/c;->a()V

    iget v0, p0, Lp4/c;->b:I

    if-gt p3, v0, :cond_2f

    iget-object v0, p0, Lp4/c;->a:[B

    const/4 v1, 0x0

    invoke-static {p1, p2, v0, v1, p3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    iput p3, p0, Lp4/c;->c:I

    goto :goto_34

    :cond_2f
    iget-object v0, p0, Lp4/c;->d:Ljava/io/OutputStream;

    invoke-virtual {v0, p1, p2, p3}, Ljava/io/OutputStream;->write([BII)V

    :goto_34
    return-void
.end method

.method public b(I)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    if-ltz p1, :cond_6

    invoke-virtual {p0, p1}, Lp4/c;->e(I)V

    goto :goto_a

    :cond_6
    int-to-long v0, p1

    invoke-virtual {p0, v0, v1}, Lp4/c;->a(J)V

    :goto_a
    return-void
.end method

.method public b(II)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lp4/c;->c(II)V

    invoke-virtual {p0, p2}, Lp4/c;->f(I)V

    return-void
.end method

.method public b(J)V
    .registers 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-virtual {p0, p1, p2}, Lp4/c;->a(J)V

    return-void
.end method

.method public b(Lp4/a;)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-virtual {p1}, Lp4/a;->b()I

    move-result v0

    const/4 v1, 0x0

    invoke-virtual {p0, p1, v1, v0}, Lp4/c;->a(Lp4/a;II)V

    return-void
.end method

.method public c(I)V
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    int-to-byte p1, p1

    invoke-virtual {p0, p1}, Lp4/c;->a(B)V

    return-void
.end method

.method public c(II)V
    .registers 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-static {p1, p2}, Lcom/google/firebase/crashlytics/internal/proto/WireFormat;->a(II)I

    move-result p1

    invoke-virtual {p0, p1}, Lp4/c;->e(I)V

    return-void
.end method

.method public d(I)V
    .registers 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    and-int/lit16 v0, p1, 0xff

    invoke-virtual {p0, v0}, Lp4/c;->c(I)V

    shr-int/lit8 v0, p1, 0x8

    and-int/lit16 v0, v0, 0xff

    invoke-virtual {p0, v0}, Lp4/c;->c(I)V

    shr-int/lit8 v0, p1, 0x10

    and-int/lit16 v0, v0, 0xff

    invoke-virtual {p0, v0}, Lp4/c;->c(I)V

    shr-int/lit8 p1, p1, 0x18

    and-int/lit16 p1, p1, 0xff

    invoke-virtual {p0, p1}, Lp4/c;->c(I)V

    return-void
.end method

.method public d(II)V
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lp4/c;->c(II)V

    invoke-virtual {p0, p2}, Lp4/c;->g(I)V

    return-void
.end method

.method public e(I)V
    .registers 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    :goto_0
    and-int/lit8 v0, p1, -0x80

    if-nez v0, :cond_8

    invoke-virtual {p0, p1}, Lp4/c;->c(I)V

    return-void

    :cond_8
    and-int/lit8 v0, p1, 0x7f

    or-int/lit16 v0, v0, 0x80

    invoke-virtual {p0, v0}, Lp4/c;->c(I)V

    ushr-int/lit8 p1, p1, 0x7

    goto :goto_0
.end method

.method public f(I)V
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-static {p1}, Lp4/c;->n(I)I

    move-result p1

    invoke-virtual {p0, p1}, Lp4/c;->e(I)V

    return-void
.end method

.method public flush()V
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    iget-object v0, p0, Lp4/c;->d:Ljava/io/OutputStream;

    if-eqz v0, :cond_7

    invoke-virtual {p0}, Lp4/c;->a()V

    :cond_7
    return-void
.end method

.method public g(I)V
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-virtual {p0, p1}, Lp4/c;->e(I)V

    return-void
.end method