frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•1y ago
I'd like to do some statistics over the machine code gcc generates, such as a histogram of used instructions, average volatile/preserved registers usage of functions etc. For now just x86_64 SysV-ABI would be enough.

However I'm not aware of any pre-existing tool that lets me easily do this. The options I currently see are either make gcc output assembly and write a parser for the GNU Assembler format (possibly by reusing the asm-parser of the compiler-explorer project), or write a tool that reads (disassembles) object files directly using elfutils.

Any hints, prior work, further ideas, links to useful resources, or any other kind of help would be much appreciated.

Comments

baobun•1y ago
"Static analysis" should be a relevant search term. Assuming you don't need to tie the instructions back to C code then the "gcc" part seems circumstancial for implementation? I guess you might want to parse the ASM into an Abstract Syntax Tree (AST) represenation and work on that?

If you do want to tie it back to the source, this looks relevant: http://icps.u-strasbg.fr/~pop/gcc-ast.html

phafu•1y ago
For my purpose I don't need to get back to the original source, no.

The gcc part is only relevant with regards to what dialect of assembler I need to parse. If I go that route, I'd write a parser for the GNU assembler, and that would of course work with any code in that dialect, regardless from which compiler it came from (I haven't checked whether other compilers can produce GNU assembler though).

America Needs to Build More Housing

https://www.nytimes.com/interactive/2026/05/18/opinion/affordable-housing-america.html
1•michaelrkn•3m ago•0 comments

Flipper One – we need your help

https://blog.flipper.net/flipper-one-we-need-your-help/
1•sandebert•5m ago•0 comments

Tech researchers are suing the Trump administration over the future of online s

https://www.technologyreview.com/2026/05/21/1137632/lawsuit-trump-administration-online-safety-co...
2•joozio•6m ago•0 comments

Lost Images from the 1945 Trinity Nuclear Test Restored

https://spectrum.ieee.org/trinity-nuclear-test
2•pseudolus•6m ago•0 comments

One opinionated path from what is money? to I run my own Bitcoin node

https://www.learnbitcoin.com/journey
2•granya•7m ago•0 comments

Necropolis in Spain is forcing rethink of who built Europe's first great tombs

https://sciencex.com/news/2026-05-year-necropolis-central-spain-radical.html
2•pseudolus•7m ago•0 comments

Python is weird – Maciej Kowalski

https://kowal.dev/blog/python-is-weird
2•rbanffy•8m ago•1 comments

3.125-Bit LLM quantization bypassing tensor cores

https://blog.djellalmohamedaniss.workers.dev/posts/data-free-3bit-quantization/
2•dmaniss•13m ago•0 comments

Galviq

https://galviq.com
2•alediemmee•14m ago•0 comments

Dimster, a performance benchmarking tool for Apache Kafka

https://jack-vanlightly.com/blog/2026/5/20/introducing-dimster-a-performance-benchmarking-tool-fo...
2•rmoff•15m ago•0 comments

Reviewing Last Decade's Predictions for 2026

https://micahblachman.beehiiv.com/p/reviewing-last-decade-s-predictions-for-2026-part-1
2•subdomain•15m ago•0 comments

Wati alternatives compared by real all-in cost at 2k conversations/month

https://wexio.io/blog/wati-alternatives
2•Puvvl•16m ago•0 comments

Bun Isolated Installs

https://bun.com/docs/pm/isolated-installs
2•ankitg12•17m ago•0 comments

Earth is now heating up twice as fast as in previous decades

https://www.newscientist.com/article/2518362-earth-is-now-heating-up-twice-as-fast-as-in-previous...
2•Anon84•17m ago•0 comments

Insurance Pricing – compare TabPFN 3.0 vs. classic ML

https://oleksandrruppelt.substack.com/p/insurance-pricing-with-tabpfn-30
2•pplonski86•23m ago•0 comments

Gribouille: A Grammar of Graphics for Typst

https://mickael.canouil.fr/posts/2026-05-20-gribouille-grammar-of-graphics-for-typst/
2•mcanouil•24m ago•0 comments

Denmark's wind and solar investments shield it from global energy turmoil

https://www.pbs.org/newshour/show/how-denmarks-wind-and-solar-investments-shield-it-from-global-e...
3•vrganj•25m ago•0 comments

Show HN: A searchable archive of 500 historical medical curiosities

https://www.thomas-morris.uk/medical-curiosities-archive/
3•mrtndavid•25m ago•0 comments

IBM invented semiconductor manufacturing automation

https://spectrum.ieee.org/semiconductor-fabrication
2•rbanffy•29m ago•0 comments

AI Can Seem More Human Than Real Humans in a Classic Turing Test, Study Finds

https://today.ucsd.edu/story/ai-can-seem-more-human-than-real-humans-in-a-classic-turing-test-stu...
3•giuliomagnifico•32m ago•1 comments

Imec Semiconductor Technology Roadmap: CFETs in 2033

https://spectrum.ieee.org/semiconductor-technology-roadmap
3•rbanffy•33m ago•0 comments

Async Python client for private DeepSeek API

https://github.com/boykopovar/aiodeepseek
2•boykopovar•36m ago•0 comments

Lessons I Learned from Creating Searx

https://hister.org/posts/lessons-i-learned-from-creating-searx
8•mstef•38m ago•1 comments

Built a live multi-agent AI operations workspace for software engineering teams

https://realtechsolutions.work.gd/
2•MunangiwaR•41m ago•0 comments

QuickSilver Pro – OpenAI-Compatible Platform for DeepSeek V4 and Qwen

https://quicksilverpro.io/
2•charlei•41m ago•1 comments

Book on Truth in the Age of A.I. Contains Quotes Made Up by A.I

https://www.nytimes.com/2026/05/19/business/media/future-of-truth-ai-quotes.html
2•andsoitis•41m ago•0 comments

Pi creator removed from OpenClaw's GitHub organization

https://twitter.com/badlogicgames/status/2057391656379269272
2•rob•41m ago•0 comments

Gillette's Metropolis. A Razor Dystopia

https://passingstrangeness.wordpress.com/2026/05/12/gillettes-metropolis/
2•nephihaha•44m ago•0 comments

KiroGraph: Local code knowledge graph for AI, optimized for token efficiency

https://github.com/davide-desio-eleva/kirograph
2•ddesio•46m ago•0 comments

The three layers: browser, index, AI – what happens when you own all three

https://github.com/the-ai-coop/open-letter
2•the-ai-coop•47m ago•0 comments