package com.google.ads.interactivemedia.v3.internal;

import android.os.Parcel;
import android.os.Parcelable;
import com.bumptech.glide.g;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Class;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Constructor;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Field;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Param;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable$VersionField;

/* JADX INFO: loaded from: classes2.dex */
@SafeParcelable$Class(creator = "GassResponseParcelCreator")
public final class zzor extends f8.a {
    public static final Parcelable.Creator<zzor> CREATOR = new zzos();

    @SafeParcelable$VersionField(id = 1)
    public final int zza;

    @SafeParcelable$Field(getter = "getAfmaSignalsAsBytes", id = 2, type = "byte[]")
    private zzbp zzb = null;
    private byte[] zzc;

    @SafeParcelable$Constructor
    public zzor(@SafeParcelable$Param(id = 1) int i10, @SafeParcelable$Param(id = 2) byte[] bArr) {
        this.zza = i10;
        this.zzc = bArr;
        zzb();
    }

    private final void zzb() {
        zzbp zzbpVar = this.zzb;
        if (zzbpVar != null || this.zzc == null) {
            if (zzbpVar == null || this.zzc != null) {
                if (zzbpVar != null && this.zzc != null) {
                    throw new IllegalStateException("Invalid internal representation - full");
                }
                if (zzbpVar != null || this.zzc != null) {
                    throw new IllegalStateException("Impossible");
                }
                throw new IllegalStateException("Invalid internal representation - empty");
            }
        }
    }

    @Override // android.os.Parcelable
    public final void writeToParcel(Parcel parcel, int i10) {
        int i11 = this.zza;
        int I = g.I(20293, parcel);
        g.C(parcel, 1, 4);
        parcel.writeInt(i11);
        byte[] bArrZzav = this.zzc;
        if (bArrZzav == null) {
            bArrZzav = this.zzb.zzav();
        }
        g.o(parcel, 2, bArrZzav);
        g.N(I, parcel);
    }

    public final zzbp zza() {
        if (this.zzb == null) {
            try {
                this.zzb = zzbp.zzd(this.zzc, zzadk.zza());
                this.zzc = null;
            } catch (zzaeg | NullPointerException e10) {
                throw new IllegalStateException(e10);
            }
        }
        zzb();
        return this.zzb;
    }
}
