This post contains a picture from p.44 of Lattice's January 2017 Programming Tools User Guide [link] does a good job showing the spatial and runtime properties of many programs written in C/C++ that run on embedded systems:
There are many other great diagrams showing how the code that these diagrams are describing works. I highly recommend taking a look. The code is available by downloading and installing Lattice Diamond from [link] and should be a good resource for learning how programs for embedded systems work.
Lattice logo from [link]