package b0;

import androidx.compose.ui.platform.y2;
import d2.h0;
import d2.m0;
import java.util.List;
import kotlin.jvm.internal.o0;
import rm.n0;

/* loaded from: classes.dex */
public abstract class j {

    /* renamed from: a, reason: collision with root package name */
    private static final float f6384a;

    /* renamed from: b, reason: collision with root package name */
    private static final float f6385b;

    /* renamed from: c, reason: collision with root package name */
    private static final float f6386c;

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class a extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f6387p;

        /* renamed from: q, reason: collision with root package name */
        Object f6388q;

        /* renamed from: r, reason: collision with root package name */
        /* synthetic */ Object f6389r;

        /* renamed from: s, reason: collision with root package name */
        int f6390s;

        a(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f6389r = obj;
            this.f6390s |= Integer.MIN_VALUE;
            return j.b(null, 0L, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class b extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f6391p;

        /* renamed from: q, reason: collision with root package name */
        Object f6392q;

        /* renamed from: r, reason: collision with root package name */
        /* synthetic */ Object f6393r;

        /* renamed from: s, reason: collision with root package name */
        int f6394s;

        b(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f6393r = obj;
            this.f6394s |= Integer.MIN_VALUE;
            return j.c(null, 0L, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class c extends kotlin.coroutines.jvm.internal.k implements dn.p {

        /* renamed from: q, reason: collision with root package name */
        Object f6395q;

        /* renamed from: r, reason: collision with root package name */
        int f6396r;

        /* renamed from: s, reason: collision with root package name */
        int f6397s;

        /* renamed from: t, reason: collision with root package name */
        private /* synthetic */ Object f6398t;

        /* renamed from: u, reason: collision with root package name */
        final /* synthetic */ o0 f6399u;

        /* renamed from: v, reason: collision with root package name */
        final /* synthetic */ o0 f6400v;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        c(o0 o0Var, o0 o0Var2, vm.d dVar) {
            super(2, dVar);
            this.f6399u = o0Var;
            this.f6400v = o0Var2;
        }

        @Override // dn.p
        /* renamed from: b, reason: merged with bridge method [inline-methods] */
        public final Object invoke(d2.b bVar, vm.d dVar) {
            return ((c) create(bVar, dVar)).invokeSuspend(n0.f34904a);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final vm.d create(Object obj, vm.d dVar) {
            c cVar = new c(this.f6399u, this.f6400v, dVar);
            cVar.f6398t = obj;
            return cVar;
        }

        /* JADX WARN: Removed duplicated region for block: B:14:0x00de  */
        /* JADX WARN: Removed duplicated region for block: B:17:0x00ef  */
        /* JADX WARN: Removed duplicated region for block: B:28:0x0041  */
        /* JADX WARN: Removed duplicated region for block: B:34:0x005f  */
        /* JADX WARN: Removed duplicated region for block: B:40:0x0073  */
        /* JADX WARN: Removed duplicated region for block: B:43:0x007f  */
        /* JADX WARN: Removed duplicated region for block: B:53:0x00a8  */
        /* JADX WARN: Removed duplicated region for block: B:56:0x00b9 A[RETURN] */
        /* JADX WARN: Removed duplicated region for block: B:57:0x00ba  */
        /* JADX WARN: Removed duplicated region for block: B:59:0x00a5 A[SYNTHETIC] */
        /* JADX WARN: Removed duplicated region for block: B:61:0x0070 A[SYNTHETIC] */
        /* JADX WARN: Removed duplicated region for block: B:63:0x0157  */
        /* JADX WARN: Removed duplicated region for block: B:68:0x011e  */
        /* JADX WARN: Removed duplicated region for block: B:77:0x00db A[SYNTHETIC] */
        /* JADX WARN: Removed duplicated region for block: B:8:0x00ca  */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:50:0x00ba -> B:6:0x00bd). Please report as a decompilation issue!!! */
        @Override // kotlin.coroutines.jvm.internal.a
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            Object f10;
            d2.b bVar;
            int i10;
            Object obj2;
            int size;
            int i11;
            int i12;
            int size2;
            int i13;
            int i14;
            Object P;
            int i15;
            Object obj3;
            Object obj4;
            f10 = wm.d.f();
            int i16 = this.f6397s;
            Object obj5 = null;
            int i17 = 1;
            if (i16 == 0) {
                rm.y.b(obj);
                bVar = (d2.b) this.f6398t;
                i10 = 0;
                if (i10 != 0) {
                }
            } else if (i16 == 1) {
                i10 = this.f6396r;
                bVar = (d2.b) this.f6398t;
                rm.y.b(obj);
                obj2 = obj;
                d2.m mVar = (d2.m) obj2;
                List c10 = mVar.c();
                size = c10.size();
                i11 = 0;
                while (true) {
                    if (i11 >= size) {
                    }
                    i11++;
                }
                if (i12 != 0) {
                }
                List c11 = mVar.c();
                size2 = c11.size();
                i13 = 0;
                while (true) {
                    if (i13 < size2) {
                    }
                    i13++;
                }
                if (i14 != 0) {
                }
                d2.o oVar = d2.o.Final;
                this.f6398t = bVar;
                this.f6395q = mVar;
                this.f6396r = i10;
                this.f6397s = 2;
                P = bVar.P(oVar, this);
                if (P != f10) {
                }
            } else {
                if (i16 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                i10 = this.f6396r;
                d2.m mVar2 = (d2.m) this.f6395q;
                d2.b bVar2 = (d2.b) this.f6398t;
                rm.y.b(obj);
                P = obj;
                List c12 = ((d2.m) P).c();
                int size3 = c12.size();
                int i18 = 0;
                while (true) {
                    if (i18 >= size3) {
                        i15 = 0;
                        break;
                    }
                    if (((d2.y) c12.get(i18)).p()) {
                        i15 = i17;
                        break;
                    }
                    i18++;
                }
                if (i15 != 0) {
                    i10 = i17;
                }
                if (!j.g(mVar2, ((d2.y) this.f6399u.f26199p).f())) {
                    List c13 = mVar2.c();
                    int size4 = c13.size();
                    int i19 = 0;
                    while (true) {
                        if (i19 >= size4) {
                            obj4 = null;
                            break;
                        }
                        obj4 = c13.get(i19);
                        if (((d2.y) obj4).i()) {
                            break;
                        }
                        i19++;
                    }
                    d2.y yVar = (d2.y) obj4;
                    if (yVar != null) {
                        this.f6399u.f26199p = yVar;
                        this.f6400v.f26199p = yVar;
                    } else {
                        i10 = i17;
                        bVar = bVar2;
                        obj5 = null;
                        if (i10 != 0) {
                            return n0.f34904a;
                        }
                        d2.o oVar2 = d2.o.Main;
                        this.f6398t = bVar;
                        this.f6395q = obj5;
                        this.f6396r = i10;
                        this.f6397s = i17;
                        obj2 = bVar.P(oVar2, this);
                        if (obj2 == f10) {
                            return f10;
                        }
                        d2.m mVar3 = (d2.m) obj2;
                        List c102 = mVar3.c();
                        size = c102.size();
                        i11 = 0;
                        while (true) {
                            if (i11 >= size) {
                                i12 = i17;
                                break;
                            }
                            if (!d2.n.d((d2.y) c102.get(i11))) {
                                i12 = 0;
                                break;
                            }
                            i11++;
                        }
                        if (i12 != 0) {
                            i10 = i17;
                        }
                        List c112 = mVar3.c();
                        size2 = c112.size();
                        i13 = 0;
                        while (true) {
                            if (i13 < size2) {
                                i14 = 0;
                                break;
                            }
                            d2.y yVar2 = (d2.y) c112.get(i13);
                            if (((yVar2.p() || d2.n.f(yVar2, bVar.g(), bVar.R0())) ? i17 : 0) != 0) {
                                i14 = i17;
                                break;
                            }
                            i13++;
                        }
                        if (i14 != 0) {
                            i10 = i17;
                        }
                        d2.o oVar3 = d2.o.Final;
                        this.f6398t = bVar;
                        this.f6395q = mVar3;
                        this.f6396r = i10;
                        this.f6397s = 2;
                        P = bVar.P(oVar3, this);
                        if (P != f10) {
                            return f10;
                        }
                        bVar2 = bVar;
                        mVar2 = mVar3;
                        List c122 = ((d2.m) P).c();
                        int size32 = c122.size();
                        int i182 = 0;
                        while (true) {
                            if (i182 >= size32) {
                            }
                            i182++;
                        }
                        if (i15 != 0) {
                        }
                        if (!j.g(mVar2, ((d2.y) this.f6399u.f26199p).f())) {
                            o0 o0Var = this.f6400v;
                            List c14 = mVar2.c();
                            o0 o0Var2 = this.f6399u;
                            int size5 = c14.size();
                            int i20 = 0;
                            while (true) {
                                if (i20 >= size5) {
                                    obj3 = null;
                                    break;
                                }
                                obj3 = c14.get(i20);
                                o0 o0Var3 = o0Var2;
                                if (d2.x.d(((d2.y) obj3).f(), ((d2.y) o0Var2.f26199p).f())) {
                                    break;
                                }
                                i20++;
                                o0Var2 = o0Var3;
                            }
                            o0Var.f26199p = obj3;
                        }
                    }
                }
                bVar = bVar2;
                obj5 = null;
                i17 = 1;
                if (i10 != 0) {
                }
            }
        }
    }

    /* loaded from: classes.dex */
    static final class d extends kotlin.jvm.internal.v implements dn.q {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.l f6401p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        d(dn.l lVar) {
            super(3);
            this.f6401p = lVar;
        }

        public final void a(d2.y yVar, d2.y yVar2, long j10) {
            this.f6401p.invoke(r1.g.d(yVar2.h()));
        }

        @Override // dn.q
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2, Object obj3) {
            a((d2.y) obj, (d2.y) obj2, ((r1.g) obj3).v());
            return n0.f34904a;
        }
    }

    /* loaded from: classes.dex */
    static final class e extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.a f6402p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        e(dn.a aVar) {
            super(1);
            this.f6402p = aVar;
        }

        public final void a(d2.y yVar) {
            this.f6402p.invoke();
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((d2.y) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes.dex */
    static final class f extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        public static final f f6403p = new f();

        f() {
            super(0);
        }

        @Override // dn.a
        public final Boolean invoke() {
            return Boolean.TRUE;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class g extends kotlin.coroutines.jvm.internal.k implements dn.p {
        final /* synthetic */ dn.a A;
        final /* synthetic */ kotlin.jvm.internal.n0 B;
        final /* synthetic */ q C;
        final /* synthetic */ dn.q D;
        final /* synthetic */ dn.p E;
        final /* synthetic */ dn.a F;
        final /* synthetic */ dn.l G;

        /* renamed from: q, reason: collision with root package name */
        Object f6404q;

        /* renamed from: r, reason: collision with root package name */
        Object f6405r;

        /* renamed from: s, reason: collision with root package name */
        Object f6406s;

        /* renamed from: t, reason: collision with root package name */
        Object f6407t;

        /* renamed from: u, reason: collision with root package name */
        Object f6408u;

        /* renamed from: v, reason: collision with root package name */
        Object f6409v;

        /* renamed from: w, reason: collision with root package name */
        boolean f6410w;

        /* renamed from: x, reason: collision with root package name */
        float f6411x;

        /* renamed from: y, reason: collision with root package name */
        int f6412y;

        /* renamed from: z, reason: collision with root package name */
        private /* synthetic */ Object f6413z;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        g(dn.a aVar, kotlin.jvm.internal.n0 n0Var, q qVar, dn.q qVar2, dn.p pVar, dn.a aVar2, dn.l lVar, vm.d dVar) {
            super(2, dVar);
            this.A = aVar;
            this.B = n0Var;
            this.C = qVar;
            this.D = qVar2;
            this.E = pVar;
            this.F = aVar2;
            this.G = lVar;
        }

        @Override // dn.p
        /* renamed from: b, reason: merged with bridge method [inline-methods] */
        public final Object invoke(d2.b bVar, vm.d dVar) {
            return ((g) create(bVar, dVar)).invokeSuspend(n0.f34904a);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final vm.d create(Object obj, vm.d dVar) {
            g gVar = new g(this.A, this.B, this.C, this.D, this.E, this.F, this.G, dVar);
            gVar.f6413z = obj;
            return gVar;
        }

        /* JADX WARN: Code restructure failed: missing block: B:126:0x0254, code lost:
        
            if (b0.j.g(r2.Q(), r0) != false) goto L86;
         */
        /* JADX WARN: Code restructure failed: missing block: B:132:0x0109, code lost:
        
            if (r17 == false) goto L83;
         */
        /* JADX WARN: Code restructure failed: missing block: B:59:0x0306, code lost:
        
            if ((!((r2 != null ? r2 == b0.q.Vertical ? r1.g.n(r5) : r1.g.m(r5) : r1.g.k(r5)) == com.google.android.gms.maps.model.BitmapDescriptorFactory.HUE_RED)) != false) goto L127;
         */
        /* JADX WARN: Multi-variable type inference failed */
        /* JADX WARN: Path cross not found for [B:39:0x02b7, B:52:0x02e3], limit reached: 144 */
        /* JADX WARN: Removed duplicated region for block: B:111:0x01c6  */
        /* JADX WARN: Removed duplicated region for block: B:11:0x028b  */
        /* JADX WARN: Removed duplicated region for block: B:122:0x017f A[SYNTHETIC] */
        /* JADX WARN: Removed duplicated region for block: B:125:0x022a  */
        /* JADX WARN: Removed duplicated region for block: B:127:0x021f  */
        /* JADX WARN: Removed duplicated region for block: B:17:0x02ae  */
        /* JADX WARN: Removed duplicated region for block: B:22:0x031f  */
        /* JADX WARN: Removed duplicated region for block: B:26:0x0325  */
        /* JADX WARN: Removed duplicated region for block: B:31:0x031b  */
        /* JADX WARN: Removed duplicated region for block: B:32:0x032b  */
        /* JADX WARN: Removed duplicated region for block: B:36:0x027d A[RETURN] */
        /* JADX WARN: Removed duplicated region for block: B:37:0x02b1  */
        /* JADX WARN: Removed duplicated region for block: B:65:0x02a7 A[SYNTHETIC] */
        /* JADX WARN: Removed duplicated region for block: B:72:0x020d  */
        /* JADX WARN: Removed duplicated region for block: B:74:0x0211  */
        /* JADX WARN: Removed duplicated region for block: B:79:0x0121  */
        /* JADX WARN: Removed duplicated region for block: B:80:0x0124  */
        /* JADX WARN: Removed duplicated region for block: B:83:0x0152 A[RETURN] */
        /* JADX WARN: Removed duplicated region for block: B:86:0x0160  */
        /* JADX WARN: Removed duplicated region for block: B:94:0x018e  */
        /* JADX WARN: Removed duplicated region for block: B:98:0x019b  */
        /* JADX WARN: Type inference failed for: r13v0 */
        /* JADX WARN: Type inference failed for: r13v1 */
        /* JADX WARN: Type inference failed for: r13v4, types: [d2.o, java.lang.Object] */
        /* JADX WARN: Type inference failed for: r13v5 */
        /* JADX WARN: Type inference failed for: r13v6 */
        /* JADX WARN: Type inference failed for: r13v7 */
        /* JADX WARN: Type inference failed for: r18v0 */
        /* JADX WARN: Type inference failed for: r18v1 */
        /* JADX WARN: Type inference failed for: r18v2, types: [java.lang.Object] */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:113:0x0204 -> B:66:0x0207). Please report as a decompilation issue!!! */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:34:0x027b -> B:9:0x027e). Please report as a decompilation issue!!! */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:75:0x0121 -> B:69:0x020f). Please report as a decompilation issue!!! */
        @Override // kotlin.coroutines.jvm.internal.a
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            Object f10;
            d2.b bVar;
            Object d10;
            boolean z10;
            Object e10;
            d2.b bVar2;
            d2.y yVar;
            d2.y yVar2;
            long f11;
            dn.p pVar;
            q qVar;
            kotlin.jvm.internal.n0 n0Var;
            kotlin.jvm.internal.n0 n0Var2;
            Object obj2;
            d0 d0Var;
            d2.b bVar3;
            float f12;
            int size;
            int i10;
            kotlin.jvm.internal.n0 n0Var3;
            d2.y yVar3;
            d2.y yVar4;
            Object obj3;
            g gVar;
            Object obj4;
            Object obj5;
            g gVar2 = this;
            f10 = wm.d.f();
            int i11 = gVar2.f6412y;
            int i12 = 3;
            int i13 = 1;
            ?? r13 = 0;
            if (i11 == 0) {
                rm.y.b(obj);
                bVar = (d2.b) gVar2.f6413z;
                d2.o oVar = d2.o.Initial;
                gVar2.f6413z = bVar;
                gVar2.f6412y = 1;
                d10 = a0.d(bVar, false, oVar, gVar2);
                if (d10 == f10) {
                    return f10;
                }
            } else if (i11 == 1) {
                bVar = (d2.b) gVar2.f6413z;
                rm.y.b(obj);
                d10 = obj;
            } else if (i11 == 2) {
                boolean z11 = gVar2.f6410w;
                yVar = (d2.y) gVar2.f6404q;
                bVar2 = (d2.b) gVar2.f6413z;
                rm.y.b(obj);
                z10 = z11;
                e10 = obj;
                yVar2 = (d2.y) e10;
                gVar2.B.f26198p = r1.g.f34318b.c();
            } else {
                if (i11 == 3) {
                    float f13 = gVar2.f6411x;
                    d0 d0Var2 = (d0) gVar2.f6408u;
                    kotlin.jvm.internal.n0 n0Var4 = (kotlin.jvm.internal.n0) gVar2.f6407t;
                    kotlin.jvm.internal.n0 n0Var5 = (kotlin.jvm.internal.n0) gVar2.f6406s;
                    d2.b bVar4 = (d2.b) gVar2.f6405r;
                    d2.y yVar5 = (d2.y) gVar2.f6404q;
                    d2.b bVar5 = (d2.b) gVar2.f6413z;
                    rm.y.b(obj);
                    n0Var = n0Var4;
                    bVar2 = bVar4;
                    d0Var = d0Var2;
                    f12 = f13;
                    yVar2 = yVar5;
                    obj2 = obj;
                    n0Var2 = n0Var5;
                    bVar3 = bVar5;
                    d2.m mVar = (d2.m) obj2;
                    List c10 = mVar.c();
                    size = c10.size();
                    i10 = 0;
                    while (true) {
                        if (i10 < size) {
                        }
                        i10++;
                        n0Var2 = n0Var3;
                    }
                    yVar4 = yVar3;
                    if (yVar4 != null) {
                    }
                    bVar2 = bVar3;
                    yVar = null;
                    if (yVar != null) {
                    }
                    if (yVar != null) {
                    }
                    return n0.f34904a;
                }
                if (i11 != 4) {
                    if (i11 != 5) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    kotlin.jvm.internal.n0 n0Var6 = (kotlin.jvm.internal.n0) gVar2.f6407t;
                    d2.b bVar6 = (d2.b) gVar2.f6406s;
                    q qVar2 = (q) gVar2.f6405r;
                    pVar = (dn.p) gVar2.f6404q;
                    d2.b bVar7 = (d2.b) gVar2.f6413z;
                    rm.y.b(obj);
                    Object Z = obj;
                    d2.m mVar2 = (d2.m) Z;
                    List c11 = mVar2.c();
                    int size2 = c11.size();
                    int i14 = 0;
                    while (true) {
                        if (i14 >= size2) {
                            gVar = gVar2;
                            obj4 = null;
                            break;
                        }
                        obj4 = c11.get(i14);
                        gVar = gVar2;
                        if (d2.x.d(((d2.y) obj4).f(), n0Var6.f26198p)) {
                            break;
                        }
                        i14++;
                        gVar2 = gVar;
                    }
                    d2.y yVar6 = (d2.y) obj4;
                    if (yVar6 == null) {
                        if (d2.n.d(yVar6)) {
                            List c12 = mVar2.c();
                            int size3 = c12.size();
                            int i15 = 0;
                            while (true) {
                                if (i15 >= size3) {
                                    obj5 = null;
                                    break;
                                }
                                obj5 = c12.get(i15);
                                if (((d2.y) obj5).i()) {
                                    break;
                                }
                                i15++;
                            }
                            d2.y yVar7 = (d2.y) obj5;
                            if (yVar7 != null) {
                                n0Var6.f26198p = yVar7.f();
                                gVar2 = gVar;
                                gVar2.f6413z = bVar7;
                                gVar2.f6404q = pVar;
                                gVar2.f6405r = qVar2;
                                gVar2.f6406s = bVar6;
                                gVar2.f6407t = n0Var6;
                                gVar2.f6408u = null;
                                gVar2.f6409v = null;
                                gVar2.f6412y = 5;
                                Z = d2.b.Z(bVar6, null, gVar2, 1, null);
                                if (Z == f10) {
                                    return f10;
                                }
                                d2.m mVar22 = (d2.m) Z;
                                List c112 = mVar22.c();
                                int size22 = c112.size();
                                int i142 = 0;
                                while (true) {
                                    if (i142 >= size22) {
                                    }
                                    i142++;
                                    gVar2 = gVar;
                                }
                                d2.y yVar62 = (d2.y) obj4;
                                if (yVar62 == null) {
                                    yVar62 = null;
                                }
                            }
                        } else {
                            long h10 = d2.n.h(yVar62);
                        }
                    }
                    if (yVar62 == null || yVar62.p()) {
                        gVar2 = gVar;
                        yVar62 = null;
                        if (yVar62 == null) {
                        }
                        return n0.f34904a;
                    }
                    if (!d2.n.d(yVar62)) {
                        gVar2 = gVar;
                        if (yVar62 == null) {
                            gVar2.F.invoke();
                        } else {
                            gVar2.G.invoke(yVar62);
                        }
                        return n0.f34904a;
                    }
                    pVar.invoke(yVar62, r1.g.d(d2.n.g(yVar62)));
                    yVar62.a();
                    f11 = yVar62.f();
                    gVar2 = gVar;
                    d2.b bVar8 = bVar7;
                    qVar = qVar2;
                    bVar2 = bVar8;
                    kotlin.jvm.internal.n0 n0Var7 = new kotlin.jvm.internal.n0();
                    n0Var7.f26198p = f11;
                    bVar6 = bVar2;
                    n0Var6 = n0Var7;
                    qVar2 = qVar;
                    bVar7 = bVar6;
                    gVar2.f6413z = bVar7;
                    gVar2.f6404q = pVar;
                    gVar2.f6405r = qVar2;
                    gVar2.f6406s = bVar6;
                    gVar2.f6407t = n0Var6;
                    gVar2.f6408u = null;
                    gVar2.f6409v = null;
                    gVar2.f6412y = 5;
                    Z = d2.b.Z(bVar6, null, gVar2, 1, null);
                    if (Z == f10) {
                    }
                    d2.m mVar222 = (d2.m) Z;
                    List c1122 = mVar222.c();
                    int size222 = c1122.size();
                    int i1422 = 0;
                    while (true) {
                        if (i1422 >= size222) {
                        }
                        i1422++;
                        gVar2 = gVar;
                    }
                    d2.y yVar622 = (d2.y) obj4;
                    if (yVar622 == null) {
                    }
                    if (yVar622 == null) {
                        if (!d2.n.d(yVar622)) {
                        }
                    }
                    gVar2 = gVar;
                    yVar622 = null;
                    if (yVar622 == null) {
                    }
                    return n0.f34904a;
                }
                float f14 = gVar2.f6411x;
                d2.y yVar8 = (d2.y) gVar2.f6409v;
                d0 d0Var3 = (d0) gVar2.f6408u;
                kotlin.jvm.internal.n0 n0Var8 = (kotlin.jvm.internal.n0) gVar2.f6407t;
                kotlin.jvm.internal.n0 n0Var9 = (kotlin.jvm.internal.n0) gVar2.f6406s;
                d2.b bVar9 = (d2.b) gVar2.f6405r;
                d2.y yVar9 = (d2.y) gVar2.f6404q;
                d2.b bVar10 = (d2.b) gVar2.f6413z;
                rm.y.b(obj);
                float f15 = f14;
                yVar2 = yVar9;
                n0Var2 = n0Var9;
                d0Var = d0Var3;
                n0Var = n0Var8;
                bVar3 = bVar10;
                if (!yVar8.p()) {
                    bVar2 = bVar3;
                    yVar = null;
                    if (yVar != null && !yVar.p()) {
                        i12 = 3;
                        i13 = 1;
                        r13 = 0;
                        long f16 = yVar2.f();
                        int n10 = yVar2.n();
                        q qVar3 = gVar2.C;
                        n0Var2 = gVar2.B;
                        if (!j.g(bVar2.Q(), f16)) {
                            yVar = r13;
                            if (yVar != null) {
                                i12 = 3;
                                i13 = 1;
                                r13 = 0;
                                long f162 = yVar2.f();
                                int n102 = yVar2.n();
                                q qVar32 = gVar2.C;
                                n0Var2 = gVar2.B;
                                if (!j.g(bVar2.Q(), f162)) {
                                    f12 = j.h(bVar2.getViewConfiguration(), n102);
                                    n0Var = new kotlin.jvm.internal.n0();
                                    n0Var.f26198p = f162;
                                    d0Var = new d0(qVar32);
                                    bVar3 = bVar2;
                                    gVar2.f6413z = bVar3;
                                    gVar2.f6404q = yVar2;
                                    gVar2.f6405r = bVar2;
                                    gVar2.f6406s = n0Var2;
                                    gVar2.f6407t = n0Var;
                                    gVar2.f6408u = d0Var;
                                    gVar2.f6409v = r13;
                                    gVar2.f6411x = f12;
                                    gVar2.f6412y = i12;
                                    obj2 = d2.b.Z(bVar2, r13, gVar2, i13, r13);
                                    if (obj2 == f10) {
                                        return f10;
                                    }
                                    d2.m mVar3 = (d2.m) obj2;
                                    List c102 = mVar3.c();
                                    size = c102.size();
                                    i10 = 0;
                                    while (true) {
                                        if (i10 < size) {
                                            n0Var3 = n0Var2;
                                            yVar3 = 0;
                                            break;
                                        }
                                        yVar3 = c102.get(i10);
                                        n0Var3 = n0Var2;
                                        if (d2.x.d(((d2.y) yVar3).f(), n0Var.f26198p)) {
                                            break;
                                        }
                                        i10++;
                                        n0Var2 = n0Var3;
                                    }
                                    yVar4 = yVar3;
                                    if (yVar4 != null && !yVar4.p()) {
                                        if (d2.n.d(yVar4)) {
                                            r1.g a10 = d0Var.a(yVar4, f12);
                                            if (a10 != null) {
                                                long v10 = a10.v();
                                                yVar4.a();
                                                n0Var2 = n0Var3;
                                                n0Var2.f26198p = v10;
                                                if (yVar4.p()) {
                                                    bVar2 = bVar3;
                                                    yVar = yVar4;
                                                    if (yVar != null) {
                                                    }
                                                } else {
                                                    d0Var.e();
                                                }
                                            } else {
                                                n0Var2 = n0Var3;
                                                d2.o oVar2 = d2.o.Final;
                                                gVar2.f6413z = bVar3;
                                                gVar2.f6404q = yVar2;
                                                gVar2.f6405r = bVar2;
                                                gVar2.f6406s = n0Var2;
                                                gVar2.f6407t = n0Var;
                                                gVar2.f6408u = d0Var;
                                                gVar2.f6409v = yVar4;
                                                gVar2.f6411x = f12;
                                                gVar2.f6412y = 4;
                                                if (bVar2.P(oVar2, gVar2) == f10) {
                                                    return f10;
                                                }
                                                bVar9 = bVar2;
                                                f15 = f12;
                                                yVar8 = yVar4;
                                                if (!yVar8.p()) {
                                                    f12 = f15;
                                                    bVar2 = bVar9;
                                                    i12 = 3;
                                                    i13 = 1;
                                                    r13 = 0;
                                                    gVar2.f6413z = bVar3;
                                                    gVar2.f6404q = yVar2;
                                                    gVar2.f6405r = bVar2;
                                                    gVar2.f6406s = n0Var2;
                                                    gVar2.f6407t = n0Var;
                                                    gVar2.f6408u = d0Var;
                                                    gVar2.f6409v = r13;
                                                    gVar2.f6411x = f12;
                                                    gVar2.f6412y = i12;
                                                    obj2 = d2.b.Z(bVar2, r13, gVar2, i13, r13);
                                                    if (obj2 == f10) {
                                                    }
                                                    d2.m mVar32 = (d2.m) obj2;
                                                    List c1022 = mVar32.c();
                                                    size = c1022.size();
                                                    i10 = 0;
                                                    while (true) {
                                                        if (i10 < size) {
                                                        }
                                                        i10++;
                                                        n0Var2 = n0Var3;
                                                    }
                                                    yVar4 = yVar3;
                                                    if (yVar4 != null) {
                                                        if (d2.n.d(yVar4)) {
                                                            List c13 = mVar32.c();
                                                            int size4 = c13.size();
                                                            int i16 = 0;
                                                            while (true) {
                                                                if (i16 >= size4) {
                                                                    obj3 = null;
                                                                    break;
                                                                }
                                                                obj3 = c13.get(i16);
                                                                if (((d2.y) obj3).i()) {
                                                                    break;
                                                                }
                                                                i16++;
                                                            }
                                                            d2.y yVar10 = (d2.y) obj3;
                                                            if (yVar10 != null) {
                                                                n0Var.f26198p = yVar10.f();
                                                                n0Var2 = n0Var3;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        i12 = 3;
                                        i13 = 1;
                                        r13 = 0;
                                        gVar2.f6413z = bVar3;
                                        gVar2.f6404q = yVar2;
                                        gVar2.f6405r = bVar2;
                                        gVar2.f6406s = n0Var2;
                                        gVar2.f6407t = n0Var;
                                        gVar2.f6408u = d0Var;
                                        gVar2.f6409v = r13;
                                        gVar2.f6411x = f12;
                                        gVar2.f6412y = i12;
                                        obj2 = d2.b.Z(bVar2, r13, gVar2, i13, r13);
                                        if (obj2 == f10) {
                                        }
                                        d2.m mVar322 = (d2.m) obj2;
                                        List c10222 = mVar322.c();
                                        size = c10222.size();
                                        i10 = 0;
                                        while (true) {
                                            if (i10 < size) {
                                            }
                                            i10++;
                                            n0Var2 = n0Var3;
                                        }
                                        yVar4 = yVar3;
                                        if (yVar4 != null) {
                                        }
                                    }
                                    bVar2 = bVar3;
                                    yVar = null;
                                    if (yVar != null) {
                                    }
                                }
                            }
                        }
                    }
                    if (yVar != null) {
                        gVar2.D.invoke(yVar2, yVar, r1.g.d(gVar2.B.f26198p));
                        gVar2.E.invoke(yVar, r1.g.d(gVar2.B.f26198p));
                        f11 = yVar.f();
                        pVar = gVar2.E;
                        qVar = gVar2.C;
                    }
                    return n0.f34904a;
                }
            }
            d2.b bVar11 = bVar;
            d2.y yVar11 = (d2.y) d10;
            boolean booleanValue = ((Boolean) gVar2.A.invoke()).booleanValue();
            if (!booleanValue) {
                yVar11.a();
            }
            gVar2.f6413z = bVar11;
            gVar2.f6404q = yVar11;
            gVar2.f6410w = booleanValue;
            gVar2.f6412y = 2;
            z10 = booleanValue;
            e10 = a0.e(bVar11, false, null, this, 2, null);
            if (e10 == f10) {
                return f10;
            }
            bVar2 = bVar11;
            yVar = yVar11;
            yVar2 = (d2.y) e10;
            gVar2.B.f26198p = r1.g.f34318b.c();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class h extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f6414p;

        /* renamed from: q, reason: collision with root package name */
        Object f6415q;

        /* renamed from: r, reason: collision with root package name */
        /* synthetic */ Object f6416r;

        /* renamed from: s, reason: collision with root package name */
        int f6417s;

        h(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f6416r = obj;
            this.f6417s |= Integer.MIN_VALUE;
            return j.f(null, 0L, null, this);
        }
    }

    static {
        float t10 = c3.h.t((float) 0.125d);
        f6384a = t10;
        float t11 = c3.h.t(18);
        f6385b = t11;
        f6386c = t10 / t11;
    }

    /* JADX WARN: Code restructure failed: missing block: B:47:0x00cb, code lost:
    
        if (d2.n.j(r11) != false) goto L47;
     */
    /* JADX WARN: Removed duplicated region for block: B:12:0x007a  */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0096  */
    /* JADX WARN: Removed duplicated region for block: B:28:0x0098  */
    /* JADX WARN: Removed duplicated region for block: B:42:0x0066 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:43:0x0067  */
    /* JADX WARN: Removed duplicated region for block: B:48:0x0091 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:52:0x0043  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0028  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:40:0x0067 -> B:10:0x006c). Please report as a decompilation issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object b(d2.b bVar, long j10, vm.d dVar) {
        a aVar;
        Object f10;
        int i10;
        kotlin.jvm.internal.n0 n0Var;
        d2.b bVar2;
        Object Z;
        Object obj;
        Object obj2;
        if (dVar instanceof a) {
            aVar = (a) dVar;
            int i11 = aVar.f6390s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                aVar.f6390s = i11 - Integer.MIN_VALUE;
                Object obj3 = aVar.f6389r;
                f10 = wm.d.f();
                i10 = aVar.f6390s;
                if (i10 == 0) {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    kotlin.jvm.internal.n0 n0Var2 = (kotlin.jvm.internal.n0) aVar.f6388q;
                    d2.b bVar3 = (d2.b) aVar.f6387p;
                    rm.y.b(obj3);
                    kotlin.jvm.internal.n0 n0Var3 = n0Var2;
                    bVar2 = bVar3;
                    d2.m mVar = (d2.m) obj3;
                    List c10 = mVar.c();
                    int size = c10.size();
                    int i12 = 0;
                    while (true) {
                        if (i12 < size) {
                            obj = null;
                            break;
                        }
                        obj = c10.get(i12);
                        if (d2.x.d(((d2.y) obj).f(), n0Var3.f26198p)) {
                            break;
                        }
                        i12++;
                    }
                    d2.y yVar = (d2.y) obj;
                    if (yVar == null) {
                        if (d2.n.d(yVar)) {
                            List c11 = mVar.c();
                            int size2 = c11.size();
                            int i13 = 0;
                            while (true) {
                                if (i13 >= size2) {
                                    obj2 = null;
                                    break;
                                }
                                obj2 = c11.get(i13);
                                if (((d2.y) obj2).i()) {
                                    break;
                                }
                                i13++;
                            }
                            d2.y yVar2 = (d2.y) obj2;
                            if (yVar2 != null) {
                                n0Var3.f26198p = yVar2.f();
                                n0Var = n0Var3;
                            }
                        }
                        aVar.f6387p = bVar2;
                        aVar.f6388q = n0Var;
                        aVar.f6390s = 1;
                        Z = d2.b.Z(bVar2, null, aVar, 1, null);
                        if (Z != f10) {
                            return f10;
                        }
                        kotlin.jvm.internal.n0 n0Var4 = n0Var;
                        obj3 = Z;
                        n0Var3 = n0Var4;
                        d2.m mVar2 = (d2.m) obj3;
                        List c102 = mVar2.c();
                        int size3 = c102.size();
                        int i122 = 0;
                        while (true) {
                            if (i122 < size3) {
                            }
                            i122++;
                        }
                        d2.y yVar3 = (d2.y) obj;
                        if (yVar3 == null) {
                            yVar3 = null;
                        }
                    }
                    if ((yVar3 == null || yVar3.p()) ? false : true) {
                        return yVar3;
                    }
                    return null;
                }
                rm.y.b(obj3);
                if (g(bVar.Q(), j10)) {
                    return null;
                }
                n0Var = new kotlin.jvm.internal.n0();
                n0Var.f26198p = j10;
                bVar2 = bVar;
                aVar.f6387p = bVar2;
                aVar.f6388q = n0Var;
                aVar.f6390s = 1;
                Z = d2.b.Z(bVar2, null, aVar, 1, null);
                if (Z != f10) {
                }
            }
        }
        aVar = new a(dVar);
        Object obj32 = aVar.f6389r;
        f10 = wm.d.f();
        i10 = aVar.f6390s;
        if (i10 == 0) {
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:18:0x00a1  */
    /* JADX WARN: Removed duplicated region for block: B:20:0x00a3  */
    /* JADX WARN: Removed duplicated region for block: B:24:0x003b  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0024  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object c(d2.b bVar, long j10, vm.d dVar) {
        b bVar2;
        Object f10;
        int i10;
        Object obj;
        d2.y yVar;
        o0 o0Var;
        if (dVar instanceof b) {
            bVar2 = (b) dVar;
            int i11 = bVar2.f6394s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                bVar2.f6394s = i11 - Integer.MIN_VALUE;
                Object obj2 = bVar2.f6393r;
                f10 = wm.d.f();
                i10 = bVar2.f6394s;
                if (i10 != 0) {
                    rm.y.b(obj2);
                    if (g(bVar.Q(), j10)) {
                        return null;
                    }
                    List c10 = bVar.Q().c();
                    int size = c10.size();
                    int i12 = 0;
                    while (true) {
                        if (i12 >= size) {
                            obj = null;
                            break;
                        }
                        obj = c10.get(i12);
                        if (d2.x.d(((d2.y) obj).f(), j10)) {
                            break;
                        }
                        i12++;
                    }
                    yVar = (d2.y) obj;
                    if (yVar == null) {
                        return null;
                    }
                    o0 o0Var2 = new o0();
                    o0 o0Var3 = new o0();
                    o0Var3.f26199p = yVar;
                    long c11 = bVar.getViewConfiguration().c();
                    try {
                        dn.p cVar = new c(o0Var3, o0Var2, null);
                        bVar2.f6391p = yVar;
                        bVar2.f6392q = o0Var2;
                        bVar2.f6394s = 1;
                        if (bVar.h0(c11, cVar, bVar2) == f10) {
                            return f10;
                        }
                        return null;
                    } catch (d2.p unused) {
                        o0Var = o0Var2;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    o0Var = (o0) bVar2.f6392q;
                    yVar = (d2.y) bVar2.f6391p;
                    try {
                        rm.y.b(obj2);
                        return null;
                    } catch (d2.p unused2) {
                    }
                }
                d2.y yVar2 = (d2.y) o0Var.f26199p;
                return yVar2 != null ? yVar : yVar2;
            }
        }
        bVar2 = new b(dVar);
        Object obj22 = bVar2.f6393r;
        f10 = wm.d.f();
        i10 = bVar2.f6394s;
        if (i10 != 0) {
        }
        d2.y yVar22 = (d2.y) o0Var.f26199p;
        if (yVar22 != null) {
        }
    }

    public static final Object d(h0 h0Var, dn.l lVar, dn.a aVar, dn.a aVar2, dn.p pVar, vm.d dVar) {
        Object f10;
        Object e10 = e(h0Var, new d(lVar), new e(aVar), aVar2, f.f6403p, null, pVar, dVar);
        f10 = wm.d.f();
        return e10 == f10 ? e10 : n0.f34904a;
    }

    public static final Object e(h0 h0Var, dn.q qVar, dn.l lVar, dn.a aVar, dn.a aVar2, q qVar2, dn.p pVar, vm.d dVar) {
        Object f10;
        Object c10 = o.c(h0Var, new g(aVar2, new kotlin.jvm.internal.n0(), qVar2, qVar, pVar, aVar, lVar, null), dVar);
        f10 = wm.d.f();
        return c10 == f10 ? c10 : n0.f34904a;
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x004f  */
    /* JADX WARN: Removed duplicated region for block: B:15:0x0055  */
    /* JADX WARN: Removed duplicated region for block: B:22:0x004a A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:25:0x003b  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0023  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:21:0x0048 -> B:10:0x004b). Please report as a decompilation issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object f(d2.b bVar, long j10, dn.l lVar, vm.d dVar) {
        h hVar;
        Object f10;
        int i10;
        d2.y yVar;
        if (dVar instanceof h) {
            hVar = (h) dVar;
            int i11 = hVar.f6417s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                hVar.f6417s = i11 - Integer.MIN_VALUE;
                Object obj = hVar.f6416r;
                f10 = wm.d.f();
                i10 = hVar.f6417s;
                if (i10 != 0) {
                    rm.y.b(obj);
                    hVar.f6414p = bVar;
                    hVar.f6415q = lVar;
                    hVar.f6417s = 1;
                    obj = b(bVar, j10, hVar);
                    if (obj == f10) {
                    }
                    yVar = (d2.y) obj;
                    if (yVar == null) {
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    dn.l lVar2 = (dn.l) hVar.f6415q;
                    d2.b bVar2 = (d2.b) hVar.f6414p;
                    rm.y.b(obj);
                    lVar = lVar2;
                    bVar = bVar2;
                    yVar = (d2.y) obj;
                    if (yVar == null) {
                        if (d2.n.d(yVar)) {
                            return kotlin.coroutines.jvm.internal.b.a(true);
                        }
                        lVar.invoke(yVar);
                        j10 = yVar.f();
                        hVar.f6414p = bVar;
                        hVar.f6415q = lVar;
                        hVar.f6417s = 1;
                        obj = b(bVar, j10, hVar);
                        if (obj == f10) {
                            return f10;
                        }
                        yVar = (d2.y) obj;
                        if (yVar == null) {
                            return kotlin.coroutines.jvm.internal.b.a(false);
                        }
                    }
                }
            }
        }
        hVar = new h(dVar);
        Object obj2 = hVar.f6416r;
        f10 = wm.d.f();
        i10 = hVar.f6417s;
        if (i10 != 0) {
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean g(d2.m mVar, long j10) {
        Object obj;
        List c10 = mVar.c();
        int size = c10.size();
        boolean z10 = false;
        int i10 = 0;
        while (true) {
            if (i10 >= size) {
                obj = null;
                break;
            }
            obj = c10.get(i10);
            if (d2.x.d(((d2.y) obj).f(), j10)) {
                break;
            }
            i10++;
        }
        d2.y yVar = (d2.y) obj;
        if (yVar != null && yVar.i()) {
            z10 = true;
        }
        return true ^ z10;
    }

    public static final float h(y2 y2Var, int i10) {
        return m0.g(i10, m0.f15832a.b()) ? y2Var.g() * f6386c : y2Var.g();
    }
}
