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

  //  Process arguments

  { int  i, j, k;
    int  flags[128];

    ARG_INIT("DASpatch")

    j = 1;
    for (i = 1; i < argc; i++)
      if (argv[i][0] == '-')
        switch (argv[i][1])
        { default:
            ARG_FLAGS("v")
            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");
        exit (1);
      }
  }

  //  Open trimmed DB and .qual and .trim tracks

  { int i, 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);

    track = Open_Track(DB,"qual");
    if (track != NULL)
      { Load_All_Track_Data(track);
        QV_IDX = (int64 *) track->anno;
        QV     = (uint8 *) track->data;
      }
    else
      { fprintf(stderr,"%s: Must have a 'qual' track, run DASqv\n",Prog_Name);
        exit (1);
      }

    track = Open_Track(DB,"trim");
    if (track != NULL)
      { FILE *afile;
        char *aname;
        int   extra, tracklen, size;
        DAZZ_EXTRA  ex_hgap, ex_cest, ex_good, ex_bad;

        Load_All_Track_Data(track);

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

        //  Get HGAP minimum, and good and bad qv thresholds from .trim extras

        aname = Strdup(Catenate(DB->path,".","trim",".anno"),"Allocating anno file");
        if (aname == NULL)
          exit (1);
        afile  = fopen(aname,"r");

        fread(&tracklen,sizeof(int),1,afile);
        fread(&size,sizeof(int),1,afile);
        fseeko(afile,0,SEEK_END);
        extra = ftell(afile) - (size*(tracklen+1) + 2*sizeof(int));
        fseeko(afile,-extra,SEEK_END);
        ex_hgap.nelem = 0;
        if (Read_Extra(afile,aname,&ex_hgap) != 0)
          { fprintf(stderr,"%s: Hgap threshold extra missing from .trim track?\n",Prog_Name);
            exit (1);
          }
        ex_cest.nelem = 0;
        if (Read_Extra(afile,aname,&ex_cest) != 0)
          { fprintf(stderr,"%s: Coverage estimate extra missing from .trim track?\n",Prog_Name);
            exit (1);
          }
        ex_good.nelem = 0;
        if (Read_Extra(afile,aname,&ex_good) != 0)
          { fprintf(stderr,"%s: Good QV threshold extra missing from .trim track?\n",Prog_Name);
            exit (1);
          }
        ex_bad.nelem = 0;
        if (Read_Extra(afile,aname,&ex_bad) != 0)
          { fprintf(stderr,"%s: Bad QV threshold extra missing from .trim track?\n",Prog_Name);
            exit (1);
          }
        fclose(afile);

        HGAP_MIN = (int) ((int64 *) (ex_hgap.value))[0];
        GOOD_QV  = (int) ((int64 *) (ex_good.value))[0];
        BAD_QV   = (int) ((int64 *) (ex_bad.value))[0];
      }
    else
      { fprintf(stderr,"%s: Must have a 'trim' track, run DAStrim\n",Prog_Name);
        exit (1);
      }
  }

  //  For each .las block/file

  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 a .las 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 patch track

          { int len, size;

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

            len  = DB_LAST - DB_FIRST;
            size = 8;
            fwrite(&len,sizeof(int),1,PR_AFILE);
            fwrite(&size,sizeof(int),1,PR_AFILE);
            PR_INDEX = 0;
	    fwrite(&PR_INDEX,sizeof(int64),1,PR_AFILE);
          }

          //  Get trace point spacing information

          fread(&novl,sizeof(int64),1,input);
          fread(&TRACE_SPACING,sizeof(int),1,input);
          ANCHOR_THRESH = ANCHOR_MATCH * TRACE_SPACING;

          //  Initialize statistics gathering

          if (VERBOSE)
            { npatch = 0;
              fpatch = 0;
              printf("\nDASpatch -g%d -b%d %s %s\n",GOOD_QV,BAD_QV,argv[1],Block_Arg_Root(parse));
            }

          //  Process each read pile

          make_a_pass(input,PATCH_GAPS,1);

          //  If verbose output statistics summary to stdout

          if (VERBOSE)
            { if (fpatch == 0)
                printf("  All %d patches were successful\n",npatch);
              else
                printf("  %d out of %d total patches failed\n",fpatch,npatch);
            }
    
          fclose(PR_AFILE);
          fclose(PR_DFILE);
          fclose(input);
        }

      Free_Block_Arg(parse);
    }

  free(dpwd);
  free(root);

  Close_DB(DB);
  free(Prog_Name);

  exit (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4fb8, %rsp           # imm = 0x4FB8
movq %rsi, 0x30(%rsp)
movl %edi, %ebp
leaq 0x16c4d(%rip), %rdi     # 0x18028
leaq 0x17aad(%rip), %rsi     # 0x18e8f
callq 0x10e4c
leaq 0x1cf02(%rip), %rcx     # 0x1e2f0
movq %rax, (%rcx)
xorl %eax, %eax
cmpq $0x80, %rax
je 0x1408
andl $0x0, 0x130(%rsp,%rax,4)
incq %rax
jmp 0x13f3
movslq %ebp, %r15
pushq $0x1
popq %r12
pushq $0x1
popq %r13
leaq 0x16c17(%rip), %r14     # 0x18031
movq 0x30(%rsp), %rbp
cmpq %r15, %r13
jge 0x149a
movq (%rbp,%r13,8), %rbx
cmpb $0x2d, (%rbx)
jne 0x1457
incq %rbx
movsbl (%rbx), %ebp
testl %ebp, %ebp
je 0x1464
movq %r14, %rdi
movl %ebp, %esi
callq 0x1140
testq %rax, %rax
je 0x146e
movslq %ebp, %rax
movl $0x1, 0x130(%rsp,%rax,4)
jmp 0x142e
movslq %r12d, %rax
incl %r12d
movq %rbx, (%rbp,%rax,8)
jmp 0x1469
movq 0x30(%rsp), %rbp
incq %r13
jmp 0x141f
movq 0x1cb83(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1ce71(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
leaq 0x16baa(%rip), %rsi     # 0x18033
movl %ebp, %ecx
xorl %eax, %eax
callq 0x11a0
pushq $0x1
popq %rdi
callq 0x1280
movl 0x308(%rsp), %eax
movl %eax, 0x1ccf1(%rip)     # 0x1e198
cmpl $0x2, %r12d
jg 0x14f8
movq 0x1cb44(%rip), %rbx     # 0x1dff8
movq (%rbx), %rdi
leaq 0x1ce32(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
leaq 0x16b89(%rip), %rsi     # 0x18051
leaq 0x16e4f(%rip), %rcx     # 0x1831e
xorl %eax, %eax
callq 0x11a0
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x1170
movq (%rbx), %rcx
leaq 0x16b74(%rip), %rdi     # 0x1805f
pushq $0x36
popq %rsi
pushq $0x1
popq %rdx
callq 0x1290
jmp 0x1492
movq 0x8(%rbp), %rdi
leaq 0x1ccfd(%rip), %rsi     # 0x1e200
callq 0x11c34
testl %eax, %eax
js 0x1492
cmpl $0x1, %eax
jne 0x1532
movq 0x1cae0(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1cdce(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
movq 0x8(%rbp), %rcx
leaq 0x16b66(%rip), %rsi     # 0x18096
jmp 0x159a
cmpl $0x0, 0x1ccff(%rip)     # 0x1e238
jne 0x157b
leaq 0x1ccbe(%rip), %r14     # 0x1e200
movq %r14, %rdi
callq 0x124da
leaq 0x16b94(%rip), %rsi     # 0x180e5
movq %r14, %rdi
callq 0x139f7
testq %rax, %rax
jne 0x15a6
movq 0x1ca93(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1cd81(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
leaq 0x16b71(%rip), %rsi     # 0x180ea
jmp 0x15fa
movq 0x1ca76(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1cd64(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
movq 0x8(%rbp), %rcx
leaq 0x16b26(%rip), %rsi     # 0x180c0
xorl %eax, %eax
callq 0x11a0
jmp 0x1492
movq %rax, %r14
movq %rax, %rdi
callq 0x14359
movq 0x18(%r14), %rax
movq %rax, 0x1cbe4(%rip)     # 0x1e1a0
movq 0x28(%r14), %rax
movq %rax, 0x1cbe1(%rip)     # 0x1e1a8
leaq 0x1cc32(%rip), %rdi     # 0x1e200
leaq 0x16b3e(%rip), %rsi     # 0x18113
callq 0x139f7
testq %rax, %rax
jne 0x1606
movq 0x1ca12(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1cd00(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
leaq 0x16c0b(%rip), %rsi     # 0x18205
xorl %eax, %eax
callq 0x11a0
jmp 0x1492
movq %rax, %r14
movq %rax, %rdi
callq 0x14359
movq 0x18(%r14), %rax
movq %rax, 0x1cb94(%rip)     # 0x1e1b0
movq 0x28(%r14), %rcx
movq %rcx, 0x1cb91(%rip)     # 0x1e1b8
movslq 0x1cc02(%rip), %rcx     # 0x1e230
xorl %edx, %edx
cmpq %rcx, %rdx
jg 0x163f
shrq $0x2, (%rax,%rdx,8)
incq %rdx
jmp 0x1630
movq 0x1cc02(%rip), %rdi     # 0x1e248
leaq 0x16cf4(%rip), %rsi     # 0x18341
leaq 0x16abf(%rip), %rdx     # 0x18113
leaq 0x16c4f(%rip), %rcx     # 0x182aa
callq 0x1102b
leaq 0x16ab1(%rip), %rsi     # 0x18118
movq %rax, %rdi
callq 0x10e4c
testq %rax, %rax
je 0x1492
movq %rax, %r14
leaq 0x17c04(%rip), %rsi     # 0x19286
movq %rax, %rdi
callq 0x1250
movq %rax, %r15
leaq 0x14(%rsp), %rdi
pushq $0x4
popq %r13
pushq $0x1
popq %rbx
movq %r13, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x10b0
leaq 0x74(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x10b0
pushq $0x2
popq %r13
movq %r15, %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x1240
movq %r15, %rdi
callq 0x11b0
leaq 0x14(%rsp), %rcx
movl (%rcx), %ecx
incl %ecx
imull (%rbp), %ecx
subl %eax, %ecx
addl $0x8, %ecx
movslq %ecx, %rsi
movq %r15, %rdi
movl %r13d, %edx
callq 0x1240
leaq 0x130(%rsp), %rdx
andl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1452d
testl %eax, %eax
jne 0x2559
leaq 0x110(%rsp), %rdx
andl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1452d
testl %eax, %eax
jne 0x2579
leaq 0x88(%rsp), %rdx
andl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1452d
testl %eax, %eax
jne 0x2599
leaq 0xf0(%rsp), %rdx
andl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1452d
testl %eax, %eax
jne 0x25b9
movq %r15, %rdi
callq 0x10c0
leaq 0x130(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, 0x1ca32(%rip)     # 0x1e1c0
leaq 0x88(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, 0x1ca22(%rip)     # 0x1e1c4
leaq 0xf0(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, 0x1ca12(%rip)     # 0x1e1c8
movq 0x30(%rsp), %r14
movq 0x8(%r14), %rdi
callq 0x10f0f
movq %rax, 0x50(%rsp)
movq 0x8(%r14), %rdi
leaq 0x16a5c(%rip), %rsi     # 0x18230
callq 0x10f67
movq %rax, 0x48(%rsp)
movl %r12d, %eax
movq %rax, 0xa8(%rsp)
pushq $0x2
popq %rax
cmpq 0xa8(%rsp), %rax
je 0x2628
movq %rax, 0xb0(%rsp)
movq (%r14,%rax,8), %rdi
callq 0x15557
movq %rax, %rbx
movq %rax, 0x78(%rsp)
movq %rbx, %rdi
callq 0x15353
testq %rax, %rax
je 0x2541
movq %rax, 0x18(%rsp)
andl $0x0, 0x1c99c(%rip)     # 0x1e1cc
andl $0x0, 0x1c999(%rip)     # 0x1e1d0
movl 0x1c9f3(%rip), %eax     # 0x1e230
movl %eax, 0x1c991(%rip)     # 0x1e1d4
movq %rbx, %rdi
callq 0x15443
movq %rax, %rdi
pushq $0x2e
popq %rsi
callq 0x1260
testq %rax, %rax
leaq 0x130(%rsp), %r14
leaq 0x17444(%rip), %rbp     # 0x18cac
je 0x19db
movq %rax, %r15
incq %r15
movq %r15, %rdi
leaq 0x88(%rsp), %rsi
pushq $0xa
popq %rdx
callq 0x11d0
movq %rax, %r13
movq 0x88(%rsp), %rax
cmpq %r15, %rax
je 0x19db
cmpb $0x0, (%rax)
jne 0x19db
movq 0x50(%rsp), %rdi
leaq 0x16984(%rip), %rsi     # 0x18234
movq 0x48(%rsp), %rdx
leaq 0x16974(%rip), %rcx     # 0x18230
callq 0x1102b
movq %rax, %rdi
leaq 0x179bb(%rip), %rsi     # 0x19286
callq 0x10eaf
testq %rax, %rax
je 0x1492
movq %rax, %r12
movq %rax, %rdi
leaq 0x16950(%rip), %rsi     # 0x18236
leaq 0x14(%rsp), %rdx
xorl %eax, %eax
callq 0x1090
cmpl $0x1, %eax
jne 0x25d9
pushq $-0x1
popq %rbx
leaq 0x16992(%rip), %r15     # 0x18297
incl %ebx
cmpl 0x14(%rsp), %ebx
jge 0x1927
movq %r14, %rdi
movl $0x4e84, %esi           # imm = 0x4E84
movq %r12, %rdx
callq 0x1180
testq %rax, %rax
jne 0x1905
jmp 0x25d9
movq %r12, %rdi
leaq 0x16932(%rip), %rsi     # 0x18263
leaq 0x74(%rsp), %rdx
xorl %eax, %eax
callq 0x1090
cmpl $0x1, %eax
jne 0x25d9
movq %r12, %rdi
leaq 0x16921(%rip), %rsi     # 0x18271
leaq 0xf0(%rsp), %rdx
leaq 0xec(%rsp), %rcx
leaq 0xe8(%rsp), %r8
xorl %eax, %eax
callq 0x1090
cmpl $0x3, %eax
jne 0x25d9
testl %r13d, %r13d
movl $0x0, %ebx
cmovgl %r13d, %ebx
incl %ebx
movq %r12, %rdi
decl %ebx
je 0x19ad
movq %r15, %rsi
leaq 0x70(%rsp), %rdx
leaq 0x1c834(%rip), %rcx     # 0x1e1d0
xorl %eax, %eax
callq 0x1090
cmpl $0x2, %eax
je 0x1986
jmp 0x25d9
movq %r15, %rsi
leaq 0x70(%rsp), %rdx
leaq 0x1c818(%rip), %rcx     # 0x1e1d4
xorl %eax, %eax
callq 0x1090
cmpl $0x2, %eax
jne 0x25d9
movq %r12, %rdi
callq 0x10c0
movl %r13d, 0x1c7f1(%rip)    # 0x1e1cc
movl 0x1c7eb(%rip), %esi     # 0x1e1cc
testl %esi, %esi
jle 0x1a52
leaq 0x16955(%rip), %r12     # 0x18341
movq %r12, %rdi
leaq 0x168ae(%rip), %rdx     # 0x182a4
callq 0x11152
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x16897(%rip), %r13     # 0x182a1
movq %r13, %rsi
movq 0x48(%rsp), %r15
movq %r15, %rdx
movq %rax, %rcx
callq 0x1102b
movq %rax, %rdi
movq %rbp, %rsi
callq 0x10eaf
movq %rax, 0x1c7a9(%rip)     # 0x1e1d8
movl 0x1c797(%rip), %esi     # 0x1e1cc
movq %r12, %rdi
leaq 0x16871(%rip), %rdx     # 0x182b0
callq 0x11152
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rax, %rcx
jmp 0x1a9a
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x16840(%rip), %r12     # 0x182a1
movq %r12, %rsi
movq 0x48(%rsp), %r15
movq %r15, %rdx
leaq 0x16831(%rip), %rcx     # 0x182a4
callq 0x1102b
movq %rax, %rdi
movq %rbp, %rsi
callq 0x10eaf
movq %rax, 0x1c74e(%rip)     # 0x1e1d8
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
leaq 0x16816(%rip), %rcx     # 0x182b0
callq 0x1102b
movq 0x18(%rsp), %r13
movq %rax, %rdi
movq %rbp, %rsi
callq 0x10eaf
movq %rax, 0x1c72a(%rip)     # 0x1e1e0
movq 0x1c71b(%rip), %rcx     # 0x1e1d8
testq %rcx, %rcx
je 0x1492
testq %rax, %rax
je 0x1492
movl 0x1c6ff(%rip), %eax     # 0x1e1d4
subl 0x1c6f5(%rip), %eax     # 0x1e1d0
movl %eax, 0x130(%rsp)
movl $0x8, 0x88(%rsp)
movq %r14, %rdi
pushq $0x4
popq %r14
movq %r14, %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1290
movq 0x1c6cf(%rip), %rcx     # 0x1e1d8
leaq 0x88(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1290
andq $0x0, 0x1c6c4(%rip)     # 0x1e1e8
movq 0x1c6ad(%rip), %rcx     # 0x1e1d8
leaq 0x1c6b6(%rip), %rdi     # 0x1e1e8
pushq $0x8
popq %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1290
leaq 0x110(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x10b0
leaq 0x1c692(%rip), %rdi     # 0x1e1f0
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x10b0
cvtsi2sdl 0x1c67c(%rip), %xmm0 # 0x1e1f0
mulsd 0x1648c(%rip), %xmm0    # 0x18008
cvttsd2si %xmm0, %eax
movl %eax, 0x1c66e(%rip)     # 0x1e1f4
cmpl $0x0, 0x1c60b(%rip)     # 0x1e198
je 0x1bd6
andl $0x0, 0x1c662(%rip)     # 0x1e1f8
andl $0x0, 0x1c65f(%rip)     # 0x1e1fc
movl 0x1c621(%rip), %ebp     # 0x1e1c4
movl 0x1c61e(%rip), %r12d    # 0x1e1c8
movq 0x30(%rsp), %rax
movq 0x8(%rax), %r15
movq 0x78(%rsp), %rdi
callq 0x15443
leaq 0x166f8(%rip), %rdi     # 0x182bc
movl %ebp, %esi
movl %r12d, %edx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x1100
cmpq $0x0, 0x1c692(%rip)     # 0x1e270
jne 0x1c07
movslq 0x1c589(%rip), %rax     # 0x1e170
imulq $0x30, %rax, %rdi
leaq 0x16751(%rip), %rsi     # 0x18343
callq 0x10d91
movq %rax, 0x1c672(%rip)     # 0x1e270
testq %rax, %rax
je 0x1492
cmpq $0x0, 0x1c669(%rip)     # 0x1e278
jne 0x1c37
movslq 0x1c55c(%rip), %rdi     # 0x1e174
addq %rdi, %rdi
leaq 0x1673b(%rip), %rsi     # 0x1835d
callq 0x10d91
movq %rax, 0x1c64a(%rip)     # 0x1e278
testq %rax, %rax
je 0x1492
movq %r13, %rdi
callq 0x1110
leaq 0x130(%rsp), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
movq %r13, %rcx
callq 0x10b0
leaq 0x1c591(%rip), %rdi     # 0x1e1f0
pushq $0x4
popq %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x10b0
movl 0x1c57d(%rip), %eax     # 0x1e1f0
xorl %ebx, %ebx
movl %eax, 0x3c(%rsp)
cmpl $0x7e, %eax
setge %bl
incl %ebx
movq 0x1c5e8(%rip), %rsi     # 0x1e270
movq %r13, %rdi
callq 0x839d
movq 0x1c5d9(%rip), %rdi     # 0x1e270
movl %ebx, %ecx
movq %rcx, 0x80(%rsp)
testl %eax, %eax
je 0x1cb1
movl $0x7fffffff, 0x24(%rdi) # imm = 0x7FFFFFFF
jmp 0x1d4a
movl 0x8(%rdi), %ecx
movq 0x1c5bd(%rip), %rax     # 0x1e278
cmpl 0x1c4b3(%rip), %ecx     # 0x1e174
jle 0x1d10
cvtsi2sd %ecx, %xmm0
mulsd 0x16341(%rip), %xmm0    # 0x18010
addsd 0x16341(%rip), %xmm0    # 0x18018
cvttsd2si %xmm0, %ecx
movl %ecx, 0x1c493(%rip)     # 0x1e174
movslq %ecx, %rsi
addq %rsi, %rsi
movq %rax, %rdi
leaq 0x16683(%rip), %rdx     # 0x18374
callq 0x10de9
movq %rax, 0x1c57b(%rip)     # 0x1e278
testq %rax, %rax
je 0x1492
movq 0x1c563(%rip), %rcx     # 0x1e270
movl 0x8(%rcx), %ecx
movslq %ecx, %rdx
movq %rax, %rdi
movq 0x80(%rsp), %rsi
movq %r13, %rcx
callq 0x10b0
movq 0x1c543(%rip), %rdi     # 0x1e270
cmpl $0x7d, 0x3c(%rsp)
jg 0x1d4a
movq 0x1c53d(%rip), %rax     # 0x1e278
movq %rax, (%rdi)
callq 0x84af
movq 0x1c526(%rip), %rdi     # 0x1e270
movslq 0x1c47f(%rip), %rbp     # 0x1e1d0
cmpl %ebp, 0x24(%rdi)
jl 0x2602
xorl %eax, %eax
xorl %r8d, %r8d
movslq 0x1c46e(%rip), %rcx     # 0x1e1d4
movq 0x1c503(%rip), %rdx     # 0x1e270
cltq
imulq $0x30, %rax, %rax
cmpq %rcx, %rbp
jge 0x24cb
movupd (%rdx,%rax), %xmm0
movups 0x10(%rdx,%rax), %xmm1
movups 0x20(%rdx,%rax), %xmm2
movups %xmm2, 0x20(%rdx)
movups %xmm1, 0x10(%rdx)
movupd %xmm0, (%rdx)
movslq 0x24(%rdx), %r14
cmpq %r14, %rbp
jne 0x1f15
movq 0x1c4cd(%rip), %rdi     # 0x1e278
movq %rdx, %rbx
movslq %r8d, %rax
leaq (%rdi,%rax,2), %rsi
movslq 0x8(%rdx), %rdx
addq %rdx, %rdx
callq 0x1230
movl 0x8(%rbx), %r15d
xorl %r12d, %r12d
pushq $0x1
popq %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rax
leaq (%rax,%r12), %rsi
addq $0x30, %rsi
movq %r13, %rdi
callq 0x839d
movq 0x1c486(%rip), %rcx     # 0x1e270
testl %eax, %eax
jne 0x2487
movl 0x38(%rcx,%r12), %ecx
leal (%rcx,%r15), %edx
movq 0x1c476(%rip), %rax     # 0x1e278
cmpl 0x1c36c(%rip), %edx     # 0x1e174
jle 0x1e59
cvtsi2sd %edx, %xmm0
mulsd 0x161fa(%rip), %xmm0    # 0x18010
addsd 0x161fa(%rip), %xmm0    # 0x18018
cvttsd2si %xmm0, %ecx
movl %ecx, 0x1c34c(%rip)     # 0x1e174
movslq %ecx, %rsi
addq %rsi, %rsi
movq %rax, %rdi
leaq 0x1653c(%rip), %rdx     # 0x18374
callq 0x10de9
movq %rax, 0x1c434(%rip)     # 0x1e278
testq %rax, %rax
je 0x1492
movq 0x1c41c(%rip), %rcx     # 0x1e270
movl 0x38(%rcx,%r12), %ecx
movslq %r15d, %rbx
leaq (%rax,%rbx,2), %rdi
movslq %ecx, %rdx
movq 0x80(%rsp), %rsi
movq %r13, %rcx
callq 0x10b0
cmpl $0x7d, 0x3c(%rsp)
jg 0x1e9b
addq %rbx, %rbx
addq 0x1c3f4(%rip), %rbx     # 0x1e278
movq 0x1c3e5(%rip), %rax     # 0x1e270
leaq (%rax,%r12), %rdi
addq $0x30, %rdi
movq %rbx, (%rdi)
callq 0x84af
movq 0x1c3ce(%rip), %rdi     # 0x1e270
cmpl %r14d, 0x54(%rdi,%r12)
jne 0x2492
addl 0x38(%rdi,%r12), %r15d
movq 0x8(%rsp), %rax
incq %rax
cmpl %eax, 0x1c2b0(%rip)     # 0x1e170
movq %rax, 0x8(%rsp)
jle 0x1ecc
movq %rdi, %rax
jmp 0x1f0c
cvtsi2sd %eax, %xmm0
mulsd 0x16138(%rip), %xmm0    # 0x18010
addsd 0x16140(%rip), %xmm0    # 0x18020
cvttsd2si %xmm0, %eax
movl %eax, 0x1c286(%rip)     # 0x1e170
cltq
imulq $0x30, %rax, %rsi
leaq 0x164d7(%rip), %rdx     # 0x183ce
callq 0x10de9
movq %rax, 0x1c36d(%rip)     # 0x1e270
testq %rax, %rax
je 0x1492
addq $0x30, %r12
jmp 0x1dd3
movq %rdx, 0x58(%rsp)
movq $0x0, 0x8(%rsp)
movq %r8, 0xb8(%rsp)
movq 0x1c32e(%rip), %rcx     # 0x1e260
movq %rbp, 0xc0(%rsp)
movslq %ebp, %rax
imulq $0x28, %rax, %rdx
movl 0x4(%rcx,%rdx), %ecx
cmpl 0x1c275(%rip), %ecx     # 0x1e1c0
jl 0x2451
movq 0x1c258(%rip), %rdx     # 0x1e1b0
movq (%rdx,%rax,8), %rcx
movq 0x8(%rdx,%rax,8), %rax
leal 0x2(%rcx), %edx
cmpl %eax, %edx
jge 0x2451
movq 0x1c245(%rip), %rdx     # 0x1e1b8
movq %rcx, %rsi
shlq $0x20, %rsi
movq %rsi, %rdi
sarq $0x1e, %rdi
movl (%rdx,%rdi), %r8d
movabsq $0x100000000, %rdi      # imm = 0x100000000
addq %rdi, %rsi
sarq $0x1e, %rsi
movl (%rdx,%rsi), %edx
movq %rdx, 0x20(%rsp)
movq 0x8(%rsp), %rdx
testl %edx, %edx
movl $0x0, %esi
cmovgl %edx, %esi
movq %rsi, 0xc8(%rsp)
movslq %edx, %rdx
movq %rdx, 0xe0(%rsp)
movslq %ecx, %rcx
cltq
movq %rax, 0xd0(%rsp)
xorl %r14d, %r14d
leaq 0x3(%rcx), %rax
cmpq 0xd0(%rsp), %rax
jge 0x2451
movq 0x1c1cf(%rip), %rdx     # 0x1e1b8
movq %rax, 0xd8(%rsp)
movl (%rdx,%rax,4), %eax
movq %rax, 0x28(%rsp)
movl 0x8(%rdx,%rcx,4), %eax
movl 0x10(%rdx,%rcx,4), %r12d
testl %eax, %eax
je 0x2068
cmpl $0x2, %eax
je 0x2054
cmpl $0x1, %eax
jne 0x23a9
movl 0x1c1da(%rip), %eax     # 0x1e1f4
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rax
leal -0x190(%rax), %ecx
movq 0x28(%rsp), %rax
addl $0x190, %eax            # imm = 0x190
cmpl %r8d, %ecx
movl %ecx, 0x44(%rsp)
cmovgl %ecx, %r8d
cmpl %r12d, %eax
movl %r12d, %ecx
movl %eax, 0x40(%rsp)
cmovll %eax, %ecx
movl %ecx, 0x4(%rsp)
jmp 0x2197
andl $0x0, 0x88(%rsp)
leaq 0x1c21d(%rip), %r14     # 0x1e280
jmp 0x23df
movq 0x20(%rsp), %rax
leal -0x190(%rax), %ecx
movq 0x28(%rsp), %rax
addl $0x190, %eax            # imm = 0x190
cmpl %r8d, %ecx
movl %ecx, 0x44(%rsp)
cmovgl %ecx, %r8d
cmpl %r12d, %eax
movl %r12d, %ebx
movl %eax, 0x40(%rsp)
cmovll %eax, %r12d
movl %r12d, 0x4(%rsp)
orl $-0x1, 0x1c1fa(%rip)    # 0x1e29c
movl 0x1c148(%rip), %eax     # 0x1e1f0
movl %eax, 0x1c1fe(%rip)     # 0x1e2ac
movl $0x64, 0x1c1fc(%rip)    # 0x1e2b4
movl 0x1c136(%rip), %eax     # 0x1e1f4
movl %eax, 0x10(%rsp)
movl 0x1c0fc(%rip), %eax     # 0x1e1c4
movl %eax, 0x60(%rsp)
movq 0xc8(%rsp), %r14
movq 0x58(%rsp), %r12
subq $0x1, %r14
jb 0x217f
cmpl %r8d, 0x10(%r12)
jg 0x2176
movl 0x4(%rsp), %eax
cmpl %eax, 0x18(%r12)
jl 0x2176
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r12, %rdx
movq %r12, %rcx
movl %r8d, %r13d
callq 0x265e
movl %r13d, %r8d
testq %rax, %rax
je 0x2176
movq %rax, %r15
movl (%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x2825
movl %r13d, %r8d
testl %eax, %eax
jne 0x2176
movl 0x10(%r15), %eax
cmpl 0x10(%rsp), %eax
jg 0x2176
movl 0x18(%r15), %ecx
cmpl 0x60(%rsp), %ecx
jg 0x2176
cmpl $0x0, 0x14(%r15)
jne 0x2176
addl %eax, %ecx
movl 0x1c161(%rip), %eax     # 0x1e2b4
addl 0x1c153(%rip), %eax     # 0x1e2ac
cmpl %eax, %ecx
jge 0x2176
movupd (%r15), %xmm0
movups 0xc(%r15), %xmm1
movups %xmm1, 0x1c13a(%rip)    # 0x1e2a8
movupd %xmm0, 0x1c126(%rip)    # 0x1e29c
addq $0x30, %r12
jmp 0x20d9
movl 0x1c117(%rip), %eax     # 0x1e29c
leaq 0x1c110(%rip), %r14     # 0x1e29c
testl %eax, %eax
movl %ebx, %r12d
jns 0x23b0
movl %r8d, %r13d
movl %r12d, 0x68(%rsp)
orl $-0x1, 0x1c12e(%rip)    # 0x1e2d4
movl 0x1c074(%rip), %eax     # 0x1e220
movl %eax, 0x1c136(%rip)     # 0x1e2e8
movl $0x64, 0x1c130(%rip)    # 0x1e2ec
xorl %r14d, %r14d
cmpl 0x8(%rsp), %r14d
jge 0x2398
movslq %r14d, %rax
imulq $0x30, %rax, %rcx
movq 0x58(%rsp), %rdx
leaq (%rdx,%rcx), %rsi
movq %rsi, 0x60(%rsp)
addq %rdx, %rcx
addq $0x28, %rcx
movslq (%rcx), %rsi
movq 0x1c070(%rip), %rdx     # 0x1e260
imulq $0x28, %rsi, %rdi
movl 0x4(%rdx,%rdi), %edx
movl %edx, 0x6c(%rsp)
movl -0x8(%rcx), %r10d
andl $0x1, %r10d
cmovnel %r14d, %r15d
movq 0xe0(%rsp), %r9
subq %rax, %r9
pushq $-0x1
popq %rbp
movl %ebp, %r8d
movl %ebp, %r11d
movl %r10d, %eax
subq $0x1, %r9
jb 0x22ae
cmpl %esi, (%rcx)
jne 0x22b6
movl -0x8(%rcx), %r10d
andl $0x1, %r10d
cmpl %eax, %r10d
cmovnel %r14d, %r15d
movl -0x18(%rcx), %ebx
movl -0x10(%rcx), %eax
cmpl %r13d, %ebx
jg 0x225b
pushq $-0x1
popq %r12
movl %r12d, %edx
movl %r14d, %edi
cmpl 0x4(%rsp), %eax
jge 0x229a
movl 0x4(%rsp), %edx
cmpl %edx, %ebx
jg 0x2274
cmpl %edx, %eax
jl 0x2274
movl %ebx, %edx
subl -0x14(%rcx), %edx
cmpl 0x44(%rsp), %edx
cmovlel %r14d, %r11d
movl %r11d, %r12d
cmpl %r13d, %ebx
jg 0x2295
cmpl %r13d, %eax
jl 0x2295
addl 0x6c(%rsp), %eax
movq 0x60(%rsp), %rdx
subl 0x1c(%rdx), %eax
cmpl 0x40(%rsp), %eax
cmovgel %r14d, %r8d
movl %r8d, %edx
movl %ebp, %edi
addq $0x30, %rcx
incl %r14d
movl %edx, %r8d
movl %r12d, %r11d
movl %edi, %ebp
jmp 0x221c
movq 0x8(%rsp), %rcx
movl %ecx, %r14d
testl %eax, %eax
cmovel %r14d, %r15d
movl %ebp, %eax
testl %ebp, %ebp
js 0x2349
movl %ebp, %ecx
imulq $0x30, %rcx, %rdx
movq 0x58(%rsp), %rsi
addq %rsi, %rdx
movl %eax, %eax
imulq $0x30, %rax, %rcx
addq %rsi, %rcx
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x265e
testq %rax, %rax
je 0x21bf
movq %rax, %r12
movl (%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x2825
testl %eax, %eax
jne 0x21bf
movl 0x10(%rsp), %eax
cmpl %eax, 0x10(%r12)
jg 0x21bf
movl 0x1bfc6(%rip), %eax     # 0x1e2e8
cmpl %eax, 0x14(%r12)
jge 0x237f
movupd (%r12), %xmm0
movups 0xc(%r12), %xmm1
movups %xmm1, 0x1bfa4(%rip)    # 0x1e2e0
movupd %xmm0, 0x1bf90(%rip)    # 0x1e2d4
jmp 0x21bf
testl %r8d, %r8d
js 0x21bf
cmpl %r11d, %r8d
jge 0x21bf
cmpl %r15d, %r11d
jl 0x2374
movl %r8d, %ebp
movl %r11d, %eax
cmpl %r8d, %r15d
jg 0x21bf
jmp 0x22c6
movl %r8d, %ebp
movl %r11d, %eax
jmp 0x22c6
jne 0x21bf
movl 0x18(%r12), %eax
cmpl 0x1bf5c(%rip), %eax     # 0x1e2ec
jge 0x21bf
jmp 0x2329
leaq 0x1bf35(%rip), %r14     # 0x1e2d4
movq 0x18(%rsp), %r13
movl 0x68(%rsp), %r12d
movl (%r14), %eax
testl %eax, %eax
js 0x23bb
cmpl $0x0, 0x4(%r14)
je 0x23cb
notl %eax
jmp 0x23cd
andl $0x0, 0x88(%rsp)
incl 0x1be33(%rip)           # 0x1e1fc
jmp 0x23d9
incl %eax
movl %eax, 0x88(%rsp)
movq 0x18(%rsp), %r13
incl 0x1be19(%rip)           # 0x1e1f8
movq 0x1bdfa(%rip), %rcx     # 0x1e1e0
leaq 0x88(%rsp), %rdi
pushq $0x4
popq %r15
movq %r15, %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1290
leaq 0x8(%r14), %rdi
movq 0x1bdd5(%rip), %rcx     # 0x1e1e0
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1290
leaq 0xc(%r14), %rdi
movq 0x1bdbf(%rip), %rcx     # 0x1e1e0
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1290
addq $0xc, 0x1bdb4(%rip)     # 0x1e1e8
movq 0xd8(%rsp), %rcx
movq 0x28(%rsp), %rax
movl %eax, %r8d
movl %r12d, %eax
movq %rax, 0x20(%rsp)
jmp 0x1fd0
movq 0x1bd80(%rip), %rcx     # 0x1e1d8
leaq 0x1bd89(%rip), %rdi     # 0x1e1e8
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x1290
movq 0xc0(%rsp), %rbp
incq %rbp
movq 0x8(%rsp), %rax
movq 0xb8(%rsp), %r8
jmp 0x1d5f
movl $0x7fffffff, 0x54(%rcx,%r12) # imm = 0x7FFFFFFF
jmp 0x2495
movq %rdi, %rcx
movq 0x1bddc(%rip), %rax     # 0x1e278
movq %rcx, 0x58(%rsp)
addq $0x8, %rcx
xorl %r8d, %r8d
movq 0x8(%rsp), %rdx
subq $0x1, %rdx
jb 0x1f23
movslq %r8d, %r8
leaq (%rax,%r8,2), %rsi
movq %rsi, -0x8(%rcx)
addl (%rcx), %r8d
addq $0x30, %rcx
jmp 0x24ad
cmpl $0x7fffffff, 0x24(%rdx,%rax) # imm = 0x7FFFFFFF
jne 0x2602
cmpl $0x0, 0x1bcb8(%rip)     # 0x1e198
movq 0x30(%rsp), %r14
je 0x2517
movl 0x1bd0f(%rip), %esi     # 0x1e1fc
movl 0x1bd05(%rip), %edx     # 0x1e1f8
testl %esi, %esi
je 0x2507
leaq 0x15dfb(%rip), %rdi     # 0x182f9
xorl %eax, %eax
callq 0x1100
jmp 0x2517
leaq 0x15dc9(%rip), %rdi     # 0x182d7
movl %edx, %esi
xorl %eax, %eax
callq 0x1100
movq 0x1bcba(%rip), %rdi     # 0x1e1d8
callq 0x10c0
movq 0x1bcb6(%rip), %rdi     # 0x1e1e0
callq 0x10c0
movq %r13, %rdi
callq 0x10c0
movq 0x78(%rsp), %rbx
jmp 0x1813
movq %rbx, %rdi
callq 0x1546e
movq 0xb0(%rsp), %rax
incq %rax
jmp 0x17ec
movq 0x1ba98(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1bd86(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
leaq 0x15bb9(%rip), %rsi     # 0x1812d
jmp 0x15fa
movq 0x1ba78(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1bd66(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
leaq 0x15bcd(%rip), %rsi     # 0x18161
jmp 0x15fa
movq 0x1ba58(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1bd46(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
leaq 0x15be4(%rip), %rsi     # 0x18198
jmp 0x15fa
movq 0x1ba38(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1bd26(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
leaq 0x15bfb(%rip), %rsi     # 0x181cf
jmp 0x15fa
movq 0x1ba18(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1bd06(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
leaq 0x15c4f(%rip), %rsi     # 0x18243
xorl %eax, %eax
callq 0x11a0
pushq $0x2
jmp 0x1494
movq 0x1b9ef(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1bcdd(%rip), %rax     # 0x1e2f0
movq (%rax), %rdx
movl 0x1bbb0(%rip), %ecx     # 0x1e1cc
leaq 0x15d67(%rip), %rsi     # 0x1838a
jmp 0x148b
movq 0x50(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rdi
callq 0x1030
leaq 0x1bbbd(%rip), %rdi     # 0x1e200
callq 0x12c93
leaq 0x1bca1(%rip), %rax     # 0x1e2f0
movq (%rax), %rdi
callq 0x1030
xorl %edi, %edi
callq 0x1280