imenu--split-menu

imenu--split-menu is a compiled Lisp function in `imenu.el'.

(imenu--split-menu MENULIST TITLE)

Split the alist MENULIST into a nested alist, if it is long enough.
In any case, add TITLE to the front of the alist.
If IMENU--RESCAN-ITEM is present in MENULIST, it is moved to the
beginning of the returned alist.
The returned alist DOES NOT share structure with MENULIST.