static void replay_add_event(ReplayAsyncEventKind event_kind,

                             void *opaque,

                             void *opaque2, uint64_t id)

{

    assert(event_kind < REPLAY_ASYNC_COUNT);



    if (!replay_file || replay_mode == REPLAY_MODE_NONE

        || !events_enabled) {

        Event e;

        e.event_kind = event_kind;

        e.opaque = opaque;

        e.opaque2 = opaque2;

        e.id = id;

        replay_run_event(&e);

        return;

    }



    Event *event = g_malloc0(sizeof(Event));

    event->event_kind = event_kind;

    event->opaque = opaque;

    event->opaque2 = opaque2;

    event->id = id;



    replay_mutex_lock();

    QTAILQ_INSERT_TAIL(&events_list, event, events);

    replay_mutex_unlock();

}

static void replay_add_event(ReplayAsyncEventKind event_kind,

                             void *opaque,

                             void *opaque2, uint64_t id)

{

    assert(event_kind < REPLAY_ASYNC_COUNT);



    if (!replay_file || replay_mode == REPLAY_MODE_NONE

        || !events_enabled) {

        Event e;

        e.event_kind = event_kind;

        e.opaque = opaque;

        e.opaque2 = opaque2;

        e.id = id;

        replay_run_event(&e);

        return;

    }



    Event *event = g_malloc0(sizeof(Event));

    event->event_kind = event_kind;

    event->opaque = opaque;

    event->opaque2 = opaque2;

    event->id = id;



    replay_mutex_lock();

    QTAILQ_INSERT_TAIL(&events_list, event, events);

    replay_mutex_unlock();

}

static void FUNC_0(ReplayAsyncEventKind VAR_0,

                             void *VAR_1,

                             void *VAR_2, uint64_t VAR_3)

{

    assert(VAR_0 < REPLAY_ASYNC_COUNT);



    if (!replay_file || replay_mode == REPLAY_MODE_NONE

        || !events_enabled) {

        Event e;

        e.VAR_0 = VAR_0;

        e.VAR_1 = VAR_1;

        e.VAR_2 = VAR_2;

        e.VAR_3 = VAR_3;

        replay_run_event(&e);

        return;

    }



    Event *event = g_malloc0(sizeof(Event));

    event->VAR_0 = VAR_0;

    event->VAR_1 = VAR_1;

    event->VAR_2 = VAR_2;

    event->VAR_3 = VAR_3;



    replay_mutex_lock();

    QTAILQ_INSERT_TAIL(&events_list, event, events);

    replay_mutex_unlock();

}

static void FUNC_0(ReplayAsyncEventKind VAR_0,
void *VAR_1,
void *VAR_2, uint64_t VAR_3)
{ assert(VAR_0 < REPLAY_ASYNC_COUNT); if (!replay_file || replay_mode == REPLAY_MODE_NONE
|| !events_enabled) { Event e; e.VAR_0 = VAR_0; e.VAR_1 = VAR_1; e.VAR_2 = VAR_2; e.VAR_3 = VAR_3; replay_run_event(&e); return; } Event *event = g_malloc0(sizeof(Event)); event->VAR_0 = VAR_0; event->VAR_1 = VAR_1; event->VAR_2 = VAR_2; event->VAR_3 = VAR_3; replay_mutex_lock(); QTAILQ_INSERT_TAIL(&events_list, event, events); replay_mutex_unlock(); }