Tree matcher generated code example: https://gist.github.com/JWalker1995/da82ba09fff022ee93130a8a2a759f2f
This needs to be optimized so that the if statements with a higher probability of failing are placed nearer to the top of the tree, so we encounter cutoffs faster.