#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
   char lineBuffer[1024];
   int  lineNo = 0;
   FILE *s19 = fopen(argv[1], "rb");
   while (fgets(lineBuffer, sizeof(lineBuffer), s19)) {
      lineNo++;
      if (lineBuffer[0] != '\0') { // Skip blank lines.
         if (strncmp(lineBuffer, "S0", 2) == 0) {
            printf("%04d: \"", lineNo);
            for (int i = 8; i < strlen(lineBuffer); i += 2) {
               char hex[3] = { lineBuffer[i], lineBuffer[i+1], '\0'};
               printf("%c", strtol(hex, NULL, 16));
            }
            printf("\"\n");
         }
      }
   }
   fclose(s19);
}

