package K;

import G0.AbstractC0250d;
import G0.InterfaceC0245a0;
import G0.InterfaceC0247b0;
import G0.InterfaceC0249c0;
import G0.InterfaceC0274t;
import T0.C0604o;
import T0.C0606q;
import androidx.compose.runtime.snapshots.Snapshot;
import h1.C2069a;
import java.util.List;
import x4.AbstractC3229F;

/* JADX INFO: loaded from: classes.dex */
public final class L implements InterfaceC0245a0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ C0464l0 f3692a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ J4.c f3693b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ Z0.y f3694c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ Z0.r f3695d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ h1.c f3696e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ int f3697f;

    public L(C0464l0 c0464l0, J4.c cVar, Z0.y yVar, Z0.r rVar, h1.c cVar2, int i6) {
        this.f3692a = c0464l0;
        this.f3693b = cVar;
        this.f3694c = yVar;
        this.f3695d = rVar;
        this.f3696e = cVar2;
        this.f3697f = i6;
    }

    @Override // G0.InterfaceC0245a0
    public final int maxIntrinsicWidth(InterfaceC0274t interfaceC0274t, List list, int i6) {
        C0464l0 c0464l0 = this.f3692a;
        c0464l0.f3889a.a(interfaceC0274t.getLayoutDirection());
        C0606q c0606q = c0464l0.f3889a.f4027j;
        if (c0606q != null) {
            return AbstractC0454g0.i(c0606q.c());
        }
        throw new IllegalStateException("layoutIntrinsics must be called first");
    }

    /* JADX WARN: Removed duplicated region for block: B:50:0x00fd  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x011d A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:61:0x0122  */
    /* JADX WARN: Removed duplicated region for block: B:65:0x0129  */
    /* JADX WARN: Removed duplicated region for block: B:70:0x013f  */
    /* JADX WARN: Removed duplicated region for block: B:85:0x023b  */
    @Override // G0.InterfaceC0245a0
    /* JADX INFO: renamed from: measure-3p2s80s */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final InterfaceC0247b0 mo1measure3p2s80s(InterfaceC0249c0 interfaceC0249c0, List list, long j4) {
        long j6;
        T0.L l;
        S0 s02;
        int iJ;
        int iH;
        C0606q c0606q;
        C0464l0 c0464l0;
        T0.L l6;
        T0.L l7;
        L l8;
        C0464l0 c0464l02;
        Snapshot.Companion companion = Snapshot.Companion;
        C0464l0 c0464l03 = this.f3692a;
        Snapshot currentThreadSnapshot = companion.getCurrentThreadSnapshot();
        J4.c readObserver = currentThreadSnapshot != null ? currentThreadSnapshot.getReadObserver() : null;
        Snapshot snapshotMakeCurrentNonObservable = companion.makeCurrentNonObservable(currentThreadSnapshot);
        try {
            S0 s0D = c0464l03.d();
            T0.L l9 = s0D != null ? s0D.f3742a : null;
            C0487x0 c0487x0 = c0464l03.f3889a;
            h1.m layoutDirection = interfaceC0249c0.getLayoutDirection();
            int i6 = c0487x0.f4023f;
            boolean z6 = c0487x0.f4022e;
            int i7 = c0487x0.f4020c;
            if (l9 != null) {
                C0604o c0604o = l9.f6472b;
                if (c0604o.f6532a.a()) {
                    j6 = j4;
                    l = l9;
                    s02 = s0D;
                    c0487x0.a(layoutDirection);
                    iJ = C2069a.j(j6);
                    iH = ((z6 || i6 == 2) && C2069a.d(j6)) ? C2069a.h(j6) : Integer.MAX_VALUE;
                    int i8 = (z6 || i6 != 2) ? i7 : 1;
                    if (iJ != iH) {
                        C0606q c0606q2 = c0487x0.f4027j;
                        if (c0606q2 == null) {
                            throw new IllegalStateException("layoutIntrinsics must be called first");
                        }
                        iH = L4.a.v(AbstractC0454g0.i(c0606q2.c()), iJ, iH);
                    }
                    c0606q = c0487x0.f4027j;
                    if (c0606q != null) {
                        throw new IllegalStateException("layoutIntrinsics must be called first");
                    }
                    C0604o c0604o2 = new C0604o(c0606q, W0.e.q(0, iH, 0, C2069a.g(j6)), i8, c0487x0.f4023f);
                    c0464l0 = c0464l03;
                    l6 = l;
                    l7 = new T0.L(new T0.K(c0487x0.f4018a, c0487x0.f4019b, c0487x0.f4026i, c0487x0.f4020c, c0487x0.f4022e, c0487x0.f4023f, c0487x0.f4024g, layoutDirection, c0487x0.f4025h, j6), c0604o2, h1.b.d(j6, (((long) AbstractC0454g0.i(c0604o2.f6535d)) << 32) | (((long) AbstractC0454g0.i(c0604o2.f6536e)) & 4294967295L)));
                } else {
                    T0.K k6 = l9.f6471a;
                    if (kotlin.jvm.internal.o.c(k6.f6461a, c0487x0.f4018a) && k6.f6462b.c(c0487x0.f4019b) && kotlin.jvm.internal.o.c(k6.f6463c, c0487x0.f4026i) && k6.f6464d == i7 && k6.f6465e == z6 && k6.f6466f == i6 && kotlin.jvm.internal.o.c(k6.f6467g, c0487x0.f4024g) && k6.f6468h == layoutDirection && kotlin.jvm.internal.o.c(k6.f6469i, c0487x0.f4025h)) {
                        int iJ2 = C2069a.j(j4);
                        s02 = s0D;
                        long j7 = k6.f6470j;
                        if (iJ2 == C2069a.j(j7) && (!(z6 || i6 == 2) || (C2069a.h(j4) == C2069a.h(j7) && C2069a.g(j4) == C2069a.g(j7)))) {
                            T0.L l10 = l9;
                            l7 = new T0.L(new T0.K(k6.f6461a, c0487x0.f4019b, k6.f6463c, k6.f6464d, k6.f6465e, k6.f6466f, k6.f6467g, k6.f6468h, k6.f6469i, j4), c0604o, h1.b.d(j4, (((long) AbstractC0454g0.i(c0604o.f6536e)) & 4294967295L) | (((long) AbstractC0454g0.i(c0604o.f6535d)) << 32)));
                            c0464l0 = c0464l03;
                            l6 = l10;
                        } else {
                            j6 = j4;
                            l = l9;
                        }
                    }
                    c0487x0.a(layoutDirection);
                    iJ = C2069a.j(j6);
                    if (z6) {
                        if (z6) {
                        }
                    } else {
                        if (z6) {
                            if (iJ != iH) {
                            }
                            c0606q = c0487x0.f4027j;
                            if (c0606q != null) {
                            }
                        }
                    }
                }
            }
            long j8 = l7.f6473c;
            Integer numValueOf = Integer.valueOf((int) (j8 >> 32));
            Integer numValueOf2 = Integer.valueOf((int) (j8 & 4294967295L));
            int iIntValue = numValueOf.intValue();
            int iIntValue2 = numValueOf2.intValue();
            if (kotlin.jvm.internal.o.c(l6, l7)) {
                l8 = this;
                c0464l02 = c0464l0;
            } else {
                c0464l02 = c0464l0;
                c0464l02.f3897i.setValue(new S0(l7, s02 != null ? s02.f3744c : null));
                c0464l02.f3903p = false;
                l8 = this;
                l8.f3693b.invoke(l7);
                V.f(c0464l02, l8.f3694c, l8.f3695d);
            }
            c0464l02.f3895g.setValue(new h1.f(l8.f3696e.L(l8.f3697f == 1 ? AbstractC0454g0.i(l7.f6472b.b(0)) : 0)));
            return interfaceC0249c0.e(iIntValue, iIntValue2, AbstractC3229F.w(new w4.k(AbstractC0250d.f1957a, Integer.valueOf(Math.round(l7.f6474d))), new w4.k(AbstractC0250d.f1958b, Integer.valueOf(Math.round(l7.f6475e)))), new q.H0(8));
        } finally {
            companion.restoreNonObservable(currentThreadSnapshot, snapshotMakeCurrentNonObservable, readObserver);
        }
    }
}
