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

  DAZZ_EXTRA ex_covr, ex_hgap;

  //  Process arguments

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

    ARG_INIT("DAScover")

    HGAP_MIN = 0;
    NUM_MASK = 0;

    mmax  = 10;
    MASKS = (Mask *) Malloc(mmax*sizeof(Mask),"Allocating mask array");
    if (MASKS == NULL)
      exit (1);

    j = 1;
    for (i = 1; i < argc; i++)
      if (argv[i][0] == '-')
        switch (argv[i][1])
        { default:
            ARG_FLAGS("v")
            break;
          case 'm':
            if (NUM_MASK >= mmax)
              { mmax  = 1.2*NUM_MASK + 10;
                MASKS = (Mask *) Realloc(MASKS,mmax*sizeof(Mask),"Reallocating mask array");
                if (MASKS == NULL)
                  exit (1);
              }
            MASKS[NUM_MASK++].name = argv[i]+2;
            break;
          case 'H':
            ARG_POSITIVE(HGAP_MIN,"HGAP threshold (in bp.s)")
            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,"      -H: HGAP minimum length threshold.\n");
        fprintf(stderr,"      -m: repeat masks, stats not collected over these intervals\n");
        exit (1);
      }
  }

  //  Open trimmed DB and any mask tracks

  { DAZZ_TRACK *track;
    int64      *anno;
    int         status, kind;
    int         i, j, k;

    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);
    Reads = DB->reads;

    k = 0;
    for (i = 0; i < NUM_MASK; i++)
      { status = Check_Track(DB,MASKS[i].name,&kind);
        switch (status)
        { case 0:
            fprintf(stderr,"%s: [WARNING] %s track is for the *un*trimmed DB?\n",
                           Prog_Name,MASKS[i].name);
            continue;
          case -1:
            fprintf(stderr,"%s: [WARNING] %s track size not correct for trimmed DB.\n",
                           Prog_Name,MASKS[i].name);
            continue;
          case -2:
            fprintf(stderr,"%s: [WARNING] -m%s option given but no track found.\n",
                           Prog_Name,MASKS[i].name);
            continue;
          default:
            if (kind != MASK_TRACK)
              { fprintf(stderr,"%s: [WARNING] %s track is not a mask track.\n",
                               Prog_Name,MASKS[i].name);
                continue;
              }
            break;
        }

        track = Open_Track(DB,MASKS[i].name);
        Load_All_Track_Data(track);

        anno = (int64 *) (track->anno);
        for (j = 0; j <= DB->nreads; j++)
          anno[j] /= sizeof(int);

        MASKS[k].name = MASKS[i].name;
        MASKS[k].idx  = anno;
        MASKS[k].data = (int *) (track->data);
        k += 1;
      }
    NUM_MASK = k;
  }

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

  ex_covr.vtype = DB_INT;
  ex_covr.nelem = MAX_COVER+1;
  ex_covr.accum = DB_SUM;
  ex_covr.name  = Cov_Name;
  ex_covr.value = Cov_Hist; 

  ex_hgap.vtype = DB_INT;
  ex_hgap.nelem = 1;
  ex_hgap.accum = DB_EXACT;
  ex_hgap.name  = Hgap_Name;
  hgap64 = HGAP_MIN;
  ex_hgap.value = &hgap64;

  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;

          { 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 cover extra's track

          if (DB_PART > 0)
           CV_ANAME = Strdup(Catenate(dpwd,PATHSEP,root,
                           Numbered_Suffix(".",DB_PART,".covr.anno")),"Allocating cover anno name");
          else
           CV_ANAME = Strdup(Catenate(dpwd,PATHSEP,root,".covr.anno"),"Allocating cover anno name");
          CV_AFILE = Fopen(CV_ANAME,"w");
          if (CV_ANAME == NULL || CV_AFILE == NULL)
            exit (1);

          { int size, length;

            length = 0;
            size   = 1;
            fwrite(&length,sizeof(int),1,CV_AFILE);
            fwrite(&size,sizeof(int),1,CV_AFILE);
          }

          //  Get trace point spacing information

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

          //  Initialize statistics gathering

          if (VERBOSE)
            { nreads = 0;
              totlen = 0;
              printf("\nDAScover %s %s\n",argv[1],Block_Arg_Root(parse));
            }

          { int i;

            for (i = 0; i <= MAX_COVER; i++)
              Cov_Hist[i] = 0;
          }

          //  Process each read pile

          make_a_pass(input,HISTOGRAM_COVER,0);

          //  If verbose output statistics summary to stdout

          if (VERBOSE)
            { int   i, cover;
              int64 ssum, stotal;

              printf("\nInput:  ");
              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 = 0;
              for (i = 0; i <= MAX_COVER; i++)
                stotal += Cov_Hist[i];

              printf("\nCoverage Histogram\n\n");
              ssum = Cov_Hist[MAX_COVER];
              if (ssum > 0)
                printf("    %4d:  %9lld  %5.1f%%\n\n",
                       MAX_COVER,Cov_Hist[MAX_COVER],(100.*ssum)/stotal);
              stotal -= ssum;
              ssum    = 0;
              for (i = MAX_COVER-1; i >= 0; i--) 
                if (Cov_Hist[i] > 0)
                  { ssum += Cov_Hist[i];
                    printf("    %4d:  %9lld  %5.1f%%\n",
                           i,Cov_Hist[i],(100.*ssum)/stotal);
                  }

              i = 0;
              while (Cov_Hist[i+1] < Cov_Hist[i])
                i += 1;
              for (cover = i++; i < MAX_COVER; i++)
                if (Cov_Hist[cover] < Cov_Hist[i])
                  cover = i;

              printf("\n  Coverage is estimated at %d\n\n",cover);
            }

          //  Output coverage histogram

          Write_Extra(CV_AFILE,&ex_covr);
          Write_Extra(CV_AFILE,&ex_hgap);

          fclose(CV_AFILE);
          free(CV_ANAME);
          fclose(input);
        }

      Free_Block_Arg(parse);
    }

  free(dpwd);
  free(root);

  Close_DB(DB);
  free(Prog_Name);

  exit (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x51f0, %rsp           # imm = 0x51F0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x23c48(%rip), %rdi     # 0x26028
leaq 0x23fd9(%rip), %rsi     # 0x263c0
callq 0x1a970
movq %rax, %rcx
leaq 0x2b04a(%rip), %rax     # 0x2d440
movq %rcx, (%rax)
movl $0x0, -0x7c(%rbp)
cmpl $0x80, -0x7c(%rbp)
jge 0x2423
movslq -0x7c(%rbp), %rax
movl $0x0, -0x290(%rbp,%rax,4)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x2400
movl $0x0, 0x28fd3(%rip)     # 0x2b400
movl $0x0, 0x28fcd(%rip)     # 0x2b404
movl $0xa, -0x29c(%rbp)
movslq -0x29c(%rbp), %rax
imulq $0x18, %rax, %rdi
leaq 0x23bde(%rip), %rsi     # 0x26031
callq 0x1a850
movq %rax, 0x28fa9(%rip)     # 0x2b408
cmpq $0x0, 0x28fa1(%rip)     # 0x2b408
jne 0x2473
movl $0x1, %edi
callq 0x2280
movl $0x1, -0x80(%rbp)
movl $0x1, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x2767
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2735
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
movl %eax, -0x51d4(%rbp)
subl $0x48, %eax
je 0x2657
jmp 0x24c6
movl -0x51d4(%rbp), %eax
subl $0x6d, %eax
je 0x25aa
jmp 0x24d7
movl $0x1, -0x84(%rbp)
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x84(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x25a5
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x84(%rbp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0x23b28(%rip), %rdi     # 0x26047
callq 0x2130
cmpq $0x0, %rax
jne 0x256d
movq 0x28ac7(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2af05(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x84(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
leaq 0x23aed(%rip), %rsi     # 0x26049
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2280
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x84(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cltq
movl $0x1, -0x290(%rbp,%rax,4)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x24e1
jmp 0x2733
movl 0x28e54(%rip), %eax     # 0x2b404
cmpl -0x29c(%rbp), %eax
jl 0x261d
cvtsi2sdl 0x28e44(%rip), %xmm0 # 0x2b404
movsd 0x23a48(%rip), %xmm1    # 0x26010
mulsd %xmm1, %xmm0
movsd 0x23a44(%rip), %xmm1    # 0x26018
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x29c(%rbp)
movq 0x28e1f(%rip), %rdi     # 0x2b408
movslq -0x29c(%rbp), %rax
imulq $0x18, %rax, %rsi
leaq 0x23a6c(%rip), %rdx     # 0x26067
callq 0x1a8d0
movq %rax, 0x28e01(%rip)     # 0x2b408
cmpq $0x0, 0x28df9(%rip)     # 0x2b408
jne 0x261b
movl $0x1, %edi
callq 0x2280
jmp 0x261d
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
addq $0x2, %rcx
movq 0x28dd4(%rip), %rax     # 0x2b408
movl 0x28dca(%rip), %edx     # 0x2b404
movl %edx, %esi
addl $0x1, %esi
movl %esi, 0x28dbf(%rip)     # 0x2b404
movslq %edx, %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
jmp 0x2733
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
leaq -0x298(%rbp), %rsi
movl $0xa, %edx
callq 0x21b0
movl %eax, 0x28d82(%rip)     # 0x2b400
movq -0x298(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x26a2
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x26ee
movq 0x2894f(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2ad8d(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %ecx
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rsi
movq (%rax,%rsi,8), %r8
addq $0x2, %r8
leaq 0x239a2(%rip), %rsi     # 0x2607f
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2280
cmpl $0x0, 0x28d0b(%rip)     # 0x2b400
jg 0x2731
movq 0x288fa(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2ad38(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movl 0x28cee(%rip), %r8d     # 0x2b400
leaq 0x2398f(%rip), %rsi     # 0x260a8
leaq 0x239a6(%rip), %rcx     # 0x260c6
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2280
jmp 0x2733
jmp 0x2757
movq -0x10(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl -0x80(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x80(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2759
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x2481
movl -0x80(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0xb8(%rbp), %eax
movl %eax, 0x28c97(%rip)     # 0x2b410
cmpl $0x3, -0x8(%rbp)
jge 0x2816
movq 0x2886e(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2acac(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movq 0x289d2(%rip), %rcx     # 0x2b170
leaq 0x2393a(%rip), %rsi     # 0x260df
movb $0x0, %al
callq 0x2190
movq 0x28845(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x23c02(%rip), %rsi     # 0x263bf
movb $0x0, %al
callq 0x2190
movq 0x2882d(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x23918(%rip), %rsi     # 0x260ed
movb $0x0, %al
callq 0x2190
movq 0x28815(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x23937(%rip), %rsi     # 0x26124
movb $0x0, %al
callq 0x2190
movq 0x287fd(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x23949(%rip), %rsi     # 0x2614e
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2280
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x28953(%rip), %rsi     # 0x2b178
callq 0x1c000
movl %eax, -0x2b4(%rbp)
cmpl $0x0, -0x2b4(%rbp)
jge 0x2843
movl $0x1, %edi
callq 0x2280
cmpl $0x1, -0x2b4(%rbp)
jne 0x2880
movq 0x287a5(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2abe3(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x23921(%rip), %rsi     # 0x26190
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2280
movq 0x288f1(%rip), %rax     # 0x2b178
cmpl $0x0, 0x38(%rax)
je 0x28c1
movq 0x28764(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2aba2(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x2390a(%rip), %rsi     # 0x261ba
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2280
movq 0x288b0(%rip), %rdi     # 0x2b178
callq 0x1cc30
movq 0x288a4(%rip), %rax     # 0x2b178
movq 0x60(%rax), %rax
movq %rax, 0x28b39(%rip)     # 0x2b418
movl $0x0, -0x2c4(%rbp)
movl $0x0, -0x2bc(%rbp)
movl -0x2bc(%rbp), %eax
cmpl 0x28b05(%rip), %eax     # 0x2b404
jge 0x2b96
movq 0x2886c(%rip), %rdi     # 0x2b178
movq 0x28af5(%rip), %rax     # 0x2b408
movslq -0x2bc(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x2b8(%rbp), %rdx
callq 0x1ea60
movl %eax, -0x2b4(%rbp)
movl -0x2b4(%rbp), %eax
movl %eax, -0x51d8(%rbp)
subl $-0x2, %eax
je 0x29e6
jmp 0x294b
movl -0x51d8(%rbp), %eax
subl $-0x1, %eax
je 0x29a7
jmp 0x2958
movl -0x51d8(%rbp), %eax
testl %eax, %eax
jne 0x2a25
jmp 0x2968
movq 0x28689(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2aac7(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movq 0x28a85(%rip), %rax     # 0x2b408
movslq -0x2bc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
leaq 0x23844(%rip), %rsi     # 0x261df
movb $0x0, %al
callq 0x2190
jmp 0x2b82
movq 0x2864a(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2aa88(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movq 0x28a46(%rip), %rax     # 0x2b408
movslq -0x2bc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
leaq 0x23838(%rip), %rsi     # 0x26212
movb $0x0, %al
callq 0x2190
jmp 0x2b82
movq 0x2860b(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2aa49(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movq 0x28a07(%rip), %rax     # 0x2b408
movslq -0x2bc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
leaq 0x23832(%rip), %rsi     # 0x2624b
movb $0x0, %al
callq 0x2190
jmp 0x2b82
cmpl $0x1, -0x2b8(%rbp)
je 0x2a6d
movq 0x285c3(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2aa01(%rip), %rax     # 0x2d440
movq (%rax), %rdx
movq 0x289bf(%rip), %rax     # 0x2b408
movslq -0x2bc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
leaq 0x2381f(%rip), %rsi     # 0x26280
movb $0x0, %al
callq 0x2190
jmp 0x2b82
jmp 0x2a6f
movq 0x28702(%rip), %rdi     # 0x2b178
movq 0x2898b(%rip), %rax     # 0x2b408
movslq -0x2bc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x1edb0
movq %rax, -0x2a8(%rbp)
movq -0x2a8(%rbp), %rdi
callq 0x1fcd0
movq -0x2a8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x2b0(%rbp)
movl $0x0, -0x2c0(%rbp)
movl -0x2c0(%rbp), %eax
movq 0x286a9(%rip), %rcx     # 0x2b178
cmpl 0x30(%rcx), %eax
jg 0x2aff
movq -0x2b0(%rbp), %rax
movslq -0x2c0(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
shrq $0x2, %rdx
movq %rdx, (%rax,%rcx,8)
movl -0x2c0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c0(%rbp)
jmp 0x2ac2
movq 0x28902(%rip), %rax     # 0x2b408
movslq -0x2bc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq 0x288ea(%rip), %rax     # 0x2b408
movslq -0x2c4(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x2b0(%rbp), %rcx
movq 0x288cb(%rip), %rax     # 0x2b408
movslq -0x2c4(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x2a8(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x288a7(%rip), %rax     # 0x2b408
movslq -0x2c4(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl -0x2c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c4(%rbp)
movl -0x2bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2bc(%rbp)
jmp 0x28f3
movl -0x2c4(%rbp), %eax
movl %eax, 0x28862(%rip)     # 0x2b404
movl $0x0, -0x58(%rbp)
movl $0x3e9, -0x54(%rbp)     # imm = 0x3E9
movl $0x1, -0x50(%rbp)
movq 0x285c2(%rip), %rax     # 0x2b180
movq %rax, -0x48(%rbp)
leaq 0x28857(%rip), %rax     # 0x2b420
movq %rax, -0x40(%rbp)
movl $0x0, -0x78(%rbp)
movl $0x1, -0x74(%rbp)
movl $0x0, -0x70(%rbp)
movq 0x2859f(%rip), %rax     # 0x2b188
movq %rax, -0x68(%rbp)
movslq 0x2880c(%rip), %rax     # 0x2b400
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1aa90
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x2368d(%rip), %rsi     # 0x262ad
callq 0x1ab20
movq %rax, -0x18(%rbp)
movl $0x2, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x351b
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x21a10
movq %rax, -0x2d0(%rbp)
movq -0x2d0(%rbp), %rdi
callq 0x215e0
movq %rax, -0x2d8(%rbp)
cmpq $0x0, %rax
je 0x3501
movl $0x0, 0x2a6ed(%rip)     # 0x2d368
movl $0x0, 0x2a6e7(%rip)     # 0x2d36c
movq 0x284ec(%rip), %rax     # 0x2b178
movl 0x30(%rax), %eax
movl %eax, 0x2a6db(%rip)     # 0x2d370
movq -0x2d0(%rbp), %rdi
callq 0x217d0
movq %rax, %rdi
movl $0x2e, %esi
callq 0x2260
movq %rax, -0x5178(%rbp)
cmpq $0x0, -0x5178(%rbp)
je 0x2faf
movq -0x5178(%rbp), %rdi
addq $0x1, %rdi
leaq -0x5180(%rbp), %rsi
movl $0xa, %edx
callq 0x21b0
movl %eax, -0x5188(%rbp)
movq -0x5180(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2fad
movq -0x5180(%rbp), %rax
movq -0x5178(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x2fad
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x2358f(%rip), %rsi     # 0x262b1
leaq 0x23584(%rip), %rcx     # 0x262ad
callq 0x1ac60
movq %rax, %rdi
leaq 0x2462d(%rip), %rsi     # 0x27365
callq 0x1aa10
movq %rax, -0x2e0(%rbp)
cmpq $0x0, -0x2e0(%rbp)
jne 0x2d58
movl $0x1, %edi
callq 0x2280
movq -0x2e0(%rbp), %rdi
leaq 0x2354d(%rip), %rsi     # 0x262b3
leaq -0x518c(%rbp), %rdx
movb $0x0, %al
callq 0x2080
cmpl $0x1, %eax
je 0x2da5
movq 0x28278(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2a6b6(%rip), %rax     # 0x2d440
movq (%rax), %rdx
leaq 0x2352c(%rip), %rsi     # 0x262c0
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2280
movl $0x0, -0x5184(%rbp)
movl -0x5184(%rbp), %eax
cmpl -0x518c(%rbp), %eax
jge 0x2e1a
leaq -0x5170(%rbp), %rdi
movq -0x2e0(%rbp), %rdx
movl $0x4e84, %esi           # imm = 0x4E84
callq 0x2170
cmpq $0x0, %rax
jne 0x2e07
movq 0x28216(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2a654(%rip), %rax     # 0x2d440
movq (%rax), %rdx
leaq 0x234ca(%rip), %rsi     # 0x262c0
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2280
jmp 0x2e09
movl -0x5184(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5184(%rbp)
jmp 0x2daf
movq -0x2e0(%rbp), %rdi
leaq 0x234b8(%rip), %rsi     # 0x262e0
leaq -0x5190(%rbp), %rdx
movb $0x0, %al
callq 0x2080
cmpl $0x1, %eax
je 0x2e67
movq 0x281b6(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2a5f4(%rip), %rax     # 0x2d440
movq (%rax), %rdx
leaq 0x2346a(%rip), %rsi     # 0x262c0
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2280
movq -0x2e0(%rbp), %rdi
leaq 0x23479(%rip), %rsi     # 0x262ee
leaq -0x51a8(%rbp), %rdx
leaq -0x5194(%rbp), %rcx
leaq -0x5198(%rbp), %r8
movb $0x0, %al
callq 0x2080
cmpl $0x3, %eax
je 0x2ec2
movq 0x2815b(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2a599(%rip), %rax     # 0x2d440
movq (%rax), %rdx
leaq 0x2340f(%rip), %rsi     # 0x262c0
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2280
movl $0x1, -0x5184(%rbp)
movl -0x5184(%rbp), %eax
cmpl -0x5188(%rbp), %eax
jg 0x2f41
movq -0x2e0(%rbp), %rdi
leaq 0x2342c(%rip), %rsi     # 0x26314
leaq -0x519c(%rbp), %rdx
leaq 0x2a476(%rip), %rcx     # 0x2d36c
movb $0x0, %al
callq 0x2080
cmpl $0x2, %eax
je 0x2f2e
movq 0x280ef(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2a52d(%rip), %rax     # 0x2d440
movq (%rax), %rdx
leaq 0x233a3(%rip), %rsi     # 0x262c0
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2280
jmp 0x2f30
movl -0x5184(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5184(%rbp)
jmp 0x2ecc
movq -0x2e0(%rbp), %rdi
leaq 0x233c5(%rip), %rsi     # 0x26314
leaq -0x519c(%rbp), %rdx
leaq 0x2a413(%rip), %rcx     # 0x2d370
movb $0x0, %al
callq 0x2080
cmpl $0x2, %eax
je 0x2f95
movq 0x28088(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2a4c6(%rip), %rax     # 0x2d440
movq (%rax), %rdx
leaq 0x2333c(%rip), %rsi     # 0x262c0
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2280
movq -0x2e0(%rbp), %rdi
callq 0x20b0
movl -0x5188(%rbp), %eax
movl %eax, 0x2a3bb(%rip)     # 0x2d368
jmp 0x2faf
cmpl $0x0, 0x2a3b2(%rip)     # 0x2d368
jle 0x301c
movq -0x20(%rbp), %rax
movq %rax, -0x51e8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x51e0(%rbp)
movl 0x2a394(%rip), %esi     # 0x2d368
leaq 0x2345a(%rip), %rdi     # 0x26435
leaq 0x2333f(%rip), %rdx     # 0x26321
callq 0x1adb0
movq -0x51e8(%rbp), %rdi
movq -0x51e0(%rbp), %rdx
movq %rax, %rcx
leaq 0x2331f(%rip), %rsi     # 0x2631e
callq 0x1ac60
movq %rax, %rdi
leaq 0x2331e(%rip), %rsi     # 0x2632c
callq 0x1a970
movq %rax, 0x2a35e(%rip)     # 0x2d378
jmp 0x304d
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x232f3(%rip), %rsi     # 0x2631e
leaq 0x232ef(%rip), %rcx     # 0x26321
callq 0x1ac60
movq %rax, %rdi
leaq 0x232eb(%rip), %rsi     # 0x2632c
callq 0x1a970
movq %rax, 0x2a32b(%rip)     # 0x2d378
movq 0x2a324(%rip), %rdi     # 0x2d378
leaq 0x23d2a(%rip), %rsi     # 0x26d85
callq 0x1aa10
movq %rax, 0x2a319(%rip)     # 0x2d380
cmpq $0x0, 0x2a309(%rip)     # 0x2d378
je 0x307b
cmpq $0x0, 0x2a307(%rip)     # 0x2d380
jne 0x3085
movl $0x1, %edi
callq 0x2280
movl $0x0, -0x51b0(%rbp)
movl $0x1, -0x51ac(%rbp)
movq 0x2a2e0(%rip), %rcx     # 0x2d380
leaq -0x51b0(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x2290
movq 0x2a2c3(%rip), %rcx     # 0x2d380
leaq -0x51ac(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x2290
movq -0x2d8(%rbp), %rcx
leaq -0x28(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x20a0
movq -0x2d8(%rbp), %rcx
leaq 0x2a28d(%rip), %rdi     # 0x2d388
movl $0x4, %esi
movl $0x1, %edx
callq 0x20a0
cmpl $0x0, 0x282ff(%rip)     # 0x2b410
je 0x315c
movq $0x0, 0x2a272(%rip) # 0x2d390
movq $0x0, 0x2a26f(%rip) # 0x2d398
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x51f0(%rbp)
movq -0x2d0(%rbp), %rdi
callq 0x217d0
movq -0x51f0(%rbp), %rsi
movq %rax, %rdx
leaq 0x231f2(%rip), %rdi     # 0x26347
movb $0x0, %al
callq 0x20f0
movl $0x0, -0x51b4(%rbp)
cmpl $0x3e8, -0x51b4(%rbp)   # imm = 0x3E8
jg 0x3199
movslq -0x51b4(%rbp), %rcx
leaq 0x282a0(%rip), %rax     # 0x2b420
movq $0x0, (%rax,%rcx,8)
movl -0x51b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51b4(%rbp)
jmp 0x3166
movq -0x2d8(%rbp), %rdi
leaq 0x9e9(%rip), %rsi       # 0x3b90
xorl %edx, %edx
callq 0x3550
cmpl $0x0, 0x2825b(%rip)     # 0x2b410
je 0x34b8
leaq 0x23196(%rip), %rdi     # 0x26358
movb $0x0, %al
callq 0x20f0
movq 0x2a1c0(%rip), %rdi     # 0x2d390
movq 0x27e01(%rip), %rax     # 0x2afd8
movq (%rax), %rdx
movl $0x7, %esi
callq 0x1aec0
leaq 0x23177(%rip), %rdi     # 0x26362
movb $0x0, %al
callq 0x20f0
movq 0x2a19f(%rip), %rdi     # 0x2d398
movq 0x27dd8(%rip), %rax     # 0x2afd8
movq (%rax), %rdx
movl $0xc, %esi
callq 0x1aec0
leaq 0x23158(%rip), %rdi     # 0x2636c
movb $0x0, %al
callq 0x20f0
cmpl $0x0, 0x281de(%rip)     # 0x2b400
jle 0x3267
leaq 0x23148(%rip), %rdi     # 0x26373
movb $0x0, %al
callq 0x20f0
movl 0x2a138(%rip), %eax     # 0x2d370
subl 0x2a12e(%rip), %eax     # 0x2d36c
movslq %eax, %rdi
subq 0x2a148(%rip), %rdi     # 0x2d390
movq 0x27d89(%rip), %rax     # 0x2afd8
movq (%rax), %rdx
xorl %esi, %esi
callq 0x1aec0
leaq 0x2311e(%rip), %rdi     # 0x2637e
movb $0x0, %al
callq 0x20f0
leaq 0x23151(%rip), %rdi     # 0x263bf
movb $0x0, %al
callq 0x20f0
movq $0x0, -0x51d0(%rbp)
movl $0x0, -0x51b8(%rbp)
cmpl $0x3e8, -0x51b8(%rbp)   # imm = 0x3E8
jg 0x32c7
movslq -0x51b8(%rbp), %rcx
leaq 0x2817c(%rip), %rax     # 0x2b420
movq (%rax,%rcx,8), %rax
addq -0x51d0(%rbp), %rax
movq %rax, -0x51d0(%rbp)
movl -0x51b8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51b8(%rbp)
jmp 0x328a
leaq 0x230c2(%rip), %rdi     # 0x26390
movb $0x0, %al
callq 0x20f0
movq 0x2a084(%rip), %rax     # 0x2d360
movq %rax, -0x51c8(%rbp)
cmpq $0x0, -0x51c8(%rbp)
jle 0x3329
movq 0x2a06c(%rip), %rdx     # 0x2d360
cvtsi2sdq -0x51c8(%rbp), %xmm1
movsd 0x22d03(%rip), %xmm0    # 0x26008
mulsd %xmm1, %xmm0
cvtsi2sdq -0x51d0(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq 0x23089(%rip), %rdi     # 0x263a6
movl $0x3e8, %esi            # imm = 0x3E8
movb $0x1, %al
callq 0x20f0
movq -0x51c8(%rbp), %rcx
movq -0x51d0(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x51d0(%rbp)
movq $0x0, -0x51c8(%rbp)
movl $0x3e7, -0x51b8(%rbp)   # imm = 0x3E7
cmpl $0x0, -0x51b8(%rbp)
jl 0x33f6
movslq -0x51b8(%rbp), %rcx
leaq 0x280af(%rip), %rax     # 0x2b420
cmpq $0x0, (%rax,%rcx,8)
jle 0x33e0
movslq -0x51b8(%rbp), %rcx
leaq 0x2809a(%rip), %rax     # 0x2b420
movq (%rax,%rcx,8), %rax
addq -0x51c8(%rbp), %rax
movq %rax, -0x51c8(%rbp)
movl -0x51b8(%rbp), %esi
movslq -0x51b8(%rbp), %rcx
leaq 0x28074(%rip), %rax     # 0x2b420
movq (%rax,%rcx,8), %rdx
cvtsi2sdq -0x51c8(%rbp), %xmm1
movsd 0x22c47(%rip), %xmm0    # 0x26008
mulsd %xmm1, %xmm0
cvtsi2sdq -0x51d0(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq 0x22fe8(%rip), %rdi     # 0x263c1
movb $0x1, %al
callq 0x20f0
jmp 0x33e2
movl -0x51b8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x51b8(%rbp)
jmp 0x3356
movl $0x0, -0x51b8(%rbp)
movl -0x51b8(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x2800d(%rip), %rax     # 0x2b420
movq (%rax,%rcx,8), %rax
movslq -0x51b8(%rbp), %rdx
leaq 0x27ffb(%rip), %rcx     # 0x2b420
cmpq (%rcx,%rdx,8), %rax
jge 0x343c
movl -0x51b8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51b8(%rbp)
jmp 0x3400
movl -0x51b8(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x51b8(%rbp)
movl %eax, -0x51bc(%rbp)
cmpl $0x3e8, -0x51b8(%rbp)   # imm = 0x3E8
jge 0x34a4
movslq -0x51bc(%rbp), %rcx
leaq 0x27fb3(%rip), %rax     # 0x2b420
movq (%rax,%rcx,8), %rax
movslq -0x51b8(%rbp), %rdx
leaq 0x27fa1(%rip), %rcx     # 0x2b420
cmpq (%rcx,%rdx,8), %rax
jge 0x3491
movl -0x51b8(%rbp), %eax
movl %eax, -0x51bc(%rbp)
jmp 0x3493
movl -0x51b8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51b8(%rbp)
jmp 0x3453
movl -0x51bc(%rbp), %esi
leaq 0x22f2a(%rip), %rdi     # 0x263db
movb $0x0, %al
callq 0x20f0
movq 0x29ec1(%rip), %rdi     # 0x2d380
leaq -0x58(%rbp), %rsi
callq 0x20640
movq 0x29eb1(%rip), %rdi     # 0x2d380
leaq -0x78(%rbp), %rsi
callq 0x20640
movq 0x29ea1(%rip), %rdi     # 0x2d380
callq 0x20b0
movq 0x29e8d(%rip), %rdi     # 0x2d378
callq 0x2030
movq -0x2d8(%rbp), %rdi
callq 0x20b0
jmp 0x2c54
movq -0x2d0(%rbp), %rdi
callq 0x21840
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2c30
movq -0x20(%rbp), %rdi
callq 0x2030
movq -0x18(%rbp), %rdi
callq 0x2030
movq 0x27c44(%rip), %rdi     # 0x2b178
callq 0x1d950
leaq 0x29f00(%rip), %rax     # 0x2d440
movq (%rax), %rdi
callq 0x2030
xorl %edi, %edi
callq 0x2280
nop