// File: ashlall[P]StreamStats/ChiSquareExperiments/VaryMemoryOneSample.cpp
// Function: main
int main(int argc, char* argv[])
{
  if (argc < 10)
  {
    cout << "usage: VaryMemory lower-memory upper-memory num-streams(>0) [N|U|P|E] location scale [0|1] stream-size num-buckets" << endl;
    throw ParameterError();
  }
  
  double lower = atof (argv[1]);
  double upper = atof (argv[2]);
  int data_repeats = atoi (argv[3]);
  char distribution_type = argv[4][0];
  double location = atof (argv[5]);
  double scale = atof (argv[6]);
  int all_quantiles = atoi (argv[7]);
  int stream_size = atoi (argv[8]);
  int num_buckets = atoi(argv[9]);
  int seed = 1; 

  // ensures that the parameters will not create error
  if (data_repeats <= 0)
  {
    cout << "The number of streams must be greater than zero." << endl;
    throw ParameterError();
  }
  if (distribution_type != 'N' && distribution_type != 'U' && distribution_type != 'P' && distribution_type != 'E')
  {
    cout << "The distribution is either N, U, P, or E." << endl;
    throw ParameterError();
  }
  if (lower <= 0)
  {
    cout << "The lower memory percent must be greater than 0." << endl;
    throw ParameterError();
  }
  if (stream_size <= 0)
  {
    cout << "The stream_size must be greater than 0.\n";
    throw ParameterError();
  }
  if (num_buckets <= 0)
  {
    cout << "The number of bins must be greater than 0.\n";
    throw ParameterError();
  }

  // finds the number of different sizes the experiment will run on
  double memory_percent;
  int num_mems = 0;
  double mem = lower;
  while (mem <= (upper + 0.0000001))
  {
    //cout << mem << endl;
    num_mems++;
    mem *= sqrt(10);
    //cout << mem << " " << upper << endl;
  }

  // creates the arrays that will hold the calculated statistics
  double actual_values[data_repeats][num_mems];
  double GK_values[data_repeats][num_mems];
  double QD_values[data_repeats][num_mems];
  double RS_values[data_repeats][num_mems];
  double percents[num_mems];
  long times[data_repeats][num_mems];
  long times2[data_repeats][num_mems];

  // creates and initializes the log file
  ofstream data_file;
  char str[150];
  name_file(str, argv, 0);
  data_file.open(str);
  data_file << "Distribution: " << distribution_type << ", location = " << location << ", scale = " << scale << endl;

  for (int i = 0; i < data_repeats; i++) // runs all tests data_repeats times
  {
    memory_percent = lower;
    int j = 0;
    data_file << "Stream " << i+1 << ":" << endl;

    // generates the data based on inputed parameters                                       
    DataGenerator data(distribution_type, stream_size, seed, location, scale);
    double *stream = data.get_stream();

    while (memory_percent <= (upper+0.0000001))  // runs tests for every memory percent
    {
      int sample_size = memory_percent * stream_size;
      if (i == 0)
        percents[j] = memory_percent;
      data_file << "memory_percent = " << memory_percent << endl;
      
      // computes GK estimate
      ChiSquareContinuous sketch1(sample_size, 1);
 
	  timeval timeBefore, timeAfter; // initializes variables
  	  long diffSeconds, diffUSeconds;
 	  gettimeofday(&timeBefore, NULL); 

      for (int i = 0; i < stream_size; i++)
	      sketch1.insert(stream[i]);

	  gettimeofday(&timeAfter, NULL); // get time for insertion
  	  diffSeconds = timeAfter.tv_sec - timeBefore.tv_sec;
  	  diffUSeconds = timeAfter.tv_usec - timeBefore.tv_usec;

	  times[i][j] = diffSeconds;
	  times2[i][j] = diffUSeconds;

      double GK_stat = get_estimate(&sketch1, distribution_type, num_buckets, location, scale);
      GK_values[i][j] = GK_stat;
      data_file << "GK = " << GK_stat << endl;

      if (all_quantiles)
      {
      	// computes QDigest estimate
	ChiSquareContinuous sketch2(sample_size, 2);
	for (int i = 0; i < stream_size; i++)
          sketch2.insert(stream[i]);
	double QD_stat = get_estimate(&sketch2, distribution_type, num_buckets, location, scale);
	QD_values[i][j] = QD_stat;
        data_file << "QDigest = " << QD_stat << endl;

	// computes ReservoirSampling estimate
	ChiSquareContinuous sketch3(sample_size, 3);
	for (int i = 0; i < stream_size; i++)
	  sketch3.insert(stream[i]);
	double RS_stat = get_estimate(&sketch3, distribution_type, num_buckets, location, scale);
	RS_values[i][j] = RS_stat;
        data_file << "Reservoir Sampling = " << RS_stat << endl;
      }

      // computes actual statistic
      double *upper_interval = sketch1.get_upper();
      double *lower_interval = sketch1.get_lower();
      double actual = data.get_stat_one_sample(num_buckets, upper_interval, lower_interval);
      actual_values[i][j] = actual;
      data_file << "Real = " << actual << endl;

      memory_percent *= sqrt(10);
      j++;
    }
    seed++; // changes seed for next repeat
  }
  data_file.close();

  // creates table file
  name_file(str, argv, 1);
  data_file.open(str);

  // creates time table file
  ofstream time_file;
  char str2[150];
  name_file(str2, argv, 5);
  time_file.open(str2);

  // creates pvalues file
  ofstream data2_file;
  char st[150];
  name_file(st, argv, 3);
  data2_file.open(st);

  int deg_freedom = num_buckets - get_DOF(distribution_type);
  for (int i = 0; i < num_mems; i++)
  {
    data_file << percents[i] * 100 << "\t";
	time_file << percents[i] * 100 << "\t";

    // adds pvalue error from the GK sketch to the table file
    double error = 0;
    for (int j = 0; j < data_repeats; j++)
      error += abs(pochisq(GK_values[j][i], deg_freedom) - pochisq(actual_values[j][i], deg_freedom));
    data_file << error / data_repeats;

	// adds times to the time table
	long double avg_time = 0.0;
	for (int j = 0; j < data_repeats; j++)
		avg_time += times[j][i] + times2[j][i]/1000000.0;// diffSeconds + diffUSeconds/1000000.0
	time_file << avg_time / data_repeats << endl;

    if (all_quantiles)
    {
      // adds pvalue error from the QDigest sketch to the table file
      error = 0;
      for (int j = 0; j < data_repeats; j++)
	error += abs(pochisq(QD_values[j][i], deg_freedom) - pochisq(actual_values[j][i], deg_freedom));
      data_file << "\t" << error / data_repeats << "\t";

      // adds pvalue error from the Reservoir Sampling sketch to the table file
      error = 0;

      for (int j = 0; j < data_repeats; j++)
	error += abs(pochisq(RS_values[j][i], deg_freedom) - pochisq(actual_values[j][i], deg_freedom));
      data_file << error / data_repeats;
    }
    data_file << endl;

    // adds all pvalues to the pvalue file
    data2_file << "memory_percent = " << percents[i] << endl;
    for (int j = 0; j < data_repeats; j++)
    {
      data2_file << pochisq(actual_values[j][i], deg_freedom) << " actual" << endl;
      data2_file << pochisq(GK_values[j][i], deg_freedom) << " GK" << endl;
      if (all_quantiles)
      {
	data2_file << pochisq(QD_values[j][i], deg_freedom) << " QD" << endl;
	data2_file << pochisq(RS_values[j][i], deg_freedom) << " RS" << endl;
      }
    }
  }
  data2_file.close();
  data_file.close();
  time_file.close();

  // Creates extra file
  name_file(str, argv, 2);
  data_file.open(str);

  // adds actual statistics to the extra file
  for (int i = 0; i < num_mems; i++)
  {
    for (int j = 0; j < data_repeats; j++)
	    data_file << actual_values[j][i] << "\t";
  }
  data_file << endl;

  // adds GK statistics to the extra file
  for (int i = 0; i < num_mems; i++)
  {
    for(int j = 0; j <data_repeats; j++)
      data_file << GK_values[j][i] << "\t";
  }
  data_file << endl;
  if (all_quantiles)
  {
    // adds QDigest statistics to the extra file
    for (int i = 0; i < num_mems; i++)
    {
	    for(int j = 0; j <data_repeats; j++)
	      data_file << QD_values[j][i] << "\t";
    }
    data_file << endl;

    // adds Reservoir Sampling statistcs to the extra file
    for (int i = 0; i < num_mems; i++)
    {
	    for(int j = 0; j <data_repeats; j++)
	     data_file << RS_values[j][i] << "\t";
    }
    data_file << endl;
  }
  data_file.close();
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc80, %rsp            # imm = 0xC80
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0xa, -0x8(%rbp)
jge 0x6b5e
movq 0x134aa(%rip), %rdi     # 0x19fd0
leaq 0xb734(%rip), %rsi      # 0x12261
callq 0x21b0
movq %rax, %rdi
movq 0x13484(%rip), %rsi     # 0x19fc0
callq 0x21d0
movl $0x1, %edi
callq 0x20c0
movq %rax, %rdi
leaq 0x130fb(%rip), %rsi     # 0x19c50
xorl %eax, %eax
movl %eax, %edx
callq 0x22f0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2210
movsd %xmm0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2210
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2280
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movb (%rax), %al
movb %al, -0x25(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2210
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2210
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x2280
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x2280
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x2280
movl %eax, -0x44(%rbp)
movl $0x1, -0x48(%rbp)
cmpl $0x0, -0x24(%rbp)
jg 0x6c3f
movq 0x133c9(%rip), %rdi     # 0x19fd0
leaq 0xb6c6(%rip), %rsi      # 0x122d4
callq 0x21b0
movq %rax, %rdi
movq 0x133a3(%rip), %rsi     # 0x19fc0
callq 0x21d0
movl $0x1, %edi
callq 0x20c0
movq %rax, %rdi
leaq 0x1301a(%rip), %rsi     # 0x19c50
xorl %eax, %eax
movl %eax, %edx
callq 0x22f0
movsbl -0x25(%rbp), %eax
cmpl $0x4e, %eax
je 0x6ca2
movsbl -0x25(%rbp), %eax
cmpl $0x55, %eax
je 0x6ca2
movsbl -0x25(%rbp), %eax
cmpl $0x50, %eax
je 0x6ca2
movsbl -0x25(%rbp), %eax
cmpl $0x45, %eax
je 0x6ca2
movq 0x13366(%rip), %rdi     # 0x19fd0
leaq 0xb694(%rip), %rsi      # 0x12305
callq 0x21b0
movq %rax, %rdi
movq 0x13340(%rip), %rsi     # 0x19fc0
callq 0x21d0
movl $0x1, %edi
callq 0x20c0
movq %rax, %rdi
leaq 0x12fb7(%rip), %rsi     # 0x19c50
xorl %eax, %eax
movl %eax, %edx
callq 0x22f0
xorps %xmm0, %xmm0
ucomisd -0x18(%rbp), %xmm0
jb 0x6ceb
movq 0x1331d(%rip), %rdi     # 0x19fd0
leaq 0xb675(%rip), %rsi      # 0x1232f
callq 0x21b0
movq %rax, %rdi
movq 0x132f7(%rip), %rsi     # 0x19fc0
callq 0x21d0
movl $0x1, %edi
callq 0x20c0
movq %rax, %rdi
leaq 0x12f6e(%rip), %rsi     # 0x19c50
xorl %eax, %eax
movl %eax, %edx
callq 0x22f0
cmpl $0x0, -0x40(%rbp)
jg 0x6d21
movq 0x132d8(%rip), %rdi     # 0x19fd0
leaq 0xb661(%rip), %rsi      # 0x12360
callq 0x21b0
movl $0x1, %edi
callq 0x20c0
movq %rax, %rdi
leaq 0x12f38(%rip), %rsi     # 0x19c50
xorl %eax, %eax
movl %eax, %edx
callq 0x22f0
cmpl $0x0, -0x44(%rbp)
jg 0x6d57
movq 0x132a2(%rip), %rdi     # 0x19fd0
leaq 0xb654(%rip), %rsi      # 0x12389
callq 0x21b0
movl $0x1, %edi
callq 0x20c0
movq %rax, %rdi
leaq 0x12f02(%rip), %rsi     # 0x19c50
xorl %eax, %eax
movl %eax, %edx
callq 0x22f0
movl $0x0, -0x54(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm1
movsd 0xb3db(%rip), %xmm0     # 0x12150
addsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x6d9f
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl $0xa, %edi
callq 0x9610
mulsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0x6d68
movl -0x24(%rbp), %eax
movl %eax, %ecx
movl -0x54(%rbp), %eax
movq %rax, -0xaa8(%rbp)
movq %rsp, %rdx
movq %rdx, -0x68(%rbp)
movq %rcx, %rdx
imulq %rax, %rdx
leaq 0xf(,%rdx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0xaa0(%rbp)
movq %rdx, %rsp
movq %rcx, -0x70(%rbp)
movq %rax, -0x78(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movl -0x54(%rbp), %eax
movq %rax, -0xa98(%rbp)
movq %rcx, %rdx
imulq %rax, %rdx
leaq 0xf(,%rdx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0xa90(%rbp)
movq %rdx, %rsp
movq %rcx, -0x80(%rbp)
movq %rax, -0x88(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movl -0x54(%rbp), %eax
movq %rax, -0xa88(%rbp)
movq %rcx, %rdx
imulq %rax, %rdx
leaq 0xf(,%rdx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0xa80(%rbp)
movq %rdx, %rsp
movq %rcx, -0x90(%rbp)
movq %rax, -0x98(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movl -0x54(%rbp), %eax
movq %rax, -0xa78(%rbp)
movq %rcx, %rdx
imulq %rax, %rdx
leaq 0xf(,%rdx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0xa70(%rbp)
movq %rdx, %rsp
movq %rcx, -0xa0(%rbp)
movq %rax, -0xa8(%rbp)
movl -0x54(%rbp), %eax
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0xa68(%rbp)
movq %rcx, %rsp
movq %rax, -0xb0(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movl -0x54(%rbp), %eax
movq %rax, -0xa60(%rbp)
movq %rcx, %rdx
imulq %rax, %rdx
leaq 0xf(,%rdx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0xa58(%rbp)
movq %rdx, %rsp
movq %rcx, -0xb8(%rbp)
movq %rax, -0xc0(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movl -0x54(%rbp), %eax
movq %rax, -0xa50(%rbp)
movq %rcx, %rdx
imulq %rax, %rdx
leaq 0xf(,%rdx,8), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0xa48(%rbp)
movq %rdx, %rsp
movq %rcx, -0xc8(%rbp)
movq %rax, -0xd0(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x22e0
movq -0x10(%rbp), %rsi
leaq -0x370(%rbp), %rdi
xorl %edx, %edx
callq 0x84d0
jmp 0x6f63
leaq -0x2d0(%rbp), %rdi
leaq -0x370(%rbp), %rsi
movl $0x10, %edx
callq 0x2050
jmp 0x6f7d
leaq 0xb431(%rip), %rsi      # 0x123b5
leaq -0x2d0(%rbp), %rdi
callq 0x21b0
movq %rax, -0xab0(%rbp)
jmp 0x6f99
movq -0xab0(%rbp), %rdi
movsbl -0x25(%rbp), %esi
callq 0x21f0
movq %rax, -0xab8(%rbp)
jmp 0x6fb2
movq -0xab8(%rbp), %rdi
leaq 0xb404(%rip), %rsi      # 0x123c4
callq 0x21b0
movq %rax, -0xac0(%rbp)
jmp 0x6fce
movq -0xac0(%rbp), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x2350
movq %rax, -0xac8(%rbp)
jmp 0x6fe8
movq -0xac8(%rbp), %rdi
leaq 0xb3dc(%rip), %rsi      # 0x123d2
callq 0x21b0
movq %rax, -0xad0(%rbp)
jmp 0x7004
movq -0xad0(%rbp), %rdi
movsd -0x38(%rbp), %xmm0
callq 0x2350
movq %rax, -0xad8(%rbp)
jmp 0x701e
movq -0xad8(%rbp), %rdi
movq 0x12f94(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x7033
movl $0x0, -0x380(%rbp)
movl -0x380(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x77d2
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x384(%rbp)
leaq 0xb376(%rip), %rsi      # 0x123dd
leaq -0x2d0(%rbp), %rdi
callq 0x21b0
movq %rax, -0xae0(%rbp)
jmp 0x707c
movq -0xae0(%rbp), %rdi
movl -0x380(%rbp), %esi
incl %esi
callq 0x2300
movq %rax, -0xae8(%rbp)
jmp 0x7099
movq -0xae8(%rbp), %rdi
leaq 0xb33e(%rip), %rsi      # 0x123e5
callq 0x21b0
movq %rax, -0xaf0(%rbp)
jmp 0x70b5
movq -0xaf0(%rbp), %rdi
movq 0x12efd(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x70ca
movsbl -0x25(%rbp), %esi
movl -0x40(%rbp), %edx
movl -0x48(%rbp), %ecx
movsd -0x30(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
leaq -0x398(%rbp), %rdi
callq 0x2500
jmp 0x70ec
leaq -0x398(%rbp), %rdi
callq 0x9630
movq %rax, -0xaf8(%rbp)
jmp 0x7101
movq -0xaf8(%rbp), %rax
movq %rax, -0x3a0(%rbp)
movsd -0x50(%rbp), %xmm1
movsd 0xb034(%rip), %xmm0     # 0x12150
addsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x7798
movsd -0x50(%rbp), %xmm0
cvtsi2sdl -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x3a4(%rbp)
cmpl $0x0, -0x380(%rbp)
jne 0x7194
movq -0xa68(%rbp), %rax
movsd -0x50(%rbp), %xmm0
movslq -0x384(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x7194
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x378(%rbp)
movl %eax, -0x37c(%rbp)
jmp 0x84ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x378(%rbp)
movl %eax, -0x37c(%rbp)
jmp 0x77c1
leaq 0xb24c(%rip), %rsi      # 0x123e7
leaq -0x2d0(%rbp), %rdi
callq 0x21b0
movq %rax, -0xb00(%rbp)
jmp 0x71b0
movq -0xb00(%rbp), %rdi
movsd -0x50(%rbp), %xmm0
callq 0x2350
movq %rax, -0xb08(%rbp)
jmp 0x71ca
movq -0xb08(%rbp), %rdi
movq 0x12de8(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x71df
cvtsi2sdl -0x3a4(%rbp), %xmm0
leaq -0x3d0(%rbp), %rdi
movl $0x1, %esi
callq 0x58b0
jmp 0x71fa
leaq -0x3e0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2290
movl $0x0, -0x404(%rbp)
movl -0x404(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x726a
movq -0x3a0(%rbp), %rax
movslq -0x404(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq -0x3d0(%rbp), %rdi
callq 0x5ad0
jmp 0x7240
jmp 0x7242
movl -0x404(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x404(%rbp)
jmp 0x7214
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x378(%rbp)
movl %eax, -0x37c(%rbp)
jmp 0x778a
xorl %eax, %eax
movl %eax, %esi
leaq -0x3f0(%rbp), %rdi
callq 0x2290
movq -0xa60(%rbp), %r8
movq -0xa58(%rbp), %rcx
movq -0xa50(%rbp), %rsi
movq -0xa48(%rbp), %rax
movq -0x3f0(%rbp), %rdx
movq -0x3e0(%rbp), %rdi
subq %rdi, %rdx
movq %rdx, -0x3f8(%rbp)
movq -0x3e8(%rbp), %rdx
movq -0x3d8(%rbp), %rdi
subq %rdi, %rdx
movq %rdx, -0x400(%rbp)
movq -0x3f8(%rbp), %rdi
movslq -0x380(%rbp), %rdx
imulq %r8, %rdx
leaq (%rcx,%rdx,8), %rcx
movslq -0x384(%rbp), %rdx
movq %rdi, (%rcx,%rdx,8)
movq -0x400(%rbp), %rdx
movslq -0x380(%rbp), %rcx
imulq %rsi, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x384(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movsbl -0x25(%rbp), %esi
movl -0x44(%rbp), %edx
movsd -0x30(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
leaq -0x3d0(%rbp), %rdi
callq 0x8720
movsd %xmm0, -0xb10(%rbp)
jmp 0x732f
movq -0xa90(%rbp), %rax
movq -0xa98(%rbp), %rdx
movsd -0xb10(%rbp), %xmm0
movsd %xmm0, -0x410(%rbp)
movsd -0x410(%rbp), %xmm0
movslq -0x380(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x384(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
leaq 0xb082(%rip), %rsi      # 0x123f9
leaq -0x2d0(%rbp), %rdi
callq 0x21b0
movq %rax, -0xb18(%rbp)
jmp 0x738c
movq -0xb18(%rbp), %rdi
movsd -0x410(%rbp), %xmm0
callq 0x2350
movq %rax, -0xb20(%rbp)
jmp 0x73a9
movq -0xb20(%rbp), %rdi
movq 0x12c09(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x73be
cmpl $0x0, -0x3c(%rbp)
je 0x7661
cvtsi2sdl -0x3a4(%rbp), %xmm0
leaq -0x438(%rbp), %rdi
movl $0x2, %esi
callq 0x58b0
jmp 0x73e3
movl $0x0, -0x43c(%rbp)
movl -0x43c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x7443
movq -0x3a0(%rbp), %rax
movslq -0x43c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq -0x438(%rbp), %rdi
callq 0x5ad0
jmp 0x7419
jmp 0x741b
movl -0x43c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x43c(%rbp)
jmp 0x73ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x378(%rbp)
movl %eax, -0x37c(%rbp)
jmp 0x7650
movsbl -0x25(%rbp), %esi
movl -0x44(%rbp), %edx
movsd -0x30(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
leaq -0x438(%rbp), %rdi
callq 0x8720
movsd %xmm0, -0xb28(%rbp)
jmp 0x746a
movq -0xa80(%rbp), %rax
movq -0xa88(%rbp), %rdx
movsd -0xb28(%rbp), %xmm0
movsd %xmm0, -0x448(%rbp)
movsd -0x448(%rbp), %xmm0
movslq -0x380(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x384(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
leaq 0xaf4d(%rip), %rsi      # 0x123ff
leaq -0x2d0(%rbp), %rdi
callq 0x21b0
movq %rax, -0xb30(%rbp)
jmp 0x74c7
movq -0xb30(%rbp), %rdi
movsd -0x448(%rbp), %xmm0
callq 0x2350
movq %rax, -0xb38(%rbp)
jmp 0x74e4
movq -0xb38(%rbp), %rdi
movq 0x12ace(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x74f9
cvtsi2sdl -0x3a4(%rbp), %xmm0
leaq -0x470(%rbp), %rdi
movl $0x3, %esi
callq 0x58b0
jmp 0x7514
movl $0x0, -0x474(%rbp)
movl -0x474(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x7580
movq -0x3a0(%rbp), %rax
movslq -0x474(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq -0x470(%rbp), %rdi
callq 0x5ad0
jmp 0x754a
jmp 0x754c
movl -0x474(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x474(%rbp)
jmp 0x751e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x378(%rbp)
movl %eax, -0x37c(%rbp)
leaq -0x470(%rbp), %rdi
callq 0x5a60
jmp 0x7650
movsbl -0x25(%rbp), %esi
movl -0x44(%rbp), %edx
movsd -0x30(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
leaq -0x470(%rbp), %rdi
callq 0x8720
movsd %xmm0, -0xb40(%rbp)
jmp 0x75a7
movq -0xa70(%rbp), %rax
movq -0xa78(%rbp), %rdx
movsd -0xb40(%rbp), %xmm0
movsd %xmm0, -0x480(%rbp)
movsd -0x480(%rbp), %xmm0
movslq -0x380(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x384(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
leaq 0xae1b(%rip), %rsi      # 0x1240a
leaq -0x2d0(%rbp), %rdi
callq 0x21b0
movq %rax, -0xb48(%rbp)
jmp 0x7604
movq -0xb48(%rbp), %rdi
movsd -0x480(%rbp), %xmm0
callq 0x2350
movq %rax, -0xb50(%rbp)
jmp 0x7621
movq -0xb50(%rbp), %rdi
movq 0x12991(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x7636
leaq -0x470(%rbp), %rdi
callq 0x5a60
leaq -0x438(%rbp), %rdi
callq 0x5a60
jmp 0x7661
leaq -0x438(%rbp), %rdi
callq 0x5a60
jmp 0x778a
leaq -0x3d0(%rbp), %rdi
movq %rdi, -0xb60(%rbp)
callq 0x6a10
movq -0xb60(%rbp), %rdi
movq %rax, -0x488(%rbp)
callq 0x69f0
movq %rax, -0x490(%rbp)
movl -0x44(%rbp), %esi
movq -0x488(%rbp), %rdx
movq -0x490(%rbp), %rcx
leaq -0x398(%rbp), %rdi
callq 0x2800
movsd %xmm0, -0xb58(%rbp)
jmp 0x76b5
movq -0xaa0(%rbp), %rax
movq -0xaa8(%rbp), %rdx
movsd -0xb58(%rbp), %xmm0
movsd %xmm0, -0x498(%rbp)
movsd -0x498(%rbp), %xmm0
movslq -0x380(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x384(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
leaq 0xad23(%rip), %rsi      # 0x12420
leaq -0x2d0(%rbp), %rdi
callq 0x21b0
movq %rax, -0xb68(%rbp)
jmp 0x7712
movq -0xb68(%rbp), %rdi
movsd -0x498(%rbp), %xmm0
callq 0x2350
movq %rax, -0xb70(%rbp)
jmp 0x772f
movq -0xb70(%rbp), %rdi
movq 0x12883(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x7744
movl $0xa, %edi
callq 0x9610
movsd %xmm0, -0xb78(%rbp)
jmp 0x7758
movsd -0xb78(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movl -0x384(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x384(%rbp)
leaq -0x3d0(%rbp), %rdi
callq 0x5a60
jmp 0x710f
leaq -0x3d0(%rbp), %rdi
callq 0x5a60
jmp 0x77c1
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
leaq -0x398(%rbp), %rdi
callq 0x9650
movl -0x380(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x380(%rbp)
jmp 0x703d
leaq -0x398(%rbp), %rdi
callq 0x9650
jmp 0x84ae
leaq -0x2d0(%rbp), %rdi
callq 0x2240
jmp 0x77e0
movq -0x10(%rbp), %rsi
leaq -0x370(%rbp), %rdi
movl $0x1, %edx
callq 0x84d0
jmp 0x77f7
leaq -0x2d0(%rbp), %rdi
leaq -0x370(%rbp), %rsi
movl $0x10, %edx
callq 0x2050
jmp 0x7811
leaq -0x698(%rbp), %rdi
callq 0x22e0
jmp 0x781f
movq -0x10(%rbp), %rsi
leaq -0x730(%rbp), %rdi
movl $0x5, %edx
callq 0x84d0
jmp 0x7836
leaq -0x698(%rbp), %rdi
leaq -0x730(%rbp), %rsi
movl $0x10, %edx
callq 0x2050
jmp 0x7850
leaq -0x930(%rbp), %rdi
callq 0x22e0
jmp 0x785e
movq -0x10(%rbp), %rsi
leaq -0x9d0(%rbp), %rdi
movl $0x3, %edx
callq 0x84d0
jmp 0x7875
leaq -0x930(%rbp), %rdi
leaq -0x9d0(%rbp), %rsi
movl $0x10, %edx
callq 0x2050
jmp 0x788f
movl -0x44(%rbp), %eax
movl %eax, -0xb80(%rbp)
movsbl -0x25(%rbp), %edi
callq 0x87e0
movl %eax, -0xb7c(%rbp)
jmp 0x78a9
movl -0xb7c(%rbp), %ecx
movl -0xb80(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x9d4(%rbp)
movl $0x0, -0x9d8(%rbp)
movl -0x9d8(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x80f7
movq -0xa68(%rbp), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0xa867(%rip), %xmm1     # 0x12158
mulsd %xmm1, %xmm0
leaq -0x2d0(%rbp), %rdi
callq 0x2350
movq %rax, -0xb88(%rbp)
jmp 0x790a
movq -0xb88(%rbp), %rdi
leaq 0xab10(%rip), %rsi      # 0x12428
callq 0x21b0
jmp 0x791f
movq -0xa68(%rbp), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0xa81e(%rip), %xmm1     # 0x12158
mulsd %xmm1, %xmm0
leaq -0x698(%rbp), %rdi
callq 0x2350
movq %rax, -0xb90(%rbp)
jmp 0x7953
movq -0xb90(%rbp), %rdi
leaq 0xaac7(%rip), %rsi      # 0x12428
callq 0x21b0
jmp 0x7968
xorps %xmm0, %xmm0
movsd %xmm0, -0x9e0(%rbp)
movl $0x0, -0x9e4(%rbp)
movl -0x9e4(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x7a91
movq -0xa90(%rbp), %rax
movq -0xa98(%rbp), %rdx
movslq -0x9e4(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xb98(%rbp)
jmp 0x79ca
movq -0xaa0(%rbp), %rax
movq -0xaa8(%rbp), %rdx
movslq -0x9e4(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xba0(%rbp)
jmp 0x7a08
movsd -0xba0(%rbp), %xmm1
movsd -0xb98(%rbp), %xmm0
subsd %xmm1, %xmm0
callq 0x9580
movsd %xmm0, -0xba8(%rbp)
jmp 0x7a2b
movsd -0xba8(%rbp), %xmm0
addsd -0x9e0(%rbp), %xmm0
movsd %xmm0, -0x9e0(%rbp)
movl -0x9e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9e4(%rbp)
jmp 0x797d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x378(%rbp)
movl %eax, -0x37c(%rbp)
jmp 0x84a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x378(%rbp)
movl %eax, -0x37c(%rbp)
leaq -0x930(%rbp), %rdi
callq 0x2260
jmp 0x84a2
movsd -0x9e0(%rbp), %xmm0
cvtsi2sdl -0x24(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq -0x2d0(%rbp), %rdi
callq 0x2350
jmp 0x7ab0
fldz
fstpt -0xa00(%rbp)
movl $0x0, -0xa04(%rbp)
movl -0xa04(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x7b5a
movq -0xa48(%rbp), %rax
movq -0xa50(%rbp), %rsi
movq -0xa58(%rbp), %rcx
movq -0xa60(%rbp), %r8
movslq -0xa04(%rbp), %rdx
movq %rdx, %rdi
imulq %r8, %rdi
leaq (%rcx,%rdi,8), %rdi
movslq -0x9d8(%rbp), %rcx
cvtsi2sdq (%rdi,%rcx,8), %xmm0
imulq %rsi, %rdx
leaq (%rax,%rdx,8), %rax
cvtsi2sdq (%rax,%rcx,8), %xmm1
movsd 0xa63e(%rip), %xmm2     # 0x12160
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xa40(%rbp)
fldl -0xa40(%rbp)
fldt -0xa00(%rbp)
faddp %st, %st(1)
fstpt -0xa00(%rbp)
movl -0xa04(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa04(%rbp)
jmp 0x7ac2
fldt -0xa00(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0xa34(%rbp)
fildl -0xa34(%rbp)
fdivrp %st, %st(1)
subq $0x10, %rsp
movq %rsp, %rax
fstpt (%rax)
leaq -0x698(%rbp), %rdi
callq 0x21e0
addq $0x10, %rsp
movq %rax, -0xbb0(%rbp)
jmp 0x7b93
movq -0xbb0(%rbp), %rdi
movq 0x1241f(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x7ba8
cmpl $0x0, -0x3c(%rbp)
je 0x7e08
xorps %xmm0, %xmm0
movsd %xmm0, -0x9e0(%rbp)
movl $0x0, -0xa08(%rbp)
movl -0xa08(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x7ca1
movq -0xa80(%rbp), %rax
movq -0xa88(%rbp), %rdx
movslq -0xa08(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xbb8(%rbp)
jmp 0x7c14
movq -0xaa0(%rbp), %rax
movq -0xaa8(%rbp), %rdx
movslq -0xa08(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xbc0(%rbp)
jmp 0x7c52
movsd -0xbc0(%rbp), %xmm1
movsd -0xbb8(%rbp), %xmm0
subsd %xmm1, %xmm0
callq 0x9580
movsd %xmm0, -0xbc8(%rbp)
jmp 0x7c75
movsd -0xbc8(%rbp), %xmm0
addsd -0x9e0(%rbp), %xmm0
movsd %xmm0, -0x9e0(%rbp)
movl -0xa08(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa08(%rbp)
jmp 0x7bc7
leaq 0xa780(%rip), %rsi      # 0x12428
leaq -0x2d0(%rbp), %rdi
callq 0x21b0
movq %rax, -0xbd0(%rbp)
jmp 0x7cbd
movq -0xbd0(%rbp), %rdi
movsd -0x9e0(%rbp), %xmm0
cvtsi2sdl -0x24(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x2350
movq %rax, -0xbd8(%rbp)
jmp 0x7ce3
movq -0xbd8(%rbp), %rdi
leaq 0xa737(%rip), %rsi      # 0x12428
callq 0x21b0
jmp 0x7cf8
xorps %xmm0, %xmm0
movsd %xmm0, -0x9e0(%rbp)
movl $0x0, -0xa0c(%rbp)
movl -0xa0c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x7de7
movq -0xa70(%rbp), %rax
movq -0xa78(%rbp), %rdx
movslq -0xa0c(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xbe0(%rbp)
jmp 0x7d5a
movq -0xaa0(%rbp), %rax
movq -0xaa8(%rbp), %rdx
movslq -0xa0c(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xbe8(%rbp)
jmp 0x7d98
movsd -0xbe8(%rbp), %xmm1
movsd -0xbe0(%rbp), %xmm0
subsd %xmm1, %xmm0
callq 0x9580
movsd %xmm0, -0xbf0(%rbp)
jmp 0x7dbb
movsd -0xbf0(%rbp), %xmm0
addsd -0x9e0(%rbp), %xmm0
movsd %xmm0, -0x9e0(%rbp)
movl -0xa0c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0c(%rbp)
jmp 0x7d0d
movsd -0x9e0(%rbp), %xmm0
cvtsi2sdl -0x24(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq -0x2d0(%rbp), %rdi
callq 0x2350
jmp 0x7e06
jmp 0x7e08
movq 0x121b1(%rip), %rsi     # 0x19fc0
leaq -0x2d0(%rbp), %rdi
callq 0x21d0
jmp 0x7e1d
leaq 0xa5c3(%rip), %rsi      # 0x123e7
leaq -0x930(%rbp), %rdi
callq 0x21b0
movq %rax, -0xbf8(%rbp)
jmp 0x7e39
movq -0xbf8(%rbp), %rdi
movq -0xa68(%rbp), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x2350
movq %rax, -0xc00(%rbp)
jmp 0x7e61
movq -0xc00(%rbp), %rdi
movq 0x12151(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x7e76
movl $0x0, -0xa10(%rbp)
movl -0xa10(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x80e1
movq -0xaa0(%rbp), %rax
movq -0xaa8(%rbp), %rdx
movslq -0xa10(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xc08(%rbp)
jmp 0x7ecd
movsd -0xc08(%rbp), %xmm0
leaq -0x930(%rbp), %rdi
callq 0x2350
movq %rax, -0xc10(%rbp)
jmp 0x7eea
movq -0xc10(%rbp), %rdi
leaq 0xa532(%rip), %rsi      # 0x1242a
callq 0x21b0
movq %rax, -0xc18(%rbp)
jmp 0x7f06
movq -0xc18(%rbp), %rdi
movq 0x120ac(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x7f1b
movq -0xa90(%rbp), %rax
movq -0xa98(%rbp), %rdx
movslq -0xa10(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xc20(%rbp)
jmp 0x7f59
movsd -0xc20(%rbp), %xmm0
leaq -0x930(%rbp), %rdi
callq 0x2350
movq %rax, -0xc28(%rbp)
jmp 0x7f76
movq -0xc28(%rbp), %rdi
leaq 0xa4ae(%rip), %rsi      # 0x12432
callq 0x21b0
movq %rax, -0xc30(%rbp)
jmp 0x7f92
movq -0xc30(%rbp), %rdi
movq 0x12020(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x7fa7
cmpl $0x0, -0x3c(%rbp)
je 0x80cb
movq -0xa80(%rbp), %rax
movq -0xa88(%rbp), %rdx
movslq -0xa10(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xc38(%rbp)
jmp 0x7fef
movsd -0xc38(%rbp), %xmm0
leaq -0x930(%rbp), %rdi
callq 0x2350
movq %rax, -0xc40(%rbp)
jmp 0x800c
movq -0xc40(%rbp), %rdi
leaq 0xa41c(%rip), %rsi      # 0x12436
callq 0x21b0
movq %rax, -0xc48(%rbp)
jmp 0x8028
movq -0xc48(%rbp), %rdi
movq 0x11f8a(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x803d
movq -0xa70(%rbp), %rax
movq -0xa78(%rbp), %rdx
movslq -0xa10(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0x9d8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x9d4(%rbp), %edi
callq 0x5260
movsd %xmm0, -0xc50(%rbp)
jmp 0x807b
movsd -0xc50(%rbp), %xmm0
leaq -0x930(%rbp), %rdi
callq 0x2350
movq %rax, -0xc58(%rbp)
jmp 0x8098
movq -0xc58(%rbp), %rdi
leaq 0xa394(%rip), %rsi      # 0x1243a
callq 0x21b0
movq %rax, -0xc60(%rbp)
jmp 0x80b4
movq -0xc60(%rbp), %rdi
movq 0x11efe(%rip), %rsi     # 0x19fc0
callq 0x21d0
jmp 0x80c9
jmp 0x80cb
jmp 0x80cd
movl -0xa10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa10(%rbp)
jmp 0x7e80
jmp 0x80e3
movl -0x9d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9d8(%rbp)
jmp 0x78c7
leaq -0x930(%rbp), %rdi
callq 0x2240
jmp 0x8105
leaq -0x2d0(%rbp), %rdi
callq 0x2240
jmp 0x8113
leaq -0x698(%rbp), %rdi
callq 0x2240
jmp 0x8121
movq -0x10(%rbp), %rsi
leaq -0x370(%rbp), %rdi
movl $0x2, %edx
callq 0x84d0
jmp 0x8138
leaq -0x2d0(%rbp), %rdi
leaq -0x370(%rbp), %rsi
movl $0x10, %edx
callq 0x2050
jmp 0x8152
movl $0x0, -0xa14(%rbp)
movl -0xa14(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x81fc
movl $0x0, -0xa18(%rbp)
movl -0xa18(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x81e6
movq -0xaa0(%rbp), %rax
movq -0xaa8(%rbp), %rdx
movslq -0xa18(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0xa14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq -0x2d0(%rbp), %rdi
callq 0x2350
movq %rax, -0xc68(%rbp)
jmp 0x81be
movq -0xc68(%rbp), %rdi
leaq 0xa25c(%rip), %rsi      # 0x12428
callq 0x21b0
jmp 0x81d3
jmp 0x81d5
movl -0xa18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa18(%rbp)
jmp 0x8175
jmp 0x81e8
movl -0xa14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa14(%rbp)
jmp 0x815c
movq 0x11dbd(%rip), %rsi     # 0x19fc0
leaq -0x2d0(%rbp), %rdi
callq 0x21d0
jmp 0x8211
movl $0x0, -0xa1c(%rbp)
movl -0xa1c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x82bb
movl $0x0, -0xa20(%rbp)
movl -0xa20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x82a5
movq -0xa90(%rbp), %rax
movq -0xa98(%rbp), %rdx
movslq -0xa20(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0xa1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq -0x2d0(%rbp), %rdi
callq 0x2350
movq %rax, -0xc70(%rbp)
jmp 0x827d
movq -0xc70(%rbp), %rdi
leaq 0xa19d(%rip), %rsi      # 0x12428
callq 0x21b0
jmp 0x8292
jmp 0x8294
movl -0xa20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa20(%rbp)
jmp 0x8234
jmp 0x82a7
movl -0xa1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa1c(%rbp)
jmp 0x821b
movq 0x11cfe(%rip), %rsi     # 0x19fc0
leaq -0x2d0(%rbp), %rdi
callq 0x21d0
jmp 0x82d0
cmpl $0x0, -0x3c(%rbp)
je 0x845a
movl $0x0, -0xa24(%rbp)
movl -0xa24(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x8384
movl $0x0, -0xa28(%rbp)
movl -0xa28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x836e
movq -0xa80(%rbp), %rax
movq -0xa88(%rbp), %rdx
movslq -0xa28(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0xa24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq -0x2d0(%rbp), %rdi
callq 0x2350
movq %rax, -0xc78(%rbp)
jmp 0x8346
movq -0xc78(%rbp), %rdi
leaq 0xa0d4(%rip), %rsi      # 0x12428
callq 0x21b0
jmp 0x835b
jmp 0x835d
movl -0xa28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa28(%rbp)
jmp 0x82fd
jmp 0x8370
movl -0xa24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa24(%rbp)
jmp 0x82e4
movq 0x11c35(%rip), %rsi     # 0x19fc0
leaq -0x2d0(%rbp), %rdi
callq 0x21d0
jmp 0x8399
movl $0x0, -0xa2c(%rbp)
movl -0xa2c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x8443
movl $0x0, -0xa30(%rbp)
movl -0xa30(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x842d
movq -0xa70(%rbp), %rax
movq -0xa78(%rbp), %rdx
movslq -0xa30(%rbp), %rcx
imulq %rdx, %rcx
leaq (%rax,%rcx,8), %rax
movslq -0xa2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq -0x2d0(%rbp), %rdi
callq 0x2350
movq %rax, -0xc80(%rbp)
jmp 0x8405
movq -0xc80(%rbp), %rdi
leaq 0xa015(%rip), %rsi      # 0x12428
callq 0x21b0
jmp 0x841a
jmp 0x841c
movl -0xa30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa30(%rbp)
jmp 0x83bc
jmp 0x842f
movl -0xa2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa2c(%rbp)
jmp 0x83a3
movq 0x11b76(%rip), %rsi     # 0x19fc0
leaq -0x2d0(%rbp), %rdi
callq 0x21d0
jmp 0x8458
jmp 0x845a
leaq -0x2d0(%rbp), %rdi
callq 0x2240
jmp 0x8468
movl $0x0, -0x4(%rbp)
leaq -0x930(%rbp), %rdi
callq 0x2260
leaq -0x698(%rbp), %rdi
callq 0x2260
leaq -0x2d0(%rbp), %rdi
callq 0x2260
movq -0x68(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
leaq -0x698(%rbp), %rdi
callq 0x2260
leaq -0x2d0(%rbp), %rdi
callq 0x2260
movq -0x378(%rbp), %rdi
callq 0x2320
nopw %cs:(%rax,%rax)