push %rbp
mov %rsp,%rbp
mov %rdi,-0x18(%rbp)
mov %rsi,-0x20(%rbp)
mov -0x18(%rbp),%rax
mov (%rax),%eax
mov %eax,-0x4(%rbp)
mov -0x20(%rbp),%rax
mov (%rax),%edx
mov -0x18(%rbp),%rax
mov %edx,(%rax)
mov -0x20(%rbp),%rax
mov -0x4(%rbp),%edx
mov %edx,(%rax)
mov -0x18(%rbp),%rax
mov (%rax),%edx
mov -0x20(%rbp),%rax
mov (%rax),%eax
add %edx,%eax
pop %rbp
retq
I am just looking for someone to confirm my thinking, what I am seeing happen is that parameter 1 is taken and put 18 below rbp and parameter two is taken and put 20 below rbp and then it seems to me that the parameters are set to each other as in x=y and y=x however at the very end the second parameter is set to rax and then added to edx which i believe is the first parameter and then returned. Is this correct or am i way off?