// File: /workspace/github_c_makefile_star2_O0/LenShustek[P]miditones/miditones_scroll.c
// Function: main
int main (int argc, char *argv[]) {
   int argno;
   char *filebasename;
#define MAXPATH 80
   char filename[MAXPATH];

   printf ("MIDITONES_SCROLL V%s, (C) 2011,2019 Len Shustek\n", VERSION);
   if (argc == 1) {             /* no arguments */
      SayUsage (argv[0]);
      return 1; }

   argno = HandleOptions (argc, argv);   /* process options */
   if (codeoutput) showbytestream = true;
   filebasename = argv[argno];

   strlcpy (filename, filebasename, MAXPATH);   // Open the input file
   strlcat (filename, ".bin", MAXPATH);
   infile = fopen (filename, "rb");
   if (!infile) {
      fprintf (stderr, "Unable to open input file %s", filename);
      return 8; }
   printf("Opening %s\n", filename);

   strlcpy (filename, filebasename, MAXPATH); // open the output file
   strlcat (filename, codeoutput ? ".c" : ".txt", MAXPATH);
   outfile = fopen (filename, "w");
   if (!outfile) {
      fprintf (stderr, "Unable to open output file %s", filename);
      return 8; }
   printf("Creating %s\n", filename);
   infofile = codeoutput ? stdout : outfile;

   /* Read the whole input file into memory */

   fseek (infile, 0, SEEK_END); /* find file size */
   buflen = ftell (infile);
   fseek (infile, 0, SEEK_SET);
   buffer = (unsigned char *) malloc (buflen + 1);
   if (!buffer) {
      fprintf (stderr, "Unable to allocate %ld bytes for the file", buflen);
      return 8; }
   fread (buffer, buflen, 1, infile);
   fclose (infile);

   /* write the prologue */

   time_t rawtime;
   time (&rawtime);
   printf ("Reading %s.bin with %ld bytes\n", filebasename, buflen);
   if (!codeoutput) {
      fprintf(outfile, "MIDITONES_SCROLL V%s on %s", VERSION, asctime(localtime(&rawtime)));
      fprintf(outfile, "command line: ");
      for (int i = 0; i < argc; i++) fprintf(outfile, "%s ", argv[i]);
      fprintf(outfile, "\n");
      fprintf(outfile, "reading %s.bin with %ld bytes\n", filebasename, buflen);
      if (num_tonegens < MAX_TONEGENS) fprintf(outfile, "displaying only %d tone generators.\n", num_tonegens); }
   else {
      fprintf (outfile, "// Playtune bytestream for file \"%s.bin\"", filebasename);
      fprintf (outfile, " created by MIDITONES_SCROLL V%s on %s\n", VERSION,
               asctime (localtime (&rawtime)));
      fprintf (outfile, "const byte PROGMEM score [] = {\n"); }
   bufptr = lastbufptr = buffer;

   /* Check for the optional self-describing file header */

   struct file_hdr_t *hdrptr = (struct file_hdr_t *) buffer;
   if (buflen > sizeof (struct file_hdr_t) && hdrptr->id1 == 'P' && hdrptr->id2 == 't') {
      fprintf(infofile, "\nfound Pt self-describing file header with flags %02X %02X\n", hdrptr->f1, hdrptr->f2);
      fprintf(infofile, "  number of tone generators used: %d\n", hdrptr->num_tgens);
      if (hdrptr->f1 & HDR_F1_VOLUME_PRESENT)      fprintf(infofile, "  volume levels are present\n");
      if (hdrptr->f1 & HDR_F1_INSTRUMENTS_PRESENT) fprintf(infofile, "  instrument changes are present\n");
      if (hdrptr->f1 & HDR_F1_PERCUSSION_PRESENT)  fprintf(infofile, "  percussion is encoded as notes 128 to 255\n");

      expect_volume = hdrptr->f1 & HDR_F1_VOLUME_PRESENT;
      bufptr += hdrptr->hdr_length;
      lastbufptr = bufptr;
      if (codeoutput) {
         fprintf (outfile, "'P','t', 6, 0x%02X, 0x%02X, %2d, // (Playtune file header)\n",
                  hdrptr->f1, hdrptr->f2, hdrptr->num_tgens); } }

   /* Do the titles */

   fprintf (outfile, "\n");
   if (codeoutput) fprintf (outfile, "//");
   fprintf (outfile, "       time   ");
   for (unsigned i = 0; i < num_tonegens; ++i)
      fprintf (outfile, expect_volume && !ignore_volume ? "   gen%-5d" : " gen%-2d", i);
   fprintf(outfile, "delay");
   if (showbytestream) fprintf(outfile, "  addr  bytestream code");
   fprintf(outfile, "\n\n");
   for (gen = 0; gen < num_tonegens; ++gen)
      gen_note[gen] = SILENT;

   unsigned tonegens_used = 0;
   bool gotcommand = true;

   /* Process the commmands in order */

   for (; bufptr < buffer + buflen; ++bufptr) {
      cmd = *bufptr;
      if (cmd < 0x80) {         /*  delay  */
         if (!gotcommand) {
            ++consecutive_delays;
            warning = true; }
         gotcommand = false;
         delay = ((unsigned int)cmd << 8) + *++bufptr;
         print_status();       // tone generator status now
         timenow += delay;      // advance time
         for (gen = 0; gen < MAX_TONEGENS; ++gen)
            gen_did_stopnote[gen] = false; }
      else if (cmd != 0xf0 && cmd != 0xe0) {   /* a command */
         gotcommand = true;
         gen = cmd & 0x0f;
         if (gen > max_tonegen_found)
            max_tonegen_found = gen;
         cmd = cmd & 0xf0;
         if (cmd == 0x90) {     /*  note on  */
            gen_note[gen] = *++bufptr;  // note number
            tonegens_used |= 1 << gen;  // record that we used this generator at least once
            ++instrument_count[gen_instrument[gen]]; // count a use of this instrument
            if (gen_did_stopnote[gen]) { // unnecesary stop note
               ++stopnotes_before_startnote;
               warning = true; }
            if (expect_volume) {
               unsigned volume = gen_volume[gen] = *++bufptr;     // volume
               if (volume > max_vol) max_vol = volume;
               if (volume < min_vol) min_vol = volume; }
            if (gen >= num_tonegens) ++notes_skipped; // won't be displaying this note
         }
         else if (cmd == 0x80) {        /*  note off  */
            if (gen_note[gen] == SILENT)
               file_error("tone generator not on", bufptr);
            gen_note[gen] = SILENT;
            gen_did_stopnote[gen] = true; }
         else if (cmd == 0xc0) {        /* change instrument */
            got_instruments = true;
            gen_instrument[gen] = *++bufptr & 0x7f;
            gen_instrument_changed[gen] = true; }
         else {
            file_error("unknown command", bufptr);
            fprintf(stderr, "*** unknown command in input bytestream; see output file\n");
            exit(8); } } }

   /*  Do the final cleanup  */

   delay = 0;
   --bufptr;
   if (codeoutput)
      --bufptr;                 //don't do 0xf0 for code, because we don't want the trailing comma
   print_status ();             // print final status
   if (codeoutput) {
      fprintf (outfile, " 0x%02x};\n", *(bufptr+1) & 0xf0);
      unsigned num_tonegens_used = countbits (tonegens_used);
      fprintf (outfile, "// This score contains %ld bytes, and %d tone generator%s used.\n",
               buflen, num_tonegens_used, num_tonegens_used == 1 ? " is" : "s are"); }
   else
      fprintf (outfile, "\n");

   fprintf (infofile, "At most %u tone generators were used.\n", max_tonegen_found + 1);
   if (notes_skipped)
      fprintf (infofile, "%u notes were not displayed because we were told to show only %u generators.\n",
               notes_skipped, num_tonegens);
   fprintf (infofile, "%u stopnote commands were unnecessary.\n", stopnotes_before_startnote);
   fprintf (infofile, "%u consecutive delays could have been merged.\n", consecutive_delays);
   if (stopnotes_before_startnote + consecutive_delays > 0) fprintf (infofile, "(Those locations are marked with \"!\")\n");
   if (got_instruments) {
      fprintf(infofile, "instruments used:\n");
      for (int i = 0; i < 128; ++i)
         if (instrument_count[i]) {
            fprintf(infofile, " %s (%3d, 0x%02X) %7d\n", instrumentname[i], i, i, instrument_count[i]); } }
   if (expect_volume)
      fprintf(infofile, "volume ranged from %d to %d\n", min_vol, max_vol);
   printf ("Done.\n"); }

