// File: j-faria[P]kima/src/Data.cpp
// Function: Data::load_multi(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
void Data::load_multi(vector<std::string> filenames, const std::string units, 
                      int skip, const vector<std::string>& indicators)
{

  data_t data;

  // Empty the vectors
  t.clear();
  y.clear();
  sig.clear();
  obsi.clear();

  // check for indicator correlations and store stuff
  int nempty = count(indicators.begin(), indicators.end(), "");
  number_indicators = indicators.size() - nempty;
  indicator_correlations = number_indicators > 0;
  indicator_names = indicators;
  indicator_names.erase(
    std::remove( indicator_names.begin(), indicator_names.end(), "" ), 
    indicator_names.end() );

  // Empty the indicator vectors as well
  actind.clear();
  actind.resize(number_indicators);
  for (unsigned n = 0; n < number_indicators; n++)
    actind[n].clear();


  std::string dump; // to dump the first skip lines of each file
  int filecount = 1;
  int last_file_size = 0;

  // Read the files into the data container
  for (auto &filename : filenames) {
    ifstream infile( filename );
    for (int i=0; i<skip; i++)  // skip the first `skip` lines of each file
      getline(infile, dump);
    infile >> data;

    // Complain if something went wrong.
    if (!infile.eof())
    {
      printf("Could not read data file (%s)!\n", filename.c_str());
      exit(1);
    }

    infile.close();

    // Assign instrument int identifier to obsi
    for(unsigned i=last_file_size; i<data.size(); i++){
      obsi.push_back(filecount);
    }
    
    last_file_size = data.size();
    filecount++;
  }

  datafile = "";
  datafiles = filenames;
  dataunits = units;
  dataskip = skip;
  datamulti = true;


  double factor = 1.;
  if(units == "kms") factor = 1E3;

  for (unsigned n=0; n<data.size(); n++)
    {
      // if (n<skip) continue;
      t.push_back(data[n][0]);
      y.push_back(data[n][1] * factor);
      sig.push_back(data[n][2] * factor);

      if (indicator_correlations)
      {
        int j = 0;
        for (unsigned i = 0; i < number_indicators + nempty; i++)
        {
          if (indicators[i] == "")
            continue; // skip column
          else
          {
            actind[j].push_back(data[n][3+i] * factor);
            j++;
          }
        }
      }

    }

  // How many points did we read?
  printf("# Loaded %zu data points from files\n", t.size());
  cout << "#   ";
  for (auto f: filenames){
    cout << f.c_str();
    (f != filenames.back()) ? cout << " | " : cout << " ";
  }
  cout << endl;

  // Did we read activity indicators? how many?
  if(indicator_correlations){
    printf("# Loaded %d observations of %d activity indicators: ", actind[0].size(), actind.size());
    for (const auto i: indicators){
      if (i != ""){
        cout << "'" << i << "'";
        (i != indicators.back()) ? cout << ", " : cout << " ";
      }
    }
    cout << endl;
  }

  // Of how many instruments?
  std::set<int> s( obsi.begin(), obsi.end() );
  // set<int>::iterator iter;
  // for(iter=s.begin(); iter!=s.end();++iter) {  cout << (*iter) << endl;}
  printf("# RVs come from %zu different instruments.\n", s.size());
  number_instruments = s.size();

  if(units == "kms") 
    cout << "# Multiplied all RVs by 1000; units are now m/s." << endl;

  if(number_instruments > 1)
  {
    // We need to sort t because it comes from different instruments
    int N = t.size();
    std::vector<double> tt(N), yy(N);
    std::vector<double> sigsig(N), obsiobsi(N);
    std::vector<int> order(N);
    std::vector<std::vector<double>> actindactind(number_indicators, std::vector<double>(N));

    // order = argsort(t)
    int x=0;
    std::iota(order.begin(), order.end(), x++);
    sort( order.begin(),order.end(), [&](int i,int j){return t[i] < t[j];} );

    for(unsigned i=0; i<N; i++){
      tt[i] = t[order[i]];
      yy[i] = y[order[i]];
      sigsig[i] = sig[order[i]];
      obsiobsi[i] = obsi[order[i]];
      for(unsigned j=0; j<number_indicators; j++)
        actindactind[j][i] = actind[j][order[i]];
    }

    for(unsigned i=0; i<N; i++){
      t[i] = tt[i];
      y[i] = yy[i];
      sig[i] = sigsig[i];
      obsi[i] = obsiobsi[i];
      for(unsigned j=0; j<number_indicators; j++)
        actind[j][i] = actindactind[j][i];
    }

    // debug
    // for(std::vector<int>::size_type i = 0; i != t.size(); i++)
    //     cout << t[i] << "\t" << y[i] << "\t" << sig[i] << "\t" << obsi[i] <<  endl;
  }

  // epoch for the mean anomaly, by default the time of the first observation
  M0_epoch = t[0];

  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x6b0, %rsp            # imm = 0x6B0
movq %rsi, -0x518(%rbp)
movq %rdx, -0x510(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x508(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x15680
movq -0x508(%rbp), %rdi
callq 0x156c0
movq -0x508(%rbp), %rdi
addq $0x18, %rdi
callq 0x156c0
movq -0x508(%rbp), %rdi
addq $0x30, %rdi
callq 0x156c0
movq -0x508(%rbp), %rdi
addq $0x48, %rdi
callq 0x16090
movq -0x28(%rbp), %rdi
callq 0x15830
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
callq 0x15860
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq 0xa567c(%rip), %rdx     # 0xb7a91
callq 0x157e0
movq %rax, -0x500(%rbp)
jmp 0x12423
movq -0x500(%rbp), %rax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rdi
callq 0x15890
movq -0x508(%rbp), %rdi
movl -0x44(%rbp), %ecx
subl %ecx, %eax
movl %eax, 0x7c(%rdi)
movl 0x7c(%rdi), %eax
testl %eax, %eax
setg 0x78(%rdi)
movq -0x28(%rbp), %rsi
subq $-0x80, %rdi
callq 0x158b0
jmp 0x1245d
movq -0x508(%rbp), %rdi
subq $-0x80, %rdi
movq %rdi, -0x528(%rbp)
callq 0x15be0
movq -0x528(%rbp), %rdi
movq %rax, -0x80(%rbp)
callq 0x15c10
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
leaq 0xa55f4(%rip), %rdx     # 0xb7a91
callq 0x15b90
movq %rax, -0x520(%rbp)
jmp 0x124ab
movq -0x520(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x15c40
movq -0x508(%rbp), %rdi
subq $-0x80, %rdi
callq 0x15c10
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x15c40
movq -0x528(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0x15b00
movq %rax, -0x530(%rbp)
jmp 0x1250d
movq -0x508(%rbp), %rdi
movq -0x530(%rbp), %rax
movq %rax, -0xa0(%rbp)
addq $0x60, %rdi
movq %rdi, -0x538(%rbp)
callq 0x15c80
movq -0x508(%rbp), %rax
movq -0x538(%rbp), %rdi
movslq 0x7c(%rax), %rsi
callq 0x15ca0
jmp 0x1254b
movl $0x0, -0xa4(%rbp)
movq -0x508(%rbp), %rcx
movl -0xa4(%rbp), %eax
cmpl 0x7c(%rcx), %eax
jae 0x125a9
movq -0x508(%rbp), %rdi
addq $0x60, %rdi
movl -0xa4(%rbp), %eax
movl %eax, %esi
callq 0x15d30
movq %rax, %rdi
callq 0x156c0
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x12555
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x137e9
leaq -0xc8(%rbp), %rdi
callq 0x66b0
movq -0x518(%rbp), %rax
movl $0x1, -0xcc(%rbp)
movl $0x0, -0xd0(%rbp)
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x15be0
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x15c10
movq %rax, -0xe8(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x162c0
testb $0x1, %al
jne 0x12619
jmp 0x127be
leaq -0xe0(%rbp), %rdi
callq 0x16300
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rsi
leaq -0x2f8(%rbp), %rdi
movl $0x8, %edx
callq 0x6770
jmp 0x12646
movl $0x0, -0x2fc(%rbp)
movl -0x2fc(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x126b1
leaq -0x2f8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x60c0
jmp 0x12670
jmp 0x12672
movl -0x2fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2fc(%rbp)
jmp 0x12650
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x137dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x6130
jmp 0x137dd
leaq -0x2f8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x111f0
jmp 0x126c3
movq -0x2f8(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x2f8(%rbp,%rax), %rdi
callq 0x68c0
movb %al, -0x539(%rbp)
jmp 0x126e3
movb -0x539(%rbp), %al
testb $0x1, %al
jne 0x12718
jmp 0x126ef
movq -0xf0(%rbp), %rdi
callq 0x61e0
movq %rax, %rsi
leaq 0xa4dc3(%rip), %rdi     # 0xb74c8
xorl %eax, %eax
callq 0x6050
jmp 0x1270e
movl $0x1, %edi
callq 0x65d0
leaq -0x2f8(%rbp), %rdi
callq 0x60d0
jmp 0x12726
movl -0xd0(%rbp), %eax
movl %eax, -0x300(%rbp)
movl -0x300(%rbp), %eax
movq %rax, -0x548(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x15d80
movq %rax, %rcx
movq -0x548(%rbp), %rax
cmpq %rcx, %rax
jae 0x12783
movq -0x508(%rbp), %rdi
addq $0x48, %rdi
leaq -0xcc(%rbp), %rsi
callq 0x16320
jmp 0x12770
jmp 0x12772
movl -0x300(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x300(%rbp)
jmp 0x12732
leaq -0x40(%rbp), %rdi
callq 0x15d80
movl %eax, -0xd0(%rbp)
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x6130
leaq -0xe0(%rbp), %rdi
callq 0x16390
jmp 0x125fd
movq -0x508(%rbp), %rdi
addq $0x98, %rdi
leaq 0xa52be(%rip), %rsi     # 0xb7a91
callq 0x6690
jmp 0x127da
movq -0x518(%rbp), %rsi
movq -0x508(%rbp), %rdi
addq $0xb8, %rdi
callq 0x158b0
jmp 0x127f6
movq -0x510(%rbp), %rsi
movq -0x508(%rbp), %rdi
addq $0xd0, %rdi
callq 0x6030
jmp 0x12812
movq -0x510(%rbp), %rdi
movq -0x508(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, 0xf0(%rax)
movb $0x1, 0xf4(%rax)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x308(%rbp)
leaq 0xa4ca0(%rip), %rsi     # 0xb74e8
callq 0x15d50
movb %al, -0x549(%rbp)
jmp 0x12855
movb -0x549(%rbp), %al
testb $0x1, %al
jne 0x12861
jmp 0x12871
movsd 0xa4c47(%rip), %xmm0    # 0xb74b0
movsd %xmm0, -0x308(%rbp)
movl $0x0, -0x30c(%rbp)
movl -0x30c(%rbp), %eax
movq %rax, -0x558(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x15d80
movq %rax, %rcx
movq -0x558(%rbp), %rax
cmpq %rcx, %rax
jae 0x12ab1
movl -0x30c(%rbp), %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x15d30
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xc6a0
movq -0x508(%rbp), %rdi
movq %rax, %rsi
callq 0x15700
jmp 0x128d2
movq -0x508(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x560(%rbp)
movl -0x30c(%rbp), %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x15d30
movq %rax, %rdi
movl $0x1, %esi
callq 0xc6a0
movq -0x560(%rbp), %rdi
movsd (%rax), %xmm0
movsd -0x308(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x318(%rbp)
leaq -0x318(%rbp), %rsi
callq 0x77e0
jmp 0x1292f
movq -0x508(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x568(%rbp)
movl -0x30c(%rbp), %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x15d30
movq %rax, %rdi
movl $0x2, %esi
callq 0xc6a0
movq -0x568(%rbp), %rdi
movsd (%rax), %xmm0
movsd -0x308(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x320(%rbp)
leaq -0x320(%rbp), %rsi
callq 0x77e0
jmp 0x1298c
movq -0x508(%rbp), %rax
testb $0x1, 0x78(%rax)
je 0x12a9b
movl $0x0, -0x324(%rbp)
movl $0x0, -0x328(%rbp)
movq -0x508(%rbp), %rcx
movl -0x328(%rbp), %eax
movl 0x7c(%rcx), %ecx
addl -0x44(%rbp), %ecx
cmpl %ecx, %eax
jae 0x12a99
movq -0x28(%rbp), %rdi
movl -0x328(%rbp), %eax
movl %eax, %esi
callq 0x15db0
movq %rax, %rdi
leaq 0xa50aa(%rip), %rsi     # 0xb7a91
callq 0x15d50
movb %al, -0x569(%rbp)
jmp 0x129f4
movb -0x569(%rbp), %al
testb $0x1, %al
jne 0x12a00
jmp 0x12a05
jmp 0x12a85
movq -0x508(%rbp), %rdi
addq $0x60, %rdi
movslq -0x324(%rbp), %rsi
callq 0x15d30
movq %rax, -0x578(%rbp)
movl -0x30c(%rbp), %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x15d30
movq %rax, %rdi
movl -0x328(%rbp), %eax
addl $0x3, %eax
movl %eax, %esi
callq 0xc6a0
movq -0x578(%rbp), %rdi
movsd (%rax), %xmm0
movsd -0x308(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x330(%rbp)
leaq -0x330(%rbp), %rsi
callq 0x77e0
jmp 0x12a74
movl -0x324(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x324(%rbp)
jmp 0x12a85
movl -0x328(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x328(%rbp)
jmp 0x129b1
jmp 0x12a9b
jmp 0x12a9d
movl -0x30c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30c(%rbp)
jmp 0x1287b
movq -0x508(%rbp), %rdi
callq 0x7c90
movq %rax, %rsi
leaq 0xa4b17(%rip), %rdi     # 0xb75de
xorl %eax, %eax
callq 0x6050
jmp 0x12ad0
movq 0x1074c1(%rip), %rdi    # 0x119f98
leaq 0xa4b25(%rip), %rsi     # 0xb7603
callq 0x64f0
jmp 0x12ae5
movq -0x518(%rbp), %rax
movq %rax, -0x338(%rbp)
movq -0x338(%rbp), %rdi
callq 0x15be0
movq %rax, -0x340(%rbp)
movq -0x338(%rbp), %rdi
callq 0x15c10
movq %rax, -0x348(%rbp)
leaq -0x340(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0x162c0
testb $0x1, %al
jne 0x12b35
jmp 0x12bf8
leaq -0x340(%rbp), %rdi
callq 0x16300
movq %rax, %rsi
leaq -0x368(%rbp), %rdi
callq 0x6200
jmp 0x12b52
leaq -0x368(%rbp), %rdi
callq 0x61e0
movq %rax, %rsi
movq 0x107430(%rip), %rdi    # 0x119f98
callq 0x64f0
jmp 0x12b6f
movq -0x518(%rbp), %rdi
callq 0x163b0
movq %rax, %rsi
leaq -0x368(%rbp), %rdi
callq 0x15fa0
testb $0x1, %al
jne 0x12b90
jmp 0x12ba7
movq 0x107401(%rip), %rdi    # 0x119f98
leaq 0xa4a6a(%rip), %rsi     # 0xb7608
callq 0x64f0
jmp 0x12ba5
jmp 0x12bbe
movq 0x1073ea(%rip), %rdi    # 0x119f98
leaq 0xa4a51(%rip), %rsi     # 0xb7606
callq 0x64f0
jmp 0x12bbc
jmp 0x12bbe
leaq -0x368(%rbp), %rdi
callq 0x6948
leaq -0x340(%rbp), %rdi
callq 0x16390
jmp 0x12b19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x6948
jmp 0x137dd
movq 0x107399(%rip), %rdi    # 0x119f98
movq 0x107312(%rip), %rsi    # 0x119f18
callq 0x6530
jmp 0x12c0d
movq -0x508(%rbp), %rax
testb $0x1, 0x78(%rax)
je 0x12df8
movq -0x508(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x590(%rbp)
xorl %eax, %eax
movl %eax, -0x57c(%rbp)
movl %eax, %esi
callq 0x15d30
movq %rax, %rdi
callq 0x7c90
movq -0x590(%rbp), %rdi
movq %rax, -0x588(%rbp)
callq 0x15d80
movq -0x588(%rbp), %rsi
movq %rax, %rdx
movl -0x57c(%rbp), %eax
leaq 0xa499b(%rip), %rdi     # 0xb760c
callq 0x6050
jmp 0x12c78
movq -0x28(%rbp), %rax
movq %rax, -0x370(%rbp)
movq -0x370(%rbp), %rdi
callq 0x15830
movq %rax, -0x378(%rbp)
movq -0x370(%rbp), %rdi
callq 0x15860
movq %rax, -0x380(%rbp)
leaq -0x378(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0x15f10
testb $0x1, %al
jne 0x12cc5
jmp 0x12de1
leaq -0x378(%rbp), %rdi
callq 0x15f50
movq %rax, %rsi
leaq -0x3a0(%rbp), %rdi
callq 0x6200
jmp 0x12ce2
leaq 0xa4da8(%rip), %rsi     # 0xb7a91
leaq -0x3a0(%rbp), %rdi
callq 0x15f70
movb %al, -0x591(%rbp)
jmp 0x12cfd
movb -0x591(%rbp), %al
testb $0x1, %al
jne 0x12d0c
jmp 0x12dc4
movq 0x107285(%rip), %rdi    # 0x119f98
leaq 0xa4d74(%rip), %rsi     # 0xb7a8e
callq 0x64f0
movq %rax, -0x5a0(%rbp)
jmp 0x12d28
movq -0x5a0(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x6490
movq %rax, -0x5a8(%rbp)
jmp 0x12d44
movq -0x5a8(%rbp), %rdi
leaq 0xa4d3c(%rip), %rsi     # 0xb7a8e
callq 0x64f0
jmp 0x12d59
movq -0x28(%rbp), %rdi
callq 0x15fd0
movq %rax, %rsi
leaq -0x3a0(%rbp), %rdi
callq 0x15fa0
testb $0x1, %al
jne 0x12d77
jmp 0x12d8e
movq 0x10721a(%rip), %rdi    # 0x119f98
leaq 0xb92bf(%rip), %rsi     # 0xcc044
callq 0x64f0
jmp 0x12d8c
jmp 0x12da5
movq 0x107203(%rip), %rdi    # 0x119f98
leaq 0xa486a(%rip), %rsi     # 0xb7606
callq 0x64f0
jmp 0x12da3
jmp 0x12da5
jmp 0x12dc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x3a0(%rbp), %rdi
callq 0x6948
jmp 0x137dd
leaq -0x3a0(%rbp), %rdi
callq 0x6948
leaq -0x378(%rbp), %rdi
callq 0x16010
jmp 0x12ca9
movq 0x1071b0(%rip), %rdi    # 0x119f98
movq 0x107129(%rip), %rsi    # 0x119f18
callq 0x6530
jmp 0x12df6
jmp 0x12df8
movq -0x508(%rbp), %rdi
addq $0x48, %rdi
movq %rdi, -0x5b0(%rbp)
callq 0x16140
movq -0x5b0(%rbp), %rdi
movq %rax, -0x3d8(%rbp)
callq 0x16170
movq %rax, -0x3e0(%rbp)
movq -0x3d8(%rbp), %rsi
movq -0x3e0(%rbp), %rdx
leaq -0x3d0(%rbp), %rdi
callq 0x161a0
jmp 0x12e45
leaq -0x3d0(%rbp), %rdi
callq 0x16220
movq %rax, %rsi
leaq 0xa4726(%rip), %rdi     # 0xb7581
xorl %eax, %eax
callq 0x6050
jmp 0x12e64
leaq -0x3d0(%rbp), %rdi
callq 0x16220
movq -0x510(%rbp), %rdi
movq %rax, %rcx
movq -0x508(%rbp), %rax
movl %ecx, 0xf8(%rax)
leaq 0xa465a(%rip), %rsi     # 0xb74e8
callq 0x15d50
movb %al, -0x5b1(%rbp)
jmp 0x12e9b
movb -0x5b1(%rbp), %al
testb $0x1, %al
jne 0x12ea7
jmp 0x12eeb
movq 0x1070ea(%rip), %rdi    # 0x119f98
leaq 0xa46f8(%rip), %rsi     # 0xb75ad
callq 0x64f0
movq %rax, -0x5c0(%rbp)
jmp 0x12ec3
movq -0x5c0(%rbp), %rdi
movq 0x107047(%rip), %rsi    # 0x119f18
callq 0x6530
jmp 0x12ed8
jmp 0x12eeb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x137d1
movq -0x508(%rbp), %rax
cmpl $0x1, 0xf8(%rax)
jle 0x13781
movq -0x508(%rbp), %rdi
callq 0x7c90
movl %eax, -0x3e4(%rbp)
movslq -0x3e4(%rbp), %rax
movq %rax, -0x5d0(%rbp)
leaq -0x401(%rbp), %rdi
movq %rdi, -0x5c8(%rbp)
callq 0x7e10
movq -0x5d0(%rbp), %rsi
movq -0x5c8(%rbp), %rdx
leaq -0x400(%rbp), %rdi
callq 0x163f0
jmp 0x12f4e
leaq -0x401(%rbp), %rdi
callq 0x8190
movslq -0x3e4(%rbp), %rax
movq %rax, -0x5e0(%rbp)
leaq -0x421(%rbp), %rdi
movq %rdi, -0x5d8(%rbp)
callq 0x7e10
movq -0x5e0(%rbp), %rsi
movq -0x5d8(%rbp), %rdx
leaq -0x420(%rbp), %rdi
callq 0x163f0
jmp 0x12f97
leaq -0x421(%rbp), %rdi
callq 0x8190
movslq -0x3e4(%rbp), %rax
movq %rax, -0x5f0(%rbp)
leaq -0x441(%rbp), %rdi
movq %rdi, -0x5e8(%rbp)
callq 0x7e10
movq -0x5f0(%rbp), %rsi
movq -0x5e8(%rbp), %rdx
leaq -0x440(%rbp), %rdi
callq 0x163f0
jmp 0x12fe0
leaq -0x441(%rbp), %rdi
callq 0x8190
movslq -0x3e4(%rbp), %rax
movq %rax, -0x600(%rbp)
leaq -0x461(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
callq 0x7e10
movq -0x600(%rbp), %rsi
movq -0x5f8(%rbp), %rdx
leaq -0x460(%rbp), %rdi
callq 0x163f0
jmp 0x13029
leaq -0x461(%rbp), %rdi
callq 0x8190
movslq -0x3e4(%rbp), %rax
movq %rax, -0x610(%rbp)
leaq -0x481(%rbp), %rdi
movq %rdi, -0x608(%rbp)
callq 0x16460
movq -0x610(%rbp), %rsi
movq -0x608(%rbp), %rdx
leaq -0x480(%rbp), %rdi
callq 0x16480
jmp 0x13072
leaq -0x481(%rbp), %rdi
callq 0x164f0
movq -0x508(%rbp), %rax
movslq 0x7c(%rax), %rax
movq %rax, -0x628(%rbp)
movslq -0x3e4(%rbp), %rax
movq %rax, -0x620(%rbp)
leaq -0x4b9(%rbp), %rdi
movq %rdi, -0x618(%rbp)
callq 0x7e10
movq -0x620(%rbp), %rsi
movq -0x618(%rbp), %rdx
leaq -0x4b8(%rbp), %rdi
callq 0x163f0
jmp 0x130cd
leaq -0x4ba(%rbp), %rdi
movq %rdi, -0x630(%rbp)
callq 0x16510
movq -0x628(%rbp), %rsi
movq -0x630(%rbp), %rcx
leaq -0x4a0(%rbp), %rdi
leaq -0x4b8(%rbp), %rdx
callq 0x16530
jmp 0x13103
leaq -0x4ba(%rbp), %rdi
callq 0x165b0
leaq -0x4b8(%rbp), %rdi
callq 0x78f0
leaq -0x4b9(%rbp), %rdi
callq 0x8190
movl $0x0, -0x4c0(%rbp)
leaq -0x480(%rbp), %rdi
movq %rdi, -0x638(%rbp)
callq 0x16140
movq -0x638(%rbp), %rdi
movq %rax, -0x4c8(%rbp)
callq 0x16170
movq %rax, -0x4d0(%rbp)
movl -0x4c0(%rbp), %edx
movl %edx, %eax
incl %eax
movl %eax, -0x4c0(%rbp)
movq -0x4c8(%rbp), %rdi
movq -0x4d0(%rbp), %rsi
callq 0x165d0
jmp 0x13183
leaq -0x480(%rbp), %rdi
movq %rdi, -0x640(%rbp)
callq 0x16140
movq -0x640(%rbp), %rdi
movq %rax, -0x4d8(%rbp)
callq 0x16170
movq %rax, %rcx
movq -0x508(%rbp), %rax
movq %rcx, -0x4e0(%rbp)
movq %rax, -0x4e8(%rbp)
movq -0x4d8(%rbp), %rdi
movq -0x4e0(%rbp), %rsi
movq -0x4e8(%rbp), %rdx
callq 0x13800
jmp 0x131dd
movl $0x0, -0x4ec(%rbp)
movl -0x4ec(%rbp), %eax
cmpl -0x3e4(%rbp), %eax
jae 0x1352d
movl -0x4ec(%rbp), %eax
movl %eax, %esi
leaq -0x480(%rbp), %rdi
callq 0x16120
movq -0x508(%rbp), %rdi
movslq (%rax), %rsi
callq 0xc6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x678(%rbp)
movl -0x4ec(%rbp), %eax
movl %eax, %esi
leaq -0x400(%rbp), %rdi
callq 0xc6a0
movsd -0x678(%rbp), %xmm0
movq %rax, %rcx
movq -0x508(%rbp), %rax
movsd %xmm0, (%rcx)
addq $0x18, %rax
movq %rax, -0x670(%rbp)
movl -0x4ec(%rbp), %eax
movl %eax, %esi
leaq -0x480(%rbp), %rdi
callq 0x16120
movq -0x670(%rbp), %rdi
movslq (%rax), %rsi
callq 0xc6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x668(%rbp)
movl -0x4ec(%rbp), %eax
movl %eax, %esi
leaq -0x420(%rbp), %rdi
callq 0xc6a0
movsd -0x668(%rbp), %xmm0
movq %rax, %rcx
movq -0x508(%rbp), %rax
movsd %xmm0, (%rcx)
addq $0x30, %rax
movq %rax, -0x660(%rbp)
movl -0x4ec(%rbp), %eax
movl %eax, %esi
leaq -0x480(%rbp), %rdi
callq 0x16120
movq -0x660(%rbp), %rdi
movslq (%rax), %rsi
callq 0xc6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x658(%rbp)
movl -0x4ec(%rbp), %eax
movl %eax, %esi
leaq -0x440(%rbp), %rdi
callq 0xc6a0
movsd -0x658(%rbp), %xmm0
movq %rax, %rcx
movq -0x508(%rbp), %rax
movsd %xmm0, (%rcx)
addq $0x48, %rax
movq %rax, -0x650(%rbp)
movl -0x4ec(%rbp), %eax
movl %eax, %esi
leaq -0x480(%rbp), %rdi
callq 0x16120
movq -0x650(%rbp), %rdi
movslq (%rax), %rsi
callq 0x16120
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x648(%rbp)
movl -0x4ec(%rbp), %eax
movl %eax, %esi
leaq -0x460(%rbp), %rdi
callq 0xc6a0
movsd -0x648(%rbp), %xmm0
movsd %xmm0, (%rax)
movl $0x0, -0x4f0(%rbp)
movq -0x508(%rbp), %rcx
movl -0x4f0(%rbp), %eax
cmpl 0x7c(%rcx), %eax
jae 0x13517
movq -0x508(%rbp), %rdi
addq $0x60, %rdi
movl -0x4f0(%rbp), %eax
movl %eax, %esi
callq 0x15d30
movq %rax, -0x688(%rbp)
movl -0x4ec(%rbp), %eax
movl %eax, %esi
leaq -0x480(%rbp), %rdi
callq 0x16120
movq -0x688(%rbp), %rdi
movslq (%rax), %rsi
callq 0xc6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x680(%rbp)
movl -0x4f0(%rbp), %eax
movl %eax, %esi
leaq -0x4a0(%rbp), %rdi
callq 0x15d30
movq %rax, %rdi
movl -0x4ec(%rbp), %eax
movl %eax, %esi
callq 0xc6a0
movsd -0x680(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x4f0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4f0(%rbp)
jmp 0x1337e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x401(%rbp), %rdi
callq 0x8190
jmp 0x137d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x421(%rbp), %rdi
callq 0x8190
jmp 0x13773
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x441(%rbp), %rdi
callq 0x8190
jmp 0x13767
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x461(%rbp), %rdi
callq 0x8190
jmp 0x1375b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x481(%rbp), %rdi
callq 0x164f0
jmp 0x1374f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x134e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x4ba(%rbp), %rdi
callq 0x165b0
leaq -0x4b8(%rbp), %rdi
callq 0x78f0
leaq -0x4b9(%rbp), %rdi
callq 0x8190
jmp 0x13743
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x4a0(%rbp), %rdi
callq 0x16030
jmp 0x13743
jmp 0x13519
movl -0x4ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4ec(%rbp)
jmp 0x131e7
movl $0x0, -0x4f4(%rbp)
movl -0x4f4(%rbp), %eax
cmpl -0x3e4(%rbp), %eax
jae 0x136f9
movl -0x4f4(%rbp), %eax
movl %eax, %esi
leaq -0x400(%rbp), %rdi
callq 0xc6a0
movq -0x508(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x6a8(%rbp)
movl -0x4f4(%rbp), %eax
movl %eax, %esi
callq 0xc6a0
movsd -0x6a8(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x4f4(%rbp), %eax
movl %eax, %esi
leaq -0x420(%rbp), %rdi
callq 0xc6a0
movq -0x508(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x6a0(%rbp)
addq $0x18, %rdi
movl -0x4f4(%rbp), %eax
movl %eax, %esi
callq 0xc6a0
movsd -0x6a0(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x4f4(%rbp), %eax
movl %eax, %esi
leaq -0x440(%rbp), %rdi
callq 0xc6a0
movq -0x508(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x698(%rbp)
addq $0x30, %rdi
movl -0x4f4(%rbp), %eax
movl %eax, %esi
callq 0xc6a0
movsd -0x698(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x4f4(%rbp), %eax
movl %eax, %esi
leaq -0x460(%rbp), %rdi
callq 0xc6a0
movq -0x508(%rbp), %rdi
cvttsd2si (%rax), %eax
movl %eax, -0x68c(%rbp)
addq $0x48, %rdi
movl -0x4f4(%rbp), %eax
movl %eax, %esi
callq 0x16120
movl -0x68c(%rbp), %ecx
movl %ecx, (%rax)
movl $0x0, -0x4f8(%rbp)
movq -0x508(%rbp), %rcx
movl -0x4f8(%rbp), %eax
cmpl 0x7c(%rcx), %eax
jae 0x136e3
movl -0x4f8(%rbp), %eax
movl %eax, %esi
leaq -0x4a0(%rbp), %rdi
callq 0x15d30
movq %rax, %rdi
movl -0x4f4(%rbp), %eax
movl %eax, %esi
callq 0xc6a0
movq -0x508(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x6b0(%rbp)
addq $0x60, %rdi
movl -0x4f8(%rbp), %eax
movl %eax, %esi
callq 0x15d30
movq %rax, %rdi
movl -0x4f4(%rbp), %eax
movl %eax, %esi
callq 0xc6a0
movsd -0x6b0(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x4f8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4f8(%rbp)
jmp 0x13659
jmp 0x136e5
movl -0x4f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4f4(%rbp)
jmp 0x13537
leaq -0x4a0(%rbp), %rdi
callq 0x16030
leaq -0x480(%rbp), %rdi
callq 0x16260
leaq -0x460(%rbp), %rdi
callq 0x78f0
leaq -0x440(%rbp), %rdi
callq 0x78f0
leaq -0x420(%rbp), %rdi
callq 0x78f0
leaq -0x400(%rbp), %rdi
callq 0x78f0
jmp 0x13781
leaq -0x480(%rbp), %rdi
callq 0x16260
leaq -0x460(%rbp), %rdi
callq 0x78f0
leaq -0x440(%rbp), %rdi
callq 0x78f0
leaq -0x420(%rbp), %rdi
callq 0x78f0
leaq -0x400(%rbp), %rdi
callq 0x78f0
jmp 0x137d1
movq -0x508(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xc6a0
movq %rax, %rcx
movq -0x508(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x100(%rax)
leaq -0x3d0(%rbp), %rdi
callq 0x16240
leaq -0xc8(%rbp), %rdi
callq 0x6948
leaq -0x40(%rbp), %rdi
callq 0x16030
addq $0x6b0, %rsp            # imm = 0x6B0
popq %rbp
retq
leaq -0x3d0(%rbp), %rdi
callq 0x16240
leaq -0xc8(%rbp), %rdi
callq 0x6948
leaq -0x40(%rbp), %rdi
callq 0x16030
movq -0x60(%rbp), %rdi
callq 0x6830
nopl (%rax,%rax)