static int replaygain_export(AVStream *st,

                             const uint8_t *track_gain, const uint8_t *track_peak,

                             const uint8_t *album_gain, const uint8_t *album_peak)

{

    AVPacketSideData *sd, *tmp;

    AVReplayGain *replaygain;

    uint8_t *data;

    int32_t tg, ag;

    uint32_t tp, ap;



    tg = parse_gain(track_gain);

    ag = parse_gain(album_gain);

    tp = parse_peak(track_peak);

    ap = parse_peak(album_peak);



    if (tg == INT32_MIN && ag == INT32_MIN)

        return 0;



    replaygain = av_mallocz(sizeof(*replaygain));

    if (!replaygain)

        return AVERROR(ENOMEM);



    tmp = av_realloc_array(st->side_data, st->nb_side_data + 1, sizeof(*tmp));

    if (!tmp) {

        av_freep(&replaygain);

        return AVERROR(ENOMEM);

    }

    st->side_data = tmp;

    st->nb_side_data++;



    sd = &st->side_data[st->nb_side_data - 1];

    sd->type = AV_PKT_DATA_REPLAYGAIN;

    sd->data = (uint8_t*)replaygain;

    sd->size = sizeof(*replaygain);



    replaygain->track_gain = tg;

    replaygain->track_peak = tp;

    replaygain->album_gain = ag;

    replaygain->album_peak = ap;



    return 0;

}

static int replaygain_export(AVStream *st,

                             const uint8_t *track_gain, const uint8_t *track_peak,

                             const uint8_t *album_gain, const uint8_t *album_peak)

{

    AVPacketSideData *sd, *tmp;

    AVReplayGain *replaygain;

    uint8_t *data;

    int32_t tg, ag;

    uint32_t tp, ap;



    tg = parse_gain(track_gain);

    ag = parse_gain(album_gain);

    tp = parse_peak(track_peak);

    ap = parse_peak(album_peak);



    if (tg == INT32_MIN && ag == INT32_MIN)

        return 0;



    replaygain = av_mallocz(sizeof(*replaygain));

    if (!replaygain)

        return AVERROR(ENOMEM);



    tmp = av_realloc_array(st->side_data, st->nb_side_data + 1, sizeof(*tmp));

    if (!tmp) {

        av_freep(&replaygain);

        return AVERROR(ENOMEM);

    }

    st->side_data = tmp;

    st->nb_side_data++;



    sd = &st->side_data[st->nb_side_data - 1];

    sd->type = AV_PKT_DATA_REPLAYGAIN;

    sd->data = (uint8_t*)replaygain;

    sd->size = sizeof(*replaygain);



    replaygain->track_gain = tg;

    replaygain->track_peak = tp;

    replaygain->album_gain = ag;

    replaygain->album_peak = ap;



    return 0;

}

        return 0;         return 0;     tg = parse_gain(track_gain);     ag = parse_gain(album_gain);     tp = parse_peak(track_peak);     ap = parse_peak(album_peak);
static int FUNC_0(AVStream *VAR_0,

                             const uint8_t *VAR_1, const uint8_t *VAR_2,

                             const uint8_t *VAR_3, const uint8_t *VAR_4)

{

    AVPacketSideData *sd, *tmp;

    AVReplayGain *replaygain;

    uint8_t *data;

    int32_t tg, ag;

    uint32_t tp, ap;



    tg = parse_gain(VAR_1);

    ag = parse_gain(VAR_3);

    tp = parse_peak(VAR_2);

    ap = parse_peak(VAR_4);



    if (tg == INT32_MIN && ag == INT32_MIN)

        return 0;



    replaygain = av_mallocz(sizeof(*replaygain));

    if (!replaygain)

        return AVERROR(ENOMEM);



    tmp = av_realloc_array(VAR_0->side_data, VAR_0->nb_side_data + 1, sizeof(*tmp));

    if (!tmp) {

        av_freep(&replaygain);

        return AVERROR(ENOMEM);

    }

    VAR_0->side_data = tmp;

    VAR_0->nb_side_data++;



    sd = &VAR_0->side_data[VAR_0->nb_side_data - 1];

    sd->type = AV_PKT_DATA_REPLAYGAIN;

    sd->data = (uint8_t*)replaygain;

    sd->size = sizeof(*replaygain);



    replaygain->VAR_1 = tg;

    replaygain->VAR_2 = tp;

    replaygain->VAR_3 = ag;

    replaygain->VAR_4 = ap;



    return 0;

}

static int FUNC_0(AVStream *VAR_0,
const uint8_t *VAR_1, const uint8_t *VAR_2,
const uint8_t *VAR_3, const uint8_t *VAR_4)
{ AVPacketSideData *sd, *tmp; AVReplayGain *replaygain; uint8_t *data; int32_t tg, ag; uint32_t tp, ap; tg = parse_gain(VAR_1); ag = parse_gain(VAR_3); tp = parse_peak(VAR_2); ap = parse_peak(VAR_4); if (tg == INT32_MIN && ag == INT32_MIN)
return 0; replaygain = av_mallocz(sizeof(*replaygain)); if (!replaygain)
return AVERROR(ENOMEM); tmp = av_realloc_array(VAR_0->side_data, VAR_0->nb_side_data + 1, sizeof(*tmp)); if (!tmp) { av_freep(&replaygain); return AVERROR(ENOMEM); } VAR_0->side_data = tmp; VAR_0->nb_side_data++; sd = &VAR_0->side_data[VAR_0->nb_side_data - 1]; sd->type = AV_PKT_DATA_REPLAYGAIN; sd->data = (uint8_t*)replaygain; sd->size = sizeof(*replaygain); replaygain->VAR_1 = tg; replaygain->VAR_2 = tp; replaygain->VAR_3 = ag; replaygain->VAR_4 = ap; return 0; }