// File: /workspace/github_c_makefile_star2_O1/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 $0x4f08, %rsp           # imm = 0x4F08
movq %rsi, %r13
movl %edi, %r14d
leaq 0x17ae3(%rip), %rdi     # 0x1b020
leaq 0x188c2(%rip), %rsi     # 0x1be06
callq 0x12dfa
leaq 0x1dd38(%rip), %rcx     # 0x21288
movq %rax, (%rcx)
leaq -0x4f30(%rbp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x2150
movl $0x1f4, 0x1dc38(%rip)   # imm = 0x1F4
cmpl $0x2, %r14d
movq %r13, -0x68(%rbp)
jl 0x367a
movl %r14d, %r15d
movl $0x1, %ecx
leaq 0x17a9b(%rip), %rax     # 0x1b028
movq %rax, -0x60(%rbp)
movl $0x1, %ebx
leaq 0x17a8f(%rip), %r12     # 0x1b02c
movq (%r13,%rbx,8), %r14
cmpb $0x2d, (%r14)
jne 0x35c4
movzbl 0x1(%r14), %eax
cmpl $0x6c, %eax
je 0x35d3
cmpl $0x6e, %eax
jne 0x3626
addq $0x2, %r14
movq %r14, -0x60(%rbp)
jmp 0x366c
movslq %ecx, %rax
incl %ecx
movq %r14, (%r13,%rax,8)
jmp 0x366c
movq %r15, %r12
movl %ecx, %r15d
addq $0x2, %r14
movq %r14, %rdi
leaq -0x38(%rbp), %rsi
movl $0xa, %edx
callq 0x21e0
movl %eax, 0x1dbb4(%rip)     # 0x211a8
movq -0x38(%rbp), %rcx
cmpb $0x0, (%rcx)
jne 0x4295
movq (%r13,%rbx,8), %rcx
cmpb $0x0, 0x2(%rcx)
je 0x4295
testl %eax, %eax
movl %r15d, %ecx
movq %r12, %r15
leaq 0x17a0d(%rip), %r12     # 0x1b02c
jg 0x366c
jmp 0x42f3
movb 0x1(%r14), %al
testb %al, %al
je 0x366c
movl %ecx, -0x30(%rbp)
addq $0x2, %r14
movsbl %al, %r13d
movq %r12, %rdi
movl %r13d, %esi
callq 0x2160
testq %rax, %rax
je 0x3725
movslq %r13d, %rax
movl $0x1, -0x4f30(%rbp,%rax,4)
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x3635
movq -0x68(%rbp), %r13
movl -0x30(%rbp), %ecx
incq %rbx
cmpq %r15, %rbx
jne 0x359d
jmp 0x368a
leaq 0x179a7(%rip), %rax     # 0x1b028
movq %rax, -0x60(%rbp)
movl $0x1, %ecx
movl -0x4d58(%rbp), %eax
movl %eax, 0x1db16(%rip)     # 0x211ac
cmpl $0x2, %ecx
jg 0x374f
movq 0x1d952(%rip), %rbx     # 0x20ff8
movq (%rbx), %rdi
leaq 0x1dbd8(%rip), %rax     # 0x21288
movq (%rax), %rdx
leaq 0x179f9(%rip), %rsi     # 0x1b0b3
leaq 0x17bb7(%rip), %rcx     # 0x1b278
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x2190
movq (%rbx), %rcx
leaq 0x179e2(%rip), %rdi     # 0x1b0c1
movl $0x36, %esi
movl $0x1, %edx
callq 0x22b0
movq (%rbx), %rcx
leaq 0x17a00(%rip), %rdi     # 0x1b0f8
movl $0x2e, %esi
movl $0x1, %edx
callq 0x22b0
movq (%rbx), %rcx
leaq 0x17a16(%rip), %rdi     # 0x1b127
movl $0x35, %esi
movl $0x1, %edx
callq 0x22b0
jmp 0x431f
movq 0x1d8cc(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1db52(%rip), %rax     # 0x21288
movq (%rax), %rdx
leaq 0x178ee(%rip), %rsi     # 0x1b02e
movl %r13d, %ecx
xorl %eax, %eax
callq 0x21c0
jmp 0x431f
movl %ecx, -0x30(%rbp)
movq 0x8(%r13), %rdi
leaq 0x1da9b(%rip), %rsi     # 0x211f8
callq 0x13cf8
testl %eax, %eax
js 0x431f
cmpl $0x0, 0x1dabf(%rip)     # 0x21230
jne 0x426a
movl %eax, %r12d
leaq 0x1da77(%rip), %rdi     # 0x211f8
callq 0x144bd
cmpl $0x0, 0x1da1f(%rip)     # 0x211ac
je 0x37fa
xorl %eax, %eax
movq %rax, 0x1da18(%rip)     # 0x211b0
movq %rax, 0x1da19(%rip)     # 0x211b8
movq %rax, 0x1da1a(%rip)     # 0x211c0
movq %rax, 0x1da1b(%rip)     # 0x211c8
movl 0x1d9f5(%rip), %esi     # 0x211a8
movq 0x8(%r13), %rcx
leaq 0x179c4(%rip), %rdi     # 0x1b182
movq -0x60(%rbp), %rdx
xorl %eax, %eax
callq 0x2120
movl -0x30(%rbp), %ebx
movl $0x2, %r15d
leaq 0x179bb(%rip), %r14     # 0x1b194
movq (%r13,%r15,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2120
incq %r15
cmpq %r15, %rbx
jne 0x37d9
movl $0xa, %edi
callq 0x2040
movq 0x8(%r13), %rdi
callq 0x12eb6
movq %rax, -0x50(%rbp)
testl %r12d, %r12d
movq 0x8(%r13), %rdi
leaq 0x17988(%rip), %rax     # 0x1b19d
leaq 0x1797c(%rip), %rsi     # 0x1b198
cmoveq %rax, %rsi
movq %rsi, -0x90(%rbp)
callq 0x12f10
movq %rax, -0x48(%rbp)
movl -0x30(%rbp), %ecx
cmpl $0x4, %ecx
movl $0x3, %eax
cmovgel %ecx, %eax
movq %rax, -0x80(%rbp)
movl $0x2, %eax
movq %rax, -0x88(%rbp)
movq (%r13,%rax,8), %rdi
callq 0x1773f
movq %rax, %r14
movq %rax, %rdi
callq 0x17572
movq %rax, -0x58(%rbp)
testq %rax, %rax
je 0x4119
movq %r14, -0x78(%rbp)
xorl %eax, %eax
movl %eax, 0x1d954(%rip)     # 0x211d0
movl %eax, 0x1d952(%rip)     # 0x211d4
movl 0x1d9a0(%rip), %eax     # 0x21228
movl %eax, 0x1d94a(%rip)     # 0x211d8
movq %r14, %rdi
callq 0x17626
movq %rax, %rdi
movl $0x2e, %esi
callq 0x2280
testq %rax, %rax
je 0x3a24
movq %rax, %r14
incq %r14
movq %r14, %rdi
leaq -0x38(%rbp), %rsi
movl $0xa, %edx
callq 0x21e0
movq %rax, %rbx
movq -0x38(%rbp), %rax
cmpq %r14, %rax
je 0x3a24
cmpb $0x0, (%rax)
jne 0x3a24
movq -0x50(%rbp), %rdi
leaq 0x178ba(%rip), %rsi     # 0x1b1a1
movq -0x48(%rbp), %rdx
movq -0x90(%rbp), %rcx
callq 0x12fd5
movq %rax, %rdi
leaq 0x188fc(%rip), %rsi     # 0x1c1fd
callq 0x12e59
testq %rax, %rax
je 0x431f
movq %rax, %r15
movq %rax, %rdi
leaq 0x17887(%rip), %rsi     # 0x1b1a3
leaq -0x40(%rbp), %rdx
xorl %eax, %eax
callq 0x20a0
cmpl $0x1, %eax
jne 0x42c7
movq %rbx, -0x30(%rbp)
cmpl $0x0, -0x40(%rbp)
leaq -0x4f30(%rbp), %r14
leaq 0x178be(%rip), %r12     # 0x1b204
leaq -0x94(%rbp), %r13
jle 0x3971
xorl %ebx, %ebx
movq %r14, %rdi
movl $0x4e84, %esi           # imm = 0x4E84
movq %r15, %rdx
callq 0x21a0
testq %rax, %rax
je 0x42c7
incl %ebx
cmpl -0x40(%rbp), %ebx
jl 0x3951
movq %r15, %rdi
leaq 0x17855(%rip), %rsi     # 0x1b1d0
leaq -0xa0(%rbp), %rdx
xorl %eax, %eax
callq 0x20a0
cmpl $0x1, %eax
jne 0x42c7
movq %r15, %rdi
leaq 0x17842(%rip), %rsi     # 0x1b1de
leaq -0xa8(%rbp), %rdx
leaq -0x9c(%rbp), %rcx
leaq -0x98(%rbp), %r8
xorl %eax, %eax
callq 0x20a0
cmpl $0x3, %eax
jne 0x42c7
movq -0x30(%rbp), %rax
movl %eax, %ebx
testl %eax, %eax
leaq 0x1d804(%rip), %r14     # 0x211d4
jle 0x39f2
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x20a0
cmpl $0x2, %eax
jne 0x42c7
decl %ebx
jne 0x39d2
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
leaq 0x1d7d6(%rip), %rcx     # 0x211d8
xorl %eax, %eax
callq 0x20a0
cmpl $0x2, %eax
jne 0x42c7
movq %r15, %rdi
callq 0x20e0
movq -0x30(%rbp), %rax
movl %eax, 0x1d7ac(%rip)     # 0x211d0
movq -0x60(%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 0x17855(%rip), %r12     # 0x1b2ba
movq %r12, %rdi
movq %rbx, %rsi
movq %r12, %rdx
leaq 0x1829b(%rip), %rcx     # 0x1bd10
callq 0x12fd5
movq %r14, %rdi
movq %rax, %rsi
callq 0x2080
movq %r12, %rdi
movq %rbx, %rsi
movq %r12, %rdx
leaq 0x182f3(%rip), %rcx     # 0x1bd88
callq 0x12fd5
movq %r15, %rdi
movq %rax, %rsi
callq 0x2080
movl 0x1d725(%rip), %esi     # 0x211d0
testl %esi, %esi
jle 0x3b13
movq %r12, %rdi
movq %r14, %rdx
callq 0x130c5
movq -0x50(%rbp), %rbx
movq %rbx, %rdi
leaq 0x17746(%rip), %rsi     # 0x1b20e
movq -0x48(%rbp), %r14
movq %r14, %rdx
movq %rax, %rcx
callq 0x12fd5
movq %rax, %rdi
leaq 0x18136(%rip), %r13     # 0x1bc17
movq %r13, %rsi
callq 0x12e59
movq %rax, 0x1d6f0(%rip)     # 0x211e0
movl 0x1d6da(%rip), %esi     # 0x211d0
movq %r12, %rdi
movq %r15, %rdx
callq 0x130c5
movq %rbx, %rdi
leaq 0x17703(%rip), %rsi     # 0x1b20e
movq %r14, %rdx
movq %rax, %rcx
jmp 0x3b59
movq -0x50(%rbp), %rbx
movq %rbx, %rdi
leaq 0x176ed(%rip), %rsi     # 0x1b20e
movq -0x48(%rbp), %r12
movq %r12, %rdx
movq %r14, %rcx
callq 0x12fd5
movq %rax, %rdi
leaq 0x180dd(%rip), %r13     # 0x1bc17
movq %r13, %rsi
callq 0x12e59
movq %rax, 0x1d697(%rip)     # 0x211e0
movq %rbx, %rdi
leaq 0x176bb(%rip), %rsi     # 0x1b20e
movq %r12, %rdx
movq %r15, %rcx
callq 0x12fd5
movq %rax, %rdi
movq %r13, %rsi
callq 0x12e59
movq %rax, 0x1d678(%rip)     # 0x211e8
movq 0x1d669(%rip), %rcx     # 0x211e0
testq %rcx, %rcx
movq -0x78(%rbp), %r14
je 0x431f
testq %rax, %rax
je 0x431f
movl 0x1d645(%rip), %eax     # 0x211d8
subl 0x1d63b(%rip), %eax     # 0x211d4
movl %eax, -0x4f30(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x4, %esi
movl $0x1, %edx
leaq -0x4f30(%rbp), %rbx
movq %rbx, %rdi
callq 0x22b0
movq 0x1d61a(%rip), %rcx     # 0x211e0
movl $0x4, %esi
movl $0x1, %edx
leaq -0x38(%rbp), %rdi
callq 0x22b0
movq $0x0, 0x1d60c(%rip) # 0x211f0
movq 0x1d5f5(%rip), %rcx     # 0x211e0
movl $0x8, %esi
movl $0x1, %edx
leaq 0x1d5f4(%rip), %rdi     # 0x211f0
callq 0x22b0
movq -0x30(%rbp), %rsp
cmpq $0x0, 0x1d65b(%rip)     # 0x21268
jne 0x3c3a
movslq 0x1d56a(%rip), %rax     # 0x21180
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdi
leaq 0x17697(%rip), %rsi     # 0x1b2bc
callq 0x12d3d
movq %rax, 0x1d637(%rip)     # 0x21268
testq %rax, %rax
je 0x431f
movq -0x58(%rbp), %r15
movq %r15, %rdi
callq 0x2130
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rcx
callq 0x20d0
movl $0x4, %esi
movl $0x1, %edx
leaq 0x1d604(%rip), %rdi     # 0x21270
movq %r15, %rcx
callq 0x20d0
xorl %eax, %eax
cmpl $0x7e, 0x1d5f3(%rip)    # 0x21270
setge %al
incl %eax
movl %eax, 0x1d5ec(%rip)     # 0x21274
movq 0x1d5d9(%rip), %rsi     # 0x21268
movq %r15, %rdi
callq 0xa1a0
testl %eax, %eax
je 0x3cab
movq 0x1d5c6(%rip), %rax     # 0x21268
movl $0x7fffffff, 0x24(%rax) # imm = 0x7FFFFFFF
jmp 0x3cce
movslq 0x1d5c2(%rip), %rax     # 0x21274
movq 0x1d5af(%rip), %rcx     # 0x21268
movslq 0x8(%rcx), %rsi
imulq %rax, %rsi
movq %r15, %rdi
movl $0x1, %edx
callq 0x2230
movq -0x68(%rbp), %r13
movq 0x1d58f(%rip), %rax     # 0x21268
movslq 0x1d4f4(%rip), %r15     # 0x211d4
cmpl %r15d, 0x24(%rax)
jl 0x4329
cmpl 0x1d4e7(%rip), %r15d    # 0x211d8
jge 0x40bc
xorl %eax, %eax
movq 0x1d568(%rip), %rsi     # 0x21268
cltq
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movupd (%rsi,%rax), %xmm0
movupd 0x10(%rsi,%rax), %xmm1
movups 0x20(%rsi,%rax), %xmm2
movups %xmm2, 0x20(%rsi)
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
movslq 0x24(%rsi), %r14
movl $0x0, %edi
cmpq %r14, %r15
movq %r15, -0x70(%rbp)
jne 0x3e4f
addq $0x30, %rsi
movq -0x58(%rbp), %r13
movq %r13, %rdi
callq 0xa1a0
movl $0x1, %ebx
testl %eax, %eax
je 0x3d60
movl $0x1, %edi
jmp 0x3e15
movl $0x60, %r15d
leaq 0x175ad(%rip), %r12     # 0x1b31a
movslq 0x1d500(%rip), %rax     # 0x21274
movq 0x1d4ed(%rip), %rcx     # 0x21268
movslq -0x28(%rcx,%r15), %rsi
imulq %rax, %rsi
movq %r13, %rdi
movl $0x1, %edx
callq 0x2230
movq 0x1d4d0(%rip), %rdi     # 0x21268
cmpl %r14d, -0xc(%rdi,%r15)
jne 0x40b1
incq %rbx
cmpl %ebx, 0x1d3d4(%rip)     # 0x21180
jg 0x3df1
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd 0x1724b(%rip), %xmm0    # 0x1b008
addsd 0x1724b(%rip), %xmm0    # 0x1b010
cvttsd2si %xmm0, %eax
movl %eax, 0x1d3b1(%rip)     # 0x21180
cltq
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
movq %r12, %rdx
callq 0x12d95
movq %rax, 0x1d480(%rip)     # 0x21268
testq %rax, %rax
je 0x431f
movq 0x1d470(%rip), %rsi     # 0x21268
addq %r15, %rsi
movq %r13, %rdi
callq 0xa1a0
addq $0x30, %r15
testl %eax, %eax
je 0x3d6d
movl %ebx, %edi
movq -0x70(%rbp), %r15
movq 0x1d44c(%rip), %rax     # 0x21268
leaq (%rbx,%rbx,2), %rcx
shlq $0x4, %rcx
movl $0x7fffffff, 0x24(%rax,%rcx) # imm = 0x7FFFFFFF
movq 0x1d435(%rip), %rax     # 0x21268
addq $0x8, %rax
xorl %ecx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx), %rdx
movq %rdx, -0x8(%rax)
addl (%rax), %ecx
addq $0x30, %rax
decq %rbx
jne 0x3e39
movq 0x1d412(%rip), %r14     # 0x21268
cmpl $0x0, 0x1d34f(%rip)     # 0x211ac
je 0x3e80
incq 0x1d34a(%rip)           # 0x211b0
movq 0x1d3eb(%rip), %rax     # 0x21258
movslq %r15d, %rcx
leaq (%rcx,%rcx,4), %rcx
movslq 0x4(%rax,%rcx,8), %rax
addq %rax, 0x1d338(%rip)     # 0x211b8
movl %edi, -0x3c(%rbp)
testl %edi, %edi
je 0x4074
movl -0x3c(%rbp), %ebx
cmpl %ebx, 0x1d2f0(%rip)     # 0x21184
jge 0x3ef3
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd 0x17163(%rip), %xmm0    # 0x1b008
addsd 0x1716b(%rip), %xmm0    # 0x1b018
cvttsd2si %xmm0, %eax
movl %eax, 0x1d2cd(%rip)     # 0x21184
movq 0x1d3ba(%rip), %rdi     # 0x21278
movslq %eax, %rsi
shlq $0x4, %rsi
leaq 0x17467(%rip), %rdx     # 0x1b333
callq 0x12d95
movq %rax, 0x1d3a0(%rip)     # 0x21278
testq %rax, %rax
je 0x431f
movslq 0x1d29c(%rip), %rcx     # 0x21184
leaq (%rax,%rcx,4), %rax
movq %rax, 0x1d38d(%rip)     # 0x21280
testl %ebx, %ebx
jle 0x3f58
movl 0x1d2ab(%rip), %eax     # 0x211a8
movq 0x1d374(%rip), %rcx     # 0x21278
movq 0x1d375(%rip), %rdx     # 0x21280
movl %ebx, %esi
shlq $0x4, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %ebx, %ebx
movl 0x10(%r14,%rdi), %r8d
subl 0x1c(%r14,%rdi), %r8d
cmpl $0x14, %r8d
jg 0x3f4d
movl 0x14(%r14,%rdi), %r8d
movl 0x18(%r14,%rdi), %r9d
subl %r8d, %r9d
cmpl %eax, %r9d
jle 0x3f4d
movslq %ebx, %rbx
movl %r8d, (%rcx,%rbx,4)
movl 0x18(%r14,%rdi), %r8d
movl %r8d, (%rdx,%rbx,4)
incl %ebx
addq $0x30, %rdi
cmpq %rdi, %rsi
jne 0x3f19
jmp 0x3f5a
xorl %ebx, %ebx
movq 0x1d317(%rip), %rdi     # 0x21278
movslq %ebx, %r14
movl $0x4, %edx
movq %r14, %rsi
leaq 0x3dc(%rip), %r15       # 0x434f
movq %r15, %rcx
callq 0x20c0
movq 0x1d2fe(%rip), %rdi     # 0x21280
movl $0x4, %edx
movq %r14, %rsi
movq %r15, %rcx
callq 0x20c0
testl %r14d, %r14d
jle 0x4074
movl $0x0, -0x30(%rbp)
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpl %ebx, %r13d
jge 0x3fcd
movq 0x1d2c1(%rip), %rax     # 0x21278
movslq %r13d, %r15
movl (%rax,%r15,4), %ecx
movq 0x1d2bb(%rip), %rdx     # 0x21280
movslq %r12d, %rsi
cmpl (%rdx,%rsi,4), %ecx
jle 0x4030
decl %r14d
jne 0x402b
movslq %r12d, %r15
leaq (,%r15,4), %rdi
addq 0x1d29c(%rip), %rdi     # 0x21280
movq 0x1d1fd(%rip), %rcx     # 0x211e8
movl $0x4, %esi
movl $0x1, %edx
callq 0x22b0
addq $0x4, 0x1d1ee(%rip)     # 0x211f0
cmpl $0x0, 0x1d1a3(%rip)     # 0x211ac
je 0x402b
movq 0x1d26e(%rip), %rax     # 0x21280
movslq (%rax,%r15,4), %rax
movslq -0x30(%rbp), %rcx
subq %rcx, %rax
addq %rax, 0x1d19c(%rip)     # 0x211c0
incq 0x1d19d(%rip)           # 0x211c8
incl %r12d
jmp 0x406b
testl %r14d, %r14d
jne 0x4065
leaq (%rax,%r15,4), %rdi
movq 0x1d1a8(%rip), %rcx     # 0x211e8
movl $0x4, %esi
movl $0x1, %edx
callq 0x22b0
addq $0x4, 0x1d199(%rip)     # 0x211f0
movq 0x1d21a(%rip), %rax     # 0x21278
movl (%rax,%r15,4), %eax
movl %eax, -0x30(%rbp)
incl %r14d
incl %r13d
cmpl %ebx, %r12d
jl 0x3fab
movq 0x1d165(%rip), %rcx     # 0x211e0
movl $0x8, %esi
movl $0x1, %edx
leaq 0x1d164(%rip), %rdi     # 0x211f0
callq 0x22b0
movq -0x70(%rbp), %r15
incq %r15
movslq 0x1d139(%rip), %rax     # 0x211d8
cmpq %rax, %r15
movq -0x68(%rbp), %r13
movl -0x3c(%rbp), %eax
jl 0x3cf9
jmp 0x40c0
movl %ebx, %edi
movq -0x70(%rbp), %r15
jmp 0x3e2c
xorl %eax, %eax
jmp 0x40c6
cltq
movq -0x78(%rbp), %r14
movq 0x1d19b(%rip), %rcx     # 0x21268
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
cmpl $0x7fffffff, 0x24(%rcx,%rax) # imm = 0x7FFFFFFF
jne 0x4329
movq 0x1d0f6(%rip), %rdi     # 0x211e0
callq 0x20e0
movq 0x1d0f2(%rip), %rdi     # 0x211e8
callq 0x20e0
movq -0x58(%rbp), %rdi
callq 0x20e0
movq %r14, %rdi
callq 0x17572
movq %rax, -0x58(%rbp)
testq %rax, %rax
jne 0x3874
movq %r14, %rdi
callq 0x17651
movq -0x88(%rbp), %rax
incq %rax
cmpq -0x80(%rbp), %rax
jne 0x3847
cmpl $0x0, 0x1d070(%rip)     # 0x211ac
je 0x4236
leaq 0x170c8(%rip), %rdi     # 0x1b211
xorl %eax, %eax
callq 0x2120
movq 0x1d059(%rip), %rdi     # 0x211b0
movq 0x1ce7a(%rip), %rbx     # 0x20fd8
movq (%rbx), %rdx
movl $0x7, %esi
callq 0x13178
leaq 0x170ab(%rip), %rdi     # 0x1b21d
xorl %eax, %eax
callq 0x2120
movq 0x1d038(%rip), %rdi     # 0x211b8
movq (%rbx), %rdx
movl $0xc, %esi
callq 0x13178
leaq 0x1709f(%rip), %rdi     # 0x1b233
xorl %eax, %eax
callq 0x2120
leaq 0x170a3(%rip), %rdi     # 0x1b245
xorl %eax, %eax
callq 0x2120
movq 0x1d018(%rip), %rdi     # 0x211c8
movq (%rbx), %rdx
movl $0x7, %esi
callq 0x13178
cvtsi2sdq 0x1d002(%rip), %xmm0 # 0x211c8
movsd 0x16e42(%rip), %xmm1    # 0x1b010
mulsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x1cfd2(%rip), %xmm1 # 0x211b0
divsd %xmm1, %xmm0
leaq 0x17067(%rip), %rdi     # 0x1b250
movb $0x1, %al
callq 0x2120
movq 0x1cfc9(%rip), %rdi     # 0x211c0
movq (%rbx), %rdx
movl $0xc, %esi
callq 0x13178
xorps %xmm0, %xmm0
cvtsi2sdq 0x1cfb0(%rip), %xmm0 # 0x211c0
mulsd 0x16df8(%rip), %xmm0    # 0x1b010
xorps %xmm1, %xmm1
cvtsi2sdq 0x1cf94(%rip), %xmm1 # 0x211b8
divsd %xmm1, %xmm0
leaq 0x17037(%rip), %rdi     # 0x1b266
movb $0x1, %al
callq 0x2120
movq -0x50(%rbp), %rdi
callq 0x2030
movq -0x48(%rbp), %rdi
callq 0x2030
leaq 0x1cfa9(%rip), %rdi     # 0x211f8
callq 0x14cd0
leaq 0x1d02d(%rip), %rax     # 0x21288
movq (%rax), %rdi
callq 0x2030
xorl %edi, %edi
callq 0x22a0
movq 0x1cd87(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1d00d(%rip), %rax     # 0x21288
movq (%rax), %rdx
movq 0x8(%r13), %rcx
leaq 0x16ed4(%rip), %rsi     # 0x1b15d
xorl %eax, %eax
callq 0x21c0
jmp 0x431f
movq 0x1cd5c(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1cfe2(%rip), %rax     # 0x21288
movq (%rax), %rdx
movq (%r13,%rbx,8), %r8
movsbl 0x1(%r8), %ecx
addq $0x2, %r8
leaq 0x16d8e(%rip), %rsi     # 0x1b04c
xorl %eax, %eax
callq 0x21c0
jmp 0x431f
movq 0x1cd2a(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1cfb0(%rip), %rax     # 0x21288
movq (%rax), %rdx
leaq 0x16ece(%rip), %rsi     # 0x1b1b0
xorl %eax, %eax
callq 0x21c0
movl $0x2, %edi
callq 0x22a0
movq 0x1ccfe(%rip), %rcx     # 0x20ff8
movq (%rcx), %rdi
leaq 0x1cf84(%rip), %rcx     # 0x21288
movq (%rcx), %rdx
leaq 0x16d67(%rip), %rsi     # 0x1b075
leaq 0x16d7e(%rip), %rcx     # 0x1b093
movl %eax, %r8d
xorl %eax, %eax
callq 0x21c0
movl $0x1, %edi
callq 0x22a0
movq 0x1ccc8(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1cf4e(%rip), %rax     # 0x21288
movq (%rax), %rdx
movl 0x1ce8d(%rip), %ecx     # 0x211d0
leaq 0x16f8c(%rip), %rsi     # 0x1b2d6
jmp 0x3743