The problem was tricky to narrow down because if I cycle back and forth between having and not having the ^M characters, reproduction becomes unpredictable. I think some undesired states were persisting between sessions. When I started deleting semanticdb files between each run, reproduction behaved a bit better. I've found that the problematic lines are the header guard:
#endif // ^M here doesn't affect Semantic behavior
> Could you check if it is parsing the ^M file correctly? Just do:
> M-x bovinate RET
> and see if it has stuff in it that matches your expectation.
With the ^M after the header guards, I get only nil when I bovinate. When I remove them, I get more content.