Step Into Labs

Step Into x64 Assembly · Lesson 11 · Reading Real Code

Reading Compiler Output

What gcc makes of C at -O0 and -O2: frames, spills, lea math, magic division and cmov.

Part of Step Into x64 Assembly. The full lesson, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.

When you open a Windows binary in a disassembler or debugger, you are reading what MSVC, gcc or clang produced from C or C++. Compilers use a small set of recognizable patterns. Once you know them, a page of disassembly reads like C again.

In this lesson

Missions

  1. Undo the spills
  2. Spot the division
  3. An if without a jump
  4. Generalize a loop