Compile thus:
gcc a.c -O3 -Wall q.s; ./a.out
Clang OK.
Theory: Array e[sz] represents a number x between 0 and 1. 0≤x<1 and x = Σ[n>0]2−64nen−1. Routine div(r, j) replaces the value in x by (r+x)/j.

To print decimal value of x, each iteration of the outer loop prints the integral part of 1013x as a decimal numeral and replaces x by (1013x) mod 1. There is nothing magic about 13 except that 0<13<20.

See this about addq, divq and mulq. In 1957 IBM 704 machine code, to compute e in binary, without decimal printout or accuracy estimate, fit on one punched card of 22 instructions.