package o; import android.view.View; import android.view.ViewGroup; import androidx.recyclerview.widget.RecyclerView; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import o.C16381npu; import o.C17052tZT; import org.bouncycastle.asn1.cmp.PKIFailureInfo; /* loaded from: classes2.dex */ public final class kpA extends scC { private final boolean b; private static final int[] e = {1}; private static final int[] d = {1, 0}; public kpA() { this((byte) 0); } private kpA(byte b) { this.b = false; } /* JADX INFO: Access modifiers changed from: package-private */ /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Type inference failed for: r13v10 */ /* JADX WARN: Type inference failed for: r13v2 */ /* JADX WARN: Type inference failed for: r13v3, types: [int, boolean] */ @Override // o.scC public final C16381npu d(InterfaceC0312Dxl interfaceC0312Dxl, View view) { ?? r13; float f; float a = interfaceC0312Dxl.a(); RecyclerView.saX sax = (RecyclerView.saX) view.getLayoutParams(); float f2 = ((ViewGroup.MarginLayoutParams) sax).leftMargin + ((ViewGroup.MarginLayoutParams) sax).rightMargin; float dimension = view.getContext().getResources().getDimension(C17052tZT.HBt.m3_carousel_small_item_size_min); float dimension2 = view.getContext().getResources().getDimension(C17052tZT.HBt.m3_carousel_small_item_size_max) + f2; float measuredWidth = view.getMeasuredWidth(); float min = Math.min(measuredWidth + f2, a); float f3 = (measuredWidth / 3.0f) + f2; float dimension3 = view.getContext().getResources().getDimension(C17052tZT.HBt.m3_carousel_small_item_size_min) + f2; float dimension4 = view.getContext().getResources().getDimension(C17052tZT.HBt.m3_carousel_small_item_size_max) + f2; float f4 = f3 < dimension3 ? dimension3 : f3 > dimension4 ? dimension4 : f3; float f5 = (min + f4) / 2.0f; int[] iArr = e; int[] iArr2 = d; int max = (int) Math.max(1.0d, Math.floor(((a - (b(iArr2) * f5)) - (b(iArr) * dimension2)) / min)); int ceil = (int) Math.ceil(a / min); int i = (ceil - max) + 1; int[] iArr3 = new int[i]; int i2 = 0; for (int i3 = 0; i3 < i; i3++) { iArr3[i3] = ceil - i3; } float f6 = dimension + f2; IeS ieS = null; int i4 = 0; int i5 = 1; loop1: while (true) { if (i4 >= i) { r13 = i2; f = f2; break; } int i6 = iArr3[i4]; int length = iArr2.length; int i7 = i2; while (i7 < length) { int i8 = iArr2[i7]; int length2 = iArr.length; int i9 = i5; IeS ieS2 = ieS; int i10 = i2; while (i10 < length2) { f = f2; int i11 = i10; IeS ieS3 = ieS2; int i12 = length2; int i13 = i7; int i14 = length; float f7 = dimension2; int i15 = i4; float f8 = dimension2; r13 = i2; int[] iArr4 = iArr3; int i16 = i; int[] iArr5 = iArr2; int[] iArr6 = iArr; ieS = new IeS(i9, f4, f6, f7, iArr[i10], f5, i8, min, i6, a); if (ieS3 != null && ieS.a >= ieS3.a) { ieS2 = ieS3; } else { if (ieS.a == BitmapDescriptorFactory.HUE_RED) { break loop1; } ieS2 = ieS; } i9++; i10 = i11 + 1; i2 = r13 == true ? 1 : 0; dimension2 = f8; f2 = f; length2 = i12; i7 = i13; length = i14; i4 = i15; iArr3 = iArr4; i = i16; iArr2 = iArr5; iArr = iArr6; } i7++; ieS = ieS2; i5 = i9; dimension2 = dimension2; f2 = f2; } i4++; dimension2 = dimension2; } float dimension5 = view.getContext().getResources().getDimension(C17052tZT.HBt.m3_carousel_gone_size) + f; float f9 = dimension5 / 2.0f; float f10 = (ieS.c / 2.0f) + BitmapDescriptorFactory.HUE_RED; float max2 = (Math.max((int) r13, ieS.d - 1) * ieS.c) + f10; float f11 = (ieS.c / 2.0f) + max2; if (ieS.e > 0) { max2 = (ieS.b / 2.0f) + f11; } if (ieS.e > 0) { f11 = (ieS.b / 2.0f) + max2; } float f12 = ieS.j > 0 ? f11 + (ieS.f / 2.0f) : max2; float a2 = interfaceC0312Dxl.a(); float f13 = 1.0f - ((dimension5 - f) / (ieS.c - f)); float f14 = 1.0f - ((ieS.f - f) / (ieS.c - f)); float f15 = 1.0f - ((ieS.b - f) / (ieS.c - f)); C16381npu.RVV b = new C16381npu.RVV(ieS.c).b(BitmapDescriptorFactory.HUE_RED - f9, f13, dimension5, r13).b(f10, BitmapDescriptorFactory.HUE_RED, ieS.c, ieS.d, true); if (ieS.e > 0) { b.b(max2, f15, ieS.b, r13); } if (ieS.j > 0) { b.b(f12, f14, ieS.f, ieS.j, false); } b.b(a2 + f9, f13, dimension5, r13); return b.c(); } private static int b(int[] iArr) { int i = PKIFailureInfo.systemUnavail; for (int i2 : iArr) { if (i2 > i) { i = i2; } } return i; } /* loaded from: classes2.dex */ static final class IeS { final float a; float b; float c; final int d; final int e; float f; private int g; final int j; /* JADX WARN: Code restructure failed: missing block: B:27:0x00ab, code lost: if (r3 > r1.f) goto L44; */ /* JADX WARN: Code restructure failed: missing block: B:36:0x00b8, code lost: if (r1.c <= r1.f) goto L43; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ IeS(int r2, float r3, float r4, float r5, int r6, float r7, int r8, float r9, int r10, float r11) { /* Method dump skipped, instructions count: 205 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: o.kpA.IeS.(int, float, float, float, int, float, int, float, int, float):void"); } public final String toString() { StringBuilder sb = new StringBuilder("Arrangement [priority="); sb.append(this.g); sb.append(", smallCount="); sb.append(this.j); sb.append(", smallSize="); sb.append(this.f); sb.append(", mediumCount="); sb.append(this.e); sb.append(", mediumSize="); sb.append(this.b); sb.append(", largeCount="); sb.append(this.d); sb.append(", largeSize="); sb.append(this.c); sb.append(", cost="); sb.append(this.a); sb.append("]"); return sb.toString(); } } }