Try compiling with optimizations. I think by default this site doesn't add optimization flags.
Here what happens with optimizations: https://godbolt.org/z/G18zd7chP
Look at the registers usages vs stack
Here what happens with optimizations: https://godbolt.org/z/G18zd7chP
Look at the registers usages vs stack