// File: /workspace/github_c_makefile_star2_O3/sc932[P]ALE/src/synthReadGen.c
// Function: main
int main(int argc, char **argv){
  if (argc == 1) {
    printf("%s", WELCOME_MSG);
    printf("Usage: %s [options] <inputFile> <outputFile>\n", argv[0]);
    printf("%s", SHORT_OPTIONS);
    return 1;
  }
  if (argc < 3){
    if(argv[1][0] == '-' && argv[1][1] == 'h'){
      printf("%s", WELCOME_MSG);
      printf("Usage: %s [options] <inputFile> <outputFile>\n\n", argv[0]);
      printf("%s", LONG_OPTIONS);
      return 0;
    }
    printf("%s", WELCOME_MSG);
    printf("Usage: %s [options] <inputFile> <outputFile>\n", argv[0]);
    printf("%s", SHORT_OPTIONS);
    return 1;
  }
  int i;
  int insDistToUse = 1; // distribution to use for insert lengths 1 = normal, 2 = poisson
  int lenDistToUse = 1; // distribution to use for read lengths 1 = normal, 2 = poisson
  int perfectStart = 0; // no error for first x bases in a read
  float inwardInsLenMean = 200.0; // inward insert length mean
  float inwardInsLenSigma = 10.0; // inward insert length sigma
  float inwardProb = 0.5; // probability of an inward insert
  float outwardInsLenMean = 500.0; // outward insert length mean
  float outwardInsLenSigma = 15.0; // inward insert length sigma
  float readLengthMean = 85.0; // read length mean
  float readLengthSigma = 7.0; // read length sigma
  int bowtieOutput = 0;
  char illuminaChar = '^';
  float errorRate = getQualityP(illuminaChar); // 1 - prob of substitution error
  int numReads = 1000;
  if(argv[1][0] == '-' && argv[1][1] == 'h'){
      printf("%s", WELCOME_MSG);
      printf("Usage: %s [options] <inputFile> <outputFile>\n\n", argv[0]);
      printf("%s", LONG_OPTIONS);
      return 0;
  }
  if (argc > 4){
    for(i = 1; i < argc - 2; i++){
      if(argv[i][0] == '-' && argv[i][1] == 'i' && argv[i][2] == 'd'){ // insert distance change
    insDistToUse = atoi(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'l' && argv[i][2] == 'd'){
    lenDistToUse = atoi(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'i' && argv[i][2] == 'm'){
    inwardInsLenMean = atof(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'i' && argv[i][2] == 'p'){
    inwardProb = atof(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'o' && argv[i][2] == 'm'){
    outwardInsLenMean = atof(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'e' && argv[i][2] == 'r'){
    illuminaChar = argv[i+1][0];
    errorRate = getQualityP(illuminaChar);
    //errorRate = atof(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'n' && argv[i][2] == 'r'){
    numReads = atof(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'i' && argv[i][2] == 's'){
    inwardInsLenSigma = atof(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'o' && argv[i][2] == 's'){
    outwardInsLenSigma = atof(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'r' && argv[i][2] == 'l'){
    readLengthMean = atof(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'r' && argv[i][2] == 's'){
    readLengthSigma = atof(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'p' && argv[i][2] == 's'){
    perfectStart = atoi(argv[i+1]);
      }else if(argv[i][0] == '-' && argv[i][1] == 'b'){
          bowtieOutput = 1;
          i--;
      }else{
    printf("Error! Could not recognize option: %s with value %s\n", argv[i], argv[i+1]);
    printf("Usage: %s [options] <inputFile> <outputFile>\n", argv[0]);
    printf("%s", SHORT_OPTIONS);
    return 0;
      }
      i++;
    }
  }
  printf("Starting with parameters: id = %i; ld = %i; im = %f; om = %f; ip = %f; er = %f (%c); is = %f; os = %f; rm = %f; rs = %f; ps = %i\n", insDistToUse, lenDistToUse, inwardInsLenMean, outwardInsLenMean, inwardProb,  errorRate, illuminaChar, inwardInsLenSigma, outwardInsLenSigma, readLengthMean, readLengthSigma, perfectStart);
  
  printf("Input file: %s\n", argv[argc - 2]);
  printf("Output file: %s\n", argv[argc - 1]);
  
  // open up input file (with the assembly to parse into reads)
  gzFile fp;
  kseq_t *seq;
  int l;
  fp = gzopen(argv[argc - 2], "r");
  seq = kseq_init(fp);
  printf("Read in file, now making sequences...\n");
  int seqLen;
  
  // open up output file
  FILE *fo1, *fo2, *foD;
  char fileName1[100] = "part1_", fileName2[100] = "part2_";
  char debugName[100] = "synthDebug_";
  if(bowtieOutput == 0){
      fo1 = fopen(argv[argc - 1], "w");
      fo2 = fo1;
  }else{
      strcat(fileName1, argv[argc - 1]);
      strcat(fileName2, argv[argc - 1]);
      strcat(debugName, argv[argc - 1]);
      fo1 = fopen(fileName1, "w");
      fo2 = fopen(fileName2, "w");
      foD = fopen(debugName, "w");
  }
  
  // seed the random number generator
  unsigned int iseed = (unsigned int)time(NULL);
  srand (iseed);
  
  int insertLength;
  int placement;
  int leftReadLength;
  int rightReadLength;
  int readOn = 0;

  while ((l = kseq_read(seq)) >= 0) {
    seqLen = (unsigned int)(seq->seq.l);
    printf("Name of assembly seq to parse: %s\n", seq->name.s);
    if (seq->comment.l) printf("comment: %s\n", seq->comment.s);
    printf("length: %d\n", seqLen);

    int *placementDepth = (int*) calloc(seqLen, sizeof(int));
    for(i=0; i<seqLen; i++){
        placementDepth[i] = 0;
    }
    
    for(readOn = 0; readOn < numReads; readOn++){
      // decide if this is going to be an inward or outward facing read
      
      // INWARD CODE FIRST
      
      if(rand()/( RAND_MAX + 1.0 ) < inwardProb){ // we are making an inward facing read!
        if(insDistToUse == 1){ // use normal distribution
          insertLength = (int)TruncatedNormal(inwardInsLenMean, inwardInsLenSigma, 10, seqLen);
        }
        // now we want to place it uniformly
        placement = (int)(rand()/( RAND_MAX + 1.0 )*(seqLen - insertLength));
        if(lenDistToUse == 1){ // use normal distribution
          leftReadLength = (int)TruncatedNormal(readLengthMean, readLengthSigma, 10, insertLength);
          rightReadLength = (int)TruncatedNormal(readLengthMean, readLengthSigma, 10, insertLength);
        }

        for(i = 0; i < leftReadLength; i++){
            placementDepth[placement + i]++;
        }
        for(i = 0; i < rightReadLength; i++){
            placementDepth[placement + insertLength - 1 - i]++;
        }
    
        if(rand()/( RAND_MAX + 1.0 ) < 0.5){ // forward first
          fprintf(fo1, "@synthR%iFi1,p:%i,i:%i\n", readOn, placement, insertLength);
          for(i = 0; i < leftReadLength; i++){
            if(i < perfectStart){
              fprintf(fo1, "%c",getBaseWithError(seq->seq.s[placement + i], 1.0));
            }else{
              fprintf(fo1, "%c",getBaseWithError(seq->seq.s[placement + i], errorRate));
            }
          }
          fprintf(fo1, "\n+\n");
          for(i = 0; i < leftReadLength; i++){fprintf(fo1, "%c",illuminaChar);}
          fprintf(fo1, "\n");
          fprintf(fo2, "@synthR%iFi1,p:%i,i:%i\n", readOn, placement, insertLength);
          for(i = 0; i < rightReadLength; i++){
            if(i < perfectStart){
              fprintf(fo2, "%c",getBaseWithError(getComplimentRes(seq->seq.s[placement + insertLength - 1 - i]), 1.0));
            }else{
              fprintf(fo2, "%c",getBaseWithError(getComplimentRes(seq->seq.s[placement + insertLength - 1 - i]), errorRate));
            }
          }
          fprintf(fo2, "\n+\n");
          for(i = 0; i < rightReadLength; i++){fprintf(fo2, "%c",illuminaChar);}
          fprintf(fo2, "\n");
        }else{ // backward first
          fprintf(fo1, "@synthR%iFi1,p:%i,i:%i\n", readOn, placement, insertLength);
          for(i = 0; i < rightReadLength; i++){
            if(i < perfectStart){
              fprintf(fo1, "%c",getBaseWithError(getComplimentRes(seq->seq.s[placement + insertLength - 1 - i]), 1.0));
            }else{
              fprintf(fo1, "%c",getBaseWithError(getComplimentRes(seq->seq.s[placement + insertLength - 1 - i]), errorRate));
            }
          }
          fprintf(fo1, "\n+\n");
          for(i = 0; i < rightReadLength; i++){fprintf(fo1, "%c",illuminaChar);}
          fprintf(fo1, "\n");
          fprintf(fo2, "@synthR%iFi1,p:%i,i:%i\n", readOn, placement, insertLength);
          for(i = 0; i < leftReadLength; i++){
            if(i < perfectStart){
              fprintf(fo2, "%c",getBaseWithError(seq->seq.s[placement + i], 1.0));
            }else{
              fprintf(fo2, "%c",getBaseWithError(seq->seq.s[placement + i], errorRate));
            }
          }
          fprintf(fo2, "\n+\n");
          for(i = 0; i < leftReadLength; i++){fprintf(fo2, "%c",illuminaChar);}
          fprintf(fo2, "\n");
        }
      }else{ // make an outward facing read

        // OUTWARD FACING READ

        if(insDistToUse == 1){ // use normal distribution
          insertLength = (int)TruncatedNormal(outwardInsLenMean, outwardInsLenSigma, 10, seqLen);
        }
        // now we want to place it uniformly
        placement = (int)(rand()/( RAND_MAX + 1.0 )*(seqLen - insertLength));
        if(lenDistToUse == 1){ // use normal distribution
          leftReadLength = (int)TruncatedNormal(readLengthMean, readLengthSigma, 10, insertLength);
          rightReadLength = (int)TruncatedNormal(readLengthMean, readLengthSigma, 10, insertLength);
        }

        for(i = 0; i < leftReadLength; i++){
            placementDepth[placement + leftReadLength - i]++;
        }
        for(i = 0; i < rightReadLength; i++){
            placementDepth[placement + insertLength - 1 - rightReadLength + i]++;
        }

        if(rand()/( RAND_MAX + 1.0 ) < 0.5){ // the left read first
          fprintf(fo1, "@synthR%iL,p:%i,i:%i\n", readOn, placement, insertLength);
          for(i = 0; i < leftReadLength; i++){
            if(i < perfectStart){
              fprintf(fo1, "%c",getBaseWithError(getComplimentRes(seq->seq.s[placement + leftReadLength - i]), 1.0));
            }else{
              fprintf(fo1, "%c",getBaseWithError(getComplimentRes(seq->seq.s[placement + leftReadLength - i]), errorRate));
            }
          }
          fprintf(fo1, "\n+\n");
          for(i = 0; i < leftReadLength; i++){fprintf(fo1, "%c",illuminaChar);}
          fprintf(fo1, "\n");
          fprintf(fo2, "@synthR%iL,p:%i,i:%i\n", readOn, placement, insertLength);
          for(i = 0; i < rightReadLength; i++){
            if(i < perfectStart){
              fprintf(fo2, "%c",getBaseWithError(seq->seq.s[placement + insertLength - 1 - rightReadLength + i], 1.0));
            }else{
              fprintf(fo2, "%c",getBaseWithError(seq->seq.s[placement + insertLength - 1 - rightReadLength + i], errorRate));
            }
          }
          fprintf(fo2, "\n+\n");
          for(i = 0; i < rightReadLength; i++){fprintf(fo2, "%c",illuminaChar);}
          fprintf(fo2, "\n");
        }else{ // the right read first
          fprintf(fo1, "@synthR%iL,p:%i,i:%i\n", readOn, placement, insertLength);
          for(i = 0; i < rightReadLength; i++){
            if(i < perfectStart){
              fprintf(fo1, "%c",getBaseWithError(seq->seq.s[placement + insertLength - 1 - rightReadLength + i], 1.0));
            }else{
              fprintf(fo1, "%c",getBaseWithError(seq->seq.s[placement + insertLength - 1 - rightReadLength + i], errorRate));
            }
          }
          fprintf(fo1, "\n+\n");
          for(i = 0; i < rightReadLength; i++){fprintf(fo1, "%c",illuminaChar);}
          fprintf(fo1, "\n");
          fprintf(fo2, "@synthR%il,p:%i,i:%i\n", readOn, placement, insertLength);
          for(i = 0; i < leftReadLength; i++){
            if(i < perfectStart){
              fprintf(fo2, "%c",getBaseWithError(getComplimentRes(seq->seq.s[placement + leftReadLength - i]), 1.0));
            }else{
              fprintf(fo2, "%c",getBaseWithError(getComplimentRes(seq->seq.s[placement + leftReadLength - i]), errorRate));
            }
          }
          fprintf(fo2, "\n+\n");
          for(i = 0; i < leftReadLength; i++){fprintf(fo2, "%c",illuminaChar);}
          fprintf(fo2, "\n");
        }
      }
    }

    for(i=0; i<seqLen; i++){
        fprintf(foD, "%d\n",placementDepth[i]);
    }
    free(placementDepth);
  }
  fclose(fo1);
  if (bowtieOutput != 0) {
	  fclose(fo2);
	  fclose(foD);
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
cmpl $0x1, %edi
jne 0x1664
leaq 0x31fa(%rip), %rdi      # 0x4832
callq 0x1040
movq (%rbx), %rsi
leaq 0x2d1d(%rip), %rdi      # 0x4364
xorl %eax, %eax
callq 0x1070
leaq 0x3223(%rip), %rdi      # 0x4878
callq 0x1040
movl $0x1, %ebp
jmp 0x2dbb
movl %edi, %r15d
movq 0x8(%rbx), %rax
movb (%rax), %cl
cmpl $0x2, %edi
jg 0x167f
cmpb $0x2d, %cl
jne 0x1631
cmpb $0x68, 0x1(%rax)
jne 0x1631
jmp 0x168a
cmpb $0x2d, %cl
jne 0x16b5
cmpb $0x68, 0x1(%rax)
jne 0x16b5
leaq 0x31a1(%rip), %rdi      # 0x4832
callq 0x1040
movq (%rbx), %rsi
leaq 0x2cf2(%rip), %rdi      # 0x4392
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1070
leaq 0x2e97(%rip), %rdi      # 0x4547
jmp 0x2db6
cmpl $0x5, %r15d
jb 0x1ad9
leal -0x2(%r15), %r14d
movss 0x29d9(%rip), %xmm4     # 0x40a4
movss 0x29d5(%rip), %xmm0     # 0x40a8
movss %xmm0, 0x38(%rsp)
movss 0x29bf(%rip), %xmm1     # 0x40a0
movss 0x29b3(%rip), %xmm5     # 0x409c
movss 0x29a7(%rip), %xmm0     # 0x4098
movss %xmm0, 0x48(%rsp)
movss 0x2995(%rip), %xmm0     # 0x4094
movss %xmm0, 0x44(%rsp)
movb $0x5e, %r12b
movss 0x299c(%rip), %xmm0     # 0x40ac
movss %xmm0, 0x8(%rsp)
movl $0x3e8, 0x5c(%rsp)      # imm = 0x3E8
movss 0x296a(%rip), %xmm0     # 0x4090
movl $0x0, 0x30(%rsp)
movl $0x1, %r13d
leaq 0x2975(%rip), %rbp      # 0x40b0
movl $0x1, 0x20(%rsp)
movl $0x1, 0x58(%rsp)
movl $0x0, 0x50(%rsp)
movslq %r13d, %rax
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x2d89
movzbl 0x1(%rsi), %ecx
leal -0x62(%rcx), %edx
cmpl $0x10, %edx
ja 0x2d89
movslq (%rbp,%rdx,4), %rdx
addq %rbp, %rdx
jmpq *%rdx
decl %r13d
movl $0x1, 0x50(%rsp)
jmp 0x1a91
cmpb $0x64, 0x2(%rsi)
jne 0x2d89
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, 0xc(%rsp)
movss %xmm4, 0x10(%rsp)
movss %xmm1, 0x14(%rsp)
movss %xmm5, 0x18(%rsp)
callq 0x1150
movss 0x18(%rsp), %xmm5
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm4
movss 0xc(%rsp), %xmm0
movl %eax, 0x58(%rsp)
jmp 0x1a91
cmpb $0x72, 0x2(%rsi)
jne 0x2d89
movq 0x8(%rbx,%rax,8), %rax
movsbq (%rax), %r12
leaq 0x290c(%rip), %rax      # 0x4100
xorps %xmm2, %xmm2
cvtsd2ss -0x200(%rax,%r12,8), %xmm2
movss %xmm2, 0x8(%rsp)
jmp 0x1a91
cmpb $0x72, 0x2(%rsi)
jne 0x2d89
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, 0xc(%rsp)
movss %xmm4, 0x10(%rsp)
movss %xmm1, 0x14(%rsp)
movss %xmm5, 0x18(%rsp)
callq 0x1050
movss 0x18(%rsp), %xmm5
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm4
cvttsd2si %xmm0, %eax
movl %eax, 0x5c(%rsp)
jmp 0x1a8b
cmpb $0x64, 0x2(%rsi)
movss %xmm1, 0x14(%rsp)
movss %xmm5, 0x18(%rsp)
jne 0x18da
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, 0xc(%rsp)
movss %xmm4, 0x10(%rsp)
callq 0x1150
movss 0x18(%rsp), %xmm5
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm4
movss 0xc(%rsp), %xmm0
movl %eax, 0x20(%rsp)
jmp 0x1a91
cmpb $0x6d, 0x2(%rsi)
jne 0x190b
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, 0xc(%rsp)
movss %xmm4, 0x10(%rsp)
movss %xmm5, 0x18(%rsp)
callq 0x1050
movss 0x18(%rsp), %xmm5
movss 0x10(%rsp), %xmm4
xorps %xmm1, %xmm1
cvtsd2ss %xmm0, %xmm1
jmp 0x1a8b
cmpb $0x6d, 0x2(%rsi)
jne 0x1949
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm4, 0x10(%rsp)
callq 0x1050
movss 0x18(%rsp), %xmm5
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm4
cvtsd2ss %xmm0, %xmm0
jmp 0x1a91
cmpb $0x73, 0x2(%rsi)
jne 0x19b4
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, 0xc(%rsp)
movss %xmm4, 0x10(%rsp)
movss %xmm1, 0x14(%rsp)
callq 0x1050
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm4
xorps %xmm5, %xmm5
cvtsd2ss %xmm0, %xmm5
jmp 0x1a8b
cmpb $0x70, 0x2(%rsi)
jne 0x1986
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, 0xc(%rsp)
movss %xmm4, 0x10(%rsp)
callq 0x1050
movss 0x18(%rsp), %xmm5
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm4
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x38(%rsp)
jmp 0x1a8b
cmpb $0x73, 0x2(%rsi)
jne 0x19b4
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, 0xc(%rsp)
callq 0x1050
movss 0x18(%rsp), %xmm5
movss 0x14(%rsp), %xmm1
xorps %xmm4, %xmm4
cvtsd2ss %xmm0, %xmm4
jmp 0x1a8b
cmpl $0x62, %ecx
je 0x177d
cmpl $0x70, %ecx
je 0x1a11
cmpl $0x72, %ecx
jne 0x2d89
cmpb $0x6c, 0x2(%rsi)
movss %xmm0, 0xc(%rsp)
movss %xmm4, 0x10(%rsp)
movss %xmm1, 0x14(%rsp)
movss %xmm5, 0x18(%rsp)
jne 0x1a5b
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1050
movss 0x18(%rsp), %xmm5
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm4
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x48(%rsp)
jmp 0x1a8b
cmpb $0x73, 0x2(%rsi)
jne 0x2d89
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, 0xc(%rsp)
movss %xmm4, 0x10(%rsp)
movss %xmm1, 0x14(%rsp)
movss %xmm5, 0x18(%rsp)
callq 0x1150
movss 0x18(%rsp), %xmm5
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm4
movss 0xc(%rsp), %xmm0
movl %eax, 0x30(%rsp)
jmp 0x1a91
cmpb $0x73, 0x2(%rsi)
jne 0x2d89
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1050
movss 0x18(%rsp), %xmm5
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm4
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x44(%rsp)
movss 0xc(%rsp), %xmm0
addl $0x2, %r13d
cmpl %r14d, %r13d
jl 0x1753
xorps %xmm2, %xmm2
cvtss2sd 0x38(%rsp), %xmm2
cvtss2sd 0x8(%rsp), %xmm3
movsbl %r12b, %ecx
cmpl $0x0, 0x50(%rsp)
sete 0x1f(%rsp)
movss 0x48(%rsp), %xmm6
movl 0x5c(%rsp), %eax
movss 0x44(%rsp), %xmm7
movl 0x58(%rsp), %edx
movl 0x20(%rsp), %esi
movl 0x30(%rsp), %ebp
jmp 0x1b34
movl $0x1, %edx
movss 0x25aa(%rip), %xmm0     # 0x4090
movl $0x3e8, %eax            # imm = 0x3E8
movsd 0x2585(%rip), %xmm3     # 0x4078
movl $0x5e, %ecx
movb $0x1, 0x1f(%rsp)
movss 0x258f(%rip), %xmm7     # 0x4094
movss 0x258b(%rip), %xmm6     # 0x4098
movss 0x2587(%rip), %xmm5     # 0x409c
movss 0x2583(%rip), %xmm1     # 0x40a0
movsd 0x24f3(%rip), %xmm2     # 0x4018
movss 0x2577(%rip), %xmm4     # 0x40a4
xorl %ebp, %ebp
movl $0x1, %esi
movl %eax, 0x5c(%rsp)
movss %xmm0, 0xc(%rsp)
cvtss2sd %xmm0, %xmm0
movss %xmm1, 0x14(%rsp)
cvtss2sd %xmm1, %xmm1
movss %xmm4, 0x10(%rsp)
cvtss2sd %xmm4, %xmm4
movss %xmm5, 0x18(%rsp)
cvtss2sd %xmm5, %xmm5
movss %xmm6, 0x48(%rsp)
cvtss2sd %xmm6, %xmm6
movss %xmm7, 0x44(%rsp)
cvtss2sd %xmm7, %xmm7
leaq 0x287b(%rip), %rdi      # 0x43f6
movl %esi, 0x20(%rsp)
movl %edx, 0x58(%rsp)
movsd %xmm2, 0xb8(%rsp)
movsd %xmm3, 0x50(%rsp)
movl %ecx, 0x40(%rsp)
movl %ebp, %r8d
movb $0x8, %al
callq 0x1070
movl %r15d, %r14d
movq -0x10(%rbx,%r14,8), %rsi
leaq 0x28c9(%rip), %rdi      # 0x4478
xorl %eax, %eax
callq 0x1070
movq -0x8(%rbx,%r14,8), %rsi
leaq 0x28c6(%rip), %rdi      # 0x4488
xorl %eax, %eax
callq 0x1070
movq -0x10(%rbx,%r14,8), %rdi
leaq 0x28c4(%rip), %rsi      # 0x4499
callq 0x1130
movq %rax, %r13
movl $0x1, %edi
movl $0x70, %esi
callq 0x10c0
movq %rax, %r12
movl $0x1, %edi
movl $0x20, %esi
callq 0x10c0
movq %rax, %r15
movq %r13, 0x18(%rax)
movl $0x4000, %edi           # imm = 0x4000
callq 0x1110
movq %rax, (%r15)
movq %r15, 0x68(%r12)
leaq 0x2903(%rip), %rdi      # 0x4521
callq 0x1040
xorps %xmm0, %xmm0
movaps %xmm0, 0x130(%rsp)
xorl %edx, %edx
movl %edx, 0x190(%rsp)
movaps %xmm0, 0x180(%rsp)
movaps %xmm0, 0x170(%rsp)
movaps %xmm0, 0x160(%rsp)
movaps %xmm0, 0x150(%rsp)
movaps %xmm0, 0x140(%rsp)
movl $0x74726170, %eax       # imm = 0x74726170
movl %eax, 0x130(%rsp)
movw $0x5f31, 0x134(%rsp)    # imm = 0x5F31
movaps %xmm0, 0xc0(%rsp)
movl %edx, 0x120(%rsp)
movaps %xmm0, 0x110(%rsp)
movaps %xmm0, 0x100(%rsp)
movaps %xmm0, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movl %eax, 0xc0(%rsp)
movw $0x5f32, 0xc4(%rsp)     # imm = 0x5F32
leaq 0x263c(%rip), %rsi      # 0x4300
leaq 0x1a0(%rsp), %rax
movl $0xc, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl %edx, 0x60(%rax)
movq -0x8(%rbx,%r14,8), %rbx
movb 0x1f(%rsp), %al
testb %al, %al
movq %r12, 0x60(%rsp)
je 0x1d05
leaq 0x27a8(%rip), %rsi      # 0x449b
movq %rbx, %rdi
callq 0x1140
movq %rax, %r13
movq %rax, 0x30(%rsp)
jmp 0x1d81
leaq 0x130(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1160
leaq 0xc0(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1160
movl %ebp, %r14d
leaq 0x1a0(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1160
leaq 0x2753(%rip), %rbx      # 0x449b
movq %r12, %rdi
movq 0x60(%rsp), %r12
movq %rbx, %rsi
callq 0x1140
movq %rax, 0x30(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1140
movq %rax, %r13
movq %rbp, %rdi
movl %r14d, %ebp
movq %rbx, %rsi
callq 0x1140
movq %rax, 0x88(%rsp)
xorl %edi, %edi
callq 0x1100
movl %eax, %edi
callq 0x10b0
leaq 0x48(%r12), %rax
movq %rax, 0xa0(%rsp)
leaq 0x30(%r12), %rax
movq %rax, 0x98(%rsp)
movq %r12, %rax
addq $0x18, %rax
movq %rax, 0xa8(%rsp)
movslq %ebp, %rbp
xorl %eax, %eax
movq %rcx, 0x38(%rsp)
movq %r13, 0x68(%rsp)
movq %rbp, 0xb0(%rsp)
testl %eax, %eax
jne 0x1e47
movl 0x8(%r15), %ecx
movl 0xc(%r15), %eax
cmpl $0x0, 0x10(%r15)
je 0x1dea
cmpl %eax, %ecx
jge 0x2d5f
cmpl %eax, %ecx
jl 0x1e22
movl $0x0, 0x8(%r15)
movq (%r15), %rsi
movq 0x18(%r15), %rdi
movl $0x4000, %edx           # imm = 0x4000
callq 0x10d0
movl %eax, 0xc(%r15)
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0x1e22
movl $0x1, 0x10(%r15)
testl %eax, %eax
je 0x2d5f
movq (%r15), %rdx
movslq 0x8(%r15), %rsi
leal 0x1(%rsi), %ecx
movl %ecx, 0x8(%r15)
movzbl (%rdx,%rsi), %edx
movl %edx, 0x4c(%rsp)
cmpl $0x40, %edx
je 0x1e42
cmpl $0x3e, %edx
jne 0x1ddb
movl %edx, 0x60(%r12)
xorl %eax, %eax
movq %rax, 0x48(%r12)
movq %rax, 0x30(%r12)
movq %rax, 0x18(%r12)
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
leaq 0x4c(%rsp), %rcx
xorl %r8d, %r8d
callq 0x2dcf
testl %eax, %eax
js 0x2d5f
cmpl $0xa, 0x4c(%rsp)
je 0x1e96
movq %r15, %rdi
movl $0x2, %esi
movq 0xa8(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2dcf
cmpq $0x0, 0x40(%r12)
jne 0x1eb6
movq $0x100, 0x38(%r12)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x1110
movq %rax, 0x40(%r12)
cmpl $0x0, 0x10(%r15)
sete %dl
movl 0xc(%r15), %eax
cmpl %eax, 0x8(%r15)
setl %cl
orb %cl, %dl
testb $0x1, %dl
je 0x1f93
testb $0x1, %cl
jne 0x1f0d
movl $0x0, 0x8(%r15)
movq (%r15), %rsi
movq 0x18(%r15), %rdi
movl $0x4000, %edx           # imm = 0x4000
callq 0x10d0
movl %eax, 0xc(%r15)
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0x1f0d
movl $0x1, 0x10(%r15)
testl %eax, %eax
je 0x1f93
movq (%r15), %rcx
movslq 0x8(%r15), %rsi
leal 0x1(%rsi), %edx
movl %edx, 0x8(%r15)
movb (%rcx,%rsi), %cl
movzbl %cl, %esi
movl %esi, 0x4c(%rsp)
cmpl $0x2a, %esi
jg 0x1f31
cmpl $0xa, %esi
je 0x1f7b
jmp 0x1f40
cmpl $0x2b, %esi
je 0x1fa2
cmpl $0x3e, %esi
je 0x1f9d
cmpl $0x40, %esi
je 0x1f9d
movq 0x30(%r12), %rax
movq 0x40(%r12), %rdx
leaq 0x1(%rax), %rsi
movq %rsi, 0x30(%r12)
movb %cl, (%rdx,%rax)
movq %r15, %rdi
movl $0x2, %esi
movq 0x98(%rsp), %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x2dcf
movl 0x8(%r15), %edx
movl 0xc(%r15), %eax
cmpl %eax, %edx
setl %cl
cmpl $0x0, 0x10(%r15)
je 0x1ed4
cmpl %eax, %edx
jl 0x1ed4
movl $0xffffffff, 0x4c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1fa2
movl %esi, 0x60(%r12)
movq 0x30(%r12), %rsi
movq 0x38(%r12), %rbx
leaq 0x1(%rsi), %rcx
movq 0x40(%r12), %rax
cmpq %rbx, %rcx
jb 0x200d
movq %rcx, %rdx
shrq %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x2, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x4, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x8, %rcx
orq %rdx, %rcx
movq %rcx, %rbx
shrq $0x10, %rbx
orq %rcx, %rbx
incq %rbx
movq %rbx, 0x38(%r12)
movq %rsi, 0x78(%rsp)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1120
movq 0x78(%rsp), %rsi
movq %rax, 0x40(%r12)
movb $0x0, (%rax,%rsi)
cmpl $0x2b, 0x4c(%rsp)
jne 0x20ed
cmpq %rbx, 0x50(%r12)
jae 0x203a
movq %rbx, 0x50(%r12)
movq 0x58(%r12), %rdi
movq %rbx, %rsi
callq 0x1120
movq %rax, 0x58(%r12)
movl 0x8(%r15), %ecx
movl 0xc(%r15), %eax
cmpl $0x0, 0x10(%r15)
je 0x2051
cmpl %eax, %ecx
jge 0x2d5f
cmpl %eax, %ecx
jl 0x2089
movl $0x0, 0x8(%r15)
movq (%r15), %rsi
movq 0x18(%r15), %rdi
movl $0x4000, %edx           # imm = 0x4000
callq 0x10d0
movl %eax, 0xc(%r15)
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0x2089
movl $0x1, 0x10(%r15)
testl %eax, %eax
je 0x2d5f
movq (%r15), %rdx
movslq 0x8(%r15), %rsi
leal 0x1(%rsi), %ecx
movl %ecx, 0x8(%r15)
movzbl (%rdx,%rsi), %edx
movl %edx, 0x4c(%rsp)
cmpl $0xa, %edx
jne 0x2042
movq 0xa0(%rsp), %rbx
movq %r15, %rdi
movl $0x2, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x2dcf
movq 0x98(%rsp), %rcx
movq (%rcx), %rsi
movq (%rbx), %rcx
testl %eax, %eax
js 0x20db
cmpq %rsi, %rcx
jb 0x20ac
movl $0x0, 0x60(%r12)
cmpq %rcx, %rsi
jne 0x2d5f
testl %esi, %esi
js 0x2d5f
movq %rsi, 0x78(%rsp)
movq 0x10(%r12), %rsi
leaq 0x2397(%rip), %rdi      # 0x449d
xorl %eax, %eax
callq 0x1070
cmpq $0x0, 0x18(%r12)
movq 0x30(%rsp), %r15
je 0x212d
movq 0x28(%r12), %rsi
leaq 0x239a(%rip), %rdi      # 0x44c0
xorl %eax, %eax
callq 0x1070
leaq 0x2399(%rip), %rdi      # 0x44cd
movq 0x78(%rsp), %rbx
movl %ebx, %esi
xorl %eax, %eax
callq 0x1070
movl %ebx, %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movl $0x4, %esi
callq 0x10c0
movq %rax, 0x80(%rsp)
testl %ebx, %ebx
jle 0x2180
movl %ebx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
shlq $0x2, %rdx
movq 0x80(%rsp), %rdi
xorl %esi, %esi
callq 0x1080
movq 0x78(%rsp), %rbx
cmpl $0x0, 0x5c(%rsp)
jle 0x2ceb
cvtsi2ss %ebx, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x90(%rsp)
xorl %r12d, %r12d
movl 0x20(%rsp), %ebx
callq 0x1190
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x1e51(%rip), %xmm0     # 0x4008
movsd 0xb8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movl %r12d, 0x24(%rsp)
jbe 0x2408
cmpl $0x1, %ebx
jne 0x220b
movss 0xc(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
callq 0x1426
movl $0xa, %r14d
movsd 0x1e8d(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
ja 0x220b
movsd 0x90(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %r14d
callq 0x1190
cvtsi2sd %eax, %xmm2
mulsd 0x1dec(%rip), %xmm2     # 0x4008
cmpl $0x1, 0x58(%rsp)
movss 0x48(%rsp), %xmm0
movss 0x44(%rsp), %xmm1
jne 0x22b7
movsd %xmm2, 0x28(%rsp)
xorps %xmm2, %xmm2
cvtsi2ss %r14d, %xmm2
movss %xmm2, 0x70(%rsp)
callq 0x1426
movl $0xa, 0x8(%rsp)
movsd 0x1e24(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
movl $0xa, %eax
ja 0x2278
xorps %xmm1, %xmm1
cvtss2sd 0x70(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movq %rax, 0x38(%rsp)
movss 0x48(%rsp), %xmm0
movss 0x44(%rsp), %xmm1
callq 0x1426
movsd 0x1dea(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
ja 0x22b1
xorps %xmm1, %xmm1
cvtss2sd 0x70(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x8(%rsp)
movsd 0x28(%rsp), %xmm2
movq 0x78(%rsp), %rax
subl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %r13d
movq 0x38(%rsp), %rax
testl %eax, %eax
movl 0x8(%rsp), %esi
movq 0x80(%rsp), %rdi
jle 0x22fa
movslq %r13d, %rcx
movl %eax, %eax
leaq (%rdi,%rcx,4), %rcx
xorl %edx, %edx
incl (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x22ef
movl %esi, %ebx
testl %esi, %esi
jle 0x2315
leal (%r14,%r13), %eax
decl %eax
movq %rbx, %rcx
cltq
incl (%rdi,%rax,4)
decl %eax
decq %rcx
jne 0x2309
callq 0x1190
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x1cdf(%rip), %xmm0     # 0x4008
movsd %xmm0, 0x28(%rsp)
movq %r15, %rdi
leaq 0x21a0(%rip), %rsi      # 0x44d9
movl %r12d, %edx
movl %r13d, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x10e0
movsd 0x1cc7(%rip), %xmm0     # 0x4018
ucomisd 0x28(%rsp), %xmm0
movq %r14, 0x28(%rsp)
movq %r13, 0x70(%rsp)
jbe 0x268d
movq 0x38(%rsp), %rax
testl %eax, %eax
jle 0x281d
movslq %r13d, %r14
movl %eax, %r15d
movq 0x60(%rsp), %rax
addq 0x40(%rax), %r14
xorl %r12d, %r12d
movsd 0x1cfa(%rip), %xmm0     # 0x4088
cmpq %rbp, %r12
jl 0x2399
movsd 0x50(%rsp), %xmm0
movsbl (%r14,%r12), %edi
callq 0x12cd
movsbl %al, %edi
movq 0x30(%rsp), %rsi
callq 0x10a0
incq %r12
cmpq %r12, %r15
jne 0x2386
movl $0x3, %esi
movl $0x1, %edx
leaq 0x2128(%rip), %rdi      # 0x44f1
movq 0x30(%rsp), %r13
movq %r13, %rcx
callq 0x1170
cmpl $0x0, 0x38(%rsp)
movl 0x40(%rsp), %r15d
movl 0x24(%rsp), %r12d
jle 0x2839
movq 0x38(%rsp), %rax
movl %eax, %r14d
movl %r15d, %edi
movq %r13, %rsi
callq 0x10a0
decl %r14d
jne 0x23f3
jmp 0x2839
cmpl $0x1, %ebx
jne 0x2444
movss 0x14(%rsp), %xmm0
movss 0x18(%rsp), %xmm1
callq 0x1426
movl $0xa, %r14d
movsd 0x1c54(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
ja 0x2444
movsd 0x90(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %r14d
callq 0x1190
cvtsi2sd %eax, %xmm2
mulsd 0x1bb3(%rip), %xmm2     # 0x4008
cmpl $0x1, 0x58(%rsp)
movss 0x48(%rsp), %xmm0
movss 0x44(%rsp), %xmm1
jne 0x24f0
movsd %xmm2, 0x28(%rsp)
xorps %xmm2, %xmm2
cvtsi2ss %r14d, %xmm2
movss %xmm2, 0x70(%rsp)
callq 0x1426
movl $0xa, 0x8(%rsp)
movsd 0x1beb(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
movl $0xa, %eax
ja 0x24b1
xorps %xmm1, %xmm1
cvtss2sd 0x70(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movq %rax, 0x38(%rsp)
movss 0x48(%rsp), %xmm0
movss 0x44(%rsp), %xmm1
callq 0x1426
movsd 0x1bb1(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
ja 0x24ea
xorps %xmm1, %xmm1
cvtss2sd 0x70(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x8(%rsp)
movsd 0x28(%rsp), %xmm2
movq 0x78(%rsp), %rax
subl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %ebx
movq 0x38(%rsp), %rax
testl %eax, %eax
movl 0x8(%rsp), %esi
movq 0x80(%rsp), %rdi
jle 0x252e
movl %eax, %eax
movl %ebx, %ecx
leal (%rcx,%rax), %edx
movslq %edx, %rdx
incl (%rdi,%rdx,4)
decq %rax
jne 0x2520
testl %esi, %esi
jle 0x2551
movl %esi, %ecx
notl %ecx
addl %r14d, %ecx
addl %ebx, %ecx
movslq %ecx, %rcx
movl %esi, %eax
leaq (%rdi,%rcx,4), %rcx
xorl %edx, %edx
incl (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x2546
callq 0x1190
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x1aa3(%rip), %xmm0     # 0x4008
movsd %xmm0, 0x28(%rsp)
movq %r15, %rdi
leaq 0x1f80(%rip), %rsi      # 0x44f5
movl %r12d, %edx
movl %ebx, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x10e0
movsd 0x1a8c(%rip), %xmm0     # 0x4018
ucomisd 0x28(%rsp), %xmm0
movq %r14, 0x28(%rsp)
jbe 0x2777
movq 0x38(%rsp), %rax
testl %eax, %eax
jle 0x2958
movl %eax, %r14d
movq 0x60(%rsp), %rcx
movq 0x40(%rcx), %r15
negq %r14
leal (%rax,%rbx), %r13d
xorl %r12d, %r12d
movslq %r13d, %rax
movzbl (%r15,%rax), %eax
cmpq %rbp, %r12
jge 0x25e0
cmpl $0x41, %eax
je 0x2601
cmpl $0x47, %eax
je 0x25f9
cmpl $0x54, %eax
jne 0x2609
movb $0x41, %al
jmp 0x260b
cmpl $0x41, %eax
movsd 0x50(%rsp), %xmm0
je 0x2605
cmpl $0x47, %eax
je 0x25fd
cmpl $0x54, %eax
jne 0x2618
movb $0x41, %al
jmp 0x261a
movb $0x43, %al
jmp 0x260b
movb $0x43, %al
jmp 0x261a
movb $0x54, %al
jmp 0x260b
movb $0x54, %al
jmp 0x261a
movb $0x47, %al
movzbl %al, %edi
movsd 0x1a72(%rip), %xmm0     # 0x4088
jmp 0x261d
movb $0x47, %al
movzbl %al, %edi
callq 0x12cd
movsbl %al, %edi
movq 0x30(%rsp), %rsi
callq 0x10a0
incq %r12
decl %r13d
movq %r14, %rax
addq %r12, %rax
jne 0x25c0
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1ea3(%rip), %rdi      # 0x44f1
movq 0x30(%rsp), %r15
movq %r15, %rcx
callq 0x1170
cmpl $0x0, 0x38(%rsp)
movl 0x40(%rsp), %r12d
movq 0x68(%rsp), %r13
jle 0x2976
movq 0x38(%rsp), %rax
movl %eax, %r14d
movl %r12d, %edi
movq %r15, %rsi
callq 0x10a0
decl %r14d
jne 0x2678
jmp 0x2976
cmpl $0x0, 0x8(%rsp)
jle 0x2a41
movq 0x60(%rsp), %rax
movq 0x40(%rax), %r14
movq 0x28(%rsp), %rax
leal (%rax,%r13), %r15d
decl %r15d
xorl %r12d, %r12d
movslq %r15d, %rax
movzbl (%r14,%rax), %eax
cmpq %rbp, %r12
movsd 0x50(%rsp), %xmm0
jge 0x26d6
cmpl $0x41, %eax
je 0x26f1
cmpl $0x47, %eax
je 0x26e9
cmpl $0x54, %eax
jne 0x26f9
movb $0x41, %al
jmp 0x26fb
cmpl $0x41, %eax
je 0x26f5
cmpl $0x47, %eax
je 0x26ed
cmpl $0x54, %eax
jne 0x2708
movb $0x41, %al
jmp 0x270a
movb $0x43, %al
jmp 0x26fb
movb $0x43, %al
jmp 0x270a
movb $0x54, %al
jmp 0x26fb
movb $0x54, %al
jmp 0x270a
movb $0x47, %al
movzbl %al, %edi
movsd 0x1982(%rip), %xmm0     # 0x4088
jmp 0x270d
movb $0x47, %al
movzbl %al, %edi
callq 0x12cd
movsbl %al, %edi
movq 0x30(%rsp), %rsi
callq 0x10a0
incq %r12
decl %r15d
cmpq %r12, %rbx
jne 0x26b0
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1db6(%rip), %rdi      # 0x44f1
movq 0x30(%rsp), %r13
movq %r13, %rcx
callq 0x1170
cmpl $0x0, 0x8(%rsp)
movl 0x40(%rsp), %r15d
movl 0x24(%rsp), %r12d
jle 0x2a5d
movl 0x8(%rsp), %r14d
movl %r15d, %edi
movq %r13, %rsi
callq 0x10a0
decl %r14d
jne 0x2762
jmp 0x2a5d
movl 0x8(%rsp), %edx
testl %edx, %edx
jle 0x2b43
movl %edx, %ecx
notl %ecx
addl %r14d, %ecx
addl %ebx, %ecx
movslq %ecx, %r14
movl %edx, %r15d
movq 0x60(%rsp), %rax
addq 0x40(%rax), %r14
xorl %r12d, %r12d
movsd 0x18e2(%rip), %xmm0     # 0x4088
cmpq %rbp, %r12
jl 0x27b1
movsd 0x50(%rsp), %xmm0
movsbl (%r14,%r12), %edi
callq 0x12cd
movsbl %al, %edi
movq 0x30(%rsp), %rsi
callq 0x10a0
incq %r12
cmpq %r12, %r15
jne 0x279e
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1d10(%rip), %rdi      # 0x44f1
movq 0x30(%rsp), %r13
movq %r13, %rcx
callq 0x1170
cmpl $0x0, 0x8(%rsp)
movl 0x40(%rsp), %r15d
movl 0x24(%rsp), %r12d
jle 0x2b5f
movl 0x8(%rsp), %r14d
movl %r15d, %edi
movq %r13, %rsi
callq 0x10a0
decl %r14d
jne 0x2808
jmp 0x2b5f
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1cc3(%rip), %rdi      # 0x44f1
movq %r15, %rcx
callq 0x1170
movq %r15, %r13
movl $0xa, %edi
movq %r13, %rsi
callq 0x10a0
movq 0x68(%rsp), %rdi
leaq 0x1c87(%rip), %rsi      # 0x44d9
movl %r12d, %edx
movq 0x70(%rsp), %r15
movl %r15d, %ecx
movq 0x28(%rsp), %r14
movl %r14d, %r8d
xorl %eax, %eax
callq 0x10e0
cmpl $0x0, 0x8(%rsp)
jle 0x2c8a
movq %r14, %rax
movq 0x60(%rsp), %rcx
movq 0x40(%rcx), %r14
addl %eax, %r15d
decl %r15d
xorl %r12d, %r12d
movq 0x68(%rsp), %r13
movslq %r15d, %rax
movzbl (%r14,%rax), %eax
cmpq %rbp, %r12
movsd 0x50(%rsp), %xmm0
jge 0x28b7
cmpl $0x41, %eax
je 0x28d2
cmpl $0x47, %eax
je 0x28ca
cmpl $0x54, %eax
jne 0x28da
movb $0x41, %al
jmp 0x28dc
cmpl $0x41, %eax
je 0x28d6
cmpl $0x47, %eax
je 0x28ce
cmpl $0x54, %eax
jne 0x28e9
movb $0x41, %al
jmp 0x28eb
movb $0x43, %al
jmp 0x28dc
movb $0x43, %al
jmp 0x28eb
movb $0x54, %al
jmp 0x28dc
movb $0x54, %al
jmp 0x28eb
movb $0x47, %al
movzbl %al, %edi
movsd 0x17a1(%rip), %xmm0     # 0x4088
jmp 0x28ee
movb $0x47, %al
movzbl %al, %edi
callq 0x12cd
movsbl %al, %edi
movq %r13, %rsi
callq 0x10a0
incq %r12
decl %r15d
cmpq %r12, %rbx
jne 0x2891
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1bd7(%rip), %rdi      # 0x44f1
movq %r13, %rcx
callq 0x1170
movl 0x8(%rsp), %r12d
testl %r12d, %r12d
jle 0x2b3a
movl 0x40(%rsp), %r15d
movq 0x28(%rsp), %r14
movl %r15d, %edi
movq %r13, %rsi
callq 0x10a0
decl %r12d
jne 0x293a
movl %ebx, 0x8(%rsp)
movq 0x30(%rsp), %r15
jmp 0x2a37
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1b88(%rip), %rdi      # 0x44f1
movq %r15, %rcx
callq 0x1170
movl 0x40(%rsp), %r12d
movl $0xa, %edi
movq %r15, %rsi
callq 0x10a0
movq %r13, %rdi
leaq 0x1b68(%rip), %rsi      # 0x44f5
movl 0x24(%rsp), %edx
movl %ebx, %ecx
movq 0x28(%rsp), %r14
movl %r14d, %r8d
xorl %eax, %eax
callq 0x10e0
movl 0x8(%rsp), %ecx
testl %ecx, %ecx
jle 0x2c97
addl %r14d, %ebx
movl %ecx, %eax
notl %eax
addl %ebx, %eax
movslq %eax, %rbx
movl %ecx, %r14d
movq 0x60(%rsp), %rax
addq 0x40(%rax), %rbx
xorl %r15d, %r15d
movsd 0x16b7(%rip), %xmm0     # 0x4088
cmpq %rbp, %r15
jl 0x29dc
movsd 0x50(%rsp), %xmm0
movsbl (%rbx,%r15), %edi
callq 0x12cd
movsbl %al, %edi
movq %r13, %rsi
callq 0x10a0
incq %r15
cmpq %r15, %r14
jne 0x29c9
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1ae7(%rip), %rdi      # 0x44f1
movq %r13, %rcx
callq 0x1170
movl 0x8(%rsp), %ebx
testl %ebx, %ebx
jle 0x2c75
movq 0x30(%rsp), %r15
movq 0x28(%rsp), %r14
movl %r12d, %edi
movq %r13, %rsi
callq 0x10a0
decl %ebx
jne 0x2a28
movl 0x24(%rsp), %r12d
jmp 0x2ccc
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1a9f(%rip), %rdi      # 0x44f1
movq %r15, %rcx
callq 0x1170
movq %r15, %r13
movl $0xa, %edi
movq %r13, %rsi
callq 0x10a0
movq 0x68(%rsp), %rdi
leaq 0x1a63(%rip), %rsi      # 0x44d9
movl %r12d, %edx
movq 0x70(%rsp), %r15
movl %r15d, %ecx
movq 0x28(%rsp), %r14
movl %r14d, %r8d
xorl %eax, %eax
callq 0x10e0
movq 0x38(%rsp), %rax
testl %eax, %eax
jle 0x2c9e
movslq %r15d, %r14
movl %eax, %r15d
movq 0x60(%rsp), %rax
addq 0x40(%rax), %r14
xorl %r12d, %r12d
movq 0x68(%rsp), %r13
movsd 0x15cc(%rip), %xmm0     # 0x4088
cmpq %rbp, %r12
jl 0x2ac7
movsd 0x50(%rsp), %xmm0
movsbl (%r14,%r12), %edi
callq 0x12cd
movsbl %al, %edi
movq %r13, %rsi
callq 0x10a0
incq %r12
cmpq %r12, %r15
jne 0x2ab4
movl $0x3, %esi
movl $0x1, %edx
leaq 0x19fc(%rip), %rdi      # 0x44f1
movq %r13, %rcx
callq 0x1170
movq 0x38(%rsp), %rax
testl %eax, %eax
movl 0x40(%rsp), %r15d
jle 0x2b3a
movl %eax, %r14d
movl 0x24(%rsp), %r12d
movl %r15d, %edi
movq %r13, %rsi
callq 0x10a0
decl %r14d
jne 0x2b13
movl %ebx, 0x8(%rsp)
movl 0x20(%rsp), %ebx
movq 0x30(%rsp), %r15
movq 0x28(%rsp), %r14
jmp 0x2cd0
movl %ebx, 0x8(%rsp)
jmp 0x2c75
movl $0x3, %esi
movl $0x1, %edx
leaq 0x199d(%rip), %rdi      # 0x44f1
movq %r15, %rcx
callq 0x1170
movq %r15, %r13
movl $0xa, %edi
movq %r13, %rsi
callq 0x10a0
movq 0x68(%rsp), %rdi
leaq 0x1993(%rip), %rsi      # 0x450b
movl %r12d, %edx
movl %ebx, %ecx
movq 0x28(%rsp), %r14
movl %r14d, %r8d
xorl %eax, %eax
callq 0x10e0
movq 0x38(%rsp), %rax
testl %eax, %eax
jle 0x2cab
movl %eax, %r14d
movq 0x60(%rsp), %rcx
movq 0x40(%rcx), %r15
negq %r14
addl %eax, %ebx
xorl %r12d, %r12d
movq 0x68(%rsp), %r13
movslq %ebx, %rax
movzbl (%r15,%rax), %eax
cmpq %rbp, %r12
jge 0x2bd2
cmpl $0x41, %eax
je 0x2bf3
cmpl $0x47, %eax
je 0x2beb
cmpl $0x54, %eax
jne 0x2bfb
movb $0x41, %al
jmp 0x2bfd
cmpl $0x41, %eax
movsd 0x50(%rsp), %xmm0
je 0x2bf7
cmpl $0x47, %eax
je 0x2bef
cmpl $0x54, %eax
jne 0x2c0a
movb $0x41, %al
jmp 0x2c0c
movb $0x43, %al
jmp 0x2bfd
movb $0x43, %al
jmp 0x2c0c
movb $0x54, %al
jmp 0x2bfd
movb $0x54, %al
jmp 0x2c0c
movb $0x47, %al
movzbl %al, %edi
movsd 0x1480(%rip), %xmm0     # 0x4088
jmp 0x2c0f
movb $0x47, %al
movzbl %al, %edi
callq 0x12cd
movsbl %al, %edi
movq %r13, %rsi
callq 0x10a0
incq %r12
decl %ebx
movq %r14, %rax
addq %r12, %rax
jne 0x2bb2
movl $0x3, %esi
movl $0x1, %edx
leaq 0x18b4(%rip), %rdi      # 0x44f1
movq %r13, %rcx
callq 0x1170
movq 0x38(%rsp), %rax
testl %eax, %eax
movl 0x40(%rsp), %r15d
jle 0x2c75
movl %eax, %ebx
movq 0x28(%rsp), %r14
movl 0x24(%rsp), %r12d
movl %r15d, %edi
movq %r13, %rsi
callq 0x10a0
decl %ebx
jne 0x2c5f
movq 0x30(%rsp), %r15
jmp 0x2ccc
movl 0x20(%rsp), %ebx
movq 0x30(%rsp), %r15
movq 0x28(%rsp), %r14
movl 0x24(%rsp), %r12d
jmp 0x2cd0
movq %r13, %rax
movq 0x68(%rsp), %r13
movq %rax, %r15
jmp 0x2cb3
movl 0x24(%rsp), %r12d
jmp 0x2cb3
movq %r13, %rcx
movq 0x68(%rsp), %r13
movq %rcx, %r15
jmp 0x2cb3
movq %r13, %r15
movq 0x68(%rsp), %r13
movl $0x3, %esi
movl $0x1, %edx
leaq 0x182d(%rip), %rdi      # 0x44f1
movq %r13, %rcx
callq 0x1170
movl 0x20(%rsp), %ebx
movl $0xa, %edi
movq %r13, %rsi
callq 0x10a0
incl %r12d
cmpl 0x5c(%rsp), %r12d
jne 0x21a3
movq %r14, 0x28(%rsp)
movq 0x78(%rsp), %rax
testl %eax, %eax
movq 0x88(%rsp), %rbp
leaq 0x17cf(%rip), %r15      # 0x44d5
movq 0x80(%rsp), %r12
jle 0x2d36
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ebx, %ebx
movl (%r12,%rbx,4), %edx
movq %rax, %r14
movq %rbp, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10e0
movq %r14, %rax
incq %rbx
cmpq %rbx, %r14
jne 0x2d17
movq %r12, %rdi
callq 0x1030
movq 0x60(%rsp), %r12
movq 0x68(%r12), %r15
movl 0x60(%r12), %eax
movq 0x28(%rsp), %r14
movq 0xb0(%rsp), %rbp
jmp 0x1dcf
movq 0x30(%rsp), %rdi
callq 0x1060
cmpb $0x0, 0x1f(%rsp)
jne 0x2d85
movq %r13, %rdi
callq 0x1060
movq 0x88(%rsp), %rdi
callq 0x1060
xorl %ebp, %ebp
jmp 0x2dbb
movq 0x8(%rbx,%rax,8), %rdx
leaq 0x162c(%rip), %rdi      # 0x43c1
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1070
movq (%rbx), %rsi
leaq 0x15bc(%rip), %rdi      # 0x4364
xorl %eax, %eax
callq 0x1070
leaq 0x1ac2(%rip), %rdi      # 0x4878
callq 0x1040
movl %ebp, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq