This name isn't my favourite, I can't immediately tell what it means. How about something like "calculate_var_register_sizes"?
I am not sure about that name. The "register_sizes" part may confuse `count` with `regsize` and the "var" part may give the impression that it is just for one var.
I changed it to "calculate_resource_registers_counts". Is it good?
Do we need to return non-void here?
In fact, we do not. Changed it to void.