This is a program in Assembler x64 GNU syntax
.global main
.text
main:
xor %rax, %rax
mov %rax, %rbx
.L1:
add $1, %rbx
add %rbx, %rax
cmp $10, %rbx
jne .L1
ret
I did the loop manually and I found out that when the loop terminates hit the return function (ret), the rbx = 10 and rax = 45, but I do not understand how they go back to main function, and what happens when they go back there?