x86-64 Assembly - Sum of multiples of 3 or 5
if01 and if0 are not the greatest names.

Instead of reloading r9, use two registers. Let r9 always contain 3, and r10 always contain 5.

Increment r8 in one place.

Running the loop downwards (1000 to 0), rather than upwards, spares an instruction (cmp).

mov rdx, 0 is encoded in 7  bytes. xor rdx, rdx is way shorter.


All that said, consider
main:
    mov r8, 0   
    mov r9, 3
    mov r10, 5

    ; for i in (1000, 0] 
    mov rcx, 999

for0:   
    mov rax, rcx
    xor rdx, rdx
    div r9
    test rdx, rdx
    jeq accumulate

    mov rax, rcx
    xor rdx, rdx
    div r10
    test rdx, rdx
    jne next

accumulate:
    add r8, rcx
next:
    dec rcx
    jne  for0

PS: I hope you know that this problem has a very straightforward arithmetical solution.