3 .type div_digits, @function
5 # div_digits(digits, div, size, res)
6 # divides an arbint in digits by uint64 div into res, returns remainder
8 # digits = rdi, div = rsx, size = rdx, res = rcx,
11 leaq -8(%rdi,%r8,8), %rdi # We want to point to the end of the buffer (LSB)
12 leaq -8(%rcx,%r8,8), %rcx # We want to point to the end of the buffer (LSB)
16 divq %rsi # rdx:rax/rsi => rax, rdx:rax%rsi => rdx
23 movq %rdx, %rax # return the remainder