static const char *local_mapped_attr_path(FsContext *ctx,

                                          const char *path, char *buffer)

{

    char *dir_name;

    char *tmp_path = g_strdup(path);

    char *base_name = basename(tmp_path);



    /* NULL terminate the directory */

    dir_name = tmp_path;

    *(base_name - 1) = '\0';



    snprintf(buffer, PATH_MAX, "%s/%s/%s/%s",

             ctx->fs_root, dir_name, VIRTFS_META_DIR, base_name);

    g_free(tmp_path);

    return buffer;

}

static const char *local_mapped_attr_path(FsContext *ctx,

                                          const char *path, char *buffer)

{

    char *dir_name;

    char *tmp_path = g_strdup(path);

    char *base_name = basename(tmp_path);



    

    dir_name = tmp_path;

    *(base_name - 1) = '\0';



    snprintf(buffer, PATH_MAX, "%s/%s/%s/%s",

             ctx->fs_root, dir_name, VIRTFS_META_DIR, base_name);

    g_free(tmp_path);

    return buffer;

}

static const char *FUNC_0(FsContext *VAR_0,

                                          const char *VAR_1, char *VAR_2)

{

    char *VAR_3;

    char *VAR_4 = g_strdup(VAR_1);

    char *VAR_5 = basename(VAR_4);



    

    VAR_3 = VAR_4;

    *(VAR_5 - 1) = '\0';



    snprintf(VAR_2, PATH_MAX, "%s/%s/%s/%s",

             VAR_0->fs_root, VAR_3, VIRTFS_META_DIR, VAR_5);

    g_free(VAR_4);

    return VAR_2;

}

static const char *FUNC_0(FsContext *VAR_0,
const char *VAR_1, char *VAR_2)
{ char *VAR_3; char *VAR_4 = g_strdup(VAR_1); char *VAR_5 = basename(VAR_4); VAR_3 = VAR_4; *(VAR_5 - 1) = '\0'; snprintf(VAR_2, PATH_MAX, "%s/%s/%s/%s",
VAR_0->fs_root, VAR_3, VIRTFS_META_DIR, VAR_5); g_free(VAR_4); return VAR_2; }