“Ali Baba and the Forty Thieves” (1971) IMDb
Miyazaki Hayao (key animator).
Sultan Ali Baba XXXIII has spent the treasure his humble ancestor stole from the robbers’ stash in the cave and terrorizes his people with a big pink genie to eat well.
A fairytale comedy continuing Toei’s tradition of Disney/UPA imitation, now with cheaper animation and more absurd gags, somewhat in the style of Dr. Seuss or late Looney Tunes (1930). Miyazaki mostly did key animation but is also credited (on IMDb) as an “organizer”.
It’s more wild and free than earlier Toei films, but equally, or perhaps more, stupid. Implausibility is the main gag, not the side effect it was in Gulliver’s Travels Beyond the Moon (1965). There is a lovely sequence in radically different animation, where a talking rodent recounts the legend of Ali Baba, only slightly tamed by leaving out the slavery and Cassim, but leaving in the death by boiling oil and stabbing. As with Puss in Boots (1969), the castle sequence towards the end is well done.
References here: Ghibli movie titles.