static int ds1225y_set_to_mode(ds1225y_t *NVRAM, nvram_open_mode mode, const char *filemode)

{

    if (NVRAM->open_mode != mode)

    {

        if (NVRAM->file)

            qemu_fclose(NVRAM->file);

        NVRAM->file = qemu_fopen(NVRAM->filename, filemode);

        NVRAM->open_mode = mode;

    }

    return (NVRAM->file != NULL);

}

static int ds1225y_set_to_mode(ds1225y_t *NVRAM, nvram_open_mode mode, const char *filemode)

{

    if (NVRAM->open_mode != mode)

    {

        if (NVRAM->file)

            qemu_fclose(NVRAM->file);

        NVRAM->file = qemu_fopen(NVRAM->filename, filemode);

        NVRAM->open_mode = mode;

    }

    return (NVRAM->file != NULL);

}

static int ds1225y_set_to_mode(ds1225y_t *NVRAM, nvram_open_mode mode, const char *filemode)
     if (NVRAM->open_mode != mode)
         if (NVRAM->file)
             qemu_fclose(NVRAM->file);
         NVRAM->file = qemu_fopen(NVRAM->filename, filemode);
         NVRAM->open_mode = mode;
     return (NVRAM->file != NULL);

static int FUNC_0(ds1225y_t *VAR_0, nvram_open_mode VAR_1, const char *VAR_2)

{

    if (VAR_0->open_mode != VAR_1)

    {

        if (VAR_0->file)

            qemu_fclose(VAR_0->file);

        VAR_0->file = qemu_fopen(VAR_0->filename, VAR_2);

        VAR_0->open_mode = VAR_1;

    }

    return (VAR_0->file != NULL);

}

static int FUNC_0(ds1225y_t *VAR_0, nvram_open_mode VAR_1, const char *VAR_2)
{ if (VAR_0->open_mode != VAR_1)
{ if (VAR_0->file)
qemu_fclose(VAR_0->file); VAR_0->file = qemu_fopen(VAR_0->filename, VAR_2); VAR_0->open_mode = VAR_1; } return (VAR_0->file != NULL); }