C code to extract statistics from ConsistentTrees