fragment: Make the codes to make entries of 'sidx' into a function.
fragment: Make the codes to write 'sidx's into a function.
file: Move the data rearrangement function into file.{c|h}.