package nano;

import com.google.protobuf.nano.CodedInputByteBufferNano;
import com.google.protobuf.nano.CodedOutputByteBufferNano;
import com.google.protobuf.nano.InternalNano;
import com.google.protobuf.nano.InvalidProtocolBufferNanoException;
import com.google.protobuf.nano.MessageNano;
import com.google.protobuf.nano.WireFormatNano;
import java.io.IOException;

/* compiled from: TbsSdkJava */
public interface SetPrivateCodesRequest {

    /* compiled from: TbsSdkJava */
    public static final class SetPrivateCodes_Request extends MessageNano {

        private static volatile SetPrivateCodes_Request[] _emptyArray;

        public int[] add;

        private int bitField0_;

        public int[] codes;

        public int[] cut;

        private String token_;

        private int uid_;

        public SetPrivateCodes_Request() {
            clear();
        }

        public static SetPrivateCodes_Request[] emptyArray() {
            if (_emptyArray == null) {
                synchronized (InternalNano.LAZY_INIT_LOCK) {
                    try {
                        if (_emptyArray == null) {
                            _emptyArray = new SetPrivateCodes_Request[0];
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                }
            }
            return _emptyArray;
        }

        public static SetPrivateCodes_Request parseFrom(byte[] bArr) throws InvalidProtocolBufferNanoException {
            return (SetPrivateCodes_Request) MessageNano.mergeFrom(new SetPrivateCodes_Request(), bArr);
        }

        public SetPrivateCodes_Request clear() {
            this.bitField0_ = 0;
            this.uid_ = 0;
            this.token_ = "";
            int[] iArr = WireFormatNano.EMPTY_INT_ARRAY;
            this.codes = iArr;
            this.cut = iArr;
            this.add = iArr;
            this.cachedSize = -1;
            return this;
        }

        public SetPrivateCodes_Request clearToken() {
            this.token_ = "";
            this.bitField0_ &= -3;
            return this;
        }

        public SetPrivateCodes_Request clearUid() {
            this.uid_ = 0;
            this.bitField0_ &= -2;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int[] iArr;
            int[] iArr2;
            int computeSerializedSize = super.computeSerializedSize();
            if ((this.bitField0_ & 1) != 0) {
                computeSerializedSize += CodedOutputByteBufferNano.computeUInt32Size(1, this.uid_);
            }
            if ((this.bitField0_ & 2) != 0) {
                computeSerializedSize += CodedOutputByteBufferNano.computeStringSize(2, this.token_);
            }
            int[] iArr3 = this.codes;
            int i10 = 0;
            if (iArr3 != null && iArr3.length > 0) {
                int i11 = 0;
                int i12 = 0;
                while (true) {
                    iArr2 = this.codes;
                    if (i11 >= iArr2.length) {
                        break;
                    }
                    i12 += CodedOutputByteBufferNano.computeUInt32SizeNoTag(iArr2[i11]);
                    i11++;
                }
                computeSerializedSize = computeSerializedSize + i12 + iArr2.length;
            }
            int[] iArr4 = this.cut;
            if (iArr4 != null && iArr4.length > 0) {
                int i13 = 0;
                int i14 = 0;
                while (true) {
                    iArr = this.cut;
                    if (i13 >= iArr.length) {
                        break;
                    }
                    i14 += CodedOutputByteBufferNano.computeUInt32SizeNoTag(iArr[i13]);
                    i13++;
                }
                computeSerializedSize = computeSerializedSize + i14 + iArr.length;
            }
            int[] iArr5 = this.add;
            if (iArr5 == null || iArr5.length <= 0) {
                return computeSerializedSize;
            }
            int i15 = 0;
            while (true) {
                int[] iArr6 = this.add;
                if (i10 >= iArr6.length) {
                    return computeSerializedSize + i15 + iArr6.length;
                }
                i15 += CodedOutputByteBufferNano.computeUInt32SizeNoTag(iArr6[i10]);
                i10++;
            }
        }

        public String getToken() {
            return this.token_;
        }

        public int getUid() {
            return this.uid_;
        }

        public boolean hasToken() {
            if ((this.bitField0_ & 2) != 0) {
                return true;
            }
            return false;
        }

        public boolean hasUid() {
            if ((this.bitField0_ & 1) != 0) {
                return true;
            }
            return false;
        }

        public SetPrivateCodes_Request setToken(String str) {
            str.getClass();
            this.token_ = str;
            this.bitField0_ |= 2;
            return this;
        }

        public SetPrivateCodes_Request setUid(int i10) {
            this.uid_ = i10;
            this.bitField0_ |= 1;
            return this;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            if ((this.bitField0_ & 1) != 0) {
                codedOutputByteBufferNano.writeUInt32(1, this.uid_);
            }
            if ((this.bitField0_ & 2) != 0) {
                codedOutputByteBufferNano.writeString(2, this.token_);
            }
            int[] iArr = this.codes;
            int i10 = 0;
            if (iArr != null && iArr.length > 0) {
                int i11 = 0;
                while (true) {
                    int[] iArr2 = this.codes;
                    if (i11 >= iArr2.length) {
                        break;
                    }
                    codedOutputByteBufferNano.writeUInt32(3, iArr2[i11]);
                    i11++;
                }
            }
            int[] iArr3 = this.cut;
            if (iArr3 != null && iArr3.length > 0) {
                int i12 = 0;
                while (true) {
                    int[] iArr4 = this.cut;
                    if (i12 >= iArr4.length) {
                        break;
                    }
                    codedOutputByteBufferNano.writeUInt32(4, iArr4[i12]);
                    i12++;
                }
            }
            int[] iArr5 = this.add;
            if (iArr5 != null && iArr5.length > 0) {
                while (true) {
                    int[] iArr6 = this.add;
                    if (i10 >= iArr6.length) {
                        break;
                    }
                    codedOutputByteBufferNano.writeUInt32(5, iArr6[i10]);
                    i10++;
                }
            }
            super.writeTo(codedOutputByteBufferNano);
        }

        public static SetPrivateCodes_Request parseFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            return new SetPrivateCodes_Request().mergeFrom(codedInputByteBufferNano);
        }

        public SetPrivateCodes_Request mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            while (true) {
                int readTag = codedInputByteBufferNano.readTag();
                if (readTag == 0) {
                    return this;
                }
                if (readTag == 8) {
                    this.uid_ = codedInputByteBufferNano.readUInt32();
                    this.bitField0_ |= 1;
                } else if (readTag == 18) {
                    this.token_ = codedInputByteBufferNano.readString();
                    this.bitField0_ |= 2;
                } else if (readTag == 24) {
                    int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 24);
                    int[] iArr = this.codes;
                    int length = iArr == null ? 0 : iArr.length;
                    int i10 = repeatedFieldArrayLength + length;
                    int[] iArr2 = new int[i10];
                    if (length != 0) {
                        System.arraycopy(iArr, 0, iArr2, 0, length);
                    }
                    while (length < i10 - 1) {
                        iArr2[length] = codedInputByteBufferNano.readUInt32();
                        codedInputByteBufferNano.readTag();
                        length++;
                    }
                    iArr2[length] = codedInputByteBufferNano.readUInt32();
                    this.codes = iArr2;
                } else if (readTag == 26) {
                    int pushLimit = codedInputByteBufferNano.pushLimit(codedInputByteBufferNano.readRawVarint32());
                    int position = codedInputByteBufferNano.getPosition();
                    int i11 = 0;
                    while (codedInputByteBufferNano.getBytesUntilLimit() > 0) {
                        codedInputByteBufferNano.readUInt32();
                        i11++;
                    }
                    codedInputByteBufferNano.rewindToPosition(position);
                    int[] iArr3 = this.codes;
                    int length2 = iArr3 == null ? 0 : iArr3.length;
                    int i12 = i11 + length2;
                    int[] iArr4 = new int[i12];
                    if (length2 != 0) {
                        System.arraycopy(iArr3, 0, iArr4, 0, length2);
                    }
                    while (length2 < i12) {
                        iArr4[length2] = codedInputByteBufferNano.readUInt32();
                        length2++;
                    }
                    this.codes = iArr4;
                    codedInputByteBufferNano.popLimit(pushLimit);
                } else if (readTag == 32) {
                    int repeatedFieldArrayLength2 = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 32);
                    int[] iArr5 = this.cut;
                    int length3 = iArr5 == null ? 0 : iArr5.length;
                    int i13 = repeatedFieldArrayLength2 + length3;
                    int[] iArr6 = new int[i13];
                    if (length3 != 0) {
                        System.arraycopy(iArr5, 0, iArr6, 0, length3);
                    }
                    while (length3 < i13 - 1) {
                        iArr6[length3] = codedInputByteBufferNano.readUInt32();
                        codedInputByteBufferNano.readTag();
                        length3++;
                    }
                    iArr6[length3] = codedInputByteBufferNano.readUInt32();
                    this.cut = iArr6;
                } else if (readTag == 34) {
                    int pushLimit2 = codedInputByteBufferNano.pushLimit(codedInputByteBufferNano.readRawVarint32());
                    int position2 = codedInputByteBufferNano.getPosition();
                    int i14 = 0;
                    while (codedInputByteBufferNano.getBytesUntilLimit() > 0) {
                        codedInputByteBufferNano.readUInt32();
                        i14++;
                    }
                    codedInputByteBufferNano.rewindToPosition(position2);
                    int[] iArr7 = this.cut;
                    int length4 = iArr7 == null ? 0 : iArr7.length;
                    int i15 = i14 + length4;
                    int[] iArr8 = new int[i15];
                    if (length4 != 0) {
                        System.arraycopy(iArr7, 0, iArr8, 0, length4);
                    }
                    while (length4 < i15) {
                        iArr8[length4] = codedInputByteBufferNano.readUInt32();
                        length4++;
                    }
                    this.cut = iArr8;
                    codedInputByteBufferNano.popLimit(pushLimit2);
                } else if (readTag == 40) {
                    int repeatedFieldArrayLength3 = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 40);
                    int[] iArr9 = this.add;
                    int length5 = iArr9 == null ? 0 : iArr9.length;
                    int i16 = repeatedFieldArrayLength3 + length5;
                    int[] iArr10 = new int[i16];
                    if (length5 != 0) {
                        System.arraycopy(iArr9, 0, iArr10, 0, length5);
                    }
                    while (length5 < i16 - 1) {
                        iArr10[length5] = codedInputByteBufferNano.readUInt32();
                        codedInputByteBufferNano.readTag();
                        length5++;
                    }
                    iArr10[length5] = codedInputByteBufferNano.readUInt32();
                    this.add = iArr10;
                } else if (readTag == 42) {
                    int pushLimit3 = codedInputByteBufferNano.pushLimit(codedInputByteBufferNano.readRawVarint32());
                    int position3 = codedInputByteBufferNano.getPosition();
                    int i17 = 0;
                    while (codedInputByteBufferNano.getBytesUntilLimit() > 0) {
                        codedInputByteBufferNano.readUInt32();
                        i17++;
                    }
                    codedInputByteBufferNano.rewindToPosition(position3);
                    int[] iArr11 = this.add;
                    int length6 = iArr11 == null ? 0 : iArr11.length;
                    int i18 = i17 + length6;
                    int[] iArr12 = new int[i18];
                    if (length6 != 0) {
                        System.arraycopy(iArr11, 0, iArr12, 0, length6);
                    }
                    while (length6 < i18) {
                        iArr12[length6] = codedInputByteBufferNano.readUInt32();
                        length6++;
                    }
                    this.add = iArr12;
                    codedInputByteBufferNano.popLimit(pushLimit3);
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
