LLVM-DIS(1)

πŸ’… LLVM-DIS(1) β€” the LLVM disassembler, bestie edition

okay so real talk, this is the llvm-dis page from the LLVM manual set, and I'm gonna walk you through it like we're texting at 2am πŸ¦‹


✨ NAME ✨

llvm-dis β€” literally the LLVM disassembler. that's her job title, that's her whole brand πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

llvm-dis [options] [filename]

🌸 DESCRIPTION 🌸

okay so picture this: llvm-dis is the LLVM disassembler, and she is so good at it. she takes an LLVM bitcode file (you know, the crunchy binary one) and converts it into human-readable LLVM assembly language. it's giving translator, it's giving glow-up, it's giving "i can fix him" but for files πŸ’–

if filename is omitted, or you literally just pass -, then llvm-dis reads its input from standard input. no file? no problem. she's flexible like that 🫢

and here's the part where you gotta pay attention, bestie: if the input is being read from standard input, then llvm-dis will send its output to standard output by default. makes sense, right? but otherwise β€” like when you actually gave her a real file β€” the output gets written to a file named after the input file, with a .ll suffix added. and lowkey important: any existing .bc suffix will first be removed, so you don't end up with something cursed like thing.bc.ll πŸ™ˆ

you can override the choice of output file using the -o option. main character energy, she lets you decide ✨


πŸ’œ OPTIONS πŸ’œ

  • -f β€” enable binary output on terminals. normally llvm-dis will refuse to write raw bitcode output if the output stream is a terminal (she's protective, she's looking out for you). with this option though, llvm-dis will write raw bitcode regardless of the output device. no cap, she said what she said πŸ’€
  • -help β€” print a summary of command line options. that's your "wait what were the flags again" button, and honestly we all need it 😭
  • -o filename β€” specify the output file name. and if filename is -, then the output is sent to standard output. iconic, consistent, we love her πŸ”₯

🌈 EXIT STATUS 🌈

if llvm-dis succeeds, it will exit with 0. slay πŸŽ‰

otherwise, if an error occurs, it will exit with a non-zero value. so like, if you see a non-zero, something went sideways, go check your vibes check 🫢


⭐ SEE ALSO ⭐

llvm-as(1) β€” the other half of the duo, iykyk πŸ‘‘


🧚 AUTHOR 🧚

maintained by the LLVM Team (https://llvm.org/). yes, the LLVM Team. royalty 🌸


2003-2023, LLVM Project β€” periodt πŸ’…


and that's the whole page, bestie!! this lil walkthrough came to you courtesy of the LLVM-DIS(1) manual page, page 17, dated 2023-12-01, from the LLVM book itself. mwah, go disassemble something πŸ“πŸ’œ

πŸ“¦ where this page comes from