gnzlbg/cargo-asm
gnzlbg/cargo-asm has 1,296 GitHub stars and 38 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-07 08:14 UTC. Last push 2024-02-26.
cargo subcommand showing the assembly or llvm-ir generated for Rust code
What you can do
- OS: Linux, Windows, and MacOSX.
- Rust: nightly and stable.
- Architectures: x86, x86_64, arm, aarch64, powerpc, mips, sparc.
- Assembly in Intel or AT&T syntax.
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalcargo-asm
A
cargosubcommand that displays the assembly or llvm-ir generated for Rust source code.
Install
cargo install cargo-asm
Example
To view the assembly of the function double_n in the module bar of the crate
lib_crate annotated with its corresponding Rust code, go to the crate's root
directory
git clone [email protected]:gnzlbg/cargo-asm.git
cd cargo-asm/cargo-asm-test/lib_crate
and type:
cargo asm lib_crate::bar::double_n --rust
which outputs:

(note: the source-code mapping information emitted by rustc after optimizations is sometimes far from perfect, like in this case. Take it with a grain of salt.)
To view the LLVM IR type
cargo llvm-ir lib_crate::bar::double_n
Features
Platform support:
- OS: Linux, Windows, and MacOSX.
- Rust: nightly and stable.
- Architectures: x86, x86_64, arm, aarch64, powerpc, mips, sparc.
Displaying:
- Assembly in Intel or AT&T syntax.
- Corresponding Rust source code alongside assembly.
- JSON AST for further processing.
- LLVM-IR.
Querying:
- functions, for example:
foo:
cargo asm crate::path::to::foo- inherent method, for example:
fooof a typeFoo(that is,Foo::foo):
cargo asm crate::path::to::Foo::foo- trait method implementations, for example:
barof the traitBarfor the typeFoo:
cargo asm "<crate::path::to::Foo as crate::path::to::Bar>::bar"- generic functions, methods, ...
- functions, for example:
To search for a function named foo in some path, one can just type cargo asm foo. The command will return a list of all similarly named functions
independently of the path.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,541 starspublic-apis/public-apis
A collective list of free APIs
496,818 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
438,945 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,094 stars