static void rtc_get_date(Object *obj, Visitor *v, void *opaque,

                         const char *name, Error **errp)

{

    Error *err = NULL;

    RTCState *s = MC146818_RTC(obj);

    struct tm current_tm;



    rtc_update_time(s);

    rtc_get_time(s, &current_tm);

    visit_start_struct(v, NULL, "struct tm", name, 0, &err);

    if (err) {

        goto out;

    }

    visit_type_int32(v, &current_tm.tm_year, "tm_year", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_mon, "tm_mon", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_mday, "tm_mday", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_hour, "tm_hour", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_min, "tm_min", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_sec, "tm_sec", &err);

    if (err) {

        goto out_end;

    }

out_end:

    error_propagate(errp, err);

    err = NULL;

    visit_end_struct(v, errp);

out:

    error_propagate(errp, err);

}

static void rtc_get_date(Object *obj, Visitor *v, void *opaque,

                         const char *name, Error **errp)

{

    Error *err = NULL;

    RTCState *s = MC146818_RTC(obj);

    struct tm current_tm;



    rtc_update_time(s);

    rtc_get_time(s, &current_tm);

    visit_start_struct(v, NULL, "struct tm", name, 0, &err);

    if (err) {

        goto out;

    }

    visit_type_int32(v, &current_tm.tm_year, "tm_year", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_mon, "tm_mon", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_mday, "tm_mday", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_hour, "tm_hour", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_min, "tm_min", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(v, &current_tm.tm_sec, "tm_sec", &err);

    if (err) {

        goto out_end;

    }

out_end:

    error_propagate(errp, err);

    err = NULL;

    visit_end_struct(v, errp);

out:

    error_propagate(errp, err);

}

static void FUNC_0(Object *VAR_0, Visitor *VAR_1, void *VAR_2,

                         const char *VAR_3, Error **VAR_4)

{

    Error *err = NULL;

    RTCState *s = MC146818_RTC(VAR_0);

    struct tm VAR_5;



    rtc_update_time(s);

    rtc_get_time(s, &VAR_5);

    visit_start_struct(VAR_1, NULL, "struct tm", VAR_3, 0, &err);

    if (err) {

        goto out;

    }

    visit_type_int32(VAR_1, &VAR_5.tm_year, "tm_year", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(VAR_1, &VAR_5.tm_mon, "tm_mon", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(VAR_1, &VAR_5.tm_mday, "tm_mday", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(VAR_1, &VAR_5.tm_hour, "tm_hour", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(VAR_1, &VAR_5.tm_min, "tm_min", &err);

    if (err) {

        goto out_end;

    }

    visit_type_int32(VAR_1, &VAR_5.tm_sec, "tm_sec", &err);

    if (err) {

        goto out_end;

    }

out_end:

    error_propagate(VAR_4, err);

    err = NULL;

    visit_end_struct(VAR_1, VAR_4);

out:

    error_propagate(VAR_4, err);

}

static void FUNC_0(Object *VAR_0, Visitor *VAR_1, void *VAR_2,
const char *VAR_3, Error **VAR_4)
{ Error *err = NULL; RTCState *s = MC146818_RTC(VAR_0); struct tm VAR_5; rtc_update_time(s); rtc_get_time(s, &VAR_5); visit_start_struct(VAR_1, NULL, "struct tm", VAR_3, 0, &err); if (err) { goto out; } visit_type_int32(VAR_1, &VAR_5.tm_year, "tm_year", &err); if (err) { goto out_end; } visit_type_int32(VAR_1, &VAR_5.tm_mon, "tm_mon", &err); if (err) { goto out_end; } visit_type_int32(VAR_1, &VAR_5.tm_mday, "tm_mday", &err); if (err) { goto out_end; } visit_type_int32(VAR_1, &VAR_5.tm_hour, "tm_hour", &err); if (err) { goto out_end; } visit_type_int32(VAR_1, &VAR_5.tm_min, "tm_min", &err); if (err) { goto out_end; } visit_type_int32(VAR_1, &VAR_5.tm_sec, "tm_sec", &err); if (err) { goto out_end; } out_end:
error_propagate(VAR_4, err); err = NULL; visit_end_struct(VAR_1, VAR_4); out:
error_propagate(VAR_4, err); }