package o6;

import e0.C0853a;
import java.lang.reflect.InvocationTargetException;
import java.util.TreeMap;
import p6.AbstractC1439e;

/* JADX INFO: renamed from: o6.g, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1387g extends AbstractC1391k {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final C1381a f15866d = new C1381a(1);

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

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

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

    public C1387g(AbstractC1380C abstractC1380C, TreeMap treeMap) {
        this.f15867a = abstractC1380C;
        this.f15868b = (C1386f[]) treeMap.values().toArray(new C1386f[treeMap.size()]);
        this.f15869c = C0853a.B((String[]) treeMap.keySet().toArray(new String[treeMap.size()]));
    }

    @Override // o6.AbstractC1391k
    public final Object b(AbstractC1394n abstractC1394n) {
        try {
            Object objE = this.f15867a.e();
            try {
                abstractC1394n.b();
                while (abstractC1394n.n()) {
                    int iQ = abstractC1394n.Q(this.f15869c);
                    if (iQ == -1) {
                        abstractC1394n.V();
                        abstractC1394n.f0();
                    } else {
                        C1386f c1386f = this.f15868b[iQ];
                        c1386f.f15864b.set(objE, c1386f.f15865c.b(abstractC1394n));
                    }
                }
                abstractC1394n.j();
                return objE;
            } catch (IllegalAccessException unused) {
                throw new AssertionError();
            }
        } catch (IllegalAccessException unused2) {
            throw new AssertionError();
        } catch (InstantiationException e8) {
            throw new RuntimeException(e8);
        } catch (InvocationTargetException e9) {
            AbstractC1439e.g(e9);
            throw null;
        }
    }

    @Override // o6.AbstractC1391k
    public final void e(AbstractC1397q abstractC1397q, Object obj) {
        try {
            abstractC1397q.b();
            for (C1386f c1386f : this.f15868b) {
                abstractC1397q.m(c1386f.f15863a);
                c1386f.f15865c.e(abstractC1397q, c1386f.f15864b.get(obj));
            }
            abstractC1397q.g();
        } catch (IllegalAccessException unused) {
            throw new AssertionError();
        }
    }

    public final String toString() {
        return "JsonAdapter(" + this.f15867a + ")";
    }
}
