How does one do this?
If I want to analyze how something is getting compiled, how would I get the emitted assembly code?
This will generate assembly code with the C code + line numbers interweaved, to more easily see which lines generate what code:
# create assembler code:
g++ -S -fverbose-asm -g -O2 test.cc -o test.s
# create asm interlaced with source lines:
as -alhnd test.s > test.lst
Found in Algorithms for programmers, page 3 (which is the overall 15th page of the PDF).