package h3;

import D.InterfaceC0133d;
import M2.C0527l1;
import android.content.Context;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.MutableIntState;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.State;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import w4.C3137A;
import x4.AbstractC3226C;

/* JADX INFO: renamed from: h3.q1, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C2176q1 implements J4.g {

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

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ n0.x f18400c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ n0.x f18401d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ D.H f18402e;

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final /* synthetic */ MutableIntState f18404j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ V4.C f18405k;
    public final /* synthetic */ int l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final /* synthetic */ Set f18406m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final /* synthetic */ boolean f18407n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final /* synthetic */ Context f18408o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final /* synthetic */ State f18409p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ MutableState f18410q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final /* synthetic */ MutableState f18411r;

    public C2176q1(List list, Map map, n0.x xVar, n0.x xVar2, D.H h5, int i6, MutableIntState mutableIntState, V4.C c6, int i7, Set set, boolean z6, Context context, State state, MutableState mutableState, MutableState mutableState2) {
        this.f18398a = list;
        this.f18399b = map;
        this.f18400c = xVar;
        this.f18401d = xVar2;
        this.f18402e = h5;
        this.f18403f = i6;
        this.f18404j = mutableIntState;
        this.f18405k = c6;
        this.l = i7;
        this.f18406m = set;
        this.f18407n = z6;
        this.f18408o = context;
        this.f18409p = state;
        this.f18410q = mutableState;
        this.f18411r = mutableState2;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:51:0x00e3  */
    /* JADX WARN: Removed duplicated region for block: B:53:0x00e8  */
    /* JADX WARN: Removed duplicated region for block: B:58:0x0107  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x0132  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x0183  */
    /* JADX WARN: Removed duplicated region for block: B:73:0x01ac  */
    /* JADX WARN: Removed duplicated region for block: B:76:0x01e1  */
    @Override // J4.g
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invoke(Object obj, Object obj2, Object obj3, Object obj4) {
        int i6;
        boolean z6;
        boolean zChanged;
        Object objRememberedValue;
        boolean zChanged2;
        Object objRememberedValue2;
        Context context;
        State state;
        boolean zChanged3;
        int i7;
        Object c2122h1;
        MutableState mutableState;
        Object objJ;
        InterfaceC0133d interfaceC0133d = (InterfaceC0133d) obj;
        int iIntValue = ((Number) obj2).intValue();
        Composer composer = (Composer) obj3;
        int iIntValue2 = ((Number) obj4).intValue();
        if ((iIntValue2 & 6) == 0) {
            i6 = (composer.changed(interfaceC0133d) ? 4 : 2) | iIntValue2;
        } else {
            i6 = iIntValue2;
        }
        if ((iIntValue2 & 48) == 0) {
            i6 |= composer.changed(iIntValue) ? 32 : 16;
        }
        if (composer.shouldExecute((i6 & 147) != 146, i6 & 1)) {
            if (ComposerKt.isTraceInProgress()) {
                ComposerKt.traceEventStart(802480018, i6, -1, "androidx.compose.foundation.lazy.items.<anonymous> (LazyDsl.kt:178)");
            }
            int iIntValue3 = ((Number) this.f18398a.get(iIntValue)).intValue();
            composer.startReplaceGroup(1377925433);
            Integer num = (Integer) this.f18399b.get(Integer.valueOf(iIntValue3));
            int iIntValue4 = num != null ? num.intValue() : 0;
            MutableIntState mutableIntState = this.f18404j;
            boolean z7 = iIntValue3 == mutableIntState.getIntValue();
            MutableState mutableState2 = this.f18410q;
            boolean z8 = ((Integer) mutableState2.getValue()) != null;
            boolean zE = AbstractC2211w1.e(this.f18411r);
            Iterable gVar = new P4.g(1, iIntValue4, 1);
            boolean z9 = gVar instanceof Collection;
            int i8 = this.l;
            Set set = this.f18406m;
            if (z9 && ((Collection) gVar).isEmpty()) {
                z6 = true;
                n0.x xVar = iIntValue3 != mutableIntState.getIntValue() ? this.f18400c : null;
                composer.startReplaceGroup(-1479522865);
                zChanged = composer.changed(mutableIntState) | composer.changed(iIntValue3);
                objRememberedValue = composer.rememberedValue();
                if (!zChanged) {
                    objRememberedValue = new C2110f1(iIntValue3, mutableIntState, 0);
                    composer.updateRememberedValue(objRememberedValue);
                    J4.a aVar = (J4.a) objRememberedValue;
                    composer.endReplaceGroup();
                    composer.startReplaceGroup(-1479520177);
                    zChanged2 = composer.changed(mutableIntState) | composer.changed(iIntValue3);
                    objRememberedValue2 = composer.rememberedValue();
                    if (!zChanged2) {
                        objRememberedValue2 = new C2110f1(iIntValue3, mutableIntState, 1);
                        composer.updateRememberedValue(objRememberedValue2);
                        J4.a aVar2 = (J4.a) objRememberedValue2;
                        composer.endReplaceGroup();
                        composer.startReplaceGroup(-1479515642);
                        boolean zChangedInstance = composer.changedInstance(this.f18405k) | composer.changed(iIntValue4) | composer.changed(i8) | composer.changed(iIntValue3) | composer.changedInstance(set) | composer.changed(this.f18407n);
                        context = this.f18408o;
                        boolean zChangedInstance2 = zChangedInstance | composer.changedInstance(context);
                        state = this.f18409p;
                        zChanged3 = zChangedInstance2 | composer.changed(state);
                        Object objRememberedValue3 = composer.rememberedValue();
                        if (zChanged3) {
                            i7 = iIntValue4;
                            mutableState = mutableState2;
                            c2122h1 = new C2122h1(this.f18405k, i7, iIntValue3, this.f18407n, this.l, this.f18406m, context, state);
                            composer.updateRememberedValue(c2122h1);
                            J4.a aVar3 = (J4.a) c2122h1;
                            objJ = A0.a.j(composer, -1479453553);
                            if (objJ == Composer.Companion.getEmpty()) {
                            }
                            J4.e eVar = (J4.e) objJ;
                            composer.endReplaceGroup();
                            AbstractC2211w1.k(iIntValue3, i7, z7, z8, zE, xVar, this.f18401d, this.f18402e, this.f18403f, aVar, aVar2, aVar3, z6, eVar, composer, 0, 3072);
                            composer.endReplaceGroup();
                            if (ComposerKt.isTraceInProgress()) {
                            }
                        }
                    }
                }
            } else {
                Iterator it = gVar.iterator();
                while (((P4.f) it).f5681c) {
                    int iA = ((AbstractC3226C) it).a();
                    Context context2 = i3.M.f18897a;
                    if (!set.contains(i3.M.g(i8, iIntValue3, iA))) {
                        z6 = false;
                        break;
                    }
                }
                z6 = true;
                n0.x xVar2 = iIntValue3 != mutableIntState.getIntValue() ? this.f18400c : null;
                composer.startReplaceGroup(-1479522865);
                zChanged = composer.changed(mutableIntState) | composer.changed(iIntValue3);
                objRememberedValue = composer.rememberedValue();
                if (!zChanged || objRememberedValue == Composer.Companion.getEmpty()) {
                    objRememberedValue = new C2110f1(iIntValue3, mutableIntState, 0);
                    composer.updateRememberedValue(objRememberedValue);
                }
                J4.a aVar4 = (J4.a) objRememberedValue;
                composer.endReplaceGroup();
                composer.startReplaceGroup(-1479520177);
                zChanged2 = composer.changed(mutableIntState) | composer.changed(iIntValue3);
                objRememberedValue2 = composer.rememberedValue();
                if (!zChanged2 || objRememberedValue2 == Composer.Companion.getEmpty()) {
                    objRememberedValue2 = new C2110f1(iIntValue3, mutableIntState, 1);
                    composer.updateRememberedValue(objRememberedValue2);
                }
                J4.a aVar22 = (J4.a) objRememberedValue2;
                composer.endReplaceGroup();
                composer.startReplaceGroup(-1479515642);
                boolean zChangedInstance3 = composer.changedInstance(this.f18405k) | composer.changed(iIntValue4) | composer.changed(i8) | composer.changed(iIntValue3) | composer.changedInstance(set) | composer.changed(this.f18407n);
                context = this.f18408o;
                boolean zChangedInstance22 = zChangedInstance3 | composer.changedInstance(context);
                state = this.f18409p;
                zChanged3 = zChangedInstance22 | composer.changed(state);
                Object objRememberedValue32 = composer.rememberedValue();
                if (!zChanged3 || objRememberedValue32 == Composer.Companion.getEmpty()) {
                    i7 = iIntValue4;
                    mutableState = mutableState2;
                    c2122h1 = new C2122h1(this.f18405k, i7, iIntValue3, this.f18407n, this.l, this.f18406m, context, state);
                    composer.updateRememberedValue(c2122h1);
                } else {
                    i7 = iIntValue4;
                    c2122h1 = objRememberedValue32;
                    mutableState = mutableState2;
                }
                J4.a aVar32 = (J4.a) c2122h1;
                objJ = A0.a.j(composer, -1479453553);
                if (objJ == Composer.Companion.getEmpty()) {
                    objJ = new C0527l1(mutableState, 4);
                    composer.updateRememberedValue(objJ);
                }
                J4.e eVar2 = (J4.e) objJ;
                composer.endReplaceGroup();
                AbstractC2211w1.k(iIntValue3, i7, z7, z8, zE, xVar2, this.f18401d, this.f18402e, this.f18403f, aVar4, aVar22, aVar32, z6, eVar2, composer, 0, 3072);
                composer.endReplaceGroup();
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventEnd();
                }
            }
        } else {
            composer.skipToGroupEnd();
        }
        return C3137A.f25453a;
    }
}
