How does one do this?
If I want to analyze how something is getting compiled, how would I get the emitted assembly code?
Use the -S switch
g++ -S main.cpp
or also with gcc
gcc -S main.c
Also see this