// File: /workspace/github_c_makefile_star2_O2/thegenemyers[P]DAMASKER/REPmask.c
// Function: main
int main(int argc, char *argv[])
{ char  *root, *dpwd;
  int    status;
  int64  novl;
  int    c;
  char  *MASK_NAME;

  //  Process arguments

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

    ARG_INIT("REPmask")

    MIN_COVER = -1;
    MASK_NAME = "rep";

    j = 1;
    for (i = 1; i < argc; i++)
      if (argv[i][0] == '-')
        switch (argv[i][1])
        { default:
            ARG_FLAGS("v")
            break;
          case 'c':
            ARG_POSITIVE(MIN_COVER,"Repeat coverage threshold")
            break;
          case 'n':
            MASK_NAME = argv[i]+2;
            break;
        }
      else
        argv[j++] = argv[i];
    argc = j;

    VERBOSE = flags['v'];

    if (argc < 3)
      { fprintf(stderr,"Usage: %s %s\n",Prog_Name,Usage);
        fprintf(stderr,"\n");
        fprintf(stderr,"      -v: Verbose mode, output statistics as proceed.\n");
        fprintf(stderr,"      -c: cutoff depth for declaring an interval repetitive.\n");
        fprintf(stderr,"      -n: use this name as for the repeat mask track\n");
        exit (1);
      }
    if (MIN_COVER <= 0)
      { fprintf(stderr,"%s: Must supply -c parameter for repeat threshold\n",Prog_Name);
        exit (1);
      }
  }

  //  Open trimmed DB

  { status = Open_DB(argv[1],DB);
    if (status < 0)
      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;
  }

  //  Initialize statistics gathering

  if (VERBOSE)
    { int i;

      nreads = 0;
      totlen = 0;
      masked = 0;
      nmasks = 0;

      printf("\nREPmask -c%d -n%s %s",MIN_COVER,MASK_NAME,argv[1]);
      for (i = 2; i < argc; i++)
        printf(" %s",argv[i]);
      printf("\n");
    }

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

  dpwd = PathTo(argv[1]);
  if (status)
    root = Root(argv[1],".dam");
  else
    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)
                  { if (status)
                      dbfile = Fopen(Catenate(dpwd,"/",root,".dam"),"r");
                    else
                      dbfile = Fopen(Catenate(dpwd,"/",root,".db"),"r");
                    if (dbfile == NULL)
			    exit (1);
                    if (fscanf(dbfile,DB_NFILE,&nfiles) != 1)
                      SYSTEM_READ_ERROR
                    for (i = 0; i < nfiles; i++)
                      if (fgets(buffer,2*MAX_NAME+100,dbfile) == NULL)
                        SYSTEM_READ_ERROR
                    if (fscanf(dbfile,DB_NBLOCK,&nblocks) != 1)
                      SYSTEM_READ_ERROR
                    if (fscanf(dbfile,DB_PARAMS,&size,&cutoff,&all) != 3)
                      SYSTEM_READ_ERROR
                    for (i = 1; i <= part; i++)
                      if (fscanf(dbfile,DB_BDATA,&oindx,&DB_FIRST) != 2)
                        SYSTEM_READ_ERROR
                    if (fscanf(dbfile,DB_BDATA,&oindx,&DB_LAST) != 2)
                      SYSTEM_READ_ERROR
                    fclose(dbfile);
                    DB_PART = part;
                  }
              }
          }

          //   Set up preliminary trimming track

          { int   len, size;
            char  ans[strlen(MASK_NAME)+7];
            char  dts[strlen(MASK_NAME)+7];

            strcpy(ans,Catenate(".",MASK_NAME,".","anno"));
            strcpy(dts,Catenate(".",MASK_NAME,".","data"));
            if (DB_PART > 0)
              { MSK_AFILE = Fopen(Catenate(dpwd,PATHSEP,root,
                                       Numbered_Suffix(".",DB_PART,ans)),"w");
                MSK_DFILE = Fopen(Catenate(dpwd,PATHSEP,root,
                                       Numbered_Suffix(".",DB_PART,dts)),"w");
              }
            else
              { MSK_AFILE = Fopen(Catenate(dpwd,PATHSEP,root,ans),"w");
                MSK_DFILE = Fopen(Catenate(dpwd,PATHSEP,root,dts),"w");
              }
            if (MSK_AFILE == NULL || MSK_DFILE == NULL)
              exit (1);

            len  = DB_LAST - DB_FIRST;
            size = 0;
            fwrite(&len,sizeof(int),1,MSK_AFILE);
            fwrite(&size,sizeof(int),1,MSK_AFILE);
            MSK_INDEX = 0;
            fwrite(&MSK_INDEX,sizeof(int64),1,MSK_AFILE);
          }

          //  Get trace point spacing information

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

          //  Process each read pile

          make_a_pass(input,PARTITION,1);

          fclose(MSK_AFILE);
          fclose(MSK_DFILE);
          fclose(input);
        }

      Free_Block_Arg(parse);
    }

  if (VERBOSE)
    { printf("\nInput:    ");
      Print_Number((int64) nreads,7,stdout);
      printf(" (100.0%%) reads     ");
      Print_Number(totlen,12,stdout);
      printf(" (100.0%%) bases\n");

      printf("Masks:    ");
      Print_Number(nmasks,7,stdout);
      printf(" (%5.1f%%) masks     ",(100.*nmasks)/nreads);
      Print_Number(masked,12,stdout);
      printf(" (%5.1f%%) bases\n",(100.*masked)/totlen);
    }

  free(dpwd);
  free(root);

  Close_DB(DB);
  free(Prog_Name);

  exit (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4f48, %rsp           # imm = 0x4F48
movq %rsi, %r12
movl %edi, %r14d
leaq 0x16c4b(%rip), %rdi     # 0x18038
leaq 0x17a82(%rip), %rsi     # 0x18e76
callq 0x10c88
leaq 0x1cea8(%rip), %rcx     # 0x1e2a8
movq %rax, (%rcx)
xorl %eax, %eax
cmpq $0x80, %rax
je 0x141a
andl $0x0, -0x4f70(%rbp,%rax,4)
incq %rax
jmp 0x1405
orl $-0x1, 0x1cd87(%rip)    # 0x1e1a8
movslq %r14d, %rax
movq %rax, -0x38(%rbp)
leaq 0x16c11(%rip), %rax     # 0x18040
movq %rax, -0x78(%rbp)
pushq $0x1
popq %rbx
pushq $0x1
popq %r15
pushq $-0x1
popq %rax
movq %rax, -0x40(%rbp)
leaq 0x16bfc(%rip), %r14     # 0x18044
movq %r12, -0x60(%rbp)
cmpq -0x38(%rbp), %r15
jge 0x154b
movq %r12, %rcx
movq (%r12,%r15,8), %r12
cmpb $0x2d, (%r12)
jne 0x14b9
movl %ebx, -0x30(%rbp)
movzbl 0x1(%r12), %ebx
addq $0x2, %r12
cmpl $0x63, %ebx
je 0x14c7
cmpl $0x6e, %ebx
jne 0x14af
movq %r12, -0x78(%rbp)
jmp 0x14b3
movsbl %bl, %r13d
movq %r14, %rdi
movl %r13d, %esi
callq 0x1160
testq %rax, %rax
je 0x151e
movsbq %bl, %rax
movl $0x1, -0x4f70(%rbp,%rax,4)
movb (%r12), %bl
incq %r12
testb %bl, %bl
jne 0x1481
movq -0x60(%rbp), %r12
jmp 0x1513
movslq %ebx, %rax
incl %ebx
movq %r12, (%rcx,%rax,8)
movq %rcx, %r12
jmp 0x1516
movq %r12, %rdi
leaq -0xa8(%rbp), %rsi
pushq $0xa
popq %rdx
callq 0x11e0
movq %rax, %r9
movl %r9d, 0x1ccc5(%rip)     # 0x1e1a8
movq -0xa8(%rbp), %rax
cmpb $0x0, (%rax)
movq -0x60(%rbp), %r12
movq (%r12,%r15,8), %r8
jne 0x1604
cmpb $0x0, 0x2(%r8)
je 0x1604
testl %r9d, %r9d
jle 0x16f0
movq %r9, -0x40(%rbp)
movl -0x30(%rbp), %ebx
incq %r15
jmp 0x144c
movq 0x1cad3(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1cd79(%rip), %rax     # 0x1e2a8
movq (%rax), %rdx
leaq 0x16b0d(%rip), %rsi     # 0x18046
movl %r13d, %ecx
xorl %eax, %eax
callq 0x11c0
pushq $0x1
popq %rdi
callq 0x1290
movl -0x4d98(%rbp), %eax
movl %eax, 0x1cc55(%rip)     # 0x1e1ac
cmpl $0x2, %ebx
jg 0x15d7
movq 0x1ca95(%rip), %r14     # 0x1dff8
movq (%r14), %rdi
leaq 0x1cd3b(%rip), %rax     # 0x1e2a8
movq (%rax), %rdx
leaq 0x16b4e(%rip), %rsi     # 0x180c5
leaq 0x16d4e(%rip), %rcx     # 0x182cc
xorl %eax, %eax
callq 0x11c0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x1190
movq (%r14), %rcx
leaq 0x16b39(%rip), %rdi     # 0x180d3
pushq $0x36
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x12a0
movq (%r14), %rcx
leaq 0x16b58(%rip), %rdi     # 0x1810a
pushq $0x3d
popq %rsi
movq %rbx, %rdx
callq 0x12a0
movq (%r14), %rcx
leaq 0x16b81(%rip), %rdi     # 0x18148
pushq $0x35
popq %rsi
movq %rbx, %rdx
callq 0x12a0
jmp 0x1543
cmpl $0x0, -0x40(%rbp)
jg 0x1634
movq 0x1ca14(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1ccba(%rip), %rax     # 0x1e2a8
movq (%rax), %rdx
leaq 0x16b86(%rip), %rsi     # 0x1817e
xorl %eax, %eax
callq 0x11c0
jmp 0x1543
movq 0x1c9ed(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1cc93(%rip), %rax     # 0x1e2a8
movq (%rax), %rdx
movsbl 0x1(%r8), %ecx
addq $0x2, %r8
leaq 0x16a3c(%rip), %rsi     # 0x18064
xorl %eax, %eax
callq 0x11c0
jmp 0x1543
movq 0x8(%r12), %rdi
leaq 0x1cbc8(%rip), %rsi     # 0x1e208
callq 0x11a70
testl %eax, %eax
js 0x1543
cmpl $0x0, 0x1cbec(%rip)     # 0x1e240
jne 0x1721
movl %eax, %r14d
leaq 0x1cba4(%rip), %rdi     # 0x1e208
callq 0x12316
movq 0x1cbf8(%rip), %rax     # 0x1e268
movq %rax, 0x1cb39(%rip)     # 0x1e1b0
cmpl $0x0, 0x1cb2e(%rip)     # 0x1e1ac
movl %ebx, %eax
movq %rax, -0xa0(%rbp)
je 0x1755
andq $0x0, 0x1cb23(%rip)     # 0x1e1b8
andq $0x0, 0x1cb23(%rip)     # 0x1e1c0
andq $0x0, 0x1cb23(%rip)     # 0x1e1c8
andq $0x0, 0x1cb23(%rip)     # 0x1e1d0
pushq $0x2
popq %rbx
movl 0x1caf2(%rip), %esi     # 0x1e1a8
movq 0x8(%r12), %rcx
leaq 0x16b14(%rip), %rdi     # 0x181d6
movq -0x78(%rbp), %rdx
xorl %eax, %eax
callq 0x1120
leaq 0x16b14(%rip), %r15     # 0x181e8
cmpq %rbx, -0xa0(%rbp)
je 0x174d
movq (%r12,%rbx,8), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1120
incq %rbx
jmp 0x16d4
movq 0x1c901(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1cba7(%rip), %rax     # 0x1e2a8
movq (%rax), %rdx
leaq 0x16982(%rip), %rsi     # 0x1808d
leaq 0x16999(%rip), %rcx     # 0x180ab
movl %r9d, %r8d
xorl %eax, %eax
callq 0x11c0
jmp 0x1543
movq 0x1c8d0(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1cb76(%rip), %rax     # 0x1e2a8
movq (%rax), %rdx
movq 0x8(%r12), %rcx
leaq 0x16a70(%rip), %rsi     # 0x181b1
xorl %eax, %eax
callq 0x11c0
jmp 0x1543
pushq $0xa
popq %rdi
callq 0x1040
movq 0x8(%r12), %rdi
callq 0x10d4b
movq %rax, -0x50(%rbp)
testl %r14d, %r14d
movq 0x8(%r12), %rdi
leaq 0x16a7f(%rip), %rax     # 0x181f1
leaq 0x16a73(%rip), %rsi     # 0x181ec
cmoveq %rax, %rsi
movq %rsi, -0xb8(%rbp)
callq 0x10da3
movq %rax, -0x48(%rbp)
pushq $0x2
popq %rax
cmpq -0xa0(%rbp), %rax
jae 0x25a4
movq %rax, -0xb0(%rbp)
movq (%r12,%rax,8), %rdi
callq 0x15393
movq %rax, %rbx
movq %rax, -0xc0(%rbp)
movq %rbx, %rdi
callq 0x1518f
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x253e
andl $0x0, 0x1ca05(%rip)     # 0x1e1d8
andl $0x0, 0x1ca02(%rip)     # 0x1e1dc
movl 0x1ca58(%rip), %eax     # 0x1e238
movl %eax, 0x1c9fa(%rip)     # 0x1e1e0
movq %rbx, %rdi
callq 0x1527f
movq %rax, %rdi
pushq $0x2e
popq %rsi
callq 0x1270
testq %rax, %rax
je 0x1963
movq %rax, %r13
incq %r13
movq %r13, %rdi
leaq -0x80(%rbp), %rsi
pushq $0xa
popq %rdx
callq 0x11e0
movq %rax, %r12
movq -0x80(%rbp), %rax
cmpq %r13, %rax
je 0x1963
cmpb $0x0, (%rax)
jne 0x1963
movq -0x50(%rbp), %rdi
leaq 0x169ba(%rip), %rsi     # 0x181f5
movq -0x48(%rbp), %rdx
movq -0xb8(%rbp), %rcx
callq 0x10e67
movq %rax, %rdi
leaq 0x17a18(%rip), %rsi     # 0x1926d
callq 0x10ceb
testq %rax, %rax
je 0x1543
movq %rax, %r13
movq %rax, %rdi
leaq 0x16987(%rip), %rsi     # 0x181f7
leaq -0x88(%rbp), %rdx
xorl %eax, %eax
callq 0x10a0
cmpl $0x1, %eax
jne 0x2555
pushq $-0x1
popq %rbx
incl %ebx
cmpl -0x88(%rbp), %ebx
jge 0x18b2
leaq -0x4f70(%rbp), %rdi
movl $0x4e84, %esi           # imm = 0x4E84
movq %r13, %rdx
callq 0x11a0
testq %rax, %rax
jne 0x188a
jmp 0x2555
movq %r13, %rdi
leaq 0x16968(%rip), %rsi     # 0x18224
leaq -0xdc(%rbp), %rdx
xorl %eax, %eax
callq 0x10a0
cmpl $0x1, %eax
jne 0x2555
movq %r13, %rdi
leaq 0x16955(%rip), %rsi     # 0x18232
leaq -0xe8(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
leaq -0xd4(%rbp), %r8
xorl %eax, %eax
callq 0x10a0
cmpl $0x3, %eax
jne 0x2555
testl %r12d, %r12d
movl $0x0, %ebx
cmovgl %r12d, %ebx
incl %ebx
movq %r13, %rdi
leaq 0x1693e(%rip), %rsi     # 0x18258
leaq -0x84(%rbp), %rdx
decl %ebx
je 0x193d
leaq 0x1c8b0(%rip), %rcx     # 0x1e1dc
xorl %eax, %eax
callq 0x10a0
cmpl $0x2, %eax
je 0x1910
jmp 0x2555
leaq 0x1c89c(%rip), %rcx     # 0x1e1e0
xorl %eax, %eax
callq 0x10a0
cmpl $0x2, %eax
jne 0x2555
movq %r13, %rdi
callq 0x10e0
movl %r12d, 0x1c875(%rip)    # 0x1e1d8
movq -0x78(%rbp), %rbx
movq %rbx, %rdi
callq 0x1100
movq %rsp, -0x38(%rbp)
movq %rsp, %r12
addq $0x16, %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq %rbx, %rdi
callq 0x1100
movq %rsp, %r13
addq $0x16, %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
leaq 0x16962(%rip), %r14     # 0x18306
movq %r14, %rdi
movq %rbx, %rsi
movq %r14, %rdx
leaq 0x173cc(%rip), %rcx     # 0x18d80
callq 0x10e67
movq %r12, %rdi
movq %rax, %rsi
callq 0x1080
movq %r14, %rdi
movq %rbx, %rsi
movq %r14, %rdx
leaq 0x17424(%rip), %rcx     # 0x18df8
callq 0x10e67
movq %r13, %rdi
movq %rax, %rsi
callq 0x1080
movl 0x1c7ee(%rip), %esi     # 0x1e1d8
testl %esi, %esi
jle 0x1a52
movq %r14, %rdi
movq %r12, %rdx
callq 0x10f8e
movq -0x50(%rbp), %rbx
movq %rbx, %rdi
leaq 0x1685b(%rip), %rsi     # 0x18262
movq -0x48(%rbp), %r15
movq %r15, %rdx
movq %rax, %rcx
callq 0x10e67
movq %rax, %rdi
leaq 0x17267(%rip), %r12     # 0x18c87
movq %r12, %rsi
callq 0x10ceb
movq %rax, 0x1c7b9(%rip)     # 0x1e1e8
movl 0x1c7a3(%rip), %esi     # 0x1e1d8
movq %r14, %rdi
movq %r13, %rdx
callq 0x10f8e
movq %rbx, %rdi
leaq 0x16818(%rip), %rsi     # 0x18262
movq %r15, %rdx
movq %rax, %rcx
jmp 0x1a97
movq -0x50(%rbp), %rbx
movq %rbx, %rdi
leaq 0x16802(%rip), %r14     # 0x18262
movq %r14, %rsi
movq -0x48(%rbp), %r15
movq %r15, %rdx
movq %r12, %rcx
callq 0x10e67
movq %rax, %rdi
leaq 0x1720b(%rip), %r12     # 0x18c87
movq %r12, %rsi
callq 0x10ceb
movq %rax, 0x1c75d(%rip)     # 0x1e1e8
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x10e67
movq %rax, %rdi
movq %r12, %rsi
callq 0x10ceb
movq %rax, 0x1c742(%rip)     # 0x1e1f0
movq 0x1c733(%rip), %rcx     # 0x1e1e8
testq %rcx, %rcx
je 0x1543
testq %rax, %rax
je 0x1543
movl 0x1c713(%rip), %eax     # 0x1e1e0
subl 0x1c709(%rip), %eax     # 0x1e1dc
movl %eax, -0x4f70(%rbp)
andl $0x0, -0x80(%rbp)
leaq -0x4f70(%rbp), %rdi
pushq $0x4
popq %rbx
movq %rbx, %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x12a0
movq 0x1c6eb(%rip), %rcx     # 0x1e1e8
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x12a0
andq $0x0, 0x1c6e4(%rip)     # 0x1e1f8
movq 0x1c6cd(%rip), %rcx     # 0x1e1e8
leaq 0x1c6d6(%rip), %rdi     # 0x1e1f8
pushq $0x8
popq %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x12a0
movq -0x38(%rbp), %rsp
leaq -0xa8(%rbp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq -0x30(%rbp), %r12
movq %r12, %rcx
callq 0x10d0
leaq 0x1c6ab(%rip), %r15     # 0x1e200
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x10d0
cmpq $0x0, 0x1c70a(%rip)     # 0x1e278
jne 0x1b97
movslq 0x1c601(%rip), %rax     # 0x1e178
imulq $0x30, %rax, %rdi
leaq 0x16786(%rip), %rsi     # 0x18308
callq 0x10bcd
movq %rax, 0x1c6ea(%rip)     # 0x1e278
testq %rax, %rax
je 0x1543
cmpq $0x0, 0x1c6e1(%rip)     # 0x1e280
jne 0x1bc7
movslq 0x1c5d4(%rip), %rdi     # 0x1e17c
addq %rdi, %rdi
leaq 0x16770(%rip), %rsi     # 0x18322
callq 0x10bcd
movq %rax, 0x1c6c2(%rip)     # 0x1e280
testq %rax, %rax
je 0x1543
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x1130
leaq -0x4f70(%rbp), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
movq %r14, %rcx
callq 0x10d0
movq %r15, %rdi
pushq $0x4
popq %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x10d0
xorl %eax, %eax
cmpl $0x7e, 0x1c5fb(%rip)    # 0x1e200
setge %al
incl %eax
movl %eax, 0x1c678(%rip)     # 0x1e288
movq 0x1c661(%rip), %rsi     # 0x1e278
movq %r14, %rdi
callq 0x81d9
movq 0x1c652(%rip), %rdi     # 0x1e278
testl %eax, %eax
je 0x1c36
movl $0x7fffffff, 0x24(%rdi) # imm = 0x7FFFFFFF
jmp 0x1cd0
movl 0x8(%rdi), %ecx
movq 0x1c640(%rip), %rax     # 0x1e280
cmpl 0x1c536(%rip), %ecx     # 0x1e17c
jle 0x1c95
cvtsi2sd %ecx, %xmm0
mulsd 0x163bc(%rip), %xmm0    # 0x18010
addsd 0x163bc(%rip), %xmm0    # 0x18018
cvttsd2si %xmm0, %ecx
movl %ecx, 0x1c516(%rip)     # 0x1e17c
movslq %ecx, %rsi
addq %rsi, %rsi
movq %rax, %rdi
leaq 0x166c3(%rip), %rdx     # 0x18339
callq 0x10c25
movq %rax, 0x1c5fe(%rip)     # 0x1e280
testq %rax, %rax
je 0x1543
movq 0x1c5e6(%rip), %rcx     # 0x1e278
movl 0x8(%rcx), %ecx
movl 0x1c5ed(%rip), %esi     # 0x1e288
movslq %ecx, %rdx
movq %rax, %rdi
movq -0x30(%rbp), %rcx
callq 0x10d0
cmpl $0x1, 0x1c5d7(%rip)     # 0x1e288
movq 0x1c5c0(%rip), %rdi     # 0x1e278
jne 0x1cd0
movq 0x1c5bf(%rip), %rax     # 0x1e280
movq %rax, (%rdi)
callq 0x82eb
movq 0x1c5a8(%rip), %rdi     # 0x1e278
movslq 0x1c505(%rip), %rdx     # 0x1e1dc
cmpl %edx, 0x24(%rdi)
jl 0x257e
xorl %eax, %eax
xorl %esi, %esi
movslq 0x1c4f5(%rip), %rcx     # 0x1e1e0
movq 0x1c586(%rip), %r12     # 0x1e278
cltq
imulq $0x30, %rax, %rax
cmpq %rcx, %rdx
jge 0x2502
movupd (%r12,%rax), %xmm0
movupd 0x10(%r12,%rax), %xmm1
movups 0x20(%r12,%rax), %xmm2
movups %xmm2, 0x20(%r12)
movupd %xmm1, 0x10(%r12)
movupd %xmm0, (%r12)
movslq 0x24(%r12), %r13
cmpq %r13, %rdx
movq %rdx, -0x68(%rbp)
jne 0x1eb7
movslq %edx, %rax
imulq $0x28, %rax, %rcx
movq %rcx, -0x70(%rbp)
incq %rax
movq %rax, -0x40(%rbp)
movq 0x1c52e(%rip), %rdi     # 0x1e280
movslq %esi, %rax
leaq (%rdi,%rax,2), %rsi
movslq 0x8(%r12), %rdx
addq %rdx, %rdx
callq 0x1240
movl 0x8(%r12), %ebx
xorl %r14d, %r14d
pushq $0x1
popq %rax
movq %rax, -0x38(%rbp)
leaq (%r12,%r14), %rsi
addq $0x30, %rsi
movq -0x30(%rbp), %rdi
callq 0x81d9
movq 0x1c4eb(%rip), %r12     # 0x1e278
testl %eax, %eax
jne 0x1ecb
movl 0x38(%r12,%r14), %ecx
leal (%rcx,%rbx), %edx
movq 0x1c4dc(%rip), %rax     # 0x1e280
cmpl 0x1c3d2(%rip), %edx     # 0x1e17c
jle 0x1dfb
cvtsi2sd %edx, %xmm0
mulsd 0x16258(%rip), %xmm0    # 0x18010
addsd 0x16258(%rip), %xmm0    # 0x18018
cvttsd2si %xmm0, %ecx
movl %ecx, 0x1c3b2(%rip)     # 0x1e17c
movslq %ecx, %rsi
addq %rsi, %rsi
movq %rax, %rdi
leaq 0x1655f(%rip), %rdx     # 0x18339
callq 0x10c25
movq %rax, 0x1c49a(%rip)     # 0x1e280
testq %rax, %rax
je 0x1543
movq 0x1c482(%rip), %rcx     # 0x1e278
movl 0x38(%rcx,%r14), %ecx
movslq %ebx, %r12
leaq (%rax,%r12,2), %rdi
movl 0x1c480(%rip), %esi     # 0x1e288
movslq %ecx, %rdx
movq -0x30(%rbp), %rcx
callq 0x10d0
cmpl $0x1, 0x1c46d(%rip)     # 0x1e288
jne 0x1e3e
addq %r12, %r12
addq 0x1c459(%rip), %r12     # 0x1e280
movq 0x1c44a(%rip), %rax     # 0x1e278
leaq (%rax,%r14), %rdi
addq $0x30, %rdi
movq %r12, (%rdi)
callq 0x82eb
movq 0x1c433(%rip), %r12     # 0x1e278
cmpl %r13d, 0x54(%r12,%r14)
jne 0x1ed4
addl 0x38(%r12,%r14), %ebx
movq -0x38(%rbp), %rax
incq %rax
cmpl %eax, 0x1c316(%rip)     # 0x1e178
movq %rax, -0x38(%rbp)
jg 0x1eae
cvtsi2sd %eax, %xmm0
mulsd 0x1619c(%rip), %xmm0    # 0x18010
addsd 0x1618c(%rip), %xmm0    # 0x18008
cvttsd2si %xmm0, %eax
movl %eax, 0x1c2f2(%rip)     # 0x1e178
cltq
imulq $0x30, %rax, %rsi
movq %r12, %rdi
leaq 0x164fd(%rip), %rdx     # 0x18393
callq 0x10c25
movq %rax, %r12
movq %rax, 0x1c3d3(%rip)     # 0x1e278
testq %rax, %rax
je 0x1543
addq $0x30, %r14
jmp 0x1d75
movq %rsi, -0x98(%rbp)
movq $0x0, -0x38(%rbp)
jmp 0x24d2
movl $0x7fffffff, 0x54(%r12,%r14) # imm = 0x7FFFFFFF
movsd 0x16144(%rip), %xmm3    # 0x18020
movsd 0x16144(%rip), %xmm4    # 0x18028
movq -0x40(%rbp), %r8
movq 0x1c391(%rip), %rax     # 0x1e280
leaq 0x8(%r12), %rcx
xorl %edi, %edi
movq -0x38(%rbp), %rdx
subq $0x1, %rdx
jb 0x1f13
movslq %edi, %rdi
leaq (%rax,%rdi,2), %rsi
movq %rsi, -0x8(%rcx)
addl (%rcx), %edi
addq $0x30, %rcx
jmp 0x1efa
movq -0x38(%rbp), %rax
testl %eax, %eax
movq %rdi, -0x98(%rbp)
jle 0x24d2
movq %rax, %rcx
movq -0x68(%rbp), %rax
movl %eax, %edx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq %rcx, -0x58(%rbp)
xorl %eax, %eax
pushq $0x1
popq %rsi
cmpq -0x58(%rbp), %rsi
je 0x2020
imulq $0x30, %rsi, %r8
leaq (%r12,%r8), %rdi
movl 0x28(%r12,%r8), %r9d
movl %eax, %r10d
testl %r10d, %r10d
js 0x1fcc
movl %r10d, %r8d
imulq $0x30, %r8, %r8
cmpl 0x28(%r12,%r8), %r9d
jne 0x1fcc
addq %r12, %r8
movl 0x20(%r8), %r11d
xorl 0x20(%rdi), %r11d
testb $0x1, %r11b
jne 0x1fcc
movl 0x18(%r8), %ebx
movl 0x10(%rdi), %r11d
leal 0x12c(%r11), %r13d
cmpl %r13d, %ebx
jge 0x1fc7
subl %ebx, %r11d
movl 0x14(%rdi), %ecx
movl 0x1c(%r8), %r13d
subl %r13d, %ecx
movl %r11d, %r15d
subl %ecx, %r15d
movl %r15d, %r14d
negl %r14d
cmovsl %r15d, %r14d
cvtsi2sd %r14d, %xmm0
addl %r11d, %ecx
cvtsi2sd %ecx, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm4, %xmm1
ucomisd %xmm0, %xmm1
ja 0x2001
decl %r10d
jmp 0x1f58
incl %eax
movslq %eax, %rcx
imulq $0x30, %rcx, %rcx
movupd (%rdi), %xmm0
movupd 0x10(%rdi), %xmm1
movups 0x20(%rdi), %xmm2
movups %xmm2, 0x20(%r12,%rcx)
movupd %xmm1, 0x10(%r12,%rcx)
movupd %xmm0, (%r12,%rcx)
incq %rsi
movq -0x40(%rbp), %r8
jmp 0x1f3e
movl 0x18(%rdi), %r9d
cmpl %ebx, %r9d
jle 0x200e
movl %r9d, 0x18(%r8)
movl 0x1c(%rdi), %edi
cmpl %r13d, %edi
jle 0x201a
movl %edi, 0x1c(%r8)
addl %r11d, 0x8(%r8)
jmp 0x1ff5
movslq 0x1c211(%rip), %r9      # 0x1e238
movq 0x1c182(%rip), %r10     # 0x1e1b0
movq -0x68(%rbp), %rsi
movslq %esi, %rcx
movq %rcx, -0xc8(%rbp)
movq -0x70(%rbp), %rcx
addq %r10, %rcx
addq $0x48, %rcx
movl %esi, %edi
movl %edi, %esi
cmpq %r9, %r8
jge 0x2060
leal 0x1(%rsi), %edi
incq %r8
testb $0x4, 0x1(%rcx)
leaq 0x28(%rcx), %rcx
jne 0x2049
cmpl $-0x1, %edx
pushq $-0x1
popq %rdi
cmovll %edx, %edi
movq %r9, -0xd0(%rbp)
testl %edx, %edx
js 0x2088
movl %edx, %ecx
imulq $0x28, %rcx, %rcx
testb $0x4, 0x21(%r10,%rcx)
je 0x2086
decl %edx
jmp 0x2070
movl %edx, %edi
movslq %eax, %rcx
movq %rcx, -0x40(%rbp)
addq $0x48, %r10
xorl %edx, %edx
movl %edi, %ecx
xorl %r14d, %r14d
movl %edx, %r9d
cmpl %eax, %r9d
jg 0x21e7
movslq %r9d, %rdx
imulq $0x30, %rdx, %r8
movl 0x28(%r12,%r8), %ebx
cmpl %ebx, %edi
jg 0x20c1
cmpl %esi, %ebx
jg 0x20c1
incl %ecx
movl %ecx, %r9d
jmp 0x209d
movslq %ebx, %rcx
imulq $0x28, %rcx, %r8
movq %r10, -0x90(%rbp)
addq %r10, %r8
incq %rcx
movl %ebx, %r10d
movq -0xd0(%rbp), %r13
movl %r10d, %r11d
cmpq %r13, %rcx
jge 0x20f9
leal 0x1(%r11), %r10d
incq %rcx
testb $0x4, 0x1(%r8)
leaq 0x28(%r8), %r8
jne 0x20df
movslq %r9d, %r9
imulq $0x30, %r9, %r10
shlq $0x20, %r9
addq %r12, %r10
xorl %r13d, %r13d
pushq $-0x1
popq %r8
xorl %ecx, %ecx
cmpl %r11d, %ebx
jg 0x2171
cmpq -0x40(%rbp), %rdx
jg 0x212f
movl 0x28(%r10), %ebx
movq %r10, %r15
cmpl %r8d, %ebx
jne 0x212f
movq %r10, %r15
movl %r8d, %ebx
jmp 0x2145
cmpl %r13d, %ecx
cmovgl %ecx, %r13d
movl -0x58(%rbp), %ecx
cmovgl -0x70(%rbp), %ecx
movl %ecx, -0x58(%rbp)
xorl %ecx, %ecx
movl %edx, -0x70(%rbp)
cmpq -0x40(%rbp), %rdx
jg 0x2171
cmpl %r11d, %ebx
jg 0x2171
addl 0x18(%r15), %ecx
subl 0x10(%r15), %ecx
incq %rdx
movabsq $0x100000000, %r8       # imm = 0x100000000
addq %r8, %r9
addq $0x30, %r10
movl %ebx, %r8d
jmp 0x2110
movl %edx, %ecx
testl %r13d, %r13d
movq -0x90(%rbp), %r10
jle 0x209a
movslq -0x58(%rbp), %rcx
imulq $0x30, %rcx, %r10
leaq (%r12,%r10), %r8
movl 0x28(%r12,%r10), %r10d
sarq $0x20, %r9
cmpq %r9, %rcx
jge 0x21d9
cmpl %r10d, 0x28(%r8)
jne 0x21d0
movslq %r14d, %r11
incl %r14d
imulq $0x30, %r11, %r11
movupd (%r8), %xmm0
movupd 0x10(%r8), %xmm1
movups 0x20(%r8), %xmm2
movups %xmm2, 0x20(%r12,%r11)
movupd %xmm1, 0x10(%r12,%r11)
movupd %xmm0, (%r12,%r11)
incq %rcx
addq $0x30, %r8
jmp 0x2198
movl %edx, %ecx
movq -0x90(%rbp), %r10
jmp 0x209a
cmpl %r14d, 0x1c09e(%rip)    # 0x1e28c
jge 0x2267
cvtsi2sd %r14d, %xmm0
mulsd 0x15e13(%rip), %xmm0    # 0x18010
addsd 0x15e2b(%rip), %xmm0    # 0x18030
cvttsd2si %xmm0, %eax
movl %eax, 0x1c07d(%rip)     # 0x1e28c
movq 0x1c07a(%rip), %rdi     # 0x1e290
movslq %eax, %rsi
shlq $0x4, %rsi
leaq 0x16188(%rip), %rdx     # 0x183ac
callq 0x10c25
movq %rax, 0x1c060(%rip)     # 0x1e290
movq 0x1c061(%rip), %rdi     # 0x1e298
movslq 0x1c04e(%rip), %rsi     # 0x1e28c
shlq $0x4, %rsi
leaq 0x1617d(%rip), %rdx     # 0x183c6
callq 0x10c25
movq %rax, 0x1c043(%rip)     # 0x1e298
movslq 0x1c030(%rip), %rcx     # 0x1e28c
leaq (%rax,%rcx,8), %rax
movq %rax, 0x1c039(%rip)     # 0x1e2a0
movq 0x1c022(%rip), %rdi     # 0x1e290
testl %r14d, %r14d
movl $0x0, %eax
cmovlel %eax, %r14d
addq $0x18, %r12
movl %r14d, %r8d
addl %r8d, %r8d
xorl %esi, %esi
cmpq %rsi, %r8
je 0x22d2
movl -0x8(%r12), %edx
movl (%r12), %ecx
leal 0x12c(%rdx), %eax
leal -0x12c(%rcx), %r9d
cmpl %eax, %r9d
jge 0x22b3
addl %edx, %ecx
movl %ecx, %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, %r9d
movl $0x1, (%rdi,%rsi,8)
movl %eax, 0x4(%rdi,%rsi,8)
andl $0x0, 0x8(%rdi,%rsi,8)
movl %r9d, 0xc(%rdi,%rsi,8)
addq $0x2, %rsi
addq $0x30, %r12
jmp 0x2286
pushq $0x8
popq %rdx
leaq 0x3f1(%rip), %rcx       # 0x26cd
callq 0x10c0
movq 0x1bfa8(%rip), %rax     # 0x1e290
movl 0x1beba(%rip), %edi     # 0x1e1a8
movq 0x1bfa3(%rip), %r12     # 0x1e298
movq 0x1bfa4(%rip), %rcx     # 0x1e2a0
shlq $0x4, %r14
xorl %r8d, %r8d
xorl %edx, %edx
xorl %r11d, %r11d
xorl %r9d, %r9d
xorl %r10d, %r10d
movslq %edx, %rsi
cmpq %r8, %r14
je 0x2381
cmpl $0x0, (%rax,%r8)
je 0x234c
leal 0x1(%r11), %ebx
cmpl %r10d, %r11d
cmovgel %ebx, %r10d
cmpl %edi, %ebx
jne 0x2378
movl 0x4(%rax,%r8), %edx
movl $0xfffffed4, %r10d      # imm = 0xFFFFFED4
addl %r10d, %edx
movl %edx, (%r12,%rsi,4)
leal 0x1(%rsi), %edx
movl %r9d, (%rcx,%rsi,4)
movl %edi, %ebx
movl %edi, %r10d
jmp 0x2378
cmpl %edi, %r11d
jne 0x236d
movl 0x4(%rax,%r8), %edx
movl $0x12c, %r9d            # imm = 0x12C
addl %r9d, %edx
movl %edx, (%r12,%rsi,4)
leal 0x1(%rsi), %edx
movl %r10d, (%rcx,%rsi,4)
movl %edi, %r9d
leal -0x1(%r11), %ebx
cmpl %r9d, %r11d
cmovlel %ebx, %r9d
addq $0x8, %r8
movl %ebx, %r11d
jmp 0x230e
pushq $0x3
popq %rdi
pushq $0x2
popq %rax
leaq -0x1(%rdi), %r8
cmpq %rsi, %r8
jge 0x2415
movl -0x8(%rcx,%rdi,4), %r8d
movl (%rcx,%rdi,4), %r9d
cmpl %r9d, %r8d
cmovll %r8d, %r9d
subl -0x4(%rcx,%rdi,4), %r9d
movslq %eax, %r8
cmpl $0x4, %r9d
jl 0x23cb
movl -0x4(%r12,%rdi,4), %r10d
cmpl $0x9, %r9d
ja 0x23e8
movl -0x8(%r12,%rdi,4), %r9d
subl %r10d, %r9d
cmpl $0x15, %r9d
jl 0x23e8
movl (%r12,%rdi,4), %r9d
movl %r9d, -0x4(%r12,%r8,4)
movl (%rcx,%rdi,4), %r9d
cmpl -0x4(%rcx,%r8,4), %r9d
jle 0x240c
decq %r8
movl %r9d, (%rcx,%r8,4)
jmp 0x240c
movl %r10d, (%r12,%r8,4)
movl (%r12,%rdi,4), %eax
movl %eax, 0x4(%r12,%r8,4)
movl -0x4(%rcx,%rdi,4), %eax
movl %eax, (%rcx,%r8,4)
movl (%rcx,%rdi,4), %eax
movl %eax, 0x4(%rcx,%r8,4)
addl $0x2, %r8d
movl %r8d, %eax
addq $0x2, %rdi
jmp 0x2387
testl %edx, %edx
cmovlel %edx, %eax
cmpl $0x0, 0x1bd8b(%rip)     # 0x1e1ac
movslq %eax, %rbx
je 0x2481
movq 0x1bd9b(%rip), %rcx     # 0x1e1c8
xorl %edx, %edx
cmpq %rbx, %rdx
jge 0x2450
movslq 0x4(%r12,%rdx,4), %rsi
movslq (%r12,%rdx,4), %rdi
subq %rdi, %rsi
addq %rsi, %rcx
movq %rcx, 0x1bd7e(%rip)     # 0x1e1c8
addq $0x2, %rdx
jmp 0x242f
cltd
pushq $0x2
popq %rcx
idivl %ecx
cltq
addq %rax, 0x1bd71(%rip)     # 0x1e1d0
incq 0x1bd52(%rip)           # 0x1e1b8
movq 0x1bdfb(%rip), %rax     # 0x1e268
imulq $0x28, -0xc8(%rbp), %rcx
movslq 0x4(%rax,%rcx), %rax
addq %rax, 0x1bd3f(%rip)     # 0x1e1c0
xorl %r15d, %r15d
cmpq %rbx, %r15
jge 0x24c7
movq 0x1bd60(%rip), %rcx     # 0x1e1f0
movq %r12, %rdi
pushq $0x4
popq %r14
movq %r14, %rsi
pushq $0x1
popq %r13
movq %r13, %rdx
callq 0x12a0
leaq 0x4(%r12), %rdi
movq 0x1bd3e(%rip), %rcx     # 0x1e1f0
movq %r14, %rsi
movq %r13, %rdx
callq 0x12a0
addq $0x2, %r15
addq $0x8, %r12
jmp 0x2484
shlq $0x2, %rbx
addq %rbx, 0x1bd26(%rip)     # 0x1e1f8
movq 0x1bd0f(%rip), %rcx     # 0x1e1e8
leaq 0x1bd18(%rip), %rdi     # 0x1e1f8
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x12a0
movq -0x68(%rbp), %rdx
incq %rdx
movq -0x38(%rbp), %rax
movq -0x98(%rbp), %rsi
jmp 0x1ce4
cmpl $0x7fffffff, 0x24(%r12,%rax) # imm = 0x7FFFFFFF
jne 0x257e
movq 0x1bcd4(%rip), %rdi     # 0x1e1e8
callq 0x10e0
movq 0x1bcd0(%rip), %rdi     # 0x1e1f0
callq 0x10e0
movq -0x30(%rbp), %rdi
callq 0x10e0
movq -0x60(%rbp), %r12
movq -0xc0(%rbp), %rbx
jmp 0x17b7
movq %rbx, %rdi
callq 0x152aa
movq -0xb0(%rbp), %rax
incq %rax
jmp 0x1790
movq 0x1ba9c(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1bd42(%rip), %rax     # 0x1e2a8
movq (%rax), %rdx
leaq 0x15c94(%rip), %rsi     # 0x18204
xorl %eax, %eax
callq 0x11c0
pushq $0x2
jmp 0x1545
movq 0x1ba73(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x1bd19(%rip), %rax     # 0x1e2a8
movq (%rax), %rdx
movl 0x1bc40(%rip), %ecx     # 0x1e1d8
leaq 0x15db0(%rip), %rsi     # 0x1834f
jmp 0x153c
cmpl $0x0, 0x1bc01(%rip)     # 0x1e1ac
je 0x2699
leaq 0x15cad(%rip), %rdi     # 0x18265
xorl %eax, %eax
callq 0x1120
movq 0x1bbf2(%rip), %rdi     # 0x1e1b8
movq 0x1ba0b(%rip), %r15     # 0x1dfd8
movq (%r15), %rdx
pushq $0x7
popq %r14
movl %r14d, %esi
callq 0x1105d
leaq 0x15c8e(%rip), %rdi     # 0x18271
xorl %eax, %eax
callq 0x1120
movq 0x1bbcf(%rip), %rdi     # 0x1e1c0
movq (%r15), %rdx
pushq $0xc
popq %rbx
movl %ebx, %esi
callq 0x1105d
leaq 0x15c82(%rip), %rdi     # 0x18287
xorl %eax, %eax
callq 0x1120
leaq 0x15c86(%rip), %rdi     # 0x18299
xorl %eax, %eax
callq 0x1120
movq 0x1bbaf(%rip), %rdi     # 0x1e1d0
movq (%r15), %rdx
movl %r14d, %esi
callq 0x1105d
cvtsi2sdq 0x1bb9b(%rip), %xmm0 # 0x1e1d0
movsd 0x159cb(%rip), %xmm1    # 0x18008
mulsd %xmm1, %xmm0
cvtsi2sdq 0x1bb6e(%rip), %xmm1 # 0x1e1b8
divsd %xmm1, %xmm0
leaq 0x15c4f(%rip), %rdi     # 0x182a4
movb $0x1, %al
callq 0x1120
movq 0x1bb65(%rip), %rdi     # 0x1e1c8
movq (%r15), %rdx
movl %ebx, %esi
callq 0x1105d
cvtsi2sdq 0x1bb52(%rip), %xmm0 # 0x1e1c8
mulsd 0x1598a(%rip), %xmm0    # 0x18008
cvtsi2sdq 0x1bb39(%rip), %xmm1 # 0x1e1c0
divsd %xmm1, %xmm0
leaq 0x15c28(%rip), %rdi     # 0x182ba
movb $0x1, %al
callq 0x1120
movq -0x50(%rbp), %rdi
callq 0x1030
movq -0x48(%rbp), %rdi
callq 0x1030
leaq 0x1bb56(%rip), %rdi     # 0x1e208
callq 0x12acf
leaq 0x1bbea(%rip), %rax     # 0x1e2a8
movq (%rax), %rdi
callq 0x1030
xorl %edi, %edi
callq 0x1290