I came up with it by trial-and-arror. A tutorial found here https://www.codesdope.com/cpp-structure/ showed me another way (several ways) but not mine so I'm not sure why it worked. I wouldn't want to risk any undefined behavior.
Differences:
I passed s rather than &s.
The function received "datast st" rather than "struct datast *st".
I used dots rather than ->.
Both methods produced the same results. Why didn't mine fail? Does it happen to be also correct? The structure in general has also arrays and pointers that may be used later.
First method passes the struct "by value", effectively passing a copy of the original struct.
Second method passes a pointer to the struct, i.e. the struct is passed "by reference", no copy is created.
Both methods are legit, but passing a pointer can be more efficient, especially for "big" structs.
Also be aware that, if you pass a pointer, then any changes you make to the struct inside the function are reflected in the original struct! This would not the case when passing the struct "by value".
I missed something. I now added an instruction modifying a within the function. The original structure changes in both cases. The behaviour is the same. It could not be passing by value which is why I think it might be undefined behavior.