Counts the number of trailing zeroes in DIR direction in mask.
Direction to count in, will find index if DIR == 0 or last index if DIR == 1.
Mask to be counted from.
Number of trailing zeroes in DIR direction in mask.
See Implementation
Counts the number of trailing zeroes in DIR direction in mask.