frontpage.
newsnewestaskshowjobs

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).

The Server Is a Sync Relay Now: Architecting Around Client-Owned State

https://tiarebalbi.com/en/blog/local-first-server-sync-relay-architecture
1•yruzin•1m ago•0 comments

Show HN: NS6 – Find your perfect domain

https://www.ns6.com/
1•nadermx•3m ago•0 comments

ASCII Art

https://github.com/doctorfree/Asciiville
1•audreyfei•5m ago•0 comments

Regressive JPEGs

https://maurycyz.com/projects/bad_jpeg/
1•vitaut•8m ago•0 comments

Erik J. Larson, The Myth of Artificial Intelligence (2021) [pdf]

https://dn721508.ca.archive.org/0/items/the-myth-of-artificial-intelligence/TheMythofArtificialIn...
1•1vuio0pswjnm7•13m ago•4 comments

Apitegromab for lean mass preservation during tirzepatide-induced weight loss

https://www.nature.com/articles/s41591-026-04440-4
1•nateb2022•18m ago•0 comments

Reading Between Dots: Decoding Hidden Computation Across Filler Tokens (ICML'26)

https://arxiv.org/abs/2607.03502
1•vismit2000•33m ago•0 comments

Tokyo Technarch Izakaya Night: Jensen like postwar industry captain

https://www.youtube.com/watch?v=X7ffSOzcYBc
1•oliculipolicula•38m ago•0 comments

Angie – Drop-In Replacement for Nginx

https://github.com/webserver-llc/angie
1•lwhsiao•38m ago•0 comments

TypePiao-Practice sheet music reading like typing, with instant feedback

https://typepiano.org
1•WenboS•39m ago•0 comments

Extra hidden computations in LLM using dot tokens for multi-hop reasoning

https://xcancel.com/kaleybrauer/status/2078185882926846044
1•vismit2000•41m ago•0 comments

Arduino Launches Plug-and-Play Modules for Long-Range Sensor Projects

https://www.allaboutcircuits.com/news/arduino-launches-plug-and-play-modules-for-long-range-senso...
1•WaitWaitWha•44m ago•0 comments

"Free Range" Offline and On

https://petergray.substack.com/p/121-free-range-offline-and-on
1•Ariarule•46m ago•0 comments

Ask HN: Are We Getting Dumber?

2•lyfeninja•47m ago•0 comments

Some surveillance I noticed today

https://nonogra.ph/some-surveillance-i-noticed-today-07-18-2026
1•arkhiver•48m ago•0 comments

A Test Isn't Racist. Assumptions About Black Kids Can Be

https://www.nytimes.com/2026/07/16/opinion/new-york-high-school-test-racism.html
2•apparent•50m ago•1 comments

StartupForge AI – Turn Any Business Idea into a Startup Blueprint

https://b07ada739af0b4a7c99daf84e96b066a.ctonew.app/
1•kvreal•52m ago•0 comments

Cataloging Growth: A Re-Evaluation of 1900–1990 [pdf]

https://veronicabp.github.io/website/VBP_BHW_CostOfLiving.pdf
1•alphabetatango•55m ago•0 comments

Ultraclose 2029 flyby of asteroid Apophis

https://www.livescience.com/space/asteroids/shared-cosmic-experience-potentially-hazardous-astero...
2•jinjin2•1h ago•0 comments

Show HN: Spiral – continuous-thrust orbit-transfer design in the browser

https://spiral.erikevenson.net
1•eevenson•1h ago•0 comments

How Websites Detect Ban Evasion-why creating new accounts isn't enough to escape

https://medium.com/@thesuperrepemail/how-websites-detect-ban-evasion-and-why-creating-a-new-accou...
2•mssblogs•1h ago•0 comments

Beginning July 20, Claude Fable 5 will be included in all Max plans

https://twitter.com/claudeai/status/2078302415804379218
8•mfiguiere•1h ago•3 comments

Amp Subscriptions, at Last

https://ampcode.com/news/subscriptions
1•shmuppet•1h ago•0 comments

In the birthplace of the car, EVs are now king: BEVs outsell gas cars in Germany

https://electrek.co/2026/07/17/in-the-birthplace-of-the-automobile-electric-cars-are-now-king/
2•breve•1h ago•0 comments

Grok Imagine regenerated Xkcd comics

https://www.xkcd-ai.com/
3•levelforge•1h ago•1 comments

Nvidia CEO Jensen Huang's jacket has sold at Sotheby's for $960k

https://twitter.com/darrenrovell/status/2078207366625964058
6•donsupreme•1h ago•2 comments

Xkcd comics re-imagined with Grok IMAGINE

https://www.xkcd-ai.com/21507
2•levelforge•1h ago•2 comments

There's no standard status page, and other lessons from tracking 96 providers

https://dev.to/kerolos_atallah/theres-no-standard-status-page-and-other-lessons-from-tracking-96-...
1•koko3tallah•1h ago•0 comments

A CPython 3.14 Bytecode Interpreter Running Inside GPU Compute Kernels

https://zenodo.org/records/21421984
2•thelibrebob•1h ago•0 comments

The biologist dedicated to tackling human-wildlife conflict

https://www.theguardian.com/environment/2026/apr/30/lion-wild-animals-livestock-moreangels-mbizah...
1•thunderbong•1h ago•0 comments