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