The gcc -S
produces the source (for the gas
assembler) you could be interested in. But remember that expecially for C++, a lot of code you could find interesting is indeed linked standard libraries, run time... whatever according to the language). You can disassemble the final code of course (e.g. simply with objdump
), where you can see startup codes and other codes added by linker (but of course, because of the dynamic binding, you won't see the code for, say, the C standard library, since it is not embedded, unless you create your final executable with static linking, when doable, i.e. the "static" version of the lib must exist)
As consequence, what you obtain is not a stand-alone equivalent asm code of what C/C++ sources do. This sort of translation is hard, expecially since asm is a very "basic" language, so that to be able to translate it "1-1" you need a lot of code, and of course the "translation" will depend on the system (e.g. a self-made output routines at the end have to use O.S. provided API/system call)... basically you have to rewrite C/C++ libraries and runtime, when needed (for C++)...
Translating into other language, e.g. from C++ to another OO language, could be simpler, but it is not what you're interested in.