package defpackage;

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

/* JADX INFO: renamed from: ᵧᵣᵱ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C3673 implements InterfaceC1439, InterfaceC1479 {

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public static final byte[] f13943 = {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, -128, -69, 0, 0, 0, 0, 0};

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public static final byte[] f13944 = {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};

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public int f13945;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public Object f13946;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public int f13947;

    public C3673(int i) {
        switch (i) {
            case C5224.STRING_SET_FIELD_NUMBER /* 6 */:
                this.f13946 = new C3673[256];
                this.f13945 = 0;
                this.f13947 = 0;
                break;
            default:
                this.f13946 = new C1709(0);
                this.f13945 = 8000;
                this.f13947 = 8000;
                break;
        }
    }

    public C3673(Context context, XmlResourceParser xmlResourceParser) {
        this.f13946 = new ArrayList();
        this.f13947 = -1;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlResourceParser), AbstractC4329.f16477);
        int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
        for (int i = 0; i < indexCount; i++) {
            int index = typedArrayObtainStyledAttributes.getIndex(i);
            if (index == 0) {
                this.f13945 = typedArrayObtainStyledAttributes.getResourceId(index, this.f13945);
            } else if (index == 1) {
                int resourceId = typedArrayObtainStyledAttributes.getResourceId(index, this.f13947);
                this.f13947 = resourceId;
                String resourceTypeName = context.getResources().getResourceTypeName(resourceId);
                context.getResources().getResourceName(resourceId);
                if ("layout".equals(resourceTypeName)) {
                    new C3501().m8000(context, resourceId);
                }
            }
        }
        typedArrayObtainStyledAttributes.recycle();
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public static void m8286(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(AbstractC3481.m7930(i2));
    }

    @Override // defpackage.InterfaceC1439
    /* JADX INFO: renamed from: ʽˈˋ */
    public int mo4113() {
        return this.f13947;
    }

    @Override // defpackage.InterfaceC1439
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public int mo4114() {
        int i = this.f13945;
        return i == -1 ? ((C4545) this.f13946).m9610() : i;
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public void m8287() {
        int i;
        int i2 = this.f13945;
        if (i2 != 2) {
            if (i2 != 3 && i2 != 1) {
                this.f13946 = null;
                return;
            }
            C1935 c1935 = (C1935) this.f13946;
            if (c1935 == null || c1935.m5177() != Integer.MAX_VALUE) {
                this.f13946 = new C1935(Integer.MAX_VALUE);
                return;
            }
            return;
        }
        if (this.f13947 <= 0) {
            ᵷᵝˎ.ᵷᵺʾᵖ();
            return;
        }
        C1935 c19352 = (C1935) this.f13946;
        if (c19352 != null) {
            synchronized (((ᵱᵻᵧᵷ) c19352.f7715)) {
                i = c19352.f7711;
            }
            if (i == this.f13947) {
                return;
            }
        }
        this.f13946 = new C1935(this.f13947);
    }

    @Override // defpackage.InterfaceC1479
    /* JADX INFO: renamed from: ᵨᵼⁱ */
    public InterfaceC1070 mo4241() {
        return new C0335(this.f13945, this.f13947, (C1709) this.f13946);
    }

    @Override // defpackage.InterfaceC1439
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public int mo4115() {
        return this.f13945;
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public void m8288(int i) {
        int[] iArr = (int[]) this.f13946;
        int i2 = this.f13945;
        iArr[i2] = i;
        int i3 = this.f13947 & (i2 + 1);
        this.f13945 = i3;
        if (i3 == 0) {
            int length = iArr.length;
            int i4 = length << 1;
            if (i4 < 0) {
                C4935.m10237("Max array capacity exceeded");
                return;
            }
            int[] iArr2 = new int[i4];
            AbstractC3761.m8421(0, 0, length, iArr, iArr2);
            AbstractC3761.m8421(length, 0, 0, (int[]) this.f13946, iArr2);
            this.f13946 = iArr2;
            this.f13945 = length;
            this.f13947 = i4 - 1;
        }
    }
}
