package v0;

import android.graphics.Bitmap;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import p0.AbstractC2686D;
import p0.AbstractC2715v;
import p0.C2696b;
import p0.C2700f;
import p0.C2706l;
import p0.C2714u;
import p0.InterfaceC2712s;
import r0.C2862a;
import r0.C2863b;
import r0.InterfaceC2866e;

/* JADX INFO: loaded from: classes.dex */
public final class F extends AbstractC3061C {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final C3065c f24996b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public String f24997c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f24998d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final C3063a f24999e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public kotlin.jvm.internal.p f25000f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final MutableState f25001g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public C2706l f25002h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final MutableState f25003i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public long f25004j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public float f25005k;
    public float l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final E f25006m;

    public F(C3065c c3065c) {
        this.f24996b = c3065c;
        c3065c.f25111i = new E(this, 0);
        this.f24997c = "";
        this.f24998d = true;
        this.f24999e = new C3063a();
        this.f25000f = C3069g.f25158c;
        this.f25001g = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);
        this.f25003i = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(new o0.e(0L), null, 2, null);
        this.f25004j = 9205357640488583168L;
        this.f25005k = 1.0f;
        this.l = 1.0f;
        this.f25006m = new E(this, 1);
    }

    @Override // v0.AbstractC3061C
    public final void a(InterfaceC2866e interfaceC2866e) {
        e(interfaceC2866e, 1.0f, null);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:23:0x0042  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0063  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void e(InterfaceC2866e interfaceC2866e, float f6, AbstractC2715v abstractC2715v) {
        int i6;
        C2706l c2706l;
        char c6;
        long j4;
        int i7;
        int i8;
        AbstractC2715v abstractC2715v2 = abstractC2715v;
        C3065c c3065c = this.f24996b;
        boolean z6 = c3065c.f25106d;
        MutableState mutableState = this.f25001g;
        if (!z6 || c3065c.f25107e == 16) {
            i6 = 0;
        } else {
            AbstractC2715v abstractC2715v3 = (AbstractC2715v) mutableState.getValue();
            int i9 = M.f25065a;
            if (!(abstractC2715v3 instanceof C2706l) ? abstractC2715v3 == null : !((i8 = ((C2706l) abstractC2715v3).f22926c) != 5 && i8 != 3)) {
                if (!(abstractC2715v2 instanceof C2706l) ? abstractC2715v2 == null : !((i7 = ((C2706l) abstractC2715v2).f22926c) != 5 && i7 != 3)) {
                    i6 = 1;
                }
            }
        }
        boolean z7 = this.f24998d;
        C3063a c3063a = this.f24999e;
        if (z7 || !o0.e.a(this.f25004j, interfaceC2866e.c())) {
            if (i6 == 1) {
                long jC = c3065c.f25107e;
                int i10 = M.f25065a;
                if (C2714u.e(jC) != 1.0f) {
                    jC = C2714u.c(1.0f, jC);
                }
                c2706l = new C2706l(jC, 5);
            } else {
                c2706l = null;
            }
            this.f25002h = c2706l;
            float fIntBitsToFloat = Float.intBitsToFloat((int) (interfaceC2866e.c() >> 32));
            MutableState mutableState2 = this.f25003i;
            this.f25005k = fIntBitsToFloat / Float.intBitsToFloat((int) (((o0.e) mutableState2.getValue()).f21799a >> 32));
            this.l = Float.intBitsToFloat((int) (interfaceC2866e.c() & 4294967295L)) / Float.intBitsToFloat((int) (((o0.e) mutableState2.getValue()).f21799a & 4294967295L));
            long jCeil = (((long) ((int) Math.ceil(Float.intBitsToFloat((int) (interfaceC2866e.c() >> 32))))) << 32) | (((long) ((int) Math.ceil(Float.intBitsToFloat((int) (interfaceC2866e.c() & 4294967295L))))) & 4294967295L);
            h1.m layoutDirection = interfaceC2866e.getLayoutDirection();
            C2700f c2700fG = c3063a.f25095a;
            C2696b c2696bA = c3063a.f25096b;
            if (c2700fG == null || c2696bA == null) {
                c6 = ' ';
                j4 = 4294967295L;
            } else {
                int i11 = (int) (jCeil >> 32);
                Bitmap bitmap = c2700fG.f22917a;
                c6 = ' ';
                j4 = 4294967295L;
                if (i11 > bitmap.getWidth() || ((int) (jCeil & 4294967295L)) > bitmap.getHeight() || c3063a.f25098d != i6) {
                }
                c3063a.f25097c = jCeil;
                long jK = W0.e.K(jCeil);
                C2863b c2863b = c3063a.f25099e;
                C2862a c2862a = c2863b.f23802a;
                h1.c cVar = c2862a.f23798a;
                h1.m mVar = c2862a.f23799b;
                InterfaceC2712s interfaceC2712s = c2862a.f23800c;
                long j6 = c2862a.f23801d;
                c2862a.f23798a = interfaceC2866e;
                c2862a.f23799b = layoutDirection;
                c2862a.f23800c = c2696bA;
                c2862a.f23801d = jK;
                c2696bA.f();
                InterfaceC2866e.C(c2863b, C2714u.f22935b, 0L, 0L, 0.0f, 62);
                this.f25006m.invoke(c2863b);
                c2696bA.r();
                C2862a c2862a2 = c2863b.f23802a;
                c2862a2.f23798a = cVar;
                c2862a2.f23799b = mVar;
                c2862a2.f23800c = interfaceC2712s;
                c2862a2.f23801d = j6;
                c2700fG.f22917a.prepareToDraw();
                this.f24998d = false;
                this.f25004j = interfaceC2866e.c();
            }
            c2700fG = AbstractC2686D.g((int) (jCeil >> c6), (int) (jCeil & j4), i6);
            c2696bA = AbstractC2686D.a(c2700fG);
            c3063a.f25095a = c2700fG;
            c3063a.f25096b = c2696bA;
            c3063a.f25098d = i6;
            c3063a.f25097c = jCeil;
            long jK2 = W0.e.K(jCeil);
            C2863b c2863b2 = c3063a.f25099e;
            C2862a c2862a3 = c2863b2.f23802a;
            h1.c cVar2 = c2862a3.f23798a;
            h1.m mVar2 = c2862a3.f23799b;
            InterfaceC2712s interfaceC2712s2 = c2862a3.f23800c;
            long j62 = c2862a3.f23801d;
            c2862a3.f23798a = interfaceC2866e;
            c2862a3.f23799b = layoutDirection;
            c2862a3.f23800c = c2696bA;
            c2862a3.f23801d = jK2;
            c2696bA.f();
            InterfaceC2866e.C(c2863b2, C2714u.f22935b, 0L, 0L, 0.0f, 62);
            this.f25006m.invoke(c2863b2);
            c2696bA.r();
            C2862a c2862a22 = c2863b2.f23802a;
            c2862a22.f23798a = cVar2;
            c2862a22.f23799b = mVar2;
            c2862a22.f23800c = interfaceC2712s2;
            c2862a22.f23801d = j62;
            c2700fG.f22917a.prepareToDraw();
            this.f24998d = false;
            this.f25004j = interfaceC2866e.c();
        } else {
            C2700f c2700f = c3063a.f25095a;
            if (i6 != (c2700f != null ? c2700f.a() : 0)) {
            }
        }
        if (abstractC2715v2 == null) {
            abstractC2715v2 = ((AbstractC2715v) mutableState.getValue()) != null ? (AbstractC2715v) mutableState.getValue() : this.f25002h;
        }
        AbstractC2715v abstractC2715v4 = abstractC2715v2;
        C2700f c2700f2 = c3063a.f25095a;
        if (c2700f2 == null) {
            F0.a.b("drawCachedImage must be invoked first before attempting to draw the result into another destination");
        }
        InterfaceC2866e.D(interfaceC2866e, c2700f2, c3063a.f25097c, 0L, f6, abstractC2715v4, 0, 858);
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final String toString() {
        StringBuilder sb = new StringBuilder("Params: \tname: ");
        sb.append(this.f24997c);
        sb.append("\n\tviewportWidth: ");
        MutableState mutableState = this.f25003i;
        sb.append(Float.intBitsToFloat((int) (((o0.e) mutableState.getValue()).f21799a >> 32)));
        sb.append("\n\tviewportHeight: ");
        sb.append(Float.intBitsToFloat((int) (((o0.e) mutableState.getValue()).f21799a & 4294967295L)));
        sb.append("\n");
        String string = sb.toString();
        kotlin.jvm.internal.o.g(string, "toString(...)");
        return string;
    }
}
