// File: /workspace/github_c_makefile_star2_O0/thegenemyers[P]DASCRUBBER/DASqv.c
// Function: main
int main(int argc, char *argv[])
{ char  *root, *dpwd;
  int64  novl;
  int    c;

  DAZZ_EXTRA ex_hgap, ex_covr;
  DAZZ_EXTRA ex_cest, ex_qvs, ex_dif;

  char *cest_name = "Coverage Estimate";
  char *qvs_name  = "Histogram of QVs";
  char *dif_name  = "Histogram of Tile Differences";
  int64 cover64;

  //  Process arguments

  { int  i, j, k;
    int  flags[128];
    char *eptr;

    ARG_INIT("DASqv")

    COVERAGE = -1;

    j = 1;
    for (i = 1; i < argc; i++)
      if (argv[i][0] == '-')
        switch (argv[i][1])
        { default:
            ARG_FLAGS("v")
            break;
          case 'c':
            ARG_POSITIVE(COVERAGE,"Voting depth")
            break;
        }
      else
        argv[j++] = argv[i];
    argc = j;

    VERBOSE = flags['v'];

    if (argc < 3)
      { fprintf(stderr,"Usage: %s %s\n",Prog_Name,Usage);
        fprintf(stderr,"\n");
        fprintf(stderr,"      -v: Verbose mode, output statistics as proceed.\n");
        fprintf(stderr,"      -c: Use this as the average coverage (not DAScover estimate).\n");
        exit (1);
      }
  }

  //  Open trimmed DB

  { int status;

    status = Open_DB(argv[1],DB);
    if (status < 0)
      exit (1);
    if (status == 1)
      { fprintf(stderr,"%s: Cannot be called on a .dam index: %s\n",Prog_Name,argv[1]);
        exit (1);
      }
    if (DB->part)
      { fprintf(stderr,"%s: Cannot be called on a block: %s\n",Prog_Name,argv[1]);
        exit (1);
      }
    Trim_DB(DB);
  }

  //  Get .covr track information

  { FILE      *afile;
    char      *aname;
    int        extra, cmax;
    int64     *cgram;

    aname = Strdup(Catenate(DB->path,".","covr",".anno"),"Allocating anno file");
    if (aname == NULL)
      exit (1);
    afile  = fopen(aname,"r");
    if (afile == NULL)
      { fprintf(stderr,"%s: Must have a 'covr' track, run DAScover\n",Prog_Name);
        exit (1);
      }

    fseeko(afile,0,SEEK_END);
    extra = ftell(afile) - sizeof(int)*2;
    fseeko(afile,-extra,SEEK_END);
    ex_covr.nelem = 0;
    if (Read_Extra(afile,aname,&ex_covr) != 0)
      { fprintf(stderr,"%s: Histogram extra missing from .covr track?\n",Prog_Name);
        exit (1);
      }
    ex_hgap.nelem = 0;
    if (Read_Extra(afile,aname,&ex_hgap) != 0)
      { fprintf(stderr,"%s: Hgap threshold extra missing from .covr track?\n",Prog_Name);
        exit (1);
      }
    fclose(afile);

    HGAP_MIN = (int) ((int64 *) (ex_hgap.value))[0];
    cgram    = (int64 *) (ex_covr.value);
    cmax     = ex_covr.nelem - 1;

    if (COVERAGE < 0)
      { int i;

        i = 0;
        while (cgram[i+1] < cgram[i])
          i += 1;
        for (COVERAGE = i++; i < cmax; i++)
          if (cgram[COVERAGE] < cgram[i])
            COVERAGE = i;
      }

    if (COVERAGE >= 40)
      QV_DEEP = COVERAGE/8;
     else if (COVERAGE >= 20)
       QV_DEEP = 5;
     else if (COVERAGE >= 4)
       QV_DEEP = COVERAGE/4;
     else
       { fprintf(stderr,"%s: Average coverage is too low (< 4X), cannot infer qv's\n",Prog_Name);
         exit (1);
       }
  }

  //  Setup extras

  ex_cest.vtype = DB_INT;      // Estimated coverage (same for every .las)
  ex_cest.nelem = 1;
  ex_cest.accum = DB_EXACT;
  ex_cest.name  = cest_name;
  cover64 = COVERAGE;
  ex_cest.value = &cover64;

  ex_qvs.vtype = DB_INT;      //  Histogram of MAXQV1 trace-point diff counts
  ex_qvs.nelem = MAXQV1;
  ex_qvs.accum = DB_SUM;
  ex_qvs.name  = qvs_name;
  ex_qvs.value = &qgram;

  ex_dif.vtype = DB_INT;     //  Histogram of MAXQV1 intrinisic qv counts
  ex_dif.nelem = MAXQV1;
  ex_dif.accum = DB_SUM;
  ex_dif.name  = dif_name;
  ex_dif.value = &sgram;

  //  For each .las file do

  dpwd = PathTo(argv[1]);
  root = Root(argv[1],".db");

  for (c = 2; c < argc; c++)
    { Block_Looper *parse;
      FILE         *input;

      parse = Parse_Block_LAS_Arg(argv[c]);

      while ((input = Next_Block_Arg(parse)) != NULL)
        { DB_PART  = 0;
          DB_FIRST = 0;
          DB_LAST  = DB->nreads;

          //  Determine if overlap block is being processed and if so get first and last read
          //    from .db file

          { FILE *dbfile;
            char  buffer[2*MAX_NAME+100];
            char *p, *eptr;
            int   i, part, nfiles, nblocks, cutoff, all, oindx;
            int64 size;

            p = rindex(Block_Arg_Root(parse),'.');
            if (p != NULL)
              { part = strtol(p+1,&eptr,10);
                if (*eptr == '\0' && eptr != p+1)
                  { dbfile = Fopen(Catenate(dpwd,"/",root,".db"),"r");
                    if (dbfile == NULL)
                      exit (1);
                    if (fscanf(dbfile,DB_NFILE,&nfiles) != 1)
                      SYSTEM_READ_ERROR
                    for (i = 0; i < nfiles; i++)
                      if (fgets(buffer,2*MAX_NAME+100,dbfile) == NULL)
                        SYSTEM_READ_ERROR
                    if (fscanf(dbfile,DB_NBLOCK,&nblocks) != 1)
                      SYSTEM_READ_ERROR
                    if (fscanf(dbfile,DB_PARAMS,&size,&cutoff,&all) != 3)
                      SYSTEM_READ_ERROR
                    for (i = 1; i <= part; i++)
                      if (fscanf(dbfile,DB_BDATA,&oindx,&DB_FIRST) != 2)
                        SYSTEM_READ_ERROR
                    if (fscanf(dbfile,DB_BDATA,&oindx,&DB_LAST) != 2)
                      SYSTEM_READ_ERROR
                    fclose(dbfile);
                    DB_PART = part;
                  }
              }
          }

          //   Set up preliminary trimming track

          if (DB_PART > 0)
            { QV_AFILE = Fopen(Catenate(dpwd,PATHSEP,root,
                                        Numbered_Suffix(".",DB_PART,".qual.anno")),"w");
              QV_DFILE = Fopen(Catenate(dpwd,PATHSEP,root,
                                        Numbered_Suffix(".",DB_PART,".qual.data")),"w");
            }
          else
            { QV_AFILE = Fopen(Catenate(dpwd,PATHSEP,root,".qual.anno"),"w");
              QV_DFILE = Fopen(Catenate(dpwd,PATHSEP,root,".qual.data"),"w");
            }
          if (QV_AFILE == NULL || QV_DFILE == NULL)
            exit (1);

          { int size, length;

            length = DB_LAST - DB_FIRST;
            size   = sizeof(int64);
            fwrite(&length,sizeof(int),1,QV_AFILE);
            fwrite(&size,sizeof(int),1,QV_AFILE);
            QV_INDEX = 0;
            fwrite(&QV_INDEX,sizeof(int64),1,QV_AFILE);
          }

          //  Get trace point spacing information

          fread(&novl,sizeof(int64),1,input);
          fread(&TRACE_SPACING,sizeof(int),1,input);

          //  Initialize statistics gathering

          { int i;

            nreads = 0;
            totlen = 0;
            for (i = 0; i <= MAXQV; i++)
              qgram[i] = sgram[i] = 0;
          }

          if (VERBOSE)
            { printf("\n\nDASqv");
              if (HGAP_MIN > 0)
                printf(" -H%d",HGAP_MIN);
              printf(" -c%d %s %s\n\n",COVERAGE,argv[1],Block_Arg_Root(parse));
              fflush(stdout);
            }

          //  Process each read pile

          make_a_pass(input,CALCULATE_QVS,1);

          //  Write out extras and close .qual track

          Write_Extra(QV_AFILE,&ex_hgap);
          Write_Extra(QV_AFILE,&ex_cest);
          Write_Extra(QV_AFILE,&ex_qvs);
          Write_Extra(QV_AFILE,&ex_dif);

          fclose(QV_AFILE);
          fclose(QV_DFILE);
          fclose(input);

          //  If verbose output statistics summary to stdout

          if (VERBOSE)
            { int   i;
              int64 ssum, qsum;
              int64 stotal, qtotal;
              int   gval, bval;

              printf("\n  Input:  ");
              Print_Number(nreads,7,stdout);
              printf("reads,  ");
              Print_Number(totlen,12,stdout);
              printf(" bases");
              if (HGAP_MIN > 0)
                { printf(" (another ");
                  Print_Number((DB_LAST-DB_FIRST) - nreads,0,stdout);
		  printf(" were < H-length)");
		}
	      printf("\n");

	      stotal = qtotal = 0;
	      for (i = 0; i <= MAXQV; i++)
	        { stotal += sgram[i];
                  qtotal += qgram[i];
                }

              printf("\n  Histogram of q-values (average %d best)\n",2*QV_DEEP);
              printf("\n                   Input                 QV\n");
              qsum = qgram[MAXQV];
              ssum = sgram[MAXQV];
              printf("\n      %2d:  %9lld  %5.1f%%    %9lld  %5.1f%%\n\n",
                     MAXQV,sgram[MAXQV],(100.*ssum)/stotal,qgram[MAXQV],(100.*qsum)/qtotal);

              bval    = gval = -1;
              qtotal -= qsum;
              stotal -= ssum;
              ssum = qsum = 0;
              for (i = MAXQV-1; i >= 0; i--) 
                if (qgram[i] > 0)
                  { ssum += sgram[i];
                    qsum += qgram[i];
                    printf("      %2d:  %9lld  %5.1f%%    %9lld  %5.1f%%\n",
                           i,sgram[i],(100.*ssum)/stotal,
                             qgram[i],(100.*qsum)/qtotal);
                    if ((100.*qsum)/qtotal > 7. && bval < 0)
                      bval = i;
                    if ((100.*qsum)/qtotal > 20. && gval < 0)
                      gval = i;
                  }

              printf("\n    Recommend \'DAStrim -g%d -b%d'\n\n",gval,bval);
            }
        }

      Free_Block_Arg(parse);
    }

  //  Clean up

  free(dpwd);
  free(root);

  Close_DB(DB);
  free(Prog_Name);

  exit (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5280, %rsp           # imm = 0x5280
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x23c50(%rip), %rax     # 0x26040
movq %rax, -0xd8(%rbp)
leaq 0x23c54(%rip), %rax     # 0x26052
movq %rax, -0xe0(%rbp)
leaq 0x23c57(%rip), %rax     # 0x26063
movq %rax, -0xe8(%rbp)
leaq 0x23f22(%rip), %rdi     # 0x2633c
leaq 0x23ff7(%rip), %rsi     # 0x26418
callq 0x1ab80
movq %rax, %rcx
leaq 0x29400(%rip), %rax     # 0x2b830
movq %rcx, (%rax)
movl $0x0, -0xf4(%rbp)
cmpl $0x80, -0xf4(%rbp)
jge 0x246c
movslq -0xf4(%rbp), %rax
movl $0x0, -0x300(%rbp,%rax,4)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x243d
movl $0xffffffff, 0x28f8a(%rip) # imm = 0xFFFFFFFF
movl $0x1, -0xf8(%rbp)
movl $0x1, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x26da
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2699
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movb 0x1(%rax), %al
subb $0x63, %al
je 0x25af
jmp 0x24d0
movl $0x1, -0xfc(%rbp)
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xfc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x25aa
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xfc(%rbp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0x23e22(%rip), %rdi     # 0x26340
callq 0x2130
cmpq $0x0, %rax
jne 0x256f
movq 0x28ac8(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x292f6(%rip), %rax     # 0x2b830
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xfc(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
leaq 0x23b23(%rip), %rsi     # 0x26081
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xfc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cltq
movl $0x1, -0x300(%rbp,%rax,4)
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x24da
jmp 0x2697
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
leaq -0x308(%rbp), %rsi
movl $0xa, %edx
callq 0x21c0
movl %eax, 0x28e27(%rip)     # 0x2b400
movq -0x308(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2600
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x2652
movq 0x289f1(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2921f(%rip), %rax     # 0x2b830
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %ecx
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rsi
movq (%rax,%rsi,8), %r8
addq $0x2, %r8
leaq 0x23a5e(%rip), %rsi     # 0x2609f
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
cmpl $0x0, 0x28da7(%rip)     # 0x2b400
jg 0x2695
movq 0x28996(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x291c4(%rip), %rax     # 0x2b830
movq (%rax), %rdx
movl 0x28d8a(%rip), %r8d     # 0x2b400
leaq 0x23a4b(%rip), %rsi     # 0x260c8
leaq 0x23a62(%rip), %rcx     # 0x260e6
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
jmp 0x2697
jmp 0x26c4
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl -0xf8(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xf8(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x26c6
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x248a
movl -0xf8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x128(%rbp), %eax
movl %eax, 0x28d15(%rip)     # 0x2b404
cmpl $0x3, -0x8(%rbp)
jge 0x2770
movq 0x288fc(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2912a(%rip), %rax     # 0x2b830
movq (%rax), %rdx
movq 0x28a70(%rip), %rcx     # 0x2b180
leaq 0x239dc(%rip), %rsi     # 0x260f3
movb $0x0, %al
callq 0x2190
movq 0x288d3(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x23ce8(%rip), %rsi     # 0x26417
movb $0x0, %al
callq 0x2190
movq 0x288bb(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x239ba(%rip), %rsi     # 0x26101
movb $0x0, %al
callq 0x2190
movq 0x288a3(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x239d9(%rip), %rsi     # 0x26138
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x28a09(%rip), %rsi     # 0x2b188
callq 0x1c210
movl %eax, -0x30c(%rbp)
cmpl $0x0, -0x30c(%rbp)
jge 0x279d
movl $0x1, %edi
callq 0x2290
cmpl $0x1, -0x30c(%rbp)
jne 0x27da
movq 0x2884b(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x29079(%rip), %rax     # 0x2b830
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x239b4(%rip), %rsi     # 0x2617d
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq 0x289a7(%rip), %rax     # 0x2b188
cmpl $0x0, 0x38(%rax)
je 0x281b
movq 0x2880a(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x29038(%rip), %rax     # 0x2b830
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x2399d(%rip), %rsi     # 0x261a7
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq 0x28966(%rip), %rdi     # 0x2b188
callq 0x1ce40
movq 0x2895a(%rip), %rax     # 0x2b188
movq 0x48(%rax), %rdi
leaq 0x23c5f(%rip), %rsi     # 0x26498
leaq 0x2398c(%rip), %rdx     # 0x261cc
leaq 0x23ae2(%rip), %rcx     # 0x26329
callq 0x1ae70
movq %rax, %rdi
leaq 0x2397b(%rip), %rsi     # 0x261d1
callq 0x1ab80
movq %rax, -0x320(%rbp)
cmpq $0x0, -0x320(%rbp)
jne 0x2876
movl $0x1, %edi
callq 0x2290
movq -0x320(%rbp), %rdi
leaq 0x24b03(%rip), %rsi     # 0x27387
callq 0x2260
movq %rax, -0x318(%rbp)
cmpq $0x0, -0x318(%rbp)
jne 0x28c6
movq 0x28757(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28f85(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x23931(%rip), %rsi     # 0x261e6
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq -0x318(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x2250
movq -0x318(%rbp), %rdi
callq 0x21a0
subq $0x8, %rax
movl %eax, -0x324(%rbp)
movq -0x318(%rbp), %rdi
xorl %eax, %eax
subl -0x324(%rbp), %eax
movslq %eax, %rsi
movl $0x2, %edx
callq 0x2250
movl $0x0, -0x6c(%rbp)
movq -0x318(%rbp), %rdi
movq -0x320(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x201c0
cmpl $0x0, %eax
je 0x295c
movq 0x286c1(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28eef(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x238c7(%rip), %rsi     # 0x26212
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movl $0x0, -0x4c(%rbp)
movq -0x318(%rbp), %rdi
movq -0x320(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x201c0
cmpl $0x0, %eax
je 0x29ab
movq 0x28672(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28ea0(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x238a7(%rip), %rsi     # 0x26241
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq -0x318(%rbp), %rdi
callq 0x20b0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl %eax, 0x28a44(%rip)     # 0x2b408
movq -0x58(%rbp), %rax
movq %rax, -0x330(%rbp)
movl -0x6c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x328(%rbp)
cmpl $0x0, 0x28a1e(%rip)     # 0x2b400
jge 0x2a9a
movl $0x0, -0x334(%rbp)
movq -0x330(%rbp), %rax
movl -0x334(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq -0x330(%rbp), %rcx
movslq -0x334(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jge 0x2a2e
movl -0x334(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x334(%rbp)
jmp 0x29f2
movl -0x334(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x334(%rbp)
movl %eax, 0x289bb(%rip)     # 0x2b400
movl -0x334(%rbp), %eax
cmpl -0x328(%rbp), %eax
jge 0x2a98
movq -0x330(%rbp), %rax
movslq 0x2899f(%rip), %rcx     # 0x2b400
movq (%rax,%rcx,8), %rax
movq -0x330(%rbp), %rcx
movslq -0x334(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jge 0x2a85
movl -0x334(%rbp), %eax
movl %eax, 0x2897b(%rip)     # 0x2b400
jmp 0x2a87
movl -0x334(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x334(%rbp)
jmp 0x2a45
jmp 0x2a9a
cmpl $0x28, 0x2895f(%rip)    # 0x2b400
jl 0x2ab9
movl 0x28957(%rip), %eax     # 0x2b400
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, 0x28955(%rip)     # 0x2b40c
jmp 0x2b1d
cmpl $0x14, 0x28940(%rip)    # 0x2b400
jl 0x2ace
movl $0x5, 0x28940(%rip)     # 0x2b40c
jmp 0x2b1b
cmpl $0x4, 0x2892b(%rip)     # 0x2b400
jl 0x2aed
movl 0x28923(%rip), %eax     # 0x2b400
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, 0x28921(%rip)     # 0x2b40c
jmp 0x2b19
movq 0x28504(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28d32(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x2376d(%rip), %rsi     # 0x26275
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
jmp 0x2b1b
jmp 0x2b1d
movl $0x0, -0x90(%rbp)
movl $0x1, -0x8c(%rbp)
movl $0x0, -0x88(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0x80(%rbp)
movslq 0x288b3(%rip), %rax     # 0x2b400
movq %rax, -0xf0(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x78(%rbp)
movl $0x0, -0xb0(%rbp)
movl $0x33, -0xac(%rbp)
movl $0x1, -0xa8(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq 0x2887e(%rip), %rax     # 0x2b410
movq %rax, -0x98(%rbp)
movl $0x0, -0xd0(%rbp)
movl $0x33, -0xcc(%rbp)
movl $0x1, -0xc8(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq 0x289e4(%rip), %rax     # 0x2b5b0
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1aca0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x236bd(%rip), %rsi     # 0x262b0
callq 0x1ad30
movq %rax, -0x18(%rbp)
movl $0x2, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x3704
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x21c20
movq %rax, -0x340(%rbp)
movq -0x340(%rbp), %rdi
callq 0x217f0
movq %rax, -0x348(%rbp)
cmpq $0x0, %rax
je 0x36ea
movl $0x0, 0x28afa(%rip)     # 0x2b748
movl $0x0, 0x28af4(%rip)     # 0x2b74c
movq 0x28529(%rip), %rax     # 0x2b188
movl 0x30(%rax), %eax
movl %eax, 0x28ae8(%rip)     # 0x2b750
movq -0x340(%rbp), %rdi
callq 0x219e0
movq %rax, %rdi
movl $0x2e, %esi
callq 0x2270
movq %rax, -0x51e8(%rbp)
cmpq $0x0, -0x51e8(%rbp)
je 0x2f82
movq -0x51e8(%rbp), %rdi
addq $0x1, %rdi
leaq -0x51f0(%rbp), %rsi
movl $0xa, %edx
callq 0x21c0
movl %eax, -0x51f8(%rbp)
movq -0x51f0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2f80
movq -0x51f0(%rbp), %rax
movq -0x51e8(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x2f80
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x235bf(%rip), %rsi     # 0x262b4
leaq 0x235b4(%rip), %rcx     # 0x262b0
callq 0x1ae70
movq %rax, %rdi
leaq 0x2467c(%rip), %rsi     # 0x27387
callq 0x1ac20
movq %rax, -0x350(%rbp)
cmpq $0x0, -0x350(%rbp)
jne 0x2d2b
movl $0x1, %edi
callq 0x2290
movq -0x350(%rbp), %rdi
leaq 0x2357d(%rip), %rsi     # 0x262b6
leaq -0x51fc(%rbp), %rdx
movb $0x0, %al
callq 0x2080
cmpl $0x1, %eax
je 0x2d78
movq 0x282a5(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28ad3(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x2355c(%rip), %rsi     # 0x262c3
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
movl $0x0, -0x51f4(%rbp)
movl -0x51f4(%rbp), %eax
cmpl -0x51fc(%rbp), %eax
jge 0x2ded
leaq -0x51e0(%rbp), %rdi
movq -0x350(%rbp), %rdx
movl $0x4e84, %esi           # imm = 0x4E84
callq 0x2170
cmpq $0x0, %rax
jne 0x2dda
movq 0x28243(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28a71(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x234fa(%rip), %rsi     # 0x262c3
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
jmp 0x2ddc
movl -0x51f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51f4(%rbp)
jmp 0x2d82
movq -0x350(%rbp), %rdi
leaq 0x234e8(%rip), %rsi     # 0x262e3
leaq -0x5200(%rbp), %rdx
movb $0x0, %al
callq 0x2080
cmpl $0x1, %eax
je 0x2e3a
movq 0x281e3(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28a11(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x2349a(%rip), %rsi     # 0x262c3
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
movq -0x350(%rbp), %rdi
leaq 0x234a9(%rip), %rsi     # 0x262f1
leaq -0x5218(%rbp), %rdx
leaq -0x5204(%rbp), %rcx
leaq -0x5208(%rbp), %r8
movb $0x0, %al
callq 0x2080
cmpl $0x3, %eax
je 0x2e95
movq 0x28188(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x289b6(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x2343f(%rip), %rsi     # 0x262c3
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
movl $0x1, -0x51f4(%rbp)
movl -0x51f4(%rbp), %eax
cmpl -0x51f8(%rbp), %eax
jg 0x2f14
movq -0x350(%rbp), %rdi
leaq 0x2345c(%rip), %rsi     # 0x26317
leaq -0x520c(%rbp), %rdx
leaq 0x28883(%rip), %rcx     # 0x2b74c
movb $0x0, %al
callq 0x2080
cmpl $0x2, %eax
je 0x2f01
movq 0x2811c(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2894a(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x233d3(%rip), %rsi     # 0x262c3
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
jmp 0x2f03
movl -0x51f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51f4(%rbp)
jmp 0x2e9f
movq -0x350(%rbp), %rdi
leaq 0x233f5(%rip), %rsi     # 0x26317
leaq -0x520c(%rbp), %rdx
leaq 0x28820(%rip), %rcx     # 0x2b750
movb $0x0, %al
callq 0x2080
cmpl $0x2, %eax
je 0x2f68
movq 0x280b5(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x288e3(%rip), %rax     # 0x2b830
movq (%rax), %rdx
leaq 0x2336c(%rip), %rsi     # 0x262c3
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
movq -0x350(%rbp), %rdi
callq 0x20b0
movl -0x51f8(%rbp), %eax
movl %eax, 0x287c8(%rip)     # 0x2b748
jmp 0x2f82
cmpl $0x0, 0x287bf(%rip)     # 0x2b748
jle 0x3055
movq -0x20(%rbp), %rax
movq %rax, -0x5270(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x5268(%rbp)
movl 0x2879d(%rip), %esi     # 0x2b748
leaq 0x234e6(%rip), %rdi     # 0x26498
leaq 0x2336b(%rip), %rdx     # 0x26324
callq 0x1afc0
movq -0x5270(%rbp), %rdi
movq -0x5268(%rbp), %rdx
movq %rax, %rcx
leaq 0x2334b(%rip), %rsi     # 0x26321
callq 0x1ae70
movq %rax, %rdi
leaq 0x23dc8(%rip), %rsi     # 0x26dad
callq 0x1ac20
movq %rax, 0x28767(%rip)     # 0x2b758
movq -0x20(%rbp), %rax
movq %rax, -0x5260(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x5258(%rbp)
movl 0x2873b(%rip), %esi     # 0x2b748
leaq 0x23484(%rip), %rdi     # 0x26498
leaq 0x23314(%rip), %rdx     # 0x2632f
callq 0x1afc0
movq -0x5260(%rbp), %rdi
movq -0x5258(%rbp), %rdx
movq %rax, %rcx
leaq 0x232e9(%rip), %rsi     # 0x26321
callq 0x1ae70
movq %rax, %rdi
leaq 0x23d66(%rip), %rsi     # 0x26dad
callq 0x1ac20
movq %rax, 0x2870d(%rip)     # 0x2b760
jmp 0x30b7
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x232bd(%rip), %rsi     # 0x26321
leaq 0x232b9(%rip), %rcx     # 0x26324
callq 0x1ae70
movq %rax, %rdi
leaq 0x23d33(%rip), %rsi     # 0x26dad
callq 0x1ac20
movq %rax, 0x286d2(%rip)     # 0x2b758
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x2328c(%rip), %rsi     # 0x26321
leaq 0x23293(%rip), %rcx     # 0x2632f
callq 0x1ae70
movq %rax, %rdi
leaq 0x23d02(%rip), %rsi     # 0x26dad
callq 0x1ac20
movq %rax, 0x286a9(%rip)     # 0x2b760
cmpq $0x0, 0x28699(%rip)     # 0x2b758
je 0x30cb
cmpq $0x0, 0x28697(%rip)     # 0x2b760
jne 0x30d5
movl $0x1, %edi
callq 0x2290
movl 0x28675(%rip), %eax     # 0x2b750
subl 0x2866b(%rip), %eax     # 0x2b74c
movl %eax, -0x5220(%rbp)
movl $0x8, -0x521c(%rbp)
movq 0x28660(%rip), %rcx     # 0x2b758
leaq -0x5220(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x22a0
movq 0x28643(%rip), %rcx     # 0x2b758
leaq -0x521c(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x22a0
movq $0x0, 0x28632(%rip) # 0x2b768
movq 0x2861b(%rip), %rcx     # 0x2b758
leaq 0x28624(%rip), %rdi     # 0x2b768
movl $0x8, %esi
movl $0x1, %edx
callq 0x22a0
movq -0x348(%rbp), %rcx
leaq -0x28(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x20a0
movq -0x348(%rbp), %rcx
leaq 0x285f5(%rip), %rdi     # 0x2b770
movl $0x4, %esi
movl $0x1, %edx
callq 0x20a0
movq $0x0, 0x285e3(%rip) # 0x2b778
movq $0x0, 0x285e0(%rip) # 0x2b780
movl $0x0, -0x5224(%rbp)
cmpl $0x32, -0x5224(%rbp)
jg 0x31f0
movslq -0x5224(%rbp), %rcx
leaq 0x283ef(%rip), %rax     # 0x2b5b0
movq $0x0, (%rax,%rcx,8)
movslq -0x5224(%rbp), %rcx
leaq 0x28239(%rip), %rax     # 0x2b410
movq $0x0, (%rax,%rcx,8)
movl -0x5224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5224(%rbp)
jmp 0x31aa
cmpl $0x0, 0x2820d(%rip)     # 0x2b404
je 0x3278
leaq 0x2313a(%rip), %rdi     # 0x2633a
movb $0x0, %al
callq 0x20f0
cmpl $0x0, 0x281fa(%rip)     # 0x2b408
jle 0x3224
movl 0x281f2(%rip), %esi     # 0x2b408
leaq 0x23125(%rip), %rdi     # 0x26342
movb $0x0, %al
callq 0x20f0
movl 0x281d6(%rip), %eax     # 0x2b400
movl %eax, -0x527c(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x5278(%rbp)
movq -0x340(%rbp), %rdi
callq 0x219e0
movl -0x527c(%rbp), %esi
movq -0x5278(%rbp), %rdx
movq %rax, %rcx
leaq 0x230e6(%rip), %rdi     # 0x26348
movb $0x0, %al
callq 0x20f0
movq 0x27d68(%rip), %rax     # 0x2afd8
movq (%rax), %rdi
callq 0x2200
movq -0x348(%rbp), %rdi
leaq 0xafa(%rip), %rsi       # 0x3d80
movl $0x1, %edx
callq 0x3740
movq 0x284c1(%rip), %rdi     # 0x2b758
leaq -0x50(%rbp), %rsi
callq 0x20850
movq 0x284b1(%rip), %rdi     # 0x2b758
leaq -0x90(%rbp), %rsi
callq 0x20850
movq 0x2849e(%rip), %rdi     # 0x2b758
leaq -0xb0(%rbp), %rsi
callq 0x20850
movq 0x2848b(%rip), %rdi     # 0x2b758
leaq -0xd0(%rbp), %rsi
callq 0x20850
movq 0x28478(%rip), %rdi     # 0x2b758
callq 0x20b0
movq 0x28474(%rip), %rdi     # 0x2b760
callq 0x20b0
movq -0x348(%rbp), %rdi
callq 0x20b0
cmpl $0x0, 0x28100(%rip)     # 0x2b404
je 0x36e5
leaq 0x23045(%rip), %rdi     # 0x26356
movb $0x0, %al
callq 0x20f0
movq 0x28459(%rip), %rdi     # 0x2b778
movq 0x27cb2(%rip), %rax     # 0x2afd8
movq (%rax), %rdx
movl $0x7, %esi
callq 0x1b0d0
leaq 0x23028(%rip), %rdi     # 0x26362
movb $0x0, %al
callq 0x20f0
movq 0x28438(%rip), %rdi     # 0x2b780
movq 0x27c89(%rip), %rax     # 0x2afd8
movq (%rax), %rdx
movl $0xc, %esi
callq 0x1b0d0
leaq 0x23008(%rip), %rdi     # 0x2636b
movb $0x0, %al
callq 0x20f0
cmpl $0x0, 0x28097(%rip)     # 0x2b408
jle 0x33b6
leaq 0x22ff8(%rip), %rdi     # 0x26372
movb $0x0, %al
callq 0x20f0
movl 0x283c9(%rip), %eax     # 0x2b750
subl 0x283bf(%rip), %eax     # 0x2b74c
movslq %eax, %rdi
subq 0x283e1(%rip), %rdi     # 0x2b778
movq 0x27c3a(%rip), %rax     # 0x2afd8
movq (%rax), %rdx
xorl %esi, %esi
callq 0x1b0d0
leaq 0x22fce(%rip), %rdi     # 0x2637d
movb $0x0, %al
callq 0x20f0
leaq 0x2305a(%rip), %rdi     # 0x26417
movb $0x0, %al
callq 0x20f0
movq $0x0, -0x5248(%rbp)
movq $0x0, -0x5240(%rbp)
movl $0x0, -0x5228(%rbp)
cmpl $0x32, -0x5228(%rbp)
jg 0x343e
movslq -0x5228(%rbp), %rcx
leaq 0x281b5(%rip), %rax     # 0x2b5b0
movq (%rax,%rcx,8), %rax
addq -0x5240(%rbp), %rax
movq %rax, -0x5240(%rbp)
movslq -0x5228(%rbp), %rcx
leaq 0x27ff5(%rip), %rax     # 0x2b410
movq (%rax,%rcx,8), %rax
addq -0x5248(%rbp), %rax
movq %rax, -0x5248(%rbp)
movl -0x5228(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5228(%rbp)
jmp 0x33e4
movl 0x27fc8(%rip), %esi     # 0x2b40c
shll %esi
leaq 0x22f42(%rip), %rdi     # 0x2638f
movb $0x0, %al
callq 0x20f0
leaq 0x22f60(%rip), %rdi     # 0x263bb
movb $0x0, %al
callq 0x20f0
movq 0x28137(%rip), %rax     # 0x2b5a0
movq %rax, -0x5238(%rbp)
movq 0x282c9(%rip), %rax     # 0x2b740
movq %rax, -0x5230(%rbp)
movq 0x282bb(%rip), %rdx     # 0x2b740
cvtsi2sdq -0x5230(%rbp), %xmm1
movsd 0x22b72(%rip), %xmm0    # 0x26008
mulsd %xmm1, %xmm0
cvtsi2sdq -0x5240(%rbp), %xmm1
divsd %xmm1, %xmm0
movq 0x280f2(%rip), %rcx     # 0x2b5a0
cvtsi2sdq -0x5238(%rbp), %xmm2
movsd 0x22b49(%rip), %xmm1    # 0x26008
mulsd %xmm2, %xmm1
cvtsi2sdq -0x5248(%rbp), %xmm2
divsd %xmm2, %xmm1
leaq 0x22f12(%rip), %rdi     # 0x263e9
movl $0x32, %esi
movb $0x2, %al
callq 0x20f0
movl $0xffffffff, -0x524c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x5250(%rbp) # imm = 0xFFFFFFFF
movq -0x5238(%rbp), %rcx
movq -0x5248(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x5248(%rbp)
movq -0x5230(%rbp), %rcx
movq -0x5240(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x5240(%rbp)
movq $0x0, -0x5238(%rbp)
movq $0x0, -0x5230(%rbp)
movl $0x31, -0x5228(%rbp)
cmpl $0x0, -0x5228(%rbp)
jl 0x36cb
movslq -0x5228(%rbp), %rcx
leaq 0x27eae(%rip), %rax     # 0x2b410
cmpq $0x0, (%rax,%rcx,8)
jle 0x36b5
movslq -0x5228(%rbp), %rcx
leaq 0x28035(%rip), %rax     # 0x2b5b0
movq (%rax,%rcx,8), %rax
addq -0x5230(%rbp), %rax
movq %rax, -0x5230(%rbp)
movslq -0x5228(%rbp), %rcx
leaq 0x27e75(%rip), %rax     # 0x2b410
movq (%rax,%rcx,8), %rax
addq -0x5238(%rbp), %rax
movq %rax, -0x5238(%rbp)
movl -0x5228(%rbp), %esi
movslq -0x5228(%rbp), %rcx
leaq 0x27fef(%rip), %rax     # 0x2b5b0
movq (%rax,%rcx,8), %rdx
cvtsi2sdq -0x5230(%rbp), %xmm1
movsd 0x22a32(%rip), %xmm0    # 0x26008
mulsd %xmm1, %xmm0
cvtsi2sdq -0x5240(%rbp), %xmm1
divsd %xmm1, %xmm0
movslq -0x5228(%rbp), %rcx
leaq 0x27e1b(%rip), %rax     # 0x2b410
movq (%rax,%rcx,8), %rcx
cvtsi2sdq -0x5238(%rbp), %xmm2
movsd 0x229fe(%rip), %xmm1    # 0x26008
mulsd %xmm2, %xmm1
cvtsi2sdq -0x5248(%rbp), %xmm2
divsd %xmm2, %xmm1
leaq 0x22df7(%rip), %rdi     # 0x26419
movb $0x2, %al
callq 0x20f0
cvtsi2sdq -0x5238(%rbp), %xmm1
movsd 0x229ce(%rip), %xmm0    # 0x26008
mulsd %xmm1, %xmm0
cvtsi2sdq -0x5248(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd 0x229bd(%rip), %xmm1    # 0x26010
ucomisd %xmm1, %xmm0
jbe 0x366e
cmpl $0x0, -0x5250(%rbp)
jge 0x366e
movl -0x5228(%rbp), %eax
movl %eax, -0x5250(%rbp)
cvtsi2sdq -0x5238(%rbp), %xmm1
movsd 0x22989(%rip), %xmm0    # 0x26008
mulsd %xmm1, %xmm0
cvtsi2sdq -0x5248(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd 0x22980(%rip), %xmm1    # 0x26018
ucomisd %xmm1, %xmm0
jbe 0x36b3
cmpl $0x0, -0x524c(%rbp)
jge 0x36b3
movl -0x5228(%rbp), %eax
movl %eax, -0x524c(%rbp)
jmp 0x36b5
jmp 0x36b7
movl -0x5228(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x5228(%rbp)
jmp 0x3547
movl -0x524c(%rbp), %esi
movl -0x5250(%rbp), %edx
leaq 0x22d69(%rip), %rdi     # 0x26447
movb $0x0, %al
callq 0x20f0
jmp 0x2c27
movq -0x340(%rbp), %rdi
callq 0x21a50
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2c03
movq -0x20(%rbp), %rdi
callq 0x2030
movq -0x18(%rbp), %rdi
callq 0x2030
movq 0x27a6b(%rip), %rdi     # 0x2b188
callq 0x1db60
leaq 0x28107(%rip), %rax     # 0x2b830
movq (%rax), %rdi
callq 0x2030
xorl %edi, %edi
callq 0x2290
nopl (%rax,%rax)