// File: /workspace/github_c_makefile_star2_O1/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 0x184e(%rip), %rdi      # 0x423e
leaq 0x1878(%rip), %rsi      # 0x426f
xorl %eax, %eax
callq 0x2090
cmpl $0x1, %ebp
je 0x338b
movl %ebp, %edi
movq %rbx, %rsi
callq 0x234c
cmpb $0x1, 0x46d8(%rip)      # 0x70f0
jne 0x2a21
movb $0x1, 0x4693(%rip)      # 0x70b4
cltq
movq (%rbx,%rax,8), %r14
xorl %ecx, %ecx
movl %ecx, %eax
cmpl $0x4f, %ecx
je 0x2a3f
movb (%r14,%rcx), %dl
movb %dl, 0x10(%rsp,%rcx)
incq %rcx
testb %dl, %dl
jne 0x2a29
addq %rsp, %rcx
addq $0x10, %rcx
cmpl $0x4f, %eax
jne 0x2a4e
movb $0x0, (%rcx)
leaq 0x1628(%rip), %rsi      # 0x407d
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x50, %edx
callq 0x24c1
leaq 0x1806(%rip), %rsi      # 0x4274
movq %r15, %rdi
callq 0x2110
movq %rax, 0x498b(%rip)      # 0x7408
testq %rax, %rax
je 0x3397
leaq 0x1807(%rip), %rdi      # 0x4294
xorl %r15d, %r15d
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x2090
movl %r15d, %eax
cmpl $0x4f, %r15d
je 0x2ab5
movb (%r14,%r15), %cl
movb %cl, 0x10(%rsp,%r15)
incq %r15
testb %cl, %cl
jne 0x2a9c
leaq (%rsp,%r15), %rcx
addq $0x10, %rcx
cmpl $0x4f, %eax
jne 0x2ac5
movb $0x0, (%rcx)
leaq 0x1669(%rip), %rax      # 0x4135
leaq 0x17cd(%rip), %rsi      # 0x42a0
cmpb $0x0, 0x4616(%rip)      # 0x70f0
cmovneq %rax, %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x50, %edx
callq 0x24c1
leaq 0x1f9f(%rip), %rsi      # 0x4a96
movq %r15, %rdi
callq 0x2110
movq %rax, 0x47fa(%rip)      # 0x7300
testq %rax, %rax
je 0x33aa
leaq 0x17ad(%rip), %rdi      # 0x42c3
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x2090
cmpb $0x0, 0x45c7(%rip)      # 0x70f0
je 0x2b34
movq 0x449e(%rip), %rax      # 0x6fd0
jmp 0x2b3b
leaq 0x47c5(%rip), %rax      # 0x7300
movq (%rax), %rax
movq %rax, 0x48cb(%rip)      # 0x7410
movq 0x48bc(%rip), %rdi      # 0x7408
xorl %esi, %esi
movl $0x2, %edx
callq 0x2100
movq 0x48a9(%rip), %rdi      # 0x7408
callq 0x20c0
movq %rax, 0x47a5(%rip)      # 0x7310
movq 0x4896(%rip), %rdi      # 0x7408
xorl %esi, %esi
xorl %edx, %edx
callq 0x2100
movq 0x478e(%rip), %r15      # 0x7310
leaq 0x1(%r15), %rdi
callq 0x20e0
movq %rax, 0x4776(%rip)      # 0x7308
testq %rax, %rax
je 0x33c2
movq 0x4866(%rip), %rcx      # 0x7408
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2060
movq 0x484f(%rip), %rdi      # 0x7408
callq 0x2070
leaq 0x8(%rsp), %rdi
callq 0x20d0
movq 0x4741(%rip), %rdx      # 0x7310
leaq 0x1724(%rip), %rdi      # 0x42fa
movq %r14, %rsi
xorl %eax, %eax
callq 0x2090
movq 0x4719(%rip), %r15      # 0x7300
cmpb $0x0, 0x4502(%rip)      # 0x70f0
je 0x2c5a
leaq 0x1794(%rip), %rsi      # 0x438b
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x20b0
movq 0x46f5(%rip), %rbx      # 0x7300
leaq 0x8(%rsp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2080
leaq 0x1790(%rip), %rsi      # 0x43b4
leaq 0x1644(%rip), %rdx      # 0x426f
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x20b0
movq 0x46c1(%rip), %rcx      # 0x7300
leaq 0x1796(%rip), %rdi      # 0x43dc
movl $0x20, %esi
movl $0x1, %edx
callq 0x2130
jmp 0x2d22
leaq 0x8(%rsp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2080
leaq 0x16a6(%rip), %rsi      # 0x4319
leaq 0x15f5(%rip), %rdx      # 0x426f
movq %r15, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x20b0
movq 0x4672(%rip), %rcx      # 0x7300
leaq 0x169f(%rip), %rdi      # 0x4334
movl $0xe, %esi
movl $0x1, %edx
callq 0x2130
testl %ebp, %ebp
jle 0x2cd2
movl %ebp, %r12d
leaq 0x1691(%rip), %r15      # 0x4343
xorl %r13d, %r13d
movq 0x4644(%rip), %rdi      # 0x7300
movq (%rbx,%r13,8), %rdx
movq %r15, %rsi
xorl %eax, %eax
callq 0x20b0
incq %r13
cmpq %r13, %r12
jne 0x2cb5
movq 0x4627(%rip), %rsi      # 0x7300
movl $0xa, %edi
callq 0x20a0
movq 0x4616(%rip), %rdi      # 0x7300
movq 0x461f(%rip), %rcx      # 0x7310
leaq 0x164f(%rip), %rsi      # 0x4347
movq %r14, %rdx
xorl %eax, %eax
callq 0x20b0
movl 0x43a8(%rip), %edx      # 0x70b0
cmpl $0x10, %edx
jae 0x2d22
movq 0x45ec(%rip), %rdi      # 0x7300
leaq 0x164b(%rip), %rsi      # 0x4366
xorl %eax, %eax
callq 0x20b0
movq 0x45df(%rip), %rbx      # 0x7308
movq %rbx, 0x46c8(%rip)      # 0x73f8
movq %rbx, 0x46c9(%rip)      # 0x7400
cmpq $0x7, 0x45d1(%rip)      # 0x7310
jb 0x2e46
cmpb $0x50, (%rbx)
jne 0x2e46
cmpb $0x74, 0x1(%rbx)
jne 0x2e46
movq 0x46b1(%rip), %rdi      # 0x7410
movzbl 0x3(%rbx), %edx
movzbl 0x4(%rbx), %ecx
leaq 0x168f(%rip), %rsi      # 0x43fd
xorl %eax, %eax
callq 0x20b0
movq 0x4694(%rip), %rdi      # 0x7410
movzbl 0x5(%rbx), %edx
leaq 0x16b2(%rip), %rsi      # 0x4439
xorl %eax, %eax
callq 0x20b0
cmpb $0x0, 0x3(%rbx)
jns 0x2db1
movq 0x4675(%rip), %rcx      # 0x7410
leaq 0x16bd(%rip), %rdi      # 0x445f
movl $0x1c, %esi
movl $0x1, %edx
callq 0x2130
testb $0x40, 0x3(%rbx)
je 0x2dd4
movq 0x4652(%rip), %rcx      # 0x7410
leaq 0x16b7(%rip), %rdi      # 0x447c
movl $0x21, %esi
movl $0x1, %edx
callq 0x2130
testb $0x20, 0x3(%rbx)
je 0x2df7
movq 0x462f(%rip), %rcx      # 0x7410
leaq 0x16b6(%rip), %rdi      # 0x449e
movl $0x2c, %esi
movl $0x1, %edx
callq 0x2130
movzbl 0x3(%rbx), %edx
movl %edx, %eax
shrb $0x7, %al
movb %al, 0x42eb(%rip)       # 0x70f1
movzbl 0x2(%rbx), %eax
addq 0x45ef(%rip), %rax      # 0x7400
movq %rax, 0x45e8(%rip)      # 0x7400
movq %rax, 0x45d9(%rip)      # 0x73f8
cmpb $0x1, 0x42ca(%rip)      # 0x70f0
jne 0x2e46
movq 0x44d1(%rip), %rdi      # 0x7300
movzbl 0x4(%rbx), %ecx
movzbl 0x5(%rbx), %r8d
leaq 0x168c(%rip), %rsi      # 0x44cb
xorl %eax, %eax
callq 0x20b0
movq 0x44b3(%rip), %rsi      # 0x7300
movl $0xa, %edi
callq 0x20a0
cmpb $0x1, 0x4292(%rip)      # 0x70f0
jne 0x2e7d
movq 0x4499(%rip), %rcx      # 0x7300
leaq 0x137e(%rip), %rdi      # 0x41ec
movl $0x2, %esi
movl $0x1, %edx
callq 0x2130
movq 0x447c(%rip), %rcx      # 0x7300
leaq 0x167c(%rip), %rdi      # 0x4507
movl $0xe, %esi
movl $0x1, %edx
callq 0x2130
cmpl $0x0, 0x420f(%rip)      # 0x70b0
je 0x2ee7
leaq 0x1677(%rip), %r14      # 0x4521
leaq 0x1665(%rip), %r15      # 0x4516
xorl %ebx, %ebx
testb $0x1, 0x4238(%rip)      # 0x70f2
movq %r14, %rsi
jne 0x2ec2
movq %r15, %rsi
movq 0x4437(%rip), %rdi      # 0x7300
cmpb $0x0, 0x4221(%rip)      # 0x70f1
cmoveq %r14, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
incl %ebx
cmpl 0x41cb(%rip), %ebx      # 0x70b0
jb 0x2eb3
movq 0x4412(%rip), %rcx      # 0x7300
leaq 0x1635(%rip), %rdi      # 0x452a
movl $0x5, %esi
movl $0x1, %edx
callq 0x2130
cmpb $0x0, 0x41a9(%rip)      # 0x70b4
je 0x2f2a
movq 0x43ec(%rip), %rcx      # 0x7300
leaq 0x1615(%rip), %rdi      # 0x4530
movl $0x17, %esi
movl $0x1, %edx
callq 0x2130
movq 0x43cf(%rip), %rcx      # 0x7300
leaq 0x1610(%rip), %rdi      # 0x4548
movl $0x2, %esi
movl $0x1, %edx
callq 0x2130
movl 0x4163(%rip), %eax      # 0x70b0
xorl %ebp, %ebp
xorl %ecx, %ecx
testl %eax, %eax
je 0x2f6f
leaq 0x4414(%rip), %rdx      # 0x7370
movzbl %cl, %ecx
movl $0xffffffff, (%rdx,%rcx,4) # imm = 0xFFFFFFFF
incb %cl
movzbl %cl, %esi
cmpl %esi, %eax
ja 0x2f5c
movb %cl, 0x44a3(%rip)       # 0x7418
movq 0x4484(%rip), %rsi      # 0x7400
movq 0x4385(%rip), %rax      # 0x7308
addq 0x4386(%rip), %rax      # 0x7310
cmpq %rax, %rsi
jae 0x3173
xorl %ebp, %ebp
movb $0x1, %al
leaq 0x43d2(%rip), %r14      # 0x7370
leaq 0x447b(%rip), %r15      # 0x7420
leaq 0x4384(%rip), %r12      # 0x7330
leaq 0x436d(%rip), %r13      # 0x7320
leaq 0x4146(%rip), %rbx      # 0x7100
movzbl (%rsi), %edx
movb %dl, 0x4456(%rip)       # 0x7419
testb %dl, %dl
js 0x301c
testb $0x1, %al
jne 0x2fd8
incl 0x410b(%rip)            # 0x70dc
movb $0x1, 0x4108(%rip)      # 0x70e0
shll $0x8, %edx
leaq 0x1(%rsi), %rax
movq %rax, 0x441a(%rip)      # 0x7400
movzbl 0x1(%rsi), %eax
orl %edx, %eax
movl %eax, 0x43fe(%rip)      # 0x73f0
callq 0x2625
movl 0x43f3(%rip), %eax      # 0x73f0
addq %rax, 0x40e4(%rip)      # 0x70e8
xorps %xmm0, %xmm0
movaps %xmm0, 0x4412(%rip)     # 0x7420
movb $0x10, 0x4403(%rip)     # 0x7418
xorl %eax, %eax
jmp 0x314b
movl %edx, %ecx
andb $-0x11, %cl
cmpb $-0x20, %cl
je 0x314b
movl %edx, %ecx
andl $0xf, %ecx
movb %cl, 0x43e3(%rip)       # 0x7418
cmpl %ecx, 0x4095(%rip)      # 0x70d0
jae 0x3043
movl %ecx, 0x408d(%rip)      # 0x70d0
movl %edx, %eax
andb $-0x10, %al
movb %al, 0x43cc(%rip)       # 0x7419
cmpb $-0x80, %al
je 0x311f
andl $-0x10, %edx
cmpl $0xc0, %edx
je 0x30f8
cmpl $0x90, %edx
jne 0x33e4
leaq 0x1(%rsi), %rax
movq %rax, 0x4385(%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 0x30a5
incl 0x403a(%rip)            # 0x70d8
movb $0x1, 0x403b(%rip)      # 0x70e0
cmpb $0x1, 0x4045(%rip)      # 0x70f1
jne 0x30e3
leaq 0x2(%rsi), %rax
movq %rax, 0x4347(%rip)      # 0x7400
movzbl 0x2(%rsi), %eax
leaq 0x42ec(%rip), %rdx      # 0x73b0
movl %eax, (%rdx,%rcx,4)
cmpl %eax, 0x402b(%rip)      # 0x70f8
jae 0x30d5
movl %eax, 0x4023(%rip)      # 0x70f8
cmpl %eax, 0x3fdd(%rip)      # 0x70b8
jbe 0x30e3
movl %eax, 0x3fd5(%rip)      # 0x70b8
btsl %ecx, %ebp
movb $0x1, %al
cmpl %ecx, 0x3fc2(%rip)      # 0x70b0
ja 0x314b
incl 0x3fde(%rip)            # 0x70d4
jmp 0x314b
movb $0x1, %al
movb %al, 0x3ff4(%rip)       # 0x70f4
leaq 0x1(%rsi), %rdx
movq %rdx, 0x42f5(%rip)      # 0x7400
movzbl 0x1(%rsi), %edx
andl $0x7f, %edx
movzbl %cl, %ecx
movl %edx, (%r12,%rcx,4)
movb %al, (%rcx,%r13)
jmp 0x314b
movzbl %cl, %eax
cmpl $-0x1, (%r14,%rax,4)
jne 0x3135
leaq 0x141b(%rip), %rdi      # 0x454b
callq 0x2537
movzbl 0x42dc(%rip), %eax      # 0x7418
movl $0xffffffff, (%r14,%rax,4) # imm = 0xFFFFFFFF
movb $0x1, (%rax,%r15)
movb $0x1, %al
movq 0x42ae(%rip), %rsi      # 0x7400
incq %rsi
movq %rsi, 0x42a4(%rip)      # 0x7400
movq 0x41a5(%rip), %rcx      # 0x7308
addq 0x41a6(%rip), %rcx      # 0x7310
cmpq %rcx, %rsi
jb 0x2fba
movl $0x0, 0x4273(%rip)      # 0x73f0
leaq -0x1(%rsi), %rax
movq %rax, 0x4278(%rip)      # 0x7400
cmpb $0x1, 0x3f61(%rip)      # 0x70f0
jne 0x319c
addq $-0x2, %rsi
movq %rsi, 0x4264(%rip)      # 0x7400
callq 0x2625
movq 0x4158(%rip), %rax      # 0x7300
cmpb $0x1, 0x3f41(%rip)      # 0x70f0
jne 0x321f
movq 0x4248(%rip), %rcx      # 0x7400
movzbl 0x1(%rcx), %edx
andl $-0x10, %edx
leaq 0x13e5(%rip), %rsi      # 0x45ab
xorl %ebx, %ebx
movq %rax, %rdi
xorl %eax, %eax
callq 0x20b0
testl %ebp, %ebp
je 0x31ea
xorl %ebx, %ebx
movl %ebp, %eax
movl %ebp, %ecx
andl $0x1, %ecx
addl %ecx, %ebx
shrl %eax
cmpl $0x1, %ebp
movl %eax, %ebp
ja 0x31da
movq 0x410f(%rip), %rdi      # 0x7300
movq 0x4118(%rip), %rdx      # 0x7310
cmpl $0x1, %ebx
leaq 0x13f5(%rip), %rax      # 0x45f7
leaq 0x13f2(%rip), %r8       # 0x45fb
cmoveq %rax, %r8
leaq 0x13a2(%rip), %rsi      # 0x45b6
movl %ebx, %ecx
xorl %eax, %eax
callq 0x20b0
jmp 0x322c
movl $0xa, %edi
movq %rax, %rsi
callq 0x20a0
movq 0x41dd(%rip), %rdi      # 0x7410
movl 0x3e97(%rip), %edx      # 0x70d0
incl %edx
leaq 0x13bf(%rip), %rsi      # 0x4601
xorl %eax, %eax
callq 0x20b0
movl 0x3e85(%rip), %edx      # 0x70d4
testl %edx, %edx
je 0x326e
movq 0x41b6(%rip), %rdi      # 0x7410
movl 0x3e50(%rip), %ecx      # 0x70b0
leaq 0x13c1(%rip), %rsi      # 0x4628
xorl %eax, %eax
callq 0x20b0
movq 0x419b(%rip), %rdi      # 0x7410
movl 0x3e5d(%rip), %edx      # 0x70d8
leaq 0x13f4(%rip), %rsi      # 0x4676
xorl %eax, %eax
callq 0x20b0
movq 0x4180(%rip), %rdi      # 0x7410
movl 0x3e46(%rip), %edx      # 0x70dc
leaq 0x1401(%rip), %rsi      # 0x469e
xorl %eax, %eax
callq 0x20b0
movl 0x3e2e(%rip), %eax      # 0x70d8
addl 0x3e2c(%rip), %eax      # 0x70dc
je 0x32cf
movq 0x4157(%rip), %rcx      # 0x7410
leaq 0x140d(%rip), %rdi      # 0x46cd
movl $0x26, %esi
movl $0x1, %edx
callq 0x2130
cmpb $0x1, 0x3e1e(%rip)      # 0x70f4
jne 0x3344
movq 0x4131(%rip), %rcx      # 0x7410
leaq 0x140e(%rip), %rdi      # 0x46f4
movl $0x12, %esi
movl $0x1, %edx
callq 0x2130
leaq 0x36e4(%rip), %r15      # 0x69e0
leaq 0x3dfd(%rip), %r12      # 0x7100
leaq 0x13fd(%rip), %rbx      # 0x4707
xorl %r14d, %r14d
movl (%r12), %r9d
testl %r9d, %r9d
je 0x3330
movq 0x40f3(%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 0x330d
cmpb $0x1, 0x3da6(%rip)      # 0x70f1
jne 0x336e
movq 0x40bc(%rip), %rdi      # 0x7410
movl 0x3d5e(%rip), %edx      # 0x70b8
movl 0x3d98(%rip), %ecx      # 0x70f8
leaq 0x13b7(%rip), %rsi      # 0x471e
xorl %eax, %eax
callq 0x20b0
leaq 0x1cb3(%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 0x220d
movl $0x1, %eax
jmp 0x337c
movq 0x3c52(%rip), %rax      # 0x6ff0
movq (%rax), %rdi
leaq 0xecf(%rip), %rsi       # 0x4277
jmp 0x33bb
movq 0x3c3f(%rip), %rax      # 0x6ff0
movq (%rax), %rdi
leaq 0xeea(%rip), %rsi       # 0x42a5
leaq 0x10(%rsp), %rdx
jmp 0x33d6
movq 0x3c27(%rip), %rax      # 0x6ff0
movq (%rax), %rdi
leaq 0xefd(%rip), %rsi       # 0x42d0
movq %r15, %rdx
xorl %eax, %eax
callq 0x20b0
movl $0x8, %eax
jmp 0x337c
movq %rsi, %rdi
callq 0x21d9