Looking at S3_0. Not sure (not looked in details) if compiler has any chance to deduct that action_id_get_target_kind() calls can be skipped (no side-effects, always returns the same target kind for the same action id), but likely not. This causes at least function call overhead, and may hinder optimization pass in general.
E.g. action in the beginning of is_action_possible() calls action_id_get_target_kind(wanted_action) five times, and more follow in non-assert code.
Looking at S3_0. Not sure (not looked in details) if compiler has any chance to deduct that action_id_get_target_kind() calls can be skipped (no side-effects, always returns the same target kind for the same action id), but likely not. This causes at least function call overhead, and may hinder optimization pass in general.
E.g. action in the beginning of is_action_possible() calls action_id_get_target_kind(wanted_action) five times, and more follow in non-assert code.