I have to iterate through the stack to temporary move the values of the words to a register, something like this:
movq ((i - 3)*8)(%rsp), %esi
or
movq %rcx, %rbx # where %rcx is the counter
subq $3, %rbx
movq $8, %rax
mulq %rbx
movq (%rbx)(%rsp), %esi
But obviously, neither of the above works, so how should I change it to make it work?