package r7;

import d3.E;
import x7.C1734j;

/* JADX INFO: loaded from: classes.dex */
public abstract class f {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final C1734j f16608a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final String[] f16609b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final String[] f16610c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final String[] f16611d;

    static {
        C1734j c1734j = C1734j.f18766t;
        f16608a = E.h("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n");
        f16609b = new String[]{"DATA", "HEADERS", "PRIORITY", "RST_STREAM", "SETTINGS", "PUSH_PROMISE", "PING", "GOAWAY", "WINDOW_UPDATE", "CONTINUATION"};
        f16610c = new String[64];
        String[] strArr = new String[256];
        for (int i = 0; i < 256; i++) {
            String binaryString = Integer.toBinaryString(i);
            P6.g.d(binaryString, "toBinaryString(it)");
            String strReplace = l7.b.i("%8s", binaryString).replace(' ', '0');
            P6.g.d(strReplace, "replace(...)");
            strArr[i] = strReplace;
        }
        f16611d = strArr;
        String[] strArr2 = f16610c;
        strArr2[0] = "";
        strArr2[1] = "END_STREAM";
        int[] iArr = {1};
        strArr2[8] = "PADDED";
        int i5 = iArr[0];
        strArr2[i5 | 8] = I1.a.r(new StringBuilder(), strArr2[i5], "|PADDED");
        strArr2[4] = "END_HEADERS";
        strArr2[32] = "PRIORITY";
        strArr2[36] = "END_HEADERS|PRIORITY";
        int[] iArr2 = {4, 32, 36};
        for (int i8 = 0; i8 < 3; i8++) {
            int i9 = iArr2[i8];
            int i10 = iArr[0];
            String[] strArr3 = f16610c;
            int i11 = i10 | i9;
            strArr3[i11] = strArr3[i10] + '|' + strArr3[i9];
            StringBuilder sb = new StringBuilder();
            sb.append(strArr3[i10]);
            sb.append('|');
            strArr3[i11 | 8] = I1.a.r(sb, strArr3[i9], "|PADDED");
        }
        int length = f16610c.length;
        for (int i12 = 0; i12 < length; i12++) {
            String[] strArr4 = f16610c;
            if (strArr4[i12] == null) {
                strArr4[i12] = f16611d[i12];
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:34:0x0068  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static String a(boolean z8, int i, int i5, int i8, int i9) {
        String strK;
        String str;
        String[] strArr = f16609b;
        String strI = i8 < strArr.length ? strArr[i8] : l7.b.i("0x%02x", Integer.valueOf(i8));
        if (i9 == 0) {
            strK = "";
        } else {
            String[] strArr2 = f16611d;
            if (i8 == 2 || i8 == 3) {
                strK = strArr2[i9];
            } else if (i8 == 4 || i8 == 6) {
                strK = i9 == 1 ? "ACK" : strArr2[i9];
            } else if (i8 != 7 && i8 != 8) {
                String[] strArr3 = f16610c;
                if (i9 < strArr3.length) {
                    str = strArr3[i9];
                    P6.g.b(str);
                } else {
                    str = strArr2[i9];
                }
                strK = (i8 != 5 || (i9 & 4) == 0) ? (i8 != 0 || (i9 & 32) == 0) ? str : X6.n.K(str, "PRIORITY", "COMPRESSED") : X6.n.K(str, "HEADERS", "PUSH_PROMISE");
            }
        }
        return l7.b.i("%s 0x%08x %5d %-13s %s", z8 ? "<<" : ">>", Integer.valueOf(i), Integer.valueOf(i5), strI, strK);
    }
}
