package n5; import com.google.android.gms.ads.RequestConfiguration; import java.io.IOException; /* loaded from: classes2.dex */ public abstract class d { /* renamed from: a, reason: collision with root package name */ static final h5.g f11995a = h5.g.h("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"); /* renamed from: b, reason: collision with root package name */ private static final String[] f11996b = {"DATA", "HEADERS", "PRIORITY", "RST_STREAM", "SETTINGS", "PUSH_PROMISE", "PING", "GOAWAY", "WINDOW_UPDATE", "CONTINUATION"}; /* renamed from: c, reason: collision with root package name */ static final String[] f11997c = new String[64]; /* renamed from: d, reason: collision with root package name */ static final String[] f11998d = new String[256]; static { int i10 = 0; int i11 = 0; while (true) { String[] strArr = f11998d; if (i11 >= strArr.length) { break; } strArr[i11] = i5.c.r("%8s", Integer.toBinaryString(i11)).replace(' ', '0'); i11++; } String[] strArr2 = f11997c; strArr2[0] = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; strArr2[1] = "END_STREAM"; int[] iArr = {1}; strArr2[8] = "PADDED"; int i12 = iArr[0]; strArr2[i12 | 8] = strArr2[i12] + "|PADDED"; strArr2[4] = "END_HEADERS"; strArr2[32] = "PRIORITY"; strArr2[36] = "END_HEADERS|PRIORITY"; int[] iArr2 = {4, 32, 36}; for (int i13 = 0; i13 < 3; i13++) { int i14 = iArr2[i13]; int i15 = iArr[0]; String[] strArr3 = f11997c; int i16 = i15 | i14; strArr3[i16] = strArr3[i15] + '|' + strArr3[i14]; strArr3[i16 | 8] = strArr3[i15] + '|' + strArr3[i14] + "|PADDED"; } while (true) { String[] strArr4 = f11997c; if (i10 >= strArr4.length) { return; } if (strArr4[i10] == null) { strArr4[i10] = f11998d[i10]; } i10++; } } static IllegalArgumentException a(String str, Object... objArr) { throw new IllegalArgumentException(i5.c.r(str, objArr)); } static String b(byte b10, byte b11) { if (b11 == 0) { return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } if (b10 != 2 && b10 != 3) { if (b10 == 4 || b10 == 6) { return b11 == 1 ? "ACK" : f11998d[b11]; } if (b10 != 7 && b10 != 8) { String[] strArr = f11997c; String str = b11 < strArr.length ? strArr[b11] : f11998d[b11]; return (b10 != 5 || (b11 & 4) == 0) ? (b10 != 0 || (b11 & 32) == 0) ? str : str.replace("PRIORITY", "COMPRESSED") : str.replace("HEADERS", "PUSH_PROMISE"); } } return f11998d[b11]; } static String c(boolean z10, int i10, int i11, byte b10, byte b11) { String[] strArr = f11996b; String r10 = b10 < strArr.length ? strArr[b10] : i5.c.r("0x%02x", Byte.valueOf(b10)); String b12 = b(b10, b11); Object[] objArr = new Object[5]; objArr[0] = z10 ? "<<" : ">>"; objArr[1] = Integer.valueOf(i10); objArr[2] = Integer.valueOf(i11); objArr[3] = r10; objArr[4] = b12; return i5.c.r("%s 0x%08x %5d %-13s %s", objArr); } static IOException d(String str, Object... objArr) { throw new IOException(i5.c.r(str, objArr)); } }