// File: /workspace/github_c_makefile_star2_O3/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, 0x20(%rsp)
movl %edi, %ebp
leaq 0x17b7d(%rip), %rdi     # 0x1a028
leaq 0x18a3d(%rip), %rsi     # 0x1aeef
callq 0x1256e
leaq 0x1de32(%rip), %r15     # 0x202f0
movq %rax, (%r15)
leaq 0x130(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x1130
cmpl $0x1, %ebp
jle 0x25b0
movl %ebp, %r15d
movl $0x1, %r12d
movl $0x1, %r13d
leaq 0x17b3d(%rip), %r14     # 0x1a031
movq 0x20(%rsp), %rcx
movq (%rcx,%r13,8), %rbx
cmpb $0x2d, (%rbx)
jne 0x2541
movb 0x1(%rbx), %al
testb %al, %al
je 0x254b
addq $0x2, %rbx
movsbl %al, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x1140
testq %rax, %rax
je 0x2604
movslq %ebp, %rax
movl $0x1, 0x130(%rsp,%rax,4)
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0x250d
movq 0x20(%rsp), %rcx
jmp 0x254b
movslq %r12d, %rax
incl %r12d
movq %rbx, (%rcx,%rax,8)
incq %r13
cmpq %r15, %r13
jne 0x24f9
movl 0x308(%rsp), %eax
movl %eax, 0x1dc38(%rip)     # 0x20198
cmpl $0x2, %r12d
leaq 0x1dd85(%rip), %r15     # 0x202f0
jle 0x25ba
movq 0x8(%rcx), %rdi
leaq 0x1dc88(%rip), %rsi     # 0x20200
callq 0x13537
testl %eax, %eax
js 0x2628
cmpl $0x1, %eax
jne 0x2632
movq 0x1da63(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movq (%r15), %rdx
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rcx
leaq 0x17aeb(%rip), %rsi     # 0x1a096
jmp 0x2691
movl $0x0, 0x1dbde(%rip)     # 0x20198
movq 0x1da37(%rip), %rbx     # 0x1fff8
movq (%rbx), %rdi
movq (%r15), %rdx
leaq 0x17a83(%rip), %rsi     # 0x1a051
leaq 0x17d49(%rip), %rcx     # 0x1a31e
xorl %eax, %eax
callq 0x11a0
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x1170
movq (%rbx), %rcx
leaq 0x17a6c(%rip), %rdi     # 0x1a05f
movl $0x36, %esi
movl $0x1, %edx
callq 0x1290
jmp 0x2628
movq 0x1d9ed(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1dcdb(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x17a14(%rip), %rsi     # 0x1a033
movl %ebp, %ecx
xorl %eax, %eax
callq 0x11a0
movl $0x1, %edi
callq 0x1280
cmpl $0x0, 0x1dbff(%rip)     # 0x20238
jne 0x2674
leaq 0x1dbbe(%rip), %r14     # 0x20200
movq %r14, %rdi
callq 0x13d40
leaq 0x17a94(%rip), %rsi     # 0x1a0e5
movq %r14, %rdi
callq 0x153a4
testq %rax, %rax
jne 0x269a
movq 0x1d993(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movq (%r15), %rdx
leaq 0x17a78(%rip), %rsi     # 0x1a0ea
jmp 0x26e7
movq 0x1d97d(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movq (%r15), %rdx
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rcx
leaq 0x17a2f(%rip), %rsi     # 0x1a0c0
xorl %eax, %eax
callq 0x11a0
jmp 0x2628
movq %rax, %r14
movq %rax, %rdi
callq 0x15c7f
movq 0x18(%r14), %rax
movq %rax, 0x1daf0(%rip)     # 0x201a0
movq 0x28(%r14), %rax
movq %rax, 0x1daed(%rip)     # 0x201a8
leaq 0x1db3e(%rip), %rdi     # 0x20200
leaq 0x17a4a(%rip), %rsi     # 0x1a113
callq 0x153a4
testq %rax, %rax
jne 0x26f3
movq 0x1d91e(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movq (%r15), %rdx
leaq 0x17b1e(%rip), %rsi     # 0x1a205
xorl %eax, %eax
callq 0x11a0
jmp 0x2628
movq %rax, %r14
movq %rax, %rdi
callq 0x15c7f
movq 0x18(%r14), %rax
movq %rax, 0x1daa7(%rip)     # 0x201b0
movq 0x28(%r14), %rcx
movq %rcx, 0x1daa4(%rip)     # 0x201b8
movl 0x1db16(%rip), %ecx     # 0x20230
testl %ecx, %ecx
js 0x2730
incq %rcx
xorl %edx, %edx
shrq $0x2, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x2723
movq 0x1db11(%rip), %rdi     # 0x20248
leaq 0x17c03(%rip), %rsi     # 0x1a341
leaq 0x179ce(%rip), %rdx     # 0x1a113
leaq 0x17b5e(%rip), %rcx     # 0x1a2aa
callq 0x12753
leaq 0x179c0(%rip), %rsi     # 0x1a118
movq %rax, %rdi
callq 0x1256e
testq %rax, %rax
je 0x2628
movq %rax, %r14
leaq 0x18b73(%rip), %rsi     # 0x1b2e6
movq %rax, %rdi
callq 0x1250
movq %rax, %r15
leaq 0x34(%rsp), %rbp
movl $0x4, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %rax, %rcx
callq 0x10b0
leaq 0x8c(%rsp), %r13
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %r15, %rcx
callq 0x10b0
movq %r15, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1240
movq %r15, %rdi
callq 0x11b0
movl (%rbp), %ecx
incl %ecx
imull (%r13), %ecx
subl %eax, %ecx
addl $0x8, %ecx
movslq %ecx, %rsi
movq %r15, %rdi
movl $0x2, %edx
callq 0x1240
leaq 0x130(%rsp), %rdx
movl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x15e4b
testl %eax, %eax
jne 0x3757
leaq 0x110(%rsp), %rdx
movl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x15e4b
testl %eax, %eax
jne 0x3777
leaq 0x98(%rsp), %rdx
movl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x15e4b
testl %eax, %eax
jne 0x3797
leaq 0xf0(%rsp), %rdx
movl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x15e4b
testl %eax, %eax
jne 0x37b7
movq %r15, %rdi
callq 0x10c0
leaq 0x130(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, 0x1d931(%rip)     # 0x201c0
leaq 0x98(%rsp), %rbp
movq 0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, 0x1d921(%rip)     # 0x201c4
leaq 0xf0(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, 0x1d911(%rip)     # 0x201c8
movq 0x20(%rsp), %rbx
movq 0x8(%rbx), %rdi
callq 0x12631
movq %rax, 0x60(%rsp)
movq 0x8(%rbx), %rdi
leaq 0x1795b(%rip), %rsi     # 0x1a230
callq 0x1268b
movq %rax, 0x58(%rsp)
movl %r12d, %eax
movq %rax, 0xb8(%rsp)
movl $0x2, %ecx
xorl %r13d, %r13d
movq 0x20(%rsp), %rax
movq %rcx, 0xc0(%rsp)
movq (%rax,%rcx,8), %rdi
callq 0x17336
movq %rax, %rbx
movq %rax, %rdi
callq 0x17168
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x3700
movq %rbx, 0x90(%rsp)
movl %r13d, 0x1d89c(%rip)    # 0x201cc
movl %r13d, 0x1d899(%rip)    # 0x201d0
movl 0x1d8f3(%rip), %eax     # 0x20230
movl %eax, 0x1d891(%rip)     # 0x201d4
movq %rbx, %rdi
callq 0x1721c
movq %rax, %rdi
movl $0x2e, %esi
callq 0x1260
testq %rax, %rax
je 0x2add
movq %rax, %r14
incq %r14
movq %r14, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x11d0
movq %rax, %r15
movq 0x98(%rsp), %rax
cmpq %r14, %rax
je 0x2add
cmpb $0x0, (%rax)
jne 0x2add
movq 0x60(%rsp), %rdi
leaq 0x17894(%rip), %rsi     # 0x1a234
movq 0x58(%rsp), %rdx
leaq 0x17884(%rip), %rcx     # 0x1a230
callq 0x12753
movq %rax, %rdi
leaq 0x1892b(%rip), %rsi     # 0x1b2e6
callq 0x125d1
testq %rax, %rax
je 0x2628
movq %rax, %r12
movq %rax, %rdi
leaq 0x17860(%rip), %rsi     # 0x1a236
leaq 0x34(%rsp), %rdx
xorl %eax, %eax
callq 0x1090
cmpl $0x1, %eax
jne 0x37d7
cmpl $0x0, 0x34(%rsp)
leaq 0x178a0(%rip), %r14     # 0x1a297
jle 0x2a21
xorl %ebx, %ebx
leaq 0x130(%rsp), %rdi
movl $0x4e84, %esi           # imm = 0x4E84
movq %r12, %rdx
callq 0x1180
testq %rax, %rax
je 0x37d7
incl %ebx
cmpl 0x34(%rsp), %ebx
jl 0x29fb
movq %r12, %rdi
leaq 0x17838(%rip), %rsi     # 0x1a263
leaq 0x8c(%rsp), %rdx
xorl %eax, %eax
callq 0x1090
cmpl $0x1, %eax
jne 0x37d7
movq %r12, %rdi
leaq 0x17824(%rip), %rsi     # 0x1a271
leaq 0xf0(%rsp), %rdx
leaq 0xec(%rsp), %rcx
leaq 0xe8(%rsp), %r8
xorl %eax, %eax
callq 0x1090
cmpl $0x3, %eax
jne 0x37d7
movl %r15d, %ebx
testl %r15d, %r15d
jle 0x2aa6
movq %r12, %rdi
movq %r14, %rsi
leaq 0x88(%rsp), %rdx
leaq 0x1d73e(%rip), %rcx     # 0x201d0
xorl %eax, %eax
callq 0x1090
cmpl $0x2, %eax
jne 0x37d7
decl %ebx
jne 0x2a7d
movq %r12, %rdi
movq %r14, %rsi
leaq 0x88(%rsp), %rdx
leaq 0x1d719(%rip), %rcx     # 0x201d4
xorl %eax, %eax
callq 0x1090
cmpl $0x2, %eax
jne 0x37d7
movq %r12, %rdi
callq 0x10c0
movl %r15d, 0x1d6f2(%rip)    # 0x201cc
xorl %r13d, %r13d
movl 0x1d6e9(%rip), %esi     # 0x201cc
testl %esi, %esi
jle 0x2b5e
leaq 0x17853(%rip), %r15     # 0x1a341
movq %r15, %rdi
leaq 0x177ac(%rip), %rdx     # 0x1a2a4
callq 0x1285a
movq 0x60(%rsp), %rbx
movq %rbx, %rdi
leaq 0x17795(%rip), %r13     # 0x1a2a1
movq %r13, %rsi
movq 0x58(%rsp), %r14
movq %r14, %rdx
movq %rax, %rcx
callq 0x12753
movq %rax, %rdi
leaq 0x181e3(%rip), %r12     # 0x1ad0c
movq %r12, %rsi
callq 0x125d1
movq %rax, 0x1d6a0(%rip)     # 0x201d8
movl 0x1d68e(%rip), %esi     # 0x201cc
movq %r15, %rdi
leaq 0x17768(%rip), %rdx     # 0x1a2b0
callq 0x1285a
movq %rbx, %rdi
movq %r13, %rsi
xorl %r13d, %r13d
movq %r14, %rdx
movq %rax, %rcx
jmp 0x2bad
movq 0x60(%rsp), %rbx
movq %rbx, %rdi
leaq 0x17734(%rip), %r15     # 0x1a2a1
movq %r15, %rsi
movq 0x58(%rsp), %r14
movq %r14, %rdx
leaq 0x17725(%rip), %rcx     # 0x1a2a4
callq 0x12753
movq %rax, %rdi
leaq 0x1817e(%rip), %r12     # 0x1ad0c
movq %r12, %rsi
callq 0x125d1
movq %rax, 0x1d63b(%rip)     # 0x201d8
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
leaq 0x17703(%rip), %rcx     # 0x1a2b0
callq 0x12753
movq %rax, %rdi
movq %r12, %rsi
callq 0x125d1
movq %rax, 0x1d61c(%rip)     # 0x201e0
movq 0x1d60d(%rip), %rcx     # 0x201d8
testq %rcx, %rcx
je 0x2628
testq %rax, %rax
je 0x2628
movl 0x1d5f1(%rip), %eax     # 0x201d4
subl 0x1d5e7(%rip), %eax     # 0x201d0
movl %eax, 0x130(%rsp)
movl $0x8, 0x98(%rsp)
movl $0x4, %esi
movl $0x1, %edx
leaq 0x130(%rsp), %rdi
callq 0x1290
movq 0x1d5bf(%rip), %rcx     # 0x201d8
movl $0x4, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x1290
movq $0x0, 0x1d5b2(%rip) # 0x201e8
movq 0x1d59b(%rip), %rcx     # 0x201d8
movl $0x8, %esi
movl $0x1, %edx
leaq 0x1d59a(%rip), %rdi     # 0x201e8
callq 0x1290
movl $0x8, %esi
movl $0x1, %edx
leaq 0x110(%rsp), %rdi
movq 0x18(%rsp), %rbx
movq %rbx, %rcx
callq 0x10b0
movl $0x4, %esi
movl $0x1, %edx
leaq 0x1d56d(%rip), %rdi     # 0x201f0
movq %rbx, %rcx
callq 0x10b0
cvtsi2sdl 0x1d55d(%rip), %xmm0 # 0x201f0
mulsd 0x1736d(%rip), %xmm0    # 0x1a008
cvttsd2si %xmm0, %eax
movl %eax, 0x1d54f(%rip)     # 0x201f4
cmpl $0x0, 0x1d4ec(%rip)     # 0x20198
movq 0x90(%rsp), %rbx
je 0x2cfb
movl %r13d, 0x1d53b(%rip)    # 0x201f8
movl %r13d, 0x1d538(%rip)    # 0x201fc
movl 0x1d4fa(%rip), %ebp     # 0x201c4
movl 0x1d4f7(%rip), %r14d    # 0x201c8
movq 0x20(%rsp), %rax
movq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x1721c
leaq 0x175d3(%rip), %rdi     # 0x1a2bc
movl %ebp, %esi
movl %r14d, %edx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x1100
cmpq $0x0, 0x1d56d(%rip)     # 0x20270
jne 0x2d30
movslq 0x1d464(%rip), %rax     # 0x20170
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdi
leaq 0x17628(%rip), %rsi     # 0x1a343
callq 0x124b1
movq %rax, 0x1d549(%rip)     # 0x20270
testq %rax, %rax
je 0x2628
cmpq $0x0, 0x1d540(%rip)     # 0x20278
jne 0x2d60
movslq 0x1d433(%rip), %rdi     # 0x20174
addq %rdi, %rdi
leaq 0x17612(%rip), %rsi     # 0x1a35d
callq 0x124b1
movq %rax, 0x1d521(%rip)     # 0x20278
testq %rax, %rax
je 0x2628
movq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x1110
movl $0x8, %esi
movl $0x1, %edx
leaq 0x130(%rsp), %rdi
movq %r14, %rcx
callq 0x10b0
movl $0x4, %esi
movl $0x1, %edx
leaq 0x1d458(%rip), %rdi     # 0x201f0
movq %r14, %rcx
callq 0x10b0
movl 0x1d44a(%rip), %eax     # 0x201f0
xorl %ebp, %ebp
movl %eax, 0x4c(%rsp)
cmpl $0x7e, %eax
setge %bpl
incl %ebp
movq 0x1d4b4(%rip), %rsi     # 0x20270
movq %r14, %rdi
callq 0x9883
movq 0x1d4a5(%rip), %rdi     # 0x20270
testl %eax, %eax
je 0x2ddb
movl $0x7fffffff, 0x24(%rdi) # imm = 0x7FFFFFFF
jmp 0x2e73
movl 0x8(%rdi), %ecx
movq 0x1d493(%rip), %rax     # 0x20278
cmpl 0x1d389(%rip), %ecx     # 0x20174
jle 0x2e3d
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x17214(%rip), %xmm0    # 0x1a010
addsd 0x17214(%rip), %xmm0    # 0x1a018
cvttsd2si %xmm0, %ecx
movl %ecx, 0x1d366(%rip)     # 0x20174
movslq %ecx, %rsi
addq %rsi, %rsi
movq %rax, %rdi
leaq 0x17556(%rip), %rdx     # 0x1a374
callq 0x12509
movq %rax, 0x1d44e(%rip)     # 0x20278
testq %rax, %rax
je 0x2628
movq 0x1d436(%rip), %rcx     # 0x20270
movl 0x8(%rcx), %ecx
movl %ebp, %esi
movslq %ecx, %rdx
movq %rax, %rdi
movq 0x18(%rsp), %rcx
callq 0x10b0
movq 0x1d41a(%rip), %rdi     # 0x20270
cmpl $0x7d, 0x4c(%rsp)
jg 0x2e73
movq 0x1d414(%rip), %rax     # 0x20278
movq %rax, (%rdi)
callq 0x998e
movq 0x1d3fd(%rip), %rdi     # 0x20270
movslq 0x1d356(%rip), %rsi     # 0x201d0
cmpl %esi, 0x24(%rdi)
jl 0x3803
cmpl 0x1d34b(%rip), %esi     # 0x201d4
jge 0x3661
movl %ebp, %eax
movq %rax, 0xd0(%rsp)
xorl %r8d, %r8d
xorl %eax, %eax
leaq 0x98(%rsp), %rbp
movq 0x1d3c3(%rip), %rbx     # 0x20270
cltq
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movupd (%rbx,%rax), %xmm0
movups 0x10(%rbx,%rax), %xmm1
movups 0x20(%rbx,%rax), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movupd %xmm0, (%rbx)
movslq 0x24(%rbx), %r15
cmpq %r15, %rsi
movq %rsi, 0x70(%rsp)
jne 0x2f23
movq 0x1d391(%rip), %rdi     # 0x20278
movslq %r8d, %rax
leaq (%rdi,%rax,2), %rsi
movslq 0x8(%rbx), %rdx
addq %rdx, %rdx
callq 0x1230
movl 0x8(%rbx), %r12d
addq $0x30, %rbx
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x9883
movl $0x1, %r14d
testl %eax, %eax
je 0x2f30
movl $0x1, %eax
jmp 0x307a
movl $0x0, 0xc(%rsp)
jmp 0x30bf
xorl %r13d, %r13d
movq 0x1d336(%rip), %rax     # 0x20270
movl 0x38(%rax,%r13), %ecx
leal (%rcx,%r12), %edx
movq 0x1d32e(%rip), %rax     # 0x20278
cmpl 0x1d224(%rip), %edx     # 0x20174
jle 0x2fa4
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
mulsd 0x170af(%rip), %xmm0    # 0x1a010
addsd 0x170af(%rip), %xmm0    # 0x1a018
cvttsd2si %xmm0, %ecx
movl %ecx, 0x1d201(%rip)     # 0x20174
movslq %ecx, %rsi
addq %rsi, %rsi
movq %rax, %rdi
leaq 0x173f1(%rip), %rdx     # 0x1a374
callq 0x12509
movq %rax, 0x1d2e9(%rip)     # 0x20278
testq %rax, %rax
je 0x2628
movq 0x1d2d1(%rip), %rcx     # 0x20270
movl 0x38(%rcx,%r13), %ecx
movslq %r12d, %rbx
leaq (%rax,%rbx,2), %rdi
movslq %ecx, %rdx
movq 0xd0(%rsp), %rsi
movq 0x18(%rsp), %rcx
callq 0x10b0
cmpl $0x7d, 0x4c(%rsp)
jg 0x2fe8
addq %rbx, %rbx
addq 0x1d2a7(%rip), %rbx     # 0x20278
movq 0x1d298(%rip), %rax     # 0x20270
leaq (%rax,%r13), %rdi
addq $0x30, %rdi
movq %rbx, (%rdi)
callq 0x998e
movq 0x1d281(%rip), %rbx     # 0x20270
cmpl %r15d, 0x54(%rbx,%r13)
jne 0x3657
addl 0x38(%rbx,%r13), %r12d
incq %r14
cmpl %r14d, 0x1d167(%rip)    # 0x20170
jg 0x3059
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
mulsd 0x16ff5(%rip), %xmm0    # 0x1a010
addsd 0x16ffd(%rip), %xmm0    # 0x1a020
cvttsd2si %xmm0, %eax
movl %eax, 0x1d143(%rip)     # 0x20170
cltq
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
movq %rbx, %rdi
leaq 0x1738d(%rip), %rdx     # 0x1a3ce
callq 0x12509
movq %rax, %rbx
movq %rax, 0x1d220(%rip)     # 0x20270
testq %rax, %rax
je 0x2628
leaq (%rbx,%r13), %rsi
addq $0x60, %rsi
movq 0x18(%rsp), %rdi
callq 0x9883
addq $0x30, %r13
testl %eax, %eax
je 0x2f33
movl %r14d, %eax
movl %eax, 0xc(%rsp)
movq 0x1d1eb(%rip), %rbx     # 0x20270
leaq (%r14,%r14,2), %rax
shlq $0x4, %rax
movl $0x7fffffff, 0x24(%rbx,%rax) # imm = 0x7FFFFFFF
movq 0x70(%rsp), %rsi
movq 0x1d1d7(%rip), %rax     # 0x20278
leaq 0x8(%rbx), %rcx
xorl %r8d, %r8d
movslq %r8d, %r8
leaq (%rax,%r8,2), %rdx
movq %rdx, -0x8(%rcx)
addl (%rcx), %r8d
addq $0x30, %rcx
decq %r14
jne 0x30a8
movq %r8, 0xc8(%rsp)
movq 0x1d192(%rip), %rcx     # 0x20260
movslq %esi, %rax
leaq (%rax,%rax,4), %rdx
movl 0x4(%rcx,%rdx,8), %ecx
cmpl 0x1d0e1(%rip), %ecx     # 0x201c0
jl 0x360c
movq 0x1d0c4(%rip), %rcx     # 0x201b0
movq (%rcx,%rax,8), %r13
movq 0x8(%rcx,%rax,8), %rax
leal 0x2(%r13), %ecx
cmpl %eax, %ecx
jge 0x360c
leal 0x3(%r13), %ecx
cmpl %eax, %ecx
jge 0x360c
movq 0x1d0a4(%rip), %rdx     # 0x201b8
movq %r13, %rsi
shlq $0x20, %rsi
movabsq $0x100000000, %rdi      # imm = 0x100000000
addq %rsi, %rdi
sarq $0x1e, %rdi
movl (%rdx,%rdi), %edi
movq %rdi, 0x38(%rsp)
sarq $0x1e, %rsi
movl (%rdx,%rsi), %r12d
movl 0xc(%rsp), %edx
movq %rdx, 0x10(%rsp)
movslq %ecx, %rcx
cltq
movq %rax, 0xd8(%rsp)
xorl %r14d, %r14d
movq %rbx, 0xe0(%rsp)
movq %r13, %rax
movslq %eax, %rdx
movq %rcx, %r13
movq 0x1d04b(%rip), %rcx     # 0x201b8
movl (%rcx,%r13,4), %eax
movq %rax, 0x40(%rsp)
movl 0x8(%rcx,%rdx,4), %eax
movl 0x10(%rcx,%rdx,4), %r15d
testl %eax, %eax
movl %r15d, 0x2c(%rsp)
je 0x3412
cmpl $0x2, %eax
movl 0xc(%rsp), %ecx
je 0x33fb
cmpl $0x1, %eax
jne 0x33eb
movq 0x38(%rsp), %rax
leal -0x190(%rax), %edx
movq 0x40(%rsp), %rax
addl $0x190, %eax            # imm = 0x190
cmpl %r12d, %edx
movl %edx, 0x54(%rsp)
cmovgl %edx, %r12d
cmpl %r15d, %eax
movl %eax, 0x50(%rsp)
cmovll %eax, %r15d
movl $0xffffffff, 0x1d0fd(%rip) # imm = 0xFFFFFFFF
movl 0x1d043(%rip), %eax     # 0x20220
movl %eax, 0x1d105(%rip)     # 0x202e8
movl $0x64, 0x1d0ff(%rip)    # 0x202ec
leaq 0x1d0e0(%rip), %r14     # 0x202d4
testl %ecx, %ecx
jle 0x3579
movq %r13, 0x78(%rsp)
movl 0x1cfed(%rip), %eax     # 0x201f4
movl %eax, 0x84(%rsp)
xorl %ebp, %ebp
movq 0x1d049(%rip), %rax     # 0x20260
movq %rax, 0x68(%rsp)
movq 0x10(%rsp), %r14
movslq %ebp, %rbp
leaq (,%rbp,2), %rax
addq %rbp, %rax
shlq $0x4, %rax
leaq (%rbx,%rax), %rsi
leaq (%rbx,%rax), %rdi
addq $0x28, %rdi
movslq (%rdi), %r8
leaq (%r8,%r8,4), %rax
movl -0x8(%rdi), %r10d
andl $0x1, %r10d
cmovnel %ebp, %r13d
leal 0x1(%rbp), %edx
cmpl %edx, %ecx
cmovgl %ecx, %edx
movl %edx, 0x30(%rsp)
movq 0x68(%rsp), %rcx
movl 0x4(%rcx,%rax,8), %r11d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %r10d, %ebx
cmpl %r8d, (%rdi)
jne 0x32f7
movl -0x8(%rdi), %r10d
andl $0x1, %r10d
cmpl %ebx, %r10d
cmovnel %ebp, %r13d
movl -0x18(%rdi), %r9d
movl -0x10(%rdi), %ebx
cmpl %r12d, %r9d
jg 0x32ad
cmpl %r15d, %ebx
jl 0x32ad
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %ebp, %eax
jmp 0x32e2
cmpl %r15d, %r9d
jg 0x32cb
cmpl %r15d, %ebx
jl 0x32cb
movl %r9d, %r14d
subl -0x14(%rdi), %r14d
cmpl 0x54(%rsp), %r14d
movq 0x10(%rsp), %r14
cmovlel %ebp, %edx
cmpl %r12d, %r9d
jg 0x32e2
cmpl %r12d, %ebx
jl 0x32e2
addl %r11d, %ebx
subl 0x1c(%rsi), %ebx
cmpl 0x50(%rsp), %ebx
cmovgel %ebp, %ecx
incq %rbp
addq $0x30, %rdi
cmpq %r14, %rbp
jl 0x3277
movl %r10d, %ebx
movl 0x30(%rsp), %esi
movl %esi, %ebp
testl %ebx, %ebx
cmovel %ebp, %r13d
movl %eax, %esi
testl %eax, %eax
movq 0xe0(%rsp), %rbx
js 0x3394
movl %eax, %eax
leaq (%rax,%rax,2), %rdx
shlq $0x4, %rdx
addq %rbx, %rdx
movl %esi, %eax
leaq (%rax,%rax,2), %rcx
shlq $0x4, %rcx
addq %rbx, %rcx
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x3829
movq %rax, %r14
movq 0x1cf1e(%rip), %rax     # 0x20260
movq %rax, 0x68(%rsp)
testq %r14, %r14
je 0x33c6
movl (%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0x39f6
testl %eax, %eax
jne 0x33c6
movl 0x84(%rsp), %eax
cmpl %eax, 0x10(%r14)
jg 0x33c6
movl 0x1cf75(%rip), %eax     # 0x202e8
cmpl %eax, 0x14(%r14)
jge 0x33b8
movupd (%r14), %xmm0
movups 0xc(%r14), %xmm1
movups %xmm1, 0x1cf56(%rip)    # 0x202e0
movupd %xmm0, 0x1cf42(%rip)    # 0x202d4
jmp 0x33c6
testl %ecx, %ecx
js 0x33cb
cmpl %edx, %ecx
jge 0x33cb
cmpl %r13d, %edx
jl 0x33af
movl %ecx, %eax
movl %edx, %esi
cmpl %ecx, %r13d
jg 0x33cb
jmp 0x330f
movl %ecx, %eax
movl %edx, %esi
jmp 0x330f
jne 0x33c6
movl 0x18(%r14), %eax
cmpl 0x1cf28(%rip), %eax     # 0x202ec
jl 0x3379
movq 0x10(%rsp), %r14
movl 0xc(%rsp), %ecx
cmpl %ecx, %ebp
jl 0x3221
leaq 0x1cef6(%rip), %r14     # 0x202d4
leaq 0x98(%rsp), %rbp
movq 0x78(%rsp), %r13
movl (%r14), %eax
testl %eax, %eax
jns 0x353c
jmp 0x3579
movl $0x0, 0x98(%rsp)
leaq 0x1ce73(%rip), %r14     # 0x20280
jmp 0x3595
movq 0x38(%rsp), %rax
leal -0x190(%rax), %ecx
movq 0x40(%rsp), %rax
addl $0x190, %eax            # imm = 0x190
cmpl %r12d, %ecx
movl %ecx, 0x54(%rsp)
cmovgl %ecx, %r12d
cmpl %r15d, %eax
movl %eax, 0x50(%rsp)
cmovll %eax, %r15d
movl $0xffffffff, 0x1ce55(%rip) # imm = 0xFFFFFFFF
movl 0x1cda3(%rip), %eax     # 0x201f0
movl %eax, 0x1ce59(%rip)     # 0x202ac
movl $0x64, 0x1ce57(%rip)    # 0x202b4
cmpl $0x0, 0xc(%rsp)
jle 0x3552
movq %r13, 0x78(%rsp)
movl 0x1cd81(%rip), %eax     # 0x201f4
movl %eax, 0x68(%rsp)
movl 0x1cd47(%rip), %eax     # 0x201c4
movl %eax, 0x30(%rsp)
movq %rbx, %rbp
movq 0x10(%rsp), %r13
cmpl %r12d, 0x10(%rbp)
jg 0x3509
cmpl %r15d, 0x18(%rbp)
jl 0x3509
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %rbp, %rdx
movq %rbp, %rcx
callq 0x3829
testq %rax, %rax
je 0x3509
movq %rax, %r14
movl (%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x39f6
testl %eax, %eax
jne 0x3509
movl 0x10(%r14), %eax
cmpl 0x68(%rsp), %eax
jg 0x3509
movl 0x18(%r14), %ecx
cmpl 0x30(%rsp), %ecx
jg 0x3509
cmpl $0x0, 0x14(%r14)
jne 0x3509
addl %eax, %ecx
movl 0x1cdce(%rip), %eax     # 0x202b4
addl 0x1cdc0(%rip), %eax     # 0x202ac
cmpl %eax, %ecx
jge 0x3509
movupd (%r14), %xmm0
movups 0xc(%r14), %xmm1
movups %xmm1, 0x1cda7(%rip)    # 0x202a8
movupd %xmm0, 0x1cd93(%rip)    # 0x2029c
addq $0x30, %rbp
decq %r13
jne 0x3489
movl 0x1cd80(%rip), %eax     # 0x2029c
leaq 0x1cd79(%rip), %r14     # 0x2029c
testl %eax, %eax
leaq 0x98(%rsp), %rbp
movl 0xc(%rsp), %ecx
movq 0x78(%rsp), %r13
js 0x31cd
cmpl $0x0, 0x4(%r14)
je 0x3547
notl %eax
jmp 0x3549
incl %eax
movl %eax, 0x98(%rsp)
jmp 0x358a
movl $0xffffffff, 0x1cd78(%rip) # imm = 0xFFFFFFFF
movl 0x1ccbe(%rip), %eax     # 0x20220
movl %eax, 0x1cd80(%rip)     # 0x202e8
movl $0x64, 0x1cd7a(%rip)    # 0x202ec
leaq 0x1cd5b(%rip), %r14     # 0x202d4
movl $0x0, 0x98(%rsp)
incl 0x1cc72(%rip)           # 0x201fc
movl 0x2c(%rsp), %r15d
incl 0x1cc63(%rip)           # 0x201f8
movq 0x1cc44(%rip), %rcx     # 0x201e0
movl $0x4, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x1290
leaq 0x8(%r14), %rdi
movq 0x1cc27(%rip), %rcx     # 0x201e0
movl $0x4, %esi
movl $0x1, %edx
callq 0x1290
leaq 0xc(%r14), %rdi
movq 0x1cc0d(%rip), %rcx     # 0x201e0
movl $0x4, %esi
movl $0x1, %edx
callq 0x1290
addq $0xc, 0x1cbfe(%rip)     # 0x201e8
leaq 0x3(%r13), %rcx
movl %r15d, %eax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
movl %eax, %r12d
cmpq 0xd8(%rsp), %rcx
jl 0x315d
movq 0x1cbc5(%rip), %rcx     # 0x201d8
movl $0x8, %esi
movl $0x1, %edx
leaq 0x1cbc4(%rip), %rdi     # 0x201e8
callq 0x1290
movq 0x70(%rsp), %rsi
incq %rsi
movslq 0x1cb9c(%rip), %rax     # 0x201d4
cmpq %rax, %rsi
movq 0x90(%rsp), %rbx
movl 0xc(%rsp), %eax
movq 0xc8(%rsp), %r8
jl 0x2ea6
jmp 0x366d
movl %r14d, 0xc(%rsp)
jmp 0x3095
xorl %eax, %eax
leaq 0x98(%rsp), %rbp
jmp 0x3679
movq 0x1cbfc(%rip), %rdi     # 0x20270
cltq
xorl %r13d, %r13d
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
cmpl $0x7fffffff, 0x24(%rdi,%rax) # imm = 0x7FFFFFFF
jne 0x3803
cmpl $0x0, 0x1cb02(%rip)     # 0x20198
je 0x36c8
movl 0x1cb5e(%rip), %esi     # 0x201fc
movl 0x1cb54(%rip), %edx     # 0x201f8
testl %esi, %esi
je 0x36b8
leaq 0x16c4a(%rip), %rdi     # 0x1a2f9
xorl %eax, %eax
callq 0x1100
jmp 0x36c8
leaq 0x16c18(%rip), %rdi     # 0x1a2d7
movl %edx, %esi
xorl %eax, %eax
callq 0x1100
movq 0x1cb09(%rip), %rdi     # 0x201d8
callq 0x10c0
movq 0x1cb05(%rip), %rdi     # 0x201e0
callq 0x10c0
movq 0x18(%rsp), %rdi
callq 0x10c0
movq %rbx, %rdi
callq 0x17168
movq %rax, 0x18(%rsp)
testq %rax, %rax
jne 0x2929
movq %rbx, %rdi
callq 0x17247
movq 0xc0(%rsp), %rcx
incq %rcx
cmpq 0xb8(%rsp), %rcx
jne 0x28f2
movq 0x60(%rsp), %rdi
callq 0x1030
movq 0x58(%rsp), %rdi
callq 0x1030
leaq 0x1cac4(%rip), %rdi     # 0x20200
callq 0x1451e
leaq 0x1cba8(%rip), %rax     # 0x202f0
movq (%rax), %rdi
callq 0x1030
xorl %edi, %edi
callq 0x1280
movq 0x1c89a(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cb88(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x169bb(%rip), %rsi     # 0x1a12d
jmp 0x26e7
movq 0x1c87a(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cb68(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x169cf(%rip), %rsi     # 0x1a161
jmp 0x26e7
movq 0x1c85a(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cb48(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x169e6(%rip), %rsi     # 0x1a198
jmp 0x26e7
movq 0x1c83a(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cb28(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x169fd(%rip), %rsi     # 0x1a1cf
jmp 0x26e7
movq 0x1c81a(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cb08(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x16a51(%rip), %rsi     # 0x1a243
xorl %eax, %eax
callq 0x11a0
movl $0x2, %edi
callq 0x1280
movq 0x1c7ee(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cadc(%rip), %rax     # 0x202f0
movq (%rax), %rdx
movl 0x1c9af(%rip), %ecx     # 0x201cc
leaq 0x16b66(%rip), %rsi     # 0x1a38a
jmp 0x2621