package com.google.android.gms.internal.ads;

import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final int f11169a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final byte[] f11170b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final boolean f11171c;

    @Nullable
    public final Map zzc;

    @Nullable
    public final List zzd;

    private fc(int i10, byte[] bArr, @Nullable Map map, @Nullable List list, boolean z10, long j10) {
        this.f11169a = i10;
        this.f11170b = bArr;
        this.zzc = map;
        this.zzd = list == null ? null : Collections.unmodifiableList(list);
        this.f11171c = z10;
    }

    @Nullable
    private static List zza(@Nullable Map map) {
        if (map == null) {
            return null;
        }
        if (map.isEmpty()) {
            return Collections.emptyList();
        }
        ArrayList arrayList = new ArrayList(map.size());
        for (Map.Entry entry : map.entrySet()) {
            arrayList.add(new cc((String) entry.getKey(), (String) entry.getValue()));
        }
        return arrayList;
    }

    @Deprecated
    public fc(int i10, byte[] bArr, @Nullable Map map, boolean z10, long j10) {
        this(i10, bArr, map, zza(map), z10, j10);
    }

    /* JADX WARN: Illegal instructions before constructor call */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r0v1, types: [java.util.TreeMap] */
    /* JADX WARN: Type inference failed for: r0v2, types: [java.util.Map] */
    /* JADX WARN: Type inference failed for: r0v3 */
    /* JADX WARN: Type inference failed for: r0v5 */
    /* JADX WARN: Type inference failed for: r3v1, types: [java.util.Map] */
    public fc(int i10, byte[] bArr, boolean z10, long j10, @Nullable List list) {
        ?? treeMap;
        if (list == null) {
            treeMap = 0;
        } else if (list.isEmpty()) {
            treeMap = Collections.emptyMap();
        } else {
            treeMap = new TreeMap(String.CASE_INSENSITIVE_ORDER);
            Iterator it = list.iterator();
            while (it.hasNext()) {
                cc ccVar = (cc) it.next();
                treeMap.put(ccVar.f9861a, ccVar.f9862b);
            }
        }
        this(i10, bArr, treeMap, list, z10, j10);
    }

    @Deprecated
    public fc(byte[] bArr, @Nullable Map map) {
        this(200, bArr, map, zza(map), false, 0L);
    }
}
