package com.google.common.collect;

import java.util.Arrays;

/* JADX INFO: loaded from: classes2.dex */
public final class q0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public Object[] f23712a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f23713b = 0;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public p0 f23714c;

    public q0(int i10) {
        this.f23712a = new Object[i10 * 2];
    }

    public final ImmutableMap a() {
        p0 p0Var = this.f23714c;
        if (p0Var != null) {
            throw p0Var.a();
        }
        RegularImmutableMap regularImmutableMapK = RegularImmutableMap.k(this.f23713b, this.f23712a, this);
        p0 p0Var2 = this.f23714c;
        if (p0Var2 == null) {
            return regularImmutableMapK;
        }
        throw p0Var2.a();
    }

    public final void b(Object obj, Object obj2) {
        int i10 = (this.f23713b + 1) * 2;
        Object[] objArr = this.f23712a;
        if (i10 > objArr.length) {
            this.f23712a = Arrays.copyOf(objArr, l0.b(objArr.length, i10));
        }
        z0.c(obj, obj2);
        Object[] objArr2 = this.f23712a;
        int i11 = this.f23713b;
        int i12 = i11 * 2;
        objArr2[i12] = obj;
        objArr2[i12 + 1] = obj2;
        this.f23713b = i11 + 1;
    }
}