// Assembly:
subq $0xd8, %rsp
movl $0x0, 0xd4(%rsp)
movl %edi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
leaq 0x1602(%rip), %rdi      # 0x528a
leaq 0x162c(%rip), %rsi      # 0x52bb
movb $0x0, %al
callq 0x3080
cmpl $0x1, 0xd0(%rsp)
jne 0x3cc0
movq 0xc8(%rsp), %rax
movq (%rax), %rdi
callq 0x3210
movl $0x1, 0xd4(%rsp)
jmp 0x495e
movl 0xd0(%rsp), %edi
movq 0xc8(%rsp), %rsi
callq 0x3280
movl %eax, 0xc4(%rsp)
testb $0x1, 0x504e(%rip)      # 0x8d30
je 0x3ceb
movb $0x1, 0x43b9(%rip)      # 0x80a4
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xb8(%rsp)
leaq 0x60(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl $0x50, %edx
callq 0x3490
leaq 0x60(%rsp), %rdi
leaq 0x139f(%rip), %rsi      # 0x50c9
movl $0x50, %edx
callq 0x3550
leaq 0x60(%rsp), %rdi
leaq 0x1580(%rip), %rsi      # 0x52c0
callq 0x30f0
movq %rax, 0x52fc(%rip)      # 0x9048
cmpq $0x0, 0x52f4(%rip)      # 0x9048
jne 0x3d83
movq 0x429b(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x60(%rsp), %rdx
leaq 0x1557(%rip), %rsi      # 0x52c3
movb $0x0, %al
callq 0x3090
movl $0x8, 0xd4(%rsp)
jmp 0x495e
leaq 0x60(%rsp), %rsi
leaq 0x1551(%rip), %rdi      # 0x52e0
movb $0x0, %al
callq 0x3080
leaq 0x60(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl $0x50, %edx
callq 0x3490
leaq 0x60(%rsp), %rdi
movb 0x4f78(%rip), %cl       # 0x8d30
leaq 0x152d(%rip), %rsi      # 0x52ec
leaq 0x13bb(%rip), %rax      # 0x5181
testb $0x1, %cl
cmovneq %rax, %rsi
movl $0x50, %edx
callq 0x3550
leaq 0x60(%rsp), %rdi
leaq 0x1d06(%rip), %rsi      # 0x5ae9
callq 0x30f0
movq %rax, 0x5151(%rip)      # 0x8f40
cmpq $0x0, 0x5149(%rip)      # 0x8f40
jne 0x3e26
movq 0x41f8(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x60(%rsp), %rdx
leaq 0x14e2(%rip), %rsi      # 0x52f1
movb $0x0, %al
callq 0x3090
movl $0x8, 0xd4(%rsp)
jmp 0x495e
leaq 0x60(%rsp), %rsi
leaq 0x14dd(%rip), %rdi      # 0x530f
movb $0x0, %al
callq 0x3080
testb $0x1, 0x4ef0(%rip)      # 0x8d30
je 0x3e53
movq 0x418f(%rip), %rax      # 0x7fd8
movq (%rax), %rax
movq %rax, 0x28(%rsp)
jmp 0x3e5f
movq 0x50e6(%rip), %rax      # 0x8f40
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x51e5(%rip)      # 0x9050
movq 0x51d6(%rip), %rdi      # 0x9048
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x30e0
movq 0x51c1(%rip), %rdi      # 0x9048
callq 0x30a0
movq %rax, 0x50bd(%rip)      # 0x8f50
movq 0x51ae(%rip), %rdi      # 0x9048
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x30e0
movq 0x50a4(%rip), %rdi      # 0x8f50
addq $0x1, %rdi
callq 0x30c0
movq %rax, 0x508c(%rip)      # 0x8f48
cmpq $0x0, 0x5084(%rip)      # 0x8f48
jne 0x3ef5
movq 0x412b(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movq 0x5079(%rip), %rdx      # 0x8f50
leaq 0x143e(%rip), %rsi      # 0x531c
movb $0x0, %al
callq 0x3090
movl $0x8, 0xd4(%rsp)
jmp 0x495e
movq 0x504c(%rip), %rdi      # 0x8f48
movq 0x504d(%rip), %rsi      # 0x8f50
movq 0x513e(%rip), %rcx      # 0x9048
movl $0x1, %edx
callq 0x3050
movq 0x512d(%rip), %rdi      # 0x9048
callq 0x3060
leaq 0x58(%rsp), %rdi
callq 0x30b0
movq 0xb8(%rsp), %rsi
movq 0x5017(%rip), %rdx      # 0x8f50
leaq 0x1406(%rip), %rdi      # 0x5346
movb $0x0, %al
callq 0x3080
testb $0x1, 0x4de2(%rip)      # 0x8d30
jne 0x404b
movq 0x4fe5(%rip), %rax      # 0x8f40
movq %rax, 0x20(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3070
movq 0x20(%rsp), %rdi
movq %rax, %rcx
leaq 0x13e4(%rip), %rsi      # 0x5365
leaq 0x1333(%rip), %rdx      # 0x52bb
movb $0x0, %al
callq 0x3090
movq 0x4faa(%rip), %rdi      # 0x8f40
leaq 0x13e3(%rip), %rsi      # 0x5380
movb $0x0, %al
callq 0x3090
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
cmpl 0xd0(%rsp), %eax
jge 0x3fec
movq 0x4f80(%rip), %rdi      # 0x8f40
movq 0xc8(%rsp), %rax
movslq 0x54(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x13b7(%rip), %rsi      # 0x538f
movb $0x0, %al
callq 0x3090
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x3fac
movq 0x4f4d(%rip), %rdi      # 0x8f40
leaq 0x159b(%rip), %rsi      # 0x5595
movb $0x0, %al
callq 0x3090
movq 0x4f38(%rip), %rdi      # 0x8f40
movq 0xb8(%rsp), %rdx
movq 0x4f39(%rip), %rcx      # 0x8f50
leaq 0x1375(%rip), %rsi      # 0x5393
movb $0x0, %al
callq 0x3090
cmpl $0x10, 0x4074(%rip)     # 0x80a0
jae 0x4049
movq 0x4f0b(%rip), %rdi      # 0x8f40
movl 0x4065(%rip), %edx      # 0x80a0
leaq 0x1370(%rip), %rsi      # 0x53b2
movb $0x0, %al
callq 0x3090
jmp 0x40b8
movq 0x4eee(%rip), %rdi      # 0x8f40
movq 0xb8(%rsp), %rdx
leaq 0x1376(%rip), %rsi      # 0x53d7
movb $0x0, %al
callq 0x3090
movq 0x4ed1(%rip), %rax      # 0x8f40
movq %rax, 0x18(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3070
movq 0x18(%rsp), %rdi
movq %rax, %rcx
leaq 0x136b(%rip), %rsi      # 0x5400
leaq 0x121f(%rip), %rdx      # 0x52bb
movb $0x0, %al
callq 0x3090
movq 0x4e96(%rip), %rdi      # 0x8f40
leaq 0x1377(%rip), %rsi      # 0x5428
movb $0x0, %al
callq 0x3090
movq 0x4e89(%rip), %rax      # 0x8f48
movq %rax, 0x4f72(%rip)      # 0x9038
movq %rax, 0x4f73(%rip)      # 0x9040
movq 0x4e74(%rip), %rax      # 0x8f48
movq %rax, 0x48(%rsp)
cmpq $0x6, 0x4e6f(%rip)      # 0x8f50
jbe 0x4246
movq 0x48(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x50, %eax
jne 0x4246
movq 0x48(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x74, %eax
jne 0x4246
movq 0x4f3f(%rip), %rdi      # 0x9050
movq 0x48(%rsp), %rax
movzbl 0x3(%rax), %edx
movq 0x48(%rsp), %rax
movzbl 0x4(%rax), %ecx
leaq 0x131f(%rip), %rsi      # 0x5449
movb $0x0, %al
callq 0x3090
movq 0x4f18(%rip), %rdi      # 0x9050
movq 0x48(%rsp), %rax
movzbl 0x5(%rax), %edx
leaq 0x133d(%rip), %rsi      # 0x5485
movb $0x0, %al
callq 0x3090
movq 0x48(%rsp), %rax
movzbl 0x3(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x4177
movq 0x4ee7(%rip), %rdi      # 0x9050
leaq 0x133b(%rip), %rsi      # 0x54ab
movb $0x0, %al
callq 0x3090
movq 0x48(%rsp), %rax
movzbl 0x3(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x419d
movq 0x4ec1(%rip), %rdi      # 0x9050
leaq 0x1332(%rip), %rsi      # 0x54c8
movb $0x0, %al
callq 0x3090
movq 0x48(%rsp), %rax
movzbl 0x3(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x41c3
movq 0x4e9b(%rip), %rdi      # 0x9050
leaq 0x132e(%rip), %rsi      # 0x54ea
movb $0x0, %al
callq 0x3090
movq 0x48(%rsp), %rax
movzbl 0x3(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x4b52(%rip)       # 0x8d31
movq 0x48(%rsp), %rax
movzbl 0x2(%rax), %ecx
movq 0x4e51(%rip), %rax      # 0x9040
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x4e44(%rip)      # 0x9040
movq 0x4e3d(%rip), %rax      # 0x9040
movq %rax, 0x4e2e(%rip)      # 0x9038
testb $0x1, 0x4b1f(%rip)      # 0x8d30
je 0x4244
movq 0x4d26(%rip), %rdi      # 0x8f40
movq 0x48(%rsp), %rax
movzbl 0x3(%rax), %edx
movq 0x48(%rsp), %rax
movzbl 0x4(%rax), %ecx
movq 0x48(%rsp), %rax
movzbl 0x5(%rax), %r8d
leaq 0x12da(%rip), %rsi      # 0x5517
movb $0x0, %al
callq 0x3090
jmp 0x4246
movq 0x4cf3(%rip), %rdi      # 0x8f40
leaq 0x1341(%rip), %rsi      # 0x5595
movb $0x0, %al
callq 0x3090
testb $0x1, 0x4ace(%rip)      # 0x8d30
je 0x4279
movq 0x4cd5(%rip), %rdi      # 0x8f40
leaq 0xfc6(%rip), %rsi       # 0x5238
movb $0x0, %al
callq 0x3090
movq 0x4cc0(%rip), %rdi      # 0x8f40
leaq 0x12cc(%rip), %rsi      # 0x5553
movb $0x0, %al
callq 0x3090
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
cmpl 0x3e00(%rip), %eax      # 0x80a0
jae 0x42ff
movq 0x4c97(%rip), %rax      # 0x8f40
movq %rax, 0x8(%rsp)
xorl %eax, %eax
testb $0x1, 0x4a7a(%rip)      # 0x8d31
movb %al, 0x17(%rsp)
je 0x42c9
movb 0x4a6f(%rip), %al       # 0x8d32
xorb $-0x1, %al
movb %al, 0x17(%rsp)
movq 0x8(%rsp), %rdi
movb 0x17(%rsp), %cl
leaq 0x1294(%rip), %rsi      # 0x556d
leaq 0x1282(%rip), %rax      # 0x5562
testb $0x1, %cl
cmovneq %rax, %rsi
movl 0x44(%rsp), %edx
movb $0x0, %al
callq 0x3090
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x4296
movq 0x4c3a(%rip), %rdi      # 0x8f40
leaq 0x1269(%rip), %rsi      # 0x5576
movb $0x0, %al
callq 0x3090
testb $0x1, 0x3d89(%rip)      # 0x80a4
je 0x4332
movq 0x4c1c(%rip), %rdi      # 0x8f40
leaq 0x1251(%rip), %rsi      # 0x557c
movb $0x0, %al
callq 0x3090
movq 0x4c07(%rip), %rdi      # 0x8f40
leaq 0x1254(%rip), %rsi      # 0x5594
movb $0x0, %al
callq 0x3090
movb $0x0, 0x4d0a(%rip)      # 0x9058
movzbl 0x4d03(%rip), %eax      # 0x9058
cmpl 0x3d45(%rip), %eax      # 0x80a0
jae 0x4384
movzbl 0x4cf4(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x4c43(%rip), %rax      # 0x8fb0
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movb 0x4cde(%rip), %al       # 0x9058
addb $0x1, %al
movb %al, 0x4cd6(%rip)       # 0x9058
jmp 0x434e
movl $0x0, 0x40(%rsp)
movb $0x1, 0x3f(%rsp)
movq 0x4ca8(%rip), %rax      # 0x9040
movq 0x4ba9(%rip), %rcx      # 0x8f48
addq 0x4baa(%rip), %rcx      # 0x8f50
cmpq %rcx, %rax
jae 0x4725
movq 0x4c8a(%rip), %rax      # 0x9040
movb (%rax), %al
movb %al, 0x4c9b(%rip)       # 0x9059
movzbl 0x4c94(%rip), %eax      # 0x9059
cmpl $0x80, %eax
jge 0x4472
testb $0x1, 0x3f(%rsp)
jne 0x43ed
movl 0x493f(%rip), %eax      # 0x8d1c
addl $0x1, %eax
movl %eax, 0x4936(%rip)      # 0x8d1c
movb $0x1, 0x4933(%rip)      # 0x8d20
movb $0x0, 0x3f(%rsp)
movzbl 0x4c60(%rip), %eax      # 0x9059
shll $0x8, %eax
movq 0x4c3d(%rip), %rcx      # 0x9040
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x4c2f(%rip)      # 0x9040
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
movl %eax, 0x4c13(%rip)      # 0x9030
callq 0x37d0
movl 0x4c08(%rip), %eax      # 0x9030
addq 0x48f9(%rip), %rax      # 0x8d28
movq %rax, 0x48f2(%rip)      # 0x8d28
movb $0x0, 0x4c1b(%rip)      # 0x9058
movzbl 0x4c14(%rip), %eax      # 0x9058
cmpl $0x10, %eax
jge 0x446d
movzbl 0x4c08(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x4c07(%rip), %rax      # 0x9060
movb $0x0, (%rax,%rcx)
movb 0x4bf5(%rip), %al       # 0x9058
addb $0x1, %al
movb %al, 0x4bed(%rip)       # 0x9058
jmp 0x443d
jmp 0x470c
movzbl 0x4be0(%rip), %eax      # 0x9059
cmpl $0xf0, %eax
je 0x470a
movzbl 0x4bce(%rip), %eax      # 0x9059
cmpl $0xe0, %eax
je 0x470a
movb $0x1, 0x3f(%rsp)
movzbl 0x4bb7(%rip), %eax      # 0x9059
andl $0xf, %eax
movb %al, 0x4bad(%rip)       # 0x9058
movzbl 0x4ba6(%rip), %eax      # 0x9058
cmpl 0x4858(%rip), %eax      # 0x8d10
jbe 0x44c7
movzbl 0x4b97(%rip), %eax      # 0x9058
movl %eax, 0x4849(%rip)      # 0x8d10
movzbl 0x4b8b(%rip), %eax      # 0x9059
andl $0xf0, %eax
movb %al, 0x4b80(%rip)       # 0x9059
movzbl 0x4b79(%rip), %eax      # 0x9059
cmpl $0x90, %eax
jne 0x460e
movq 0x4b4e(%rip), %rax      # 0x9040
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x4b40(%rip)      # 0x9040
movzbl 0x1(%rax), %edx
movzbl 0x4b4d(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x4a9c(%rip), %rax      # 0x8fb0
movl %edx, (%rax,%rcx,4)
movzbl 0x4b3a(%rip), %ecx      # 0x9058
movl $0x1, %eax
shll %cl, %eax
orl 0x40(%rsp), %eax
movl %eax, 0x40(%rsp)
movzbl 0x4b24(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x4a33(%rip), %rax      # 0x8f70
movslq (%rax,%rcx,4), %rcx
leaq 0x47f8(%rip), %rax      # 0x8d40
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0x47eb(%rip), %rax      # 0x8d40
movl %edx, (%rax,%rcx,4)
movzbl 0x4af9(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x4af8(%rip), %rax      # 0x9060
testb $0x1, (%rax,%rcx)
je 0x4584
movl 0x47a4(%rip), %eax      # 0x8d18
addl $0x1, %eax
movl %eax, 0x479b(%rip)      # 0x8d18
movb $0x1, 0x479c(%rip)      # 0x8d20
testb $0x1, 0x47a6(%rip)      # 0x8d31
je 0x45eb
movq 0x4aac(%rip), %rax      # 0x9040
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x4a9e(%rip)      # 0x9040
movzbl 0x1(%rax), %eax
movzbl 0x4aab(%rip), %ecx      # 0x9058
movl %ecx, %edx
leaq 0x4a3a(%rip), %rcx      # 0x8ff0
movl %eax, (%rcx,%rdx,4)
movl %eax, 0x38(%rsp)
movl 0x38(%rsp), %eax
cmpl 0x4771(%rip), %eax      # 0x8d38
jbe 0x45d3
movl 0x38(%rsp), %eax
movl %eax, 0x4765(%rip)      # 0x8d38
movl 0x38(%rsp), %eax
cmpl 0x3acb(%rip), %eax      # 0x80a8
jae 0x45e9
movl 0x38(%rsp), %eax
movl %eax, 0x3abf(%rip)      # 0x80a8
jmp 0x45eb
movzbl 0x4a66(%rip), %eax      # 0x9058
cmpl 0x3aa8(%rip), %eax      # 0x80a0
jb 0x4609
movl 0x4714(%rip), %eax      # 0x8d14
addl $0x1, %eax
movl %eax, 0x470b(%rip)      # 0x8d14
jmp 0x4708
movzbl 0x4a44(%rip), %eax      # 0x9059
cmpl $0x80, %eax
jne 0x4675
movzbl 0x4a35(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x4984(%rip), %rax      # 0x8fb0
cmpl $-0x1, (%rax,%rcx,4)
jne 0x4645
movq 0x4a07(%rip), %rsi      # 0x9040
leaq 0xf57(%rip), %rdi       # 0x5597
callq 0x3680
movzbl 0x4a0c(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x495b(%rip), %rax      # 0x8fb0
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movzbl 0x49f5(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x49f4(%rip), %rax      # 0x9060
movb $0x1, (%rax,%rcx)
jmp 0x4706
movzbl 0x49dd(%rip), %eax      # 0x9059
cmpl $0xc0, %eax
jne 0x46cf
movb $0x1, 0x46aa(%rip)      # 0x8d34
movq 0x49af(%rip), %rax      # 0x9040
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x49a1(%rip)      # 0x9040
movzbl 0x1(%rax), %edx
andl $0x7f, %edx
movzbl 0x49ab(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x48ba(%rip), %rax      # 0x8f70
movl %edx, (%rax,%rcx,4)
movzbl 0x4998(%rip), %eax      # 0x9058
movl %eax, %ecx
leaq 0x4897(%rip), %rax      # 0x8f60
movb $0x1, (%rax,%rcx)
jmp 0x4704
movq 0x496a(%rip), %rsi      # 0x9040
leaq 0xed0(%rip), %rdi       # 0x55ad
callq 0x3680
movq 0x390f(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0xeca(%rip), %rsi       # 0x55bd
movb $0x0, %al
callq 0x3090
movl $0x8, %edi
callq 0x3100
jmp 0x4706
jmp 0x4708
jmp 0x470a
jmp 0x470c
jmp 0x470e
movq 0x492b(%rip), %rax      # 0x9040
addq $0x1, %rax
movq %rax, 0x4920(%rip)      # 0x9040
jmp 0x4391
movl $0x0, 0x4901(%rip)      # 0x9030
movq 0x490a(%rip), %rax      # 0x9040
addq $-0x1, %rax
movq %rax, 0x48ff(%rip)      # 0x9040
testb $0x1, 0x45e8(%rip)      # 0x8d30
je 0x475c
movq 0x48ef(%rip), %rax      # 0x9040
addq $-0x1, %rax
movq %rax, 0x48e4(%rip)      # 0x9040
callq 0x37d0
testb $0x1, 0x45c8(%rip)      # 0x8d30
je 0x47d8
movq 0x47cf(%rip), %rdi      # 0x8f40
movq 0x48c8(%rip), %rax      # 0x9040
movzbl 0x1(%rax), %edx
andl $0xf0, %edx
leaq 0xe6e(%rip), %rsi       # 0x55f7
movb $0x0, %al
callq 0x3090
movl 0x40(%rsp), %edi
callq 0x3c20
movl %eax, 0x34(%rsp)
movq 0x479c(%rip), %rdi      # 0x8f40
movq 0x47a5(%rip), %rdx      # 0x8f50
movl 0x34(%rsp), %ecx
movl 0x34(%rsp), %esi
leaq 0xe8d(%rip), %r8        # 0x5647
leaq 0xe82(%rip), %rax       # 0x5643
cmpl $0x1, %esi
cmoveq %rax, %r8
leaq 0xe33(%rip), %rsi       # 0x5602
movb $0x0, %al
callq 0x3090
jmp 0x47ed
movq 0x4761(%rip), %rdi      # 0x8f40
leaq 0xdaf(%rip), %rsi       # 0x5595
movb $0x0, %al
callq 0x3090
movq 0x485c(%rip), %rdi      # 0x9050
movl 0x4516(%rip), %edx      # 0x8d10
addl $0x1, %edx
leaq 0xe49(%rip), %rsi       # 0x564d
movb $0x0, %al
callq 0x3090
cmpl $0x0, 0x4502(%rip)      # 0x8d14
je 0x4835
movq 0x4835(%rip), %rdi      # 0x9050
movl 0x44f3(%rip), %edx      # 0x8d14
movl 0x3879(%rip), %ecx      # 0x80a0
leaq 0xe46(%rip), %rsi       # 0x5674
movb $0x0, %al
callq 0x3090
movq 0x4814(%rip), %rdi      # 0x9050
movl 0x44d6(%rip), %edx      # 0x8d18
leaq 0xe79(%rip), %rsi       # 0x56c2
movb $0x0, %al
callq 0x3090
movq 0x47f9(%rip), %rdi      # 0x9050
movl 0x44bf(%rip), %edx      # 0x8d1c
leaq 0xe86(%rip), %rsi       # 0x56ea
movb $0x0, %al
callq 0x3090
movl 0x44a7(%rip), %eax      # 0x8d18
addl 0x44a5(%rip), %eax      # 0x8d1c
cmpl $0x0, %eax
jbe 0x4891
movq 0x47cd(%rip), %rdi      # 0x9050
leaq 0xe8f(%rip), %rsi       # 0x5719
movb $0x0, %al
callq 0x3090
testb $0x1, 0x449c(%rip)      # 0x8d34
je 0x4926
movq 0x47ab(%rip), %rdi      # 0x9050
leaq 0xe94(%rip), %rsi       # 0x5740
movb $0x0, %al
callq 0x3090
movl $0x0, 0x30(%rsp)
cmpl $0x80, 0x30(%rsp)
jge 0x4924
movslq 0x30(%rsp), %rcx
leaq 0x446f(%rip), %rax      # 0x8d40
cmpl $0x0, (%rax,%rcx,4)
je 0x4915
movq 0x4772(%rip), %rdi      # 0x9050
movslq 0x30(%rsp), %rcx
leaq 0x3816(%rip), %rax      # 0x8100
movq (%rax,%rcx,8), %rdx
movl 0x30(%rsp), %ecx
movl 0x30(%rsp), %r8d
movslq 0x30(%rsp), %rsi
leaq 0x443d(%rip), %rax      # 0x8d40
movl (%rax,%rsi,4), %r9d
leaq 0xe45(%rip), %rsi       # 0x5753
movb $0x0, %al
callq 0x3090
jmp 0x4917
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x48bb
jmp 0x4926
testb $0x1, 0x4404(%rip)      # 0x8d31
je 0x4950
movq 0x471a(%rip), %rdi      # 0x9050
movl 0x376c(%rip), %edx      # 0x80a8
movl 0x43f6(%rip), %ecx      # 0x8d38
leaq 0xe21(%rip), %rsi       # 0x576a
movb $0x0, %al
callq 0x3090
leaq 0xe30(%rip), %rdi       # 0x5787
movb $0x0, %al
callq 0x3080
movl 0xd4(%rsp), %eax
addq $0xd8, %rsp
retq