Then I went to the websites of those manufacturers and entered my measurements to get a recommendation (My size would be an S for my 172cm height / 80cm inseam). If you'd like to get more visual about it, you can import those numbers (manually) into bikegeocalc.com
A S will drop your bar lower compared to the same saddle height on a M.
You need to know if you are flexible enough to have your hand that low for few hours rides.
But a S will have your bar nearer the saddle than a M, so you may end up less stretched to grab the hoods.
A S if too small for you, can have a longer stem and a seatpost with offset.
And you can usually put about 3cm of spacers max below the stem if too low.
A M if too big is trickier.
Straight seatpost and shorter stem are less ideal for handling.
For comparison, I have both a Canyon Ultimate and Carbonda CFR505 in M(54) both with a 90mm stem and straight seatpost, no spacers.
Canyon were hesitating between a S and M, when I contacted them.
And I'm 178cm/89cm inseam. So very roughly about 3cm shorter torso than you
My saddle is set at 76.5cm (BB/top of the saddle)
It looks difficult, but if you do your homework, it isn't that complex.
The good news is that as you look to be between two sizes, both will work with some eventual adaptations
My son, is your size more or less and rides a Carbonda CFR505 S with a 110mm stem.
I took it for a ride once, and it didn't feel strange.