package XnFJ5_9.Ft6VRog_36.Nm6q_10;

import androidx.recyclerview.widget.RecyclerView;
import com.wang.avi.BuildConfig;
import java.io.IOException;
/* compiled from: Http2.java */
/* loaded from: classes.dex */
public final class X6FRs_4 {
    public static final Nm6q_10.FSaI4_7 KQgRr5e_0 = Nm6q_10.FSaI4_7.PGPF6hQ_2("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n");

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public static final String[] f1590KQgRr5e_0 = {"DATA", "HEADERS", "PRIORITY", "RST_STREAM", "SETTINGS", "PUSH_PROMISE", "PING", "GOAWAY", "WINDOW_UPDATE", "CONTINUATION"};
    public static final String[] QxJ9d_1 = new String[64];
    public static final String[] PGPF6hQ_2 = new String[RecyclerView.WGk6X_27.FLAG_TMP_DETACHED];

    static {
        int i;
        int i2 = 0;
        int i3 = 0;
        while (true) {
            String[] strArr = PGPF6hQ_2;
            if (i3 >= strArr.length) {
                break;
            }
            strArr[i3] = XnFJ5_9.Ft6VRog_36.X6FRs_4.KQgRr5e_0("%8s", Integer.toBinaryString(i3)).replace(' ', '0');
            i3++;
        }
        String[] strArr2 = QxJ9d_1;
        strArr2[0] = BuildConfig.FLAVOR;
        strArr2[1] = "END_STREAM";
        int[] iArr = {1};
        strArr2[8] = "PADDED";
        for (int i4 = 0; i4 < 1; i4++) {
            QxJ9d_1[iArr[i4] | 8] = QxJ9d_1[i] + "|PADDED";
        }
        String[] strArr3 = QxJ9d_1;
        strArr3[4] = "END_HEADERS";
        strArr3[32] = "PRIORITY";
        strArr3[36] = "END_HEADERS|PRIORITY";
        int[] iArr2 = {4, 32, 36};
        for (int i5 = 0; i5 < 3; i5++) {
            int i6 = iArr2[i5];
            for (int i7 = 0; i7 < 1; i7++) {
                int i8 = iArr[i7];
                int i9 = i8 | i6;
                QxJ9d_1[i9] = QxJ9d_1[i8] + '|' + QxJ9d_1[i6];
                QxJ9d_1[i9 | 8] = QxJ9d_1[i8] + '|' + QxJ9d_1[i6] + "|PADDED";
            }
        }
        while (true) {
            String[] strArr4 = QxJ9d_1;
            if (i2 >= strArr4.length) {
                return;
            }
            if (strArr4[i2] == null) {
                strArr4[i2] = PGPF6hQ_2[i2];
            }
            i2++;
        }
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public static IllegalArgumentException m717KQgRr5e_0(String str, Object... objArr) {
        throw new IllegalArgumentException(XnFJ5_9.Ft6VRog_36.X6FRs_4.KQgRr5e_0(str, objArr));
    }

    public static IOException KQgRr5e_0(String str, Object... objArr) throws IOException {
        throw new IOException(XnFJ5_9.Ft6VRog_36.X6FRs_4.KQgRr5e_0(str, objArr));
    }

    public static String KQgRr5e_0(boolean z, int i, int i2, byte b, byte b2) {
        String[] strArr = f1590KQgRr5e_0;
        String KQgRr5e_02 = b < strArr.length ? strArr[b] : XnFJ5_9.Ft6VRog_36.X6FRs_4.KQgRr5e_0("0x%02x", Byte.valueOf(b));
        String KQgRr5e_03 = KQgRr5e_0(b, b2);
        Object[] objArr = new Object[5];
        objArr[0] = z ? "<<" : ">>";
        objArr[1] = Integer.valueOf(i);
        objArr[2] = Integer.valueOf(i2);
        objArr[3] = KQgRr5e_02;
        objArr[4] = KQgRr5e_03;
        return XnFJ5_9.Ft6VRog_36.X6FRs_4.KQgRr5e_0("%s 0x%08x %5d %-13s %s", objArr);
    }

    public static String KQgRr5e_0(byte b, byte b2) {
        if (b2 == 0) {
            return BuildConfig.FLAVOR;
        }
        if (b != 2 && b != 3) {
            if (b == 4 || b == 6) {
                return b2 == 1 ? "ACK" : PGPF6hQ_2[b2];
            } else if (b != 7 && b != 8) {
                String[] strArr = QxJ9d_1;
                String str = b2 < strArr.length ? strArr[b2] : PGPF6hQ_2[b2];
                if (b != 5 || (b2 & 4) == 0) {
                    return (b != 0 || (b2 & 32) == 0) ? str : str.replace("PRIORITY", "COMPRESSED");
                }
                return str.replace("HEADERS", "PUSH_PROMISE");
            }
        }
        return PGPF6hQ_2[b2];
    }
}
