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

  //  Process arguments

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

    ARG_INIT("TANmask")

    MIN_LEN   = 500;
    MASK_NAME = "tan";

    j = 1;
    for (i = 1; i < argc; i++)
      if (argv[i][0] == '-')
        switch (argv[i][1])
        { default:
            ARG_FLAGS("v")
            break;
          case 'n':
            MASK_NAME = argv[i]+2;
            break;
          case 'l':
            ARG_POSITIVE(MIN_LEN,"Minimum retained segment length")
            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,"      -l: shortest tandem interval to report.\n");
        fprintf(stderr,"      -n: use this name as for the tandem mask track\n");
        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);
  }

  //  Initialize statistics gathering

  if (VERBOSE)
    { int i;

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

      printf("\nTANmask -l%d -n%s %s",MIN_LEN,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 mask 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)
              { TN_AFILE = Fopen(Catenate(dpwd,PATHSEP,root,
                                          Numbered_Suffix(".",DB_PART,ans)),"w");
                TN_DFILE = Fopen(Catenate(dpwd,PATHSEP,root,
                                          Numbered_Suffix(".",DB_PART,dts)),"w");
              }
            else
              { TN_AFILE = Fopen(Catenate(dpwd,PATHSEP,root,ans),"w");
                TN_DFILE = Fopen(Catenate(dpwd,PATHSEP,root,dts),"w");
              }
            if (TN_AFILE == NULL || TN_DFILE == NULL)
              exit (1);

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

          //  Process each read pile

          make_a_pass(input,TANDEM,0);

          fclose(TN_AFILE);
          fclose(TN_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 $0x4f28, %rsp           # imm = 0x4F28
movq %rsi, %r15
movl %edi, %r14d
leaq 0x16c23(%rip), %rdi     # 0x19020
leaq 0x17a02(%rip), %rsi     # 0x19e06
callq 0x11734
leaq 0x1ce78(%rip), %rcx     # 0x1f288
movq %rax, (%rcx)
xorl %eax, %eax
cmpq $0x80, %rax
je 0x242a
andl $0x0, -0x4f50(%rbp,%rax,4)
incq %rax
jmp 0x2415
movl $0x1f4, 0x1cd74(%rip)   # imm = 0x1F4
movslq %r14d, %rax
movq %rax, -0x60(%rbp)
leaq 0x16be6(%rip), %rax     # 0x19028
movq %rax, -0x70(%rbp)
pushq $0x1
popq %rax
movl %eax, -0x30(%rbp)
pushq $0x1
popq %rbx
leaq 0x16bd6(%rip), %r12     # 0x1902c
movq %r15, -0x38(%rbp)
cmpq -0x60(%rbp), %rbx
jge 0x2542
movq (%r15,%rbx,8), %r13
cmpb $0x2d, (%r13)
jne 0x24bf
movzbl 0x1(%r13), %r15d
addq $0x2, %r13
cmpl $0x6c, %r15d
je 0x24d0
cmpl $0x6e, %r15d
jne 0x24b4
movq %r13, -0x70(%rbp)
jmp 0x24b9
movsbl %r15b, %r14d
movq %r12, %rdi
movl %r14d, %esi
callq 0x2160
testq %rax, %rax
je 0x2515
movsbq %r15b, %rax
movl $0x1, -0x4f50(%rbp,%rax,4)
movb (%r13), %r15b
incq %r13
testb %r15b, %r15b
jne 0x248a
movq -0x38(%rbp), %r15
jmp 0x250d
movl -0x30(%rbp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, -0x30(%rbp)
movq %r13, (%r15,%rax,8)
jmp 0x250d
movq %r13, %rdi
leaq -0x40(%rbp), %rsi
pushq $0xa
popq %rdx
callq 0x21e0
movl %eax, 0x1ccc3(%rip)     # 0x1f1a8
movq -0x40(%rbp), %rcx
cmpb $0x0, (%rcx)
movq -0x38(%rbp), %r15
movq (%r15,%rbx,8), %r8
jne 0x267b
cmpb $0x0, 0x2(%r8)
je 0x267b
testl %eax, %eax
jle 0x26ab
incq %rbx
jmp 0x245a
movq 0x1cadc(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
leaq 0x1cd62(%rip), %rax     # 0x1f288
movq (%rax), %rdx
leaq 0x16afe(%rip), %rsi     # 0x1902e
movl %r14d, %ecx
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %rdi
callq 0x22a0
movl -0x4d78(%rbp), %eax
movl %eax, 0x1cc5e(%rip)     # 0x1f1ac
movl -0x30(%rbp), %ebx
cmpl $0x2, %ebx
jg 0x25d1
movq 0x1ca9b(%rip), %r14     # 0x1eff8
movq (%r14), %rdi
leaq 0x1cd21(%rip), %rax     # 0x1f288
movq (%rax), %rdx
leaq 0x16b42(%rip), %rsi     # 0x190b3
leaq 0x16d00(%rip), %rcx     # 0x19278
xorl %eax, %eax
callq 0x21c0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x2190
movq (%r14), %rcx
leaq 0x16b2d(%rip), %rdi     # 0x190c1
pushq $0x36
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x22b0
movq (%r14), %rcx
leaq 0x16b4c(%rip), %rdi     # 0x190f8
pushq $0x2e
popq %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%r14), %rcx
leaq 0x16b66(%rip), %rdi     # 0x19127
pushq $0x35
popq %rsi
movq %rbx, %rdx
callq 0x22b0
jmp 0x253a
movq 0x8(%r15), %rdi
leaq 0x1cc1c(%rip), %rsi     # 0x1f1f8
callq 0x1251c
testl %eax, %eax
js 0x253a
cmpl $0x0, 0x1cc40(%rip)     # 0x1f230
jne 0x26dc
movl %eax, %r14d
leaq 0x1cbf8(%rip), %rdi     # 0x1f1f8
callq 0x12dc2
cmpl $0x0, 0x1cba0(%rip)     # 0x1f1ac
movl %ebx, %r12d
je 0x2713
andq $0x0, 0x1cb93(%rip)     # 0x1f1b0
andq $0x0, 0x1cb93(%rip)     # 0x1f1b8
andq $0x0, 0x1cb93(%rip)     # 0x1f1c0
andq $0x0, 0x1cb93(%rip)     # 0x1f1c8
pushq $0x2
popq %rbx
movl 0x1cb6a(%rip), %esi     # 0x1f1a8
movq 0x8(%r15), %rcx
leaq 0x16b39(%rip), %rdi     # 0x19182
movq -0x70(%rbp), %rdx
xorl %eax, %eax
callq 0x2120
leaq 0x16b39(%rip), %r15     # 0x19194
cmpq %rbx, %r12
je 0x2707
movq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2120
incq %rbx
jmp 0x265b
movq 0x1c976(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
leaq 0x1cbfc(%rip), %rax     # 0x1f288
movq (%rax), %rdx
movsbl 0x1(%r8), %ecx
addq $0x2, %r8
leaq 0x169ad(%rip), %rsi     # 0x1904c
xorl %eax, %eax
callq 0x21c0
jmp 0x253a
movq 0x1c946(%rip), %rcx     # 0x1eff8
movq (%rcx), %rdi
leaq 0x1cbcc(%rip), %rcx     # 0x1f288
movq (%rcx), %rdx
leaq 0x169af(%rip), %rsi     # 0x19075
leaq 0x169c6(%rip), %rcx     # 0x19093
movl %eax, %r8d
xorl %eax, %eax
callq 0x21c0
jmp 0x253a
movq 0x1c915(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
leaq 0x1cb9b(%rip), %rax     # 0x1f288
movq (%rax), %rdx
movq 0x8(%r15), %rcx
leaq 0x16a62(%rip), %rsi     # 0x1915d
xorl %eax, %eax
callq 0x21c0
jmp 0x253a
pushq $0xa
popq %rdi
callq 0x2040
movq -0x38(%rbp), %r15
movq %r12, -0x98(%rbp)
movq 0x8(%r15), %rdi
callq 0x117f7
movq %rax, -0x58(%rbp)
testl %r14d, %r14d
movq 0x8(%r15), %rdi
leaq 0x16a68(%rip), %rax     # 0x1919d
leaq 0x16a5c(%rip), %rsi     # 0x19198
cmoveq %rax, %rsi
movq %rsi, -0xa8(%rbp)
callq 0x1184f
movq %rax, -0x50(%rbp)
pushq $0x2
popq %rax
leaq -0x80(%rbp), %r12
cmpq -0x98(%rbp), %rax
jae 0x3058
movq %rax, -0xa0(%rbp)
movq (%r15,%rax,8), %rdi
callq 0x15e3f
movq %rax, %rbx
movq %rax, -0xb0(%rbp)
movq %rbx, %rdi
callq 0x15c3b
testq %rax, %rax
je 0x2ff2
movq %rax, -0x78(%rbp)
andl $0x0, 0x1ca36(%rip)     # 0x1f1d0
andl $0x0, 0x1ca33(%rip)     # 0x1f1d4
movl 0x1ca81(%rip), %eax     # 0x1f228
movl %eax, 0x1ca2b(%rip)     # 0x1f1d8
movq %rbx, %rdi
callq 0x15d2b
movq %rax, %rdi
pushq $0x2e
popq %rsi
callq 0x2280
testq %rax, %rax
je 0x2932
movq %rax, %r14
incq %r14
movq %r14, %rdi
leaq -0x40(%rbp), %rsi
pushq $0xa
popq %rdx
callq 0x21e0
movq %rax, %r13
movq -0x40(%rbp), %rax
cmpq %r14, %rax
je 0x2932
cmpb $0x0, (%rax)
jne 0x2932
movq -0x58(%rbp), %rdi
leaq 0x1699f(%rip), %rsi     # 0x191a1
movq -0x50(%rbp), %rdx
movq -0xa8(%rbp), %rcx
callq 0x11913
movq %rax, %rdi
leaq 0x179e1(%rip), %rsi     # 0x1a1fd
callq 0x11797
testq %rax, %rax
je 0x253a
movq %rax, %r14
movq %rax, %rdi
leaq 0x1696c(%rip), %rsi     # 0x191a3
leaq -0x84(%rbp), %rdx
xorl %eax, %eax
callq 0x20a0
cmpl $0x1, %eax
leaq -0x4f50(%rbp), %r15
jne 0x3009
pushq $-0x1
popq %rbx
incl %ebx
cmpl -0x84(%rbp), %ebx
jge 0x287c
movq %r15, %rdi
movl $0x4e84, %esi           # imm = 0x4E84
movq %r14, %rdx
callq 0x21a0
testq %rax, %rax
jne 0x2858
jmp 0x3009
movq %r14, %rdi
leaq 0x1694a(%rip), %rsi     # 0x191d0
leaq -0xbc(%rbp), %rdx
xorl %eax, %eax
callq 0x20a0
cmpl $0x1, %eax
jne 0x3009
movq %r14, %rdi
leaq 0x16937(%rip), %rsi     # 0x191de
leaq -0xc8(%rbp), %rdx
leaq -0xb8(%rbp), %rcx
leaq -0xb4(%rbp), %r8
xorl %eax, %eax
callq 0x20a0
cmpl $0x3, %eax
leaq 0x16937(%rip), %r15     # 0x19204
jne 0x3009
testl %r13d, %r13d
movl $0x0, %ebx
cmovgl %r13d, %ebx
incl %ebx
movq %r14, %rdi
decl %ebx
je 0x2906
movq %r15, %rsi
movq %r12, %rdx
leaq 0x1c8df(%rip), %rcx     # 0x1f1d4
xorl %eax, %eax
callq 0x20a0
cmpl $0x2, %eax
je 0x28e1
jmp 0x3009
movq %r15, %rsi
movq %r12, %rdx
leaq 0x1c8c5(%rip), %rcx     # 0x1f1d8
xorl %eax, %eax
callq 0x20a0
cmpl $0x2, %eax
jne 0x3009
movq %r14, %rdi
callq 0x20e0
movl %r13d, 0x1c89e(%rip)    # 0x1f1d0
movq -0x70(%rbp), %rbx
movq %rbx, %rdi
callq 0x2100
movq %rsp, -0x30(%rbp)
movq %rsp, %r14
addq $0x16, %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq %rbx, %rdi
callq 0x2100
movq %rsp, %r15
addq $0x16, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
leaq 0x16947(%rip), %r12     # 0x192ba
movq %r12, %rdi
movq %rbx, %rsi
movq %r12, %rdx
leaq 0x1738d(%rip), %rcx     # 0x19d10
callq 0x11913
movq %r14, %rdi
movq %rax, %rsi
callq 0x2080
movq %r12, %rdi
movq %rbx, %rsi
movq %r12, %rdx
leaq 0x173e5(%rip), %rcx     # 0x19d88
callq 0x11913
movq %r15, %r13
movq %r15, %rdi
movq %rax, %rsi
callq 0x2080
movl 0x1c814(%rip), %esi     # 0x1f1d0
testl %esi, %esi
jle 0x2a24
movq %r12, %rdi
movq %r14, %rdx
callq 0x11a3a
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
leaq 0x16835(%rip), %rsi     # 0x1920e
movq -0x50(%rbp), %r14
movq %r14, %rdx
movq %rax, %rcx
callq 0x11913
movq %rax, %rdi
leaq 0x17225(%rip), %r15     # 0x19c17
movq %r15, %rsi
callq 0x11797
movq %rax, 0x1c7df(%rip)     # 0x1f1e0
movl 0x1c7c9(%rip), %esi     # 0x1f1d0
movq %r12, %rdi
movq %r13, %rdx
callq 0x11a3a
movq %rbx, %rdi
leaq 0x167f2(%rip), %rsi     # 0x1920e
movq %r14, %rdx
movq %rax, %rcx
jmp 0x2a6a
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
leaq 0x167dc(%rip), %rsi     # 0x1920e
movq -0x50(%rbp), %r12
movq %r12, %rdx
movq %r14, %rcx
callq 0x11913
movq %rax, %rdi
leaq 0x171cc(%rip), %r15     # 0x19c17
movq %r15, %rsi
callq 0x11797
movq %rax, 0x1c786(%rip)     # 0x1f1e0
movq %rbx, %rdi
leaq 0x167aa(%rip), %rsi     # 0x1920e
movq %r12, %rdx
movq %r13, %rcx
callq 0x11913
movq %rax, %rdi
movq %r15, %rsi
callq 0x11797
movq %rax, 0x1c767(%rip)     # 0x1f1e8
movq 0x1c758(%rip), %rcx     # 0x1f1e0
testq %rcx, %rcx
pushq $0x1
popq %r12
je 0x253a
testq %rax, %rax
je 0x253a
movl 0x1c734(%rip), %eax     # 0x1f1d8
subl 0x1c72a(%rip), %eax     # 0x1f1d4
movl %eax, -0x4f50(%rbp)
andl $0x0, -0x40(%rbp)
leaq -0x4f50(%rbp), %rbx
movq %rbx, %rdi
pushq $0x4
popq %r14
movq %r14, %rsi
movq %r12, %rdx
callq 0x22b0
movq 0x1c70c(%rip), %rcx     # 0x1f1e0
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x22b0
andq $0x0, 0x1c705(%rip)     # 0x1f1f0
movq 0x1c6ee(%rip), %rcx     # 0x1f1e0
leaq 0x1c6f7(%rip), %rdi     # 0x1f1f0
pushq $0x8
popq %r15
movq %r15, %rsi
movq %r12, %rdx
callq 0x22b0
movq -0x30(%rbp), %rsp
cmpq $0x0, 0x1c754(%rip)     # 0x1f268
jne 0x2b3d
movslq 0x1c663(%rip), %rax     # 0x1f180
imulq $0x30, %rax, %rdi
leaq 0x16794(%rip), %rsi     # 0x192bc
callq 0x11679
movq %rax, 0x1c734(%rip)     # 0x1f268
testq %rax, %rax
je 0x253a
movq -0x78(%rbp), %r13
movq %r13, %rdi
callq 0x2130
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x20d0
leaq 0x1c70f(%rip), %rdi     # 0x1f270
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x20d0
xorl %eax, %eax
cmpl $0x7e, 0x1c6f8(%rip)    # 0x1f270
setge %al
incl %eax
movl %eax, 0x1c6f1(%rip)     # 0x1f274
movq 0x1c6de(%rip), %rsi     # 0x1f268
movq %r13, %rdi
callq 0x8c85
testl %eax, %eax
movq -0x38(%rbp), %r15
je 0x2bb0
movq 0x1c6c7(%rip), %rax     # 0x1f268
movl $0x7fffffff, 0x24(%rax) # imm = 0x7FFFFFFF
movl 0x1c626(%rip), %eax     # 0x1f1d4
jmp 0x2be7
movslq 0x1c6bd(%rip), %rax     # 0x1f274
movq 0x1c6aa(%rip), %rcx     # 0x1f268
movslq 0x8(%rcx), %rsi
imulq %rax, %rsi
movq %r13, %rdi
pushq $0x1
popq %rdx
callq 0x2230
movq 0x1c690(%rip), %rcx     # 0x1f268
movl 0x1c5f6(%rip), %eax     # 0x1f1d4
cmpl %eax, 0x24(%rcx)
jl 0x3032
movslq %eax, %rdx
xorl %eax, %eax
movslq 0x1c5e5(%rip), %rcx     # 0x1f1d8
movq 0x1c66e(%rip), %r14     # 0x1f268
cltq
imulq $0x30, %rax, %rax
cmpq %rcx, %rdx
jge 0x2fb6
movupd (%r14,%rax), %xmm0
movups 0x10(%r14,%rax), %xmm1
movups 0x20(%r14,%rax), %xmm2
movups %xmm2, 0x20(%r14)
movups %xmm1, 0x10(%r14)
movupd %xmm0, (%r14)
movslq 0x24(%r14), %rcx
xorl %ebx, %ebx
movq %rdx, -0x68(%rbp)
movq %rcx, -0x30(%rbp)
cmpq %rcx, %rdx
jne 0x2cf8
pushq $0x30
popq %r15
movq %r12, %rbx
pushq $0x1
popq %r12
addq %r15, %r14
movq -0x78(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x8c85
testl %eax, %eax
jne 0x2f7c
movslq 0x1c607(%rip), %rax     # 0x1f274
movq 0x1c5f4(%rip), %rcx     # 0x1f268
movslq 0x8(%rcx,%r15), %rsi
imulq %rax, %rsi
movq %r13, %rdi
movl %r12d, %edx
callq 0x2230
movq 0x1c5d9(%rip), %r14     # 0x1f268
movq -0x30(%rbp), %rax
cmpl %eax, 0x24(%r14,%r15)
jne 0x2f8c
incq %rbx
cmpl %ebx, 0x1c4d9(%rip)     # 0x1f180
jg 0x2cef
cvtsi2sd %ebx, %xmm0
mulsd 0x1635b(%rip), %xmm0    # 0x19010
addsd 0x1634b(%rip), %xmm0    # 0x19008
cvttsd2si %xmm0, %eax
movl %eax, 0x1c4b9(%rip)     # 0x1f180
cltq
imulq $0x30, %rax, %rsi
movq %r14, %rdi
leaq 0x16643(%rip), %rdx     # 0x1931a
callq 0x116d1
movq %rax, %r14
movq %rax, 0x1c582(%rip)     # 0x1f268
testq %rax, %rax
je 0x253a
addq $0x30, %r15
jmp 0x2c4c
movq -0x68(%rbp), %r8
cmpl $0x0, 0x1c4a9(%rip)     # 0x1f1ac
je 0x2d26
incq 0x1c4a4(%rip)           # 0x1f1b0
movq 0x1c545(%rip), %rax     # 0x1f258
movslq %r8d, %rcx
imulq $0x28, %rcx, %rcx
movslq 0x4(%rax,%rcx), %rax
addq %rax, 0x1c492(%rip)     # 0x1f1b8
movq %rbx, -0x90(%rbp)
testl %ebx, %ebx
je 0x2f48
movq 0x1c53c(%rip), %rax     # 0x1f278
movq -0x90(%rbp), %rbx
cmpl %ebx, 0x1c43b(%rip)     # 0x1f184
jge 0x2da3
cvtsi2sd %ebx, %xmm0
mulsd 0x162b9(%rip), %xmm0    # 0x19010
addsd 0x162b9(%rip), %xmm0    # 0x19018
cvttsd2si %xmm0, %ecx
movl %ecx, 0x1c41b(%rip)     # 0x1f184
movslq %ecx, %rsi
shlq $0x4, %rsi
movq %rax, %rdi
leaq 0x165b9(%rip), %rdx     # 0x19333
callq 0x116d1
movq %rax, 0x1c4f2(%rip)     # 0x1f278
testq %rax, %rax
je 0x253a
movslq 0x1c3ee(%rip), %rcx     # 0x1f184
leaq (%rax,%rcx,4), %rcx
movq %rcx, 0x1c4df(%rip)     # 0x1f280
jmp 0x2daa
movq 0x1c4d6(%rip), %rcx     # 0x1f280
movl 0x1c3f8(%rip), %edx     # 0x1f1a8
xorl %esi, %esi
testl %ebx, %ebx
movl $0x0, %edi
cmovgl %ebx, %edi
imulq $0x30, %rdi, %rdi
xorl %r15d, %r15d
movslq %r15d, %r12
cmpq %rsi, %rdi
je 0x2e06
movl 0x10(%r14,%rsi), %r8d
subl 0x1c(%r14,%rsi), %r8d
cmpl $0x14, %r8d
jg 0x2e00
movl 0x14(%r14,%rsi), %r8d
movl 0x18(%r14,%rsi), %r9d
subl %r8d, %r9d
cmpl %edx, %r9d
jle 0x2e00
movl %r8d, (%rax,%r12,4)
movl 0x18(%r14,%rsi), %r8d
movl %r8d, (%rcx,%r12,4)
incl %r12d
movl %r12d, %r15d
addq $0x30, %rsi
jmp 0x2dc3
movq %rax, %rdi
movq %r12, %rsi
pushq $0x4
popq %rbx
movq %rbx, %rdx
leaq 0x368(%rip), %r14       # 0x3181
movq %r14, %rcx
callq 0x20c0
movq 0x1c458(%rip), %rdi     # 0x1f280
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x20c0
xorl %esi, %esi
xorl %eax, %eax
xorl %ebx, %ebx
movl $0x0, -0x44(%rbp)
movl %esi, %esi
movl %eax, %edi
movslq %eax, %r13
shlq $0x2, %r13
movl %ebx, -0x7c(%rbp)
movl %ebx, %ebx
decq %rbx
xorl %r14d, %r14d
xorl %r12d, %r12d
movq %rsi, -0x30(%rbp)
movq %rdi, -0x60(%rbp)
leal (%rdi,%r12), %eax
cmpl %r15d, %eax
jge 0x2f48
cmpl %r15d, %esi
jge 0x2e90
movq 0x1c3fb(%rip), %rax     # 0x1f278
movl (%rax,%rsi,4), %ecx
movq 0x1c3f9(%rip), %rdx     # 0x1f280
addq %r13, %rdx
cmpl (%rdx,%r12,4), %ecx
jle 0x2efc
cmpl %r12d, %ebx
jne 0x2ef0
movq 0x1c3e4(%rip), %rdi     # 0x1f280
addq %r13, %rdi
addq %r14, %rdi
movq 0x1c33f(%rip), %rcx     # 0x1f1e8
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
movq -0x60(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x4, 0x1c32c(%rip)     # 0x1f1f0
cmpl $0x0, 0x1c2e1(%rip)     # 0x1f1ac
je 0x2ef0
movq 0x1c3ac(%rip), %rax     # 0x1f280
addq %r13, %rax
movslq (%rax,%r12,4), %rax
movslq -0x44(%rbp), %rcx
subq %rcx, %rax
addq %rax, 0x1c2d7(%rip)     # 0x1f1c0
incq 0x1c2d8(%rip)           # 0x1f1c8
incq %r12
addq $0x4, %r14
jmp 0x2e64
movl -0x7c(%rbp), %ebx
cmpl %r12d, %ebx
jne 0x2f37
leaq (%rax,%rsi,4), %rdi
movq 0x1c2d9(%rip), %rcx     # 0x1f1e8
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
movq -0x60(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x4, 0x1c2c6(%rip)     # 0x1f1f0
movq 0x1c347(%rip), %rax     # 0x1f278
movl (%rax,%rsi,4), %eax
movl %eax, -0x44(%rbp)
addq %r12, %rdi
subl %r12d, %ebx
incl %ebx
incl %esi
movl %edi, %eax
jmp 0x2e43
movq 0x1c291(%rip), %rcx     # 0x1f1e0
leaq 0x1c29a(%rip), %rdi     # 0x1f1f0
pushq $0x8
popq %rsi
pushq $0x1
popq %r12
movq %r12, %rdx
callq 0x22b0
movq -0x68(%rbp), %rdx
incq %rdx
movq -0x38(%rbp), %r15
movq -0x90(%rbp), %rax
jmp 0x2bec
movq 0x1c2e5(%rip), %r14     # 0x1f268
movl $0x7fffffff, 0x24(%r14,%r15) # imm = 0x7FFFFFFF
leaq 0x8(%r14), %rax
xorl %ecx, %ecx
movq %rbx, %rdx
movq -0x68(%rbp), %r8
subq $0x1, %rdx
jb 0x2cfc
movslq %ecx, %rcx
leaq (%rcx,%rcx), %rsi
movq %rsi, -0x8(%rax)
addl (%rax), %ecx
addq $0x30, %rax
jmp 0x2f99
cmpl $0x7fffffff, 0x24(%r14,%rax) # imm = 0x7FFFFFFF
jne 0x3032
movq 0x1c218(%rip), %rdi     # 0x1f1e0
callq 0x20e0
movq 0x1c214(%rip), %rdi     # 0x1f1e8
callq 0x20e0
movq -0x78(%rbp), %rdi
callq 0x20e0
leaq -0x80(%rbp), %r12
movq -0xb0(%rbp), %rbx
jmp 0x277e
movq %rbx, %rdi
callq 0x15d56
movq -0xa0(%rbp), %rax
incq %rax
jmp 0x2757
movq 0x1bfe8(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
leaq 0x1c26e(%rip), %rax     # 0x1f288
movq (%rax), %rdx
leaq 0x1618c(%rip), %rsi     # 0x191b0
xorl %eax, %eax
callq 0x21c0
pushq $0x2
jmp 0x253c
movq 0x1bfbf(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
leaq 0x1c245(%rip), %rax     # 0x1f288
movq (%rax), %rdx
movl 0x1c184(%rip), %ecx     # 0x1f1d0
leaq 0x16283(%rip), %rsi     # 0x192d6
jmp 0x2533
cmpl $0x0, 0x1c14d(%rip)     # 0x1f1ac
je 0x314d
leaq 0x161a5(%rip), %rdi     # 0x19211
xorl %eax, %eax
callq 0x2120
movq 0x1c136(%rip), %rdi     # 0x1f1b0
movq 0x1bf57(%rip), %r15     # 0x1efd8
movq (%r15), %rdx
pushq $0x7
popq %r14
movl %r14d, %esi
callq 0x11b09
leaq 0x16186(%rip), %rdi     # 0x1921d
xorl %eax, %eax
callq 0x2120
movq 0x1c113(%rip), %rdi     # 0x1f1b8
movq (%r15), %rdx
pushq $0xc
popq %rbx
movl %ebx, %esi
callq 0x11b09
leaq 0x1617a(%rip), %rdi     # 0x19233
xorl %eax, %eax
callq 0x2120
leaq 0x1617e(%rip), %rdi     # 0x19245
xorl %eax, %eax
callq 0x2120
movq 0x1c0f3(%rip), %rdi     # 0x1f1c8
movq (%r15), %rdx
movl %r14d, %esi
callq 0x11b09
cvtsi2sdq 0x1c0df(%rip), %xmm0 # 0x1f1c8
movsd 0x15f17(%rip), %xmm1    # 0x19008
mulsd %xmm1, %xmm0
cvtsi2sdq 0x1c0b2(%rip), %xmm1 # 0x1f1b0
divsd %xmm1, %xmm0
leaq 0x16147(%rip), %rdi     # 0x19250
movb $0x1, %al
callq 0x2120
movq 0x1c0a9(%rip), %rdi     # 0x1f1c0
movq (%r15), %rdx
movl %ebx, %esi
callq 0x11b09
cvtsi2sdq 0x1c096(%rip), %xmm0 # 0x1f1c0
mulsd 0x15ed6(%rip), %xmm0    # 0x19008
cvtsi2sdq 0x1c07d(%rip), %xmm1 # 0x1f1b8
divsd %xmm1, %xmm0
leaq 0x16120(%rip), %rdi     # 0x19266
movb $0x1, %al
callq 0x2120
movq -0x58(%rbp), %rdi
callq 0x2030
movq -0x50(%rbp), %rdi
callq 0x2030
leaq 0x1c092(%rip), %rdi     # 0x1f1f8
callq 0x1357b
leaq 0x1c116(%rip), %rax     # 0x1f288
movq (%rax), %rdi
callq 0x2030
xorl %edi, %edi
callq 0x22a0