package androidx.compose.foundation.layout;

import c3.h;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import h2.d0;
import h2.f0;
import h2.g0;
import h2.p0;
import j2.b0;
import kotlin.jvm.internal.v;
import l1.i;
import rm.n0;

/* loaded from: classes.dex */
final class p extends i.c implements b0 {
    private float C;
    private float D;
    private float E;
    private float F;
    private boolean G;

    /* loaded from: classes.dex */
    static final class a extends v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ p0 f1880p;

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

        public final void a(p0.a aVar) {
            p0.a.l(aVar, this.f1880p, 0, 0, BitmapDescriptorFactory.HUE_RED, 4, null);
        }

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

    public /* synthetic */ p(float f10, float f11, float f12, float f13, boolean z10, kotlin.jvm.internal.k kVar) {
        this(f10, f11, f12, f13, z10);
    }

    /* JADX WARN: Code restructure failed: missing block: B:10:0x0050, code lost:
    
        if (r5 != Integer.MAX_VALUE) goto L16;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final long h2(c3.d dVar) {
        int i10;
        int g10;
        int d10;
        int g11;
        float f10 = this.E;
        h.a aVar = c3.h.f7410q;
        int i11 = 0;
        int d11 = !c3.h.v(f10, aVar.c()) ? jn.o.d(dVar.Z0(this.E), 0) : Integer.MAX_VALUE;
        int d12 = !c3.h.v(this.F, aVar.c()) ? jn.o.d(dVar.Z0(this.F), 0) : Integer.MAX_VALUE;
        if (!c3.h.v(this.C, aVar.c())) {
            g11 = jn.o.g(dVar.Z0(this.C), d11);
            i10 = jn.o.d(g11, 0);
        }
        i10 = 0;
        if (!c3.h.v(this.D, aVar.c())) {
            g10 = jn.o.g(dVar.Z0(this.D), d12);
            d10 = jn.o.d(g10, 0);
            if (d10 != Integer.MAX_VALUE) {
                i11 = d10;
            }
        }
        return c3.c.a(i10, d11, i11, d12);
    }

    @Override // j2.b0
    public int I(h2.o oVar, h2.n nVar, int i10) {
        long h22 = h2(oVar);
        return c3.b.j(h22) ? c3.b.l(h22) : c3.c.i(h22, nVar.T(i10));
    }

    @Override // j2.b0
    public f0 h(g0 g0Var, d0 d0Var, long j10) {
        long a10;
        long h22 = h2(g0Var);
        if (this.G) {
            a10 = c3.c.g(j10, h22);
        } else {
            float f10 = this.C;
            h.a aVar = c3.h.f7410q;
            a10 = c3.c.a(!c3.h.v(f10, aVar.c()) ? c3.b.n(h22) : jn.o.g(c3.b.n(j10), c3.b.l(h22)), !c3.h.v(this.E, aVar.c()) ? c3.b.l(h22) : jn.o.d(c3.b.l(j10), c3.b.n(h22)), !c3.h.v(this.D, aVar.c()) ? c3.b.m(h22) : jn.o.g(c3.b.m(j10), c3.b.k(h22)), !c3.h.v(this.F, aVar.c()) ? c3.b.k(h22) : jn.o.d(c3.b.k(j10), c3.b.m(h22)));
        }
        p0 Y = d0Var.Y(a10);
        return g0.j0(g0Var, Y.S0(), Y.F0(), null, new a(Y), 4, null);
    }

    public final void i2(boolean z10) {
        this.G = z10;
    }

    public final void j2(float f10) {
        this.F = f10;
    }

    public final void k2(float f10) {
        this.E = f10;
    }

    public final void l2(float f10) {
        this.D = f10;
    }

    public final void m2(float f10) {
        this.C = f10;
    }

    @Override // j2.b0
    public int p(h2.o oVar, h2.n nVar, int i10) {
        long h22 = h2(oVar);
        return c3.b.i(h22) ? c3.b.k(h22) : c3.c.h(h22, nVar.s(i10));
    }

    @Override // j2.b0
    public int s(h2.o oVar, h2.n nVar, int i10) {
        long h22 = h2(oVar);
        return c3.b.i(h22) ? c3.b.k(h22) : c3.c.h(h22, nVar.v0(i10));
    }

    @Override // j2.b0
    public int x(h2.o oVar, h2.n nVar, int i10) {
        long h22 = h2(oVar);
        return c3.b.j(h22) ? c3.b.l(h22) : c3.c.i(h22, nVar.X(i10));
    }

    private p(float f10, float f11, float f12, float f13, boolean z10) {
        this.C = f10;
        this.D = f11;
        this.E = f12;
        this.F = f13;
        this.G = z10;
    }
}
