package androidx.fragment.app;

import X6FRs_4.XnFJ5_9.KQgRr5e_0.IMuAHx_6;
import X6FRs_4.XnFJ5_9.KQgRr5e_0.KQgRr5e_0;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Log;
import java.util.ArrayList;
/* compiled from: BackStackRecord.java */
/* loaded from: classes.dex */
public final class BackStackState implements Parcelable {
    public static final Parcelable.Creator<BackStackState> CREATOR = new KQgRr5e_0();
    public final int KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final CharSequence f2312KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final String f2313KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final ArrayList<String> f2314KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final int[] f2315KQgRr5e_0;

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public final int f3520Mqv2r_3;
    public final int PGPF6hQ_2;
    public final int QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public final CharSequence f2316QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public final ArrayList<String> f2317QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public final boolean f2318QxJ9d_1;

    /* renamed from: X6FRs_4  reason: collision with root package name */
    public final int f3521X6FRs_4;

    /* compiled from: BackStackRecord.java */
    /* loaded from: classes.dex */
    public static class KQgRr5e_0 implements Parcelable.Creator<BackStackState> {
        @Override // android.os.Parcelable.Creator
        /* renamed from: KQgRr5e_0 */
        public BackStackState createFromParcel(Parcel parcel) {
            return new BackStackState(parcel);
        }

        @Override // android.os.Parcelable.Creator
        /* renamed from: KQgRr5e_0 */
        public BackStackState[] newArray(int i) {
            return new BackStackState[i];
        }
    }

    public BackStackState(X6FRs_4.XnFJ5_9.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0) {
        int size = kQgRr5e_0.f1303KQgRr5e_0.size();
        this.f2315KQgRr5e_0 = new int[size * 6];
        if (kQgRr5e_0.f1304KQgRr5e_0) {
            int i = 0;
            for (int i2 = 0; i2 < size; i2++) {
                KQgRr5e_0.C0071KQgRr5e_0 c0071KQgRr5e_0 = kQgRr5e_0.f1303KQgRr5e_0.get(i2);
                int[] iArr = this.f2315KQgRr5e_0;
                int i3 = i + 1;
                iArr[i] = c0071KQgRr5e_0.KQgRr5e_0;
                int i4 = i3 + 1;
                Fragment fragment = c0071KQgRr5e_0.f1311KQgRr5e_0;
                iArr[i3] = fragment != null ? fragment.mIndex : -1;
                int[] iArr2 = this.f2315KQgRr5e_0;
                int i5 = i4 + 1;
                iArr2[i4] = c0071KQgRr5e_0.QxJ9d_1;
                int i6 = i5 + 1;
                iArr2[i5] = c0071KQgRr5e_0.PGPF6hQ_2;
                int i7 = i6 + 1;
                iArr2[i6] = c0071KQgRr5e_0.f3330Mqv2r_3;
                i = i7 + 1;
                iArr2[i7] = c0071KQgRr5e_0.f3331X6FRs_4;
            }
            this.KQgRr5e_0 = kQgRr5e_0.f3328X6FRs_4;
            this.QxJ9d_1 = kQgRr5e_0.f3325IFxWkV_5;
            this.f2313KQgRr5e_0 = kQgRr5e_0.f1302KQgRr5e_0;
            this.PGPF6hQ_2 = kQgRr5e_0.f3326IMuAHx_6;
            this.f3520Mqv2r_3 = kQgRr5e_0.f3324FSaI4_7;
            this.f2312KQgRr5e_0 = kQgRr5e_0.f1301KQgRr5e_0;
            this.f3521X6FRs_4 = kQgRr5e_0.f3329Xgtqvk_8;
            this.f2316QxJ9d_1 = kQgRr5e_0.f1308QxJ9d_1;
            this.f2314KQgRr5e_0 = kQgRr5e_0.f1309QxJ9d_1;
            this.f2317QxJ9d_1 = kQgRr5e_0.f1306PGPF6hQ_2;
            this.f2318QxJ9d_1 = kQgRr5e_0.f1307PGPF6hQ_2;
            return;
        }
        throw new IllegalStateException("Not on back stack");
    }

