package j2;

import android.os.Bundle;
import androidx.compose.runtime.MutableState;
import androidx.navigation.AbstractC1131f;
import androidx.navigation.C1137l;
import androidx.navigation.H;
import java.util.Iterator;
import p.C2676t;
import p.InterfaceC2670n;
import p.X;
import p.Z;
import w4.C3137A;

/* JADX INFO: renamed from: j2.C, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C2322C extends kotlin.jvm.internal.p implements J4.c {

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ Object f19472d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ Object f19473e;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    public C2322C(C2330h c2330h, J4.c cVar, J4.c cVar2, MutableState mutableState, int i6) {
        super(1);
        this.f19469a = i6;
        switch (i6) {
            case 1:
                this.f19470b = c2330h;
                this.f19471c = (kotlin.jvm.internal.p) cVar;
                this.f19472d = (kotlin.jvm.internal.p) cVar2;
                this.f19473e = mutableState;
                super(1);
                break;
            default:
                this.f19470b = c2330h;
                this.f19471c = (kotlin.jvm.internal.p) cVar;
                this.f19472d = (kotlin.jvm.internal.p) cVar2;
                this.f19473e = mutableState;
                break;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:101:? A[LOOP:3: B:66:0x0148->B:101:?, LOOP_END, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:82:0x0087 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:86:? A[LOOP:0: B:12:0x005e->B:86:?, LOOP_END, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:87:0x00c7 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:91:? A[LOOP:1: B:28:0x009e->B:91:?, LOOP_END, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:93:0x0131 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:96:? A[LOOP:2: B:50:0x0108->B:96:?, LOOP_END, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:98:0x0171 A[SYNTHETIC] */
    /* JADX WARN: Type inference failed for: r2v1, types: [J4.c, kotlin.jvm.internal.p] */
    /* JADX WARN: Type inference failed for: r2v12, types: [J4.c, kotlin.jvm.internal.p] */
    /* JADX WARN: Type inference failed for: r4v3, types: [J4.c, kotlin.jvm.internal.p] */
    /* JADX WARN: Type inference failed for: r4v6, types: [J4.c, kotlin.jvm.internal.p] */
    @Override // J4.c
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invoke(Object obj) {
        X x6;
        X x7;
        Z z6;
        Z z7;
        Object obj2 = null;
        Object obj3 = this.f19471c;
        Object obj4 = this.f19473e;
        Object obj5 = this.f19472d;
        Object obj6 = this.f19470b;
        switch (this.f19469a) {
            case 0:
                C2676t c2676t = (C2676t) ((InterfaceC2670n) obj);
                androidx.navigation.B b5 = ((C1137l) c2676t.c()).f12757b;
                kotlin.jvm.internal.o.f(b5, "null cannot be cast to non-null type androidx.navigation.compose.ComposeNavigator.Destination");
                C2329g c2329g = (C2329g) b5;
                if (((Boolean) ((C2330h) obj6).f19483c.getValue()).booleanValue() || W.b.Q((MutableState) obj4)) {
                    int i6 = androidx.navigation.B.l;
                    Iterator it = AbstractC1131f.b(c2329g).iterator();
                    while (true) {
                        if (it.hasNext()) {
                            androidx.navigation.B b6 = (androidx.navigation.B) it.next();
                            if (b6 instanceof C2329g) {
                                J4.c cVar = ((C2329g) b6).f19481p;
                                if (cVar != null) {
                                    x6 = (X) cVar.invoke(c2676t);
                                }
                                if (x6 == null) {
                                    obj2 = x6;
                                }
                            } else if (b6 instanceof C2327e) {
                                ((C2327e) b6).getClass();
                            }
                            x6 = null;
                            if (x6 == null) {
                            }
                        }
                    }
                    return obj2 == null ? (X) ((kotlin.jvm.internal.p) obj3).invoke(c2676t) : obj2;
                }
                int i7 = androidx.navigation.B.l;
                Iterator it2 = AbstractC1131f.b(c2329g).iterator();
                while (true) {
                    if (it2.hasNext()) {
                        androidx.navigation.B b7 = (androidx.navigation.B) it2.next();
                        if (b7 instanceof C2329g) {
                            J4.c cVar2 = ((C2329g) b7).f19479n;
                            if (cVar2 != null) {
                                x7 = (X) cVar2.invoke(c2676t);
                            }
                            if (x7 == null) {
                                obj2 = x7;
                            }
                        } else if (b7 instanceof C2327e) {
                            ((C2327e) b7).getClass();
                        }
                        x7 = null;
                        if (x7 == null) {
                        }
                    }
                }
                return obj2 == null ? (X) ((kotlin.jvm.internal.p) obj5).invoke(c2676t) : obj2;
            case 1:
                C2676t c2676t2 = (C2676t) ((InterfaceC2670n) obj);
                androidx.navigation.B b8 = ((C1137l) c2676t2.b()).f12757b;
                kotlin.jvm.internal.o.f(b8, "null cannot be cast to non-null type androidx.navigation.compose.ComposeNavigator.Destination");
                C2329g c2329g2 = (C2329g) b8;
                if (((Boolean) ((C2330h) obj6).f19483c.getValue()).booleanValue() || W.b.Q((MutableState) obj4)) {
                    int i8 = androidx.navigation.B.l;
                    Iterator it3 = AbstractC1131f.b(c2329g2).iterator();
                    while (true) {
                        if (it3.hasNext()) {
                            androidx.navigation.B b9 = (androidx.navigation.B) it3.next();
                            if (b9 instanceof C2329g) {
                                J4.c cVar3 = ((C2329g) b9).f19482q;
                                if (cVar3 != null) {
                                    z6 = (Z) cVar3.invoke(c2676t2);
                                }
                                if (z6 == null) {
                                    obj2 = z6;
                                }
                            } else if (b9 instanceof C2327e) {
                                ((C2327e) b9).getClass();
                            }
                            z6 = null;
                            if (z6 == null) {
                            }
                        }
                    }
                    return obj2 == null ? (Z) ((kotlin.jvm.internal.p) obj3).invoke(c2676t2) : obj2;
                }
                int i9 = androidx.navigation.B.l;
                Iterator it4 = AbstractC1131f.b(c2329g2).iterator();
                while (true) {
                    if (it4.hasNext()) {
                        androidx.navigation.B b10 = (androidx.navigation.B) it4.next();
                        if (b10 instanceof C2329g) {
                            J4.c cVar4 = ((C2329g) b10).f19480o;
                            if (cVar4 != null) {
                                z7 = (Z) cVar4.invoke(c2676t2);
                            }
                            if (z7 == null) {
                                obj2 = z7;
                            }
                        } else if (b10 instanceof C2327e) {
                            ((C2327e) b10).getClass();
                        }
                        z7 = null;
                        if (z7 == null) {
                        }
                    }
                }
                return obj2 == null ? (Z) ((kotlin.jvm.internal.p) obj5).invoke(c2676t2) : obj2;
            default:
                C1137l it5 = (C1137l) obj;
                kotlin.jvm.internal.o.h(it5, "it");
                ((kotlin.jvm.internal.y) obj6).f20130a = true;
                ((H) obj3).a((androidx.navigation.B) obj5, (Bundle) obj4, it5, x4.y.f26065a);
                return C3137A.f25453a;
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C2322C(kotlin.jvm.internal.y yVar, H h5, androidx.navigation.B b5, Bundle bundle) {
        super(1);
        this.f19469a = 2;
        this.f19470b = yVar;
        this.f19471c = h5;
        this.f19472d = b5;
        this.f19473e = bundle;
    }
}
