package com.tencent.mm.plugin.game.d;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.bt.a;
import java.util.LinkedList;

public final class by extends a {
    public dg ncJ;
    public co ncK;
    public u ncL;

    public final int op(int i, Object... objArr) {
        AppMethodBeat.i(111632);
        int ix;
        if (i == 0) {
            e.a.a.c.a aVar = (e.a.a.c.a) objArr[0];
            if (this.ncJ != null) {
                aVar.iy(1, this.ncJ.computeSize());
                this.ncJ.writeFields(aVar);
            }
            if (this.ncK != null) {
                aVar.iy(2, this.ncK.computeSize());
                this.ncK.writeFields(aVar);
            }
            if (this.ncL != null) {
                aVar.iy(3, this.ncL.computeSize());
                this.ncL.writeFields(aVar);
            }
            AppMethodBeat.o(111632);
            return 0;
        } else if (i == 1) {
            if (this.ncJ != null) {
                ix = e.a.a.a.ix(1, this.ncJ.computeSize()) + 0;
            } else {
                ix = 0;
            }
            if (this.ncK != null) {
                ix += e.a.a.a.ix(2, this.ncK.computeSize());
            }
            if (this.ncL != null) {
                ix += e.a.a.a.ix(3, this.ncL.computeSize());
            }
            AppMethodBeat.o(111632);
            return ix;
        } else if (i == 2) {
            e.a.a.a.a aVar2 = new e.a.a.a.a((byte[]) objArr[0], unknownTagHandler);
            for (ix = a.getNextFieldNumber(aVar2); ix > 0; ix = a.getNextFieldNumber(aVar2)) {
                if (!super.populateBuilderWithField(aVar2, this, ix)) {
                    aVar2.ems();
                }
            }
            AppMethodBeat.o(111632);
            return 0;
        } else if (i == 3) {
            e.a.a.a.a aVar3 = (e.a.a.a.a) objArr[0];
            by byVar = (by) objArr[1];
            int intValue = ((Integer) objArr[2]).intValue();
            LinkedList Vh;
            int size;
            byte[] bArr;
            e.a.a.a.a aVar4;
            boolean z;
            switch (intValue) {
                case 1:
                    Vh = aVar3.Vh(intValue);
                    size = Vh.size();
                    for (intValue = 0; intValue < size; intValue++) {
                        bArr = (byte[]) Vh.get(intValue);
                        dg dgVar = new dg();
                        aVar4 = new e.a.a.a.a(bArr, unknownTagHandler);
                        for (z = true; z; z = dgVar.populateBuilderWithField(aVar4, dgVar, a.getNextFieldNumber(aVar4))) {
                        }
                        byVar.ncJ = dgVar;
                    }
                    AppMethodBeat.o(111632);
                    return 0;
                case 2:
                    Vh = aVar3.Vh(intValue);
                    size = Vh.size();
                    for (intValue = 0; intValue < size; intValue++) {
                        bArr = (byte[]) Vh.get(intValue);
                        co coVar = new co();
                        aVar4 = new e.a.a.a.a(bArr, unknownTagHandler);
                        for (z = true; z; z = coVar.populateBuilderWithField(aVar4, coVar, a.getNextFieldNumber(aVar4))) {
                        }
                        byVar.ncK = coVar;
                    }
                    AppMethodBeat.o(111632);
                    return 0;
                case 3:
                    Vh = aVar3.Vh(intValue);
                    size = Vh.size();
                    for (intValue = 0; intValue < size; intValue++) {
                        bArr = (byte[]) Vh.get(intValue);
                        u uVar = new u();
                        aVar4 = new e.a.a.a.a(bArr, unknownTagHandler);
                        for (z = true; z; z = uVar.populateBuilderWithField(aVar4, uVar, a.getNextFieldNumber(aVar4))) {
                        }
                        byVar.ncL = uVar;
                    }
                    AppMethodBeat.o(111632);
                    return 0;
                default:
                    AppMethodBeat.o(111632);
                    return -1;
            }
        } else {
            AppMethodBeat.o(111632);
            return -1;
        }
    }
}
