package com.google.common.collect;

import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.util.Objects;

/* JADX INFO: loaded from: classes2.dex */
@GwtCompatible(emulated = true, serializable = true)
@ElementTypesAreNonnullByDefault
public class ImmutableListMultimap<K, V> extends ImmutableMultimap<K, V> implements a1 {

    @J2ktIncompatible
    @GwtIncompatible
    private static final long serialVersionUID = 0;

    public static ImmutableListMultimap n() {
        return EmptyImmutableListMultimap.f23583g;
    }

    @J2ktIncompatible
    @GwtIncompatible
    private void readObject(ObjectInputStream objectInputStream) throws ClassNotFoundException, IOException {
        objectInputStream.defaultReadObject();
        int i10 = objectInputStream.readInt();
        if (i10 < 0) {
            throw new InvalidObjectException(com.google.android.gms.measurement.internal.u1.g("Invalid key count ", i10));
        }
        q0 q0VarA = ImmutableMap.a();
        int i11 = 0;
        for (int i12 = 0; i12 < i10; i12++) {
            Object object = objectInputStream.readObject();
            Objects.requireNonNull(object);
            int i13 = objectInputStream.readInt();
            if (i13 <= 0) {
                throw new InvalidObjectException(com.google.android.gms.measurement.internal.u1.g("Invalid value count ", i13));
            }
            m0 m0VarM = ImmutableList.m();
            for (int i14 = 0; i14 < i13; i14++) {
                Object object2 = objectInputStream.readObject();
                Objects.requireNonNull(object2);
                m0VarM.c(object2);
            }
            q0VarA.b(object, m0VarM.i());
            i11 += i13;
        }
        try {
            u0.f23732a.A(this, q0VarA.a());
            xyz.stream.utils.f0 f0Var = u0.f23733b;
            f0Var.getClass();
            try {
                ((Field) f0Var.f36136b).set(this, Integer.valueOf(i11));
            } catch (IllegalAccessException e10) {
                throw new AssertionError(e10);
            }
        } catch (IllegalArgumentException e11) {
            throw ((InvalidObjectException) new InvalidObjectException(e11.getMessage()).initCause(e11));
        }
    }

    @J2ktIncompatible
    @GwtIncompatible
    private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
        objectOutputStream.defaultWriteObject();
        z0.D(this, objectOutputStream);
    }

    @Override // com.google.common.collect.e1
    /* JADX INFO: renamed from: m, reason: merged with bridge method [inline-methods] */
    public final ImmutableList get(Object obj) {
        ImmutableList immutableList = (ImmutableList) this.f23605e.get(obj);
        if (immutableList != null) {
            return immutableList;
        }
        n0 n0Var = ImmutableList.f23599b;
        return RegularImmutableList.f23615e;
    }
}
