In the grim darkness of the far future, there is only war. The world has become a barren wasteland that is inhospitable to the the human race, which has been forced to take residence in hive cities. These are massive industrial metropolises that are densely populated and built deep into the Earth's crust. This has been the case for thousands of years, and the human race now number in the hundreds of trillions. As a result, these hive cities are overpopulated and resources are always in dangerously short supply. However, one invaluable resource that is always plentiful: bodies.
The hive cities make use of every available resource, no matter how grim. The bodies of the dead are not buried or cremated with respect, but processed into a paste called corpse starch. This nutritious paste is broken down human remains mixed in with various ingredients, which are then fed to the starving dregs of society. Practically, billions of people die every day. People who have died of natural causes or accidents from unsafe working conditions, executed prisoners, unwanted children who have disobeyed their parents too many times, etc., will all be turned into food to feed the living workers and the armies that keep hive cities safe. This is so the nobility can save the real food for the important and relevant higher-ups of society.
Of course, the kind and benevolent leaders of the hives hate having to take this route with the masses, but it is a regrettable sacrifice that must be made for the survival of humanity. With heavy hearts, they have taken it upon themselves to design a system that processes bodies into food that maintains the nutrition of the population? How can I make this work?