int fw_cfg_add_callback(FWCfgState *s, uint16_t key, FWCfgCallback callback,

                        void *callback_opaque, uint8_t *data, size_t len)

{

    int arch = !!(key & FW_CFG_ARCH_LOCAL);



    if (!(key & FW_CFG_WRITE_CHANNEL))

        return 0;



    key &= FW_CFG_ENTRY_MASK;



    if (key >= FW_CFG_MAX_ENTRY || len > 65535)

        return 0;



    s->entries[arch][key].data = data;

    s->entries[arch][key].len = len;

    s->entries[arch][key].callback_opaque = callback_opaque;

    s->entries[arch][key].callback = callback;



    return 1;

}

int fw_cfg_add_callback(FWCfgState *s, uint16_t key, FWCfgCallback callback,

                        void *callback_opaque, uint8_t *data, size_t len)

{

    int arch = !!(key & FW_CFG_ARCH_LOCAL);



    if (!(key & FW_CFG_WRITE_CHANNEL))

        return 0;



    key &= FW_CFG_ENTRY_MASK;



    if (key >= FW_CFG_MAX_ENTRY || len > 65535)

        return 0;



    s->entries[arch][key].data = data;

    s->entries[arch][key].len = len;

    s->entries[arch][key].callback_opaque = callback_opaque;

    s->entries[arch][key].callback = callback;



    return 1;

}

        return 0;     return 1; int fw_cfg_add_callback(FWCfgState *s, uint16_t key, FWCfgCallback callback,                         void *callback_opaque, uint8_t *data, size_t len)     if (!(key & FW_CFG_WRITE_CHANNEL))         return 0;     if (key >= FW_CFG_MAX_ENTRY || len > 65535)         return 0;     return 1;         return 0;     return 1; int fw_cfg_add_callback(FWCfgState *s, uint16_t key, FWCfgCallback callback,
int FUNC_0(FWCfgState *VAR_0, uint16_t VAR_1, FWCfgCallback VAR_2,

                        void *VAR_3, uint8_t *VAR_4, size_t VAR_5)

{

    int VAR_6 = !!(VAR_1 & FW_CFG_ARCH_LOCAL);



    if (!(VAR_1 & FW_CFG_WRITE_CHANNEL))

        return 0;



    VAR_1 &= FW_CFG_ENTRY_MASK;



    if (VAR_1 >= FW_CFG_MAX_ENTRY || VAR_5 > 65535)

        return 0;



    VAR_0->entries[VAR_6][VAR_1].VAR_4 = VAR_4;

    VAR_0->entries[VAR_6][VAR_1].VAR_5 = VAR_5;

    VAR_0->entries[VAR_6][VAR_1].VAR_3 = VAR_3;

    VAR_0->entries[VAR_6][VAR_1].VAR_2 = VAR_2;



    return 1;

}

int FUNC_0(FWCfgState *VAR_0, uint16_t VAR_1, FWCfgCallback VAR_2,
void *VAR_3, uint8_t *VAR_4, size_t VAR_5)
{ int VAR_6 = !!(VAR_1 & FW_CFG_ARCH_LOCAL); if (!(VAR_1 & FW_CFG_WRITE_CHANNEL))
return 0; VAR_1 &= FW_CFG_ENTRY_MASK; if (VAR_1 >= FW_CFG_MAX_ENTRY || VAR_5 > 65535)
return 0; VAR_0->entries[VAR_6][VAR_1].VAR_4 = VAR_4; VAR_0->entries[VAR_6][VAR_1].VAR_5 = VAR_5; VAR_0->entries[VAR_6][VAR_1].VAR_3 = VAR_3; VAR_0->entries[VAR_6][VAR_1].VAR_2 = VAR_2; return 1; }