package 㿎.ሽ.㿎;

import java.io.IOException;
import okio.ByteString;
import ඓ.K.K.K.C1293;
import 㿎.ሽ.C2540;

/* renamed from: 㿎.ሽ.㿎.ʬ  reason: contains not printable characters */
/* compiled from: Http2 */
public final class C2590 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public static final String[] f8711 = new String[64];

    /* renamed from: ῲ  reason: contains not printable characters */
    public static final String[] f8712 = {"DATA", "HEADERS", "PRIORITY", "RST_STREAM", "SETTINGS", "PUSH_PROMISE", "PING", "GOAWAY", "WINDOW_UPDATE", "CONTINUATION"};

    /* renamed from: K  reason: contains not printable characters */
    public static final ByteString f8713 = ByteString.encodeUtf8("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n");

    /* renamed from: 㸾  reason: contains not printable characters */
    public static final String[] f8714 = new String[256];

    static {
        int i = 0;
        int i2 = 0;
        while (true) {
            String[] strArr = f8714;
            if (i2 >= strArr.length) {
                break;
            }
            strArr[i2] = C2540.m6642("%8s", Integer.toBinaryString(i2)).replace(' ', '0');
            i2++;
        }
        String[] strArr2 = f8711;
        strArr2[0] = "";
        strArr2[1] = "END_STREAM";
        int[] iArr = {1};
        strArr2[8] = "PADDED";
        for (int i3 : iArr) {
            f8711[i3 | 8] = C1293.m3414(new StringBuilder(), f8711[i3], "|PADDED");
        }
        String[] strArr3 = f8711;
        strArr3[4] = "END_HEADERS";
        strArr3[32] = "PRIORITY";
        strArr3[36] = "END_HEADERS|PRIORITY";
        int[] iArr2 = {4, 32, 36};
        for (int i4 : iArr2) {
            for (int i5 : iArr) {
                int i6 = i5 | i4;
                f8711[i6] = f8711[i5] + '|' + f8711[i4];
                StringBuilder sb = new StringBuilder();
                sb.append(f8711[i5]);
                sb.append('|');
                f8711[i6 | 8] = C1293.m3414(sb, f8711[i4], "|PADDED");
            }
        }
        while (true) {
            String[] strArr4 = f8711;
            if (i < strArr4.length) {
                if (strArr4[i] == null) {
                    strArr4[i] = f8714[i];
                }
                i++;
            } else {
                return;
            }
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static IOException m6801(String str, Object... objArr) throws IOException {
        throw new IOException(C2540.m6642(str, objArr));
    }

    /* renamed from: K  reason: contains not printable characters */
    public static IllegalArgumentException m6802(String str, Object... objArr) {
        throw new IllegalArgumentException(C2540.m6642(str, objArr));
    }

    /* renamed from: K  reason: contains not printable characters */
    public static String m6803(boolean z, int i, int i2, byte b, byte b2) {
        String str;
        String[] strArr = f8712;
        String r0 = b < strArr.length ? strArr[b] : C2540.m6642("0x%02x", Byte.valueOf(b));
        if (b2 == 0) {
            str = "";
        } else {
            if (!(b == 2 || b == 3)) {
                if (b == 4 || b == 6) {
                    str = b2 == 1 ? "ACK" : f8714[b2];
                } else if (!(b == 7 || b == 8)) {
                    String[] strArr2 = f8711;
                    String str2 = b2 < strArr2.length ? strArr2[b2] : f8714[b2];
                    str = (b != 5 || (b2 & 4) == 0) ? (b != 0 || (b2 & 32) == 0) ? str2 : str2.replace("PRIORITY", "COMPRESSED") : str2.replace("HEADERS", "PUSH_PROMISE");
                }
            }
            str = f8714[b2];
        }
        Object[] objArr = new Object[5];
        objArr[0] = z ? "<<" : ">>";
        objArr[1] = Integer.valueOf(i);
        objArr[2] = Integer.valueOf(i2);
        objArr[3] = r0;
        objArr[4] = str;
        return C2540.m6642("%s 0x%08x %5d %-13s %s", objArr);
    }
}
