package o;

import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.ad, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC0728ad implements InterfaceC0220Im, InterfaceC0117En, Serializable {
    public final InterfaceC0220Im l;

    public AbstractC0728ad(InterfaceC0220Im interfaceC0220Im) {
        this.l = interfaceC0220Im;
    }

    public InterfaceC0117En e() {
        InterfaceC0220Im interfaceC0220Im = this.l;
        if (interfaceC0220Im instanceof InterfaceC0117En) {
            return (InterfaceC0117En) interfaceC0220Im;
        }
        return null;
    }

    public InterfaceC0220Im l(Object obj, InterfaceC0220Im interfaceC0220Im) {
        throw new UnsupportedOperationException("create(Any?;Continuation) has not been overridden");
    }

    public StackTraceElement m() throws IllegalAccessException, NoSuchFieldException, SecurityException, IllegalArgumentException {
        int iIntValue;
        String strC;
        InterfaceC0223Ip interfaceC0223Ip = (InterfaceC0223Ip) getClass().getAnnotation(InterfaceC0223Ip.class);
        String str = null;
        if (interfaceC0223Ip == null) {
            return null;
        }
        int iV = interfaceC0223Ip.v();
        if (iV > 1) {
            throw new IllegalStateException(("Debug metadata version mismatch. Expected: 1, got " + iV + ". Please update the Kotlin standard library.").toString());
        }
        try {
            Field declaredField = getClass().getDeclaredField("label");
            declaredField.setAccessible(true);
            Object obj = declaredField.get(this);
            Integer num = obj instanceof Integer ? (Integer) obj : null;
            iIntValue = (num != null ? num.intValue() : 0) - 1;
        } catch (Exception unused) {
            iIntValue = -1;
        }
        int i = iIntValue >= 0 ? interfaceC0223Ip.l()[iIntValue] : -1;
        C1883mi c1883mi = AbstractC2001nt0.b;
        C1883mi c1883mi2 = AbstractC2001nt0.c;
        if (c1883mi2 == null) {
            try {
                C1883mi c1883mi3 = new C1883mi(Class.class.getDeclaredMethod("getModule", null), getClass().getClassLoader().loadClass("java.lang.Module").getDeclaredMethod("getDescriptor", null), getClass().getClassLoader().loadClass("java.lang.module.ModuleDescriptor").getDeclaredMethod("name", null));
                AbstractC2001nt0.c = c1883mi3;
                c1883mi2 = c1883mi3;
            } catch (Exception unused2) {
                AbstractC2001nt0.c = c1883mi;
                c1883mi2 = c1883mi;
            }
        }
        if (c1883mi2 != c1883mi) {
            Method method = c1883mi2.a;
            Object objInvoke = method != null ? method.invoke(getClass(), null) : null;
            if (objInvoke != null) {
                Method method2 = c1883mi2.b;
                Object objInvoke2 = method2 != null ? method2.invoke(objInvoke, null) : null;
                if (objInvoke2 != null) {
                    Method method3 = c1883mi2.c;
                    Object objInvoke3 = method3 != null ? method3.invoke(objInvoke2, null) : null;
                    if (objInvoke3 instanceof String) {
                        str = (String) objInvoke3;
                    }
                }
            }
        }
        if (str == null) {
            strC = interfaceC0223Ip.c();
        } else {
            strC = str + '/' + interfaceC0223Ip.c();
        }
        return new StackTraceElement(strC, interfaceC0223Ip.m(), interfaceC0223Ip.f(), i);
    }

    public abstract Object n(Object obj);

    @Override // o.InterfaceC0220Im
    public final void resumeWith(Object obj) {
        InterfaceC0220Im interfaceC0220Im = this;
        while (true) {
            AbstractC0728ad abstractC0728ad = (AbstractC0728ad) interfaceC0220Im;
            InterfaceC0220Im interfaceC0220Im2 = abstractC0728ad.l;
            try {
                obj = abstractC0728ad.n(obj);
                if (obj == EnumC0091Dn.l) {
                    return;
                }
            } catch (Throwable th) {
                obj = new H20(th);
            }
            abstractC0728ad.o();
            if (!(interfaceC0220Im2 instanceof AbstractC0728ad)) {
                interfaceC0220Im2.resumeWith(obj);
                return;
            }
            interfaceC0220Im = interfaceC0220Im2;
        }
    }

    public String toString() throws IllegalAccessException, NoSuchFieldException, SecurityException, IllegalArgumentException {
        StringBuilder sb = new StringBuilder("Continuation at ");
        Object objM = m();
        if (objM == null) {
            objM = getClass().getName();
        }
        sb.append(objM);
        return sb.toString();
    }

    public void o() {
    }
}
