package G;

import G0.q0;
import i0.C2246j;
import i0.InterfaceC2241e;
import java.util.List;
import x.EnumC3207z0;

/* JADX INFO: renamed from: G.i, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0234i {

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

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

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

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final h1.m f1761f;

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

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

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final int[] f1764i;

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f1766k;

    public C0234i(int i6, int i7, List list, long j4, Object obj, InterfaceC2241e interfaceC2241e, h1.m mVar) {
        EnumC3207z0 enumC3207z0 = EnumC3207z0.f25984a;
        this.f1756a = i6;
        this.f1757b = list;
        this.f1758c = j4;
        this.f1759d = obj;
        this.f1760e = interfaceC2241e;
        this.f1761f = mVar;
        EnumC3207z0 enumC3207z02 = EnumC3207z0.f25984a;
        this.f1762g = false;
        int size = list.size();
        int iMax = 0;
        for (int i8 = 0; i8 < size; i8++) {
            q0 q0Var = (q0) list.get(i8);
            iMax = Math.max(iMax, !this.f1762g ? q0Var.f1999b : q0Var.f1998a);
        }
        this.f1763h = iMax;
        this.f1764i = new int[this.f1757b.size() * 2];
        this.f1766k = Integer.MIN_VALUE;
    }

    public final void a(int i6) {
        this.f1765j += i6;
        int[] iArr = this.f1764i;
        int length = iArr.length;
        for (int i7 = 0; i7 < length; i7++) {
            boolean z6 = this.f1762g;
            if ((z6 && i7 % 2 == 1) || (!z6 && i7 % 2 == 0)) {
                iArr[i7] = iArr[i7] + i6;
            }
        }
    }

    public final void b(int i6, int i7, int i8) {
        int i9;
        this.f1765j = i6;
        boolean z6 = this.f1762g;
        this.f1766k = z6 ? i8 : i7;
        List list = this.f1757b;
        int size = list.size();
        for (int i10 = 0; i10 < size; i10++) {
            q0 q0Var = (q0) list.get(i10);
            int i11 = i10 * 2;
            int[] iArr = this.f1764i;
            if (z6) {
                iArr[i11] = Math.round((1 + (this.f1761f != h1.m.f16628a ? 0.0f * (-1) : 0.0f)) * ((i7 - q0Var.f1998a) / 2.0f));
                iArr[i11 + 1] = i6;
                i9 = q0Var.f1999b;
            } else {
                iArr[i11] = i6;
                int i12 = i11 + 1;
                InterfaceC2241e interfaceC2241e = this.f1760e;
                if (interfaceC2241e == null) {
                    A.b.b("null verticalAlignment");
                    throw new E3.v();
                }
                iArr[i12] = ((C2246j) interfaceC2241e).a(q0Var.f1999b, i8);
                i9 = q0Var.f1998a;
            }
            i6 += i9;
        }
    }
}
