I am miserably confused right now when trying to discern assembly language. I am asked to convert the following x86-84 code to Y86-84:
long arith(long int x, long int y, long int z) {
return (x+y+z) & (x+4+48*y);
}
In x86-64:
arith:
leaq (%rsi, %rsi, 2), %rax
salq $4, %rax
leaq 4(%rdi, %rax), %rax
addq %rdi, %rsi
addq %rdx, %rsi
andq %rsi, %rax
ret
Before I convert, I'm having a hard time understanding what's even going on in x86-64. I would be immensely appreciative to anyone who could walk me through what is even going on in this code.