// File: /workspace/github_c_makefile_star2_O0/thegenemyers[P]DASCRUBBER/DASpatch.c
// Function: main
int main(int argc, char *argv[])
{ char       *root, *dpwd;
  int64       novl;
  DAZZ_TRACK *track;
  int         c;

  //  Process arguments

  { int  i, j, k;
    int  flags[128];

    ARG_INIT("DASpatch")

    j = 1;
    for (i = 1; i < argc; i++)
      if (argv[i][0] == '-')
        switch (argv[i][1])
        { default:
            ARG_FLAGS("v")
            break;
        }
      else
        argv[j++] = argv[i];
    argc = j;

    VERBOSE = flags['v'];

    if (argc < 3)
      { fprintf(stderr,"Usage: %s %s\n",Prog_Name,Usage);
        fprintf(stderr,"\n");
        fprintf(stderr,"      -v: Verbose mode, output statistics as proceed.\n");
        exit (1);
      }
  }

  //  Open trimmed DB and .qual and .trim tracks

  { int i, status;

    status = Open_DB(argv[1],DB);
    if (status < 0)
      exit (1);
    if (status == 1)
      { fprintf(stderr,"%s: Cannot be called on a .dam index: %s\n",Prog_Name,argv[1]);
        exit (1);
      }
    if (DB->part)
      { fprintf(stderr,"%s: Cannot be called on a block: %s\n",Prog_Name,argv[1]);
        exit (1);
      }
    Trim_DB(DB);

    track = Open_Track(DB,"qual");
    if (track != NULL)
      { Load_All_Track_Data(track);
        QV_IDX = (int64 *) track->anno;
        QV     = (uint8 *) track->data;
      }
    else
      { fprintf(stderr,"%s: Must have a 'qual' track, run DASqv\n",Prog_Name);
        exit (1);
      }

    track = Open_Track(DB,"trim");
    if (track != NULL)
      { FILE *afile;
        char *aname;
        int   extra, tracklen, size;
        DAZZ_EXTRA  ex_hgap, ex_cest, ex_good, ex_bad;

        Load_All_Track_Data(track);

        TRIM_IDX = (int64 *) track->anno;
        TRIM     = (int *) track->data;
        for (i = 0; i <= DB->nreads; i++)
          TRIM_IDX[i] /= sizeof(int);

        //  Get HGAP minimum, and good and bad qv thresholds from .trim extras

        aname = Strdup(Catenate(DB->path,".","trim",".anno"),"Allocating anno file");
        if (aname == NULL)
          exit (1);
        afile  = fopen(aname,"r");

        fread(&tracklen,sizeof(int),1,afile);
        fread(&size,sizeof(int),1,afile);
        fseeko(afile,0,SEEK_END);
        extra = ftell(afile) - (size*(tracklen+1) + 2*sizeof(int));
        fseeko(afile,-extra,SEEK_END);
        ex_hgap.nelem = 0;
        if (Read_Extra(afile,aname,&ex_hgap) != 0)
          { fprintf(stderr,"%s: Hgap threshold extra missing from .trim track?\n",Prog_Name);
            exit (1);
          }
        ex_cest.nelem = 0;
        if (Read_Extra(afile,aname,&ex_cest) != 0)
          { fprintf(stderr,"%s: Coverage estimate extra missing from .trim track?\n",Prog_Name);
            exit (1);
          }
        ex_good.nelem = 0;
        if (Read_Extra(afile,aname,&ex_good) != 0)
          { fprintf(stderr,"%s: Good QV threshold extra missing from .trim track?\n",Prog_Name);
            exit (1);
          }
        ex_bad.nelem = 0;
        if (Read_Extra(afile,aname,&ex_bad) != 0)
          { fprintf(stderr,"%s: Bad QV threshold extra missing from .trim track?\n",Prog_Name);
            exit (1);
          }
        fclose(afile);

        HGAP_MIN = (int) ((int64 *) (ex_hgap.value))[0];
        GOOD_QV  = (int) ((int64 *) (ex_good.value))[0];
        BAD_QV   = (int) ((int64 *) (ex_bad.value))[0];
      }
    else
      { fprintf(stderr,"%s: Must have a 'trim' track, run DAStrim\n",Prog_Name);
        exit (1);
      }
  }

  //  For each .las block/file

  dpwd = PathTo(argv[1]);
  root = Root(argv[1],".db");

  for (c = 2; c < argc; c++)
    { Block_Looper *parse;
      FILE         *input;

      parse = Parse_Block_LAS_Arg(argv[c]);

      while ((input = Next_Block_Arg(parse)) != NULL)
        { DB_PART  = 0;
          DB_FIRST = 0;
          DB_LAST  = DB->nreads;

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

          { FILE *dbfile;
            char  buffer[2*MAX_NAME+100];
            char *p, *eptr;
            int   i, part, nfiles, nblocks, cutoff, all, oindx;
            int64 size;

            p = rindex(Block_Arg_Root(parse),'.');
            if (p != NULL)
              { part = strtol(p+1,&eptr,10);
                if (*eptr == '\0' && eptr != p+1)
                  { dbfile = Fopen(Catenate(dpwd,"/",root,".db"),"r");
                    if (dbfile == NULL)
                      exit (1);
                    if (fscanf(dbfile,DB_NFILE,&nfiles) != 1)
                      SYSTEM_READ_ERROR
                    for (i = 0; i < nfiles; i++)
                      if (fgets(buffer,2*MAX_NAME+100,dbfile) == NULL)
                        SYSTEM_READ_ERROR
                    if (fscanf(dbfile,DB_NBLOCK,&nblocks) != 1)
                      SYSTEM_READ_ERROR
                    if (fscanf(dbfile,DB_PARAMS,&size,&cutoff,&all) != 3)
                      SYSTEM_READ_ERROR
                    for (i = 1; i <= part; i++)
                      if (fscanf(dbfile,DB_BDATA,&oindx,&DB_FIRST) != 2)
                        SYSTEM_READ_ERROR
                    if (fscanf(dbfile,DB_BDATA,&oindx,&DB_LAST) != 2)
                      SYSTEM_READ_ERROR
                    fclose(dbfile);
                    DB_PART = part;
                  }
              }
          }

          //  Set up patch track

          { int len, size;

            if (DB_PART > 0)
              { PR_AFILE = Fopen(Catenate(dpwd,PATHSEP,root,
                                          Numbered_Suffix(".",DB_PART,".patch.anno")),"w");
                PR_DFILE = Fopen(Catenate(dpwd,PATHSEP,root,
                                          Numbered_Suffix(".",DB_PART,".patch.data")),"w");
              }
            else
              { PR_AFILE = Fopen(Catenate(dpwd,PATHSEP,root,".patch.anno"),"w");
                PR_DFILE = Fopen(Catenate(dpwd,PATHSEP,root,".patch.data"),"w");
              }
            if (PR_AFILE == NULL || PR_DFILE == NULL)
              exit (1);

            len  = DB_LAST - DB_FIRST;
            size = 8;
            fwrite(&len,sizeof(int),1,PR_AFILE);
            fwrite(&size,sizeof(int),1,PR_AFILE);
            PR_INDEX = 0;
	    fwrite(&PR_INDEX,sizeof(int64),1,PR_AFILE);
          }

          //  Get trace point spacing information

          fread(&novl,sizeof(int64),1,input);
          fread(&TRACE_SPACING,sizeof(int),1,input);
          ANCHOR_THRESH = ANCHOR_MATCH * TRACE_SPACING;

          //  Initialize statistics gathering

          if (VERBOSE)
            { npatch = 0;
              fpatch = 0;
              printf("\nDASpatch -g%d -b%d %s %s\n",GOOD_QV,BAD_QV,argv[1],Block_Arg_Root(parse));
            }

          //  Process each read pile

          make_a_pass(input,PATCH_GAPS,1);

          //  If verbose output statistics summary to stdout

          if (VERBOSE)
            { if (fpatch == 0)
                printf("  All %d patches were successful\n",npatch);
              else
                printf("  %d out of %d total patches failed\n",fpatch,npatch);
            }
    
          fclose(PR_AFILE);
          fclose(PR_DFILE);
          fclose(input);
        }

      Free_Block_Arg(parse);
    }

  free(dpwd);
  free(root);

  Close_DB(DB);
  free(Prog_Name);

  exit (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5200, %rsp           # imm = 0x5200
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x23c38(%rip), %rdi     # 0x26028
leaq 0x24a33(%rip), %rsi     # 0x26e2a
callq 0x1ab20
movq %rax, %rcx
leaq 0x2914a(%rip), %rax     # 0x2b550
movq %rcx, (%rax)
movl $0x0, -0x38(%rbp)
cmpl $0x80, -0x38(%rbp)
jge 0x2433
movslq -0x38(%rbp), %rax
movl $0x0, -0x240(%rbp,%rax,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2410
movl $0x1, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x2554
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2522
movl $0x1, -0x40(%rbp)
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x251e
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0x23b8d(%rip), %rdi     # 0x26031
callq 0x2130
cmpq $0x0, %rax
jne 0x24ef
movq 0x28b42(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x29090(%rip), %rax     # 0x2b550
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
leaq 0x23b55(%rip), %rsi     # 0x26033
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cltq
movl $0x1, -0x240(%rbp,%rax,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x246c
jmp 0x2520
jmp 0x2544
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x3c(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2546
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2441
movl -0x3c(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x68(%rbp), %eax
movl %eax, 0x28e95(%rip)     # 0x2b3f8
cmpl $0x3, -0x8(%rbp)
jge 0x25cc
movq 0x28a88(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28fd6(%rip), %rax     # 0x2b550
movq (%rax), %rdx
movq 0x28bfc(%rip), %rcx     # 0x2b180
leaq 0x23ac6(%rip), %rsi     # 0x26051
movb $0x0, %al
callq 0x2190
movq 0x28a5f(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x24886(%rip), %rsi     # 0x26e29
movb $0x0, %al
callq 0x2190
movq 0x28a47(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x23aa4(%rip), %rsi     # 0x2605f
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x28bad(%rip), %rsi     # 0x2b188
callq 0x1c1b0
movl %eax, -0x248(%rbp)
cmpl $0x0, -0x248(%rbp)
jge 0x25f9
movl $0x1, %edi
callq 0x2290
cmpl $0x1, -0x248(%rbp)
jne 0x2636
movq 0x289ef(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28f3d(%rip), %rax     # 0x2b550
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x23a71(%rip), %rsi     # 0x26096
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq 0x28b4b(%rip), %rax     # 0x2b188
cmpl $0x0, 0x38(%rax)
je 0x2677
movq 0x289ae(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28efc(%rip), %rax     # 0x2b550
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x23a5a(%rip), %rsi     # 0x260c0
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq 0x28b0a(%rip), %rdi     # 0x2b188
callq 0x1cde0
movq 0x28afe(%rip), %rdi     # 0x2b188
leaq 0x23a54(%rip), %rsi     # 0x260e5
callq 0x1ef60
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x26ca
movq -0x30(%rbp), %rdi
callq 0x1fe80
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x28d47(%rip)     # 0x2b400
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x28d40(%rip)     # 0x2b408
jmp 0x26f6
movq 0x28927(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28e75(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x23a05(%rip), %rsi     # 0x260ea
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq 0x28a8b(%rip), %rdi     # 0x2b188
leaq 0x23a0f(%rip), %rsi     # 0x26113
callq 0x1ef60
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x2a1a
movq -0x30(%rbp), %rdi
callq 0x1fe80
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x28ce0(%rip)     # 0x2b410
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x28cd9(%rip)     # 0x2b418
movl $0x0, -0x244(%rbp)
movl -0x244(%rbp), %eax
movq 0x28a32(%rip), %rcx     # 0x2b188
cmpl 0x30(%rcx), %eax
jg 0x2786
movq 0x28cae(%rip), %rax     # 0x2b410
movslq -0x244(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
shrq $0x2, %rdx
movq %rdx, (%rax,%rcx,8)
movl -0x244(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x244(%rbp)
jmp 0x2749
movq 0x289fb(%rip), %rax     # 0x2b188
movq 0x48(%rax), %rdi
leaq 0x23ba9(%rip), %rsi     # 0x26341
leaq 0x23974(%rip), %rdx     # 0x26113
leaq 0x23b04(%rip), %rcx     # 0x262aa
callq 0x1ae10
movq %rax, %rdi
leaq 0x23963(%rip), %rsi     # 0x26118
callq 0x1ab20
movq %rax, -0x258(%rbp)
cmpq $0x0, -0x258(%rbp)
jne 0x27d5
movl $0x1, %edi
callq 0x2290
movq -0x258(%rbp), %rdi
leaq 0x24a3e(%rip), %rsi     # 0x27221
callq 0x2260
movq %rax, -0x250(%rbp)
movq -0x250(%rbp), %rcx
leaq -0x260(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x20a0
movq -0x250(%rbp), %rcx
leaq -0x264(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x20a0
movq -0x250(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x2250
movq -0x250(%rbp), %rdi
callq 0x21a0
movl -0x264(%rbp), %ecx
movl -0x260(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
movslq %ecx, %rcx
addq $0x8, %rcx
subq %rcx, %rax
movl %eax, -0x25c(%rbp)
movq -0x250(%rbp), %rdi
xorl %eax, %eax
subl -0x25c(%rbp), %eax
movslq %eax, %rsi
movl $0x2, %edx
callq 0x2250
movl $0x0, -0x284(%rbp)
movq -0x250(%rbp), %rdi
movq -0x258(%rbp), %rsi
leaq -0x288(%rbp), %rdx
callq 0x20160
cmpl $0x0, %eax
je 0x28dd
movq 0x28740(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28c8e(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x23861(%rip), %rsi     # 0x2612d
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movl $0x0, -0x2a4(%rbp)
movq -0x250(%rbp), %rdi
movq -0x258(%rbp), %rsi
leaq -0x2a8(%rbp), %rdx
callq 0x20160
cmpl $0x0, %eax
je 0x2932
movq 0x286eb(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28c39(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x23840(%rip), %rsi     # 0x26161
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movl $0x0, -0x2c4(%rbp)
movq -0x250(%rbp), %rdi
movq -0x258(%rbp), %rsi
leaq -0x2c8(%rbp), %rdx
callq 0x20160
cmpl $0x0, %eax
je 0x2987
movq 0x28696(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28be4(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x23822(%rip), %rsi     # 0x26198
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movl $0x0, -0x2e4(%rbp)
movq -0x250(%rbp), %rdi
movq -0x258(%rbp), %rsi
leaq -0x2e8(%rbp), %rdx
callq 0x20160
cmpl $0x0, %eax
je 0x29dc
movq 0x28641(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28b8f(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x23804(%rip), %rsi     # 0x261cf
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq -0x250(%rbp), %rdi
callq 0x20b0
movq -0x270(%rbp), %rax
movq (%rax), %rax
movl %eax, 0x28a28(%rip)     # 0x2b420
movq -0x2b0(%rbp), %rax
movq (%rax), %rax
movl %eax, 0x28a1c(%rip)     # 0x2b424
movq -0x2d0(%rbp), %rax
movq (%rax), %rax
movl %eax, 0x28a10(%rip)     # 0x2b428
jmp 0x2a46
movq 0x285d7(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28b25(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x237d0(%rip), %rsi     # 0x26205
movb $0x0, %al
callq 0x2190
movl $0x1, %edi
callq 0x2290
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1ac40
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x237ca(%rip), %rsi     # 0x26230
callq 0x1acd0
movq %rax, -0x18(%rbp)
movl $0x2, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x312e
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x21bc0
movq %rax, -0x2f0(%rbp)
movq -0x2f0(%rbp), %rdi
callq 0x21790
movq %rax, -0x2f8(%rbp)
cmpq $0x0, %rax
je 0x3114
movl $0x0, 0x2896b(%rip)     # 0x2b42c
movl $0x0, 0x28965(%rip)     # 0x2b430
movq 0x286b6(%rip), %rax     # 0x2b188
movl 0x30(%rax), %eax
movl %eax, 0x28959(%rip)     # 0x2b434
movq -0x2f0(%rbp), %rdi
callq 0x21980
movq %rax, %rdi
movl $0x2e, %esi
callq 0x2270
movq %rax, -0x5198(%rbp)
cmpq $0x0, -0x5198(%rbp)
je 0x2df5
movq -0x5198(%rbp), %rdi
addq $0x1, %rdi
leaq -0x51a0(%rbp), %rsi
movl $0xa, %edx
callq 0x21c0
movl %eax, -0x51a8(%rbp)
movq -0x51a0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2df3
movq -0x51a0(%rbp), %rax
movq -0x5198(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x2df3
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x236cc(%rip), %rsi     # 0x26234
leaq 0x236c1(%rip), %rcx     # 0x26230
callq 0x1ae10
movq %rax, %rdi
leaq 0x246a3(%rip), %rsi     # 0x27221
callq 0x1abc0
movq %rax, -0x300(%rbp)
cmpq $0x0, -0x300(%rbp)
jne 0x2b9e
movl $0x1, %edi
callq 0x2290
movq -0x300(%rbp), %rdi
leaq 0x2368a(%rip), %rsi     # 0x26236
leaq -0x51ac(%rbp), %rdx
movb $0x0, %al
callq 0x2080
cmpl $0x1, %eax
je 0x2beb
movq 0x28432(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28980(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x23669(%rip), %rsi     # 0x26243
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
movl $0x0, -0x51a4(%rbp)
movl -0x51a4(%rbp), %eax
cmpl -0x51ac(%rbp), %eax
jge 0x2c60
leaq -0x5190(%rbp), %rdi
movq -0x300(%rbp), %rdx
movl $0x4e84, %esi           # imm = 0x4E84
callq 0x2170
cmpq $0x0, %rax
jne 0x2c4d
movq 0x283d0(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x2891e(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x23607(%rip), %rsi     # 0x26243
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
jmp 0x2c4f
movl -0x51a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51a4(%rbp)
jmp 0x2bf5
movq -0x300(%rbp), %rdi
leaq 0x235f5(%rip), %rsi     # 0x26263
leaq -0x51b0(%rbp), %rdx
movb $0x0, %al
callq 0x2080
cmpl $0x1, %eax
je 0x2cad
movq 0x28370(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x288be(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x235a7(%rip), %rsi     # 0x26243
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
movq -0x300(%rbp), %rdi
leaq 0x235b6(%rip), %rsi     # 0x26271
leaq -0x51c8(%rbp), %rdx
leaq -0x51b4(%rbp), %rcx
leaq -0x51b8(%rbp), %r8
movb $0x0, %al
callq 0x2080
cmpl $0x3, %eax
je 0x2d08
movq 0x28315(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28863(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x2354c(%rip), %rsi     # 0x26243
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
movl $0x1, -0x51a4(%rbp)
movl -0x51a4(%rbp), %eax
cmpl -0x51a8(%rbp), %eax
jg 0x2d87
movq -0x300(%rbp), %rdi
leaq 0x23569(%rip), %rsi     # 0x26297
leaq -0x51bc(%rbp), %rdx
leaq 0x286f4(%rip), %rcx     # 0x2b430
movb $0x0, %al
callq 0x2080
cmpl $0x2, %eax
je 0x2d74
movq 0x282a9(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x287f7(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x234e0(%rip), %rsi     # 0x26243
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
jmp 0x2d76
movl -0x51a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x51a4(%rbp)
jmp 0x2d12
movq -0x300(%rbp), %rdi
leaq 0x23502(%rip), %rsi     # 0x26297
leaq -0x51bc(%rbp), %rdx
leaq 0x28691(%rip), %rcx     # 0x2b434
movb $0x0, %al
callq 0x2080
cmpl $0x2, %eax
je 0x2ddb
movq 0x28242(%rip), %rax     # 0x2aff8
movq (%rax), %rdi
leaq 0x28790(%rip), %rax     # 0x2b550
movq (%rax), %rdx
leaq 0x23479(%rip), %rsi     # 0x26243
movb $0x0, %al
callq 0x2190
movl $0x2, %edi
callq 0x2290
movq -0x300(%rbp), %rdi
callq 0x20b0
movl -0x51a8(%rbp), %eax
movl %eax, 0x28639(%rip)     # 0x2b42c
jmp 0x2df5
cmpl $0x0, 0x28630(%rip)     # 0x2b42c
jle 0x2ec8
movq -0x20(%rbp), %rax
movq %rax, -0x51f0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x51e8(%rbp)
movl 0x2860e(%rip), %esi     # 0x2b42c
leaq 0x2351c(%rip), %rdi     # 0x26341
leaq 0x23478(%rip), %rdx     # 0x262a4
callq 0x1af60
movq -0x51f0(%rbp), %rdi
movq -0x51e8(%rbp), %rdx
movq %rax, %rcx
leaq 0x23458(%rip), %rsi     # 0x262a1
callq 0x1ae10
movq %rax, %rdi
leaq 0x23def(%rip), %rsi     # 0x26c47
callq 0x1abc0
movq %rax, 0x285d4(%rip)     # 0x2b438
movq -0x20(%rbp), %rax
movq %rax, -0x51e0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x51d8(%rbp)
movl 0x285ac(%rip), %esi     # 0x2b42c
leaq 0x234ba(%rip), %rdi     # 0x26341
leaq 0x23422(%rip), %rdx     # 0x262b0
callq 0x1af60
movq -0x51e0(%rbp), %rdi
movq -0x51d8(%rbp), %rdx
movq %rax, %rcx
leaq 0x233f6(%rip), %rsi     # 0x262a1
callq 0x1ae10
movq %rax, %rdi
leaq 0x23d8d(%rip), %rsi     # 0x26c47
callq 0x1abc0
movq %rax, 0x2857a(%rip)     # 0x2b440
jmp 0x2f2a
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x233ca(%rip), %rsi     # 0x262a1
leaq 0x233c6(%rip), %rcx     # 0x262a4
callq 0x1ae10
movq %rax, %rdi
leaq 0x23d5a(%rip), %rsi     # 0x26c47
callq 0x1abc0
movq %rax, 0x2853f(%rip)     # 0x2b438
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x23399(%rip), %rsi     # 0x262a1
leaq 0x233a1(%rip), %rcx     # 0x262b0
callq 0x1ae10
movq %rax, %rdi
leaq 0x23d29(%rip), %rsi     # 0x26c47
callq 0x1abc0
movq %rax, 0x28516(%rip)     # 0x2b440
cmpq $0x0, 0x28506(%rip)     # 0x2b438
je 0x2f3e
cmpq $0x0, 0x28504(%rip)     # 0x2b440
jne 0x2f48
movl $0x1, %edi
callq 0x2290
movl 0x284e6(%rip), %eax     # 0x2b434
subl 0x284dc(%rip), %eax     # 0x2b430
movl %eax, -0x51cc(%rbp)
movl $0x8, -0x51d0(%rbp)
movq 0x284cd(%rip), %rcx     # 0x2b438
leaq -0x51cc(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x22a0
movq 0x284b0(%rip), %rcx     # 0x2b438
leaq -0x51d0(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x22a0
movq $0x0, 0x2849f(%rip) # 0x2b448
movq 0x28488(%rip), %rcx     # 0x2b438
leaq 0x28491(%rip), %rdi     # 0x2b448
movl $0x8, %esi
movl $0x1, %edx
callq 0x22a0
movq -0x2f8(%rbp), %rcx
leaq -0x28(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x20a0
movq -0x2f8(%rbp), %rcx
leaq 0x28462(%rip), %rdi     # 0x2b450
movl $0x4, %esi
movl $0x1, %edx
callq 0x20a0
cvtsi2sdl 0x2844b(%rip), %xmm1 # 0x2b450
movsd 0x22ffb(%rip), %xmm0    # 0x26008
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x28439(%rip)     # 0x2b454
cmpl $0x0, 0x283d6(%rip)     # 0x2b3f8
je 0x308f
movl $0x0, 0x2842a(%rip)     # 0x2b458
movl $0x0, 0x28424(%rip)     # 0x2b45c
movl 0x283e6(%rip), %eax     # 0x2b424
movl %eax, -0x5200(%rbp)
movl 0x283de(%rip), %eax     # 0x2b428
movl %eax, -0x51fc(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x51f8(%rbp)
movq -0x2f0(%rbp), %rdi
callq 0x21980
movl -0x5200(%rbp), %esi
movl -0x51fc(%rbp), %edx
movq -0x51f8(%rbp), %rcx
movq %rax, %r8
leaq 0x23234(%rip), %rdi     # 0x262bc
movb $0x0, %al
callq 0x20f0
movq -0x2f8(%rbp), %rdi
leaq 0x703(%rip), %rsi       # 0x37a0
movl $0x1, %edx
callq 0x3170
cmpl $0x0, 0x2834a(%rip)     # 0x2b3f8
je 0x30eb
cmpl $0x0, 0x283a5(%rip)     # 0x2b45c
jne 0x30cf
movl 0x28399(%rip), %esi     # 0x2b458
leaq 0x23211(%rip), %rdi     # 0x262d7
movb $0x0, %al
callq 0x20f0
jmp 0x30e9
movl 0x28387(%rip), %esi     # 0x2b45c
movl 0x2837d(%rip), %edx     # 0x2b458
leaq 0x23217(%rip), %rdi     # 0x262f9
movb $0x0, %al
callq 0x20f0
jmp 0x30eb
movq 0x28346(%rip), %rdi     # 0x2b438
callq 0x20b0
movq 0x28342(%rip), %rdi     # 0x2b440
callq 0x20b0
movq -0x2f8(%rbp), %rdi
callq 0x20b0
jmp 0x2a9a
movq -0x2f0(%rbp), %rdi
callq 0x219f0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2a76
movq -0x20(%rbp), %rdi
callq 0x2030
movq -0x18(%rbp), %rdi
callq 0x2030
movq 0x28041(%rip), %rdi     # 0x2b188
callq 0x1db00
leaq 0x283fd(%rip), %rax     # 0x2b550
movq (%rax), %rdi
callq 0x2030
xorl %edi, %edi
callq 0x2290
nopw %cs:(%rax,%rax)