// File: /workspace/github_cpp_makefile_star2_O2/tanakh[P]icfpc2015/main.cpp
// Function: main
int main(int argc, char *argv[])
{
  ppw.insert("ei!");
  ppw.insert("r'lyeh");
  ppw.insert("ia! ia!");
  ppw.insert("yuggoth");
  ppw.insert("planet 10");
  ppw.insert("tsathoggua");
  ppw.insert("yogSothoth");
  ppw.insert("john bigboote");
  ppw.insert("cthulhu fhtagn!");
  ppw.insert("Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn.");

  // srand(time(NULL));
  init_genrand(time(NULL));

  string tag;
  vector<string> files;
  int tle = -1;
  int mle = -1;
  int core = 1;

  bool anneal = false;
  double init_temp;
  double temp_decay;
  int turns;

  bool gene = false;

  bool rep = false;
  int rep_id;
  int rep_seed;
  string rep_cmds;
  string rep_file;

  bool beam = false;
  int beam_width = 1;

  vector<double> def_param {4.17089, 1.37104, 1.36987, 1.4519, 0.139807, 3.30003, 1.5467, 1.16281, 0.395305, 1.95616 };

  anneal = true;
  beam_width = 1;
  init_temp = 250;
  temp_decay = 0.992;
  turns = 250;

  for (int i = 1; i < argc; ) {
    string arg = argv[i];

    if (arg == "-f") {
      files.push_back(argv[i+1]);
      i += 2;
    }
    else if (arg == "-t") {
      tle = atoi(argv[i+1]);
      i += 2;
    }
    else if (arg == "-m") {
      mle = atoi(argv[i+1]);
      i += 2;
    }
    else if (arg == "-c") {
      core = atoi(argv[i+1]);
      i += 2;
    }
    else if (arg == "-p") {
      string w = argv[i+1];
      for (auto &c: w) c = tolower(c);
      ppw.insert(w);
      i += 2;
    }

    else if (arg == "-g") {
      tag = argv[i+1];
      i += 2;
    }
    else if (arg == "-v") {
      verbose = true;
      i++;
    }
    else if (arg == "-a") {
      anneal = true;

      istringstream iss(argv[i+1]);
      char dmy;
      iss >> init_temp >> dmy >> temp_decay >> dmy >> turns;

      i += 2;
    }
    else if (arg == "-ga") {
      gene = true;
      i++;
    }
    else if (arg == "-b") {
      beam = true;
      beam_width = atoi(argv[i+1]);
      i += 2;
    }
    else if (arg == "-r") {
      rep = true;

      istringstream iss(argv[i+1]);
      char dmy;
      iss >> rep_id >> dmy >> rep_seed >> dmy;
      getline(iss, rep_cmds);

      i+=2;
    }
    else if (arg == "-rr") {
      rep = true;

      istringstream iss(argv[i+1]);
      char dmy;
      iss >> rep_id >> dmy >> rep_seed >> dmy;
      getline(iss, rep_file);

      i+=2;
    }
  }

  if (rep) {
    ostringstream fn;
    fn << "problems/problem_" << rep_id << ".json";

    if (rep_file != "") {
      ifstream ifs(rep_file.c_str());
      value v;
      parse(v, ifs);
      string sol = v.get<picojson::array>()[0].get<object>()["solution"].get<string>();

      replay(read_problem(fn.str()), rep_seed, sol);
    }
    else {
      replay(read_problem(fn.str()), rep_seed, rep_cmds);
    }
    return 0;
  }

  vector<problem> problems;
  for (auto &file: files)
    problems.push_back(read_problem(file));

  int total_problems = 0;
  for (auto &p: problems)
    total_problems += p.source_seeds.size();

  picojson::array v;
  vector<vector<int>> scores;
  for (auto &p: problems) {
    vector<int> ss;
    cerr << "\n" << "problem: " << p.id << ": " << p.width << "x" << p.height << endl;

    int ttt = 0;
    for (auto &seed: p.source_seeds) {
      cerr << "\n" << p.id << " [" << ++ttt << "/" << p.source_seeds.size() << "]" << endl;

      auto sol =
        anneal ? annealing(p, seed, tle, mle, tag, init_temp, temp_decay, turns, beam_width):
        gene ? ga(p, seed, tle, mle, tag):
        beam ? beam_search(p, seed, tle, mle, def_param, beam_width):
        solve(p, seed, tle, mle, def_param, true);

      if (!anneal) replay(p, seed, sol.first);

      output_solution(p.id, seed, sol.second, sol.first, tag);

      cerr << "score: " << sol.second << endl;

      object o;
      o["problemId"] = value((int64_t)p.id);
      o["seed"] = value((int64_t)seed);
      if (tag != "")
        o["tag"] = value(tag);
      o["solution"] = value(sol.first);
      v.push_back(value(o));
      ss.push_back(sol.second);
    }
    scores.push_back(ss);
  }
  cout << value(v) << endl;

  double gtot = 0;

  cerr << "summary: " << endl;
  vector<pair<int,double>> vv;
  for (int i=0;i<(int)problems.size();i++) {
    double avg = 0;
    for (auto &p: scores[i]) avg += p;
    avg /= scores[i].size();
    vv.emplace_back(problems[i].id, avg);

    double avg_size = 0;
    for (auto &p: problems[i].units)
      avg_size += p.members.size();
    avg_size /= problems[i].units.size();
    double blks = problems[i].source_length * avg_size;
    double exp_line = blks / problems[i].width;
    gtot += avg / exp_line;
  }

  sort(vv.begin(), vv.end());

  for (auto &i: vv)
    cerr << i.first << ": " << i.second << endl;

  cerr << "grand total: " << gtot / problems.size() << endl;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x578, %rsp            # imm = 0x578
movq %rsi, 0x10(%rsp)
movl %edi, %r14d
leaq 0xa5a4(%rip), %rsi      # 0x125e4
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x15604(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
leaq 0xa56b(%rip), %rsi      # 0x125e8
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x155c7(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
leaq 0xa535(%rip), %rsi      # 0x125ef
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x1558a(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
leaq 0xa500(%rip), %rsi      # 0x125f7
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x1554d(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
leaq 0xa4cb(%rip), %rsi      # 0x125ff
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x15510(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
leaq 0xa498(%rip), %rsi      # 0x12609
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x154d3(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
leaq 0xa466(%rip), %rsi      # 0x12614
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x15496(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
leaq 0xa434(%rip), %rsi      # 0x1261f
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x15459(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
leaq 0xa405(%rip), %rsi      # 0x1262d
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x1541c(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
leaq 0xa3d8(%rip), %rsi      # 0x1263d
leaq 0x180(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x30e0
leaq 0x153df(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %rsi
callq 0x1052e
leaq 0x180(%rsp), %rdi
callq 0x3550
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x32d0
movq %rax, %rdi
callq 0x379c
leaq 0x3b8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %bl, (%rax)
andq $0x0, 0xd0(%rsp)
leaq 0x398(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xc0(%rsp)
movb %bl, (%rax)
leaq 0x170(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %bl, (%rax)
leaq 0x9f5e(%rip), %rsi      # 0x12260
pushq $0xa
popq %rdx
leaq 0x180(%rsp), %rax
movq %rdx, %rcx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x3c8(%rsp), %rdi
leaq 0x3e0(%rsp), %rcx
movq %rax, %rsi
callq 0xa21e
movabsq $0x406f400000000000, %rax # imm = 0x406F400000000000
leaq 0x98(%rsp), %rcx
movq %rax, (%rcx)
movabsq $0x3fefbe76c8b43958, %rax # imm = 0x3FEFBE76C8B43958
leaq 0x90(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x2c(%rsp), %rax
movl $0xfa, (%rax)
pushq $0x1
popq %rbx
movq $0x0, 0x20(%rsp)
leaq 0x3e0(%rsp), %r15
leaq 0xe0(%rsp), %r13
movl %ebx, %eax
movq %rax, 0x88(%rsp)
cmpl %r14d, %ebx
jge 0x875e
movq %r13, %r12
movslq %ebx, %r13
movq 0x10(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq %r15, %rdi
leaq 0x180(%rsp), %rdx
callq 0x30e0
movq %r15, %rdi
leaq 0xa2b6(%rip), %rsi      # 0x12671
callq 0xa254
testb %al, %al
je 0x8401
movq 0x10(%rsp), %rax
movq 0x8(%rax,%r13,8), %rsi
leaq 0x180(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %r13
movq %r12, %rdx
callq 0x30e0
leaq 0xc0(%rsp), %rdi
movq %rbp, %rsi
callq 0x10722
movq %rbp, %rdi
callq 0x3550
addl $0x2, %ebx
jmp 0x8440
movq %r15, %rdi
leaq 0xa269(%rip), %rsi      # 0x12674
callq 0xa254
testb %al, %al
jne 0x843a
movq %r15, %rdi
leaq 0xa259(%rip), %rsi      # 0x12677
callq 0xa254
testb %al, %al
jne 0x843a
movq %r15, %rdi
leaq 0xa249(%rip), %rsi      # 0x1267a
callq 0xa254
testb %al, %al
je 0x844d
addl $0x2, %ebx
movq %r12, %r13
movq %r15, %rdi
callq 0x3550
jmp 0x8389
movq %r15, %rdi
leaq 0xa226(%rip), %rsi      # 0x1267d
callq 0xa254
testb %al, %al
je 0x84ac
movl %r14d, 0x68(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax,%r13,8), %rsi
leaq 0x180(%rsp), %rdi
movq %r12, %rdx
callq 0x30e0
movq 0x180(%rsp), %r13
movq 0x188(%rsp), %rbp
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0x84db
movsbl (%r13,%r14), %edi
callq 0x33c0
movb %al, (%r13,%r14)
incq %r14
jmp 0x8492
movq %r15, %rdi
leaq 0xa1ca(%rip), %rsi      # 0x12680
callq 0xa254
testb %al, %al
je 0x8507
movq 0x10(%rsp), %rax
movq 0x8(%rax,%r13,8), %rsi
leaq 0x3a8(%rsp), %rdi
callq 0x3510
jmp 0x843a
leaq 0x1517e(%rip), %rdi     # 0x1d660
leaq 0x180(%rsp), %r14
movq %r14, %rsi
callq 0x10800
addl $0x2, %ebx
movq %r14, %rdi
callq 0x3550
movl 0x68(%rsp), %r14d
jmp 0x843d
movq %r15, %rdi
leaq 0xa172(%rip), %rsi      # 0x12683
callq 0xa254
testb %al, %al
je 0x8528
movb $0x1, 0x1516f(%rip)     # 0x1d690
incl %ebx
jmp 0x843d
movq %r15, %rdi
leaq 0xa154(%rip), %rsi      # 0x12686
callq 0xa254
testb %al, %al
je 0x85cf
movq 0x10(%rsp), %rax
movq 0x8(%rax,%r13,8), %rsi
movq %r12, %r13
movq %r12, %rdi
leaq 0x40(%rsp), %rdx
callq 0x30e0
leaq 0x180(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
pushq $0x8
popq %rdx
callq 0x3470
movq %r13, %rdi
callq 0x3550
movq %r12, %rdi
leaq 0x98(%rsp), %rsi
callq 0x31d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x3380
movq %rax, %rdi
leaq 0x90(%rsp), %rsi
callq 0x31d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x3380
movq %rax, %rdi
leaq 0x2c(%rsp), %rsi
callq 0x3190
addl $0x2, %ebx
leaq 0x180(%rsp), %rdi
callq 0x3110
jmp 0x8440
movq %r15, %rdi
leaq 0xa0b0(%rip), %rsi      # 0x12689
callq 0xa254
testb %al, %al
jne 0x8521
movq %r15, %rdi
leaq 0xa09d(%rip), %rsi      # 0x1268d
callq 0xa254
testb %al, %al
je 0x8615
movq 0x10(%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x3410
movq %rax, 0x88(%rsp)
jmp 0x843a
movq %r15, %rdi
leaq 0xa071(%rip), %rsi      # 0x12690
callq 0xa254
testb %al, %al
je 0x86ae
movq 0x10(%rsp), %rax
movq 0x8(%rax,%r13,8), %rsi
movq %r12, %r13
movq %r12, %rdi
leaq 0x40(%rsp), %rdx
callq 0x30e0
leaq 0x180(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
pushq $0x8
popq %rdx
callq 0x3470
movq %r13, %rdi
callq 0x3550
movq %r12, %rdi
leaq 0x28(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
movq %r13, %rsi
callq 0x3380
movq %rax, %rdi
leaq 0x1c(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
movq %r13, %rsi
callq 0x3380
leaq 0x180(%rsp), %rdi
leaq 0x388(%rsp), %rsi
callq 0x3070
jmp 0x8742
movq %r15, %rdi
leaq 0x9fdb(%rip), %rsi      # 0x12693
callq 0xa254
testb %al, %al
je 0x843d
movq 0x10(%rsp), %rax
movq 0x8(%rax,%r13,8), %rsi
movq %r12, %r13
movq %r12, %rdi
leaq 0x40(%rsp), %rdx
callq 0x30e0
leaq 0x180(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
pushq $0x8
popq %rdx
callq 0x3470
movq %r13, %rdi
callq 0x3550
movq %r12, %rdi
leaq 0x28(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
movq %r13, %rsi
callq 0x3380
movq %rax, %rdi
leaq 0x1c(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
movq %r13, %rsi
callq 0x3380
leaq 0x180(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x3070
addl $0x2, %ebx
leaq 0x180(%rsp), %rdi
callq 0x3110
movb $0x1, %al
movq %rax, 0x20(%rsp)
jmp 0x8440
testb $0x1, 0x20(%rsp)
je 0x88e6
leaq 0x3e0(%rsp), %rdi
callq 0x3390
leaq 0x9f1a(%rip), %rsi      # 0x12697
leaq 0x3e0(%rsp), %rdi
callq 0x32f0
movl 0x28(%rsp), %esi
movq %rax, %rdi
callq 0x3490
leaq 0x9d42(%rip), %rsi      # 0x124df
movq %rax, %rdi
callq 0x32f0
leaq 0x9efe(%rip), %rsi      # 0x126aa
leaq 0x160(%rsp), %rdi
callq 0x9d6e
testb %al, %al
je 0x902a
movq 0x160(%rsp), %rsi
leaq 0x180(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x34f0
leaq 0x70(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x558(%rsp), %rdi
leaq 0x180(%rsp), %rdx
callq 0x96f1
leaq 0x558(%rsp), %rdi
callq 0x3550
leaq 0x70(%rsp), %rdi
callq 0x960e
movq (%rax), %rdi
callq 0x94f4
movq %rax, %rbx
leaq 0x9cd9(%rip), %rsi      # 0x124f8
leaq 0xe0(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
callq 0x30e0
leaq 0xe0(%rsp), %rsi
movq %rbx, %rdi
callq 0x954c
movq %rax, %rdi
callq 0xa262
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x33a0
leaq 0xe0(%rsp), %rdi
callq 0x3550
leaq 0x3e8(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x3420
leaq 0xe0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x4336
movl 0x1c(%rsp), %esi
leaq 0xe0(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x79d2
leaq 0xe0(%rsp), %rdi
callq 0x96ce
leaq 0xa0(%rsp), %rdi
callq 0x3550
leaq 0x40(%rsp), %rdi
callq 0x3550
leaq 0x70(%rsp), %rdi
callq 0x9760
leaq 0x180(%rsp), %rdi
callq 0x3080
jmp 0x9087
xorpd %xmm0, %xmm0
leaq 0x40(%rsp), %rbx
andq $0x0, 0x10(%rbx)
movapd %xmm0, (%rbx)
movq 0xc0(%rsp), %r14
movq 0xc8(%rsp), %r12
leaq 0x180(%rsp), %r15
cmpq %r12, %r14
je 0x8939
movq %r15, %rdi
movq %r14, %rsi
callq 0x4336
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1094e
movq %r15, %rdi
callq 0x96ce
addq $0x20, %r14
jmp 0x8910
movq 0x40(%rsp), %r12
movq 0x48(%rsp), %rax
movq %rax, 0xd8(%rsp)
xorpd %xmm0, %xmm0
leaq 0xa0(%rsp), %rax
movapd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x70(%rsp), %rax
movapd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x3a8(%rsp), %rbp
leaq 0xe0(%rsp), %r13
leaq 0x30(%rsp), %r15
cmpq 0xd8(%rsp), %r12
je 0x8d4c
xorpd %xmm0, %xmm0
movapd %xmm0, 0x140(%rsp)
andq $0x0, 0x150(%rsp)
movq 0x1363a(%rip), %rdi     # 0x1bfe8
leaq 0x9cf4(%rip), %rsi      # 0x126a9
callq 0x32f0
movq %rax, %rdi
leaq 0x9ce7(%rip), %rsi      # 0x126ab
callq 0x32f0
movl (%r12), %esi
movq %rax, %rdi
callq 0x3490
movq %rax, %rdi
leaq 0x9b79(%rip), %rsi      # 0x12558
callq 0x32f0
movl 0x20(%r12), %esi
movq %rax, %rdi
callq 0x3490
movq %rax, %rdi
leaq 0x9de3(%rip), %rsi      # 0x127de
callq 0x32f0
movl 0x24(%r12), %esi
movq %rax, %rdi
callq 0x3490
movq %rax, %rdi
callq 0x3130
movq 0x48(%r12), %r14
movq 0x50(%r12), %rax
movq %rax, 0x68(%rsp)
pushq $0x1
popq %rbx
movq %r12, 0x10(%rsp)
cmpq 0x68(%rsp), %r14
je 0x8d26
movq 0x135aa(%rip), %rdi     # 0x1bfe8
leaq 0x9c64(%rip), %rsi      # 0x126a9
callq 0x32f0
movl (%r12), %esi
movq %rax, %rdi
callq 0x3490
movq %rax, %rdi
leaq 0x98c4(%rip), %rsi      # 0x12324
callq 0x32f0
movq %rax, %rdi
movl %ebx, %esi
callq 0x3490
movq %rax, %rdi
leaq 0x9d4f(%rip), %rsi      # 0x127c8
callq 0x32f0
movq 0x50(%r12), %rsi
subq 0x48(%r12), %rsi
sarq $0x2, %rsi
movq %rax, %rdi
callq 0x31e0
movq %rax, %rdi
leaq 0x9a63(%rip), %rsi      # 0x12501
callq 0x32f0
movq %rax, %rdi
callq 0x3130
movl %ebx, 0x20(%rsp)
movl (%r14), %edx
movsd 0x98(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movl 0x2c(%rsp), %eax
movq %rbp, %rbx
leaq 0x3e0(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %rbx, %r9
pushq 0x88(%rsp)
pushq %rax
callq 0x6f9d
popq %rax
popq %rcx
movl (%r12), %edi
movl (%r14), %esi
movl 0x400(%rsp), %edx
movq %rbp, %rcx
movq %rbx, %r8
callq 0x5d50
movq %rbx, %rbp
movq 0x134da(%rip), %rdi     # 0x1bfe8
leaq 0x9a92(%rip), %rsi      # 0x125a7
callq 0x32f0
movl 0x400(%rsp), %esi
movq %rax, %rdi
callq 0x3490
movq %rax, %rdi
callq 0x3130
andl $0x0, 0x188(%rsp)
andq $0x0, 0x190(%rsp)
leaq 0x188(%rsp), %rax
movq %rax, 0x198(%rsp)
movq %rax, 0x1a0(%rsp)
andq $0x0, 0x1a8(%rsp)
movq 0x10(%rsp), %rax
movslq (%rax), %rax
movl $0x6, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq %r13, %rbx
movq %r13, %rdi
leaq 0x9960(%rip), %rsi      # 0x124e5
leaq 0xf(%rsp), %rdx
callq 0x30e0
leaq 0x180(%rsp), %rdi
movq %rbx, %rsi
callq 0x954c
movq %r15, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x9d22
movq %r13, %r12
movq %r13, %rdi
callq 0x3550
movq %rbx, %rdi
callq 0x9760
movslq (%r14), %rax
movl $0x6, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq %r13, %rdi
leaq 0x9915(%rip), %rsi      # 0x124ef
leaq 0xf(%rsp), %rdx
callq 0x30e0
leaq 0x180(%rsp), %rdi
movq %r12, %rsi
callq 0x954c
movq %rax, %rdi
movq %r15, %rsi
callq 0x9d22
movq %r13, %rdi
callq 0x3550
movq %r15, %rdi
callq 0x9760
movq %rbp, %rdi
leaq 0x9a91(%rip), %rsi      # 0x126aa
callq 0x9d6e
movl 0x20(%rsp), %ebx
movq 0x10(%rsp), %r12
testb %al, %al
je 0x8c75
movq %r15, %rdi
movq %rbp, %rsi
callq 0x9d78
movq %r13, %rdi
leaq 0x98b4(%rip), %rsi      # 0x124f4
leaq 0xf(%rsp), %rdx
callq 0x30e0
leaq 0x180(%rsp), %rdi
movq %r13, %rsi
callq 0x954c
movq %rax, %rdi
movq %r15, %rsi
callq 0x9d22
movq %r13, %rdi
callq 0x3550
movq %r15, %rdi
callq 0x9760
movq %r15, %rdi
leaq 0x3e0(%rsp), %rsi
callq 0x9d78
movq %r13, %rdi
leaq 0x9869(%rip), %rsi      # 0x124f8
leaq 0xf(%rsp), %rdx
callq 0x30e0
leaq 0x180(%rsp), %rdi
movq %r13, %rsi
callq 0x954c
movq %rax, %rdi
movq %r15, %rsi
callq 0x9d22
movq %r13, %rdi
callq 0x3550
movq %r15, %rdi
callq 0x9760
movq %r13, %rdi
leaq 0x180(%rsp), %rsi
callq 0x9de6
leaq 0xa0(%rsp), %rdi
movq %r13, %rsi
callq 0x10b76
movq %r13, %rdi
callq 0x9760
leaq 0x140(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x99be
leaq 0x180(%rsp), %rdi
callq 0xa9d2
leaq 0x3e0(%rsp), %rdi
callq 0x3550
addq $0x4, %r14
incl %ebx
jmp 0x8a2c
leaq 0x70(%rsp), %rdi
leaq 0x140(%rsp), %rbx
movq %rbx, %rsi
callq 0xa2ba
movq %rbx, %rdi
callq 0xd7a4
addq $0x60, %r12
jmp 0x8983
leaq 0x180(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xa2e6
movq 0x13260(%rip), %rdi     # 0x1bfc8
leaq 0x180(%rsp), %rsi
callq 0x9dbc
movq %rax, %rdi
callq 0x3130
leaq 0x180(%rsp), %rdi
callq 0x9760
movq 0x13257(%rip), %rdi     # 0x1bfe8
leaq 0x991d(%rip), %rsi      # 0x126b5
callq 0x32f0
movq %rax, %rdi
callq 0x3130
xorpd %xmm0, %xmm0
leaq 0x180(%rsp), %rbx
movapd %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x40(%rsp), %rsi
xorl %r12d, %r12d
pushq $0x60
popq %r15
movq 0x9238(%rip), %xmm3     # 0x12010
movapd 0x9240(%rip), %xmm4     # 0x12020
leaq 0x3e0(%rsp), %r14
pushq $0x28
popq %r13
movq 0x48(%rsp), %rax
subq %rsi, %rax
cqto
idivq %r15
cltq
cmpq %rax, %r12
jge 0x8f31
movq 0x70(%rsp), %rax
imulq $0x18, %r12, %rdx
movq (%rax,%rdx), %rcx
movq 0x8(%rax,%rdx), %rax
xorpd %xmm0, %xmm0
movq %rcx, %rdx
cmpq %rax, %rdx
je 0x8e39
cvtsi2sdl (%rdx), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x3e0(%rsp)
addq $0x4, %rdx
jmp 0x8e1d
subq %rcx, %rax
sarq $0x2, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm4, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, 0x3e0(%rsp)
imulq $0x60, %r12, %rbp
addq %rbp, %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa32a
movq 0x40(%rsp), %rsi
leaq (%rsi,%rbp), %rcx
movq 0x8(%rsi,%rbp), %rdx
movq 0x10(%rsi,%rbp), %rax
xorpd %xmm0, %xmm0
movq %rdx, %rdi
movq 0x9176(%rip), %xmm3     # 0x12010
movapd 0x917e(%rip), %xmm4     # 0x12020
cmpq %rax, %rdi
je 0x8ed5
movq 0x8(%rdi), %r8
subq (%rdi), %r8
sarq $0x3, %r8
movq %r8, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm4, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
addsd %xmm2, %xmm0
addq $0x28, %rdi
jmp 0x8ea2
subq %rdx, %rax
cqto
idivq %r13
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm4, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
cvtsi2sdl 0x40(%rcx), %xmm1
mulsd %xmm0, %xmm1
cvtsi2sdl 0x20(%rcx), %xmm0
divsd %xmm0, %xmm1
movsd 0x3e0(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
incq %r12
jmp 0x8dec
movq 0x180(%rsp), %rdi
movq 0x188(%rsp), %rsi
callq 0x11071
movq 0x180(%rsp), %r12
movq 0x188(%rsp), %r13
movq 0x1308b(%rip), %rbx     # 0x1bfe8
leaq 0x95f4(%rip), %r14      # 0x12558
cmpq %r13, %r12
je 0x8f9d
movl (%r12), %esi
movq %rbx, %rdi
callq 0x3490
movq %rax, %rdi
movq %r14, %rsi
callq 0x32f0
movsd 0x8(%r12), %xmm0
movq %rax, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x3130
addq $0x10, %r12
jmp 0x8f64
movq 0x13044(%rip), %rdi     # 0x1bfe8
leaq 0x9714(%rip), %rsi      # 0x126bf
callq 0x32f0
movq %rax, %rdi
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
cqto
idivq %r15
movq %rax, %xmm0
punpckldq 0x9041(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x9049(%rip), %xmm0     # 0x12020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x3440
movq %rax, %rdi
callq 0x3130
leaq 0x180(%rsp), %rdi
callq 0x10f14
leaq 0x70(%rsp), %rdi
callq 0x9958
leaq 0xa0(%rsp), %rdi
callq 0xa354
leaq 0x40(%rsp), %rdi
callq 0xa376
jmp 0x9094
leaq 0x3e8(%rsp), %rsi
leaq 0xe0(%rsp), %rdi
callq 0x3420
leaq 0x180(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x4336
movl 0x1c(%rsp), %esi
leaq 0x180(%rsp), %rdi
leaq 0x388(%rsp), %rdx
callq 0x79d2
leaq 0x180(%rsp), %rdi
callq 0x96ce
leaq 0xe0(%rsp), %rdi
callq 0x3550
leaq 0x3e0(%rsp), %rdi
callq 0x3540
leaq 0x3c8(%rsp), %rdi
callq 0xdf34
leaq 0x160(%rsp), %rdi
callq 0x3550
leaq 0x388(%rsp), %rdi
callq 0x3550
leaq 0xc0(%rsp), %rdi
callq 0x9d00
leaq 0x3a8(%rsp), %rdi
callq 0x3550
xorl %eax, %eax
addq $0x578, %rsp            # imm = 0x578
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9101
jmp 0x9280
jmp 0x9101
jmp 0x9280
jmp 0x918a
jmp 0x918a
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
jmp 0x9279
jmp 0x9280
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x96ce
jmp 0x912b
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x3550
jmp 0x913d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x91aa
jmp 0x9180
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x96ce
jmp 0x915b
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x3550
jmp 0x9238
jmp 0x9180
jmp 0x9235
jmp 0x9235
jmp 0x9280
jmp 0x91d2
movq %rax, %rbx
jmp 0x91af
jmp 0x9295
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x3110
jmp 0x9283
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x3550
leaq 0x70(%rsp), %rdi
callq 0x9760
leaq 0x180(%rsp), %rdi
callq 0x3080
jmp 0x9238
jmp 0x926e
jmp 0x9280
movq %rax, %rbx
jmp 0x933d
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x9760
jmp 0x933d
movq %rax, %rbx
jmp 0x936b
jmp 0x921b
jmp 0x922b
jmp 0x921b
jmp 0x922b
jmp 0x921b
jmp 0x922b
jmp 0x921b
jmp 0x922b
jmp 0x921b
jmp 0x922b
jmp 0x921b
jmp 0x922b
jmp 0x921b
jmp 0x922b
jmp 0x921b
jmp 0x922b
jmp 0x921b
jmp 0x922b
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
jmp 0x939a
movq %rax, %rbx
jmp 0x939f
jmp 0x929d
movq %rax, %rbx
leaq 0x3e0(%rsp), %rdi
callq 0x3540
jmp 0x935e
jmp 0x932d
jmp 0x929d
movq %rax, %rbx
jmp 0x9354
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x96ce
jmp 0x9354
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x3550
jmp 0x9283
movq %rax, %rbx
leaq 0x3e0(%rsp), %rdi
callq 0x3550
jmp 0x935e
movq %rax, %rbx
jmp 0x935e
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x10f14
jmp 0x933d
jmp 0x932d
jmp 0x92d4
jmp 0x92d9
jmp 0x92d9
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
jmp 0x9307
jmp 0x92e0
jmp 0x92d9
jmp 0x92d4
movq %rax, %rbx
jmp 0x9302
jmp 0x932d
movq %rax, %rbx
jmp 0x9302
movq %rax, %rbx
jmp 0x930c
jmp 0x92e0
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x3550
jmp 0x9302
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x3550
leaq 0x30(%rsp), %rdi
callq 0x9760
leaq 0x180(%rsp), %rdi
callq 0xa9d2
jmp 0x931e
movq %rax, %rbx
leaq 0x3e0(%rsp), %rdi
callq 0x3550
jmp 0x9330
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0xd7a4
leaq 0x70(%rsp), %rdi
callq 0x9958
leaq 0xa0(%rsp), %rdi
callq 0xa354
leaq 0x40(%rsp), %rdi
callq 0xa376
leaq 0x3c8(%rsp), %rdi
callq 0xdf34
leaq 0x160(%rsp), %rdi
callq 0x3550
leaq 0x388(%rsp), %rdi
callq 0x3550
leaq 0xc0(%rsp), %rdi
callq 0x9d00
leaq 0x3a8(%rsp), %rdi
callq 0x3550
movq %rbx, %rdi
callq 0x34a0
nop