    public X6FRs_4.XnFJ5_9.KQgRr5e_0.KQgRr5e_0 KQgRr5e_0(IMuAHx_6 iMuAHx_6) {
        X6FRs_4.XnFJ5_9.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 = new X6FRs_4.XnFJ5_9.KQgRr5e_0.KQgRr5e_0(iMuAHx_6);
        int i = 0;
        int i2 = 0;
        while (i < this.f2315KQgRr5e_0.length) {
            KQgRr5e_0.C0071KQgRr5e_0 c0071KQgRr5e_0 = new KQgRr5e_0.C0071KQgRr5e_0();
            int i3 = i + 1;
            c0071KQgRr5e_0.KQgRr5e_0 = this.f2315KQgRr5e_0[i];
            if (IMuAHx_6.f3314FSaI4_7) {
                Log.v("FragmentManager", "Instantiate " + kQgRr5e_0 + " op #" + i2 + " base fragment #" + this.f2315KQgRr5e_0[i3]);
            }
            int i4 = i3 + 1;
            int i5 = this.f2315KQgRr5e_0[i3];
            if (i5 >= 0) {
                c0071KQgRr5e_0.f1311KQgRr5e_0 = iMuAHx_6.f1269KQgRr5e_0.get(i5);
            } else {
                c0071KQgRr5e_0.f1311KQgRr5e_0 = null;
            }
            int[] iArr = this.f2315KQgRr5e_0;
            int i6 = i4 + 1;
            int i7 = iArr[i4];
            c0071KQgRr5e_0.QxJ9d_1 = i7;
            int i8 = i6 + 1;
            int i9 = iArr[i6];
            c0071KQgRr5e_0.PGPF6hQ_2 = i9;
            int i10 = i8 + 1;
            int i11 = iArr[i8];
            c0071KQgRr5e_0.f3330Mqv2r_3 = i11;
            int i12 = iArr[i10];
            c0071KQgRr5e_0.f3331X6FRs_4 = i12;
            kQgRr5e_0.KQgRr5e_0 = i7;
            kQgRr5e_0.QxJ9d_1 = i9;
            kQgRr5e_0.PGPF6hQ_2 = i11;
            kQgRr5e_0.f3327Mqv2r_3 = i12;
            kQgRr5e_0.m612KQgRr5e_0(c0071KQgRr5e_0);
            i2++;
            i = i10 + 1;
        }
        kQgRr5e_0.f3328X6FRs_4 = this.KQgRr5e_0;
        kQgRr5e_0.f3325IFxWkV_5 = this.QxJ9d_1;
        kQgRr5e_0.f1302KQgRr5e_0 = this.f2313KQgRr5e_0;
        kQgRr5e_0.f3326IMuAHx_6 = this.PGPF6hQ_2;
        kQgRr5e_0.f1304KQgRr5e_0 = true;
        kQgRr5e_0.f3324FSaI4_7 = this.f3520Mqv2r_3;
        kQgRr5e_0.f1301KQgRr5e_0 = this.f2312KQgRr5e_0;
        kQgRr5e_0.f3329Xgtqvk_8 = this.f3521X6FRs_4;
        kQgRr5e_0.f1308QxJ9d_1 = this.f2316QxJ9d_1;
        kQgRr5e_0.f1309QxJ9d_1 = this.f2314KQgRr5e_0;
        kQgRr5e_0.f1306PGPF6hQ_2 = this.f2317QxJ9d_1;
        kQgRr5e_0.f1307PGPF6hQ_2 = this.f2318QxJ9d_1;
        kQgRr5e_0.KQgRr5e_0(1);
        return kQgRr5e_0;
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeIntArray(this.f2315KQgRr5e_0);
        parcel.writeInt(this.KQgRr5e_0);
        parcel.writeInt(this.QxJ9d_1);
        parcel.writeString(this.f2313KQgRr5e_0);
        parcel.writeInt(this.PGPF6hQ_2);
        parcel.writeInt(this.f3520Mqv2r_3);
        TextUtils.writeToParcel(this.f2312KQgRr5e_0, parcel, 0);
        parcel.writeInt(this.f3521X6FRs_4);
        TextUtils.writeToParcel(this.f2316QxJ9d_1, parcel, 0);
        parcel.writeStringList(this.f2314KQgRr5e_0);
        parcel.writeStringList(this.f2317QxJ9d_1);
        parcel.writeInt(this.f2318QxJ9d_1 ? 1 : 0);
    }

    public BackStackState(Parcel parcel) {
        this.f2315KQgRr5e_0 = parcel.createIntArray();
        this.KQgRr5e_0 = parcel.readInt();
        this.QxJ9d_1 = parcel.readInt();
        this.f2313KQgRr5e_0 = parcel.readString();
        this.PGPF6hQ_2 = parcel.readInt();
        this.f3520Mqv2r_3 = parcel.readInt();
        this.f2312KQgRr5e_0 = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        this.f3521X6FRs_4 = parcel.readInt();
        this.f2316QxJ9d_1 = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        this.f2314KQgRr5e_0 = parcel.createStringArrayList();
        this.f2317QxJ9d_1 = parcel.createStringArrayList();
        this.f2318QxJ9d_1 = parcel.readInt() != 0;
    }
}
