package defpackage;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.util.AttributeSet;
import android.util.StateSet;
import android.view.ContextThemeWrapper;
import ar.tvplayer.tv.R;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParserException;

/* renamed from: ᵤˆ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3410 implements InterfaceC2895 {

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final int[][] f12700;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final int f12701;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C4879 f12702;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final C4879[] f12703;

    public C3410(ʽʽﹶ r2) {
        this.f12701 = r2.ᵿʗᵝʽ;
        this.f12702 = (C4879) r2.ᵢˇᵭ;
        this.f12700 = (int[][]) r2.ᵤᵙᵷ;
        this.f12703 = (C4879[]) r2.ᵾᵬ;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public static void m7773(ʽʽﹶ r11, Context context, XmlResourceParser xmlResourceParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
        int depth = xmlResourceParser.getDepth() + 1;
        while (true) {
            int next = xmlResourceParser.next();
            if (next == 1) {
                return;
            }
            int depth2 = xmlResourceParser.getDepth();
            if (depth2 < depth && next == 3) {
                return;
            }
            if (next == 2 && depth2 <= depth && xmlResourceParser.getName().equals("item")) {
                Resources resources = context.getResources();
                int[] iArr = AbstractC0914.f4192;
                TypedArray typedArrayObtainAttributes = theme == null ? resources.obtainAttributes(attributeSet, iArr) : theme.obtainStyledAttributes(attributeSet, iArr, 0, 0);
                int resourceId = typedArrayObtainAttributes.getResourceId(0, 0);
                int resourceId2 = typedArrayObtainAttributes.getResourceId(1, 0);
                C5318 c5318 = new C5318(0.0f);
                ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(context, resourceId);
                if (resourceId2 != 0) {
                    contextThemeWrapper.getTheme().applyStyle(resourceId2, true);
                }
                C4879 c4879M9814 = C4879.m10322(contextThemeWrapper.obtainStyledAttributes(AbstractC0914.f4190), c5318).m9814();
                typedArrayObtainAttributes.recycle();
                int attributeCount = attributeSet.getAttributeCount();
                int[] iArr2 = new int[attributeCount];
                int i = 0;
                for (int i2 = 0; i2 < attributeCount; i2++) {
                    int attributeNameResource = attributeSet.getAttributeNameResource(i2);
                    if (attributeNameResource != R.attr._11_res_0x7f040574 && attributeNameResource != R.attr._11_res_0x7f04057f) {
                        int i3 = i + 1;
                        if (!attributeSet.getAttributeBooleanValue(i2, false)) {
                            attributeNameResource = -attributeNameResource;
                        }
                        iArr2[i] = attributeNameResource;
                        i = i3;
                    }
                }
                int[] iArrTrimStateSet = StateSet.trimStateSet(iArr2, i);
                int i4 = r11.ᵿʗᵝʽ;
                if (i4 == 0 || iArrTrimStateSet.length == 0) {
                    r11.ᵢˇᵭ = c4879M9814;
                }
                int[][] iArr3 = (int[][]) r11.ᵤᵙᵷ;
                if (i4 >= iArr3.length) {
                    int i5 = i4 + 10;
                    int[][] iArr4 = new int[i5][];
                    System.arraycopy(iArr3, 0, iArr4, 0, i4);
                    r11.ᵤᵙᵷ = iArr4;
                    C4879[] c4879Arr = new C4879[i5];
                    System.arraycopy((C4879[]) r11.ᵾᵬ, 0, c4879Arr, 0, i4);
                    r11.ᵾᵬ = c4879Arr;
                }
                int[][] iArr5 = (int[][]) r11.ᵤᵙᵷ;
                int i6 = r11.ᵿʗᵝʽ;
                iArr5[i6] = iArrTrimStateSet;
                ((C4879[]) r11.ᵾᵬ)[i6] = c4879M9814;
                r11.ᵿʗᵝʽ = i6 + 1;
            }
        }
    }

    @Override // defpackage.InterfaceC2895
    /* renamed from: ˏᵙ */
    public final C4879 mo7064() {
        return this.f12702;
    }

    @Override // defpackage.InterfaceC2895
    /* renamed from: ᵥᵯˎ */
    public final C4879 mo7065(float f) {
        return this.f12702.mo7065(f);
    }

    @Override // defpackage.InterfaceC2895
    /* renamed from: ᵴᵳ */
    public final C4879 mo7066(int[] iArr) {
        int i;
        int i2;
        int[][] iArr2;
        int i3 = 0;
        int i4 = 0;
        while (true) {
            i = -1;
            i2 = this.f12701;
            iArr2 = this.f12700;
            if (i4 >= i2) {
                i4 = -1;
                break;
            }
            if (StateSet.stateSetMatches(iArr2[i4], iArr)) {
                break;
            }
            i4++;
        }
        if (i4 < 0) {
            int[] iArr3 = StateSet.WILD_CARD;
            while (true) {
                if (i3 >= i2) {
                    break;
                }
                if (StateSet.stateSetMatches(iArr2[i3], iArr3)) {
                    i = i3;
                    break;
                }
                i3++;
            }
            i4 = i;
        }
        return this.f12703[i4];
    }

    @Override // defpackage.InterfaceC2895
    /* renamed from: ᵻᵢﹳᵰ */
    public final boolean mo7067() {
        return this.f12701 > 1;
    }
}
