package com.bumptech.glide.load.engine;

import com.google.android.gms.internal.ads.b12;
import com.google.android.gms.internal.ads.d12;
import com.google.android.gms.internal.ads.e12;
import com.google.android.gms.internal.ads.g12;
import java.security.GeneralSecurityException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public final class b0 {

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

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

    public /* synthetic */ b0(Map map, Map map2) {
        this.f5645a = map;
        this.f5646b = map2;
    }

    public static b0 c() {
        return new b0(0);
    }

    public Object a(Enum r42) throws GeneralSecurityException {
        Object obj = this.f5645a.get(r42);
        if (obj != null) {
            return obj;
        }
        throw new GeneralSecurityException("Unable to convert proto enum: " + r42);
    }

    public Enum b(Object obj) throws GeneralSecurityException {
        Enum r02 = (Enum) this.f5646b.get(obj);
        if (r02 != null) {
            return r02;
        }
        throw new GeneralSecurityException("Unable to convert object enum: " + obj);
    }

    public void d(b12 b12Var) throws GeneralSecurityException {
        if (b12Var == null) {
            throw new NullPointerException("primitive constructor must be non-null");
        }
        d12 d12Var = new d12(b12Var.f9339a, b12Var.f9340b);
        Map map = this.f5645a;
        if (!map.containsKey(d12Var)) {
            map.put(d12Var, b12Var);
            return;
        }
        b12 b12Var2 = (b12) map.get(d12Var);
        if (!b12Var2.equals(b12Var) || !b12Var.equals(b12Var2)) {
            throw new GeneralSecurityException("Attempt to register non-equal PrimitiveConstructor object for already existing object of type: ".concat(d12Var.toString()));
        }
    }

    public void e(Enum r22, Object obj) {
        this.f5645a.put(r22, obj);
        this.f5646b.put(obj, r22);
    }

    public b0 f() {
        return new b0(Collections.unmodifiableMap(this.f5645a), Collections.unmodifiableMap(this.f5646b));
    }

    public Enum g(Object obj) throws GeneralSecurityException {
        Enum r02 = (Enum) this.f5646b.get(obj);
        if (r02 != null) {
            return r02;
        }
        throw new GeneralSecurityException("Unable to convert object enum: ".concat(String.valueOf(obj)));
    }

    public void h(g12 g12Var) throws GeneralSecurityException {
        Class clsZza = g12Var.zza();
        Map map = this.f5646b;
        if (!map.containsKey(clsZza)) {
            map.put(clsZza, g12Var);
            return;
        }
        g12 g12Var2 = (g12) map.get(clsZza);
        if (!g12Var2.equals(g12Var) || !g12Var.equals(g12Var2)) {
            throw new GeneralSecurityException("Attempt to register non-equal PrimitiveWrapper object or input class object for already existing object of type".concat(clsZza.toString()));
        }
    }

    public Object i(Enum r32) throws GeneralSecurityException {
        Object obj = this.f5645a.get(r32);
        if (obj != null) {
            return obj;
        }
        throw new GeneralSecurityException("Unable to convert proto enum: ".concat(String.valueOf(r32)));
    }

    public /* synthetic */ b0(int i10) {
        if (i10 != 2) {
            this.f5645a = new HashMap();
            this.f5646b = new HashMap();
        } else {
            this.f5645a = new HashMap();
            this.f5646b = new HashMap();
        }
    }

    public /* synthetic */ b0(e12 e12Var) {
        this.f5645a = new HashMap(e12Var.f10596a);
        this.f5646b = new HashMap(e12Var.f10597b);
    }

    public b0() {
        this.f5645a = new HashMap();
        this.f5646b = new HashMap();
    }
}
