// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x185f(%rip), %rdi      # 0x423e
leaq 0x1889(%rip), %rsi      # 0x426f
xorl %eax, %eax
callq 0x2090
cmpl $0x1, %ebp
je 0x3373
movl %ebp, %edi
movq %rbx, %rsi
callq 0x234c
cmpb $0x1, 0x46e9(%rip)      # 0x70f0
jne 0x2a10
movb $0x1, 0x46a4(%rip)      # 0x70b4
cltq
movq (%rbx,%rax,8), %r14
xorl %eax, %eax
cmpl $0x4f, %eax
je 0x2a2e
movb (%r14,%rax), %cl
movb %cl, 0x10(%rsp,%rax)
incq %rax
testb %cl, %cl
jne 0x2a18
jmp 0x2a33
movb $0x0, 0x10(%rsp,%rax)
leaq 0x1643(%rip), %rsi      # 0x407d
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x50, %edx
callq 0x24b3
leaq 0x1821(%rip), %rsi      # 0x4274
movq %r15, %rdi
callq 0x2110
movq %rax, 0x49a6(%rip)      # 0x7408
testq %rax, %rax
je 0x337f
leaq 0x1822(%rip), %rdi      # 0x4294
xorl %r15d, %r15d
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x2090
cmpl $0x4f, %r15d
je 0x2a99
movb (%r14,%r15), %al
movb %al, 0x10(%rsp,%r15)
incq %r15
testb %al, %al
jne 0x2a81
jmp 0x2a9f
movb $0x0, 0x10(%rsp,%r15)
leaq 0x168f(%rip), %rax      # 0x4135
leaq 0x17f3(%rip), %rsi      # 0x42a0
cmpb $0x0, 0x463c(%rip)      # 0x70f0
cmovneq %rax, %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x50, %edx
callq 0x24b3
leaq 0x1fc5(%rip), %rsi      # 0x4a96
movq %r15, %rdi
callq 0x2110
movq %rax, 0x4820(%rip)      # 0x7300
testq %rax, %rax
je 0x3392
leaq 0x17d3(%rip), %rdi      # 0x42c3
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x2090
cmpb $0x0, 0x45ed(%rip)      # 0x70f0
je 0x2b0e
movq 0x44c4(%rip), %rax      # 0x6fd0
jmp 0x2b15
leaq 0x47eb(%rip), %rax      # 0x7300
movq (%rax), %rax
movq %rax, 0x48f1(%rip)      # 0x7410
movq 0x48e2(%rip), %rdi      # 0x7408
xorl %esi, %esi
movl $0x2, %edx
callq 0x2100
movq 0x48cf(%rip), %rdi      # 0x7408
callq 0x20c0
movq %rax, 0x47cb(%rip)      # 0x7310
movq 0x48bc(%rip), %rdi      # 0x7408
xorl %esi, %esi
xorl %edx, %edx
callq 0x2100
movq 0x47b4(%rip), %r15      # 0x7310
leaq 0x1(%r15), %rdi
callq 0x20e0
movq %rax, 0x479c(%rip)      # 0x7308
testq %rax, %rax
je 0x33aa
movq 0x488c(%rip), %rcx      # 0x7408
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2060
movq 0x4875(%rip), %rdi      # 0x7408
callq 0x2070
leaq 0x8(%rsp), %rdi
callq 0x20d0
movq 0x4767(%rip), %rdx      # 0x7310
leaq 0x174a(%rip), %rdi      # 0x42fa
movq %r14, %rsi
xorl %eax, %eax
callq 0x2090
movq 0x473f(%rip), %r15      # 0x7300
cmpb $0x0, 0x4528(%rip)      # 0x70f0
je 0x2c34
leaq 0x17ba(%rip), %rsi      # 0x438b
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x20b0
movq 0x471b(%rip), %rbx      # 0x7300
leaq 0x8(%rsp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2080
leaq 0x17b6(%rip), %rsi      # 0x43b4
leaq 0x166a(%rip), %rdx      # 0x426f
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x20b0
movq 0x46e7(%rip), %rcx      # 0x7300
leaq 0x17bc(%rip), %rdi      # 0x43dc
movl $0x20, %esi
movl $0x1, %edx
callq 0x2130
jmp 0x2cfc
leaq 0x8(%rsp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2080
leaq 0x16cc(%rip), %rsi      # 0x4319
leaq 0x161b(%rip), %rdx      # 0x426f
movq %r15, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x20b0
movq 0x4698(%rip), %rcx      # 0x7300
leaq 0x16c5(%rip), %rdi      # 0x4334
movl $0xe, %esi
movl $0x1, %edx
callq 0x2130
testl %ebp, %ebp
jle 0x2cac
movl %ebp, %r12d
leaq 0x16b7(%rip), %r15      # 0x4343
xorl %r13d, %r13d
movq 0x466a(%rip), %rdi      # 0x7300
movq (%rbx,%r13,8), %rdx
movq %r15, %rsi
xorl %eax, %eax
callq 0x20b0
incq %r13
cmpq %r13, %r12
jne 0x2c8f
movq 0x464d(%rip), %rsi      # 0x7300
movl $0xa, %edi
callq 0x20a0
movq 0x463c(%rip), %rdi      # 0x7300
movq 0x4645(%rip), %rcx      # 0x7310
leaq 0x1675(%rip), %rsi      # 0x4347
movq %r14, %rdx
xorl %eax, %eax
callq 0x20b0
movl 0x43ce(%rip), %edx      # 0x70b0
cmpl $0x10, %edx
jae 0x2cfc
movq 0x4612(%rip), %rdi      # 0x7300
leaq 0x1671(%rip), %rsi      # 0x4366
xorl %eax, %eax
callq 0x20b0
movq 0x4605(%rip), %rbx      # 0x7308
movq %rbx, 0x46ee(%rip)      # 0x73f8
movq %rbx, 0x46ef(%rip)      # 0x7400
cmpq $0x7, 0x45f7(%rip)      # 0x7310
jb 0x2e25
cmpb $0x50, (%rbx)
jne 0x2e25
cmpb $0x74, 0x1(%rbx)
jne 0x2e25
movq 0x46d7(%rip), %rdi      # 0x7410
movzbl 0x3(%rbx), %edx
movzbl 0x4(%rbx), %ecx
leaq 0x16b5(%rip), %rsi      # 0x43fd
xorl %eax, %eax
callq 0x20b0
movq 0x46ba(%rip), %rdi      # 0x7410
movzbl 0x5(%rbx), %edx
leaq 0x16d8(%rip), %rsi      # 0x4439
xorl %eax, %eax
callq 0x20b0
movb 0x3(%rbx), %al
testb %al, %al
jns 0x2d8f
movq 0x469a(%rip), %rcx      # 0x7410
leaq 0x16e2(%rip), %rdi      # 0x445f
movl $0x1c, %esi
movl $0x1, %edx
callq 0x2130
movb 0x3(%rbx), %al
testb $0x40, %al
je 0x2db3
movq 0x4676(%rip), %rcx      # 0x7410
leaq 0x16db(%rip), %rdi      # 0x447c
movl $0x21, %esi
movl $0x1, %edx
callq 0x2130
movb 0x3(%rbx), %al
testb $0x20, %al
je 0x2dd7
movq 0x4652(%rip), %rcx      # 0x7410
leaq 0x16d9(%rip), %rdi      # 0x449e
movl $0x2c, %esi
movl $0x1, %edx
callq 0x2130
movb 0x3(%rbx), %al
movl %eax, %ecx
shrb $0x7, %cl
movb %cl, 0x430f(%rip)       # 0x70f1
movzbl 0x2(%rbx), %ecx
addq 0x4613(%rip), %rcx      # 0x7400
movq %rcx, 0x460c(%rip)      # 0x7400
movq %rcx, 0x45fd(%rip)      # 0x73f8
cmpb $0x1, 0x42ee(%rip)      # 0x70f0
jne 0x2e25
movq 0x44f5(%rip), %rdi      # 0x7300
movzbl %al, %edx
movzbl 0x4(%rbx), %ecx
movzbl 0x5(%rbx), %r8d
leaq 0x16ad(%rip), %rsi      # 0x44cb
xorl %eax, %eax
callq 0x20b0
movq 0x44d4(%rip), %rsi      # 0x7300
movl $0xa, %edi
callq 0x20a0
cmpb $0x1, 0x42b3(%rip)      # 0x70f0
jne 0x2e5c
movq 0x44ba(%rip), %rcx      # 0x7300
leaq 0x139f(%rip), %rdi      # 0x41ec
movl $0x2, %esi
movl $0x1, %edx
callq 0x2130
movq 0x449d(%rip), %rcx      # 0x7300
leaq 0x169d(%rip), %rdi      # 0x4507
movl $0xe, %esi
movl $0x1, %edx
callq 0x2130
cmpl $0x0, 0x4230(%rip)      # 0x70b0
je 0x2ec6
leaq 0x1698(%rip), %r14      # 0x4521
leaq 0x1686(%rip), %r15      # 0x4516
xorl %ebx, %ebx
testb $0x1, 0x4259(%rip)      # 0x70f2
movq %r14, %rsi
jne 0x2ea1
movq %r15, %rsi
movq 0x4458(%rip), %rdi      # 0x7300
cmpb $0x0, 0x4242(%rip)      # 0x70f1
cmoveq %r14, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
incl %ebx
cmpl 0x41ec(%rip), %ebx      # 0x70b0
jb 0x2e92
movq 0x4433(%rip), %rcx      # 0x7300
leaq 0x1656(%rip), %rdi      # 0x452a
movl $0x5, %esi
movl $0x1, %edx
callq 0x2130
cmpb $0x0, 0x41ca(%rip)      # 0x70b4
je 0x2f09
movq 0x440d(%rip), %rcx      # 0x7300
leaq 0x1636(%rip), %rdi      # 0x4530
movl $0x17, %esi
movl $0x1, %edx
callq 0x2130
movq 0x43f0(%rip), %rcx      # 0x7300
leaq 0x1631(%rip), %rdi      # 0x4548
movl $0x2, %esi
movl $0x1, %edx
callq 0x2130
movl 0x4184(%rip), %eax      # 0x70b0
xorl %ebp, %ebp
xorl %ecx, %ecx
testl %eax, %eax
je 0x2f4e
leaq 0x4435(%rip), %rdx      # 0x7370
movzbl %cl, %ecx
movl $0xffffffff, (%rdx,%rcx,4) # imm = 0xFFFFFFFF
incb %cl
movzbl %cl, %esi
cmpl %esi, %eax
ja 0x2f3b
movb %cl, 0x44c4(%rip)       # 0x7418
movq 0x44a5(%rip), %rsi      # 0x7400
movq 0x43a6(%rip), %rax      # 0x7308
addq 0x43a7(%rip), %rax      # 0x7310
cmpq %rax, %rsi
jae 0x3152
xorl %ebp, %ebp
movb $0x1, %al
leaq 0x43f3(%rip), %r14      # 0x7370
leaq 0x449c(%rip), %r15      # 0x7420
leaq 0x43a5(%rip), %r12      # 0x7330
leaq 0x438e(%rip), %r13      # 0x7320
leaq 0x4167(%rip), %rbx      # 0x7100
movzbl (%rsi), %edx
movb %dl, 0x4477(%rip)       # 0x7419
testb %dl, %dl
js 0x2ffb
testb $0x1, %al
jne 0x2fb7
incl 0x412c(%rip)            # 0x70dc
movb $0x1, 0x4129(%rip)      # 0x70e0
shll $0x8, %edx
leaq 0x1(%rsi), %rax
movq %rax, 0x443b(%rip)      # 0x7400
movzbl 0x1(%rsi), %eax
orl %edx, %eax
movl %eax, 0x441f(%rip)      # 0x73f0
callq 0x2617
movl 0x4414(%rip), %eax      # 0x73f0
addq %rax, 0x4105(%rip)      # 0x70e8
xorps %xmm0, %xmm0
movaps %xmm0, 0x4433(%rip)     # 0x7420
movb $0x10, 0x4424(%rip)     # 0x7418
xorl %eax, %eax
jmp 0x312a
movl %edx, %ecx
andb $-0x11, %cl
cmpb $-0x20, %cl
je 0x312a
movl %edx, %ecx
andl $0xf, %ecx
movb %cl, 0x4404(%rip)       # 0x7418
cmpl %ecx, 0x40b6(%rip)      # 0x70d0
jae 0x3022
movl %ecx, 0x40ae(%rip)      # 0x70d0
movl %edx, %eax
andb $-0x10, %al
movb %al, 0x43ed(%rip)       # 0x7419
cmpb $-0x80, %al
je 0x30fe
andl $-0x10, %edx
cmpl $0xc0, %edx
je 0x30d7
cmpl $0x90, %edx
jne 0x33cc
leaq 0x1(%rsi), %rax
movq %rax, 0x43a6(%rip)      # 0x7400
movzbl 0x1(%rsi), %eax
leal (,%rcx,4), %edx
movslq (%rdx,%r12), %rdi
incl (%rbx,%rdi,4)
movl %eax, (%rdx,%r14)
cmpb $0x1, (%rcx,%r15)
jne 0x3084
incl 0x405b(%rip)            # 0x70d8
movb $0x1, 0x405c(%rip)      # 0x70e0
cmpb $0x1, 0x4066(%rip)      # 0x70f1
jne 0x30c2
leaq 0x2(%rsi), %rax
movq %rax, 0x4368(%rip)      # 0x7400
movzbl 0x2(%rsi), %eax
leaq 0x430d(%rip), %rdx      # 0x73b0
movl %eax, (%rdx,%rcx,4)
cmpl %eax, 0x404c(%rip)      # 0x70f8
jae 0x30b4
movl %eax, 0x4044(%rip)      # 0x70f8
cmpl %eax, 0x3ffe(%rip)      # 0x70b8
jbe 0x30c2
movl %eax, 0x3ff6(%rip)      # 0x70b8
btsl %ecx, %ebp
movb $0x1, %al
cmpl %ecx, 0x3fe3(%rip)      # 0x70b0
ja 0x312a
incl 0x3fff(%rip)            # 0x70d4
jmp 0x312a
movb $0x1, %al
movb %al, 0x4015(%rip)       # 0x70f4
leaq 0x1(%rsi), %rdx
movq %rdx, 0x4316(%rip)      # 0x7400
movzbl 0x1(%rsi), %edx
andl $0x7f, %edx
movzbl %cl, %ecx
movl %edx, (%r12,%rcx,4)
movb %al, (%rcx,%r13)
jmp 0x312a
movzbl %cl, %eax
cmpl $-0x1, (%r14,%rax,4)
jne 0x311b
leaq 0x143c(%rip), %rdi      # 0x454b
callq 0x2529
movzbl 0x42fd(%rip), %eax      # 0x7418
movl $0xffffffff, (%r14,%rax,4) # imm = 0xFFFFFFFF
movb $0x1, (%rax,%r15)
movb $0x1, %al
movq 0x42cf(%rip), %rsi      # 0x7400
incq %rsi
movq %rsi, 0x42c5(%rip)      # 0x7400
movq 0x41c6(%rip), %rcx      # 0x7308
addq 0x41c7(%rip), %rcx      # 0x7310
cmpq %rcx, %rsi
jb 0x2f99
movl $0x0, 0x4294(%rip)      # 0x73f0
leaq -0x1(%rsi), %rax
movq %rax, 0x4299(%rip)      # 0x7400
cmpb $0x1, 0x3f82(%rip)      # 0x70f0
jne 0x317b
addq $-0x2, %rsi
movq %rsi, 0x4285(%rip)      # 0x7400
callq 0x2617
movq 0x4179(%rip), %rax      # 0x7300
cmpb $0x1, 0x3f62(%rip)      # 0x70f0
jne 0x31e0
movq 0x4269(%rip), %rcx      # 0x7400
movzbl 0x1(%rcx), %edx
andl $-0x10, %edx
leaq 0x1406(%rip), %rsi      # 0x45ab
xorl %ebx, %ebx
movq %rax, %rdi
xorl %eax, %eax
callq 0x20b0
testl %ebp, %ebp
je 0x31ef
xorl %ebx, %ebx
movl %ebp, %eax
movl %ebp, %ecx
andl $0x1, %ecx
addl %ecx, %ebx
shrl %eax
cmpl $0x1, %ebp
movl %eax, %ebp
ja 0x31b9
cmpl $0x1, %ebx
leaq 0x1424(%rip), %rax      # 0x45f7
leaq 0x1421(%rip), %r8       # 0x45fb
cmoveq %rax, %r8
jmp 0x31f6
movl $0xa, %edi
movq %rax, %rsi
callq 0x20a0
jmp 0x3214
leaq 0x1405(%rip), %r8       # 0x45fb
movq 0x4103(%rip), %rdi      # 0x7300
movq 0x410c(%rip), %rdx      # 0x7310
leaq 0x13ab(%rip), %rsi      # 0x45b6
movl %ebx, %ecx
xorl %eax, %eax
callq 0x20b0
movq 0x41f5(%rip), %rdi      # 0x7410
movl 0x3eaf(%rip), %edx      # 0x70d0
incl %edx
leaq 0x13d7(%rip), %rsi      # 0x4601
xorl %eax, %eax
callq 0x20b0
movl 0x3e9d(%rip), %edx      # 0x70d4
testl %edx, %edx
je 0x3256
movq 0x41ce(%rip), %rdi      # 0x7410
movl 0x3e68(%rip), %ecx      # 0x70b0
leaq 0x13d9(%rip), %rsi      # 0x4628
xorl %eax, %eax
callq 0x20b0
movq 0x41b3(%rip), %rdi      # 0x7410
movl 0x3e75(%rip), %edx      # 0x70d8
leaq 0x140c(%rip), %rsi      # 0x4676
xorl %eax, %eax
callq 0x20b0
movq 0x4198(%rip), %rdi      # 0x7410
movl 0x3e5e(%rip), %edx      # 0x70dc
leaq 0x1419(%rip), %rsi      # 0x469e
xorl %eax, %eax
callq 0x20b0
movl 0x3e46(%rip), %eax      # 0x70d8
addl 0x3e44(%rip), %eax      # 0x70dc
je 0x32b7
movq 0x416f(%rip), %rcx      # 0x7410
leaq 0x1425(%rip), %rdi      # 0x46cd
movl $0x26, %esi
movl $0x1, %edx
callq 0x2130
cmpb $0x1, 0x3e36(%rip)      # 0x70f4
jne 0x332c
movq 0x4149(%rip), %rcx      # 0x7410
leaq 0x1426(%rip), %rdi      # 0x46f4
movl $0x12, %esi
movl $0x1, %edx
callq 0x2130
leaq 0x36fc(%rip), %r15      # 0x69e0
leaq 0x3e15(%rip), %r12      # 0x7100
leaq 0x1415(%rip), %rbx      # 0x4707
xorl %r14d, %r14d
movl (%r12), %r9d
testl %r9d, %r9d
je 0x3318
movq 0x410b(%rip), %rdi      # 0x7410
movq (%r15), %rdx
movq %rbx, %rsi
movl %r14d, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x20b0
incq %r14
addq $0x8, %r15
addq $0x4, %r12
cmpq $0x80, %r14
jne 0x32f5
cmpb $0x1, 0x3dbe(%rip)      # 0x70f1
jne 0x3356
movq 0x40d4(%rip), %rdi      # 0x7410
movl 0x3d76(%rip), %edx      # 0x70b8
movl 0x3db0(%rip), %ecx      # 0x70f8
leaq 0x13cf(%rip), %rsi      # 0x471e
xorl %eax, %eax
callq 0x20b0
leaq 0x1ccb(%rip), %rdi      # 0x5028
callq 0x2050
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2209
movl $0x1, %eax
jmp 0x3364
movq 0x3c6a(%rip), %rax      # 0x6ff0
movq (%rax), %rdi
leaq 0xee7(%rip), %rsi       # 0x4277
jmp 0x33a3
movq 0x3c57(%rip), %rax      # 0x6ff0
movq (%rax), %rdi
leaq 0xf02(%rip), %rsi       # 0x42a5
leaq 0x10(%rsp), %rdx
jmp 0x33be
movq 0x3c3f(%rip), %rax      # 0x6ff0
movq (%rax), %rdi
leaq 0xf15(%rip), %rsi       # 0x42d0
movq %r15, %rdx
xorl %eax, %eax
callq 0x20b0
movl $0x8, %eax
jmp 0x3364
movq %rsi, %rdi
callq 0x21d5