Rabbit-R1/android (non root)/java/sources/okio/internal/ByteStringKt.java
2024-05-21 17:08:36 -04:00

535 lines
26 KiB
Java

package okio.internal;
import androidx.media3.exoplayer.upstream.CmcdHeadersFactory;
import com.google.common.base.Ascii;
import io.flutter.plugin.editing.SpellCheckPlugin;
import java.util.Arrays;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.ArraysKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import okio.Base64;
import okio.Buffer;
import okio.ByteString;
import okio.Platform;
import okio.Util;
/* compiled from: ByteString.kt */
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000P\n\u0000\n\u0002\u0010\u0019\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\f\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0005\n\u0002\b\u0018\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u0018\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\u0005H\u0002\u001a\u0011\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u0007H\u0080\b\u001a\u0010\u0010\f\u001a\u00020\u00052\u0006\u0010\r\u001a\u00020\u000eH\u0002\u001a\r\u0010\u000f\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a\r\u0010\u0011\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a\u0015\u0010\u0012\u001a\u00020\u0005*\u00020\n2\u0006\u0010\u0013\u001a\u00020\nH\u0080\b\u001a\u000f\u0010\u0014\u001a\u0004\u0018\u00010\n*\u00020\u0010H\u0080\b\u001a\r\u0010\u0015\u001a\u00020\n*\u00020\u0010H\u0080\b\u001a\r\u0010\u0016\u001a\u00020\n*\u00020\u0010H\u0080\b\u001a\u0015\u0010\u0017\u001a\u00020\u0018*\u00020\n2\u0006\u0010\u0019\u001a\u00020\u0007H\u0080\b\u001a\u0015\u0010\u0017\u001a\u00020\u0018*\u00020\n2\u0006\u0010\u0019\u001a\u00020\nH\u0080\b\u001a\u0017\u0010\u001a\u001a\u00020\u0018*\u00020\n2\b\u0010\u0013\u001a\u0004\u0018\u00010\u001bH\u0080\b\u001a\u0015\u0010\u001c\u001a\u00020\u001d*\u00020\n2\u0006\u0010\u001e\u001a\u00020\u0005H\u0080\b\u001a\r\u0010\u001f\u001a\u00020\u0005*\u00020\nH\u0080\b\u001a\r\u0010 \u001a\u00020\u0005*\u00020\nH\u0080\b\u001a\r\u0010!\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a\u001d\u0010\"\u001a\u00020\u0005*\u00020\n2\u0006\u0010\u0013\u001a\u00020\u00072\u0006\u0010#\u001a\u00020\u0005H\u0080\b\u001a\r\u0010$\u001a\u00020\u0007*\u00020\nH\u0080\b\u001a\u001d\u0010%\u001a\u00020\u0005*\u00020\n2\u0006\u0010\u0013\u001a\u00020\u00072\u0006\u0010#\u001a\u00020\u0005H\u0080\b\u001a\u001d\u0010%\u001a\u00020\u0005*\u00020\n2\u0006\u0010\u0013\u001a\u00020\n2\u0006\u0010#\u001a\u00020\u0005H\u0080\b\u001a-\u0010&\u001a\u00020\u0018*\u00020\n2\u0006\u0010'\u001a\u00020\u00052\u0006\u0010\u0013\u001a\u00020\u00072\u0006\u0010(\u001a\u00020\u00052\u0006\u0010)\u001a\u00020\u0005H\u0080\b\u001a-\u0010&\u001a\u00020\u0018*\u00020\n2\u0006\u0010'\u001a\u00020\u00052\u0006\u0010\u0013\u001a\u00020\n2\u0006\u0010(\u001a\u00020\u00052\u0006\u0010)\u001a\u00020\u0005H\u0080\b\u001a\u0015\u0010*\u001a\u00020\u0018*\u00020\n2\u0006\u0010+\u001a\u00020\u0007H\u0080\b\u001a\u0015\u0010*\u001a\u00020\u0018*\u00020\n2\u0006\u0010+\u001a\u00020\nH\u0080\b\u001a\u001d\u0010,\u001a\u00020\n*\u00020\n2\u0006\u0010-\u001a\u00020\u00052\u0006\u0010.\u001a\u00020\u0005H\u0080\b\u001a\r\u0010/\u001a\u00020\n*\u00020\nH\u0080\b\u001a\r\u00100\u001a\u00020\n*\u00020\nH\u0080\b\u001a\r\u00101\u001a\u00020\u0007*\u00020\nH\u0080\b\u001a\u001d\u00102\u001a\u00020\n*\u00020\u00072\u0006\u0010'\u001a\u00020\u00052\u0006\u0010)\u001a\u00020\u0005H\u0080\b\u001a\r\u00103\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a\r\u00104\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a$\u00105\u001a\u000206*\u00020\n2\u0006\u00107\u001a\u0002082\u0006\u0010'\u001a\u00020\u00052\u0006\u0010)\u001a\u00020\u0005H\u0000\"\u0014\u0010\u0000\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0003¨\u00069"}, d2 = {"HEX_DIGIT_CHARS", "", "getHEX_DIGIT_CHARS", "()[C", "codePointIndexToCharIndex", "", CmcdHeadersFactory.STREAMING_FORMAT_SS, "", "codePointCount", "commonOf", "Lokio/ByteString;", "data", "decodeHexDigit", "c", "", "commonBase64", "", "commonBase64Url", "commonCompareTo", "other", "commonDecodeBase64", "commonDecodeHex", "commonEncodeUtf8", "commonEndsWith", "", "suffix", "commonEquals", "", "commonGetByte", "", "pos", "commonGetSize", "commonHashCode", "commonHex", "commonIndexOf", "fromIndex", "commonInternalArray", "commonLastIndexOf", "commonRangeEquals", "offset", "otherOffset", "byteCount", "commonStartsWith", "prefix", "commonSubstring", "beginIndex", SpellCheckPlugin.END_INDEX_KEY, "commonToAsciiLowercase", "commonToAsciiUppercase", "commonToByteArray", "commonToByteString", "commonToString", "commonUtf8", "commonWrite", "", "buffer", "Lokio/Buffer;", "okio"}, k = 2, mv = {1, 4, 0})
/* loaded from: classes3.dex */
public final class ByteStringKt {
private static final char[] HEX_DIGIT_CHARS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
public static final char[] getHEX_DIGIT_CHARS() {
return HEX_DIGIT_CHARS;
}
public static final String commonUtf8(ByteString commonUtf8) {
Intrinsics.checkNotNullParameter(commonUtf8, "$this$commonUtf8");
String utf8 = commonUtf8.getUtf8();
if (utf8 != null) {
return utf8;
}
String utf8String = Platform.toUtf8String(commonUtf8.internalArray$okio());
commonUtf8.setUtf8$okio(utf8String);
return utf8String;
}
public static final String commonBase64(ByteString commonBase64) {
Intrinsics.checkNotNullParameter(commonBase64, "$this$commonBase64");
return Base64.encodeBase64$default(commonBase64.getData(), null, 1, null);
}
public static final String commonBase64Url(ByteString commonBase64Url) {
Intrinsics.checkNotNullParameter(commonBase64Url, "$this$commonBase64Url");
return Base64.encodeBase64(commonBase64Url.getData(), Base64.getBASE64_URL_SAFE());
}
public static final String commonHex(ByteString commonHex) {
Intrinsics.checkNotNullParameter(commonHex, "$this$commonHex");
char[] cArr = new char[commonHex.getData().length * 2];
int i = 0;
for (byte b : commonHex.getData()) {
int i2 = i + 1;
cArr[i] = getHEX_DIGIT_CHARS()[(b >> 4) & 15];
i += 2;
cArr[i2] = getHEX_DIGIT_CHARS()[b & Ascii.SI];
}
return new String(cArr);
}
public static final ByteString commonToAsciiLowercase(ByteString commonToAsciiLowercase) {
byte b;
Intrinsics.checkNotNullParameter(commonToAsciiLowercase, "$this$commonToAsciiLowercase");
for (int i = 0; i < commonToAsciiLowercase.getData().length; i++) {
byte b2 = commonToAsciiLowercase.getData()[i];
byte b3 = (byte) 65;
if (b2 >= b3 && b2 <= (b = (byte) 90)) {
byte[] data = commonToAsciiLowercase.getData();
byte[] copyOf = Arrays.copyOf(data, data.length);
Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
copyOf[i] = (byte) (b2 + 32);
for (int i2 = i + 1; i2 < copyOf.length; i2++) {
byte b4 = copyOf[i2];
if (b4 >= b3 && b4 <= b) {
copyOf[i2] = (byte) (b4 + 32);
}
}
return new ByteString(copyOf);
}
}
return commonToAsciiLowercase;
}
public static final ByteString commonToAsciiUppercase(ByteString commonToAsciiUppercase) {
byte b;
Intrinsics.checkNotNullParameter(commonToAsciiUppercase, "$this$commonToAsciiUppercase");
for (int i = 0; i < commonToAsciiUppercase.getData().length; i++) {
byte b2 = commonToAsciiUppercase.getData()[i];
byte b3 = (byte) 97;
if (b2 >= b3 && b2 <= (b = (byte) 122)) {
byte[] data = commonToAsciiUppercase.getData();
byte[] copyOf = Arrays.copyOf(data, data.length);
Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
copyOf[i] = (byte) (b2 - 32);
for (int i2 = i + 1; i2 < copyOf.length; i2++) {
byte b4 = copyOf[i2];
if (b4 >= b3 && b4 <= b) {
copyOf[i2] = (byte) (b4 - 32);
}
}
return new ByteString(copyOf);
}
}
return commonToAsciiUppercase;
}
public static final ByteString commonSubstring(ByteString commonSubstring, int i, int i2) {
Intrinsics.checkNotNullParameter(commonSubstring, "$this$commonSubstring");
if (!(i >= 0)) {
throw new IllegalArgumentException("beginIndex < 0".toString());
}
if (!(i2 <= commonSubstring.getData().length)) {
throw new IllegalArgumentException(("endIndex > length(" + commonSubstring.getData().length + ')').toString());
}
if (i2 - i >= 0) {
return (i == 0 && i2 == commonSubstring.getData().length) ? commonSubstring : new ByteString(ArraysKt.copyOfRange(commonSubstring.getData(), i, i2));
}
throw new IllegalArgumentException("endIndex < beginIndex".toString());
}
public static final byte commonGetByte(ByteString commonGetByte, int i) {
Intrinsics.checkNotNullParameter(commonGetByte, "$this$commonGetByte");
return commonGetByte.getData()[i];
}
public static final int commonGetSize(ByteString commonGetSize) {
Intrinsics.checkNotNullParameter(commonGetSize, "$this$commonGetSize");
return commonGetSize.getData().length;
}
public static final byte[] commonToByteArray(ByteString commonToByteArray) {
Intrinsics.checkNotNullParameter(commonToByteArray, "$this$commonToByteArray");
byte[] data = commonToByteArray.getData();
byte[] copyOf = Arrays.copyOf(data, data.length);
Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
return copyOf;
}
public static final byte[] commonInternalArray(ByteString commonInternalArray) {
Intrinsics.checkNotNullParameter(commonInternalArray, "$this$commonInternalArray");
return commonInternalArray.getData();
}
public static final boolean commonRangeEquals(ByteString commonRangeEquals, int i, ByteString other, int i2, int i3) {
Intrinsics.checkNotNullParameter(commonRangeEquals, "$this$commonRangeEquals");
Intrinsics.checkNotNullParameter(other, "other");
return other.rangeEquals(i2, commonRangeEquals.getData(), i, i3);
}
public static final boolean commonRangeEquals(ByteString commonRangeEquals, int i, byte[] other, int i2, int i3) {
Intrinsics.checkNotNullParameter(commonRangeEquals, "$this$commonRangeEquals");
Intrinsics.checkNotNullParameter(other, "other");
return i >= 0 && i <= commonRangeEquals.getData().length - i3 && i2 >= 0 && i2 <= other.length - i3 && Util.arrayRangeEquals(commonRangeEquals.getData(), i, other, i2, i3);
}
public static final boolean commonStartsWith(ByteString commonStartsWith, ByteString prefix) {
Intrinsics.checkNotNullParameter(commonStartsWith, "$this$commonStartsWith");
Intrinsics.checkNotNullParameter(prefix, "prefix");
return commonStartsWith.rangeEquals(0, prefix, 0, prefix.size());
}
public static final boolean commonStartsWith(ByteString commonStartsWith, byte[] prefix) {
Intrinsics.checkNotNullParameter(commonStartsWith, "$this$commonStartsWith");
Intrinsics.checkNotNullParameter(prefix, "prefix");
return commonStartsWith.rangeEquals(0, prefix, 0, prefix.length);
}
public static final boolean commonEndsWith(ByteString commonEndsWith, ByteString suffix) {
Intrinsics.checkNotNullParameter(commonEndsWith, "$this$commonEndsWith");
Intrinsics.checkNotNullParameter(suffix, "suffix");
return commonEndsWith.rangeEquals(commonEndsWith.size() - suffix.size(), suffix, 0, suffix.size());
}
public static final boolean commonEndsWith(ByteString commonEndsWith, byte[] suffix) {
Intrinsics.checkNotNullParameter(commonEndsWith, "$this$commonEndsWith");
Intrinsics.checkNotNullParameter(suffix, "suffix");
return commonEndsWith.rangeEquals(commonEndsWith.size() - suffix.length, suffix, 0, suffix.length);
}
public static final int commonIndexOf(ByteString commonIndexOf, byte[] other, int i) {
Intrinsics.checkNotNullParameter(commonIndexOf, "$this$commonIndexOf");
Intrinsics.checkNotNullParameter(other, "other");
int length = commonIndexOf.getData().length - other.length;
int max = Math.max(i, 0);
if (max > length) {
return -1;
}
while (!Util.arrayRangeEquals(commonIndexOf.getData(), max, other, 0, other.length)) {
if (max == length) {
return -1;
}
max++;
}
return max;
}
public static final int commonLastIndexOf(ByteString commonLastIndexOf, ByteString other, int i) {
Intrinsics.checkNotNullParameter(commonLastIndexOf, "$this$commonLastIndexOf");
Intrinsics.checkNotNullParameter(other, "other");
return commonLastIndexOf.lastIndexOf(other.internalArray$okio(), i);
}
public static final int commonLastIndexOf(ByteString commonLastIndexOf, byte[] other, int i) {
Intrinsics.checkNotNullParameter(commonLastIndexOf, "$this$commonLastIndexOf");
Intrinsics.checkNotNullParameter(other, "other");
for (int min = Math.min(i, commonLastIndexOf.getData().length - other.length); min >= 0; min--) {
if (Util.arrayRangeEquals(commonLastIndexOf.getData(), min, other, 0, other.length)) {
return min;
}
}
return -1;
}
public static final boolean commonEquals(ByteString commonEquals, Object obj) {
Intrinsics.checkNotNullParameter(commonEquals, "$this$commonEquals");
if (obj == commonEquals) {
return true;
}
if (obj instanceof ByteString) {
ByteString byteString = (ByteString) obj;
if (byteString.size() == commonEquals.getData().length && byteString.rangeEquals(0, commonEquals.getData(), 0, commonEquals.getData().length)) {
return true;
}
}
return false;
}
public static final int commonHashCode(ByteString commonHashCode) {
Intrinsics.checkNotNullParameter(commonHashCode, "$this$commonHashCode");
int hashCode = commonHashCode.getHashCode();
if (hashCode != 0) {
return hashCode;
}
int hashCode2 = Arrays.hashCode(commonHashCode.getData());
commonHashCode.setHashCode$okio(hashCode2);
return hashCode2;
}
public static final int commonCompareTo(ByteString commonCompareTo, ByteString other) {
Intrinsics.checkNotNullParameter(commonCompareTo, "$this$commonCompareTo");
Intrinsics.checkNotNullParameter(other, "other");
int size = commonCompareTo.size();
int size2 = other.size();
int min = Math.min(size, size2);
for (int i = 0; i < min; i++) {
int i2 = commonCompareTo.getByte(i) & 255;
int i3 = other.getByte(i) & 255;
if (i2 != i3) {
return i2 < i3 ? -1 : 1;
}
}
if (size == size2) {
return 0;
}
return size < size2 ? -1 : 1;
}
public static final ByteString commonOf(byte[] data) {
Intrinsics.checkNotNullParameter(data, "data");
byte[] copyOf = Arrays.copyOf(data, data.length);
Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
return new ByteString(copyOf);
}
public static final ByteString commonToByteString(byte[] commonToByteString, int i, int i2) {
Intrinsics.checkNotNullParameter(commonToByteString, "$this$commonToByteString");
Util.checkOffsetAndCount(commonToByteString.length, i, i2);
return new ByteString(ArraysKt.copyOfRange(commonToByteString, i, i2 + i));
}
public static final ByteString commonEncodeUtf8(String commonEncodeUtf8) {
Intrinsics.checkNotNullParameter(commonEncodeUtf8, "$this$commonEncodeUtf8");
ByteString byteString = new ByteString(Platform.asUtf8ToByteArray(commonEncodeUtf8));
byteString.setUtf8$okio(commonEncodeUtf8);
return byteString;
}
public static final ByteString commonDecodeBase64(String commonDecodeBase64) {
Intrinsics.checkNotNullParameter(commonDecodeBase64, "$this$commonDecodeBase64");
byte[] decodeBase64ToArray = Base64.decodeBase64ToArray(commonDecodeBase64);
if (decodeBase64ToArray != null) {
return new ByteString(decodeBase64ToArray);
}
return null;
}
public static final ByteString commonDecodeHex(String commonDecodeHex) {
Intrinsics.checkNotNullParameter(commonDecodeHex, "$this$commonDecodeHex");
if (!(commonDecodeHex.length() % 2 == 0)) {
throw new IllegalArgumentException(("Unexpected hex string: " + commonDecodeHex).toString());
}
int length = commonDecodeHex.length() / 2;
byte[] bArr = new byte[length];
for (int i = 0; i < length; i++) {
int i2 = i * 2;
bArr[i] = (byte) ((decodeHexDigit(commonDecodeHex.charAt(i2)) << 4) + decodeHexDigit(commonDecodeHex.charAt(i2 + 1)));
}
return new ByteString(bArr);
}
public static final void commonWrite(ByteString commonWrite, Buffer buffer, int i, int i2) {
Intrinsics.checkNotNullParameter(commonWrite, "$this$commonWrite");
Intrinsics.checkNotNullParameter(buffer, "buffer");
buffer.write(commonWrite.getData(), i, i2);
}
public static final int decodeHexDigit(char c) {
if ('0' <= c && '9' >= c) {
return c - '0';
}
if ('a' <= c && 'f' >= c) {
return c - 'W';
}
if ('A' > c || 'F' < c) {
throw new IllegalArgumentException("Unexpected hex digit: " + c);
}
return c - '7';
}
public static final String commonToString(ByteString byteString) {
ByteString commonToString = byteString;
Intrinsics.checkNotNullParameter(commonToString, "$this$commonToString");
if (byteString.getData().length == 0) {
return "[size=0]";
}
int codePointIndexToCharIndex = codePointIndexToCharIndex(byteString.getData(), 64);
if (codePointIndexToCharIndex == -1) {
if (byteString.getData().length <= 64) {
return "[hex=" + byteString.hex() + ']';
}
StringBuilder append = new StringBuilder("[size=").append(byteString.getData().length).append(" hex=");
if (!(64 <= byteString.getData().length)) {
throw new IllegalArgumentException(("endIndex > length(" + byteString.getData().length + ')').toString());
}
if (64 != byteString.getData().length) {
commonToString = new ByteString(ArraysKt.copyOfRange(byteString.getData(), 0, 64));
}
return append.append(commonToString.hex()).append("…]").toString();
}
String utf8 = byteString.utf8();
if (utf8 != null) {
String substring = utf8.substring(0, codePointIndexToCharIndex);
Intrinsics.checkNotNullExpressionValue(substring, "(this as java.lang.Strin…ing(startIndex, endIndex)");
String replace$default = StringsKt.replace$default(StringsKt.replace$default(StringsKt.replace$default(substring, "\\", "\\\\", false, 4, (Object) null), "\n", "\\n", false, 4, (Object) null), "\r", "\\r", false, 4, (Object) null);
if (codePointIndexToCharIndex < utf8.length()) {
return "[size=" + byteString.getData().length + " text=" + replace$default + "…]";
}
return "[text=" + replace$default + ']';
}
throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
}
public static final int codePointIndexToCharIndex(byte[] bArr, int i) {
byte b;
int i2;
int length = bArr.length;
int i3 = 0;
int i4 = 0;
int i5 = 0;
loop0: while (i3 < length) {
byte b2 = bArr[i3];
if (b2 >= 0) {
int i6 = i5 + 1;
if (i5 == i) {
return i4;
}
if ((b2 != 10 && b2 != 13 && ((b2 >= 0 && 31 >= b2) || (Byte.MAX_VALUE <= b2 && 159 >= b2))) || b2 == 65533) {
return -1;
}
i4 += b2 < 65536 ? 1 : 2;
i3++;
while (true) {
i5 = i6;
if (i3 < length && (b = bArr[i3]) >= 0) {
i3++;
i6 = i5 + 1;
if (i5 == i) {
return i4;
}
if ((b == 10 || b == 13 || ((b < 0 || 31 < b) && (Byte.MAX_VALUE > b || 159 < b))) && b != 65533) {
i4 += b < 65536 ? 1 : 2;
}
}
}
} else if ((b2 >> 5) == -2) {
int i7 = i3 + 1;
if (length <= i7) {
if (i5 == i) {
return i4;
}
return -1;
}
byte b3 = bArr[i7];
if ((b3 & 192) != 128) {
if (i5 == i) {
return i4;
}
return -1;
}
int i8 = (b2 << 6) ^ (b3 ^ 3968);
if (i8 < 128) {
if (i5 == i) {
return i4;
}
return -1;
}
int i9 = i5 + 1;
if (i5 == i) {
return i4;
}
if ((i8 != 10 && i8 != 13 && ((i8 >= 0 && 31 >= i8) || (127 <= i8 && 159 >= i8))) || i8 == 65533) {
return -1;
}
i4 += i8 < 65536 ? 1 : 2;
Unit unit = Unit.INSTANCE;
i3 += 2;
i5 = i9;
} else {
if ((b2 >> 4) == -2) {
int i10 = i3 + 2;
if (length <= i10) {
if (i5 == i) {
return i4;
}
return -1;
}
byte b4 = bArr[i3 + 1];
if ((b4 & 192) != 128) {
if (i5 == i) {
return i4;
}
return -1;
}
byte b5 = bArr[i10];
if ((b5 & 192) != 128) {
if (i5 == i) {
return i4;
}
return -1;
}
int i11 = (b2 << Ascii.FF) ^ ((b5 ^ (-123008)) ^ (b4 << 6));
if (i11 < 2048) {
if (i5 == i) {
return i4;
}
return -1;
}
if (55296 <= i11 && 57343 >= i11) {
if (i5 == i) {
return i4;
}
return -1;
}
i2 = i5 + 1;
if (i5 == i) {
return i4;
}
if ((i11 != 10 && i11 != 13 && ((i11 >= 0 && 31 >= i11) || (127 <= i11 && 159 >= i11))) || i11 == 65533) {
return -1;
}
i4 += i11 < 65536 ? 1 : 2;
Unit unit2 = Unit.INSTANCE;
i3 += 3;
} else {
if ((b2 >> 3) != -2) {
if (i5 == i) {
return i4;
}
return -1;
}
int i12 = i3 + 3;
if (length <= i12) {
if (i5 == i) {
return i4;
}
return -1;
}
byte b6 = bArr[i3 + 1];
if ((b6 & 192) != 128) {
if (i5 == i) {
return i4;
}
return -1;
}
byte b7 = bArr[i3 + 2];
if ((b7 & 192) != 128) {
if (i5 == i) {
return i4;
}
return -1;
}
byte b8 = bArr[i12];
if ((b8 & 192) != 128) {
if (i5 == i) {
return i4;
}
return -1;
}
int i13 = (b2 << Ascii.DC2) ^ (((b8 ^ 3678080) ^ (b7 << 6)) ^ (b6 << Ascii.FF));
if (i13 > 1114111) {
if (i5 == i) {
return i4;
}
return -1;
}
if (55296 <= i13 && 57343 >= i13) {
if (i5 == i) {
return i4;
}
return -1;
}
if (i13 < 65536) {
if (i5 == i) {
return i4;
}
return -1;
}
i2 = i5 + 1;
if (i5 == i) {
return i4;
}
if ((i13 != 10 && i13 != 13 && ((i13 >= 0 && 31 >= i13) || (127 <= i13 && 159 >= i13))) || i13 == 65533) {
return -1;
}
i4 += i13 < 65536 ? 1 : 2;
Unit unit3 = Unit.INSTANCE;
i3 += 4;
}
i5 = i2;
}
}
return i4;
}
}