package o;

import java.util.LinkedHashMap;
import java.util.Map;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class EL implements EJ {
    public final EJ a;
    public final DL b;

    public EL(EJ ej) {
        Xa0 xa0 = Xa0.a;
        this.a = ej;
        this.b = new DL(Xa0.b, ej.d());
    }

    @Override // o.EJ
    public Object a(Ua0 ua0) {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        int size = linkedHashMap.size() * 2;
        Ua0 ua0B = ua0.b(d());
        while (true) {
            int iJ = ua0B.j(d());
            if (iJ == -1) {
                ua0B.u(d());
                return linkedHashMap;
            }
            int i = iJ + size;
            LinkedHashMap linkedHashMap2 = linkedHashMap;
            Xa0 xa0 = Xa0.a;
            DL dl = this.b;
            Object objQ = ua0B.q(dl, i, xa0, null);
            int iJ2 = ua0B.j(dl);
            if (iJ2 != i + 1) {
                throw new IllegalArgumentException(AbstractC0126Ew.i(i, iJ2, "Value must follow key in a map, index for key: ", ", returned index for value: ").toString());
            }
            boolean zContainsKey = linkedHashMap2.containsKey(objQ);
            EJ ej = this.a;
            linkedHashMap2.put(objQ, (!zContainsKey || (ej.d().c() instanceof EY)) ? ua0B.q(dl, iJ2, ej, null) : ua0B.q(dl, iJ2, ej, GN.Y(objQ, linkedHashMap2)));
        }
    }

    @Override // o.EJ
    public final void c(C0173Gr c0173Gr, Object obj) {
        ((Map) obj).size();
        DL dl = this.b;
        C0173Gr c0173GrC = c0173Gr.c(dl);
        int i = 0;
        for (Map.Entry entry : ((Map) obj).entrySet()) {
            Object key = entry.getKey();
            Object value = entry.getValue();
            int i2 = i + 1;
            c0173GrC.j(dl, i, Xa0.a, key);
            i += 2;
            c0173GrC.j(dl, i2, this.a, value);
        }
        c0173GrC.m();
    }

    @Override // o.EJ
    public final L60 d() {
        return this.b;
    }
}
