package o;

import java.util.ArrayList;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class C6 implements InterfaceC2235qO {
    public final N6 a;
    public boolean b;

    public C6(N6 n6) {
        this.a = n6;
    }

    @Override // o.InterfaceC2235qO
    public final InterfaceC2329rO a(InterfaceC2424sO interfaceC2424sO, List list, long j) {
        ArrayList arrayList = new ArrayList(list.size());
        int size = list.size();
        int iMax = 0;
        int iMax2 = 0;
        for (int i = 0; i < size; i++) {
            VW vwC = ((InterfaceC1760lO) list.get(i)).c(j);
            iMax = Math.max(iMax, vwC.l);
            iMax2 = Math.max(iMax2, vwC.m);
            arrayList.add(vwC);
        }
        boolean zW = interfaceC2424sO.w();
        N6 n6 = this.a;
        if (zW) {
            this.b = true;
            n6.a.setValue(new C1470iI((4294967295L & iMax2) | (iMax << 32)));
        } else if (!this.b) {
            n6.a.setValue(new C1470iI((4294967295L & iMax2) | (iMax << 32)));
        }
        return interfaceC2424sO.H(iMax, iMax2, C0358Nv.l, new C1066e4(2, arrayList));
    }

    @Override // o.InterfaceC2235qO
    public final int c(InterfaceC2608uI interfaceC2608uI, List list, int i) {
        if (list.isEmpty()) {
            return 0;
        }
        int iD = ((InterfaceC1760lO) list.get(0)).d(i);
        int iR = AbstractC0008Ai.R(list);
        int i2 = 1;
        if (1 <= iR) {
            while (true) {
                int iD2 = ((InterfaceC1760lO) list.get(i2)).d(i);
                if (iD2 > iD) {
                    iD = iD2;
                }
                if (i2 == iR) {
                    break;
                }
                i2++;
            }
        }
        return iD;
    }

    @Override // o.InterfaceC2235qO
    public final int g(InterfaceC2608uI interfaceC2608uI, List list, int i) {
        if (list.isEmpty()) {
            return 0;
        }
        int iV = ((InterfaceC1760lO) list.get(0)).V(i);
        int iR = AbstractC0008Ai.R(list);
        int i2 = 1;
        if (1 <= iR) {
            while (true) {
                int iV2 = ((InterfaceC1760lO) list.get(i2)).V(i);
                if (iV2 > iV) {
                    iV = iV2;
                }
                if (i2 == iR) {
                    break;
                }
                i2++;
            }
        }
        return iV;
    }

    @Override // o.InterfaceC2235qO
    public final int i(InterfaceC2608uI interfaceC2608uI, List list, int i) {
        if (list.isEmpty()) {
            return 0;
        }
        int iO = ((InterfaceC1760lO) list.get(0)).O(i);
        int iR = AbstractC0008Ai.R(list);
        int i2 = 1;
        if (1 <= iR) {
            while (true) {
                int iO2 = ((InterfaceC1760lO) list.get(i2)).O(i);
                if (iO2 > iO) {
                    iO = iO2;
                }
                if (i2 == iR) {
                    break;
                }
                i2++;
            }
        }
        return iO;
    }

    @Override // o.InterfaceC2235qO
    public final int j(InterfaceC2608uI interfaceC2608uI, List list, int i) {
        if (list.isEmpty()) {
            return 0;
        }
        int iU = ((InterfaceC1760lO) list.get(0)).U(i);
        int iR = AbstractC0008Ai.R(list);
        int i2 = 1;
        if (1 <= iR) {
            while (true) {
                int iU2 = ((InterfaceC1760lO) list.get(i2)).U(i);
                if (iU2 > iU) {
                    iU = iU2;
                }
                if (i2 == iR) {
                    break;
                }
                i2++;
            }
        }
        return iU;
    }
}
