I wrote a fast Fenwick tree library for my flash cards app: https://git.unnamed.website/sdc/tree/fenwick.c
The operation "Search for largest index with prefix sum less than or equal to s" isn't a common thing that people do with Fenwick trees so I had to read an arXiv paper about it.
The nice thing about Fenwick trees is that they're only a few lines of code but... on the other hand they use crazy incomprehensive bit hacks!