package p;

import B.AbstractC0085s0;
import G0.InterfaceC0247b0;
import G0.InterfaceC0249c0;
import G0.q0;
import G0.t0;
import e.C1950d;
import i0.C2239c;
import i0.InterfaceC2242f;
import q.A0;
import q.C2803u0;
import q.v0;

/* JADX INFO: loaded from: classes.dex */
public final class W extends AbstractC0085s0 {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public A0 f22679b;

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

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public v0 f22682e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public X f22683f;

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public J4.a f22685k;
    public C2651M l;

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

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public InterfaceC2242f f22687n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final V f22688o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final V f22689p;

    public W(A0 a02, v0 v0Var, v0 v0Var2, v0 v0Var3, X x6, Z z6, J4.a aVar, C2651M c2651m) {
        super(1);
        this.f22679b = a02;
        this.f22680c = v0Var;
        this.f22681d = v0Var2;
        this.f22682e = v0Var3;
        this.f22683f = x6;
        this.f22684j = z6;
        this.f22685k = aVar;
        this.l = c2651m;
        this.f22686m = AbstractC2642D.f22617a;
        h1.b.b(0, 0, 15);
        this.f22688o = new V(this, 0);
        this.f22689p = new V(this, 1);
    }

    public final InterfaceC2242f getAlignment() {
        InterfaceC2242f interfaceC2242f;
        InterfaceC2242f interfaceC2242f2;
        if (this.f22679b.f().a(EnumC2649K.f22640a, EnumC2649K.f22641b)) {
            C2643E c2643e = ((Y) this.f22683f).f22691b.f22780c;
            if (c2643e != null && (interfaceC2242f2 = c2643e.f22618a) != null) {
                return interfaceC2242f2;
            }
            C2643E c2643e2 = this.f22684j.f22694a.f22780c;
            if (c2643e2 != null) {
                return c2643e2.f22618a;
            }
            return null;
        }
        C2643E c2643e3 = this.f22684j.f22694a.f22780c;
        if (c2643e3 != null && (interfaceC2242f = c2643e3.f22618a) != null) {
            return interfaceC2242f;
        }
        C2643E c2643e4 = ((Y) this.f22683f).f22691b.f22780c;
        if (c2643e4 != null) {
            return c2643e4.f22618a;
        }
        return null;
    }

    /* JADX WARN: Removed duplicated region for block: B:33:0x00c2  */
    @Override // B.AbstractC0085s0, I0.InterfaceC0315y
    /* JADX INFO: renamed from: measure-3p2s80s */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final InterfaceC0247b0 mo0measure3p2s80s(InterfaceC0249c0 interfaceC0249c0, G0.Z z6, long j4) {
        p0.c0 c0Var;
        char c6;
        long j6;
        if (this.f22679b.f23134a.b() == this.f22679b.f23137d.getValue()) {
            this.f22687n = null;
        } else if (this.f22687n == null) {
            InterfaceC2242f alignment = getAlignment();
            if (alignment == null) {
                alignment = C2239c.f18794a;
            }
            this.f22687n = alignment;
        }
        boolean zU = interfaceC0249c0.U();
        x4.z zVar = x4.z.f26066a;
        if (zU) {
            q0 q0VarQ = z6.Q(j4);
            long j7 = (((long) q0VarQ.f1998a) << 32) | (((long) q0VarQ.f1999b) & 4294967295L);
            this.f22686m = j7;
            return interfaceC0249c0.e((int) (j7 >> 32), (int) (4294967295L & j7), zVar, new t0(q0VarQ, 5));
        }
        if (!((Boolean) this.f22685k.invoke()).booleanValue()) {
            q0 q0VarQ2 = z6.Q(j4);
            return interfaceC0249c0.e(q0VarQ2.f1998a, q0VarQ2.f1999b, zVar, new t0(q0VarQ2, 6));
        }
        C2651M c2651m = this.l;
        v0 v0Var = c2651m.f22652a;
        X x6 = c2651m.f22655d;
        Z z7 = c2651m.f22656e;
        C2803u0 c2803u0A = v0Var != null ? v0Var.a(new C2652N(x6, z7, 0), new C2652N(x6, z7, 1)) : null;
        v0 v0Var2 = c2651m.f22653b;
        C2803u0 c2803u0A2 = v0Var2 != null ? v0Var2.a(new C2652N(x6, z7, 2), new C2652N(x6, z7, 3)) : null;
        if (c2651m.f22654c.f23134a.b() == EnumC2649K.f22640a) {
            e0 e0Var = ((Y) x6).f22691b.f22781d;
            if (e0Var != null) {
                c0Var = new p0.c0(e0Var.f22729b);
            } else {
                e0 e0Var2 = z7.f22694a.f22781d;
                c0Var = e0Var2 != null ? new p0.c0(e0Var2.f22729b) : null;
            }
        } else {
            e0 e0Var3 = z7.f22694a.f22781d;
            if (e0Var3 != null) {
                c0Var = new p0.c0(e0Var3.f22729b);
            } else {
                e0 e0Var4 = ((Y) x6).f22691b.f22781d;
                if (e0Var4 != null) {
                    c0Var = new p0.c0(e0Var4.f22729b);
                }
            }
        }
        v0 v0Var3 = c2651m.f22657f;
        C1950d c1950d = new C1950d(c2803u0A, c2803u0A2, v0Var3 != null ? v0Var3.a(C2659c.f22709m, new C1950d(c0Var, x6, z7, 8)) : null, 7);
        q0 q0VarQ3 = z6.Q(j4);
        long j8 = (((long) q0VarQ3.f1998a) << 32) | (((long) q0VarQ3.f1999b) & 4294967295L);
        long j9 = !h1.l.a(this.f22686m, AbstractC2642D.f22617a) ? this.f22686m : j8;
        v0 v0Var4 = this.f22680c;
        C2803u0 c2803u0A3 = v0Var4 != null ? v0Var4.a(this.f22688o, new U(this, j9, 0)) : null;
        if (c2803u0A3 != null) {
            j8 = ((h1.l) c2803u0A3.getValue()).f16627a;
        }
        long jD = h1.b.d(j4, j8);
        v0 v0Var5 = this.f22681d;
        long j10 = v0Var5 != null ? ((h1.j) v0Var5.a(C2659c.f22711o, new U(this, j9, 1)).getValue()).f16621a : 0L;
        v0 v0Var6 = this.f22682e;
        if (v0Var6 != null) {
            c6 = ' ';
            j6 = ((h1.j) v0Var6.a(this.f22689p, new U(this, j9, 2)).getValue()).f16621a;
        } else {
            c6 = ' ';
            j6 = 0;
        }
        InterfaceC2242f interfaceC2242f = this.f22687n;
        return interfaceC0249c0.e((int) (jD >> c6), (int) (jD & 4294967295L), zVar, new T(q0VarQ3, h1.j.c(interfaceC2242f != null ? interfaceC2242f.a(j9, jD, h1.m.f16628a) : 0L, j6), j10, c1950d));
    }

    @Override // i0.AbstractC2254r
    public final void onAttach() {
        super.onAttach();
        this.f22686m = AbstractC2642D.f22617a;
    }
}
