package o;

import android.view.ViewGroup;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public abstract class Tm0 {
    public static final ViewGroup.LayoutParams a = new ViewGroup.LayoutParams(-2, -2);

    /* JADX WARN: Removed duplicated region for block: B:20:0x005c  */
    /* JADX WARN: Removed duplicated region for block: B:23:0x0081  */
    /* JADX WARN: Removed duplicated region for block: B:25:0x0086  */
    /* JADX WARN: Removed duplicated region for block: B:28:0x00b1  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final o.Qm0 a(o.AbstractC3054z r6, o.AbstractC0425Qk r7, o.C0554Vj r8) {
        /*
            java.util.concurrent.atomic.AtomicBoolean r0 = o.XD.a
            r1 = 0
            r2 = 1
            boolean r0 = r0.compareAndSet(r1, r2)
            r3 = 0
            if (r0 == 0) goto L43
            r0 = 6
            o.ff r0 = o.AbstractC2841wm0.a(r2, r1, r0)
            o.dc0 r2 = o.L5.w
            java.lang.Object r2 = r2.getValue()
            o.vn r2 = (o.InterfaceC2747vn) r2
            o.Gm r2 = o.C80.e(r2)
            o.t r4 = new o.t
            r5 = 12
            r4.<init>(r0, r3, r5)
            r5 = 3
            o.AbstractC1692kh0.C(r2, r3, r4, r5)
            o.w r2 = new o.w
            r4 = 17
            r2.<init>(r4, r0)
            java.lang.Object r0 = o.AbstractC2884x90.c
            monitor-enter(r0)
            java.lang.Object r4 = o.AbstractC2884x90.i     // Catch: java.lang.Throwable -> L40
            java.util.List r4 = (java.util.List) r4     // Catch: java.lang.Throwable -> L40
            java.util.ArrayList r2 = o.AbstractC3117zi.m0(r4, r2)     // Catch: java.lang.Throwable -> L40
            o.AbstractC2884x90.i = r2     // Catch: java.lang.Throwable -> L40
            monitor-exit(r0)
            o.AbstractC2884x90.a()
            goto L43
        L40:
            r6 = move-exception
            monitor-exit(r0)
            throw r6
        L43:
            int r0 = r6.getChildCount()
            if (r0 <= 0) goto L56
            android.view.View r0 = r6.getChildAt(r1)
            boolean r1 = r0 instanceof o.C2207q3
            if (r1 == 0) goto L54
            o.q3 r0 = (o.C2207q3) r0
            goto L5a
        L54:
            r0 = r3
            goto L5a
        L56:
            r6.removeAllViews()
            goto L54
        L5a:
            if (r0 != 0) goto L72
            o.q3 r0 = new o.q3
            android.content.Context r1 = r6.getContext()
            o.vn r2 = r7.i()
            r0.<init>(r1, r2)
            android.view.View r1 = r0.getView()
            android.view.ViewGroup$LayoutParams r2 = o.Tm0.a
            r6.addView(r1, r2)
        L72:
            android.view.View r6 = r0.getView()
            r1 = 2131231299(0x7f080243, float:1.8078675E38)
            java.lang.Object r6 = r6.getTag(r1)
            boolean r2 = r6 instanceof o.Qm0
            if (r2 == 0) goto L84
            r3 = r6
            o.Qm0 r3 = (o.Qm0) r3
        L84:
            if (r3 != 0) goto La0
            o.Qm0 r3 = new o.Qm0
            o.C70 r6 = new o.C70
            o.sK r2 = r0.getRoot()
            r6.<init>(r2)
            o.Vk r2 = new o.Vk
            r2.<init>(r7, r6)
            r3.<init>(r0, r2)
            android.view.View r6 = r0.getView()
            r6.setTag(r1, r3)
        La0:
            r3.e(r8)
            o.vn r6 = r0.getCoroutineContext()
            o.vn r8 = r7.i()
            boolean r6 = o.F3.c(r6, r8)
            if (r6 != 0) goto Lb8
            o.vn r6 = r7.i()
            r0.setCoroutineContext(r6)
        Lb8:
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: o.Tm0.a(o.z, o.Qk, o.Vj):o.Qm0");
    }
}
