Where does the returned value for 'main' function go?
It is returned to the calling process.
On a POSIX compliant systems if the calling parent process were a C program it could at least retrieve the lowest 8bit of its child's return value by calling wait()
or waitpid()
after the child ended.