package F7;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/* JADX INFO: loaded from: classes.dex */
public final class U implements InvocationHandler {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Object[] f2680a = new Object[0];

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Class f2681b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ V f2682c;

    public U(V v7, Class cls) {
        this.f2682c = v7;
        this.f2681b = cls;
    }

    /* JADX WARN: Code restructure failed: missing block: B:23:0x0043, code lost:
    
        r0 = F7.AbstractC0135t.b(r9, r1, r8);
     */
    /* JADX WARN: Code restructure failed: missing block: B:24:0x0047, code lost:
    
        r9.f2683a.put(r8, r0);
     */
    /* JADX WARN: Code restructure failed: missing block: B:43:0x006c, code lost:
    
        r0 = (F7.AbstractC0135t) r0;
     */
    /* JADX WARN: Removed duplicated region for block: B:52:0x005f A[EXC_TOP_SPLITTER, SYNTHETIC] */
    @Override // java.lang.reflect.InvocationHandler
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invoke(Object obj, Method method, Object[] objArr) {
        AbstractC0135t abstractC0135tB;
        if (method.getDeclaringClass() == Object.class) {
            return method.invoke(this, objArr);
        }
        if (objArr == null) {
            objArr = this.f2680a;
        }
        Object[] objArr2 = objArr;
        C0118b c0118b = M.f2623b;
        boolean zE = c0118b.e(method);
        Class cls = this.f2681b;
        if (zE) {
            return c0118b.d(method, cls, obj, objArr2);
        }
        V v7 = this.f2682c;
        while (true) {
            Object objPutIfAbsent = v7.f2683a.get(method);
            if (objPutIfAbsent instanceof AbstractC0135t) {
                abstractC0135tB = (AbstractC0135t) objPutIfAbsent;
                break;
            }
            if (objPutIfAbsent == null) {
                Object obj2 = new Object();
                synchronized (obj2) {
                    try {
                        objPutIfAbsent = v7.f2683a.putIfAbsent(method, obj2);
                        if (objPutIfAbsent != null) {
                            synchronized (objPutIfAbsent) {
                                try {
                                    Object obj3 = v7.f2683a.get(method);
                                    if (obj3 != null) {
                                        break;
                                    }
                                } finally {
                                }
                            }
                            break;
                        }
                        try {
                            break;
                        } catch (Throwable th) {
                            v7.f2683a.remove(method);
                            throw th;
                        }
                    } finally {
                    }
                }
            }
            synchronized (objPutIfAbsent) {
            }
        }
        AbstractC0135t abstractC0135t = abstractC0135tB;
        return abstractC0135t.a(new B(abstractC0135t.f2722a, obj, objArr2, abstractC0135t.f2723b, abstractC0135t.f2724c), objArr2);
    }
}
