// File: /workspace/github_c_makefile_star2_O1/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 0x167f
leaq 0x318f(%rip), %rdi      # 0x47e2
callq 0x1040
movq (%rbx), %rsi
leaq 0x2cb2(%rip), %rdi      # 0x4314
xorl %eax, %eax
callq 0x1070
leaq 0x31b8(%rip), %rdi      # 0x4828
callq 0x1040
movl $0x1, %ebp
jmp 0x2d66
movl %edi, %r15d
movq 0x8(%rbx), %rax
movb (%rax), %cl
cmpl $0x2, %edi
jg 0x169a
cmpb $0x2d, %cl
jne 0x164c
cmpb $0x68, 0x1(%rax)
jne 0x164c
jmp 0x16a5
cmpb $0x2d, %cl
jne 0x16d0
cmpb $0x68, 0x1(%rax)
jne 0x16d0
leaq 0x3136(%rip), %rdi      # 0x47e2
callq 0x1040
movq (%rbx), %rsi
leaq 0x2c87(%rip), %rdi      # 0x4342
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1070
leaq 0x2e2c(%rip), %rdi      # 0x44f7
jmp 0x1dbd
cmpl $0x5, %r15d
jl 0x1b5d
leal -0x2(%r15), %r14d
movss 0x29be(%rip), %xmm4     # 0x40a4
movss 0x29ba(%rip), %xmm0     # 0x40a8
movss %xmm0, 0x60(%rsp)
movss 0x29a4(%rip), %xmm1     # 0x40a0
movss 0x2998(%rip), %xmm5     # 0x409c
movss 0x298c(%rip), %xmm0     # 0x4098
movss %xmm0, 0x40(%rsp)
movss 0x297a(%rip), %xmm0     # 0x4094
movss %xmm0, 0x3c(%rsp)
movb $0x5e, %bpl
movss 0x2981(%rip), %xmm0     # 0x40ac
movss %xmm0, 0x30(%rsp)
movl $0x3e8, 0x74(%rsp)      # imm = 0x3E8
movss 0x294f(%rip), %xmm0     # 0x4090
movl $0x0, 0x48(%rsp)
movl $0x1, %r13d
movl $0x1, %r12d
movl $0x1, 0x6c(%rsp)
movl $0x0, 0x10(%rsp)
movslq %r13d, %rax
movq (%rbx,%rax,8), %rsi
movb (%rsi), %cl
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x69, 0x1(%rsi)
jne 0x17c3
cmpb $0x64, 0x2(%rsi)
jne 0x17c3
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1150
movss 0xc(%rsp), %xmm5
movss 0x4(%rsp), %xmm1
movss 0x8(%rsp), %xmm4
movss (%rsp), %xmm0
movl %eax, %r12d
jmp 0x1ad5
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x6c, 0x1(%rsi)
jne 0x1819
cmpb $0x64, 0x2(%rsi)
jne 0x1819
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1150
movss 0xc(%rsp), %xmm5
movss 0x4(%rsp), %xmm1
movss 0x8(%rsp), %xmm4
movss (%rsp), %xmm0
movl %eax, 0x6c(%rsp)
jmp 0x1ad5
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x69, 0x1(%rsi)
jne 0x1865
cmpb $0x6d, 0x2(%rsi)
jne 0x1865
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm4, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1050
movss 0xc(%rsp), %xmm5
movss 0x4(%rsp), %xmm1
movss 0x8(%rsp), %xmm4
cvtsd2ss %xmm0, %xmm0
jmp 0x1ad5
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x69, 0x1(%rsi)
jne 0x18bc
cmpb $0x70, 0x2(%rsi)
jne 0x18bc
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1050
movss 0xc(%rsp), %xmm5
movss 0x4(%rsp), %xmm1
movss 0x8(%rsp), %xmm4
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x60(%rsp)
jmp 0x1ad0
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x6f, 0x1(%rsi)
jne 0x1904
cmpb $0x6d, 0x2(%rsi)
jne 0x1904
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1050
movss 0xc(%rsp), %xmm5
movss 0x8(%rsp), %xmm4
xorps %xmm1, %xmm1
cvtsd2ss %xmm0, %xmm1
jmp 0x1ad0
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x65, 0x1(%rsi)
jne 0x1940
cmpb $0x72, 0x2(%rsi)
jne 0x1940
movq 0x8(%rbx,%rax,8), %rax
movsbq (%rax), %rbp
leaq 0x2787(%rip), %rax      # 0x40b0
xorps %xmm2, %xmm2
cvtsd2ss -0x200(%rax,%rbp,8), %xmm2
movss %xmm2, 0x30(%rsp)
jmp 0x1ad5
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x6e, 0x1(%rsi)
jne 0x199a
cmpb $0x72, 0x2(%rsi)
jne 0x199a
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1050
movss 0xc(%rsp), %xmm5
movss 0x4(%rsp), %xmm1
movss 0x8(%rsp), %xmm4
cvttsd2si %xmm0, %eax
movss (%rsp), %xmm0
movl %eax, 0x74(%rsp)
jmp 0x1ad5
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x69, 0x1(%rsi)
jne 0x19e2
cmpb $0x73, 0x2(%rsi)
jne 0x19e2
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1050
movss 0xc(%rsp), %xmm5
movss 0x4(%rsp), %xmm1
xorps %xmm4, %xmm4
cvtsd2ss %xmm0, %xmm4
jmp 0x1ad0
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x6f, 0x1(%rsi)
jne 0x1a2a
cmpb $0x73, 0x2(%rsi)
jne 0x1a2a
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
callq 0x1050
movss 0x4(%rsp), %xmm1
movss 0x8(%rsp), %xmm4
xorps %xmm5, %xmm5
cvtsd2ss %xmm0, %xmm5
jmp 0x1ad0
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x72, 0x1(%rsi)
jne 0x1a7e
cmpb $0x6c, 0x2(%rsi)
jne 0x1a7e
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1050
movss 0xc(%rsp), %xmm5
movss 0x4(%rsp), %xmm1
movss 0x8(%rsp), %xmm4
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x40(%rsp)
jmp 0x1ad0
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x72, 0x1(%rsi)
jne 0x1ae7
cmpb $0x73, 0x2(%rsi)
jne 0x1ae7
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1050
movss 0xc(%rsp), %xmm5
movss 0x4(%rsp), %xmm1
movss 0x8(%rsp), %xmm4
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x3c(%rsp)
movss (%rsp), %xmm0
addl $0x2, %r13d
cmpl %r14d, %r13d
jl 0x1765
jmp 0x2d7a
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x70, 0x1(%rsi)
jne 0x1b3a
cmpb $0x73, 0x2(%rsi)
jne 0x1b3a
movq 0x8(%rbx,%rax,8), %rdi
movss %xmm0, (%rsp)
movss %xmm4, 0x8(%rsp)
movss %xmm1, 0x4(%rsp)
movss %xmm5, 0xc(%rsp)
callq 0x1150
movss 0xc(%rsp), %xmm5
movss 0x4(%rsp), %xmm1
movss 0x8(%rsp), %xmm4
movss (%rsp), %xmm0
movl %eax, 0x48(%rsp)
jmp 0x1ad5
cmpb $0x2d, %cl
jne 0x1d90
cmpb $0x62, 0x1(%rsi)
jne 0x1d90
decl %r13d
movl $0x1, 0x10(%rsp)
jmp 0x1ad5
movl $0x1, %edx
movss 0x2526(%rip), %xmm0     # 0x4090
movl $0x3e8, 0x74(%rsp)      # imm = 0x3E8
movsd 0x24fe(%rip), %xmm3     # 0x4078
movl $0x5e, %ecx
movb $0x1, %bpl
movss 0x250a(%rip), %xmm7     # 0x4094
movss 0x2506(%rip), %xmm6     # 0x4098
movss 0x2502(%rip), %xmm5     # 0x409c
movss 0x24fe(%rip), %xmm1     # 0x40a0
movsd 0x246e(%rip), %xmm2     # 0x4018
movss 0x24f2(%rip), %xmm4     # 0x40a4
xorl %r8d, %r8d
movl $0x1, %esi
movss %xmm0, (%rsp)
cvtss2sd %xmm0, %xmm0
movss %xmm1, 0x4(%rsp)
cvtss2sd %xmm1, %xmm1
movss %xmm4, 0x8(%rsp)
cvtss2sd %xmm4, %xmm4
movss %xmm5, 0xc(%rsp)
cvtss2sd %xmm5, %xmm5
movss %xmm6, 0x40(%rsp)
cvtss2sd %xmm6, %xmm6
movss %xmm7, 0x3c(%rsp)
cvtss2sd %xmm7, %xmm7
leaq 0x27aa(%rip), %rdi      # 0x43a6
movl %esi, 0x84(%rsp)
movl %edx, 0x6c(%rsp)
movsd %xmm2, 0xb8(%rsp)
movsd %xmm3, 0x60(%rsp)
movl %ecx, 0x54(%rsp)
movl %r8d, 0x48(%rsp)
movb $0x8, %al
callq 0x1070
movl %r15d, %r14d
movq -0x10(%rbx,%r14,8), %rsi
leaq 0x27f3(%rip), %rdi      # 0x4428
xorl %eax, %eax
callq 0x1070
movq -0x8(%rbx,%r14,8), %rsi
leaq 0x27f0(%rip), %rdi      # 0x4438
xorl %eax, %eax
callq 0x1070
movq -0x10(%rbx,%r14,8), %rdi
leaq 0x27ee(%rip), %rsi      # 0x4449
callq 0x1130
movq %rax, %r12
movl $0x1, %edi
movl $0x70, %esi
callq 0x10c0
movq %rax, %r15
movl $0x1, %edi
movl $0x20, %esi
callq 0x10c0
movq %rax, %r13
movq %r12, 0x18(%rax)
movl $0x4000, %edi           # imm = 0x4000
callq 0x1110
movq %rax, (%r13)
movq %r15, 0x10(%rsp)
movq %r13, 0x68(%r15)
leaq 0x2828(%rip), %rdi      # 0x44d1
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 0x2561(%rip), %rsi      # 0x42b0
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
testb %bpl, %bpl
movb %bpl, 0x47(%rsp)
je 0x1dc7
leaq 0x26d0(%rip), %rsi      # 0x444b
movq %rbx, %rdi
callq 0x1140
movq %rax, %r13
movq %rax, 0x30(%rsp)
jmp 0x1e33
movq 0x8(%rbx,%rax,8), %rdx
leaq 0x25d5(%rip), %rdi      # 0x4371
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1070
movq (%rbx), %rsi
leaq 0x2565(%rip), %rdi      # 0x4314
xorl %eax, %eax
callq 0x1070
leaq 0x2a6b(%rip), %rdi      # 0x4828
callq 0x1040
jmp 0x2d66
leaq 0x130(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1160
leaq 0xc0(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1160
leaq 0x1a0(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1160
leaq 0x2644(%rip), %rbx      # 0x444b
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1140
movq %rax, 0x30(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1140
movq %rax, %r13
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1140
movq %rax, %rbx
xorl %edi, %edi
callq 0x1100
movl %eax, %edi
callq 0x10b0
movq 0x10(%rsp), %rdx
leaq 0x48(%rdx), %rax
movq %rax, 0x98(%rsp)
leaq 0x30(%rdx), %rax
movq %rax, 0xa8(%rsp)
movq %rdx, %rax
addq $0x18, %rax
movq %rax, 0xb0(%rsp)
movslq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %rax, 0x28(%rsp)
movq %rbx, 0x90(%rsp)
movq 0x68(%rdx), %rbx
cmpl $0x0, 0x60(%rdx)
movl %ebp, 0x18(%rsp)
jne 0x1f1f
jmp 0x1ea0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x1efb
cmpl $0x0, 0x10(%rbx)
je 0x1eb4
movl 0x8(%rbx), %eax
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl 0xc(%rbx), %eax
jge 0x1efb
movl 0x8(%rbx), %eax
cmpl 0xc(%rbx), %eax
jl 0x1ee9
movl $0x0, 0x8(%rbx)
movq (%rbx), %rsi
movq 0x18(%rbx), %rdi
movl $0x4000, %edx           # imm = 0x4000
callq 0x10d0
movl %eax, 0xc(%rbx)
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0x1ee5
movl $0x1, 0x10(%rbx)
testl %eax, %eax
je 0x1e98
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x8(%rbx)
movzbl (%rax,%rcx), %r14d
movl %r14d, 0x70(%rsp)
cmpl $-0x1, %r14d
je 0x21bb
cmpl $0x40, %r14d
je 0x1f16
cmpl $0x3e, %r14d
jne 0x1ea0
movq 0x10(%rsp), %rdx
movl %r14d, 0x60(%rdx)
xorl %eax, %eax
movq %rax, 0x48(%rdx)
movq %rax, 0x30(%rdx)
movq %rax, 0x18(%rdx)
movq %rbx, %rdi
xorl %esi, %esi
leaq 0x70(%rsp), %rcx
xorl %r8d, %r8d
callq 0x2db3
testl %eax, %eax
js 0x204d
cmpl $0xa, 0x70(%rsp)
je 0x1f68
movq %rbx, %rdi
movl $0x2, %esi
movq 0xb0(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2db3
movq 0x10(%rsp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x1f8f
movq 0x10(%rsp), %r14
movq $0x100, 0x38(%r14)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x1110
movq %rax, 0x40(%r14)
cmpl $0x0, 0x10(%rbx)
je 0x1fa2
movl 0x8(%rbx), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0xc(%rbx), %ecx
jge 0x1fe8
movl 0x8(%rbx), %eax
cmpl 0xc(%rbx), %eax
jl 0x1fd7
movl $0x0, 0x8(%rbx)
movq (%rbx), %rsi
movq 0x18(%rbx), %rdi
movl $0x4000, %edx           # imm = 0x4000
callq 0x10d0
movl %eax, 0xc(%rbx)
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0x1fd3
movl $0x1, 0x10(%rbx)
testl %eax, %eax
je 0x2046
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x8(%rbx)
movzbl (%rax,%rcx), %eax
movl %eax, 0x70(%rsp)
cmpl $0x2a, %eax
jg 0x1ffd
cmpl $0xa, %eax
je 0x1f8f
cmpl $-0x1, %eax
jne 0x200c
jmp 0x2060
cmpl $0x2b, %eax
je 0x2060
cmpl $0x3e, %eax
je 0x2058
cmpl $0x40, %eax
je 0x2058
movq 0x10(%rsp), %rdi
movq 0x30(%rdi), %rcx
movq 0x40(%rdi), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x30(%rdi)
movb %al, (%rdx,%rcx)
movq %rbx, %rdi
movl $0x2, %esi
movq 0xa8(%rsp), %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x2db3
jmp 0x1f8f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1fe8
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x21bb
movq 0x10(%rsp), %rcx
movl %eax, 0x60(%rcx)
movq 0x10(%rsp), %r15
movq 0x30(%r15), %r14
leaq 0x1(%r14), %rax
cmpq 0x38(%r15), %rax
jb 0x20b8
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x38(%r15)
movq 0x40(%r15), %rdi
callq 0x1120
movq %rax, 0x40(%r15)
movq 0x40(%r15), %rax
movb $0x0, (%rax,%r14)
cmpl $0x2b, 0x70(%rsp)
jne 0x21c0
movq 0x38(%r15), %rsi
cmpq %rsi, 0x50(%r15)
jae 0x20f5
movq 0x10(%rsp), %r14
movq %rsi, 0x50(%r14)
movq 0x58(%r14), %rdi
callq 0x1120
movq %rax, 0x58(%r14)
jmp 0x20f5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x214e
cmpl $0x0, 0x10(%rbx)
je 0x2108
movl 0x8(%rbx), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0xc(%rbx), %ecx
jge 0x214e
movl 0x8(%rbx), %eax
cmpl 0xc(%rbx), %eax
jl 0x213d
movl $0x0, 0x8(%rbx)
movq (%rbx), %rsi
movq 0x18(%rbx), %rdi
movl $0x4000, %edx           # imm = 0x4000
callq 0x10d0
movl %eax, 0xc(%rbx)
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0x2139
movl $0x1, 0x10(%rbx)
testl %eax, %eax
je 0x20ee
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x8(%rbx)
movzbl (%rax,%rcx), %eax
movl %eax, 0x70(%rsp)
cmpl $-0x1, %eax
je 0x21b5
cmpl $0xa, %eax
jne 0x20f5
movq 0x98(%rsp), %rdx
movq %rbx, %rdi
movl $0x2, %esi
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x2db3
movq 0x98(%rsp), %rdx
testl %eax, %eax
js 0x2195
movq (%rdx), %rax
movq 0xa8(%rsp), %rcx
cmpq (%rcx), %rax
jb 0x2164
movq 0x10(%rsp), %r15
movl $0x0, 0x60(%r15)
movq 0x30(%r15), %r14
cmpq 0x48(%r15), %r14
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmovnel %eax, %r14d
jmp 0x21c0
movl $0xfffffffe, %r14d      # imm = 0xFFFFFFFE
movq 0x10(%rsp), %r15
testl %r14d, %r14d
js 0x2d3e
movq 0x10(%r15), %rsi
movq 0x30(%r15), %rbx
leaq 0x2275(%rip), %rdi      # 0x444d
xorl %eax, %eax
callq 0x1070
cmpq $0x0, 0x18(%r15)
je 0x21f8
movq 0x28(%r15), %rsi
leaq 0x227f(%rip), %rdi      # 0x4470
xorl %eax, %eax
callq 0x1070
leaq 0x227e(%rip), %rdi      # 0x447d
movl %ebx, %esi
xorl %eax, %eax
callq 0x1070
movq %rbx, 0x88(%rsp)
movslq 0x88(%rsp), %rbx
movl $0x4, %esi
movq %rbx, %rdi
callq 0x10c0
movq %rax, %rbp
testl %ebx, %ebx
movq 0x88(%rsp), %rbx
jle 0x224a
movl %ebx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
shlq $0x2, %rdx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x1080
cmpl $0x0, 0x74(%rsp)
leaq 0x222f(%rip), %r14      # 0x4485
movl 0x18(%rsp), %r15d
jle 0x2ce6
cvtsi2ss %ebx, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xa0(%rsp)
movl $0x0, 0x24(%rsp)
movq %rbp, 0x78(%rsp)
callq 0x1190
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x1d75(%rip), %xmm0     # 0x4008
movsd 0xb8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x25d1
cmpl $0x1, 0x84(%rsp)
movq 0x28(%rsp), %r14
jne 0x22eb
movss (%rsp), %xmm0
movss 0x8(%rsp), %xmm1
callq 0x1441
movl $0xa, %r14d
movsd 0x1dad(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
ja 0x22eb
movsd 0xa0(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %r14d
callq 0x1190
cvtsi2sd %eax, %xmm2
mulsd 0x1d0c(%rip), %xmm2     # 0x4008
cmpl $0x1, 0x6c(%rsp)
movss 0x40(%rsp), %xmm0
movss 0x3c(%rsp), %xmm1
jne 0x238b
movsd %xmm2, 0x28(%rsp)
xorps %xmm2, %xmm2
cvtsi2ss %r14d, %xmm2
movss %xmm2, 0x18(%rsp)
callq 0x1441
movl $0xa, %r15d
movsd 0x1d4a(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
movl $0xa, %r12d
ja 0x2354
xorps %xmm1, %xmm1
cvtss2sd 0x18(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %r12d
movss 0x40(%rsp), %xmm0
movss 0x3c(%rsp), %xmm1
callq 0x1441
movsd 0x1d13(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
ja 0x2385
xorps %xmm1, %xmm1
cvtss2sd 0x18(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %r15d
movsd 0x28(%rsp), %xmm2
movl %ebx, %eax
subl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %ebx
testl %r12d, %r12d
jle 0x23c2
movslq %ebx, %rcx
movl %r12d, %eax
leaq (,%rcx,4), %rcx
addq %rbp, %rcx
xorl %edx, %edx
incl (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x23b7
testl %r15d, %r15d
jle 0x23de
movl %r15d, %eax
leal (%r14,%rbx), %ecx
decl %ecx
movslq %ecx, %rcx
incl (%rbp,%rcx,4)
decl %ecx
decq %rax
jne 0x23d0
callq 0x1190
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x1c16(%rip), %xmm0     # 0x4008
movsd %xmm0, 0x18(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x2085(%rip), %rsi      # 0x4489
movl 0x24(%rsp), %edx
movl %ebx, %ecx
movq %r14, 0x28(%rsp)
movl %r14d, %r8d
xorl %eax, %eax
callq 0x10e0
movsd 0x1bf7(%rip), %xmm0     # 0x4018
ucomisd 0x18(%rsp), %xmm0
jbe 0x291d
movl %r15d, 0x18(%rsp)
movq %r12, %rbp
testl %r12d, %r12d
jle 0x2480
movl %ebp, %r14d
movslq %ebx, %r15
movq 0x10(%rsp), %rax
addq 0x40(%rax), %r15
xorl %r12d, %r12d
movsd 0x1c34(%rip), %xmm0     # 0x4088
cmpq 0x48(%rsp), %r12
jl 0x2461
movsd 0x60(%rsp), %xmm0
movsbl (%r15,%r12), %edi
callq 0x12e8
movsbl %al, %edi
movq 0x30(%rsp), %rsi
callq 0x10a0
incq %r12
cmpq %r12, %r14
jne 0x244c
movl $0x3, %esi
movl $0x1, %edx
leaq 0x2010(%rip), %rdi      # 0x44a1
movq 0x30(%rsp), %r14
movq %r14, %rcx
callq 0x1170
movq %rbp, %r12
testl %r12d, %r12d
movl 0x54(%rsp), %r15d
jle 0x24bd
movl %r12d, %ebp
movl %r15d, %edi
movq %r14, %rsi
callq 0x10a0
decl %ebp
jne 0x24ae
movl $0xa, %edi
movq %r14, %rsi
callq 0x10a0
movq %r13, %rdi
leaq 0x1fb5(%rip), %rsi      # 0x4489
movl 0x24(%rsp), %edx
movl %ebx, %ecx
movq 0x28(%rsp), %r8
xorl %eax, %eax
callq 0x10e0
cmpl $0x0, 0x18(%rsp)
jle 0x2593
movl 0x18(%rsp), %ebp
movq 0x28(%rsp), %rax
addl %eax, %ebx
decl %ebx
xorl %r14d, %r14d
movslq %ebx, %rax
cmpq 0x48(%rsp), %r14
jge 0x252b
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rcx
movzbl (%rcx,%rax), %eax
cmpl $0x41, %eax
je 0x2559
cmpl $0x47, %eax
je 0x2551
cmpl $0x54, %eax
jne 0x2561
movb $0x41, %al
jmp 0x2563
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rcx
movzbl (%rcx,%rax), %eax
cmpl $0x41, %eax
movsd 0x60(%rsp), %xmm0
je 0x255d
cmpl $0x47, %eax
je 0x2555
cmpl $0x54, %eax
jne 0x2570
movb $0x41, %al
jmp 0x2572
movb $0x43, %al
jmp 0x2563
movb $0x43, %al
jmp 0x2572
movb $0x54, %al
jmp 0x2563
movb $0x54, %al
jmp 0x2572
movb $0x47, %al
movzbl %al, %edi
movsd 0x1b1a(%rip), %xmm0     # 0x4088
jmp 0x2575
movb $0x47, %al
movzbl %al, %edi
callq 0x12e8
movsbl %al, %edi
movq %r13, %rsi
callq 0x10a0
incq %r14
decl %ebx
cmpq %r14, %rbp
jne 0x2501
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1efd(%rip), %rdi      # 0x44a1
movq %r13, %rcx
callq 0x1170
movl 0x18(%rsp), %ebx
testl %ebx, %ebx
jle 0x2c96
movq 0x78(%rsp), %rbp
movl %r15d, %edi
movq %r13, %rsi
callq 0x10a0
decl %ebx
jne 0x25bd
jmp 0x2c88
cmpl $0x1, 0x84(%rsp)
movq 0x28(%rsp), %r14
jne 0x2617
movss 0x4(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x1441
movl $0xa, %r14d
movsd 0x1a81(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
ja 0x2617
movsd 0xa0(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %r14d
callq 0x1190
cvtsi2sd %eax, %xmm2
mulsd 0x19e0(%rip), %xmm2     # 0x4008
cmpl $0x1, 0x6c(%rsp)
movss 0x40(%rsp), %xmm0
movss 0x3c(%rsp), %xmm1
jne 0x26b7
movsd %xmm2, 0x18(%rsp)
xorps %xmm2, %xmm2
cvtsi2ss %r14d, %xmm2
movss %xmm2, 0x58(%rsp)
callq 0x1441
movl $0xa, %r15d
movsd 0x1a1e(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
movl $0xa, %r12d
ja 0x2680
xorps %xmm1, %xmm1
cvtss2sd 0x58(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %r12d
movss 0x40(%rsp), %xmm0
movss 0x3c(%rsp), %xmm1
callq 0x1441
movsd 0x19e7(%rip), %xmm1     # 0x4080
ucomisd %xmm0, %xmm1
ja 0x26b1
xorps %xmm1, %xmm1
cvtss2sd 0x58(%rsp), %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %r15d
movsd 0x18(%rsp), %xmm2
movl %ebx, %eax
subl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %ebx
testl %r12d, %r12d
jle 0x26e4
movl %r12d, %eax
movl %ebx, %ecx
leal (%rcx,%rax), %edx
movslq %edx, %rdx
incl (%rbp,%rdx,4)
decq %rax
jne 0x26d5
testl %r15d, %r15d
jle 0x2711
movl %r15d, %ecx
notl %ecx
addl %r14d, %ecx
addl %ebx, %ecx
movslq %ecx, %rcx
movl %r15d, %eax
leaq (,%rcx,4), %rcx
addq %rbp, %rcx
xorl %edx, %edx
incl (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x2706
callq 0x1190
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x18e3(%rip), %xmm0     # 0x4008
movsd %xmm0, 0x18(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x1d6e(%rip), %rsi      # 0x44a5
movl 0x24(%rsp), %edx
movl %ebx, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x10e0
movsd 0x18c9(%rip), %xmm0     # 0x4018
ucomisd 0x18(%rsp), %xmm0
movl %r15d, 0x18(%rsp)
movq %r14, 0x28(%rsp)
jbe 0x2ad3
testl %r12d, %r12d
jle 0x2813
movl %r12d, %ebp
negq %rbp
leal (%r12,%rbx), %r14d
xorl %r15d, %r15d
movslq %r14d, %rax
cmpq 0x48(%rsp), %r15
jge 0x27a5
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rcx
movzbl (%rcx,%rax), %eax
cmpl $0x41, %eax
je 0x27d3
cmpl $0x47, %eax
je 0x27cb
cmpl $0x54, %eax
jne 0x27db
movb $0x41, %al
jmp 0x27dd
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rcx
movzbl (%rcx,%rax), %eax
cmpl $0x41, %eax
movsd 0x60(%rsp), %xmm0
je 0x27d7
cmpl $0x47, %eax
je 0x27cf
cmpl $0x54, %eax
jne 0x27ea
movb $0x41, %al
jmp 0x27ec
movb $0x43, %al
jmp 0x27dd
movb $0x43, %al
jmp 0x27ec
movb $0x54, %al
jmp 0x27dd
movb $0x54, %al
jmp 0x27ec
movb $0x47, %al
movzbl %al, %edi
movsd 0x18a0(%rip), %xmm0     # 0x4088
jmp 0x27ef
movb $0x47, %al
movzbl %al, %edi
callq 0x12e8
movsbl %al, %edi
movq 0x30(%rsp), %rsi
callq 0x10a0
incq %r15
decl %r14d
movq %rbp, %rax
addq %r15, %rax
jne 0x277b
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1c7d(%rip), %rdi      # 0x44a1
movq 0x30(%rsp), %r15
movq %r15, %rcx
callq 0x1170
testl %r12d, %r12d
movl 0x54(%rsp), %r14d
jle 0x284d
movl %r12d, %ebp
movl %r14d, %edi
movq %r15, %rsi
callq 0x10a0
decl %ebp
jne 0x283e
movl $0xa, %edi
movq %r15, %rsi
callq 0x10a0
movq %r13, %rdi
leaq 0x1c41(%rip), %rsi      # 0x44a5
movl 0x24(%rsp), %edx
movl %ebx, %ecx
movq 0x28(%rsp), %r8
xorl %eax, %eax
callq 0x10e0
cmpl $0x0, 0x18(%rsp)
jle 0x28d5
addl 0x28(%rsp), %ebx
movl 0x18(%rsp), %eax
movl %eax, %ebp
notl %ebp
addl %ebx, %ebp
movl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x40(%rax), %r14
xorl %r15d, %r15d
movl %ebp, %eax
movsd 0x17e5(%rip), %xmm0     # 0x4088
cmpq 0x48(%rsp), %r15
cmovll %ebp, %eax
jl 0x28b3
movsd 0x60(%rsp), %xmm0
cltq
addq %r14, %rax
movsbl (%r15,%rax), %edi
callq 0x12e8
movsbl %al, %edi
movq %r13, %rsi
callq 0x10a0
incq %r15
cmpq %r15, %rbx
jne 0x2899
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1bbb(%rip), %rdi      # 0x44a1
movq %r13, %rcx
callq 0x1170
movl 0x18(%rsp), %r15d
testl %r15d, %r15d
jle 0x2ca2
movl %r15d, %ebx
movl 0x54(%rsp), %ebp
leaq 0x1b7b(%rip), %r14      # 0x4485
movl %ebp, %edi
movq %r13, %rsi
callq 0x10a0
decl %ebx
jne 0x290a
jmp 0x2cb8
movq %r12, 0x58(%rsp)
movl %r15d, %r12d
testl %r15d, %r15d
jle 0x29d5
movl %r12d, %ebp
movq 0x28(%rsp), %rax
leal (%rax,%rbx), %r14d
decl %r14d
xorl %r15d, %r15d
movslq %r14d, %rax
cmpq 0x48(%rsp), %r15
movsd 0x60(%rsp), %xmm0
jge 0x2970
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rcx
movzbl (%rcx,%rax), %eax
cmpl $0x41, %eax
je 0x2998
cmpl $0x47, %eax
je 0x2990
cmpl $0x54, %eax
jne 0x29a0
movb $0x41, %al
jmp 0x29a2
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rcx
movzbl (%rcx,%rax), %eax
cmpl $0x41, %eax
je 0x299c
cmpl $0x47, %eax
je 0x2994
cmpl $0x54, %eax
jne 0x29af
movb $0x41, %al
jmp 0x29b1
movb $0x43, %al
jmp 0x29a2
movb $0x43, %al
jmp 0x29b1
movb $0x54, %al
jmp 0x29a2
movb $0x54, %al
jmp 0x29b1
movb $0x47, %al
movzbl %al, %edi
movsd 0x16db(%rip), %xmm0     # 0x4088
jmp 0x29b4
movb $0x47, %al
movzbl %al, %edi
callq 0x12e8
movsbl %al, %edi
movq 0x30(%rsp), %rsi
callq 0x10a0
incq %r15
decl %r14d
cmpq %r15, %rbp
jne 0x2940
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1abb(%rip), %rdi      # 0x44a1
movq 0x30(%rsp), %r15
movq %r15, %rcx
callq 0x1170
testl %r12d, %r12d
movl 0x54(%rsp), %r14d
jle 0x2a0f
movl %r12d, %ebp
movl %r14d, %edi
movq %r15, %rsi
callq 0x10a0
decl %ebp
jne 0x2a00
movl $0xa, %edi
movq %r15, %rsi
callq 0x10a0
movq %r13, %rdi
leaq 0x1a63(%rip), %rsi      # 0x4489
movl 0x24(%rsp), %edx
movl %ebx, %ecx
movq 0x28(%rsp), %r8
xorl %eax, %eax
callq 0x10e0
cmpl $0x0, 0x58(%rsp)
jle 0x2a85
movl 0x58(%rsp), %r14d
movslq %ebx, %rbx
movq 0x10(%rsp), %rax
addq 0x40(%rax), %rbx
xorl %r15d, %r15d
movsd 0x162d(%rip), %xmm0     # 0x4088
cmpq 0x48(%rsp), %r15
jl 0x2a68
movsd 0x60(%rsp), %xmm0
movsbl (%rbx,%r15), %edi
callq 0x12e8
movsbl %al, %edi
movq %r13, %rsi
callq 0x10a0
incq %r15
cmpq %r15, %r14
jne 0x2a53
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1a0b(%rip), %rdi      # 0x44a1
movq %r13, %rcx
callq 0x1170
movq 0x58(%rsp), %rax
testl %eax, %eax
jle 0x2cab
movl %eax, %ebx
movl 0x54(%rsp), %ebp
leaq 0x19cd(%rip), %r14      # 0x4485
movl %r12d, %r15d
movl %ebp, %edi
movq %r13, %rsi
callq 0x10a0
decl %ebx
jne 0x2abb
movq 0x58(%rsp), %r12
jmp 0x2cb8
movq %r12, 0x58(%rsp)
testl %r15d, %r15d
jle 0x2b3b
movq 0x28(%rsp), %rax
addl %ebx, %eax
movl 0x18(%rsp), %ecx
movl %ecx, %ebp
notl %ebp
addl %eax, %ebp
movl %ecx, %r14d
movq 0x10(%rsp), %rax
movq 0x40(%rax), %r15
xorl %r12d, %r12d
movl %ebp, %eax
movsd 0x1581(%rip), %xmm0     # 0x4088
cmpq 0x48(%rsp), %r12
cmovll %ebp, %eax
jl 0x2b17
movsd 0x60(%rsp), %xmm0
cltq
addq %r15, %rax
movsbl (%r12,%rax), %edi
callq 0x12e8
movsbl %al, %edi
movq 0x30(%rsp), %rsi
callq 0x10a0
incq %r12
cmpq %r12, %r14
jne 0x2afd
movl $0x3, %esi
movl $0x1, %edx
leaq 0x1955(%rip), %rdi      # 0x44a1
movq 0x30(%rsp), %r14
movq %r14, %rcx
callq 0x1170
cmpl $0x0, 0x18(%rsp)
movl 0x54(%rsp), %r15d
jle 0x2b78
movl 0x18(%rsp), %ebp
movl %r15d, %edi
movq %r14, %rsi
callq 0x10a0
decl %ebp
jne 0x2b69
movl $0xa, %edi
movq %r14, %rsi
callq 0x10a0
movq %r13, %rdi
leaq 0x192c(%rip), %rsi      # 0x44bb
movl 0x24(%rsp), %edx
movl %ebx, %ecx
movq 0x28(%rsp), %r8
xorl %eax, %eax
callq 0x10e0
movq 0x58(%rsp), %r12
testl %r12d, %r12d
jle 0x2c53
movl %r12d, %ebp
negq %rbp
addl %r12d, %ebx
xorl %r14d, %r14d
cmpq 0x48(%rsp), %r14
jge 0x2be5
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
movslq %ebx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x41, %eax
je 0x2c16
cmpl $0x47, %eax
je 0x2c0e
cmpl $0x54, %eax
jne 0x2c1e
movb $0x41, %al
jmp 0x2c20
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
movslq %ebx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x41, %eax
movsd 0x60(%rsp), %xmm0
je 0x2c1a
cmpl $0x47, %eax
je 0x2c12
cmpl $0x54, %eax
jne 0x2c2d
movb $0x41, %al
jmp 0x2c2f
movb $0x43, %al
jmp 0x2c20
movb $0x43, %al
jmp 0x2c2f
movb $0x54, %al
jmp 0x2c20
movb $0x54, %al
jmp 0x2c2f
movb $0x47, %al
movzbl %al, %edi
movsd 0x145d(%rip), %xmm0     # 0x4088
jmp 0x2c32
movb $0x47, %al
movzbl %al, %edi
callq 0x12e8
movsbl %al, %edi
movq %r13, %rsi
callq 0x10a0
incq %r14
decl %ebx
movq %rbp, %rax
addq %r14, %rax
jne 0x2bbb
movl $0x3, %esi
movl $0x1, %edx
leaq 0x183d(%rip), %rdi      # 0x44a1
movq %r13, %rcx
callq 0x1170
testl %r12d, %r12d
movq 0x78(%rsp), %rbp
jle 0x2c88
movl %r12d, %ebx
movl %r15d, %edi
movq %r13, %rsi
callq 0x10a0
decl %ebx
jne 0x2c79
leaq 0x17f6(%rip), %r14      # 0x4485
movl 0x18(%rsp), %r15d
jmp 0x2cbd
leaq 0x17e8(%rip), %r14      # 0x4485
movl %ebx, %r15d
jmp 0x2cb8
leaq 0x17dc(%rip), %r14      # 0x4485
jmp 0x2cb8
leaq 0x17d3(%rip), %r14      # 0x4485
movl %r12d, %r15d
movq %rax, %r12
movq 0x78(%rsp), %rbp
movl $0xa, %edi
movq %r13, %rsi
callq 0x10a0
movl 0x24(%rsp), %eax
incl %eax
movl %eax, 0x24(%rsp)
cmpl 0x74(%rsp), %eax
movq 0x88(%rsp), %rbx
jne 0x227f
movl %r15d, 0x18(%rsp)
movq %r12, 0x58(%rsp)
testl %ebx, %ebx
movq %rbp, %r12
movq 0x90(%rsp), %r15
jle 0x2d23
movq %rbx, %rbp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %ebx, %ebx
movl (%r12,%rbx,4), %edx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x10e0
incq %rbx
cmpq %rbx, %rbp
jne 0x2d0a
movq %r12, %rdi
callq 0x1030
movq 0x10(%rsp), %rdx
movq 0x58(%rsp), %r12
movl 0x18(%rsp), %ebp
jmp 0x1e84
movq 0x30(%rsp), %rdi
callq 0x1060
cmpb $0x0, 0x47(%rsp)
jne 0x2d64
movq %r13, %rdi
callq 0x1060
movq 0x90(%rsp), %rdi
callq 0x1060
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm2, %xmm2
cvtss2sd 0x60(%rsp), %xmm2
cvtss2sd 0x30(%rsp), %xmm3
movsbl %bpl, %ecx
cmpl $0x0, 0x10(%rsp)
sete %bpl
movss 0x40(%rsp), %xmm6
movss 0x3c(%rsp), %xmm7
movl 0x6c(%rsp), %edx
movl %r12d, %esi
movl 0x48(%rsp), %r8d
jmp 0x1bba