what-the-bank/sources/o/C15111ghZ.java

1810 lines
60 KiB
Java

package o;
import com.google.common.primitives.UnsignedBytes;
import io.flutter.embedding.android.KeyboardMap;
import java.io.Closeable;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel;
import java.nio.charset.Charset;
import okhttp3.internal.connection.RealConnection;
import org.jmrtd.PassportService;
/* renamed from: o.ghZ, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C15111ghZ implements InterfaceC15149gid, InterfaceC15148gic, Cloneable, ByteChannel {
public long c;
public C15170giy d;
@Override // o.InterfaceC15149gid
public final C15111ghZ c() {
return this;
}
@Override // o.giD, java.io.Closeable, java.lang.AutoCloseable
public final void close() {
}
@Override // o.InterfaceC15148gic, o.InterfaceC15168giw, java.io.Flushable
public final void flush() {
}
@Override // o.InterfaceC15149gid, o.InterfaceC15148gic
public final C15111ghZ i() {
return this;
}
@Override // java.nio.channels.Channel
public final boolean isOpen() {
return true;
}
@Override // o.InterfaceC15148gic
public final /* bridge */ /* synthetic */ InterfaceC15148gic a() {
return this;
}
@Override // o.InterfaceC15148gic
public final /* synthetic */ InterfaceC15148gic a(byte[] bArr) {
C14957gcv.e(bArr, "");
return b(bArr, 0, bArr.length);
}
@Override // o.InterfaceC15148gic
public final /* bridge */ /* synthetic */ InterfaceC15148gic b() {
return this;
}
@Override // o.InterfaceC15148gic
public final /* synthetic */ InterfaceC15148gic b(C15155gij c15155gij) {
C14957gcv.e(c15155gij, "");
c15155gij.a(this, c15155gij.a());
return this;
}
@Override // o.InterfaceC15148gic
public final /* synthetic */ InterfaceC15148gic d(String str) {
C14957gcv.e(str, "");
return c(str, 0, str.length());
}
/* renamed from: o.ghZ$Sts */
/* loaded from: classes.dex */
public static final class Sts extends OutputStream {
private C15111ghZ a;
@Override // java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
public final void close() {
}
@Override // java.io.OutputStream, java.io.Flushable
public final void flush() {
}
public Sts(C15111ghZ c15111ghZ) {
this.a = c15111ghZ;
}
@Override // java.io.OutputStream
public final void write(int i) {
this.a.b(i);
}
@Override // java.io.OutputStream
public final void write(byte[] bArr, int i, int i2) {
C14957gcv.e(bArr, "");
this.a.b(bArr, i, i2);
}
public final String toString() {
StringBuilder sb = new StringBuilder();
sb.append(this.a);
sb.append(".outputStream()");
return sb.toString();
}
}
@Override // o.InterfaceC15149gid
public final void g(long j) throws EOFException {
if (this.c < j) {
throw new EOFException();
}
}
@Override // o.InterfaceC15149gid
public final InterfaceC15149gid g() {
return C15160gio.c(new C15161gip(this));
}
/* renamed from: o.ghZ$HBt */
/* loaded from: classes.dex */
public static final class HBt extends InputStream {
private C15111ghZ c;
@Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable
public final void close() {
}
public HBt(C15111ghZ c15111ghZ) {
this.c = c15111ghZ;
}
@Override // java.io.InputStream
public final int read(byte[] bArr, int i, int i2) {
C14957gcv.e(bArr, "");
return this.c.c(bArr, i, i2);
}
public final String toString() {
StringBuilder sb = new StringBuilder();
sb.append(this.c);
sb.append(".inputStream()");
return sb.toString();
}
@Override // java.io.InputStream
public final int available() {
return (int) Math.min(this.c.c, 2147483647L);
}
@Override // java.io.InputStream
public final int read() {
if (this.c.c > 0) {
return this.c.f() & UnsignedBytes.MAX_VALUE;
}
return -1;
}
}
@Override // o.InterfaceC15149gid
public final InputStream h() {
return new HBt(this);
}
public static /* synthetic */ RVV c(C15111ghZ c15111ghZ) {
RVV a = giE.a();
C14957gcv.e(a, "");
return giJ.d(c15111ghZ, a);
}
@Override // o.InterfaceC15149gid
public final String d(Charset charset) {
C14957gcv.e(charset, "");
return b(this.c, charset);
}
public final String b(long j, Charset charset) throws EOFException {
C14957gcv.e(charset, "");
if (j < 0 || j > 2147483647L) {
throw new IllegalArgumentException("byteCount: ".concat(String.valueOf(j)).toString());
}
if (this.c < j) {
throw new EOFException();
}
if (j == 0) {
return "";
}
C15170giy c15170giy = this.d;
C14957gcv.e(c15170giy);
if (c15170giy.e + j > c15170giy.d) {
return new String(e(j), charset);
}
int i = (int) j;
String str = new String(c15170giy.c, c15170giy.e, i, charset);
c15170giy.e += i;
this.c -= j;
if (c15170giy.e == c15170giy.d) {
this.d = c15170giy.d();
C15169gix.e(c15170giy);
}
return str;
}
@Override // o.InterfaceC15149gid
public final String t() throws EOFException {
return b(Long.MAX_VALUE);
}
@Override // java.nio.channels.ReadableByteChannel
public final int read(ByteBuffer byteBuffer) throws IOException {
C14957gcv.e(byteBuffer, "");
C15170giy c15170giy = this.d;
if (c15170giy == null) {
return -1;
}
int min = Math.min(byteBuffer.remaining(), c15170giy.d - c15170giy.e);
byteBuffer.put(c15170giy.c, c15170giy.e, min);
c15170giy.e += min;
this.c -= min;
if (c15170giy.e == c15170giy.d) {
this.d = c15170giy.d();
C15169gix.e(c15170giy);
}
return min;
}
public final C15111ghZ d(String str, int i, int i2, Charset charset) {
C14957gcv.e(str, "");
C14957gcv.e(charset, "");
if (i < 0) {
throw new IllegalArgumentException("beginIndex < 0: ".concat(String.valueOf(i)).toString());
}
if (i2 < i) {
StringBuilder sb = new StringBuilder("endIndex < beginIndex: ");
sb.append(i2);
sb.append(" < ");
sb.append(i);
throw new IllegalArgumentException(sb.toString().toString());
}
if (i2 > str.length()) {
StringBuilder sb2 = new StringBuilder("endIndex > string.length: ");
sb2.append(i2);
sb2.append(" > ");
sb2.append(str.length());
throw new IllegalArgumentException(sb2.toString().toString());
}
if (C14957gcv.b(charset, gdP.a)) {
return c(str, i, i2);
}
String substring = str.substring(i, i2);
C14957gcv.c((Object) substring, "");
byte[] bytes = substring.getBytes(charset);
C14957gcv.c(bytes, "");
return b(bytes, 0, bytes.length);
}
@Override // java.nio.channels.WritableByteChannel
public final int write(ByteBuffer byteBuffer) throws IOException {
C14957gcv.e(byteBuffer, "");
int remaining = byteBuffer.remaining();
int i = remaining;
while (i > 0) {
C15170giy d = d(1);
int min = Math.min(i, 8192 - d.d);
byteBuffer.get(d.c, d.d, min);
i -= min;
d.d += min;
}
this.c += remaining;
return remaining;
}
@Override // o.InterfaceC15149gid
public final long a(C15155gij c15155gij) throws IOException {
C14957gcv.e(c15155gij, "");
return a(c15155gij, 0L);
}
@Override // o.InterfaceC15149gid
public final long e(C15155gij c15155gij) {
C14957gcv.e(c15155gij, "");
return c(c15155gij, 0L);
}
@Override // o.giD
public final C15139giB timeout() {
return C15139giB.NONE;
}
public final String toString() {
return q().toString();
}
@Override // o.InterfaceC15149gid
public final int c(C15163gir c15163gir) {
C14957gcv.e(c15163gir, "");
int a = giJ.a(this, c15163gir);
if (a == -1) {
return -1;
}
j(c15163gir.d[a].a());
return a;
}
@Override // o.InterfaceC15149gid
public final String b(long j) throws EOFException {
if (j < 0) {
throw new IllegalArgumentException("limit < 0: ".concat(String.valueOf(j)).toString());
}
long j2 = j != Long.MAX_VALUE ? j + 1 : Long.MAX_VALUE;
long a = a((byte) 10, 0L, j2);
if (a != -1) {
return giJ.d(this, a);
}
if (j2 < this.c && d(j2 - 1) == 13 && d(j2) == 10) {
return giJ.d(this, j2);
}
C15111ghZ c15111ghZ = new C15111ghZ();
c(c15111ghZ, 0L, Math.min(32L, this.c));
StringBuilder sb = new StringBuilder("\\n not found: limit=");
sb.append(Math.min(this.c, j));
sb.append(" content=");
sb.append(c15111ghZ.c(c15111ghZ.c).c());
sb.append((char) 8230);
throw new EOFException(sb.toString());
}
/* renamed from: o.ghZ$RVV */
/* loaded from: classes.dex */
public static final class RVV implements Closeable {
public boolean a;
public C15111ghZ b;
public byte[] c;
public C15170giy f;
public long d = -1;
public int g = -1;
public int e = -1;
@Override // java.io.Closeable, java.lang.AutoCloseable
public final void close() {
if (this.b == null) {
throw new IllegalStateException("not attached to a buffer".toString());
}
this.b = null;
this.f = null;
this.d = -1L;
this.c = null;
this.g = -1;
this.e = -1;
}
public final int e(long j) {
C15111ghZ c15111ghZ = this.b;
if (c15111ghZ == null) {
throw new IllegalStateException("not attached to a buffer".toString());
}
if (j < -1 || j > c15111ghZ.c) {
StringBuilder sb = new StringBuilder("offset=");
sb.append(j);
sb.append(" > size=");
sb.append(c15111ghZ.c);
throw new ArrayIndexOutOfBoundsException(sb.toString());
}
if (j != -1 && j != c15111ghZ.c) {
long j2 = c15111ghZ.c;
C15170giy c15170giy = c15111ghZ.d;
C15170giy c15170giy2 = c15111ghZ.d;
C15170giy c15170giy3 = this.f;
long j3 = 0;
if (c15170giy3 != null) {
long j4 = this.d;
int i = this.g;
C14957gcv.e(c15170giy3);
long j5 = j4 - (i - c15170giy3.e);
if (j5 > j) {
c15170giy2 = this.f;
j2 = j5;
} else {
c15170giy = this.f;
j3 = j5;
}
}
if (j2 - j > j - j3) {
while (true) {
C14957gcv.e(c15170giy);
if (j < (c15170giy.d - c15170giy.e) + j3) {
break;
}
j3 += c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
}
} else {
while (j2 > j) {
C14957gcv.e(c15170giy2);
c15170giy2 = c15170giy2.h;
C14957gcv.e(c15170giy2);
j2 -= c15170giy2.d - c15170giy2.e;
}
j3 = j2;
c15170giy = c15170giy2;
}
if (this.a) {
C14957gcv.e(c15170giy);
if (c15170giy.i) {
C15170giy b = c15170giy.b();
if (c15111ghZ.d == c15170giy) {
c15111ghZ.d = b;
}
c15170giy = c15170giy.b(b);
C15170giy c15170giy4 = c15170giy.h;
C14957gcv.e(c15170giy4);
c15170giy4.d();
}
}
this.f = c15170giy;
this.d = j;
C14957gcv.e(c15170giy);
this.c = c15170giy.c;
this.g = c15170giy.e + ((int) (j - j3));
int i2 = c15170giy.d;
this.e = i2;
return i2 - this.g;
}
this.f = null;
this.d = j;
this.c = null;
this.g = -1;
this.e = -1;
return -1;
}
}
@Override // o.InterfaceC15149gid
public final void d(byte[] bArr) throws EOFException {
C14957gcv.e(bArr, "");
int i = 0;
while (i < bArr.length) {
int c = c(bArr, i, bArr.length - i);
if (c == -1) {
throw new EOFException();
}
i += c;
}
}
public final int c(byte[] bArr, int i, int i2) {
C14957gcv.e(bArr, "");
giE.d(bArr.length, i, i2);
C15170giy c15170giy = this.d;
if (c15170giy == null) {
return -1;
}
int min = Math.min(i2, c15170giy.d - c15170giy.e);
byte[] bArr2 = c15170giy.c;
int i3 = c15170giy.e;
int i4 = c15170giy.e + min;
C14957gcv.e(bArr2, "");
C14957gcv.e(bArr, "");
System.arraycopy(bArr2, i3, bArr, i, i4 - i3);
c15170giy.e += min;
this.c -= min;
if (c15170giy.e == c15170giy.d) {
this.d = c15170giy.d();
C15169gix.e(c15170giy);
}
return min;
}
@Override // o.InterfaceC15149gid
public final void j(long j) throws EOFException {
while (j > 0) {
C15170giy c15170giy = this.d;
if (c15170giy == null) {
throw new EOFException();
}
int min = (int) Math.min(j, c15170giy.d - c15170giy.e);
long j2 = min;
this.c -= j2;
j -= j2;
c15170giy.e += min;
if (c15170giy.e == c15170giy.d) {
this.d = c15170giy.d();
C15169gix.e(c15170giy);
}
}
}
@Override // o.InterfaceC15148gic
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public final C15111ghZ c(String str, int i, int i2) {
char charAt;
C14957gcv.e(str, "");
if (i < 0) {
throw new IllegalArgumentException("beginIndex < 0: ".concat(String.valueOf(i)).toString());
}
if (i2 < i) {
StringBuilder sb = new StringBuilder("endIndex < beginIndex: ");
sb.append(i2);
sb.append(" < ");
sb.append(i);
throw new IllegalArgumentException(sb.toString().toString());
}
if (i2 > str.length()) {
StringBuilder sb2 = new StringBuilder("endIndex > string.length: ");
sb2.append(i2);
sb2.append(" > ");
sb2.append(str.length());
throw new IllegalArgumentException(sb2.toString().toString());
}
while (i < i2) {
char charAt2 = str.charAt(i);
if (charAt2 < 128) {
C15170giy d = d(1);
byte[] bArr = d.c;
int i3 = d.d - i;
int min = Math.min(i2, 8192 - i3);
int i4 = i + 1;
bArr[i + i3] = (byte) charAt2;
while (true) {
i = i4;
if (i >= min || (charAt = str.charAt(i)) >= 128) {
break;
}
i4 = i + 1;
bArr[i + i3] = (byte) charAt;
}
int i5 = (i3 + i) - d.d;
d.d += i5;
this.c += i5;
} else {
if (charAt2 < 2048) {
C15170giy d2 = d(2);
d2.c[d2.d] = (byte) ((charAt2 >> 6) | 192);
d2.c[d2.d + 1] = (byte) ((charAt2 & '?') | 128);
d2.d += 2;
this.c += 2;
} else if (charAt2 < 55296 || charAt2 > 57343) {
C15170giy d3 = d(3);
d3.c[d3.d] = (byte) ((charAt2 >> '\f') | PassportService.DEFAULT_MAX_BLOCKSIZE);
d3.c[d3.d + 1] = (byte) (((charAt2 >> 6) & 63) | 128);
d3.c[d3.d + 2] = (byte) ((charAt2 & '?') | 128);
d3.d += 3;
this.c += 3;
} else {
int i6 = i + 1;
char charAt3 = i6 < i2 ? str.charAt(i6) : (char) 0;
if (charAt2 > 56319 || 56320 > charAt3 || charAt3 >= 57344) {
b(63);
i = i6;
} else {
int i7 = (((charAt2 & 1023) << 10) | (charAt3 & 1023)) + 65536;
C15170giy d4 = d(4);
d4.c[d4.d] = (byte) ((i7 >> 18) | 240);
d4.c[d4.d + 1] = (byte) (((i7 >> 12) & 63) | 128);
d4.c[d4.d + 2] = (byte) (((i7 >> 6) & 63) | 128);
d4.c[d4.d + 3] = (byte) ((i7 & 63) | 128);
d4.d += 4;
this.c += 4;
i += 2;
}
}
i++;
}
}
return this;
}
public final C15111ghZ i(int i) {
if (i < 128) {
b(i);
} else if (i < 2048) {
C15170giy d = d(2);
d.c[d.d] = (byte) ((i >> 6) | 192);
d.c[d.d + 1] = (byte) ((i & 63) | 128);
d.d += 2;
this.c += 2;
} else if (55296 <= i && i < 57344) {
b(63);
} else if (i < 65536) {
C15170giy d2 = d(3);
d2.c[d2.d] = (byte) ((i >> 12) | PassportService.DEFAULT_MAX_BLOCKSIZE);
d2.c[d2.d + 1] = (byte) (((i >> 6) & 63) | 128);
d2.c[d2.d + 2] = (byte) ((i & 63) | 128);
d2.d += 3;
this.c += 3;
} else if (i <= 1114111) {
C15170giy d3 = d(4);
d3.c[d3.d] = (byte) ((i >> 18) | 240);
d3.c[d3.d + 1] = (byte) (((i >> 12) & 63) | 128);
d3.c[d3.d + 2] = (byte) (((i >> 6) & 63) | 128);
d3.c[d3.d + 3] = (byte) ((i & 63) | 128);
d3.d += 4;
this.c += 4;
} else {
StringBuilder sb = new StringBuilder("Unexpected code point: 0x");
sb.append(giE.a(i));
throw new IllegalArgumentException(sb.toString());
}
return this;
}
@Override // o.InterfaceC15148gic
/* renamed from: d, reason: merged with bridge method [inline-methods] */
public final C15111ghZ b(byte[] bArr, int i, int i2) {
C14957gcv.e(bArr, "");
long j = i2;
giE.d(bArr.length, i, j);
int i3 = i2 + i;
while (i < i3) {
C15170giy d = d(1);
int min = Math.min(i3 - i, 8192 - d.d);
byte[] bArr2 = d.c;
int i4 = d.d;
int i5 = i + min;
C14957gcv.e(bArr, "");
C14957gcv.e(bArr2, "");
System.arraycopy(bArr, i, bArr2, i4, i5 - i);
d.d += min;
i = i5;
}
this.c += j;
return this;
}
@Override // o.InterfaceC15148gic
public final long c(giD gid) throws IOException {
C14957gcv.e(gid, "");
long j = 0;
while (true) {
long read = gid.read(this, 8192L);
if (read == -1) {
return j;
}
j += read;
}
}
@Override // o.InterfaceC15148gic
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public final C15111ghZ b(int i) {
C15170giy d = d(1);
byte[] bArr = d.c;
int i2 = d.d;
d.d = i2 + 1;
bArr[i2] = (byte) i;
this.c++;
return this;
}
@Override // o.InterfaceC15148gic
/* renamed from: f, reason: merged with bridge method [inline-methods] */
public final C15111ghZ g(int i) {
C15170giy d = d(2);
byte[] bArr = d.c;
int i2 = d.d;
bArr[i2] = (byte) (i >>> 8);
bArr[i2 + 1] = (byte) i;
d.d = i2 + 2;
this.c += 2;
return this;
}
@Override // o.InterfaceC15148gic
/* renamed from: c, reason: merged with bridge method [inline-methods] */
public final C15111ghZ j(int i) {
C15170giy d = d(4);
byte[] bArr = d.c;
int i2 = d.d;
bArr[i2] = (byte) (i >>> 24);
bArr[i2 + 1] = (byte) (i >>> 16);
bArr[i2 + 2] = (byte) (i >>> 8);
bArr[i2 + 3] = (byte) i;
d.d = i2 + 4;
this.c += 4;
return this;
}
public final C15111ghZ n(long j) {
C15170giy d = d(8);
byte[] bArr = d.c;
int i = d.d;
bArr[i] = (byte) ((j >>> 56) & 255);
bArr[i + 1] = (byte) ((j >>> 48) & 255);
bArr[i + 2] = (byte) ((j >>> 40) & 255);
bArr[i + 3] = (byte) ((j >>> 32) & 255);
bArr[i + 4] = (byte) ((j >>> 24) & 255);
bArr[i + 5] = (byte) ((j >>> 16) & 255);
bArr[i + 6] = (byte) ((j >>> 8) & 255);
bArr[i + 7] = (byte) (j & 255);
d.d = i + 8;
this.c += 8;
return this;
}
@Override // o.InterfaceC15148gic
/* renamed from: f, reason: merged with bridge method [inline-methods] */
public final C15111ghZ h(long j) {
if (j == 0) {
return b(48);
}
boolean z = false;
if (j < 0) {
j = -j;
if (j < 0) {
C14957gcv.e("-9223372036854775808", "");
return c("-9223372036854775808", 0, 20);
}
z = true;
}
int i = j < 100000000 ? j < 10000 ? j < 100 ? j >= 10 ? 2 : 1 : j < 1000 ? 3 : 4 : j < 1000000 ? j < 100000 ? 5 : 6 : j < 10000000 ? 7 : 8 : j < 1000000000000L ? j < RealConnection.IDLE_CONNECTION_HEALTHY_NS ? j < 1000000000 ? 9 : 10 : j < 100000000000L ? 11 : 12 : j < 1000000000000000L ? j < 10000000000000L ? 13 : j < 100000000000000L ? 14 : 15 : j < 100000000000000000L ? j < 10000000000000000L ? 16 : 17 : j < 1000000000000000000L ? 18 : 19;
if (z) {
i++;
}
C15170giy d = d(i);
byte[] bArr = d.c;
int i2 = d.d + i;
while (j != 0) {
i2--;
bArr[i2] = giJ.c()[(int) (j % 10)];
j /= 10;
}
if (z) {
bArr[i2 - 1] = 45;
}
d.d += i;
this.c += i;
return this;
}
@Override // o.InterfaceC15148gic
/* renamed from: i, reason: merged with bridge method [inline-methods] */
public final C15111ghZ l(long j) {
if (j == 0) {
return b(48);
}
long j2 = (j >>> 1) | j;
long j3 = j2 | (j2 >>> 2);
long j4 = j3 | (j3 >>> 4);
long j5 = j4 | (j4 >>> 8);
long j6 = j5 | (j5 >>> 16);
long j7 = j6 | (j6 >>> 32);
long j8 = j7 - ((j7 >>> 1) & 6148914691236517205L);
long j9 = ((j8 >>> 2) & 3689348814741910323L) + (j8 & 3689348814741910323L);
long j10 = ((j9 >>> 4) + j9) & 1085102592571150095L;
long j11 = j10 + (j10 >>> 8);
long j12 = j11 + (j11 >>> 16);
int i = (int) ((((j12 & 63) + ((j12 >>> 32) & 63)) + 3) / 4);
C15170giy d = d(i);
byte[] bArr = d.c;
int i2 = d.d;
for (int i3 = (d.d + i) - 1; i3 >= i2; i3--) {
bArr[i3] = giJ.c()[(int) (15 & j)];
j >>>= 4;
}
d.d += i;
this.c += i;
return this;
}
public final C15170giy d(int i) {
if (i <= 0 || i > 8192) {
throw new IllegalArgumentException("unexpected capacity".toString());
}
C15170giy c15170giy = this.d;
if (c15170giy == null) {
C15170giy d = C15169gix.d();
this.d = d;
d.h = d;
d.a = d;
return d;
}
C14957gcv.e(c15170giy);
C15170giy c15170giy2 = c15170giy.h;
C14957gcv.e(c15170giy2);
return (c15170giy2.d + i > 8192 || !c15170giy2.b) ? c15170giy2.b(C15169gix.d()) : c15170giy2;
}
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof C15111ghZ) {
long j = this.c;
C15111ghZ c15111ghZ = (C15111ghZ) obj;
if (j == c15111ghZ.c) {
if (j == 0) {
return true;
}
C15170giy c15170giy = this.d;
C14957gcv.e(c15170giy);
C15170giy c15170giy2 = c15111ghZ.d;
C14957gcv.e(c15170giy2);
int i = c15170giy.e;
int i2 = c15170giy2.e;
long j2 = 0;
while (j2 < this.c) {
long min = Math.min(c15170giy.d - i, c15170giy2.d - i2);
long j3 = 0;
while (j3 < min) {
if (c15170giy.c[i] == c15170giy2.c[i2]) {
j3++;
i++;
i2++;
}
}
if (i == c15170giy.d) {
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
i = c15170giy.e;
}
if (i2 == c15170giy2.d) {
c15170giy2 = c15170giy2.a;
C14957gcv.e(c15170giy2);
i2 = c15170giy2.e;
}
j2 += min;
}
return true;
}
}
return false;
}
public final int hashCode() {
C15170giy c15170giy = this.d;
if (c15170giy == null) {
return 0;
}
int i = 1;
do {
int i2 = c15170giy.d;
for (int i3 = c15170giy.e; i3 < i2; i3++) {
i = (i * 31) + c15170giy.c[i3];
}
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
} while (c15170giy != this.d);
return i;
}
/* renamed from: d, reason: merged with bridge method [inline-methods] */
public final C15111ghZ clone() {
C15111ghZ c15111ghZ = new C15111ghZ();
if (this.c != 0) {
C15170giy c15170giy = this.d;
C14957gcv.e(c15170giy);
c15170giy.i = true;
C15170giy c15170giy2 = new C15170giy(c15170giy.c, c15170giy.e, c15170giy.d, true, false);
c15111ghZ.d = c15170giy2;
c15170giy2.h = c15170giy2;
c15170giy2.a = c15170giy2.h;
for (C15170giy c15170giy3 = c15170giy.a; c15170giy3 != c15170giy; c15170giy3 = c15170giy3.a) {
C15170giy c15170giy4 = c15170giy2.h;
C14957gcv.e(c15170giy4);
C14957gcv.e(c15170giy3);
c15170giy3.i = true;
c15170giy4.b(new C15170giy(c15170giy3.c, c15170giy3.e, c15170giy3.d, true, false));
}
c15111ghZ.c = this.c;
}
return c15111ghZ;
}
public final C15155gij e(int i) {
if (i == 0) {
return C15155gij.e;
}
giE.d(this.c, 0L, i);
C15170giy c15170giy = this.d;
int i2 = 0;
int i3 = 0;
int i4 = 0;
while (i3 < i) {
C14957gcv.e(c15170giy);
if (c15170giy.d == c15170giy.e) {
throw new AssertionError("s.limit == s.pos");
}
i3 += c15170giy.d - c15170giy.e;
i4++;
c15170giy = c15170giy.a;
}
byte[][] bArr = new byte[i4];
int[] iArr = new int[i4 << 1];
C15170giy c15170giy2 = this.d;
int i5 = 0;
while (i2 < i) {
C14957gcv.e(c15170giy2);
bArr[i5] = c15170giy2.c;
i2 += c15170giy2.d - c15170giy2.e;
iArr[i5] = Math.min(i2, i);
iArr[bArr.length + i5] = c15170giy2.e;
c15170giy2.i = true;
i5++;
c15170giy2 = c15170giy2.a;
}
return new giA(bArr, iArr);
}
public final long e() {
long j = this.c;
if (j == 0) {
return 0L;
}
C15170giy c15170giy = this.d;
C14957gcv.e(c15170giy);
C15170giy c15170giy2 = c15170giy.h;
C14957gcv.e(c15170giy2);
return (c15170giy2.d >= 8192 || !c15170giy2.b) ? j : j - (c15170giy2.d - c15170giy2.e);
}
public final C15111ghZ c(C15111ghZ c15111ghZ, long j, long j2) {
C14957gcv.e(c15111ghZ, "");
giE.d(this.c, j, j2);
if (j2 != 0) {
c15111ghZ.c += j2;
C15170giy c15170giy = this.d;
while (true) {
C14957gcv.e(c15170giy);
if (j < c15170giy.d - c15170giy.e) {
break;
}
j -= c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
}
while (j2 > 0) {
C14957gcv.e(c15170giy);
c15170giy.i = true;
C15170giy c15170giy2 = new C15170giy(c15170giy.c, c15170giy.e, c15170giy.d, true, false);
c15170giy2.e += (int) j;
c15170giy2.d = Math.min(c15170giy2.e + ((int) j2), c15170giy2.d);
C15170giy c15170giy3 = c15111ghZ.d;
if (c15170giy3 == null) {
c15170giy2.h = c15170giy2;
c15170giy2.a = c15170giy2.h;
c15111ghZ.d = c15170giy2.a;
} else {
C14957gcv.e(c15170giy3);
C15170giy c15170giy4 = c15170giy3.h;
C14957gcv.e(c15170giy4);
c15170giy4.b(c15170giy2);
}
j2 -= c15170giy2.d - c15170giy2.e;
c15170giy = c15170giy.a;
j = 0;
}
}
return this;
}
public final byte d(long j) {
giE.d(this.c, j, 1L);
C15170giy c15170giy = this.d;
if (c15170giy == null) {
C15170giy c15170giy2 = null;
C14957gcv.e((Object) null);
byte[] bArr = c15170giy2.c;
throw null;
}
long j2 = this.c;
if (j2 - j < j) {
while (j2 > j) {
c15170giy = c15170giy.h;
C14957gcv.e(c15170giy);
j2 -= c15170giy.d - c15170giy.e;
}
C14957gcv.e(c15170giy);
return c15170giy.c[(int) ((c15170giy.e + j) - j2)];
}
long j3 = 0;
while (true) {
long j4 = (c15170giy.d - c15170giy.e) + j3;
if (j4 > j) {
C14957gcv.e(c15170giy);
return c15170giy.c[(int) ((c15170giy.e + j) - j3)];
}
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j3 = j4;
}
}
public final long a(byte b, long j, long j2) {
C15170giy c15170giy;
int i;
long j3 = j;
long j4 = j2;
long j5 = 0;
if (0 > j3 || j3 > j4) {
StringBuilder sb = new StringBuilder("size=");
sb.append(this.c);
sb.append(" fromIndex=");
sb.append(j3);
sb.append(" toIndex=");
sb.append(j4);
throw new IllegalArgumentException(sb.toString().toString());
}
long j6 = this.c;
if (j4 > j6) {
j4 = j6;
}
if (j3 != j4 && (c15170giy = this.d) != null) {
if (j6 - j3 < j3) {
while (j6 > j3) {
c15170giy = c15170giy.h;
C14957gcv.e(c15170giy);
j6 -= c15170giy.d - c15170giy.e;
}
if (c15170giy != null) {
while (j6 < j4) {
byte[] bArr = c15170giy.c;
int min = (int) Math.min(c15170giy.d, (c15170giy.e + j4) - j6);
i = (int) ((c15170giy.e + j3) - j6);
while (i < min) {
if (bArr[i] == b) {
return (i - c15170giy.e) + j6;
}
i++;
}
j6 += c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j3 = j6;
}
}
} else {
while (true) {
long j7 = (c15170giy.d - c15170giy.e) + j5;
if (j7 > j3) {
break;
}
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j5 = j7;
}
if (c15170giy != null) {
j6 = j5;
while (j6 < j4) {
byte[] bArr2 = c15170giy.c;
int min2 = (int) Math.min(c15170giy.d, (c15170giy.e + j4) - j6);
i = (int) ((c15170giy.e + j3) - j6);
while (i < min2) {
if (bArr2[i] == b) {
return (i - c15170giy.e) + j6;
}
i++;
}
j6 += c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j3 = j6;
}
}
}
}
return -1L;
}
public final long a(C15155gij c15155gij, long j) throws IOException {
long j2;
int i;
int i2;
byte[] bArr;
C14957gcv.e(c15155gij, "");
if (c15155gij.a() <= 0) {
throw new IllegalArgumentException("bytes is empty".toString());
}
long j3 = 0;
if (j >= 0) {
C15170giy c15170giy = this.d;
if (c15170giy != null) {
long j4 = this.c;
if (j4 - j < j) {
while (j4 > j) {
c15170giy = c15170giy.h;
C14957gcv.e(c15170giy);
j4 -= c15170giy.d - c15170giy.e;
}
if (c15170giy != null) {
byte[] b = c15155gij.b();
byte b2 = b[0];
int a = c15155gij.a();
long j5 = (this.c - a) + 1;
j2 = j4;
long j6 = j;
while (j2 < j5) {
byte[] bArr2 = c15170giy.c;
int i3 = a;
byte[] bArr3 = b;
int min = (int) Math.min(c15170giy.d, (c15170giy.e + j5) - j2);
i = (int) ((c15170giy.e + j6) - j2);
while (i < min) {
if (bArr2[i] == b2) {
i2 = i3;
bArr = bArr3;
if (giJ.d(c15170giy, i + 1, bArr, 1, i2)) {
return (i - c15170giy.e) + j2;
}
} else {
i2 = i3;
bArr = bArr3;
}
i++;
bArr3 = bArr;
i3 = i2;
}
j2 += c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
b = bArr3;
j6 = j2;
a = i3;
}
}
} else {
while (true) {
long j7 = (c15170giy.d - c15170giy.e) + j3;
if (j7 > j) {
break;
}
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j3 = j7;
}
if (c15170giy != null) {
byte[] b3 = c15155gij.b();
byte b4 = b3[0];
int a2 = c15155gij.a();
long j8 = (this.c - a2) + 1;
j2 = j3;
long j9 = j;
while (j2 < j8) {
byte[] bArr4 = c15170giy.c;
int min2 = (int) Math.min(c15170giy.d, (c15170giy.e + j8) - j2);
i = (int) ((c15170giy.e + j9) - j2);
while (i < min2) {
if (bArr4[i] == b4 && giJ.d(c15170giy, i + 1, b3, 1, a2)) {
return (i - c15170giy.e) + j2;
}
i++;
}
j2 += c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j9 = j2;
}
}
}
}
return -1L;
}
throw new IllegalArgumentException("fromIndex < 0: ".concat(String.valueOf(j)).toString());
}
public final long c(C15155gij c15155gij, long j) {
int i;
int i2;
C14957gcv.e(c15155gij, "");
long j2 = 0;
if (j < 0) {
throw new IllegalArgumentException("fromIndex < 0: ".concat(String.valueOf(j)).toString());
}
C15170giy c15170giy = this.d;
if (c15170giy == null) {
return -1L;
}
long j3 = this.c;
if (j3 - j < j) {
while (j3 > j) {
c15170giy = c15170giy.h;
C14957gcv.e(c15170giy);
j3 -= c15170giy.d - c15170giy.e;
}
if (c15170giy == null) {
return -1L;
}
if (c15155gij.a() != 2) {
byte[] b = c15155gij.b();
while (j3 < this.c) {
byte[] bArr = c15170giy.c;
i = (int) ((c15170giy.e + j) - j3);
int i3 = c15170giy.d;
while (i < i3) {
byte b2 = bArr[i];
for (byte b3 : b) {
if (b2 == b3) {
i2 = c15170giy.e;
}
}
i++;
}
j3 += c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j = j3;
}
return -1L;
}
byte c = c15155gij.c(0);
byte c2 = c15155gij.c(1);
while (j3 < this.c) {
byte[] bArr2 = c15170giy.c;
i = (int) ((c15170giy.e + j) - j3);
int i4 = c15170giy.d;
while (i < i4) {
byte b4 = bArr2[i];
if (b4 != c && b4 != c2) {
i++;
}
i2 = c15170giy.e;
}
j3 += c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j = j3;
}
return -1L;
}
while (true) {
long j4 = (c15170giy.d - c15170giy.e) + j2;
if (j4 > j) {
break;
}
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j2 = j4;
}
if (c15170giy == null) {
return -1L;
}
if (c15155gij.a() != 2) {
byte[] b5 = c15155gij.b();
j3 = j2;
while (j3 < this.c) {
byte[] bArr3 = c15170giy.c;
i = (int) ((c15170giy.e + j) - j3);
int i5 = c15170giy.d;
while (i < i5) {
byte b6 = bArr3[i];
for (byte b7 : b5) {
if (b6 == b7) {
i2 = c15170giy.e;
}
}
i++;
}
j3 += c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j = j3;
}
return -1L;
}
byte c3 = c15155gij.c(0);
byte c4 = c15155gij.c(1);
while (j2 < this.c) {
byte[] bArr4 = c15170giy.c;
i = (int) ((c15170giy.e + j) - j2);
int i6 = c15170giy.d;
while (i < i6) {
byte b8 = bArr4[i];
if (b8 == c3 || b8 == c4) {
j3 = j2;
i2 = c15170giy.e;
} else {
i++;
}
}
j2 += c15170giy.d - c15170giy.e;
c15170giy = c15170giy.a;
C14957gcv.e(c15170giy);
j = j2;
}
return -1L;
return (i - i2) + j3;
}
@Override // o.InterfaceC15149gid
public final boolean e(long j, C15155gij c15155gij) {
C14957gcv.e(c15155gij, "");
return b(j, c15155gij, c15155gij.a());
}
public final boolean b(long j, C15155gij c15155gij, int i) {
C14957gcv.e(c15155gij, "");
if (j < 0 || i < 0 || this.c - j < i || c15155gij.a() < i) {
return false;
}
for (int i2 = 0; i2 < i; i2++) {
if (d(i2 + j) != c15155gij.c(i2)) {
return false;
}
}
return true;
}
@Override // o.giD
public final long read(C15111ghZ c15111ghZ, long j) {
C14957gcv.e(c15111ghZ, "");
if (j < 0) {
throw new IllegalArgumentException("byteCount < 0: ".concat(String.valueOf(j)).toString());
}
long j2 = this.c;
if (j2 == 0) {
return -1L;
}
if (j > j2) {
j = j2;
}
c15111ghZ.write(this, j);
return j;
}
@Override // o.InterfaceC15149gid
public final long d(InterfaceC15168giw interfaceC15168giw) throws IOException {
C14957gcv.e(interfaceC15168giw, "");
long j = this.c;
if (j > 0) {
interfaceC15168giw.write(this, j);
}
return j;
}
@Override // o.InterfaceC15149gid
public final byte f() throws EOFException {
if (this.c != 0) {
C15170giy c15170giy = this.d;
C14957gcv.e(c15170giy);
int i = c15170giy.e;
int i2 = c15170giy.d;
int i3 = i + 1;
byte b = c15170giy.c[i];
this.c--;
if (i3 == i2) {
this.d = c15170giy.d();
C15169gix.e(c15170giy);
} else {
c15170giy.e = i3;
}
return b;
}
throw new EOFException();
}
@Override // o.InterfaceC15149gid
public final byte[] k() {
return e(this.c);
}
@Override // o.InterfaceC15149gid
public final byte[] e(long j) throws EOFException {
if (j < 0 || j > 2147483647L) {
throw new IllegalArgumentException("byteCount: ".concat(String.valueOf(j)).toString());
}
if (this.c < j) {
throw new EOFException();
}
byte[] bArr = new byte[(int) j];
d(bArr);
return bArr;
}
@Override // o.InterfaceC15149gid
public final C15155gij l() {
return c(this.c);
}
@Override // o.InterfaceC15149gid
public final C15155gij c(long j) throws EOFException {
if (j < 0 || j > 2147483647L) {
throw new IllegalArgumentException("byteCount: ".concat(String.valueOf(j)).toString());
}
if (this.c < j) {
throw new EOFException();
}
if (j >= 4096) {
C15155gij e = e((int) j);
j(j);
return e;
}
return new C15155gij(e(j));
}
@Override // o.InterfaceC15149gid
public final long o() throws EOFException {
if (this.c == 0) {
throw new EOFException();
}
boolean z = false;
int i = 0;
long j = 0;
long j2 = -7;
boolean z2 = false;
do {
C15170giy c15170giy = this.d;
C14957gcv.e(c15170giy);
byte[] bArr = c15170giy.c;
int i2 = c15170giy.e;
int i3 = c15170giy.d;
while (i2 < i3) {
byte b = bArr[i2];
if (b >= 48 && b <= 57) {
int i4 = 48 - b;
if (j < -922337203685477580L || (j == -922337203685477580L && i4 < j2)) {
C15111ghZ b2 = new C15111ghZ().h(j).b((int) b);
if (!z2) {
b2.f();
}
StringBuilder sb = new StringBuilder("Number too large: ");
sb.append(b2.b(b2.c, gdP.a));
throw new NumberFormatException(sb.toString());
}
j = (j * 10) + i4;
} else {
if (b != 45 || i != 0) {
z = true;
break;
}
j2--;
z2 = true;
}
i2++;
i++;
}
if (i2 == i3) {
this.d = c15170giy.d();
C15169gix.e(c15170giy);
} else {
c15170giy.e = i2;
}
if (z) {
break;
}
} while (this.d != null);
long j3 = this.c - i;
this.c = j3;
if (i >= (z2 ? 2 : 1)) {
return !z2 ? -j : j;
}
if (j3 != 0) {
String str = z2 ? "Expected a digit" : "Expected a digit or '-'";
StringBuilder sb2 = new StringBuilder();
sb2.append(str);
sb2.append(" but was 0x");
sb2.append((String) giE.c(new Object[]{Byte.valueOf(d(0L))}, 194407667, -194407666, (int) System.currentTimeMillis()));
throw new NumberFormatException(sb2.toString());
}
throw new EOFException();
}
@Override // o.InterfaceC15149gid
public final void e(C15111ghZ c15111ghZ, long j) throws EOFException {
C14957gcv.e(c15111ghZ, "");
long j2 = this.c;
if (j2 < j) {
c15111ghZ.write(this, j2);
throw new EOFException();
}
c15111ghZ.write(this, j);
}
/* JADX WARN: Removed duplicated region for block: B:31:0x00a6 */
/* JADX WARN: Removed duplicated region for block: B:33:0x00b4 */
/* JADX WARN: Removed duplicated region for block: B:39:0x00b8 A[EDGE_INSN: B:39:0x00b8->B:36:0x00b8 BREAK A[LOOP:0: B:4:0x000b->B:38:?], SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:40:0x00b0 */
@Override // o.InterfaceC15149gid
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final long m() throws java.io.EOFException {
/*
r14 = this;
long r0 = r14.c
r2 = 0
int r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
if (r0 == 0) goto Lbf
r0 = 0
r1 = r0
r4 = r2
Lb:
o.giy r6 = r14.d
o.C14957gcv.e(r6)
byte[] r7 = r6.c
int r8 = r6.e
int r9 = r6.d
L16:
if (r8 >= r9) goto La4
r10 = r7[r8]
r11 = 48
if (r10 < r11) goto L25
r11 = 57
if (r10 > r11) goto L25
int r11 = r10 + (-48)
goto L3a
L25:
r11 = 97
if (r10 < r11) goto L2e
r12 = 102(0x66, float:1.43E-43)
if (r10 > r12) goto L2e
goto L36
L2e:
r11 = 65
if (r10 < r11) goto L73
r12 = 70
if (r10 > r12) goto L73
L36:
int r11 = r10 - r11
int r11 = r11 + 10
L3a:
r12 = -1152921504606846976(0xf000000000000000, double:-3.105036184601418E231)
long r12 = r12 & r4
int r12 = (r12 > r2 ? 1 : (r12 == r2 ? 0 : -1))
if (r12 != 0) goto L4a
r10 = 4
long r4 = r4 << r10
long r10 = (long) r11
long r4 = r4 | r10
int r8 = r8 + 1
int r0 = r0 + 1
goto L16
L4a:
o.ghZ r0 = new o.ghZ
r0.<init>()
o.ghZ r0 = r0.l(r4)
o.ghZ r0 = r0.b(r10)
java.lang.NumberFormatException r1 = new java.lang.NumberFormatException
java.lang.StringBuilder r2 = new java.lang.StringBuilder
java.lang.String r3 = "Number too large: "
r2.<init>(r3)
long r3 = r0.c
java.nio.charset.Charset r5 = o.gdP.a
java.lang.String r0 = r0.b(r3, r5)
r2.append(r0)
java.lang.String r0 = r2.toString()
r1.<init>(r0)
throw r1
L73:
if (r0 == 0) goto L77
r1 = 1
goto La4
L77:
java.lang.StringBuilder r0 = new java.lang.StringBuilder
java.lang.String r1 = "Expected leading [0-9a-fA-F] character but was 0x"
r0.<init>(r1)
java.lang.Byte r1 = java.lang.Byte.valueOf(r10)
java.lang.Object[] r1 = new java.lang.Object[]{r1}
long r2 = java.lang.System.currentTimeMillis()
int r2 = (int) r2
r3 = 194407667(0xb966cf3, float:5.7941827E-32)
r4 = -194407666(0xfffffffff469930e, float:-7.402269E31)
java.lang.Object r1 = o.giE.c(r1, r3, r4, r2)
java.lang.String r1 = (java.lang.String) r1
r0.append(r1)
java.lang.String r0 = r0.toString()
java.lang.NumberFormatException r1 = new java.lang.NumberFormatException
r1.<init>(r0)
throw r1
La4:
if (r8 != r9) goto Lb0
o.giy r7 = r6.d()
r14.d = r7
o.C15169gix.e(r6)
goto Lb2
Lb0:
r6.e = r8
Lb2:
if (r1 != 0) goto Lb8
o.giy r6 = r14.d
if (r6 != 0) goto Lb
Lb8:
long r1 = r14.c
long r6 = (long) r0
long r1 = r1 - r6
r14.c = r1
return r4
Lbf:
java.io.EOFException r0 = new java.io.EOFException
r0.<init>()
throw r0
*/
throw new UnsupportedOperationException("Method not decompiled: o.C15111ghZ.m():long");
}
@Override // o.InterfaceC15149gid
public final int n() throws EOFException {
int i;
int i2;
if (this.c >= 4) {
C15170giy c15170giy = this.d;
C14957gcv.e(c15170giy);
int i3 = c15170giy.e;
int i4 = c15170giy.d;
if (i4 - i3 < 4) {
i = ((f() & UnsignedBytes.MAX_VALUE) << 24) | ((f() & UnsignedBytes.MAX_VALUE) << 16) | ((f() & UnsignedBytes.MAX_VALUE) << 8);
i2 = f() & UnsignedBytes.MAX_VALUE;
} else {
byte[] bArr = c15170giy.c;
byte b = bArr[i3];
byte b2 = bArr[i3 + 1];
byte b3 = bArr[i3 + 2];
int i5 = i3 + 4;
byte b4 = bArr[i3 + 3];
this.c -= 4;
if (i5 == i4) {
this.d = c15170giy.d();
C15169gix.e(c15170giy);
} else {
c15170giy.e = i5;
}
i = b4 & UnsignedBytes.MAX_VALUE;
i2 = ((b2 & UnsignedBytes.MAX_VALUE) << 16) | ((b & UnsignedBytes.MAX_VALUE) << 24) | ((b3 & UnsignedBytes.MAX_VALUE) << 8);
}
return i | i2;
}
throw new EOFException();
}
@Override // o.InterfaceC15149gid
public final long p() throws EOFException {
if (this.c >= 8) {
C15170giy c15170giy = this.d;
C14957gcv.e(c15170giy);
int i = c15170giy.e;
int i2 = c15170giy.d;
if (i2 - i < 8) {
return ((n() & KeyboardMap.kValueMask) << 32) | (KeyboardMap.kValueMask & n());
}
byte[] bArr = c15170giy.c;
long j = bArr[i];
long j2 = bArr[i + 1];
long j3 = bArr[i + 2];
long j4 = bArr[i + 3];
long j5 = bArr[i + 4];
long j6 = bArr[i + 5];
long j7 = bArr[i + 6];
int i3 = i + 8;
long j8 = bArr[i + 7];
this.c -= 8;
if (i3 == i2) {
this.d = c15170giy.d();
C15169gix.e(c15170giy);
} else {
c15170giy.e = i3;
}
return (j8 & 255) | ((j & 255) << 56) | ((j2 & 255) << 48) | ((j3 & 255) << 40) | ((j4 & 255) << 32) | ((j5 & 255) << 24) | ((j6 & 255) << 16) | ((j7 & 255) << 8);
}
throw new EOFException();
}
@Override // o.InterfaceC15149gid
public final short s() throws EOFException {
int i;
int i2;
if (this.c >= 2) {
C15170giy c15170giy = this.d;
C14957gcv.e(c15170giy);
int i3 = c15170giy.e;
int i4 = c15170giy.d;
if (i4 - i3 < 2) {
i = (f() & UnsignedBytes.MAX_VALUE) << 8;
i2 = f() & UnsignedBytes.MAX_VALUE;
} else {
byte[] bArr = c15170giy.c;
byte b = bArr[i3];
int i5 = i3 + 2;
byte b2 = bArr[i3 + 1];
this.c -= 2;
if (i5 == i4) {
this.d = c15170giy.d();
C15169gix.e(c15170giy);
} else {
c15170giy.e = i5;
}
i = b2 & UnsignedBytes.MAX_VALUE;
i2 = (b & UnsignedBytes.MAX_VALUE) << 8;
}
return (short) (i | i2);
}
throw new EOFException();
}
public final C15155gij q() {
long j = this.c;
if (j > 2147483647L) {
StringBuilder sb = new StringBuilder("size > Int.MAX_VALUE: ");
sb.append(this.c);
throw new IllegalStateException(sb.toString().toString());
}
return e((int) j);
}
@Override // o.InterfaceC15168giw
public final void write(C15111ghZ c15111ghZ, long j) {
C15170giy c15170giy;
C15170giy d;
C14957gcv.e(c15111ghZ, "");
if (c15111ghZ == this) {
throw new IllegalArgumentException("source == this".toString());
}
giE.d(c15111ghZ.c, 0L, j);
while (j > 0) {
C15170giy c15170giy2 = c15111ghZ.d;
C14957gcv.e(c15170giy2);
int i = c15170giy2.d;
C15170giy c15170giy3 = c15111ghZ.d;
C14957gcv.e(c15170giy3);
long j2 = i - c15170giy3.e;
int i2 = 0;
if (j < j2) {
C15170giy c15170giy4 = this.d;
if (c15170giy4 != null) {
C14957gcv.e(c15170giy4);
c15170giy = c15170giy4.h;
} else {
c15170giy = null;
}
if (c15170giy != null && c15170giy.b) {
if ((c15170giy.d + j) - (c15170giy.i ? 0 : c15170giy.e) <= 8192) {
C15170giy c15170giy5 = c15111ghZ.d;
C14957gcv.e(c15170giy5);
c15170giy5.d(c15170giy, (int) j);
c15111ghZ.c -= j;
this.c += j;
return;
}
}
C15170giy c15170giy6 = c15111ghZ.d;
C14957gcv.e(c15170giy6);
int i3 = (int) j;
if (i3 <= 0 || i3 > c15170giy6.d - c15170giy6.e) {
throw new IllegalArgumentException("byteCount out of range".toString());
}
if (i3 >= 1024) {
c15170giy6.i = true;
d = new C15170giy(c15170giy6.c, c15170giy6.e, c15170giy6.d, true, false);
} else {
d = C15169gix.d();
byte[] bArr = c15170giy6.c;
byte[] bArr2 = d.c;
int i4 = c15170giy6.e;
C14957gcv.e(bArr, "");
C14957gcv.e(bArr2, "");
System.arraycopy(bArr, i4, bArr2, 0, (i4 + i3) - i4);
}
d.d = d.e + i3;
c15170giy6.e += i3;
C15170giy c15170giy7 = c15170giy6.h;
C14957gcv.e(c15170giy7);
c15170giy7.b(d);
c15111ghZ.d = d;
}
C15170giy c15170giy8 = c15111ghZ.d;
C14957gcv.e(c15170giy8);
long j3 = c15170giy8.d - c15170giy8.e;
c15111ghZ.d = c15170giy8.d();
C15170giy c15170giy9 = this.d;
if (c15170giy9 == null) {
this.d = c15170giy8;
c15170giy8.h = c15170giy8;
c15170giy8.a = c15170giy8.h;
} else {
C14957gcv.e(c15170giy9);
C15170giy c15170giy10 = c15170giy9.h;
C14957gcv.e(c15170giy10);
C15170giy b = c15170giy10.b(c15170giy8);
C15170giy c15170giy11 = b.h;
if (c15170giy11 == b) {
throw new IllegalStateException("cannot compact".toString());
}
C14957gcv.e(c15170giy11);
if (c15170giy11.b) {
int i5 = b.d - b.e;
C15170giy c15170giy12 = b.h;
C14957gcv.e(c15170giy12);
int i6 = c15170giy12.d;
C15170giy c15170giy13 = b.h;
C14957gcv.e(c15170giy13);
if (!c15170giy13.i) {
C15170giy c15170giy14 = b.h;
C14957gcv.e(c15170giy14);
i2 = c15170giy14.e;
}
if (i5 <= (8192 - i6) + i2) {
C15170giy c15170giy15 = b.h;
C14957gcv.e(c15170giy15);
b.d(c15170giy15, i5);
b.d();
C15169gix.e(b);
}
}
}
c15111ghZ.c -= j3;
this.c += j3;
j -= j3;
}
}
@Override // o.InterfaceC15149gid
public final boolean a(long j) {
return this.c >= j;
}
@Override // o.InterfaceC15149gid
public final boolean j() {
return this.c == 0;
}
}