// File: /workspace/github_c_makefile_star2_O3/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 $0x4f18, %rsp           # imm = 0x4F18
movq %rsi, -0x60(%rbp)
movl %edi, %r14d
leaq 0x17b52(%rip), %rdi     # 0x1b020
leaq 0x18991(%rip), %rsi     # 0x1be66
callq 0x12da2
leaq 0x1dda7(%rip), %rcx     # 0x21288
movq %rax, (%rcx)
leaq -0x4f40(%rbp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x2150
movl $0x1f4, 0x1dca7(%rip)   # imm = 0x1F4
cmpl $0x1, %r14d
jle 0x3619
movl %r14d, %ecx
movl $0x1, %r15d
leaq 0x17b0d(%rip), %rax     # 0x1b028
movq %rax, -0x78(%rbp)
movl $0x1, %ebx
leaq 0x17b01(%rip), %r12     # 0x1b02c
movq -0x60(%rbp), %r14
movq %rcx, -0x30(%rbp)
movq (%r14,%rbx,8), %r13
cmpb $0x2d, (%r13)
jne 0x3596
movzbl 0x1(%r13), %eax
testl %eax, %eax
je 0x35a0
addq $0x2, %r13
cmpl $0x6c, %eax
je 0x35ad
cmpl $0x6e, %eax
jne 0x355b
movq %r13, -0x78(%rbp)
jmp 0x35a0
movsbl %al, %r14d
movq %r12, %rdi
movl %r14d, %esi
callq 0x2160
testq %rax, %rax
je 0x36a6
movslq %r14d, %rax
movl $0x1, -0x4f40(%rbp,%rax,4)
movb (%r13), %al
incq %r13
testb %al, %al
jne 0x355b
movq -0x60(%rbp), %r14
movq -0x30(%rbp), %rcx
jmp 0x35a0
movslq %r15d, %rax
incl %r15d
movq %r13, (%r14,%rax,8)
incq %rbx
cmpq %rcx, %rbx
jne 0x3533
jmp 0x36d5
movq %r13, %rdi
leaq -0x38(%rbp), %rsi
movl $0xa, %edx
callq 0x21e0
movl %eax, 0x1dbe4(%rip)     # 0x211a8
movq -0x38(%rbp), %rcx
cmpb $0x0, (%rcx)
movq (%r14,%rbx,8), %r8
jne 0x420d
cmpb $0x0, 0x2(%r8)
je 0x420d
testl %eax, %eax
movq -0x30(%rbp), %rcx
jg 0x35a0
movq 0x1da09(%rip), %rcx     # 0x20ff8
movq (%rcx), %rdi
leaq 0x1dc8f(%rip), %rcx     # 0x21288
movq (%rcx), %rdx
leaq 0x17a72(%rip), %rsi     # 0x1b075
leaq 0x17a89(%rip), %rcx     # 0x1b093
movl %eax, %r8d
xorl %eax, %eax
callq 0x21c0
jmp 0x36cb
movl $0x0, 0x1db89(%rip)     # 0x211ac
movq 0x1d9ce(%rip), %rbx     # 0x20ff8
movq (%rbx), %rdi
leaq 0x1dc54(%rip), %rax     # 0x21288
movq (%rax), %rdx
leaq 0x17a75(%rip), %rsi     # 0x1b0b3
leaq 0x17c33(%rip), %rcx     # 0x1b278
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x2190
movq (%rbx), %rcx
leaq 0x17a5e(%rip), %rdi     # 0x1b0c1
movl $0x36, %esi
movl $0x1, %edx
callq 0x22b0
movq (%rbx), %rcx
leaq 0x17a7c(%rip), %rdi     # 0x1b0f8
movl $0x2e, %esi
movl $0x1, %edx
callq 0x22b0
movq (%rbx), %rcx
leaq 0x17a92(%rip), %rdi     # 0x1b127
movl $0x35, %esi
movl $0x1, %edx
callq 0x22b0
jmp 0x36cb
movq 0x1d94b(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1dbd1(%rip), %rax     # 0x21288
movq (%rax), %rdx
leaq 0x1796d(%rip), %rsi     # 0x1b02e
movl %r14d, %ecx
xorl %eax, %eax
callq 0x21c0
movl $0x1, %edi
callq 0x22a0
movl -0x4d68(%rbp), %eax
movl %eax, 0x1dacb(%rip)     # 0x211ac
cmpl $0x2, %r15d
jle 0x3623
movq 0x8(%r14), %rdi
leaq 0x1db02(%rip), %rsi     # 0x211f8
callq 0x13d6b
testl %eax, %eax
js 0x36cb
cmpl $0x0, 0x1db2a(%rip)     # 0x21230
jne 0x423d
movl %eax, %r12d
leaq 0x1dae2(%rip), %rdi     # 0x211f8
callq 0x14574
cmpl $0x0, 0x1da8a(%rip)     # 0x211ac
movl %r15d, %r15d
je 0x3799
xorl %eax, %eax
movq %rax, 0x1da80(%rip)     # 0x211b0
movq %rax, 0x1da81(%rip)     # 0x211b8
movq %rax, 0x1da82(%rip)     # 0x211c0
movq %rax, 0x1da83(%rip)     # 0x211c8
movl 0x1da5d(%rip), %esi     # 0x211a8
movq 0x8(%r14), %rcx
leaq 0x17a2c(%rip), %rdi     # 0x1b182
movq -0x78(%rbp), %rdx
xorl %eax, %eax
callq 0x2120
movl $0x2, %ebx
movq %r15, %r13
movq %r14, %r15
leaq 0x17a21(%rip), %r14     # 0x1b194
movq (%r15,%rbx,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2120
incq %rbx
cmpq %rbx, %r13
jne 0x3773
movl $0xa, %edi
callq 0x2040
movq %r15, %r14
movq %r13, %r15
movq 0x8(%r14), %rdi
callq 0x12e65
movq %rax, -0x50(%rbp)
testl %r12d, %r12d
movq 0x8(%r14), %rdi
leaq 0x179e9(%rip), %rax     # 0x1b19d
leaq 0x179dd(%rip), %rsi     # 0x1b198
cmoveq %rax, %rsi
movq %rsi, -0x98(%rbp)
callq 0x12ebf
movq %rax, -0x48(%rbp)
movl $0x2, %eax
movq %r15, -0x88(%rbp)
movq %rax, -0x90(%rbp)
movq (%r14,%rax,8), %rdi
callq 0x17b6a
movq %rax, %rbx
movq %rax, %rdi
callq 0x1799c
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x40bd
movq %rbx, -0x68(%rbp)
xorl %eax, %eax
movl %eax, 0x1d9c1(%rip)     # 0x211d0
movl %eax, 0x1d9bf(%rip)     # 0x211d4
movl 0x1da0d(%rip), %eax     # 0x21228
movl %eax, 0x1d9b7(%rip)     # 0x211d8
movq %rbx, %rdi
callq 0x17a50
movq %rax, %rdi
movl $0x2e, %esi
callq 0x2280
testq %rax, %rax
je 0x39a6
movq %rax, %r14
incq %r14
movq %r14, %rdi
leaq -0x38(%rbp), %rsi
movl $0xa, %edx
callq 0x21e0
movq %rax, %r12
movq -0x38(%rbp), %rax
cmpq %r14, %rax
je 0x39a6
cmpb $0x0, (%rax)
jne 0x39a6
movq -0x50(%rbp), %rdi
leaq 0x17927(%rip), %rsi     # 0x1b1a1
movq -0x48(%rbp), %rdx
movq -0x98(%rbp), %rcx
callq 0x12f87
movq %rax, %rdi
leaq 0x189c9(%rip), %rsi     # 0x1c25d
callq 0x12e05
testq %rax, %rax
je 0x36cb
movq %rax, %r15
movq %rax, %rdi
leaq 0x178f4(%rip), %rsi     # 0x1b1a3
leaq -0x40(%rbp), %rdx
xorl %eax, %eax
callq 0x20a0
cmpl $0x1, %eax
leaq -0x4f40(%rbp), %r14
jne 0x4268
cmpl $0x0, -0x40(%rbp)
jle 0x38f2
xorl %ebx, %ebx
movq %r14, %rdi
movl $0x4e84, %esi           # imm = 0x4E84
movq %r15, %rdx
callq 0x21a0
testq %rax, %rax
je 0x4268
incl %ebx
cmpl -0x40(%rbp), %ebx
jl 0x38d2
movq %r15, %rdi
leaq 0x178d4(%rip), %rsi     # 0x1b1d0
leaq -0xa4(%rbp), %rdx
xorl %eax, %eax
callq 0x20a0
cmpl $0x1, %eax
jne 0x4268
movq %r15, %rdi
leaq 0x178c1(%rip), %rsi     # 0x1b1de
leaq -0xb0(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
leaq -0x9c(%rbp), %r8
xorl %eax, %eax
callq 0x20a0
cmpl $0x3, %eax
leaq 0x178c1(%rip), %r14     # 0x1b204
jne 0x4268
movl %r12d, %ebx
testl %r12d, %r12d
jle 0x3976
movq %r15, %rdi
movq %r14, %rsi
leaq -0x7c(%rbp), %rdx
leaq 0x1d872(%rip), %rcx     # 0x211d4
xorl %eax, %eax
callq 0x20a0
cmpl $0x2, %eax
jne 0x4268
decl %ebx
jne 0x3951
movq %r15, %rdi
movq %r14, %rsi
leaq -0x7c(%rbp), %rdx
leaq 0x1d851(%rip), %rcx     # 0x211d8
xorl %eax, %eax
callq 0x20a0
cmpl $0x2, %eax
jne 0x4268
movq %r15, %rdi
callq 0x20e0
movl %r12d, 0x1d82a(%rip)    # 0x211d0
movq -0x78(%rbp), %rbx
movq %rbx, %rdi
callq 0x2100
movq %rsp, -0x58(%rbp)
movq %rsp, %r13
addq $0x16, %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movq %rbx, %rdi
callq 0x2100
movq %rsp, %r15
addq $0x16, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
leaq 0x178d3(%rip), %rdi     # 0x1b2ba
movq %rbx, %rsi
leaq 0x178c9(%rip), %rdx     # 0x1b2ba
leaq 0x18378(%rip), %rcx     # 0x1bd70
callq 0x12f87
movq %r13, %rdi
movq %rax, %rsi
callq 0x2080
leaq 0x178ab(%rip), %rdi     # 0x1b2ba
movq %rbx, %rsi
leaq 0x178a1(%rip), %rbx     # 0x1b2ba
movq %rbx, %rdx
leaq 0x183c5(%rip), %rcx     # 0x1bde8
callq 0x12f87
movq %r15, %rdi
movq %rax, %rsi
callq 0x2080
movl 0x1d797(%rip), %esi     # 0x211d0
testl %esi, %esi
jle 0x3aa4
movq %rbx, %rdi
movq %r13, %rdx
callq 0x1308e
movq -0x50(%rbp), %rbx
movq %rbx, %rdi
leaq 0x177b8(%rip), %r14     # 0x1b20e
movq %r14, %rsi
movq -0x48(%rbp), %r12
movq %r12, %rdx
movq %rax, %rcx
callq 0x12f87
movq %rax, %rdi
leaq 0x18205(%rip), %r13     # 0x1bc77
movq %r13, %rsi
callq 0x12e05
movq %rax, 0x1d75f(%rip)     # 0x211e0
movl 0x1d749(%rip), %esi     # 0x211d0
leaq 0x1782c(%rip), %rdi     # 0x1b2ba
movq %r15, %rdx
callq 0x1308e
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
jmp 0x3ae9
movq -0x50(%rbp), %rbx
movq %rbx, %rdi
leaq 0x1775c(%rip), %r14     # 0x1b20e
movq %r14, %rsi
movq -0x48(%rbp), %r12
movq %r12, %rdx
movq %r13, %rcx
callq 0x12f87
movq %rax, %rdi
leaq 0x181a9(%rip), %r13     # 0x1bc77
movq %r13, %rsi
callq 0x12e05
movq %rax, 0x1d703(%rip)     # 0x211e0
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x12f87
movq %rax, %rdi
movq %r13, %rsi
callq 0x12e05
movq %rax, 0x1d6e8(%rip)     # 0x211e8
movq 0x1d6d9(%rip), %rcx     # 0x211e0
testq %rcx, %rcx
movq -0x88(%rbp), %r15
leaq -0x4f40(%rbp), %rbx
movq -0x30(%rbp), %r14
je 0x36cb
testq %rax, %rax
je 0x36cb
movl 0x1d6a7(%rip), %eax     # 0x211d8
subl 0x1d69d(%rip), %eax     # 0x211d4
movl %eax, -0x4f40(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x22b0
movq 0x1d683(%rip), %rcx     # 0x211e0
movl $0x4, %esi
movl $0x1, %edx
leaq -0x38(%rbp), %rdi
callq 0x22b0
movq $0x0, 0x1d675(%rip) # 0x211f0
movq 0x1d65e(%rip), %rcx     # 0x211e0
movl $0x8, %esi
movl $0x1, %edx
leaq 0x1d65d(%rip), %rdi     # 0x211f0
callq 0x22b0
movq -0x58(%rbp), %rsp
cmpq $0x0, 0x1d6c4(%rip)     # 0x21268
jne 0x3bd1
movslq 0x1d5d3(%rip), %rax     # 0x21180
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdi
leaq 0x17700(%rip), %rsi     # 0x1b2bc
callq 0x12ce5
movq %rax, 0x1d6a0(%rip)     # 0x21268
testq %rax, %rax
je 0x36cb
movq %r14, %rdi
callq 0x2130
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x20d0
movl $0x4, %esi
movl $0x1, %edx
leaq 0x1d671(%rip), %rdi     # 0x21270
movq %r14, %rcx
callq 0x20d0
xorl %eax, %eax
cmpl $0x7e, 0x1d660(%rip)    # 0x21270
setge %al
incl %eax
movl %eax, 0x1d659(%rip)     # 0x21274
movq 0x1d646(%rip), %rsi     # 0x21268
movq %r14, %rdi
callq 0xa0b7
testl %eax, %eax
movq %r14, %rdi
movq -0x60(%rbp), %r14
je 0x3c4f
movq 0x1d62c(%rip), %rax     # 0x21268
movl $0x7fffffff, 0x24(%rax) # imm = 0x7FFFFFFF
movl 0x1d58b(%rip), %ecx     # 0x211d4
movq -0x68(%rbp), %rbx
jmp 0x3c89
movslq 0x1d61e(%rip), %rax     # 0x21274
movq 0x1d60b(%rip), %rcx     # 0x21268
movslq 0x8(%rcx), %rsi
imulq %rax, %rsi
movl $0x1, %edx
callq 0x2230
movq 0x1d5f2(%rip), %rax     # 0x21268
movl 0x1d558(%rip), %ecx     # 0x211d4
cmpl %ecx, 0x24(%rax)
movq -0x68(%rbp), %rbx
jl 0x4294
cmpl 0x1d549(%rip), %ecx     # 0x211d8
jge 0x4058
movslq %ecx, %r12
xorl %ecx, %ecx
movq 0x1d5c7(%rip), %r15     # 0x21268
movslq %ecx, %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movupd (%r15,%rax), %xmm0
movupd 0x10(%r15,%rax), %xmm1
movups 0x20(%r15,%rax), %xmm2
movups %xmm2, 0x20(%r15)
movupd %xmm1, 0x10(%r15)
movupd %xmm0, (%r15)
movslq 0x24(%r15), %rbx
cmpq %rbx, %r12
movq %r12, -0x70(%rbp)
jne 0x3d00
addq $0x30, %r15
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0xa0b7
movl $0x1, %r14d
testl %eax, %eax
je 0x3d07
movl $0x1, %esi
jmp 0x3dc6
xorl %esi, %esi
jmp 0x3dfa
movl $0x60, %r12d
movq -0x30(%rbp), %r13
movslq 0x1d55c(%rip), %rax     # 0x21274
movq 0x1d549(%rip), %rcx     # 0x21268
movslq -0x28(%rcx,%r12), %rsi
imulq %rax, %rsi
movq %r13, %rdi
movl $0x1, %edx
callq 0x2230
movq 0x1d52c(%rip), %r15     # 0x21268
cmpl %ebx, -0xc(%r15,%r12)
jne 0x404c
incq %r14
cmpl %r14d, 0x1d42f(%rip)    # 0x21180
jg 0x3da1
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
mulsd 0x172a5(%rip), %xmm0    # 0x1b008
addsd 0x172a5(%rip), %xmm0    # 0x1b010
cvttsd2si %xmm0, %eax
movl %eax, 0x1d40b(%rip)     # 0x21180
cltq
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
movq %r15, %rdi
leaq 0x17591(%rip), %rdx     # 0x1b31a
callq 0x12d3d
movq %rax, %r15
movq %rax, 0x1d4d0(%rip)     # 0x21268
testq %rax, %rax
je 0x36cb
addq %r12, %r15
movq -0x30(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0xa0b7
addq $0x30, %r12
testl %eax, %eax
je 0x3d11
movl %r14d, %esi
movq -0x70(%rbp), %r12
movq 0x1d49b(%rip), %r15     # 0x21268
leaq (%r14,%r14,2), %rax
shlq $0x4, %rax
movl $0x7fffffff, 0x24(%r15,%rax) # imm = 0x7FFFFFFF
leaq 0x8(%r15), %rax
xorl %ecx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx), %rdx
movq %rdx, -0x8(%rax)
addl (%rax), %ecx
addq $0x30, %rax
decq %r14
jne 0x3de4
cmpl $0x0, 0x1d3ab(%rip)     # 0x211ac
je 0x3e24
incq 0x1d3a6(%rip)           # 0x211b0
movq 0x1d447(%rip), %rax     # 0x21258
movslq %r12d, %rcx
leaq (%rcx,%rcx,4), %rcx
movslq 0x4(%rax,%rcx,8), %rax
addq %rax, 0x1d394(%rip)     # 0x211b8
movl %esi, -0x3c(%rbp)
testl %esi, %esi
je 0x400f
movq 0x1d442(%rip), %rax     # 0x21278
movl -0x3c(%rbp), %ebx
cmpl %ebx, 0x1d345(%rip)     # 0x21184
jge 0x3e9a
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd 0x171b8(%rip), %xmm0    # 0x1b008
addsd 0x171c0(%rip), %xmm0    # 0x1b018
cvttsd2si %xmm0, %ecx
movl %ecx, 0x1d322(%rip)     # 0x21184
movslq %ecx, %rsi
shlq $0x4, %rsi
movq %rax, %rdi
leaq 0x174c0(%rip), %rdx     # 0x1b333
callq 0x12d3d
movq %rax, 0x1d3f9(%rip)     # 0x21278
testq %rax, %rax
je 0x36cb
movslq 0x1d2f5(%rip), %rcx     # 0x21184
leaq (%rax,%rcx,4), %rcx
movq %rcx, 0x1d3e6(%rip)     # 0x21280
testl %ebx, %ebx
jle 0x3efa
movl 0x1d304(%rip), %ecx     # 0x211a8
movq 0x1d3d5(%rip), %rdx     # 0x21280
movl %ebx, %esi
shlq $0x4, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %r12d, %r12d
movl 0x10(%r15,%rdi), %r8d
subl 0x1c(%r15,%rdi), %r8d
cmpl $0x14, %r8d
jg 0x3eef
movl 0x14(%r15,%rdi), %r8d
movl 0x18(%r15,%rdi), %r9d
subl %r8d, %r9d
cmpl %ecx, %r9d
jle 0x3eef
movslq %r12d, %r12
movl %r8d, (%rax,%r12,4)
movl 0x18(%r15,%rdi), %r8d
movl %r8d, (%rdx,%r12,4)
incl %r12d
addq $0x30, %rdi
cmpq %rdi, %rsi
jne 0x3eba
jmp 0x3efd
xorl %r12d, %r12d
movslq %r12d, %r14
movl $0x4, %edx
movq %rax, %rdi
movq %r14, %rsi
leaq 0x3a8(%rip), %rbx       # 0x42ba
movq %rbx, %rcx
callq 0x20c0
movq 0x1d35f(%rip), %rdi     # 0x21280
movl $0x4, %edx
movq %r14, %rsi
movq %rbx, %rcx
callq 0x20c0
testl %r14d, %r14d
jle 0x400f
movl $0x0, -0x58(%rbp)
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpl %r12d, %r15d
jge 0x3f6b
movq 0x1d323(%rip), %rax     # 0x21278
movslq %r15d, %r13
movl (%rax,%r13,4), %ecx
movq 0x1d31d(%rip), %rdx     # 0x21280
movslq %r14d, %rsi
cmpl (%rdx,%rsi,4), %ecx
jle 0x3fcd
decl %ebx
jne 0x3fc8
movslq %r14d, %r13
leaq (,%r13,4), %rdi
addq 0x1d2ff(%rip), %rdi     # 0x21280
movq 0x1d260(%rip), %rcx     # 0x211e8
movl $0x4, %esi
movl $0x1, %edx
callq 0x22b0
addq $0x4, 0x1d251(%rip)     # 0x211f0
cmpl $0x0, 0x1d206(%rip)     # 0x211ac
je 0x3fc8
movq 0x1d2d1(%rip), %rax     # 0x21280
movslq (%rax,%r13,4), %rax
movslq -0x58(%rbp), %rcx
subq %rcx, %rax
addq %rax, 0x1d1ff(%rip)     # 0x211c0
incq 0x1d200(%rip)           # 0x211c8
incl %r14d
jmp 0x4006
testl %ebx, %ebx
jne 0x4001
leaq (%rax,%r13,4), %rdi
movq 0x1d20c(%rip), %rcx     # 0x211e8
movl $0x4, %esi
movl $0x1, %edx
callq 0x22b0
addq $0x4, 0x1d1fd(%rip)     # 0x211f0
movq 0x1d27e(%rip), %rax     # 0x21278
movl (%rax,%r13,4), %eax
movl %eax, -0x58(%rbp)
incl %ebx
incl %r15d
cmpl %r12d, %r14d
jl 0x3f49
movq 0x1d1ca(%rip), %rcx     # 0x211e0
movl $0x8, %esi
movl $0x1, %edx
leaq 0x1d1c9(%rip), %rdi     # 0x211f0
callq 0x22b0
movq -0x70(%rbp), %r12
incq %r12
movslq 0x1d19e(%rip), %rax     # 0x211d8
cmpq %rax, %r12
movq -0x60(%rbp), %r14
movl -0x3c(%rbp), %ecx
jl 0x3c9a
jmp 0x405c
movl %r14d, %esi
movq -0x70(%rbp), %r12
jmp 0x3dde
xorl %ecx, %ecx
jmp 0x4071
movq 0x1d205(%rip), %rax     # 0x21268
movslq %ecx, %rcx
movq -0x88(%rbp), %r15
movq -0x68(%rbp), %rbx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
cmpl $0x7fffffff, 0x24(%rax,%rcx) # imm = 0x7FFFFFFF
jne 0x4294
movq 0x1d152(%rip), %rdi     # 0x211e0
callq 0x20e0
movq 0x1d14e(%rip), %rdi     # 0x211e8
callq 0x20e0
movq -0x30(%rbp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x1799c
movq %rax, -0x30(%rbp)
testq %rax, %rax
jne 0x3807
movq %rbx, %rdi
callq 0x17a7b
movq -0x90(%rbp), %rax
incq %rax
cmpq %r15, %rax
jne 0x37db
cmpl $0x0, 0x1d0cd(%rip)     # 0x211ac
je 0x41d9
leaq 0x17125(%rip), %rdi     # 0x1b211
xorl %eax, %eax
callq 0x2120
movq 0x1d0b6(%rip), %rdi     # 0x211b0
movq 0x1ced7(%rip), %rbx     # 0x20fd8
movq (%rbx), %rdx
movl $0x7, %esi
callq 0x1313d
leaq 0x17108(%rip), %rdi     # 0x1b21d
xorl %eax, %eax
callq 0x2120
movq 0x1d095(%rip), %rdi     # 0x211b8
movq (%rbx), %rdx
movl $0xc, %esi
callq 0x1313d
leaq 0x170fc(%rip), %rdi     # 0x1b233
xorl %eax, %eax
callq 0x2120
leaq 0x17100(%rip), %rdi     # 0x1b245
xorl %eax, %eax
callq 0x2120
movq 0x1d075(%rip), %rdi     # 0x211c8
movq (%rbx), %rdx
movl $0x7, %esi
callq 0x1313d
cvtsi2sdq 0x1d05f(%rip), %xmm0 # 0x211c8
movsd 0x16e9f(%rip), %xmm1    # 0x1b010
mulsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x1d02f(%rip), %xmm1 # 0x211b0
divsd %xmm1, %xmm0
leaq 0x170c4(%rip), %rdi     # 0x1b250
movb $0x1, %al
callq 0x2120
movq 0x1d026(%rip), %rdi     # 0x211c0
movq (%rbx), %rdx
movl $0xc, %esi
callq 0x1313d
xorps %xmm0, %xmm0
cvtsi2sdq 0x1d00d(%rip), %xmm0 # 0x211c0
mulsd 0x16e55(%rip), %xmm0    # 0x1b010
xorps %xmm1, %xmm1
cvtsi2sdq 0x1cff1(%rip), %xmm1 # 0x211b8
divsd %xmm1, %xmm0
leaq 0x17094(%rip), %rdi     # 0x1b266
movb $0x1, %al
callq 0x2120
movq -0x50(%rbp), %rdi
callq 0x2030
movq -0x48(%rbp), %rdi
callq 0x2030
leaq 0x1d006(%rip), %rdi     # 0x211f8
callq 0x14d52
leaq 0x1d08a(%rip), %rax     # 0x21288
movq (%rax), %rdi
callq 0x2030
xorl %edi, %edi
callq 0x22a0
movq 0x1cde4(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1d06a(%rip), %rax     # 0x21288
movq (%rax), %rdx
movsbl 0x1(%r8), %ecx
addq $0x2, %r8
leaq 0x16e1b(%rip), %rsi     # 0x1b04c
xorl %eax, %eax
callq 0x21c0
jmp 0x36cb
movq 0x1cdb4(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1d03a(%rip), %rax     # 0x21288
movq (%rax), %rdx
movq 0x8(%r14), %rcx
leaq 0x16f01(%rip), %rsi     # 0x1b15d
xorl %eax, %eax
callq 0x21c0
jmp 0x36cb
movq 0x1cd89(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1d00f(%rip), %rax     # 0x21288
movq (%rax), %rdx
leaq 0x16f2d(%rip), %rsi     # 0x1b1b0
xorl %eax, %eax
callq 0x21c0
movl $0x2, %edi
callq 0x22a0
movq 0x1cd5d(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0x1cfe3(%rip), %rax     # 0x21288
movq (%rax), %rdx
movl 0x1cf22(%rip), %ecx     # 0x211d0
leaq 0x17021(%rip), %rsi     # 0x1b2d6
jmp 0x36c4