The order is given by ni_axes. like in your example, "R-L,S-I,A-P" is x,y,z respectively.
Resulting in the order [x,y,z]:
[0,0,0]
[1,0,0]
[2,0,0]
...
[0,1,0]
[1,1,0]
...
If you're still wondring, run:
3dcalc -a 'anydataset+orig[0]' -prefix locations -expr 'i*10000+j*100+k'
3dAFNIto3D -prefix locations locations+orig
(note: anydataset must have less than 100 voxels in each direction)
resulting in a file containing values iijjkk, the voxel indices for xxyyzz.