package androidx.compose.ui.platform;

import android.os.Parcel;
import android.util.Base64;
import c3.v;
import c3.x;
import s1.g0;
import v2.p;
import v2.q;

/* loaded from: classes.dex */
public final class k1 {

    /* renamed from: a, reason: collision with root package name */
    private Parcel f2482a = Parcel.obtain();

    public final void a(byte b10) {
        this.f2482a.writeByte(b10);
    }

    public final void b(float f10) {
        this.f2482a.writeFloat(f10);
    }

    public final void c(int i10) {
        this.f2482a.writeInt(i10);
    }

    public final void d(b3.k kVar) {
        c(kVar.e());
    }

    public final void e(b3.o oVar) {
        b(oVar.b());
        b(oVar.c());
    }

    public final void f(String str) {
        this.f2482a.writeString(str);
    }

    public final void g(q2.b0 b0Var) {
        long g10 = b0Var.g();
        g0.a aVar = s1.g0.f35254b;
        if (!s1.g0.n(g10, aVar.f())) {
            a((byte) 1);
            m(b0Var.g());
        }
        long k10 = b0Var.k();
        v.a aVar2 = c3.v.f7436b;
        if (!c3.v.e(k10, aVar2.a())) {
            a((byte) 2);
            j(b0Var.k());
        }
        v2.r n10 = b0Var.n();
        if (n10 != null) {
            a((byte) 3);
            i(n10);
        }
        v2.p l10 = b0Var.l();
        if (l10 != null) {
            int i10 = l10.i();
            a((byte) 4);
            o(i10);
        }
        v2.q m10 = b0Var.m();
        if (m10 != null) {
            int k11 = m10.k();
            a((byte) 5);
            l(k11);
        }
        String j10 = b0Var.j();
        if (j10 != null) {
            a((byte) 6);
            f(j10);
        }
        if (!c3.v.e(b0Var.o(), aVar2.a())) {
            a((byte) 7);
            j(b0Var.o());
        }
        b3.a e10 = b0Var.e();
        if (e10 != null) {
            float i11 = e10.i();
            a((byte) 8);
            k(i11);
        }
        b3.o u10 = b0Var.u();
        if (u10 != null) {
            a((byte) 9);
            e(u10);
        }
        if (!s1.g0.n(b0Var.d(), aVar.f())) {
            a((byte) 10);
            m(b0Var.d());
        }
        b3.k s10 = b0Var.s();
        if (s10 != null) {
            a((byte) 11);
            d(s10);
        }
        s1.p1 r10 = b0Var.r();
        if (r10 != null) {
            a((byte) 12);
            h(r10);
        }
    }

    public final void h(s1.p1 p1Var) {
        m(p1Var.c());
        b(r1.g.m(p1Var.d()));
        b(r1.g.n(p1Var.d()));
        b(p1Var.b());
    }

    public final void i(v2.r rVar) {
        c(rVar.v());
    }

    public final void j(long j10) {
        long g10 = c3.v.g(j10);
        x.a aVar = c3.x.f7440b;
        byte b10 = 0;
        if (!c3.x.g(g10, aVar.c())) {
            if (c3.x.g(g10, aVar.b())) {
                b10 = 1;
            } else if (c3.x.g(g10, aVar.a())) {
                b10 = 2;
            }
        }
        a(b10);
        if (c3.x.g(c3.v.g(j10), aVar.c())) {
            return;
        }
        b(c3.v.h(j10));
    }

    public final void k(float f10) {
        b(f10);
    }

    public final void l(int i10) {
        q.a aVar = v2.q.f38991b;
        byte b10 = 0;
        if (!v2.q.h(i10, aVar.b())) {
            if (v2.q.h(i10, aVar.a())) {
                b10 = 1;
            } else if (v2.q.h(i10, aVar.d())) {
                b10 = 2;
            } else if (v2.q.h(i10, aVar.c())) {
                b10 = 3;
            }
        }
        a(b10);
    }

    public final void m(long j10) {
        n(j10);
    }

    public final void n(long j10) {
        this.f2482a.writeLong(j10);
    }

    public final void o(int i10) {
        p.a aVar = v2.p.f38987b;
        byte b10 = 0;
        if (!v2.p.f(i10, aVar.b()) && v2.p.f(i10, aVar.a())) {
            b10 = 1;
        }
        a(b10);
    }

    public final String p() {
        return Base64.encodeToString(this.f2482a.marshall(), 0);
    }

    public final void q() {
        this.f2482a.recycle();
        this.f2482a = Parcel.obtain();
    }
}
