// File: /workspace/github_c_makefile_star2_O1/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 $0x4fa8, %rsp           # imm = 0x4FA8
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x17b0f(%rip), %rdi     # 0x1a028
leaq 0x1896f(%rip), %rsi     # 0x1ae8f
callq 0x1255a
leaq 0x1ddc4(%rip), %rcx     # 0x202f0
movq %rax, (%rcx)
leaq 0x120(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x1130
movq %rbx, %rcx
movl $0x1, %r12d
cmpl $0x2, %ebp
movq %rbx, 0x18(%rsp)
jl 0x25c4
movl %ebp, %ebx
movl $0x1, %r15d
leaq 0x17acc(%rip), %r14     # 0x1a031
movq (%rcx,%r15,8), %r13
cmpb $0x2d, (%r13)
jne 0x25b2
movb 0x1(%r13), %al
testb %al, %al
je 0x25bc
addq $0x2, %r13
movsbl %al, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x1140
testq %rax, %rax
je 0x262b
movslq %ebp, %rax
movl $0x1, 0x120(%rsp,%rax,4)
movb (%r13), %al
incq %r13
testb %al, %al
jne 0x257c
movq 0x18(%rsp), %rcx
jmp 0x25bc
movslq %r12d, %rax
incl %r12d
movq %r13, (%rcx,%rax,8)
incq %r15
cmpq %rbx, %r15
jne 0x2565
movl 0x2f8(%rsp), %eax
movl %eax, 0x1dbc7(%rip)     # 0x20198
cmpl $0x2, %r12d
jg 0x2654
movq 0x1da1a(%rip), %rbx     # 0x1fff8
movq (%rbx), %rdi
leaq 0x1dd08(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x17a5f(%rip), %rsi     # 0x1a051
leaq 0x17d25(%rip), %rcx     # 0x1a31e
xorl %eax, %eax
callq 0x11a0
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x1170
movq (%rbx), %rcx
leaq 0x17a48(%rip), %rdi     # 0x1a05f
movl $0x36, %esi
movl $0x1, %edx
callq 0x1290
jmp 0x276b
movq 0x1d9c6(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1dcb4(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x179ed(%rip), %rsi     # 0x1a033
movl %ebp, %ecx
xorl %eax, %eax
callq 0x11a0
jmp 0x276b
movq 0x8(%rcx), %rdi
leaq 0x1dba1(%rip), %rsi     # 0x20200
callq 0x13458
testl %eax, %eax
js 0x276b
cmpl $0x1, %eax
jne 0x2697
movq 0x1d980(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1dc6e(%rip), %rax     # 0x202f0
movq (%rax), %rdx
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
leaq 0x17a01(%rip), %rsi     # 0x1a096
jmp 0x2707
cmpl $0x0, 0x1db9a(%rip)     # 0x20238
jne 0x26e3
leaq 0x1db59(%rip), %r14     # 0x20200
movq %r14, %rdi
callq 0x13c1d
leaq 0x17a2f(%rip), %rsi     # 0x1a0e5
movq %r14, %rdi
callq 0x152c3
testq %rax, %rax
jne 0x2710
movq 0x1d92e(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1dc1c(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x17a0c(%rip), %rsi     # 0x1a0ea
jmp 0x2764
movq 0x1d90e(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1dbfc(%rip), %rax     # 0x202f0
movq (%rax), %rdx
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
leaq 0x179b9(%rip), %rsi     # 0x1a0c0
xorl %eax, %eax
callq 0x11a0
jmp 0x276b
movq %rax, %r14
movq %rax, %rdi
callq 0x15bcd
movq 0x18(%r14), %rax
movq %rax, 0x1da7a(%rip)     # 0x201a0
movq 0x28(%r14), %rax
movq %rax, 0x1da77(%rip)     # 0x201a8
leaq 0x1dac8(%rip), %rdi     # 0x20200
leaq 0x179d4(%rip), %rsi     # 0x1a113
callq 0x152c3
testq %rax, %rax
jne 0x2775
movq 0x1d8a8(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1db96(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x17aa1(%rip), %rsi     # 0x1a205
xorl %eax, %eax
callq 0x11a0
movl $0x1, %edi
callq 0x1280
movq %rax, %r14
movq %rax, %rdi
callq 0x15bcd
movq 0x18(%r14), %rax
movq %rax, 0x1da25(%rip)     # 0x201b0
movq 0x28(%r14), %rcx
movq %rcx, 0x1da22(%rip)     # 0x201b8
movl 0x1da94(%rip), %ecx     # 0x20230
testl %ecx, %ecx
js 0x27b2
incq %rcx
xorl %edx, %edx
shrq $0x2, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x27a5
movq 0x1da8f(%rip), %rdi     # 0x20248
leaq 0x17b81(%rip), %rsi     # 0x1a341
leaq 0x1794c(%rip), %rdx     # 0x1a113
leaq 0x17adc(%rip), %rcx     # 0x1a2aa
callq 0x12735
leaq 0x1793e(%rip), %rsi     # 0x1a118
movq %rax, %rdi
callq 0x1255a
testq %rax, %rax
je 0x276b
movq %rax, %r14
leaq 0x18a95(%rip), %rsi     # 0x1b286
movq %rax, %rdi
callq 0x1250
movq %rax, %r15
leaq 0x14(%rsp), %rbp
movl $0x4, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %rax, %rcx
callq 0x10b0
leaq 0x84(%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 0x120(%rsp), %rdx
movl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x15d99
testl %eax, %eax
jne 0x3760
leaq 0x100(%rsp), %rdx
movl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x15d99
testl %eax, %eax
jne 0x3780
leaq 0x98(%rsp), %rdx
movl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x15d99
testl %eax, %eax
jne 0x37a0
leaq 0xe0(%rsp), %rdx
movl $0x0, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x15d99
testl %eax, %eax
jne 0x37c0
movq %r15, %rdi
callq 0x10c0
leaq 0x120(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, 0x1d8b3(%rip)     # 0x201c0
leaq 0x98(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, 0x1d8a3(%rip)     # 0x201c4
leaq 0xe0(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, 0x1d893(%rip)     # 0x201c8
movq 0x18(%rsp), %rbx
movq 0x8(%rbx), %rdi
callq 0x12616
movq %rax, 0x40(%rsp)
movq 0x8(%rbx), %rdi
leaq 0x178dd(%rip), %rsi     # 0x1a230
callq 0x12670
movq %rax, 0x38(%rsp)
cmpl $0x4, %r12d
movl $0x3, %eax
cmovgel %r12d, %eax
movq %rax, 0xb8(%rsp)
movl $0x2, %ecx
movq 0x18(%rsp), %rax
movq %rcx, 0xc0(%rsp)
movq (%rax,%rcx,8), %rdi
callq 0x16e9f
movq %rax, %rbx
movq %rax, %rdi
callq 0x16cd2
testq %rax, %rax
je 0x3709
movq %rbx, 0x48(%rsp)
movq %rax, 0x90(%rsp)
xorl %eax, %eax
movl %eax, 0x1d816(%rip)     # 0x201cc
movl %eax, 0x1d814(%rip)     # 0x201d0
movl 0x1d86e(%rip), %eax     # 0x20230
movl %eax, 0x1d80c(%rip)     # 0x201d4
movq %rbx, %rdi
callq 0x16d86
movq %rax, %rdi
movl $0x2e, %esi
callq 0x1260
testq %rax, %rax
je 0x2b65
movq %rax, %r15
incq %r15
movq %r15, %rdi
leaq 0x98(%rsp), %rsi
movl $0xa, %edx
callq 0x11d0
movq %rax, %r12
movq 0x98(%rsp), %rax
cmpq %r15, %rax
je 0x2b65
cmpb $0x0, (%rax)
jne 0x2b65
movq 0x40(%rsp), %rdi
leaq 0x1780a(%rip), %rsi     # 0x1a234
movq 0x38(%rsp), %rdx
leaq 0x177fa(%rip), %rcx     # 0x1a230
callq 0x12735
movq %rax, %rdi
leaq 0x18841(%rip), %rsi     # 0x1b286
callq 0x125b9
testq %rax, %rax
je 0x276b
movq %rax, %r13
movq %rax, %rdi
leaq 0x177d6(%rip), %rsi     # 0x1a236
leaq 0x14(%rsp), %rdx
xorl %eax, %eax
callq 0x1090
cmpl $0x1, %eax
jne 0x37e0
cmpl $0x0, 0x14(%rsp)
jle 0x2aa4
xorl %ebx, %ebx
leaq 0x120(%rsp), %rdi
movl $0x4e84, %esi           # imm = 0x4E84
movq %r13, %rdx
callq 0x1180
testq %rax, %rax
je 0x37e0
incl %ebx
cmpl 0x14(%rsp), %ebx
jl 0x2a7e
movq %r13, %rdi
leaq 0x177b5(%rip), %rsi     # 0x1a263
leaq 0x84(%rsp), %rdx
xorl %eax, %eax
callq 0x1090
cmpl $0x1, %eax
jne 0x37e0
movq %r13, %rdi
leaq 0x177a1(%rip), %rsi     # 0x1a271
leaq 0xe0(%rsp), %rdx
leaq 0xdc(%rsp), %rcx
leaq 0xd8(%rsp), %r8
xorl %eax, %eax
callq 0x1090
cmpl $0x3, %eax
jne 0x37e0
movl %r12d, %ebx
testl %r12d, %r12d
jle 0x2b2d
movq %r13, %rdi
leaq 0x1778d(%rip), %rsi     # 0x1a297
leaq 0x80(%rsp), %rdx
leaq 0x1d6b7(%rip), %rcx     # 0x201d0
xorl %eax, %eax
callq 0x1090
cmpl $0x2, %eax
jne 0x37e0
decl %ebx
jne 0x2b00
movq %r13, %rdi
leaq 0x17760(%rip), %rsi     # 0x1a297
leaq 0x80(%rsp), %rdx
leaq 0x1d68e(%rip), %rcx     # 0x201d4
xorl %eax, %eax
callq 0x1090
cmpl $0x2, %eax
jne 0x37e0
movq %r13, %rdi
callq 0x10c0
movl %r12d, 0x1d667(%rip)    # 0x201cc
movl 0x1d661(%rip), %esi     # 0x201cc
testl %esi, %esi
jle 0x2be3
leaq 0x177cb(%rip), %r15     # 0x1a341
movq %r15, %rdi
leaq 0x17724(%rip), %rdx     # 0x1a2a4
callq 0x12825
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
leaq 0x1770d(%rip), %r12     # 0x1a2a1
movq %r12, %rsi
movq 0x38(%rsp), %r14
movq %r14, %rdx
movq %rax, %rcx
callq 0x12735
movq %rax, %rdi
leaq 0x180fb(%rip), %r13     # 0x1acac
movq %r13, %rsi
callq 0x125b9
movq %rax, 0x1d618(%rip)     # 0x201d8
movl 0x1d606(%rip), %esi     # 0x201cc
movq %r15, %rdi
leaq 0x176e0(%rip), %rdx     # 0x1a2b0
callq 0x12825
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rax, %rcx
jmp 0x2c32
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
leaq 0x176af(%rip), %r15     # 0x1a2a1
movq %r15, %rsi
movq 0x38(%rsp), %r14
movq %r14, %rdx
leaq 0x176a0(%rip), %rcx     # 0x1a2a4
callq 0x12735
movq %rax, %rdi
leaq 0x18099(%rip), %r13     # 0x1acac
movq %r13, %rsi
callq 0x125b9
movq %rax, 0x1d5b6(%rip)     # 0x201d8
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
leaq 0x1767e(%rip), %rcx     # 0x1a2b0
callq 0x12735
movq %rax, %rdi
movq %r13, %rsi
callq 0x125b9
movq %rax, 0x1d597(%rip)     # 0x201e0
movq 0x1d588(%rip), %rcx     # 0x201d8
testq %rcx, %rcx
movq 0x48(%rsp), %rbx
je 0x276b
testq %rax, %rax
je 0x276b
movl 0x1d567(%rip), %eax     # 0x201d4
subl 0x1d55d(%rip), %eax     # 0x201d0
movl %eax, 0x120(%rsp)
movl $0x8, 0x98(%rsp)
movl $0x4, %esi
movl $0x1, %edx
leaq 0x120(%rsp), %rdi
callq 0x1290
movq 0x1d535(%rip), %rcx     # 0x201d8
movl $0x4, %esi
movl $0x1, %edx
leaq 0x98(%rsp), %rdi
callq 0x1290
movq $0x0, 0x1d523(%rip) # 0x201e8
movq 0x1d50c(%rip), %rcx     # 0x201d8
movl $0x8, %esi
movl $0x1, %edx
leaq 0x1d50b(%rip), %rdi     # 0x201e8
callq 0x1290
movl $0x8, %esi
movl $0x1, %edx
leaq 0x100(%rsp), %rdi
movq 0x90(%rsp), %r13
movq %r13, %rcx
callq 0x10b0
movl $0x4, %esi
movl $0x1, %edx
leaq 0x1d4db(%rip), %rdi     # 0x201f0
movq %r13, %rcx
callq 0x10b0
cvtsi2sdl 0x1d4cb(%rip), %xmm0 # 0x201f0
mulsd 0x172db(%rip), %xmm0    # 0x1a008
cvttsd2si %xmm0, %eax
movl %eax, 0x1d4bd(%rip)     # 0x201f4
cmpl $0x0, 0x1d45a(%rip)     # 0x20198
je 0x2d85
xorl %eax, %eax
movl %eax, 0x1d4b0(%rip)     # 0x201f8
movl %eax, 0x1d4ae(%rip)     # 0x201fc
movl 0x1d470(%rip), %ebp     # 0x201c4
movl 0x1d46d(%rip), %r15d    # 0x201c8
movq 0x18(%rsp), %rax
movq 0x8(%rax), %r12
movq %rbx, %rdi
callq 0x16d86
leaq 0x17549(%rip), %rdi     # 0x1a2bc
movl %ebp, %esi
movl %r15d, %edx
movq %r12, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x1100
cmpq $0x0, 0x1d4e3(%rip)     # 0x20270
jne 0x2dba
movslq 0x1d3da(%rip), %rax     # 0x20170
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdi
leaq 0x1759e(%rip), %rsi     # 0x1a343
callq 0x1249d
movq %rax, 0x1d4bf(%rip)     # 0x20270
testq %rax, %rax
je 0x276b
cmpq $0x0, 0x1d4b6(%rip)     # 0x20278
jne 0x2dea
movslq 0x1d3a9(%rip), %rdi     # 0x20174
addq %rdi, %rdi
leaq 0x17588(%rip), %rsi     # 0x1a35d
callq 0x1249d
movq %rax, 0x1d497(%rip)     # 0x20278
testq %rax, %rax
je 0x276b
movq %r13, %rdi
callq 0x1110
movl $0x8, %esi
movl $0x1, %edx
leaq 0x120(%rsp), %rdi
movq %r13, %rcx
callq 0x10b0
movl $0x4, %esi
movl $0x1, %edx
leaq 0x1d3d3(%rip), %rdi     # 0x201f0
movq %r13, %rcx
callq 0x10b0
movl 0x1d3c5(%rip), %eax     # 0x201f0
xorl %ebx, %ebx
movl %eax, 0x30(%rsp)
cmpl $0x7e, %eax
setge %bl
incl %ebx
movq 0x1d430(%rip), %rsi     # 0x20270
movq %r13, %rdi
callq 0x9900
movq 0x1d421(%rip), %rcx     # 0x20270
testl %eax, %eax
je 0x2e5f
movl $0x7fffffff, 0x24(%rcx) # imm = 0x7FFFFFFF
jmp 0x2eed
movl 0x8(%rcx), %eax
cmpl 0x1d30c(%rip), %eax     # 0x20174
jle 0x2eb4
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x17197(%rip), %xmm0    # 0x1a010
addsd 0x17197(%rip), %xmm0    # 0x1a018
cvttsd2si %xmm0, %eax
movl %eax, 0x1d2e9(%rip)     # 0x20174
movq 0x1d3e6(%rip), %rdi     # 0x20278
movslq %eax, %rsi
addq %rsi, %rsi
leaq 0x174d5(%rip), %rdx     # 0x1a374
callq 0x124f5
movq %rax, 0x1d3cd(%rip)     # 0x20278
testq %rax, %rax
je 0x276b
movq 0x1d3bd(%rip), %rdi     # 0x20278
movl %ebx, %esi
movq 0x1d3ac(%rip), %rax     # 0x20270
movslq 0x8(%rax), %rdx
movq %r13, %rcx
callq 0x10b0
cmpl $0x7d, 0x30(%rsp)
jg 0x2eed
movq 0x1d39a(%rip), %rax     # 0x20278
movq 0x1d38b(%rip), %rdi     # 0x20270
movq %rax, (%rdi)
callq 0x9a0b
movq 0x1d37c(%rip), %rax     # 0x20270
movslq 0x1d2d5(%rip), %rsi     # 0x201d0
cmpl %esi, 0x24(%rax)
jl 0x380c
cmpl 0x1d2ca(%rip), %esi     # 0x201d4
jge 0x3676
movl %ebx, %eax
movq %rax, 0xc8(%rsp)
movq $0x0, 0x88(%rsp)
xorl %r14d, %r14d
movq 0x1d340(%rip), %r15     # 0x20270
movslq %r14d, %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movupd (%r15,%rax), %xmm0
movups 0x10(%r15,%rax), %xmm1
movups 0x20(%r15,%rax), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movupd %xmm0, (%r15)
movslq 0x24(%r15), %r14
cmpq %r14, %rsi
movq %rsi, 0x50(%rsp)
jne 0x2fb0
movq 0x1d307(%rip), %rdi     # 0x20278
movslq 0x88(%rsp), %rax
leaq (%rdi,%rax,2), %rsi
movslq 0x8(%r15), %rdx
addq %rdx, %rdx
callq 0x1230
movl 0x8(%r15), %ebp
addq $0x30, %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x9900
movl $0x1, %ebx
testl %eax, %eax
je 0x2fb8
movl $0x1, %r14d
jmp 0x30f5
xorl %r14d, %r14d
jmp 0x3143
movl $0x30, %r15d
movq 0x1d2ab(%rip), %rax     # 0x20270
movl 0x8(%rax,%r15), %eax
addl %ebp, %eax
cmpl 0x1d1a2(%rip), %eax     # 0x20174
jle 0x301e
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x1702d(%rip), %xmm0    # 0x1a010
addsd 0x1702d(%rip), %xmm0    # 0x1a018
cvttsd2si %xmm0, %eax
movl %eax, 0x1d17f(%rip)     # 0x20174
movq 0x1d27c(%rip), %rdi     # 0x20278
movslq %eax, %rsi
addq %rsi, %rsi
leaq 0x1736b(%rip), %rdx     # 0x1a374
callq 0x124f5
movq %rax, 0x1d263(%rip)     # 0x20278
testq %rax, %rax
je 0x276b
movslq %ebp, %r12
addq %r12, %r12
movq 0x1d24d(%rip), %rdi     # 0x20278
addq %r12, %rdi
movq 0x1d23b(%rip), %rax     # 0x20270
movslq 0x8(%rax,%r15), %rdx
movq 0xc8(%rsp), %rsi
movq %r13, %rcx
callq 0x10b0
cmpl $0x7d, 0x30(%rsp)
jg 0x306b
addq 0x1d220(%rip), %r12     # 0x20278
movq 0x1d211(%rip), %rdi     # 0x20270
movq %r12, (%rdi,%r15)
addq %r15, %rdi
callq 0x9a0b
movq 0x1d1fe(%rip), %rdi     # 0x20270
cmpl %r14d, 0x24(%rdi,%r15)
jne 0x366e
addl 0x8(%rdi,%r15), %ebp
incq %rbx
cmpl %ebx, 0x1d0e5(%rip)     # 0x20170
jg 0x30d4
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd 0x16f74(%rip), %xmm0    # 0x1a010
addsd 0x16f7c(%rip), %xmm0    # 0x1a020
cvttsd2si %xmm0, %eax
movl %eax, 0x1d0c2(%rip)     # 0x20170
cltq
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
leaq 0x1730f(%rip), %rdx     # 0x1a3ce
callq 0x124f5
movq %rax, 0x1d1a5(%rip)     # 0x20270
testq %rax, %rax
je 0x276b
addq $0x30, %r15
movq 0x1d191(%rip), %rsi     # 0x20270
addq %r15, %rsi
movq %r13, %rdi
callq 0x9900
testl %eax, %eax
je 0x2fbe
movl %ebx, %r14d
movq 0x1d174(%rip), %rax     # 0x20270
leaq (%rbx,%rbx,2), %rcx
shlq $0x4, %rcx
movl $0x7fffffff, 0x24(%rax,%rcx) # imm = 0x7FFFFFFF
movq 0x50(%rsp), %rsi
movq 0x1d160(%rip), %rax     # 0x20278
movq 0x1d151(%rip), %rcx     # 0x20270
addq $0x8, %rcx
xorl %edi, %edi
movslq %edi, %rdi
leaq (%rax,%rdi,2), %rdx
movq %rdx, -0x8(%rcx)
addl (%rcx), %edi
addq $0x30, %rcx
decq %rbx
jne 0x3125
movq %rdi, 0x88(%rsp)
movq 0x1d116(%rip), %rcx     # 0x20260
movslq %esi, %rax
leaq (%rax,%rax,4), %rdx
movl 0x4(%rcx,%rdx,8), %ecx
cmpl 0x1d065(%rip), %ecx     # 0x201c0
jl 0x362f
movq 0x1d048(%rip), %rcx     # 0x201b0
movq (%rcx,%rax,8), %r15
movq 0x8(%rcx,%rax,8), %rax
leal 0x2(%r15), %ecx
cmpl %eax, %ecx
jge 0x362f
leal 0x3(%r15), %ecx
cmpl %eax, %ecx
jge 0x362f
movq 0x1d0e0(%rip), %rdx     # 0x20270
movq %rdx, 0x60(%rsp)
movq 0x1d01c(%rip), %rdx     # 0x201b8
movq %r15, %rsi
shlq $0x20, %rsi
movabsq $0x100000000, %rdi      # imm = 0x100000000
addq %rsi, %rdi
sarq $0x1e, %rdi
movl (%rdx,%rdi), %edi
movq %rdi, 0x20(%rsp)
sarq $0x1e, %rsi
movl (%rdx,%rsi), %r13d
movl %r14d, %edx
movq %rdx, 0x68(%rsp)
movslq %ecx, %rcx
cltq
movq %rax, 0xd0(%rsp)
xorl %ebx, %ebx
movl %r14d, 0x34(%rsp)
movq %r15, %rax
cltq
movq %rcx, %r15
movq 0x1cfc9(%rip), %rcx     # 0x201b8
movl 0x8(%rcx,%rax,4), %edx
movl 0x10(%rcx,%rax,4), %ebp
movl (%rcx,%r15,4), %eax
movq %rax, 0x28(%rsp)
testl %edx, %edx
jne 0x332c
movq %r15, 0x58(%rsp)
movq 0x20(%rsp), %rax
leal -0x190(%rax), %ebx
movl %ebp, %eax
movq 0x28(%rsp), %rcx
leal 0x190(%rcx), %ebp
cmpl %r13d, %ebx
cmovlel %r13d, %ebx
cmpl %eax, %ebp
movl %eax, 0x8(%rsp)
cmovgel %eax, %ebp
movl $0xffffffff, 0x1d05d(%rip) # imm = 0xFFFFFFFF
movl 0x1cfab(%rip), %eax     # 0x201f0
movl %eax, 0x1d061(%rip)     # 0x202ac
movl $0x64, 0x1d05f(%rip)    # 0x202b4
testl %r14d, %r14d
jle 0x330e
movl 0x1cf90(%rip), %eax     # 0x201f4
movl %eax, 0x10(%rsp)
movl 0x1cf56(%rip), %eax     # 0x201c4
movl %eax, 0xc(%rsp)
movq 0x60(%rsp), %r15
movq 0x68(%rsp), %r14
cmpl %ebx, 0x10(%r15)
jg 0x3301
cmpl %ebp, 0x18(%r15)
jl 0x3301
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r15, %rdx
movq %r15, %rcx
callq 0x3832
testq %rax, %rax
je 0x3301
movq %rax, %r12
movl (%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x3a02
testl %eax, %eax
jne 0x3301
movl 0x10(%r12), %eax
cmpl 0x10(%rsp), %eax
jg 0x3301
movl 0x18(%r12), %ecx
cmpl 0xc(%rsp), %ecx
jg 0x3301
cmpl $0x0, 0x14(%r12)
jne 0x3301
addl %eax, %ecx
movl 0x1cfd8(%rip), %eax     # 0x202b4
addl 0x1cfca(%rip), %eax     # 0x202ac
cmpl %eax, %ecx
jge 0x3301
movupd (%r12), %xmm0
movups 0xc(%r12), %xmm1
movups %xmm1, 0x1cfaf(%rip)    # 0x202a8
movupd %xmm0, 0x1cf9b(%rip)    # 0x2029c
addq $0x30, %r15
decq %r14
jne 0x327c
movl 0x1cf88(%rip), %edx     # 0x2029c
shrl $0x1f, %edx
leaq 0x1cf7e(%rip), %rbx     # 0x2029c
movl 0x34(%rsp), %r14d
movq 0x58(%rsp), %r15
movl 0x8(%rsp), %ebp
cmpl $0x1, %edx
jne 0x3569
movq 0x20(%rsp), %rax
leal -0x190(%rax), %ecx
movq 0x28(%rsp), %rax
addl $0x190, %eax            # imm = 0x190
cmpl %r13d, %ecx
movl %ecx, 0x10(%rsp)
cmovgl %ecx, %r13d
cmpl %ebp, %eax
movl %ebp, %r12d
movl %eax, 0xc(%rsp)
cmovll %eax, %r12d
movl $0xffffffff, 0x1cf68(%rip) # imm = 0xFFFFFFFF
movl 0x1ceae(%rip), %eax     # 0x20220
movl %eax, 0x1cf70(%rip)     # 0x202e8
movl $0x64, 0x1cf6a(%rip)    # 0x202ec
leaq 0x1cf4b(%rip), %rbx     # 0x202d4
testl %r14d, %r14d
jle 0x3569
movl %edx, 0x74(%rsp)
movl %ebp, 0x8(%rsp)
movq %r15, 0x58(%rsp)
xorl %ebp, %ebp
movl 0x1ce4d(%rip), %eax     # 0x201f4
movl %eax, 0x78(%rsp)
movslq %ebp, %rbp
leaq (,%rbp,2), %rax
addq %rbp, %rax
shlq $0x4, %rax
movq 0x60(%rsp), %rcx
leaq (%rcx,%rax), %rsi
leaq (%rcx,%rax), %rdi
addq $0x28, %rdi
movslq (%rdi), %r8
movq 0x1ce88(%rip), %rax     # 0x20260
leaq (%r8,%r8,4), %rcx
movl -0x8(%rdi), %r10d
andl $0x1, %r10d
cmovnel %ebp, %ebx
leal 0x1(%rbp), %edx
cmpl %edx, %r14d
cmovgl %r14d, %edx
movl %edx, 0x7c(%rsp)
movl 0x4(%rax,%rcx,8), %r11d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq 0x68(%rsp), %r15
movl %r10d, %r14d
cmpl %r8d, (%rdi)
jne 0x3490
movl -0x8(%rdi), %r10d
andl $0x1, %r10d
cmpl %r14d, %r10d
cmovnel %ebp, %ebx
movl -0x18(%rdi), %r9d
movl -0x10(%rdi), %r14d
cmpl %r13d, %r9d
jg 0x3444
cmpl %r12d, %r14d
jl 0x3444
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ebp, %edx
jmp 0x347b
cmpl %r12d, %r9d
jg 0x3462
cmpl %r12d, %r14d
jl 0x3462
movl %r9d, %r15d
subl -0x14(%rdi), %r15d
cmpl 0x10(%rsp), %r15d
movq 0x68(%rsp), %r15
cmovlel %ebp, %ecx
cmpl %r13d, %r9d
jg 0x347b
cmpl %r13d, %r14d
jl 0x347b
addl %r11d, %r14d
subl 0x1c(%rsi), %r14d
cmpl 0xc(%rsp), %r14d
cmovgel %ebp, %eax
incq %rbp
addq $0x30, %rdi
cmpq %r15, %rbp
jl 0x340e
movl %r10d, %r14d
movl 0x7c(%rsp), %esi
movl %esi, %ebp
testl %r14d, %r14d
cmovel %ebp, %ebx
movl %edx, %esi
testl %edx, %edx
movl 0x34(%rsp), %r14d
js 0x3519
movl %edx, %eax
leaq (%rax,%rax,2), %rdx
shlq $0x4, %rdx
movq 0x60(%rsp), %rdi
addq %rdi, %rdx
movl %esi, %eax
leaq (%rax,%rax,2), %rcx
shlq $0x4, %rcx
addq %rdi, %rcx
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x3832
testq %rax, %rax
je 0x3531
movq %rax, %r15
movl (%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x3a02
testl %eax, %eax
jne 0x3531
movl 0x78(%rsp), %eax
cmpl %eax, 0x10(%r15)
jg 0x3531
movl 0x1cdf0(%rip), %eax     # 0x202e8
cmpl %eax, 0x14(%r15)
jge 0x3545
movupd (%r15), %xmm0
movups 0xc(%r15), %xmm1
movups %xmm1, 0x1cdd1(%rip)    # 0x202e0
movupd %xmm0, 0x1cdbd(%rip)    # 0x202d4
jmp 0x3531
testl %eax, %eax
js 0x3531
cmpl %ecx, %eax
jge 0x3531
cmpl %ebx, %ecx
jl 0x353c
movl %eax, %edx
movl %ecx, %esi
cmpl %eax, %ebx
jle 0x34a1
cmpl %r14d, %ebp
jl 0x33ab
jmp 0x3555
movl %eax, %edx
movl %ecx, %esi
jmp 0x34a1
jne 0x3531
movl 0x18(%r15), %eax
cmpl 0x1cd9b(%rip), %eax     # 0x202ec
jl 0x34fe
jmp 0x3531
leaq 0x1cd78(%rip), %rbx     # 0x202d4
movq 0x58(%rsp), %r15
movl 0x8(%rsp), %ebp
movl 0x74(%rsp), %edx
cmpl $0x2, %edx
jne 0x3582
movl $0x0, 0x98(%rsp)
leaq 0x1cd00(%rip), %rbx     # 0x20280
jmp 0x35b4
movl (%rbx), %eax
testl %eax, %eax
js 0x3592
cmpl $0x0, 0x4(%rbx)
je 0x35a5
notl %eax
jmp 0x35a7
movl $0x0, 0x98(%rsp)
incl 0x1cc59(%rip)           # 0x201fc
jmp 0x35ae
incl %eax
movl %eax, 0x98(%rsp)
incl 0x1cc44(%rip)           # 0x201f8
movq 0x1cc25(%rip), %rcx     # 0x201e0
movl $0x4, %esi
movl $0x1, %edx
leaq 0x98(%rsp), %rdi
callq 0x1290
leaq 0x8(%rbx), %rdi
movq 0x1cc03(%rip), %rcx     # 0x201e0
movl $0x4, %esi
movl $0x1, %edx
callq 0x1290
leaq 0xc(%rbx), %rdi
movq 0x1cbe9(%rip), %rcx     # 0x201e0
movl $0x4, %esi
movl $0x1, %edx
callq 0x1290
addq $0xc, 0x1cbda(%rip)     # 0x201e8
leaq 0x3(%r15), %rcx
movl %ebp, %eax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
movl %eax, %r13d
cmpq 0xd0(%rsp), %rcx
jl 0x31e0
movq 0x1cba2(%rip), %rcx     # 0x201d8
movl $0x8, %esi
movl $0x1, %edx
leaq 0x1cba1(%rip), %rdi     # 0x201e8
callq 0x1290
movq 0x50(%rsp), %rsi
incq %rsi
movslq 0x1cb79(%rip), %rax     # 0x201d4
cmpq %rax, %rsi
movq 0x90(%rsp), %r13
jl 0x2f29
jmp 0x367a
movl %ebx, %r14d
jmp 0x310c
xorl %eax, %eax
jmp 0x367d
movslq %r14d, %rax
movq 0x48(%rsp), %rbx
movq 0x1cbe7(%rip), %rcx     # 0x20270
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
cmpl $0x7fffffff, 0x24(%rcx,%rax) # imm = 0x7FFFFFFF
jne 0x380c
cmpl $0x0, 0x1caf2(%rip)     # 0x20198
je 0x36d8
movl 0x1cb4e(%rip), %esi     # 0x201fc
movl 0x1cb44(%rip), %edx     # 0x201f8
testl %esi, %esi
je 0x36c8
leaq 0x16c3a(%rip), %rdi     # 0x1a2f9
xorl %eax, %eax
callq 0x1100
jmp 0x36d8
leaq 0x16c08(%rip), %rdi     # 0x1a2d7
movl %edx, %esi
xorl %eax, %eax
callq 0x1100
movq 0x1caf9(%rip), %rdi     # 0x201d8
callq 0x10c0
movq 0x1caf5(%rip), %rdi     # 0x201e0
callq 0x10c0
movq %r13, %rdi
callq 0x10c0
movq %rbx, %rdi
callq 0x16cd2
testq %rax, %rax
jne 0x29a6
movq %rbx, %rdi
callq 0x16db1
movq 0xc0(%rsp), %rcx
incq %rcx
cmpq 0xb8(%rsp), %rcx
jne 0x2977
movq 0x40(%rsp), %rdi
callq 0x1030
movq 0x38(%rsp), %rdi
callq 0x1030
leaq 0x1cabb(%rip), %rdi     # 0x20200
callq 0x14430
leaq 0x1cb9f(%rip), %rax     # 0x202f0
movq (%rax), %rdi
callq 0x1030
xorl %edi, %edi
callq 0x1280
movq 0x1c891(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cb7f(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x169b2(%rip), %rsi     # 0x1a12d
jmp 0x2764
movq 0x1c871(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cb5f(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x169c6(%rip), %rsi     # 0x1a161
jmp 0x2764
movq 0x1c851(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cb3f(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x169dd(%rip), %rsi     # 0x1a198
jmp 0x2764
movq 0x1c831(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cb1f(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x169f4(%rip), %rsi     # 0x1a1cf
jmp 0x2764
movq 0x1c811(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1caff(%rip), %rax     # 0x202f0
movq (%rax), %rdx
leaq 0x16a48(%rip), %rsi     # 0x1a243
xorl %eax, %eax
callq 0x11a0
movl $0x2, %edi
callq 0x1280
movq 0x1c7e5(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1cad3(%rip), %rax     # 0x202f0
movq (%rax), %rdx
movl 0x1c9a6(%rip), %ecx     # 0x201cc
leaq 0x16b5d(%rip), %rsi     # 0x1a38a
jmp 0x2648