3 .type div_digits, @function
5 # div_digits(digits, div, size, res, rem)
6 # divides an arbint in digits by uint64 div into res with remainder rem
7 # Either res or rem may alias digits
8 # digits = rdi, div = rsx, size = rdx, res = rcx, rem = r8
11 leaq -8(%rdi,%r9,8), %rdi # We want to point to the end of the buffer (LSB)
12 leaq -8(%rcx,%r9,8), %rcx # We want to point to the end of the buffer (LSB)
13 leaq -8(%r8,%r9,8), %r8 # We want to point to the end of the buffer (LSB)
17 divq %rsi # rdx:rax/rsi => rax, rdx:rax%rsi => rdx