package defpackage;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.util.Xml;
import java.nio.ByteBuffer;
import java.util.ArrayList;

/* renamed from: ᵥᵕᵢˌ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3513 implements InterfaceC3699, InterfaceC1731 {

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public int f13182;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public int f13183;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public Object f13184;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public static final byte[] f13181 = {79, 103, 103, 83, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, -43, -59, -9, 1, 19, 79, 112, 117, 115, 72, 101, 97, 100, 1, 2, 56, 1, Byte.MIN_VALUE, -69, 0, 0, 0, 0, 0};

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public static final byte[] f13180 = {79, 103, 103, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 11, -103, 87, 83, 1, 16, 79, 112, 117, 115, 84, 97, 103, 115, 0, 0, 0, 0, 0, 0, 0, 0};

    public C3513(int i) {
        switch (i) {
            case C1339.STRING_SET_FIELD_NUMBER /* 6 */:
                this.f13184 = new C3513[256];
                this.f13183 = 0;
                this.f13182 = 0;
                break;
            default:
                this.f13184 = new C5553(0);
                this.f13183 = 8000;
                this.f13182 = 8000;
                break;
        }
    }

    public C3513(Context context, XmlResourceParser xmlResourceParser) throws Resources.NotFoundException {
        this.f13184 = new ArrayList();
        this.f13182 = -1;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlResourceParser), AbstractC3962.f14951);
        int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
        for (int i = 0; i < indexCount; i++) {
            int index = typedArrayObtainStyledAttributes.getIndex(i);
            if (index == 0) {
                this.f13183 = typedArrayObtainStyledAttributes.getResourceId(index, this.f13183);
            } else if (index == 1) {
                int resourceId = typedArrayObtainStyledAttributes.getResourceId(index, this.f13182);
                this.f13182 = resourceId;
                String resourceTypeName = context.getResources().getResourceTypeName(resourceId);
                context.getResources().getResourceName(resourceId);
                if ("layout".equals(resourceTypeName)) {
                    new C1047().m3420(context, resourceId);
                }
            }
        }
        typedArrayObtainStyledAttributes.recycle();
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public static void m8035(ByteBuffer byteBuffer, long j, int i, int i2, boolean z) {
        byteBuffer.put((byte) 79);
        byteBuffer.put((byte) 103);
        byteBuffer.put((byte) 103);
        byteBuffer.put((byte) 83);
        byteBuffer.put((byte) 0);
        byteBuffer.put(z ? (byte) 2 : (byte) 0);
        byteBuffer.putLong(j);
        byteBuffer.putInt(0);
        byteBuffer.putInt(i);
        byteBuffer.putInt(0);
        byteBuffer.put(ᵯᵽᵦ.ˇʼʤˎ(i2));
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public void m8036() {
        int i;
        int i2 = this.f13183;
        if (i2 != 2) {
            if (i2 != 3 && i2 != 1) {
                this.f13184 = null;
                return;
            }
            C3457 c3457 = (C3457) this.f13184;
            if (c3457 == null || c3457.m7856() != Integer.MAX_VALUE) {
                this.f13184 = new C3457(Integer.MAX_VALUE);
                return;
            }
            return;
        }
        if (this.f13182 <= 0) {
            ᵨᴵᵺ.ᵻᵢﹳᵰ();
            return;
        }
        C3457 c34572 = (C3457) this.f13184;
        if (c34572 != null) {
            synchronized (((ᵼᵫᵧˀ) c34572.f12975)) {
                i = c34572.f12979;
            }
            if (i == this.f13182) {
                return;
            }
        }
        this.f13184 = new C3457(this.f13182);
    }

    @Override // defpackage.InterfaceC3699
    /* renamed from: ˏᵙ */
    public int mo6992() {
        int i = this.f13183;
        return i == -1 ? ((C3493) this.f13184).m7943() : i;
    }

    @Override // defpackage.InterfaceC3699
    /* renamed from: ᵥᵯˎ */
    public int mo6993() {
        return this.f13183;
    }

    @Override // defpackage.InterfaceC3699
    /* renamed from: ᵴᵳ */
    public int mo6994() {
        return this.f13182;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public void m8037(int i) {
        int[] iArr = (int[]) this.f13184;
        int i2 = this.f13183;
        iArr[i2] = i;
        int i3 = this.f13182 & (i2 + 1);
        this.f13183 = i3;
        if (i3 == 0) {
            int length = iArr.length;
            int i4 = length << 1;
            if (i4 < 0) {
                C1260.m3816("Max array capacity exceeded");
                return;
            }
            int[] iArr2 = new int[i4];
            AbstractC1658.m4716(0, 0, length, iArr, iArr2);
            AbstractC1658.m4716(length, 0, 0, (int[]) this.f13184, iArr2);
            this.f13184 = iArr2;
            this.f13183 = length;
            this.f13182 = i4 - 1;
        }
    }

    @Override // defpackage.InterfaceC1731
    /* renamed from: ᵾᵬ */
    public InterfaceC2569 mo4930() {
        return new C2574(this.f13183, this.f13182, (C5553) this.f13184);
    }
}
