dhc-1----Page:4
1  2  3  4  5  6  7  8  9  10  11  12  13  14 

One approach.
There are probably many approaches, this one is ISC's.
The in-memory format is wire format.
The output format is (nearly) identical to the input format.
So you need 2 functions per each option.
PPT Version