package com.fyber.inneractive.sdk.protobuf; import androidx.work.WorkInfo; import com.applovin.exoplayer2.common.base.Ascii; import com.fyber.inneractive.sdk.protobuf.GeneratedMessageLite; import com.fyber.inneractive.sdk.protobuf.i; import com.fyber.inneractive.sdk.protobuf.o0; import com.fyber.inneractive.sdk.protobuf.p1; import com.fyber.inneractive.sdk.protobuf.q1; import com.fyber.inneractive.sdk.protobuf.z; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import kotlin.jvm.internal.ByteCompanionObject; /* loaded from: classes2.dex */ public abstract class j { public int a; public final int b; public final int c; public k d; public static final class a extends j { public final byte[] e; public int f; public int g; public int h; public final int i; public int j; public int k; public a(byte[] bArr, int i, int i2, boolean z) { super(0); this.k = Integer.MAX_VALUE; this.e = bArr; this.f = i2 + i; this.h = i; this.i = i; } @Override // com.fyber.inneractive.sdk.protobuf.j public final int b() { return this.h - this.i; } @Override // com.fyber.inneractive.sdk.protobuf.j public final void c(int i) { this.k = i; int i2 = this.f + this.g; this.f = i2; int i3 = i2 - this.i; if (i3 <= i) { this.g = 0; return; } int i4 = i3 - i; this.g = i4; this.f = i2 - i4; } @Override // com.fyber.inneractive.sdk.protobuf.j public final boolean c() throws IOException { return this.h == this.f; } @Override // com.fyber.inneractive.sdk.protobuf.j public final boolean d() throws IOException { return y() != 0; } @Override // com.fyber.inneractive.sdk.protobuf.j public final boolean e(int i) throws IOException { int t; int i2 = r1.a; int i3 = i & 7; int i4 = 0; if (i3 == 0) { if (this.f - this.h >= 10) { while (i4 < 10) { byte[] bArr = this.e; int i5 = this.h; this.h = i5 + 1; if (bArr[i5] < 0) { i4++; } } throw z.e(); } while (i4 < 10) { int i6 = this.h; if (i6 == this.f) { throw z.i(); } byte[] bArr2 = this.e; this.h = i6 + 1; if (bArr2[i6] < 0) { i4++; } } throw z.e(); return true; } if (i3 == 1) { int i7 = this.f; int i8 = this.h; if (8 > i7 - i8) { throw z.i(); } this.h = i8 + 8; return true; } if (i3 == 2) { int m = m(); if (m >= 0) { int i9 = this.f; int i10 = this.h; if (m <= i9 - i10) { this.h = i10 + m; return true; } } if (m < 0) { throw z.f(); } throw z.i(); } if (i3 == 3) { do { t = t(); if (t == 0) { break; } } while (e(t)); a(r1.a(i >>> 3, 4)); return true; } if (i3 == 4) { return false; } if (i3 != 5) { int i11 = z.a; throw new z.a(); } int i12 = this.f; int i13 = this.h; if (4 > i12 - i13) { throw z.i(); } this.h = i13 + 4; return true; } @Override // com.fyber.inneractive.sdk.protobuf.j public final double f() throws IOException { return Double.longBitsToDouble(x()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int g() throws IOException { return m(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int h() throws IOException { return w(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long i() throws IOException { return x(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final float j() throws IOException { return Float.intBitsToFloat(w()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int k() throws IOException { return m(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long l() throws IOException { return y(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int n() throws IOException { return w(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long o() throws IOException { return x(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int p() throws IOException { return j.b(m()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long q() throws IOException { return j.a(y()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final String r() throws IOException { int m = m(); if (m > 0) { int i = this.f; int i2 = this.h; if (m <= i - i2) { String str = new String(this.e, i2, m, y.a); this.h += m; return str; } } if (m == 0) { return ""; } if (m < 0) { throw z.f(); } throw z.i(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final String s() throws IOException { int m = m(); if (m > 0) { int i = this.f; int i2 = this.h; if (m <= i - i2) { String a = q1.a.a(this.e, i2, m); this.h += m; return a; } } if (m == 0) { return ""; } if (m <= 0) { throw z.f(); } throw z.i(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int t() throws IOException { if (c()) { this.j = 0; return 0; } int m = m(); this.j = m; int i = r1.a; if ((m >>> 3) != 0) { return m; } throw z.b(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int u() throws IOException { return m(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long v() throws IOException { return y(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final void a(int i) throws z { if (this.j != i) { throw z.a(); } } @Override // com.fyber.inneractive.sdk.protobuf.j public final int d(int i) throws z { if (i < 0) { throw z.f(); } int b = b() + i; int i2 = this.k; if (b > i2) { throw z.i(); } this.k = b; int i3 = this.f + this.g; this.f = i3; int i4 = i3 - this.i; if (i4 > b) { int i5 = i4 - b; this.g = i5; this.f = i3 - i5; } else { this.g = 0; } return i2; } @Override // com.fyber.inneractive.sdk.protobuf.j public final void a(int i, o0.a aVar, q qVar) throws IOException { int i2 = this.a; if (i2 < this.b) { this.a = i2 + 1; ((GeneratedMessageLite.b) aVar).a(this, qVar); a(r1.a(i, 4)); this.a--; return; } throw z.h(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int m() throws IOException { int i; int i2 = this.h; int i3 = this.f; if (i3 != i2) { byte[] bArr = this.e; int i4 = i2 + 1; byte b = bArr[i2]; if (b >= 0) { this.h = i4; return b; } if (i3 - i4 >= 9) { int i5 = i2 + 2; int i6 = (bArr[i4] << 7) ^ b; if (i6 < 0) { i = i6 ^ WorkInfo.STOP_REASON_FOREGROUND_SERVICE_TIMEOUT; } else { int i7 = i2 + 3; int i8 = (bArr[i5] << Ascii.SO) ^ i6; if (i8 >= 0) { i = i8 ^ 16256; } else { int i9 = i2 + 4; int i10 = i8 ^ (bArr[i7] << Ascii.NAK); if (i10 < 0) { i = (-2080896) ^ i10; } else { i7 = i2 + 5; byte b2 = bArr[i9]; int i11 = (i10 ^ (b2 << Ascii.FS)) ^ 266354560; if (b2 < 0) { i9 = i2 + 6; if (bArr[i7] < 0) { i7 = i2 + 7; if (bArr[i9] < 0) { i9 = i2 + 8; if (bArr[i7] < 0) { i7 = i2 + 9; if (bArr[i9] < 0) { int i12 = i2 + 10; if (bArr[i7] >= 0) { i5 = i12; i = i11; } } } } } i = i11; } i = i11; } i5 = i9; } i5 = i7; } this.h = i5; return i; } } long j = 0; for (int i13 = 0; i13 < 64; i13 += 7) { int i14 = this.h; if (i14 == this.f) { throw z.i(); } byte[] bArr2 = this.e; this.h = i14 + 1; j |= (r3 & Byte.MAX_VALUE) << i13; if ((bArr2[i14] & ByteCompanionObject.MIN_VALUE) == 0) { return (int) j; } } throw z.e(); } public final int w() throws IOException { int i = this.h; if (this.f - i >= 4) { byte[] bArr = this.e; this.h = i + 4; return ((bArr[i + 3] & 255) << 24) | (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8) | ((bArr[i + 2] & 255) << 16); } throw z.i(); } public final long x() throws IOException { int i = this.h; if (this.f - i >= 8) { byte[] bArr = this.e; this.h = i + 8; return ((bArr[i + 7] & 255) << 56) | (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8) | ((bArr[i + 2] & 255) << 16) | ((bArr[i + 3] & 255) << 24) | ((bArr[i + 4] & 255) << 32) | ((bArr[i + 5] & 255) << 40) | ((bArr[i + 6] & 255) << 48); } throw z.i(); } public final long y() throws IOException { long j; long j2; long j3; int i = this.h; int i2 = this.f; long j4 = 0; if (i2 != i) { byte[] bArr = this.e; int i3 = i + 1; byte b = bArr[i]; if (b >= 0) { this.h = i3; return b; } if (i2 - i3 >= 9) { int i4 = i + 2; int i5 = (bArr[i3] << 7) ^ b; if (i5 < 0) { j = i5 ^ WorkInfo.STOP_REASON_FOREGROUND_SERVICE_TIMEOUT; } else { int i6 = i + 3; int i7 = (bArr[i4] << Ascii.SO) ^ i5; if (i7 >= 0) { j = i7 ^ 16256; i4 = i6; } else { int i8 = i + 4; int i9 = i7 ^ (bArr[i6] << Ascii.NAK); if (i9 < 0) { j = (-2080896) ^ i9; i4 = i8; } else { long j5 = i9; i4 = i + 5; long j6 = j5 ^ (bArr[i8] << 28); if (j6 >= 0) { j3 = 266354560; } else { int i10 = i + 6; long j7 = j6 ^ (bArr[i4] << 35); if (j7 < 0) { j2 = -34093383808L; } else { i4 = i + 7; j6 = j7 ^ (bArr[i10] << 42); if (j6 >= 0) { j3 = 4363953127296L; } else { i10 = i + 8; j7 = j6 ^ (bArr[i4] << 49); if (j7 < 0) { j2 = -558586000294016L; } else { i4 = i + 9; long j8 = (j7 ^ (bArr[i10] << 56)) ^ 71499008037633920L; if (j8 < 0) { int i11 = i + 10; if (bArr[i4] >= 0) { i4 = i11; } } j = j8; } } } j = j7 ^ j2; i4 = i10; } j = j3 ^ j6; } } } this.h = i4; return j; } } for (int i12 = 0; i12 < 64; i12 += 7) { int i13 = this.h; if (i13 == this.f) { throw z.i(); } byte[] bArr2 = this.e; this.h = i13 + 1; j4 |= (r1 & Byte.MAX_VALUE) << i12; if ((bArr2[i13] & ByteCompanionObject.MIN_VALUE) == 0) { return j4; } } throw z.e(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final void a(o0.a aVar, q qVar) throws IOException { int m = m(); if (this.a < this.b) { int d = d(m); this.a++; ((GeneratedMessageLite.b) aVar).a(this, qVar); a(0); this.a--; this.k = d; int i = this.f + this.g; this.f = i; int i2 = i - this.i; if (i2 <= d) { this.g = 0; return; } int i3 = i2 - d; this.g = i3; this.f = i - i3; return; } throw z.h(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int a() { int i = this.k; if (i == Integer.MAX_VALUE) { return -1; } return i - b(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final i.h e() throws IOException { byte[] bArr; int m = m(); if (m > 0) { int i = this.f; int i2 = this.h; if (m <= i - i2) { i.h a = i.a(this.e, i2, m); this.h += m; return a; } } if (m == 0) { return i.b; } if (m > 0) { int i3 = this.f; int i4 = this.h; if (m <= i3 - i4) { int i5 = m + i4; this.h = i5; bArr = Arrays.copyOfRange(this.e, i4, i5); i.h hVar = i.b; return new i.h(bArr); } } if (m > 0) { throw z.i(); } if (m == 0) { bArr = y.b; i.h hVar2 = i.b; return new i.h(bArr); } throw z.f(); } } public static final class b extends j { public final InputStream e; public final byte[] f; public int g; public int h; public int i; public int j; public int k; public int l; public b(InputStream inputStream) { super(0); this.l = Integer.MAX_VALUE; y.a(inputStream, "input"); this.e = inputStream; this.f = new byte[4096]; this.g = 0; this.i = 0; this.k = 0; } @Override // com.fyber.inneractive.sdk.protobuf.j public final int a() { int i = this.l; if (i == Integer.MAX_VALUE) { return -1; } return i - (this.k + this.i); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int b() { return this.k + this.i; } @Override // com.fyber.inneractive.sdk.protobuf.j public final boolean d() throws IOException { return y() != 0; } @Override // com.fyber.inneractive.sdk.protobuf.j public final boolean e(int i) throws IOException { int t; int i2 = r1.a; int i3 = i & 7; int i4 = 0; if (i3 == 0) { if (this.g - this.i >= 10) { while (i4 < 10) { byte[] bArr = this.f; int i5 = this.i; this.i = i5 + 1; if (bArr[i5] < 0) { i4++; } } throw z.e(); } while (i4 < 10) { if (this.i == this.g) { h(1); } byte[] bArr2 = this.f; int i6 = this.i; this.i = i6 + 1; if (bArr2[i6] < 0) { i4++; } } throw z.e(); return true; } if (i3 == 1) { i(8); return true; } if (i3 == 2) { i(m()); return true; } if (i3 == 3) { do { t = t(); if (t == 0) { break; } } while (e(t)); a(r1.a(i >>> 3, 4)); return true; } if (i3 == 4) { return false; } if (i3 == 5) { i(4); return true; } int i7 = z.a; throw new z.a(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final double f() throws IOException { return Double.longBitsToDouble(x()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int g() throws IOException { return m(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int h() throws IOException { return w(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long i() throws IOException { return x(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final float j() throws IOException { return Float.intBitsToFloat(w()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int k() throws IOException { return m(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long l() throws IOException { return y(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int n() throws IOException { return w(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long o() throws IOException { return x(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int p() throws IOException { return j.b(m()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long q() throws IOException { return j.a(y()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final String r() throws IOException { int m = m(); if (m > 0) { int i = this.g; int i2 = this.i; if (m <= i - i2) { String str = new String(this.f, i2, m, y.a); this.i += m; return str; } } if (m == 0) { return ""; } if (m > this.g) { return new String(f(m), y.a); } h(m); String str2 = new String(this.f, this.i, m, y.a); this.i += m; return str2; } @Override // com.fyber.inneractive.sdk.protobuf.j public final String s() throws IOException { byte[] f; int m = m(); int i = this.i; int i2 = this.g; if (m <= i2 - i && m > 0) { f = this.f; this.i = i + m; } else { if (m == 0) { return ""; } i = 0; if (m <= i2) { h(m); f = this.f; this.i = m; } else { f = f(m); } } return q1.a.a(f, i, m); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int t() throws IOException { if (c()) { this.j = 0; return 0; } int m = m(); this.j = m; int i = r1.a; if ((m >>> 3) != 0) { return m; } throw z.b(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int u() throws IOException { return m(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long v() throws IOException { return y(); } public final void z() { int i = this.g + this.h; this.g = i; int i2 = this.k + i; int i3 = this.l; if (i2 <= i3) { this.h = 0; return; } int i4 = i2 - i3; this.h = i4; this.g = i - i4; } @Override // com.fyber.inneractive.sdk.protobuf.j public final void a(int i) throws z { if (this.j != i) { throw z.a(); } } @Override // com.fyber.inneractive.sdk.protobuf.j public final void c(int i) { this.l = i; z(); } public final byte[] f(int i) throws IOException { byte[] g = g(i); if (g != null) { return g; } int i2 = this.i; int i3 = this.g; int i4 = i3 - i2; this.k += i3; this.i = 0; this.g = 0; int i5 = i - i4; ArrayList arrayList = new ArrayList(); while (i5 > 0) { int min = Math.min(i5, 4096); byte[] bArr = new byte[min]; int i6 = 0; while (i6 < min) { int read = this.e.read(bArr, i6, min - i6); if (read == -1) { throw z.i(); } this.k += read; i6 += read; } i5 -= min; arrayList.add(bArr); } byte[] bArr2 = new byte[i]; System.arraycopy(this.f, i2, bArr2, 0, i4); Iterator it = arrayList.iterator(); while (it.hasNext()) { byte[] bArr3 = (byte[]) it.next(); System.arraycopy(bArr3, 0, bArr2, i4, bArr3.length); i4 += bArr3.length; } return bArr2; } public final byte[] g(int i) throws IOException { if (i == 0) { return y.b; } if (i < 0) { throw z.f(); } int i2 = this.k; int i3 = this.i; int i4 = i2 + i3 + i; if (i4 - this.c > 0) { throw new z("Protocol message was too large. May be malicious. Use CodedInputStream.setSizeLimit() to increase the size limit."); } int i5 = this.l; if (i4 > i5) { i((i5 - i2) - i3); throw z.i(); } int i6 = this.g - i3; int i7 = i - i6; if (i7 >= 4096 && i7 > this.e.available()) { return null; } byte[] bArr = new byte[i]; System.arraycopy(this.f, this.i, bArr, 0, i6); this.k += this.g; this.i = 0; this.g = 0; while (i6 < i) { int read = this.e.read(bArr, i6, i - i6); if (read == -1) { throw z.i(); } this.k += read; i6 += read; } return bArr; } public final void h(int i) throws IOException { if (j(i)) { return; } if (i <= (this.c - this.k) - this.i) { throw z.i(); } throw new z("Protocol message was too large. May be malicious. Use CodedInputStream.setSizeLimit() to increase the size limit."); } @Override // com.fyber.inneractive.sdk.protobuf.j public final boolean c() throws IOException { return this.i == this.g && !j(1); } public final int w() throws IOException { int i = this.i; if (this.g - i < 4) { h(4); i = this.i; } byte[] bArr = this.f; this.i = i + 4; return ((bArr[i + 3] & 255) << 24) | (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8) | ((bArr[i + 2] & 255) << 16); } public final long x() throws IOException { int i = this.i; if (this.g - i < 8) { h(8); i = this.i; } byte[] bArr = this.f; this.i = i + 8; return ((bArr[i + 7] & 255) << 56) | (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8) | ((bArr[i + 2] & 255) << 16) | ((bArr[i + 3] & 255) << 24) | ((bArr[i + 4] & 255) << 32) | ((bArr[i + 5] & 255) << 40) | ((bArr[i + 6] & 255) << 48); } @Override // com.fyber.inneractive.sdk.protobuf.j public final void a(int i, o0.a aVar, q qVar) throws IOException { int i2 = this.a; if (i2 < this.b) { this.a = i2 + 1; ((GeneratedMessageLite.b) aVar).a(this, qVar); a(r1.a(i, 4)); this.a--; return; } throw z.h(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int d(int i) throws z { if (i < 0) { throw z.f(); } int i2 = this.k + this.i + i; int i3 = this.l; if (i2 <= i3) { this.l = i2; z(); return i3; } throw z.i(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int m() throws IOException { int i; int i2 = this.i; int i3 = this.g; if (i3 != i2) { byte[] bArr = this.f; int i4 = i2 + 1; byte b = bArr[i2]; if (b >= 0) { this.i = i4; return b; } if (i3 - i4 >= 9) { int i5 = i2 + 2; int i6 = (bArr[i4] << 7) ^ b; if (i6 < 0) { i = i6 ^ WorkInfo.STOP_REASON_FOREGROUND_SERVICE_TIMEOUT; } else { int i7 = i2 + 3; int i8 = (bArr[i5] << Ascii.SO) ^ i6; if (i8 >= 0) { i = i8 ^ 16256; } else { int i9 = i2 + 4; int i10 = i8 ^ (bArr[i7] << Ascii.NAK); if (i10 < 0) { i = (-2080896) ^ i10; } else { i7 = i2 + 5; byte b2 = bArr[i9]; int i11 = (i10 ^ (b2 << Ascii.FS)) ^ 266354560; if (b2 < 0) { i9 = i2 + 6; if (bArr[i7] < 0) { i7 = i2 + 7; if (bArr[i9] < 0) { i9 = i2 + 8; if (bArr[i7] < 0) { i7 = i2 + 9; if (bArr[i9] < 0) { int i12 = i2 + 10; if (bArr[i7] >= 0) { i5 = i12; i = i11; } } } } } i = i11; } i = i11; } i5 = i9; } i5 = i7; } this.i = i5; return i; } } long j = 0; for (int i13 = 0; i13 < 64; i13 += 7) { if (this.i == this.g) { h(1); } byte[] bArr2 = this.f; int i14 = this.i; this.i = i14 + 1; j |= (r3 & Byte.MAX_VALUE) << i13; if ((bArr2[i14] & ByteCompanionObject.MIN_VALUE) == 0) { return (int) j; } } throw z.e(); } public final long y() throws IOException { long j; long j2; long j3; int i = this.i; int i2 = this.g; long j4 = 0; if (i2 != i) { byte[] bArr = this.f; int i3 = i + 1; byte b = bArr[i]; if (b >= 0) { this.i = i3; return b; } if (i2 - i3 >= 9) { int i4 = i + 2; int i5 = (bArr[i3] << 7) ^ b; if (i5 < 0) { j = i5 ^ WorkInfo.STOP_REASON_FOREGROUND_SERVICE_TIMEOUT; } else { int i6 = i + 3; int i7 = (bArr[i4] << Ascii.SO) ^ i5; if (i7 >= 0) { j = i7 ^ 16256; i4 = i6; } else { int i8 = i + 4; int i9 = i7 ^ (bArr[i6] << Ascii.NAK); if (i9 < 0) { j = (-2080896) ^ i9; i4 = i8; } else { long j5 = i9; i4 = i + 5; long j6 = j5 ^ (bArr[i8] << 28); if (j6 >= 0) { j3 = 266354560; } else { int i10 = i + 6; long j7 = j6 ^ (bArr[i4] << 35); if (j7 < 0) { j2 = -34093383808L; } else { i4 = i + 7; j6 = j7 ^ (bArr[i10] << 42); if (j6 >= 0) { j3 = 4363953127296L; } else { i10 = i + 8; j7 = j6 ^ (bArr[i4] << 49); if (j7 < 0) { j2 = -558586000294016L; } else { i4 = i + 9; long j8 = (j7 ^ (bArr[i10] << 56)) ^ 71499008037633920L; if (j8 < 0) { int i11 = i + 10; if (bArr[i4] >= 0) { i4 = i11; } } j = j8; } } } j = j7 ^ j2; i4 = i10; } j = j3 ^ j6; } } } this.i = i4; return j; } } for (int i12 = 0; i12 < 64; i12 += 7) { if (this.i == this.g) { h(1); } byte[] bArr2 = this.f; int i13 = this.i; this.i = i13 + 1; j4 |= (r1 & Byte.MAX_VALUE) << i12; if ((bArr2[i13] & ByteCompanionObject.MIN_VALUE) == 0) { return j4; } } throw z.e(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final void a(o0.a aVar, q qVar) throws IOException { int m = m(); if (this.a < this.b) { int d = d(m); this.a++; ((GeneratedMessageLite.b) aVar).a(this, qVar); a(0); this.a--; this.l = d; z(); return; } throw z.h(); } public final void i(int i) throws IOException { int i2 = this.g; int i3 = this.i; int i4 = i2 - i3; if (i <= i4 && i >= 0) { this.i = i3 + i; return; } if (i < 0) { throw z.f(); } int i5 = this.k; int i6 = i5 + i3; int i7 = i6 + i; int i8 = this.l; if (i7 > i8) { i((i8 - i5) - i3); throw z.i(); } this.k = i6; this.g = 0; this.i = 0; while (i4 < i) { try { long j = i - i4; long skip = this.e.skip(j); if (skip < 0 || skip > j) { throw new IllegalStateException(this.e.getClass() + "#skip returned invalid result: " + skip + "\nThe InputStream implementation is buggy."); } if (skip == 0) { break; } else { i4 += (int) skip; } } finally { this.k += i4; z(); } } if (i4 >= i) { return; } int i9 = this.g; int i10 = i9 - this.i; this.i = i9; h(1); while (true) { int i11 = i - i10; int i12 = this.g; if (i11 <= i12) { this.i = i11; return; } else { i10 += i12; this.i = i12; h(1); } } } public final boolean j(int i) throws IOException { int i2 = this.i; int i3 = i2 + i; int i4 = this.g; if (i3 <= i4) { throw new IllegalStateException("refillBuffer() called when " + i + " bytes were already available in buffer"); } int i5 = this.c; int i6 = this.k; if (i > (i5 - i6) - i2 || i6 + i2 + i > this.l) { return false; } if (i2 > 0) { if (i4 > i2) { byte[] bArr = this.f; System.arraycopy(bArr, i2, bArr, 0, i4 - i2); } this.k += i2; this.g -= i2; this.i = 0; } InputStream inputStream = this.e; byte[] bArr2 = this.f; int i7 = this.g; int read = inputStream.read(bArr2, i7, Math.min(bArr2.length - i7, (this.c - this.k) - i7)); if (read == 0 || read < -1 || read > this.f.length) { throw new IllegalStateException(this.e.getClass() + "#read(byte[]) returned invalid result: " + read + "\nThe InputStream implementation is buggy."); } if (read <= 0) { return false; } this.g += read; z(); if (this.g >= i) { return true; } return j(i); } @Override // com.fyber.inneractive.sdk.protobuf.j public final i.h e() throws IOException { int m = m(); int i = this.g; int i2 = this.i; if (m <= i - i2 && m > 0) { i.h a = i.a(this.f, i2, m); this.i += m; return a; } if (m == 0) { return i.b; } byte[] g = g(m); if (g != null) { return i.a(g, 0, g.length); } int i3 = this.i; int i4 = this.g; int i5 = i4 - i3; this.k += i4; this.i = 0; this.g = 0; int i6 = m - i5; ArrayList arrayList = new ArrayList(); while (i6 > 0) { int min = Math.min(i6, 4096); byte[] bArr = new byte[min]; int i7 = 0; while (i7 < min) { int read = this.e.read(bArr, i7, min - i7); if (read == -1) { throw z.i(); } this.k += read; i7 += read; } i6 -= min; arrayList.add(bArr); } byte[] bArr2 = new byte[m]; System.arraycopy(this.f, i3, bArr2, 0, i5); Iterator it = arrayList.iterator(); while (it.hasNext()) { byte[] bArr3 = (byte[]) it.next(); System.arraycopy(bArr3, 0, bArr2, i5, bArr3.length); i5 += bArr3.length; } i.h hVar = i.b; return new i.h(bArr2); } } public static final class c extends j { public final ByteBuffer e; public final long f; public long g; public long h; public final long i; public int j; public int k; public int l; public c(ByteBuffer byteBuffer, boolean z) { super(0); this.l = Integer.MAX_VALUE; this.e = byteBuffer; long a = p1.a(byteBuffer); this.f = a; this.g = byteBuffer.limit() + a; long position = a + byteBuffer.position(); this.h = position; this.i = position; } @Override // com.fyber.inneractive.sdk.protobuf.j public final int b() { return (int) (this.h - this.i); } @Override // com.fyber.inneractive.sdk.protobuf.j public final boolean c() throws IOException { return this.h == this.g; } @Override // com.fyber.inneractive.sdk.protobuf.j public final boolean d() throws IOException { return y() != 0; } @Override // com.fyber.inneractive.sdk.protobuf.j public final boolean e(int i) throws IOException { int t; int i2 = r1.a; int i3 = i & 7; int i4 = 0; if (i3 == 0) { if (((int) (this.g - this.h)) >= 10) { while (i4 < 10) { long j = this.h; this.h = j + 1; if (p1.c.a(j) < 0) { i4++; } } throw z.e(); } while (i4 < 10) { long j2 = this.h; if (j2 == this.g) { throw z.i(); } this.h = j2 + 1; if (p1.c.a(j2) < 0) { i4++; } } throw z.e(); return true; } if (i3 == 1) { long j3 = this.g; long j4 = this.h; if (8 > ((int) (j3 - j4))) { throw z.i(); } this.h = j4 + 8; return true; } if (i3 == 2) { int m = m(); if (m >= 0) { long j5 = this.g; long j6 = this.h; if (m <= ((int) (j5 - j6))) { this.h = j6 + m; return true; } } if (m < 0) { throw z.f(); } throw z.i(); } if (i3 == 3) { do { t = t(); if (t == 0) { break; } } while (e(t)); a(r1.a(i >>> 3, 4)); return true; } if (i3 == 4) { return false; } if (i3 != 5) { int i5 = z.a; throw new z.a(); } long j7 = this.g; long j8 = this.h; if (4 > ((int) (j7 - j8))) { throw z.i(); } this.h = j8 + 4; return true; } @Override // com.fyber.inneractive.sdk.protobuf.j public final double f() throws IOException { return Double.longBitsToDouble(x()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int g() throws IOException { return m(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int h() throws IOException { return w(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long i() throws IOException { return x(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final float j() throws IOException { return Float.intBitsToFloat(w()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int k() throws IOException { return m(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long l() throws IOException { return y(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int n() throws IOException { return w(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long o() throws IOException { return x(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int p() throws IOException { return j.b(m()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long q() throws IOException { return j.a(y()); } @Override // com.fyber.inneractive.sdk.protobuf.j public final String r() throws IOException { int m = m(); if (m > 0) { long j = this.g; long j2 = this.h; if (m <= ((int) (j - j2))) { byte[] bArr = new byte[m]; long j3 = m; p1.c.a(j2, bArr, j3); String str = new String(bArr, y.a); this.h += j3; return str; } } if (m == 0) { return ""; } if (m < 0) { throw z.f(); } throw z.i(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final String s() throws IOException { int m = m(); if (m > 0) { long j = this.g; long j2 = this.h; if (m <= ((int) (j - j2))) { int i = (int) (j2 - this.f); ByteBuffer byteBuffer = this.e; q1.b bVar = q1.a; bVar.getClass(); String a = byteBuffer.hasArray() ? bVar.a(byteBuffer.array(), byteBuffer.arrayOffset() + i, m) : byteBuffer.isDirect() ? bVar.b(byteBuffer, i, m) : q1.b.a(byteBuffer, i, m); this.h += m; return a; } } if (m == 0) { return ""; } if (m <= 0) { throw z.f(); } throw z.i(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int t() throws IOException { if (c()) { this.k = 0; return 0; } int m = m(); this.k = m; int i = r1.a; if ((m >>> 3) != 0) { return m; } throw z.b(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int u() throws IOException { return m(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final long v() throws IOException { return y(); } public final void z() { long j = this.g + this.j; this.g = j; int i = (int) (j - this.i); int i2 = this.l; if (i <= i2) { this.j = 0; return; } int i3 = i - i2; this.j = i3; this.g = j - i3; } @Override // com.fyber.inneractive.sdk.protobuf.j public final void a(int i) throws z { if (this.k != i) { throw z.a(); } } @Override // com.fyber.inneractive.sdk.protobuf.j public final void c(int i) { this.l = i; z(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int d(int i) throws z { if (i < 0) { throw z.f(); } int b = b() + i; int i2 = this.l; if (b > i2) { throw z.i(); } this.l = b; z(); return i2; } /* JADX WARN: Code restructure failed: missing block: B:33:0x0091, code lost: if (r2.a(r6) < 0) goto L34; */ @Override // com.fyber.inneractive.sdk.protobuf.j /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final int m() throws java.io.IOException { /* Method dump skipped, instructions count: 204 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.protobuf.j.c.m():int"); } public final long y() throws IOException { long j; long j2; int i; long j3 = this.h; long j4 = 0; if (this.g != j3) { long j5 = j3 + 1; p1.d dVar = p1.c; byte a = dVar.a(j3); if (a >= 0) { this.h = j5; return a; } if (this.g - j5 >= 9) { long j6 = 2 + j3; int a2 = (dVar.a(j5) << 7) ^ a; if (a2 >= 0) { long j7 = 3 + j3; int a3 = a2 ^ (dVar.a(j6) << Ascii.SO); if (a3 >= 0) { j = a3 ^ 16256; j6 = j7; } else { j6 = 4 + j3; int a4 = a3 ^ (dVar.a(j7) << Ascii.NAK); if (a4 < 0) { i = (-2080896) ^ a4; } else { long j8 = j3 + 5; long a5 = a4 ^ (dVar.a(j6) << 28); if (a5 >= 0) { j = 266354560 ^ a5; j6 = j8; } else { j6 = j3 + 6; long a6 = (dVar.a(j8) << 35) ^ a5; if (a6 < 0) { j2 = -34093383808L; } else { long j9 = 7 + j3; long a7 = a6 ^ (dVar.a(j6) << 42); if (a7 >= 0) { j = 4363953127296L ^ a7; } else { j6 = j3 + 8; a6 = a7 ^ (dVar.a(j9) << 49); if (a6 < 0) { j2 = -558586000294016L; } else { j9 = j3 + 9; long a8 = (a6 ^ (dVar.a(j6) << 56)) ^ 71499008037633920L; if (a8 < 0) { j6 = j3 + 10; if (dVar.a(j9) >= 0) { j = a8; } } else { j = a8; } } } j6 = j9; } j = j2 ^ a6; } } } this.h = j6; return j; } i = a2 ^ WorkInfo.STOP_REASON_FOREGROUND_SERVICE_TIMEOUT; j = i; this.h = j6; return j; } } for (int i2 = 0; i2 < 64; i2 += 7) { long j10 = this.h; if (j10 == this.g) { throw z.i(); } this.h = j10 + 1; j4 |= (r2 & Byte.MAX_VALUE) << i2; if ((p1.c.a(j10) & ByteCompanionObject.MIN_VALUE) == 0) { return j4; } } throw z.e(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final void a(int i, o0.a aVar, q qVar) throws IOException { int i2 = this.a; if (i2 < this.b) { this.a = i2 + 1; ((GeneratedMessageLite.b) aVar).a(this, qVar); a(r1.a(i, 4)); this.a--; return; } throw z.h(); } public final int w() throws IOException { long j = this.h; if (this.g - j >= 4) { this.h = 4 + j; p1.d dVar = p1.c; return ((dVar.a(j + 3) & 255) << 24) | (dVar.a(j) & 255) | ((dVar.a(1 + j) & 255) << 8) | ((dVar.a(2 + j) & 255) << 16); } throw z.i(); } public final long x() throws IOException { long j = this.h; if (this.g - j >= 8) { this.h = 8 + j; p1.d dVar = p1.c; return ((dVar.a(j + 7) & 255) << 56) | (dVar.a(j) & 255) | ((dVar.a(1 + j) & 255) << 8) | ((dVar.a(2 + j) & 255) << 16) | ((dVar.a(3 + j) & 255) << 24) | ((dVar.a(4 + j) & 255) << 32) | ((dVar.a(5 + j) & 255) << 40) | ((dVar.a(6 + j) & 255) << 48); } throw z.i(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final void a(o0.a aVar, q qVar) throws IOException { int m = m(); if (this.a < this.b) { int d = d(m); this.a++; ((GeneratedMessageLite.b) aVar).a(this, qVar); a(0); this.a--; this.l = d; z(); return; } throw z.h(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final int a() { int i = this.l; if (i == Integer.MAX_VALUE) { return -1; } return i - b(); } @Override // com.fyber.inneractive.sdk.protobuf.j public final i.h e() throws IOException { int m = m(); if (m > 0) { long j = this.g; long j2 = this.h; if (m <= ((int) (j - j2))) { byte[] bArr = new byte[m]; long j3 = m; p1.c.a(j2, bArr, j3); this.h += j3; i.h hVar = i.b; return new i.h(bArr); } } if (m == 0) { return i.b; } if (m < 0) { throw z.f(); } throw z.i(); } } public /* synthetic */ j(int i) { this(); } public static long a(long j) { return (-(j & 1)) ^ (j >>> 1); } public static int b(int i) { return (-(i & 1)) ^ (i >>> 1); } public abstract int a(); public abstract void a(int i) throws z; public abstract void a(int i, o0.a aVar, q qVar) throws IOException; public abstract void a(o0.a aVar, q qVar) throws IOException; public abstract int b(); public abstract void c(int i); public abstract boolean c() throws IOException; public abstract int d(int i) throws z; public abstract boolean d() throws IOException; public abstract i.h e() throws IOException; public abstract boolean e(int i) throws IOException; public abstract double f() throws IOException; public abstract int g() throws IOException; public abstract int h() throws IOException; public abstract long i() throws IOException; public abstract float j() throws IOException; public abstract int k() throws IOException; public abstract long l() throws IOException; public abstract int m() throws IOException; public abstract int n() throws IOException; public abstract long o() throws IOException; public abstract int p() throws IOException; public abstract long q() throws IOException; public abstract String r() throws IOException; public abstract String s() throws IOException; public abstract int t() throws IOException; public abstract int u() throws IOException; public abstract long v() throws IOException; public j() { this.b = 100; this.c = Integer.MAX_VALUE; } }