In message , Wilco Dijkstra writes
Where you do need assembler to do something specific you want exactly that (often timing, cycles and space are important) and not have the compiler monkey around with it.
Where you do want assembler put it in a separate pure assembler function. If the overhead is much then the last thing you need is the compiler playing about "optimising it"