# m2c

> Decompiler for matching projects that turns GNU as-format 32-bit MIPS, ARM, PowerPC and SuperH assembly into draft C, with partial C++ support. A target combines platform, compiler (IDO, GCC or MetroWerks CodeWarrior) and language; context files supply types, and it can infer unknown struct fields and emit global initializers. The README places it alongside splat, asm-differ and decomp-permuter, and decomp.me calls it for initial decompilations.

- Type: Tool
- Targets: Binary · Game
- Category: Game analysis tools
- Relationship: Foundation tool
- Sources reviewed: 2026-10-18
- Added to the catalog: 2026-10-19
- Original resource: <https://github.com/matt-kempster/m2c>
- Primary source: <https://github.com/matt-kempster/m2c/blob/708d2d2cb2698f091a92492b328f73b24209f72d/README.md>
- Catalog page: <https://awesomerea.org/resources/m2c/>
- Record JSON: <https://awesomerea.org/resources/m2c/record.json>
- Chinese version: [简体中文](https://awesomerea.org/zh/resources/m2c/index.md)

## Requirements & limits

- Python 3.8+ with graphviz. Run m2c.py from a checkout or install it from the Git repository as a Python package; the package named m2c on PyPI is an unrelated project. There are no releases or tags.
- Input must match the GNU as assembly format, such as spimdisasm output. The README lists the mips, mipsel, mipsee (eabi64), ppc, arm, gba (APCS) and sh2 platforms, the ido, gcc and mwcc compilers, and the c and c++ languages. Struct-field inference skips structs with bitfields or unnamed union fields, and initializers cannot be generated for bitfield structs or symbols of unknown type.
- GPL-3.0-only. The README warns that output is sometimes suboptimal, especially for loops; it is a starting point to refine and check with a compiler and diff tool, not byte-identical source.

## Primary sources

1. <https://github.com/matt-kempster/m2c/blob/708d2d2cb2698f091a92492b328f73b24209f72d/README.md>
2. <https://github.com/matt-kempster/m2c/blob/708d2d2cb2698f091a92492b328f73b24209f72d/README.md#L26-L49>
3. <https://github.com/matt-kempster/m2c/blob/708d2d2cb2698f091a92492b328f73b24209f72d/README.md#L387-L404>
4. <https://github.com/matt-kempster/m2c/blob/708d2d2cb2698f091a92492b328f73b24209f72d/pyproject.toml>
5. <https://github.com/matt-kempster/m2c/blob/708d2d2cb2698f091a92492b328f73b24209f72d/LICENSE>
6. <https://github.com/decompme/decomp.me/blob/f5850753ef561a3d79e6eb7e96ff08e78154b91d/cromper/cromper/wrappers/m2c_wrapper.py>

## More in Games

- [decomp-toolkit](https://awesomerea.org/resources/decomp-toolkit/index.md) · Tool
- [Cheat Engine MCP Bridge](https://awesomerea.org/resources/cheatengine-mcp-bridge/index.md) · Integration
- [ido-static-recomp](https://awesomerea.org/resources/ido-static-recomp/index.md) · Tool
- [PS2Recomp](https://awesomerea.org/resources/ps2recomp/index.md) · Tool
- [Xenosaga I Decomp Compatibility Kit](https://awesomerea.org/resources/decomp-compat-kit/index.md) · Tool
- [GB Recompiled](https://awesomerea.org/resources/gb-recompiled/index.md) · Tool

## About this entry

The description was reviewed against primary sources.
Original editorial content: MIT. Linked projects, papers and assets retain their own rights and licenses.
