use long for N
inline function optimization
append captured tokens to match_entry