package p461;

import java.io.EOFException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel;
import java.nio.charset.Charset;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.InterfaceC6540;
import p402.p403.C6560;
import p402.p411.p413.C6635;
import p402.p420.C6689;
import p461.p462.C7133;
import p461.p462.C7134;

/* JADX INFO: renamed from: ޑ.ނ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6540
public final class C7103 implements InterfaceC7107, InterfaceC7106, Cloneable, ByteChannel {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public C7123 f20629;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public long f20630;

    /* JADX INFO: renamed from: ޑ.ނ$֏, reason: contains not printable characters */
    public static final class C7104 extends InputStream {
        public C7104() {
        }

        @Override // java.io.InputStream
        public int available() {
            return (int) Math.min(C7103.this.f20630, Integer.MAX_VALUE);
        }

        @Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable
        public void close() {
        }

        @Override // java.io.InputStream
        public int read() {
            C7103 c7103 = C7103.this;
            if (c7103.f20630 > 0) {
                return c7103.readByte() & 255;
            }
            return -1;
        }

        @Override // java.io.InputStream
        public int read(byte[] bArr, int i, int i2) {
            if (bArr != null) {
                return C7103.this.m10405(bArr, i, i2);
            }
            C6635.m9824("sink");
            throw null;
        }

        public String toString() {
            return C7103.this + ".inputStream()";
        }
    }

    /* JADX INFO: renamed from: ޑ.ނ$ؠ, reason: contains not printable characters */
    public static final class C7105 extends OutputStream {
        public C7105() {
        }

        @Override // java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
        public void close() {
        }

        @Override // java.io.OutputStream, java.io.Flushable
        public void flush() {
        }

        public String toString() {
            return C7103.this + ".outputStream()";
        }

        @Override // java.io.OutputStream
        public void write(int i) {
            C7103.this.writeByte(i);
        }

        @Override // java.io.OutputStream
        public void write(byte[] bArr, int i, int i2) {
            if (bArr != null) {
                C7103.this.write(bArr, i, i2);
            } else {
                C6635.m9824("data");
                throw null;
            }
        }
    }

    public Object clone() {
        C7103 c7103 = new C7103();
        if (this.f20630 != 0) {
            C7123 c7123 = this.f20629;
            if (c7123 == null) {
                C6635.m9822();
                throw null;
            }
            C7123 c7123M10478 = c7123.m10478();
            c7103.f20629 = c7123M10478;
            c7123M10478.f20671 = c7123M10478;
            c7123M10478.f20670 = c7123M10478;
            for (C7123 c71232 = c7123.f20670; c71232 != c7123; c71232 = c71232.f20670) {
                C7123 c71233 = c7123M10478.f20671;
                if (c71233 == null) {
                    C6635.m9822();
                    throw null;
                }
                if (c71232 == null) {
                    C6635.m9822();
                    throw null;
                }
                c71233.m10476(c71232.m10478());
            }
            c7103.f20630 = this.f20630;
        }
        return c7103;
    }

    @Override // p461.InterfaceC7129, java.io.Closeable, java.lang.AutoCloseable
    public void close() {
    }

    public boolean equals(Object obj) {
        if (this != obj) {
            if (obj instanceof C7103) {
                long j = this.f20630;
                C7103 c7103 = (C7103) obj;
                if (j == c7103.f20630) {
                    if (j != 0) {
                        C7123 c7123 = this.f20629;
                        if (c7123 == null) {
                            C6635.m9822();
                            throw null;
                        }
                        C7123 c71232 = c7103.f20629;
                        if (c71232 == null) {
                            C6635.m9822();
                            throw null;
                        }
                        int i = c7123.f20666;
                        int i2 = c71232.f20666;
                        long j2 = 0;
                        while (j2 < this.f20630) {
                            long jMin = Math.min(c7123.f20667 - i, c71232.f20667 - i2);
                            long j3 = 0;
                            while (j3 < jMin) {
                                int i3 = i + 1;
                                int i4 = i2 + 1;
                                if (c7123.f20665[i] == c71232.f20665[i2]) {
                                    j3++;
                                    i = i3;
                                    i2 = i4;
                                }
                            }
                            if (i == c7123.f20667) {
                                C7123 c71233 = c7123.f20670;
                                if (c71233 == null) {
                                    C6635.m9822();
                                    throw null;
                                }
                                i = c71233.f20666;
                                c7123 = c71233;
                            }
                            if (i2 == c71232.f20667) {
                                c71232 = c71232.f20670;
                                if (c71232 == null) {
                                    C6635.m9822();
                                    throw null;
                                }
                                i2 = c71232.f20666;
                            }
                            j2 += jMin;
                        }
                    }
                }
            }
            return false;
        }
        return true;
    }

    @Override // p461.InterfaceC7106, p461.InterfaceC7127, java.io.Flushable
    public void flush() {
    }

    @Override // p461.InterfaceC7107, p461.InterfaceC7106
    public C7103 getBuffer() {
        return this;
    }

    public int hashCode() {
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            return 0;
        }
        int i = 1;
        do {
            int i2 = c7123.f20667;
            for (int i3 = c7123.f20666; i3 < i2; i3++) {
                i = (i * 31) + c7123.f20665[i3];
            }
            c7123 = c7123.f20670;
            if (c7123 == null) {
                C6635.m9822();
                throw null;
            }
        } while (c7123 != this.f20629);
        return i;
    }

    @Override // java.nio.channels.Channel
    public boolean isOpen() {
        return true;
    }

    @Override // java.nio.channels.ReadableByteChannel
    public int read(ByteBuffer byteBuffer) {
        if (byteBuffer == null) {
            C6635.m9824("sink");
            throw null;
        }
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            return -1;
        }
        int iMin = Math.min(byteBuffer.remaining(), c7123.f20667 - c7123.f20666);
        byteBuffer.put(c7123.f20665, c7123.f20666, iMin);
        int i = c7123.f20666 + iMin;
        c7123.f20666 = i;
        this.f20630 -= (long) iMin;
        if (i == c7123.f20667) {
            this.f20629 = c7123.m10475();
            C7125.f20674.m10480(c7123);
        }
        return iMin;
    }

    @Override // p461.InterfaceC7107
    public byte readByte() {
        long j = this.f20630;
        if (j == 0) {
            throw new EOFException();
        }
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            C6635.m9822();
            throw null;
        }
        int i = c7123.f20666;
        int i2 = c7123.f20667;
        int i3 = i + 1;
        byte b = c7123.f20665[i];
        this.f20630 = j - 1;
        if (i3 == i2) {
            this.f20629 = c7123.m10475();
            C7125.f20674.m10480(c7123);
        } else {
            c7123.f20666 = i3;
        }
        return b;
    }

    @Override // p461.InterfaceC7107
    public int readInt() throws EOFException {
        long j = this.f20630;
        if (j < 4) {
            throw new EOFException();
        }
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            C6635.m9822();
            throw null;
        }
        int i = c7123.f20666;
        int i2 = c7123.f20667;
        if (i2 - i < 4) {
            return ((readByte() & 255) << 24) | ((readByte() & 255) << 16) | ((readByte() & 255) << 8) | (readByte() & 255);
        }
        byte[] bArr = c7123.f20665;
        int i3 = i + 1;
        int i4 = i3 + 1;
        int i5 = ((bArr[i] & 255) << 24) | ((bArr[i3] & 255) << 16);
        int i6 = i4 + 1;
        int i7 = i5 | ((bArr[i4] & 255) << 8);
        int i8 = i6 + 1;
        int i9 = i7 | (bArr[i6] & 255);
        this.f20630 = j - 4;
        if (i8 == i2) {
            this.f20629 = c7123.m10475();
            C7125.f20674.m10480(c7123);
        } else {
            c7123.f20666 = i8;
        }
        return i9;
    }

    @Override // p461.InterfaceC7107
    public short readShort() throws EOFException {
        long j = this.f20630;
        if (j < 2) {
            throw new EOFException();
        }
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            C6635.m9822();
            throw null;
        }
        int i = c7123.f20666;
        int i2 = c7123.f20667;
        if (i2 - i < 2) {
            return (short) (((readByte() & 255) << 8) | (readByte() & 255));
        }
        byte[] bArr = c7123.f20665;
        int i3 = i + 1;
        int i4 = i3 + 1;
        int i5 = ((bArr[i] & 255) << 8) | (bArr[i3] & 255);
        this.f20630 = j - 2;
        if (i4 == i2) {
            this.f20629 = c7123.m10475();
            C7125.f20674.m10480(c7123);
        } else {
            c7123.f20666 = i4;
        }
        return (short) i5;
    }

    @Override // p461.InterfaceC7107
    public void skip(long j) throws EOFException {
        while (j > 0) {
            C7123 c7123 = this.f20629;
            if (c7123 == null) {
                throw new EOFException();
            }
            int iMin = (int) Math.min(j, c7123.f20667 - c7123.f20666);
            long j2 = iMin;
            this.f20630 -= j2;
            j -= j2;
            int i = c7123.f20666 + iMin;
            c7123.f20666 = i;
            if (i == c7123.f20667) {
                this.f20629 = c7123.m10475();
                C7125.f20674.m10480(c7123);
            }
        }
    }

    public String toString() {
        if (this.f20630 <= ((long) Integer.MAX_VALUE)) {
            return m10417((int) this.f20630).toString();
        }
        StringBuilder sbM4889 = C2803.m4889("size > Int.MAX_VALUE: ");
        sbM4889.append(this.f20630);
        throw new IllegalStateException(sbM4889.toString().toString());
    }

    @Override // java.nio.channels.WritableByteChannel
    public int write(ByteBuffer byteBuffer) {
        if (byteBuffer == null) {
            C6635.m9824("source");
            throw null;
        }
        int iRemaining = byteBuffer.remaining();
        int i = iRemaining;
        while (i > 0) {
            C7123 c7123M10423 = m10423(1);
            int iMin = Math.min(i, 8192 - c7123M10423.f20667);
            byteBuffer.get(c7123M10423.f20665, c7123M10423.f20667, iMin);
            i -= iMin;
            c7123M10423.f20667 += iMin;
        }
        this.f20630 += (long) iRemaining;
        return iRemaining;
    }

    @Override // p461.InterfaceC7106
    public C7103 write(byte[] bArr) {
        if (bArr != null) {
            write(bArr, 0, bArr.length);
            return this;
        }
        C6635.m9824("source");
        throw null;
    }

    @Override // p461.InterfaceC7106
    public C7103 write(byte[] bArr, int i, int i2) {
        if (bArr == null) {
            C6635.m9824("source");
            throw null;
        }
        long j = i2;
        C4303.m7086(bArr.length, i, j);
        int i3 = i2 + i;
        while (i < i3) {
            C7123 c7123M10423 = m10423(1);
            int iMin = Math.min(i3 - i, 8192 - c7123M10423.f20667);
            int i4 = i + iMin;
            C6560.m9789(bArr, c7123M10423.f20665, c7123M10423.f20667, i, i4);
            c7123M10423.f20667 += iMin;
            i = i4;
        }
        this.f20630 += j;
        return this;
    }

    @Override // p461.InterfaceC7106
    public /* bridge */ /* synthetic */ InterfaceC7106 write(byte[] bArr) {
        write(bArr);
        return this;
    }

    @Override // p461.InterfaceC7106
    public /* bridge */ /* synthetic */ InterfaceC7106 write(byte[] bArr, int i, int i2) {
        write(bArr, i, i2);
        return this;
    }

    @Override // p461.InterfaceC7106
    public C7103 writeByte(int i) {
        C7123 c7123M10423 = m10423(1);
        byte[] bArr = c7123M10423.f20665;
        int i2 = c7123M10423.f20667;
        c7123M10423.f20667 = i2 + 1;
        bArr[i2] = (byte) i;
        this.f20630++;
        return this;
    }

    @Override // p461.InterfaceC7106
    public /* bridge */ /* synthetic */ InterfaceC7106 writeByte(int i) {
        writeByte(i);
        return this;
    }

    @Override // p461.InterfaceC7106
    public C7103 writeInt(int i) {
        C7123 c7123M10423 = m10423(4);
        byte[] bArr = c7123M10423.f20665;
        int i2 = c7123M10423.f20667;
        int i3 = i2 + 1;
        bArr[i2] = (byte) ((i >>> 24) & 255);
        int i4 = i3 + 1;
        bArr[i3] = (byte) ((i >>> 16) & 255);
        int i5 = i4 + 1;
        bArr[i4] = (byte) ((i >>> 8) & 255);
        bArr[i5] = (byte) (i & 255);
        c7123M10423.f20667 = i5 + 1;
        this.f20630 += 4;
        return this;
    }

    @Override // p461.InterfaceC7106
    public /* bridge */ /* synthetic */ InterfaceC7106 writeInt(int i) {
        writeInt(i);
        return this;
    }

    @Override // p461.InterfaceC7106
    public C7103 writeShort(int i) {
        C7123 c7123M10423 = m10423(2);
        byte[] bArr = c7123M10423.f20665;
        int i2 = c7123M10423.f20667;
        int i3 = i2 + 1;
        bArr[i2] = (byte) ((i >>> 8) & 255);
        bArr[i3] = (byte) (i & 255);
        c7123M10423.f20667 = i3 + 1;
        this.f20630 += 2;
        return this;
    }

    @Override // p461.InterfaceC7106
    public /* bridge */ /* synthetic */ InterfaceC7106 writeShort(int i) {
        writeShort(i);
        return this;
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public int mo10404(C7116 c7116) throws EOFException {
        if (c7116 == null) {
            C6635.m9824("options");
            throw null;
        }
        int iM10483 = C7133.m10483(this, c7116, false);
        if (iM10483 == -1) {
            return -1;
        }
        skip(c7116.f20653[iM10483].mo10450());
        return iM10483;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public int m10405(byte[] bArr, int i, int i2) {
        if (bArr == null) {
            C6635.m9824("sink");
            throw null;
        }
        C4303.m7086(bArr.length, i, i2);
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            return -1;
        }
        int iMin = Math.min(i2, c7123.f20667 - c7123.f20666);
        byte[] bArr2 = c7123.f20665;
        int i3 = c7123.f20666;
        C6560.m9789(bArr2, bArr, i, i3, i3 + iMin);
        int i4 = c7123.f20666 + iMin;
        c7123.f20666 = i4;
        this.f20630 -= (long) iMin;
        if (i4 != c7123.f20667) {
            return iMin;
        }
        this.f20629 = c7123.m10475();
        C7125.f20674.m10480(c7123);
        return iMin;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public long m10406(byte b, long j, long j2) {
        C7123 c7123;
        long j3 = 0;
        if (!(0 <= j && j2 >= j)) {
            StringBuilder sbM4889 = C2803.m4889("size=");
            sbM4889.append(this.f20630);
            sbM4889.append(" fromIndex=");
            sbM4889.append(j);
            sbM4889.append(" toIndex=");
            sbM4889.append(j2);
            throw new IllegalArgumentException(sbM4889.toString().toString());
        }
        long j4 = this.f20630;
        if (j2 > j4) {
            j2 = j4;
        }
        if (j != j2 && (c7123 = this.f20629) != null) {
            long j5 = this.f20630;
            if (j5 - j < j) {
                while (j5 > j) {
                    c7123 = c7123.f20671;
                    if (c7123 == null) {
                        C6635.m9822();
                        throw null;
                    }
                    j5 -= (long) (c7123.f20667 - c7123.f20666);
                }
                while (j5 < j2) {
                    byte[] bArr = c7123.f20665;
                    int iMin = (int) Math.min(c7123.f20667, (((long) c7123.f20666) + j2) - j5);
                    for (int i = (int) ((((long) c7123.f20666) + j) - j5); i < iMin; i++) {
                        if (bArr[i] == b) {
                            return ((long) (i - c7123.f20666)) + j5;
                        }
                    }
                    j5 += (long) (c7123.f20667 - c7123.f20666);
                    c7123 = c7123.f20670;
                    if (c7123 == null) {
                        C6635.m9822();
                        throw null;
                    }
                    j = j5;
                }
            } else {
                while (true) {
                    long j6 = ((long) (c7123.f20667 - c7123.f20666)) + j3;
                    if (j6 > j) {
                        while (j3 < j2) {
                            byte[] bArr2 = c7123.f20665;
                            int iMin2 = (int) Math.min(c7123.f20667, (((long) c7123.f20666) + j2) - j3);
                            for (int i2 = (int) ((((long) c7123.f20666) + j) - j3); i2 < iMin2; i2++) {
                                if (bArr2[i2] == b) {
                                    return ((long) (i2 - c7123.f20666)) + j3;
                                }
                            }
                            j3 += (long) (c7123.f20667 - c7123.f20666);
                            c7123 = c7123.f20670;
                            if (c7123 == null) {
                                C6635.m9822();
                                throw null;
                            }
                            j = j3;
                        }
                    } else {
                        c7123 = c7123.f20670;
                        if (c7123 == null) {
                            C6635.m9822();
                            throw null;
                        }
                        j3 = j6;
                    }
                }
            }
        }
        return -1L;
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public long mo10407(C7108 c7108) {
        if (c7108 != null) {
            return m10408(c7108, 0L);
        }
        C6635.m9824("bytes");
        throw null;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public long m10408(C7108 c7108, long j) {
        long j2 = j;
        if (c7108 == null) {
            C6635.m9824("bytes");
            throw null;
        }
        if (!(c7108.mo10450() > 0)) {
            throw new IllegalArgumentException("bytes is empty".toString());
        }
        long j3 = 0;
        if (!(j2 >= 0)) {
            throw new IllegalArgumentException(C2803.m4874("fromIndex < 0: ", j2).toString());
        }
        C7123 c7123 = this.f20629;
        if (c7123 != null) {
            long j4 = this.f20630;
            if (j4 - j2 < j2) {
                while (j4 > j2) {
                    c7123 = c7123.f20671;
                    if (c7123 == null) {
                        C6635.m9822();
                        throw null;
                    }
                    j4 -= (long) (c7123.f20667 - c7123.f20666);
                }
                byte[] bArrMo10452 = c7108.mo10452();
                byte b = bArrMo10452[0];
                int iMo10450 = c7108.mo10450();
                long j5 = (this.f20630 - ((long) iMo10450)) + 1;
                while (j4 < j5) {
                    byte[] bArr = c7123.f20665;
                    long j6 = j5;
                    int iMin = (int) Math.min(c7123.f20667, (((long) c7123.f20666) + j5) - j4);
                    for (int i = (int) ((((long) c7123.f20666) + j2) - j4); i < iMin; i++) {
                        if (bArr[i] == b && C7133.m10485(c7123, i + 1, bArrMo10452, 1, iMo10450)) {
                            return ((long) (i - c7123.f20666)) + j4;
                        }
                    }
                    j4 += (long) (c7123.f20667 - c7123.f20666);
                    c7123 = c7123.f20670;
                    if (c7123 == null) {
                        C6635.m9822();
                        throw null;
                    }
                    j2 = j4;
                    j5 = j6;
                }
            } else {
                while (true) {
                    long j7 = ((long) (c7123.f20667 - c7123.f20666)) + j3;
                    if (j7 > j2) {
                        byte[] bArrMo104522 = c7108.mo10452();
                        byte b2 = bArrMo104522[0];
                        int iMo104502 = c7108.mo10450();
                        long j8 = (this.f20630 - ((long) iMo104502)) + 1;
                        while (j3 < j8) {
                            byte[] bArr2 = c7123.f20665;
                            long j9 = j8;
                            int iMin2 = (int) Math.min(c7123.f20667, (((long) c7123.f20666) + j8) - j3);
                            for (int i2 = (int) ((((long) c7123.f20666) + j2) - j3); i2 < iMin2; i2++) {
                                if (bArr2[i2] == b2 && C7133.m10485(c7123, i2 + 1, bArrMo104522, 1, iMo104502)) {
                                    return ((long) (i2 - c7123.f20666)) + j3;
                                }
                            }
                            j3 += (long) (c7123.f20667 - c7123.f20666);
                            c7123 = c7123.f20670;
                            if (c7123 == null) {
                                C6635.m9822();
                                throw null;
                            }
                            j2 = j3;
                            j8 = j9;
                        }
                    } else {
                        c7123 = c7123.f20670;
                        if (c7123 == null) {
                            C6635.m9822();
                            throw null;
                        }
                        j3 = j7;
                    }
                }
            }
        }
        return -1L;
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public long mo10409(InterfaceC7127 interfaceC7127) {
        if (interfaceC7127 == null) {
            C6635.m9824("sink");
            throw null;
        }
        long j = this.f20630;
        if (j > 0) {
            interfaceC7127.mo10205(this, j);
        }
        return j;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public long mo10410(InterfaceC7129 interfaceC7129) {
        if (interfaceC7129 == null) {
            C6635.m9824("source");
            throw null;
        }
        long j = 0;
        while (true) {
            long jMo10207 = interfaceC7129.mo10207(this, 8192);
            if (jMo10207 == -1) {
                return j;
            }
            j += jMo10207;
        }
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public String mo10411(long j) {
        return m10412(j, C6689.f19437);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public String m10412(long j, Charset charset) throws EOFException {
        if (charset == null) {
            C6635.m9824("charset");
            throw null;
        }
        if (!(j >= 0 && j <= ((long) Integer.MAX_VALUE))) {
            throw new IllegalArgumentException(C2803.m4874("byteCount: ", j).toString());
        }
        if (this.f20630 < j) {
            throw new EOFException();
        }
        if (j == 0) {
            return "";
        }
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            C6635.m9822();
            throw null;
        }
        int i = c7123.f20666;
        if (((long) i) + j > c7123.f20667) {
            return new String(mo10429(j), charset);
        }
        int i2 = (int) j;
        String str = new String(c7123.f20665, i, i2, charset);
        int i3 = c7123.f20666 + i2;
        c7123.f20666 = i3;
        this.f20630 -= j;
        if (i3 == c7123.f20667) {
            this.f20629 = c7123.m10475();
            C7125.f20674.m10480(c7123);
        }
        return str;
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public String mo10413(Charset charset) {
        if (charset != null) {
            return m10412(this.f20630, charset);
        }
        C6635.m9824("charset");
        throw null;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public C7103 mo10414(String str) {
        if (str != null) {
            mo10415(str, 0, str.length());
            return this;
        }
        C6635.m9824("string");
        throw null;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public C7103 mo10415(String str, int i, int i2) {
        char cCharAt;
        if (str == null) {
            C6635.m9824("string");
            throw null;
        }
        if (!(i >= 0)) {
            throw new IllegalArgumentException(C2803.m4871("beginIndex < 0: ", i).toString());
        }
        if (!(i2 >= i)) {
            throw new IllegalArgumentException(C2803.m4873("endIndex < beginIndex: ", i2, " < ", i).toString());
        }
        if (!(i2 <= str.length())) {
            StringBuilder sbM4896 = C2803.m4896("endIndex > string.length: ", i2, " > ");
            sbM4896.append(str.length());
            throw new IllegalArgumentException(sbM4896.toString().toString());
        }
        while (i < i2) {
            char cCharAt2 = str.charAt(i);
            if (cCharAt2 < 128) {
                C7123 c7123M10423 = m10423(1);
                byte[] bArr = c7123M10423.f20665;
                int i3 = c7123M10423.f20667 - i;
                int iMin = Math.min(i2, 8192 - i3);
                int i4 = i + 1;
                bArr[i + i3] = (byte) cCharAt2;
                while (true) {
                    i = i4;
                    if (i >= iMin || (cCharAt = str.charAt(i)) >= 128) {
                        break;
                    }
                    i4 = i + 1;
                    bArr[i + i3] = (byte) cCharAt;
                }
                int i5 = c7123M10423.f20667;
                int i6 = (i3 + i) - i5;
                c7123M10423.f20667 = i5 + i6;
                this.f20630 += (long) i6;
            } else {
                if (cCharAt2 < 2048) {
                    C7123 c7123M104232 = m10423(2);
                    byte[] bArr2 = c7123M104232.f20665;
                    int i7 = c7123M104232.f20667;
                    bArr2[i7] = (byte) ((cCharAt2 >> 6) | 192);
                    bArr2[i7 + 1] = (byte) ((cCharAt2 & '?') | 128);
                    c7123M104232.f20667 = i7 + 2;
                    this.f20630 += 2;
                } else if (cCharAt2 < 55296 || cCharAt2 > 57343) {
                    C7123 c7123M104233 = m10423(3);
                    byte[] bArr3 = c7123M104233.f20665;
                    int i8 = c7123M104233.f20667;
                    bArr3[i8] = (byte) ((cCharAt2 >> '\f') | 224);
                    bArr3[i8 + 1] = (byte) ((63 & (cCharAt2 >> 6)) | 128);
                    bArr3[i8 + 2] = (byte) ((cCharAt2 & '?') | 128);
                    c7123M104233.f20667 = i8 + 3;
                    this.f20630 += 3;
                } else {
                    int i9 = i + 1;
                    char cCharAt3 = i9 < i2 ? str.charAt(i9) : (char) 0;
                    if (cCharAt2 > 56319 || 56320 > cCharAt3 || 57343 < cCharAt3) {
                        writeByte(63);
                        i = i9;
                    } else {
                        int i10 = (((cCharAt2 & 1023) << 10) | (cCharAt3 & 1023)) + 65536;
                        C7123 c7123M104234 = m10423(4);
                        byte[] bArr4 = c7123M104234.f20665;
                        int i11 = c7123M104234.f20667;
                        bArr4[i11] = (byte) ((i10 >> 18) | 240);
                        bArr4[i11 + 1] = (byte) (((i10 >> 12) & 63) | 128);
                        bArr4[i11 + 2] = (byte) (((i10 >> 6) & 63) | 128);
                        bArr4[i11 + 3] = (byte) ((i10 & 63) | 128);
                        c7123M104234.f20667 = i11 + 4;
                        this.f20630 += 4;
                        i += 2;
                    }
                }
                i++;
            }
        }
        return this;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final C7103 m10416(C7103 c7103, long j, long j2) {
        if (c7103 == null) {
            C6635.m9824("out");
            throw null;
        }
        C4303.m7086(this.f20630, j, j2);
        if (j2 != 0) {
            c7103.f20630 += j2;
            C7123 c7123 = this.f20629;
            while (c7123 != null) {
                int i = c7123.f20667;
                int i2 = c7123.f20666;
                if (j >= i - i2) {
                    j -= (long) (i - i2);
                    c7123 = c7123.f20670;
                } else {
                    while (j2 > 0) {
                        if (c7123 == null) {
                            C6635.m9822();
                            throw null;
                        }
                        C7123 c7123M10478 = c7123.m10478();
                        int i3 = c7123M10478.f20666 + ((int) j);
                        c7123M10478.f20666 = i3;
                        c7123M10478.f20667 = Math.min(i3 + ((int) j2), c7123M10478.f20667);
                        C7123 c71232 = c7103.f20629;
                        if (c71232 == null) {
                            c7123M10478.f20671 = c7123M10478;
                            c7123M10478.f20670 = c7123M10478;
                            c7103.f20629 = c7123M10478;
                        } else {
                            if (c71232 == null) {
                                C6635.m9822();
                                throw null;
                            }
                            C7123 c71233 = c71232.f20671;
                            if (c71233 == null) {
                                C6635.m9822();
                                throw null;
                            }
                            c71233.m10476(c7123M10478);
                        }
                        j2 -= (long) (c7123M10478.f20667 - c7123M10478.f20666);
                        c7123 = c7123.f20670;
                        j = 0;
                    }
                }
            }
            C6635.m9822();
            throw null;
        }
        return this;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ֏ */
    public /* bridge */ /* synthetic */ InterfaceC7106 mo10414(String str) {
        mo10414(str);
        return this;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ֏ */
    public /* bridge */ /* synthetic */ InterfaceC7106 mo10415(String str, int i, int i2) {
        mo10415(str, i, i2);
        return this;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final C7108 m10417(int i) {
        if (i == 0) {
            return C7108.f20633;
        }
        C4303.m7086(this.f20630, 0L, i);
        C7123 c7123 = this.f20629;
        int i2 = 0;
        int i3 = 0;
        int i4 = 0;
        while (i3 < i) {
            if (c7123 == null) {
                C6635.m9822();
                throw null;
            }
            int i5 = c7123.f20667;
            int i6 = c7123.f20666;
            if (i5 == i6) {
                throw new AssertionError("s.limit == s.pos");
            }
            i3 += i5 - i6;
            i4++;
            c7123 = c7123.f20670;
        }
        byte[][] bArr = new byte[i4][];
        int[] iArr = new int[i4 * 2];
        C7123 c71232 = this.f20629;
        int i7 = 0;
        while (i2 < i) {
            if (c71232 == null) {
                C6635.m9822();
                throw null;
            }
            bArr[i7] = c71232.f20665;
            i2 += c71232.f20667 - c71232.f20666;
            iArr[i7] = Math.min(i2, i);
            iArr[i7 + i4] = c71232.f20666;
            c71232.f20668 = true;
            i7++;
            c71232 = c71232.f20670;
        }
        return new C7126(bArr, iArr);
    }

    @Override // p461.InterfaceC7127
    /* JADX INFO: renamed from: ֏ */
    public void mo10205(C7103 c7103, long j) {
        C7123 c7123;
        C7123 c7123M10479;
        if (c7103 == null) {
            C6635.m9824("source");
            throw null;
        }
        if (!(c7103 != this)) {
            throw new IllegalArgumentException("source == this".toString());
        }
        C4303.m7086(c7103.f20630, 0L, j);
        long j2 = j;
        while (j2 > 0) {
            C7123 c71232 = c7103.f20629;
            if (c71232 == null) {
                C6635.m9822();
                throw null;
            }
            int i = c71232.f20667;
            if (c71232 == null) {
                C6635.m9822();
                throw null;
            }
            if (j2 < i - c71232.f20666) {
                C7123 c71233 = this.f20629;
                if (c71233 == null) {
                    c7123 = null;
                } else {
                    if (c71233 == null) {
                        C6635.m9822();
                        throw null;
                    }
                    c7123 = c71233.f20671;
                }
                if (c7123 != null && c7123.f20669) {
                    if ((((long) c7123.f20667) + j2) - ((long) (c7123.f20668 ? 0 : c7123.f20666)) <= 8192) {
                        C7123 c71234 = c7103.f20629;
                        if (c71234 == null) {
                            C6635.m9822();
                            throw null;
                        }
                        c71234.m10477(c7123, (int) j2);
                        c7103.f20630 -= j2;
                        this.f20630 += j2;
                        return;
                    }
                }
                C7123 c71235 = c7103.f20629;
                if (c71235 == null) {
                    C6635.m9822();
                    throw null;
                }
                int i2 = (int) j2;
                if (c71235 == null) {
                    throw null;
                }
                if (!(i2 > 0 && i2 <= c71235.f20667 - c71235.f20666)) {
                    throw new IllegalArgumentException("byteCount out of range".toString());
                }
                if (i2 >= 1024) {
                    c7123M10479 = c71235.m10478();
                } else {
                    c7123M10479 = C7125.f20674.m10479();
                    byte[] bArr = c71235.f20665;
                    byte[] bArr2 = c7123M10479.f20665;
                    int i3 = c71235.f20666;
                    C6560.m9790(bArr, bArr2, 0, i3, i3 + i2, 2);
                }
                c7123M10479.f20667 = c7123M10479.f20666 + i2;
                c71235.f20666 += i2;
                C7123 c71236 = c71235.f20671;
                if (c71236 == null) {
                    C6635.m9822();
                    throw null;
                }
                c71236.m10476(c7123M10479);
                c7103.f20629 = c7123M10479;
            }
            C7123 c71237 = c7103.f20629;
            if (c71237 == null) {
                C6635.m9822();
                throw null;
            }
            long j3 = c71237.f20667 - c71237.f20666;
            c7103.f20629 = c71237.m10475();
            C7123 c71238 = this.f20629;
            if (c71238 == null) {
                this.f20629 = c71237;
                c71237.f20671 = c71237;
                c71237.f20670 = c71237;
            } else {
                if (c71238 == null) {
                    C6635.m9822();
                    throw null;
                }
                C7123 c71239 = c71238.f20671;
                if (c71239 == null) {
                    C6635.m9822();
                    throw null;
                }
                c71239.m10476(c71237);
                if (!(c71237.f20671 != c71237)) {
                    throw new IllegalStateException("cannot compact".toString());
                }
                C7123 c712310 = c71237.f20671;
                if (c712310 == null) {
                    C6635.m9822();
                    throw null;
                }
                if (c712310.f20669) {
                    int i4 = c71237.f20667 - c71237.f20666;
                    if (i4 <= (8192 - c712310.f20667) + (c712310.f20668 ? 0 : c712310.f20666)) {
                        C7123 c712311 = c71237.f20671;
                        if (c712311 == null) {
                            C6635.m9822();
                            throw null;
                        }
                        c71237.m10477(c712311, i4);
                        c71237.m10475();
                        C7125.f20674.m10480(c71237);
                    } else {
                        continue;
                    }
                } else {
                    continue;
                }
            }
            c7103.f20630 -= j3;
            this.f20630 += j3;
            j2 -= j3;
        }
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public boolean mo10418(long j, C7108 c7108) {
        if (c7108 == null) {
            C6635.m9824("bytes");
            throw null;
        }
        int iMo10450 = c7108.mo10450();
        if (j < 0 || iMo10450 < 0 || this.f20630 - j < iMo10450 || c7108.mo10450() - 0 < iMo10450) {
            return false;
        }
        for (int i = 0; i < iMo10450; i++) {
            if (m10433(((long) i) + j) != c7108.mo10443(0 + i)) {
                return false;
            }
        }
        return true;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final long m10419() {
        long j = this.f20630;
        if (j == 0) {
            return 0L;
        }
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            C6635.m9822();
            throw null;
        }
        C7123 c71232 = c7123.f20671;
        if (c71232 == null) {
            C6635.m9822();
            throw null;
        }
        int i = c71232.f20667;
        if (i < 8192 && c71232.f20669) {
            j -= (long) (i - c71232.f20666);
        }
        return j;
    }

    @Override // p461.InterfaceC7129
    /* JADX INFO: renamed from: ؠ */
    public long mo10207(C7103 c7103, long j) {
        if (c7103 == null) {
            C6635.m9824("sink");
            throw null;
        }
        if (!(j >= 0)) {
            throw new IllegalArgumentException(C2803.m4874("byteCount < 0: ", j).toString());
        }
        long j2 = this.f20630;
        if (j2 == 0) {
            return -1L;
        }
        if (j > j2) {
            j = j2;
        }
        c7103.mo10205(this, j);
        return j;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public long m10420(C7108 c7108, long j) {
        int i;
        int i2;
        if (c7108 == null) {
            C6635.m9824("targetBytes");
            throw null;
        }
        if (!(j >= 0)) {
            throw new IllegalArgumentException(C2803.m4874("fromIndex < 0: ", j).toString());
        }
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            return -1L;
        }
        long j2 = this.f20630;
        if (j2 - j < j) {
            while (j2 > j) {
                c7123 = c7123.f20671;
                if (c7123 == null) {
                    C6635.m9822();
                    throw null;
                }
                j2 -= (long) (c7123.f20667 - c7123.f20666);
            }
            if (c7108.mo10450() == 2) {
                byte bMo10443 = c7108.mo10443(0);
                byte bMo104432 = c7108.mo10443(1);
                while (j2 < this.f20630) {
                    byte[] bArr = c7123.f20665;
                    i = (int) ((((long) c7123.f20666) + j) - j2);
                    int i3 = c7123.f20667;
                    while (i < i3) {
                        byte b = bArr[i];
                        if (b == bMo10443 || b == bMo104432) {
                            i2 = c7123.f20666;
                        } else {
                            i++;
                        }
                    }
                    j2 += (long) (c7123.f20667 - c7123.f20666);
                    c7123 = c7123.f20670;
                    if (c7123 == null) {
                        C6635.m9822();
                        throw null;
                    }
                    j = j2;
                }
                return -1L;
            }
            byte[] bArrMo10452 = c7108.mo10452();
            while (j2 < this.f20630) {
                byte[] bArr2 = c7123.f20665;
                i = (int) ((((long) c7123.f20666) + j) - j2);
                int i4 = c7123.f20667;
                while (i < i4) {
                    byte b2 = bArr2[i];
                    for (byte b3 : bArrMo10452) {
                        if (b2 == b3) {
                            i2 = c7123.f20666;
                        }
                    }
                    i++;
                }
                j2 += (long) (c7123.f20667 - c7123.f20666);
                c7123 = c7123.f20670;
                if (c7123 == null) {
                    C6635.m9822();
                    throw null;
                }
                j = j2;
            }
            return -1L;
        }
        j2 = 0;
        while (true) {
            long j3 = ((long) (c7123.f20667 - c7123.f20666)) + j2;
            if (j3 > j) {
                if (c7108.mo10450() == 2) {
                    byte bMo104433 = c7108.mo10443(0);
                    byte bMo104434 = c7108.mo10443(1);
                    while (j2 < this.f20630) {
                        byte[] bArr3 = c7123.f20665;
                        i = (int) ((((long) c7123.f20666) + j) - j2);
                        int i5 = c7123.f20667;
                        while (i < i5) {
                            byte b4 = bArr3[i];
                            if (b4 != bMo104433 && b4 != bMo104434) {
                                i++;
                            }
                        }
                        j2 += (long) (c7123.f20667 - c7123.f20666);
                        c7123 = c7123.f20670;
                        if (c7123 == null) {
                            C6635.m9822();
                            throw null;
                        }
                        j = j2;
                    }
                    return -1L;
                }
                byte[] bArrMo104522 = c7108.mo10452();
                while (j2 < this.f20630) {
                    byte[] bArr4 = c7123.f20665;
                    i = (int) ((((long) c7123.f20666) + j) - j2);
                    int i6 = c7123.f20667;
                    while (i < i6) {
                        byte b5 = bArr4[i];
                        for (byte b6 : bArrMo104522) {
                            if (b5 != b6) {
                            }
                        }
                        i++;
                    }
                    j2 += (long) (c7123.f20667 - c7123.f20666);
                    c7123 = c7123.f20670;
                    if (c7123 == null) {
                        C6635.m9822();
                        throw null;
                    }
                    j = j2;
                }
                return -1L;
            }
            c7123 = c7123.f20670;
            if (c7123 == null) {
                C6635.m9822();
                throw null;
            }
            j2 = j3;
        }
        return ((long) (i - i2)) + j2;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public C7103 mo10421(long j) {
        if (j == 0) {
            writeByte(48);
        } else {
            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)) + ((long) 3)) / ((long) 4));
            C7123 c7123M10423 = m10423(i);
            byte[] bArr = c7123M10423.f20665;
            int i2 = c7123M10423.f20667;
            for (int i3 = (i2 + i) - 1; i3 >= i2; i3--) {
                bArr[i3] = C7133.f20683[(int) (15 & j)];
                j >>>= 4;
            }
            c7123M10423.f20667 += i;
            this.f20630 += (long) i;
        }
        return this;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public C7103 mo10422(C7108 c7108) {
        if (c7108 != null) {
            c7108.mo10445(this, 0, c7108.mo10450());
            return this;
        }
        C6635.m9824("byteString");
        throw null;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ؠ */
    public /* bridge */ /* synthetic */ InterfaceC7106 mo10421(long j) {
        mo10421(j);
        return this;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ؠ */
    public /* bridge */ /* synthetic */ InterfaceC7106 mo10422(C7108 c7108) {
        mo10422(c7108);
        return this;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final C7123 m10423(int i) {
        if (!(i >= 1 && i <= 8192)) {
            throw new IllegalArgumentException("unexpected capacity".toString());
        }
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            C7123 c7123M10479 = C7125.f20674.m10479();
            this.f20629 = c7123M10479;
            c7123M10479.f20671 = c7123M10479;
            c7123M10479.f20670 = c7123M10479;
            return c7123M10479;
        }
        if (c7123 == null) {
            C6635.m9822();
            throw null;
        }
        C7123 c71232 = c7123.f20671;
        if (c71232 == null) {
            C6635.m9822();
            throw null;
        }
        if (c71232.f20667 + i <= 8192 && c71232.f20669) {
            return c71232;
        }
        C7123 c7123M104792 = C7125.f20674.m10479();
        c71232.m10476(c7123M104792);
        return c7123M104792;
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public long mo10424(C7108 c7108) {
        if (c7108 != null) {
            return m10420(c7108, 0L);
        }
        C6635.m9824("targetBytes");
        throw null;
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public C7103 m10425(int i) {
        String str;
        if (i < 128) {
            writeByte(i);
        } else if (i < 2048) {
            C7123 c7123M10423 = m10423(2);
            byte[] bArr = c7123M10423.f20665;
            int i2 = c7123M10423.f20667;
            bArr[i2] = (byte) ((i >> 6) | 192);
            bArr[i2 + 1] = (byte) ((i & 63) | 128);
            c7123M10423.f20667 = i2 + 2;
            this.f20630 += 2;
        } else if (55296 <= i && 57343 >= i) {
            writeByte(63);
        } else if (i < 65536) {
            C7123 c7123M104232 = m10423(3);
            byte[] bArr2 = c7123M104232.f20665;
            int i3 = c7123M104232.f20667;
            bArr2[i3] = (byte) ((i >> 12) | 224);
            bArr2[i3 + 1] = (byte) (((i >> 6) & 63) | 128);
            bArr2[i3 + 2] = (byte) ((i & 63) | 128);
            c7123M104232.f20667 = i3 + 3;
            this.f20630 += 3;
        } else {
            if (i > 1114111) {
                StringBuilder sbM4889 = C2803.m4889("Unexpected code point: 0x");
                if (i != 0) {
                    char[] cArr = C7134.f20684;
                    int i4 = 0;
                    char[] cArr2 = {cArr[(i >> 28) & 15], cArr[(i >> 24) & 15], cArr[(i >> 20) & 15], cArr[(i >> 16) & 15], cArr[(i >> 12) & 15], cArr[(i >> 8) & 15], cArr[(i >> 4) & 15], cArr[i & 15]};
                    while (i4 < 8 && cArr2[i4] == '0') {
                        i4++;
                    }
                    str = new String(cArr2, i4, 8 - i4);
                } else {
                    str = "0";
                }
                sbM4889.append(str);
                throw new IllegalArgumentException(sbM4889.toString());
            }
            C7123 c7123M104233 = m10423(4);
            byte[] bArr3 = c7123M104233.f20665;
            int i5 = c7123M104233.f20667;
            bArr3[i5] = (byte) ((i >> 18) | 240);
            bArr3[i5 + 1] = (byte) (((i >> 12) & 63) | 128);
            bArr3[i5 + 2] = (byte) (((i >> 6) & 63) | 128);
            bArr3[i5 + 3] = (byte) ((i & 63) | 128);
            c7123M104233.f20667 = i5 + 4;
            this.f20630 += 4;
        }
        return this;
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public C7108 m10426() {
        return mo10427(this.f20630);
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public C7108 mo10427(long j) throws EOFException {
        if (!(j >= 0 && j <= ((long) Integer.MAX_VALUE))) {
            throw new IllegalArgumentException(C2803.m4874("byteCount: ", j).toString());
        }
        if (this.f20630 < j) {
            throw new EOFException();
        }
        if (j < 4096) {
            return new C7108(mo10429(j));
        }
        C7108 c7108M10417 = m10417((int) j);
        skip(j);
        return c7108M10417;
    }

    @Override // p461.InterfaceC7129
    /* JADX INFO: renamed from: ށ */
    public C7130 mo10277() {
        return C7130.f20679;
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public boolean mo10428(long j) {
        return this.f20630 >= j;
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public byte[] mo10429(long j) throws EOFException {
        int i = 0;
        if (!(j >= 0 && j <= ((long) Integer.MAX_VALUE))) {
            throw new IllegalArgumentException(C2803.m4874("byteCount: ", j).toString());
        }
        if (this.f20630 < j) {
            throw new EOFException();
        }
        int i2 = (int) j;
        byte[] bArr = new byte[i2];
        while (i < i2) {
            int iM10405 = m10405(bArr, i, i2 - i);
            if (iM10405 == -1) {
                throw new EOFException();
            }
            i += iM10405;
        }
        return bArr;
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public String mo10430(long j) throws EOFException {
        if (!(j >= 0)) {
            throw new IllegalArgumentException(C2803.m4874("limit < 0: ", j).toString());
        }
        long j2 = j != Long.MAX_VALUE ? j + 1 : Long.MAX_VALUE;
        byte b = (byte) 10;
        long jM10406 = m10406(b, 0L, j2);
        if (jM10406 != -1) {
            return C7133.m10484(this, jM10406);
        }
        if (j2 < this.f20630 && m10433(j2 - 1) == ((byte) 13) && m10433(j2) == b) {
            return C7133.m10484(this, j2);
        }
        C7103 c7103 = new C7103();
        m10416(c7103, 0L, Math.min(32, this.f20630));
        throw new EOFException("\\n not found: limit=" + Math.min(this.f20630, j) + " content=" + c7103.m10426().mo10451() + (char) 8230);
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public void mo10431(long j) throws EOFException {
        if (this.f20630 < j) {
            throw new EOFException();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:13:0x0027  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x006c  */
    /* JADX WARN: Removed duplicated region for block: B:67:0x00e6  */
    /* JADX WARN: Removed duplicated region for block: B:71:0x00f5 A[LOOP:0: B:69:0x00f1->B:71:0x00f5, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:73:0x0105  */
    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public C7103 mo10432(long j) {
        if (j == 0) {
            writeByte(48);
        } else {
            boolean z = false;
            int i = 1;
            if (j < 0) {
                j = -j;
                if (j < 0) {
                    mo10414("-9223372036854775808");
                } else {
                    z = true;
                    if (j < 100000000) {
                        i = j < 1000000000000L ? j < 10000000000L ? 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;
                    } else if (j >= 10000) {
                        i = j < 1000000 ? j < 100000 ? 5 : 6 : j < 10000000 ? 7 : 8;
                    } else if (j >= 100) {
                        i = j < 1000 ? 3 : 4;
                    } else if (j >= 10) {
                        i = 2;
                    }
                    if (z) {
                        i++;
                    }
                    C7123 c7123M10423 = m10423(i);
                    byte[] bArr = c7123M10423.f20665;
                    int i2 = c7123M10423.f20667 + i;
                    while (j != 0) {
                        long j2 = 10;
                        i2--;
                        bArr[i2] = C7133.f20683[(int) (j % j2)];
                        j /= j2;
                    }
                    if (z) {
                        bArr[i2 - 1] = (byte) 45;
                    }
                    c7123M10423.f20667 += i;
                    this.f20630 += (long) i;
                }
            } else {
                if (j < 100000000) {
                }
                if (z) {
                }
                C7123 c7123M104232 = m10423(i);
                byte[] bArr2 = c7123M104232.f20665;
                int i22 = c7123M104232.f20667 + i;
                while (j != 0) {
                }
                if (z) {
                }
                c7123M104232.f20667 += i;
                this.f20630 += (long) i;
            }
        }
        return this;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ޅ */
    public /* bridge */ /* synthetic */ InterfaceC7106 mo10432(long j) {
        mo10432(j);
        return this;
    }

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final byte m10433(long j) {
        C4303.m7086(this.f20630, j, 1L);
        C7123 c7123 = this.f20629;
        if (c7123 == null) {
            C6635.m9822();
            throw null;
        }
        long j2 = this.f20630;
        if (j2 - j < j) {
            while (j2 > j) {
                c7123 = c7123.f20671;
                if (c7123 == null) {
                    C6635.m9822();
                    throw null;
                }
                j2 -= (long) (c7123.f20667 - c7123.f20666);
            }
            return c7123.f20665[(int) ((((long) c7123.f20666) + j) - j2)];
        }
        long j3 = 0;
        while (true) {
            int i = c7123.f20667;
            int i2 = c7123.f20666;
            long j4 = ((long) (i - i2)) + j3;
            if (j4 > j) {
                return c7123.f20665[(int) ((((long) i2) + j) - j3)];
            }
            c7123 = c7123.f20670;
            if (c7123 == null) {
                C6635.m9822();
                throw null;
            }
            j3 = j4;
        }
    }

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public short m10434() {
        int i = readShort() & 65535;
        return (short) (((i & 255) << 8) | ((65280 & i) >>> 8));
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public String mo10435() {
        return mo10430(Long.MAX_VALUE);
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public boolean mo10436() {
        return this.f20630 == 0;
    }

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public String m10437() {
        return m10412(this.f20630, C6689.f19437);
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public String mo10438() {
        long jM10406 = m10406((byte) 10, 0L, Long.MAX_VALUE);
        if (jM10406 != -1) {
            return C7133.m10484(this, jM10406);
        }
        long j = this.f20630;
        if (j != 0) {
            return mo10411(j);
        }
        return null;
    }

    @Override // p461.InterfaceC7106
    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public OutputStream mo10439() {
        return new C7105();
    }

    /* JADX WARN: Removed duplicated region for block: B:35:0x00a6  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x00b2  */
    /* JADX WARN: Removed duplicated region for block: B:38:0x00b6  */
    /* JADX WARN: Removed duplicated region for block: B:49:0x00ba A[EDGE_INSN: B:49:0x00ba->B:40:0x00ba BREAK  A[LOOP:0: B:5:0x000e->B:51:?], SYNTHETIC] */
    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public long mo10440() throws EOFException {
        int i;
        if (this.f20630 == 0) {
            throw new EOFException();
        }
        int i2 = 0;
        boolean z = false;
        long j = 0;
        do {
            C7123 c7123 = this.f20629;
            if (c7123 == null) {
                C6635.m9822();
                throw null;
            }
            byte[] bArr = c7123.f20665;
            int i3 = c7123.f20666;
            int i4 = c7123.f20667;
            while (i3 < i4) {
                byte b = bArr[i3];
                byte b2 = (byte) 48;
                if (b < b2 || b > ((byte) 57)) {
                    byte b3 = (byte) 97;
                    if ((b >= b3 && b <= ((byte) 102)) || (b >= (b3 = (byte) 65) && b <= ((byte) 70))) {
                        i = (b - b3) + 10;
                    } else {
                        if (i2 == 0) {
                            StringBuilder sbM4889 = C2803.m4889("Expected leading [0-9a-fA-F] character but was 0x");
                            char[] cArr = C7134.f20684;
                            sbM4889.append(new String(new char[]{cArr[(b >> 4) & 15], cArr[b & 15]}));
                            throw new NumberFormatException(sbM4889.toString());
                        }
                        z = true;
                        if (i3 != i4) {
                            this.f20629 = c7123.m10475();
                            C7125.f20674.m10480(c7123);
                        } else {
                            c7123.f20666 = i3;
                        }
                        if (!z) {
                            break;
                        }
                    }
                } else {
                    i = b - b2;
                }
                if (((-1152921504606846976L) & j) != 0) {
                    C7103 c7103 = new C7103();
                    c7103.mo10421(j);
                    c7103.writeByte((int) b);
                    StringBuilder sbM48892 = C2803.m4889("Number too large: ");
                    sbM48892.append(c7103.m10437());
                    throw new NumberFormatException(sbM48892.toString());
                }
                j = (j << 4) | ((long) i);
                i3++;
                i2++;
            }
            if (i3 != i4) {
            }
            if (!z) {
            }
        } while (this.f20629 != null);
        this.f20630 -= (long) i2;
        return j;
    }

    @Override // p461.InterfaceC7107
    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public InputStream mo10441() {
        return new C7104();
    }
}
