package com.bytedance.android.livesdk.model;

import X.0SJ;
import X.0SP;
import X.0SQ;
import com.bytedance.android.live.base.model.ImageModel;
import com.bytedance.android.live.base.model._ImageModel_ProtoDecoder;
import com.bytedance.android.livesdk.model.FansClubData;
import com.bytedance.covode.number.Covode;
import java.util.HashMap;

public final class _FansClubData_UserBadge_ProtoDecoder implements 0SJ<FansClubData.UserBadge> {
    static {
        Covode.recordClassIndex(18914);
    }

    public final /* synthetic */ Object LIZIZ(0SP r2) {
        return LIZ(r2);
    }

    public static FansClubData.UserBadge LIZ(0SP r11) {
        FansClubData.UserBadge userBadge = new FansClubData.UserBadge();
        userBadge.icons = new HashMap();
        long LIZ = r11.LIZ();
        while (true) {
            int LIZIZ = r11.LIZIZ();
            if (LIZIZ == -1) {
                r11.LIZ(LIZ);
                return userBadge;
            } else if (LIZIZ == 1) {
                long LIZ2 = r11.LIZ();
                Integer num = null;
                ImageModel imageModel = null;
                while (true) {
                    int LIZIZ2 = r11.LIZIZ();
                    if (LIZIZ2 == -1) {
                        break;
                    } else if (LIZIZ2 == 1) {
                        num = Integer.valueOf(r11.LJ());
                    } else if (LIZIZ2 == 2) {
                        imageModel = _ImageModel_ProtoDecoder.LIZ(r11);
                    }
                }
                r11.LIZ(LIZ2);
                if (num == null) {
                    throw new IllegalStateException("Map key must not be null!");
                } else if (imageModel != null) {
                    userBadge.icons.put(num, imageModel);
                } else {
                    throw new IllegalStateException("Map value must not be null!");
                }
            } else if (LIZIZ != 2) {
                0SQ.LIZJ(r11);
            } else {
                userBadge.title = r11.LIZLLL();
            }
        }
    }
}
