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

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public long f16841a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final String f16842b;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final long f16844d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final long f16845e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final long f16846f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final long f16847g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final List f16848h;

    public tc(String str, String str2, long j10, long j11, long j12, long j13, List list) {
        this.f16842b = str;
        this.f16843c = true == "".equals(str2) ? null : str2;
        this.f16844d = j10;
        this.f16845e = j11;
        this.f16846f = j12;
        this.f16847g = j13;
        this.f16848h = list;
    }

    public static tc a(it1 it1Var) throws IOException {
        if (vc.f(it1Var) != 538247942) {
            throw new IOException();
        }
        String strJ = vc.j(it1Var);
        String strJ2 = vc.j(it1Var);
        long jH = vc.h(it1Var);
        long jH2 = vc.h(it1Var);
        long jH3 = vc.h(it1Var);
        long jH4 = vc.h(it1Var);
        int iF = vc.f(it1Var);
        if (iF < 0) {
            throw new IOException(defpackage.e.n(new StringBuilder(String.valueOf(iF).length() + 20), "readHeaderList size=", iF));
        }
        List listEmptyList = iF == 0 ? Collections.emptyList() : new ArrayList();
        for (int i10 = 0; i10 < iF; i10++) {
            listEmptyList.add(new cc(vc.j(it1Var).intern(), vc.j(it1Var).intern()));
        }
        return new tc(strJ, strJ2, jH, jH2, jH3, jH4, listEmptyList);
    }

    /* JADX WARN: Illegal instructions before constructor call */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r0v0, types: [java.util.List] */
    /* JADX WARN: Type inference failed for: r0v1, types: [java.util.ArrayList] */
    /* JADX WARN: Type inference failed for: r0v2 */
    /* JADX WARN: Type inference failed for: r11v1, types: [java.util.List] */
    public tc(String str, yb ybVar) {
        String str2 = ybVar.f18780b;
        long j10 = ybVar.f18781c;
        long j11 = ybVar.f18782d;
        long j12 = ybVar.f18783e;
        long j13 = ybVar.f18784f;
        ?? arrayList = ybVar.f18786h;
        if (arrayList == 0) {
            Map map = ybVar.f18785g;
            arrayList = new ArrayList(map.size());
            for (Map.Entry entry : map.entrySet()) {
                arrayList.add(new cc((String) entry.getKey(), (String) entry.getValue()));
            }
        }
        this(str, str2, j10, j11, j12, j13, arrayList);
    }
}
