C (gcc), 260 187 167 156 152 147 143143 138 bytes
i,*m,o;f*m;f(e){for(m=L"...",i=0;e>0;printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o))o=(e-=*m)<0?*m+e:*m++;*m++));}
Try it online!Try it online! Golfed from the reference implementation.
StackExchange removes unprintables, so the value of m
is replaced with "..."
.
Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6}
with the literal byte values of the integers.
00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228 6d3d i,*m,o;f*m;f(e){for(m=
00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02 060e m=L"L".....\n..\n...
00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30 3b65 .. \n...\n..",i=0i=0;e
00000030: 3b65 3e30 3b70 7269 6e74 6628 2225 2e32 7325 ;e>0;printf >0;printf("%.22s%
00000040: 7325 6420 222c 2231 7332 7332 7033 7333 7033 s%d d ","1s2s2p3s3"1s2s2p3s3p3
00000050: 7033 6434 7334 7034 6435 7335 7034 6635 6436 p3d4s4p4d5s5p4f5 d4s4p4d5s5p4f5d6
00000060: 6436 7336 7035 6636 6437 7337 7022 2b69 2b2b d6s6p5f6d7s7p"+is6p5f6d7s7p"+i++
00000070: 2b2b 2a32 2c6f2c28 2929652d 6f3d3d2a 28656d29 2d3d3c30 2a6d3f2a 6d2b ++*2*2,o))o=(e-=*m)<0?*m+
00000080: 293c 303f653a 2a6d 2b652b2b 3a2a2929 6d2b3b7d 2b3b 7d )<0?*m+e e:*m++;*m++));}
Alternatively, you could just copy the code from the TIO link.