Like this: https://github.com/krkrz/krkr2/blob/master/kirikiri2/trunk/kirikiri2/src/cor...
Well, that doesn't tell us very much, not without reading through a lot of C++. Perhaps counterintuitively, it may be easier to get an idea of what's happening from a +quartz log.