I don't think that's correct; assuming RIP-relative for all the global variables, the first 9 instructions are 7 bytes each and the last one 4, giving a total of 67 bytes.
You can cherry-pick examples all you want, but I think this is a great example of why you should use Asm: It's not even trying to be optimised, and it still somehow manages to be smaller overall!
Try to optimise it, however, and you can definitely beat GCC...
lea rcx, [copyxe]
imul rax, [rcx], 3
add r9, rax
imul rax, [rcx+copyx-copyxe], -3
add r9, rax
imul rax, [rcx+sizex-copyxe], 3
add r10, rax
inc r14
...with 32 bytes. This human gives, for "-O2", the following 41-byte snippet: lea rcx, [copyxe]
mov rax, [rcx]
lea rax, [rax+rax*2]
add r9, rax
mov rax, [rcx+copyx-copyxe]
lea rax, [rax+rax*2]
sub r9, rax
mov rax, [rcx+sizex-copyxe]
lea rax, [rax+rax*2]
add r10, rax
inc r14
GCC may be clever to turn (-3) * x into x - 4 * x, but not clever enough to realise that turning 3 * x into x + 2 * x like it did for the other two "statements" and a subtraction would be shorter and faster because it means one less operation on the critical path.However assembly programmers will also instinctively avoid things that result in massive amounts of code because they have to manually write every line of it. Compared to C++ where templates are effectively a code generation meta-language. C makes you work a lot harder to generate huge amounts of machine code - and its binaries tend to be smaller because of it.
http://blog.stuffedcow.net/2013/05/measuring-rob-capacity/
The repeated use of rax is also no problem because of register renaming. Despite two dependency chains specifying rax, the CPU can detect that they're independent and assign different physical registers for rax, allowing them to execute in parallel.
Here's a small snippet I found from draw.asm:
72 bytes.Here's what GCC generates with -Os for the same code:
36 bytes.As a bonus, GCC with -O2:
52 bytes.So, not only does GCC hugely beat this snippet of handwritten Menuet assembly in code size, it can even do so handily while folding all the repeated additions into LEA and eliminating most of the loads.
This is an excellent example of why you shouldn't write in assembler.