[17/77] Add an int_mode_for_size helper function