package E;

import G0.InterfaceC0247b0;
import java.util.List;
import java.util.Map;
import m3.AbstractC2467b;
import x.EnumC3207z0;
import x4.AbstractC3251q;

/* JADX INFO: loaded from: classes.dex */
public final class r implements InterfaceC0247b0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final t f1054a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final boolean f1056c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final float f1057d;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final float f1059f;

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final V4.C f1061h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final h1.c f1062i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final int f1063j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final J4.c f1064k;
    public final J4.c l;

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

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final int f1066n;

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

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

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final EnumC3207z0 f1069q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final int f1070r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final int f1071s;

    public r(t tVar, int i6, boolean z6, float f6, InterfaceC0247b0 interfaceC0247b0, float f7, boolean z7, V4.C c6, h1.c cVar, int i7, J4.c cVar2, J4.c cVar3, List list, int i8, int i9, int i10, EnumC3207z0 enumC3207z0, int i11, int i12) {
        this.f1054a = tVar;
        this.f1055b = i6;
        this.f1056c = z6;
        this.f1057d = f6;
        this.f1058e = interfaceC0247b0;
        this.f1059f = f7;
        this.f1060g = z7;
        this.f1061h = c6;
        this.f1062i = cVar;
        this.f1063j = i7;
        this.f1064k = cVar2;
        this.l = cVar3;
        this.f1065m = list;
        this.f1066n = i8;
        this.f1067o = i9;
        this.f1068p = i10;
        this.f1069q = enumC3207z0;
        this.f1070r = i11;
        this.f1071s = i12;
    }

    /* JADX WARN: Type inference failed for: r2v1, types: [java.lang.Object, java.util.Collection, java.util.List] */
    public final r a(int i6, boolean z6) {
        t tVar;
        int i7;
        int i8;
        if (this.f1060g) {
            return null;
        }
        ?? r22 = this.f1065m;
        if (r22.isEmpty() || (tVar = this.f1054a) == null || (i7 = this.f1055b - i6) < 0 || i7 >= tVar.f1095g) {
            return null;
        }
        s sVar = (s) AbstractC3251q.e0(r22);
        s sVar2 = (s) AbstractC3251q.n0(r22);
        if (sVar.f1088r || sVar2.f1088r) {
            return null;
        }
        EnumC3207z0 enumC3207z0 = this.f1069q;
        int i9 = this.f1067o;
        int i10 = this.f1066n;
        if (i6 < 0) {
            if (Math.min((AbstractC2467b.g(sVar, enumC3207z0) + sVar.l) - i10, (AbstractC2467b.g(sVar2, enumC3207z0) + sVar2.l) - i9) <= (-i6)) {
                return null;
            }
        } else if (Math.min(i10 - AbstractC2467b.g(sVar, enumC3207z0), i9 - AbstractC2467b.g(sVar2, enumC3207z0)) <= i6) {
            return null;
        }
        int size = r22.size();
        int i11 = 0;
        while (i11 < size) {
            s sVar3 = (s) r22.get(i11);
            if (sVar3.f1088r) {
                i8 = i7;
            } else {
                long j4 = sVar3.f1085o;
                i8 = i7;
                sVar3.f1085o = (((long) ((int) (j4 >> 32))) << 32) | (((long) (((int) (j4 & 4294967295L)) + i6)) & 4294967295L);
                if (z6) {
                    int size2 = sVar3.f1076e.size();
                    for (int i12 = 0; i12 < size2; i12++) {
                        sVar3.f1079h.a(i12, sVar3.f1073b);
                    }
                }
            }
            i11++;
            i7 = i8;
        }
        return new r(this.f1054a, i7, this.f1056c || i6 > 0, i6, this.f1058e, this.f1059f, this.f1060g, this.f1061h, this.f1062i, this.f1063j, this.f1064k, this.l, r22, this.f1066n, this.f1067o, this.f1068p, enumC3207z0, this.f1070r, this.f1071s);
    }

    @Override // G0.InterfaceC0247b0
    public final Map b() {
        return this.f1058e.b();
    }

    @Override // G0.InterfaceC0247b0
    public final void c() {
        this.f1058e.c();
    }

    @Override // G0.InterfaceC0247b0
    public final J4.c d() {
        return this.f1058e.d();
    }

    public final long e() {
        InterfaceC0247b0 interfaceC0247b0 = this.f1058e;
        return (((long) interfaceC0247b0.getWidth()) << 32) | (((long) interfaceC0247b0.getHeight()) & 4294967295L);
    }

    @Override // G0.InterfaceC0247b0
    public final int getHeight() {
        return this.f1058e.getHeight();
    }

    @Override // G0.InterfaceC0247b0
    public final int getWidth() {
        return this.f1058e.getWidth();
    }
}
