C to Assembly Explorer
Code — test.cc C/C++ Source
Assembly Output ASM View
Terminal

How to Use

  1. Enter or paste C/C++ functions into the left editor (Code — test.cc).
  2. Select your target architecture (x86_64 or wasm32) and optimization flag (e.g., -O2).
  3. Click Compile to generate the corresponding assembly instructions via Clang WebAssembly.
  4. Inspect compiler stderr messages and execution timings in the Terminal panel below.

Supported Architectures

  • x86_64 (Intel/AMD 64-bit): Register-based CISC assembly. Produces standard x86 instructions such as mov, push, add, and register manipulations (%rax, %rdi).
  • wasm32 (WebAssembly 32-bit): Stack-based virtual instruction set. Generates WebAssembly text format (WAT) instructions such as i32.add, local.get, and call.

Optimization Flags

  • -O0: Disables optimization. Preserves a direct line-by-line mapping between C source lines and assembly.
  • -O1: Applies basic code simplifications without significant compile-time overhead.
  • -O2 / -O3: Enables aggressive optimizations including loop unrolling, function inlining, and vectorization.