On Tue, 2025-03-11 at 11:56 +0530, manoj alladawar via Gcc-help wrote: > Dear GCC Community, > > I hope this message finds you well. > > I am currently working on a Debian-based system running Ubuntu 22.04 and > using GCC version 11.4.0. I have compiled a C source file using GCC with > the -O2 optimization flag, resulting in an optimized binary. Current GCC version is 14.2 and the development one is GCC 15 And you could (and probably should) build GCC from its source code (the build tree has to be outside of the source tree). And GCC has better optimizations, e.g. -O3 and -flto (used both at compile time and link time). It also permit static analysis options https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html and a lot more optimization options https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html including profile guided optimizations. > > I am now interested in generating high-level C code from this optimized > binary for analysis and understanding. You probably should learn more about GIMPLE representations https://gcc.gnu.org/onlinedocs/gccint/GIMPLE.html and about GCC plugins https://gcc.gnu.org/onlinedocs/gccint/Plugins.html and perhaps look into https://github.com/bstarynk/bismon and this report http://www.starynkevitch.net/Basile/bismon-chariot-doc.pdf > > Could you kindly advise me on which > decompiler would be most suitable for this purpose? Specifically, I would > appreciate recommendations for decompilers that perform effectively on > GCC-based optimized code. Consider using Binsec https://binsec.github.io/ regards -- Basile STARYNKEVITCH <basile@xxxxxxxxxxxxxxxxx> 8 rue de la Faïencerie 92340 Bourg-la-Reine, France http://starynkevitch.net/Basile & https://github.com/bstarynk & https://github.com/RefPerSys/RefPerSys/