int qemu_devtree_add_subnode(void *fdt, const char *name)

{

    int offset;

    char *dupname = g_strdup(name);

    char *basename = strrchr(dupname, '/');

    int retval;



    if (!basename) {

        return -1;

    }



    basename[0] = '\0';

    basename++;



    offset = fdt_path_offset(fdt, dupname);

    if (offset < 0) {

        return offset;

    }



    retval = fdt_add_subnode(fdt, offset, basename);

    g_free(dupname);

    return retval;

}

int qemu_devtree_add_subnode(void *fdt, const char *name)

{

    int offset;

    char *dupname = g_strdup(name);

    char *basename = strrchr(dupname, '/');

    int retval;



    if (!basename) {

        return -1;

    }



    basename[0] = '\0';

    basename++;



    offset = fdt_path_offset(fdt, dupname);

    if (offset < 0) {

        return offset;

    }



    retval = fdt_add_subnode(fdt, offset, basename);

    g_free(dupname);

    return retval;

}

        return offset;     int offset;         return offset;     int offset;         return offset;     int offset;         return offset;     int offset;     offset = fdt_path_offset(fdt, dupname);     if (offset < 0) {         return offset;     retval = fdt_add_subnode(fdt, offset, basename);
int FUNC_0(void *VAR_0, const char *VAR_1)

{

    int VAR_2;

    char *VAR_3 = g_strdup(VAR_1);

    char *VAR_4 = strrchr(VAR_3, '/');

    int VAR_5;



    if (!VAR_4) {

        return -1;

    }



    VAR_4[0] = '\0';

    VAR_4++;



    VAR_2 = fdt_path_offset(VAR_0, VAR_3);

    if (VAR_2 < 0) {

        return VAR_2;

    }



    VAR_5 = fdt_add_subnode(VAR_0, VAR_2, VAR_4);

    g_free(VAR_3);

    return VAR_5;

}

int FUNC_0(void *VAR_0, const char *VAR_1)
{ int VAR_2; char *VAR_3 = g_strdup(VAR_1); char *VAR_4 = strrchr(VAR_3, '/'); int VAR_5; if (!VAR_4) { return -1; } VAR_4[0] = '\0'; VAR_4++; VAR_2 = fdt_path_offset(VAR_0, VAR_3); if (VAR_2 < 0) { return VAR_2; } VAR_5 = fdt_add_subnode(VAR_0, VAR_2, VAR_4); g_free(VAR_3); return VAR_5; }