// File: /workspace/github_cpp_makefile_star2_O3/harry830622[P]floorplanner/src/floorplanner.cpp
// Function: Floorplanner::FastSA()
void Floorplanner::FastSA() {
  const double initial_uphill_probability = 0.99;
  const double initial_temperature =
      average_uphill_cost_ / (-1 * log(initial_uphill_probability));
  const int num_perturbations =
      database_.num_macros() * database_.num_macros() * 3;
  const double frozen_temperature = initial_temperature / 1.0e50;
  const double frozen_acceptance_rate = 0.01;
  const double alpha = alpha_;
  const double beta = (1 - alpha);
  const double adaptive_alpha_base = alpha / 4.0;
  const double adaptive_beta_base = beta / 4.0;
  const int c = 100;
  const int k = 7;

  if (is_drawing_) {
    drawing_ = Json::object();
    drawing_["config"] = {{"initialTemperature", initial_temperature},
                          {"c", c},
                          {"k", k},
                          {"numPerturbations", num_perturbations}};
    drawing_["iterations"] = Json::array();
  }

  Floorplan floorplan(best_floorplan_);
  floorplan.Pack(database_);

  if (is_drawing_) {
    drawing_["initialFloorplan"] = floorplan.drawing();
  }

  double adaptive_alpha = adaptive_alpha_base;
  double adaptive_beta = adaptive_beta_base;
  double best_cost = ComputeCost(floorplan, adaptive_alpha, adaptive_beta);
  double last_cost = best_cost;
  double temperature = initial_temperature;
  int nth_iteration = 0;
  while (temperature > frozen_temperature) {
    ++nth_iteration;

    double total_delta_cost = 0.0;
    int num_accepted_floorplans = 0;
    int num_feasible_floorplans = 0;

    if (is_drawing_) {
      Json iteration = Json::object();
      iteration["temperature"] = temperature;
      iteration["floorplans"] = Json::array();
      drawing_["iterations"].push_back(iteration);
    }

    for (int i = 0; i < num_perturbations; ++i) {
      Floorplan new_floorplan(floorplan);
      new_floorplan.Perturb(database_);
      new_floorplan.Pack(database_);

      const double cost =
          ComputeCost(new_floorplan, adaptive_alpha, adaptive_beta);
      const double delta_cost = cost - last_cost;
      if (delta_cost < 0) {
        total_delta_cost += delta_cost;

        ++num_accepted_floorplans;
        floorplan = new_floorplan;
        last_cost = cost;

        const double outline_width = database_.outline_width();
        const double outline_height = database_.outline_height();
        if (new_floorplan.width() <= outline_width &&
            new_floorplan.height() <= outline_height) {
          ++num_feasible_floorplans;
          if (cost < best_cost) {
            best_floorplan_ = new_floorplan;
            best_cost = cost;
          }
        }

        if (is_drawing_) {
          Json floorplan_drawing = floorplan.drawing();
          floorplan_drawing["isAccepted"] = true;
          floorplan_drawing["cost"] = cost;
          Json& iteration = drawing_["iterations"].back();
          iteration["floorplans"].push_back(floorplan_drawing);
        }
      } else {
        const double p = exp(-1 * delta_cost / temperature);
        if (rand() / static_cast<double>(RAND_MAX) < p) {
          total_delta_cost += delta_cost;

          ++num_accepted_floorplans;
          floorplan = new_floorplan;
          last_cost = cost;

          if (is_drawing_) {
            Json floorplan_drawing = floorplan.drawing();
            floorplan_drawing["isAccepted"] = true;
            floorplan_drawing["cost"] = cost;
            Json& iteration = drawing_["iterations"].back();
            iteration["floorplans"].push_back(floorplan_drawing);
          }
        } else {
          if (is_drawing_) {
            Json new_floorplan_drawing = new_floorplan.drawing();
            new_floorplan_drawing["isAccepted"] = false;
            new_floorplan_drawing["cost"] = cost;
            Json& iteration = drawing_["iterations"].back();
            iteration["floorplans"].push_back(new_floorplan_drawing);
          }
        }
      }
    }

    if (is_verbose_) {
      cout << "  nth_iteration: " << nth_iteration << endl;
      cout << "    temperature: " << temperature << endl;
      cout << "    total_delta_cost: " << total_delta_cost << endl;
      cout << "    num_accepted_floorplans: " << num_accepted_floorplans
           << endl;
      cout << "    num_feasible_floorplans: " << num_feasible_floorplans
           << endl;
      cout << "    num_perturbations: " << num_perturbations << endl;
      cout << "    adaptive_alpha: " << adaptive_alpha
           << "\tadaptive_beta: " << adaptive_beta << endl;
      cout << "    Best area: " << best_floorplan_.area()
           << "\tBest wirelength: " << best_floorplan_.wirelength() << endl;
    }

    if (num_accepted_floorplans / static_cast<double>(num_perturbations) <
        frozen_acceptance_rate) {
      break;
    }

    adaptive_alpha =
        adaptive_alpha_base +
        (alpha - adaptive_alpha_base) *
            (num_feasible_floorplans / static_cast<double>(num_perturbations));
    adaptive_beta =
        adaptive_beta_base +
        (beta - adaptive_beta_base) *
            (num_feasible_floorplans / static_cast<double>(num_perturbations));

    const double average_delta_cost = abs(total_delta_cost / num_perturbations);
    if (nth_iteration >= 1 && nth_iteration < k) {
      temperature =
          initial_temperature * average_delta_cost / (nth_iteration + 1) / c;
    } else {
      temperature =
          initial_temperature * average_delta_cost / (nth_iteration + 1);
    }

    if (is_drawing_) {
      Json& iteration = drawing_["iterations"].back();
      iteration["numFeasibleFloorplans"] = num_feasible_floorplans;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp            # imm = 0x3A8
movq %rdi, %rbx
movsd 0x68(%rdi), %xmm0
divsd 0xe6e5(%rip), %xmm0     # 0x217b0
movsd %xmm0, 0x50(%rsp)
movq (%rdi), %rdi
callq 0x8a44
movl %eax, %ebp
movq (%rbx), %rdi
callq 0x8a44
imull %ebp, %eax
leal (%rax,%rax,2), %r12d
movsd 0x8(%rbx), %xmm0
movapd %xmm0, 0x130(%rsp)
cmpb $0x1, 0x31(%rbx)
movl %r12d, 0x24(%rsp)
jne 0x134c3
leaq 0x398(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0xe11c
leaq 0x118(%rbx), %r15
movq %r14, %rdi
callq 0xe5c8
movb 0x118(%rbx), %al
movb (%r14), %cl
movb %cl, 0x118(%rbx)
movb %al, (%r14)
movq 0x120(%rbx), %rax
movq 0x8(%r14), %rcx
movq %rcx, 0x120(%rbx)
movq %rax, 0x8(%r14)
movq %r15, %rdi
callq 0xe5c8
movq %r14, %rdi
callq 0xe0aa
leaq 0x218(%rsp), %rdi
movb $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
leaq 0xe6b3(%rip), %rsi      # 0x21837
callq 0x1518f
leaq 0x218(%rsp), %r12
movq %r12, %rdi
callq 0xe5c8
leaq 0x228(%rsp), %r14
movb $0x0, (%r14)
movq $0x0, 0x8(%r14)
movq %r14, %rdi
movsd 0x50(%rsp), %xmm0
callq 0x103ca
movq %r14, %rdi
callq 0xe5c8
leaq 0x170(%rsp), %r14
movl $0x2, %edx
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0xe11c
leaq 0x180(%rsp), %r14
leaq 0x30(%rsp), %rdi
movb $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
leaq 0xe76c(%rip), %rsi      # 0x21971
callq 0x10337
leaq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0xe5c8
leaq 0x40(%rsp), %r13
movb $0x5, (%r13)
movq $0x64, 0x8(%r13)
movq %r13, %rdi
callq 0xe5c8
movq %r13, %rdi
callq 0xe5c8
movl $0x2, %edx
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0xe11c
leaq 0x190(%rsp), %r14
leaq 0x378(%rsp), %rdi
movb $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
leaq 0xefa8(%rip), %rsi      # 0x2221e
callq 0x10337
leaq 0x378(%rsp), %r12
movq %r12, %rdi
callq 0xe5c8
leaq 0x388(%rsp), %r13
movb $0x5, (%r13)
movq $0x7, 0x8(%r13)
movq %r13, %rdi
callq 0xe5c8
movq %r13, %rdi
callq 0xe5c8
movl $0x2, %edx
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0xe11c
leaq 0x1a0(%rsp), %r14
leaq 0x358(%rsp), %rdi
movb $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
leaq 0xe55d(%rip), %rsi      # 0x2184a
callq 0x15222
leaq 0x358(%rsp), %r12
movq %r12, %rdi
callq 0xe5c8
leaq 0x368(%rsp), %r13
movslq 0x24(%rsp), %rax
movb $0x5, (%r13)
movq %rax, 0x8(%r13)
movq %r13, %rdi
callq 0xe5c8
movq %r13, %rdi
callq 0xe5c8
movl $0x2, %edx
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0xe11c
leaq 0x348(%rsp), %rdi
leaq 0x170(%rsp), %rsi
movl $0x4, %edx
movl $0x1, %ecx
movl $0x2, %r8d
callq 0xe11c
leaq 0xe4ec(%rip), %rsi      # 0x2185b
movq %r15, %rdi
callq 0xe258
movq %rax, %r12
leaq 0x348(%rsp), %r14
movq %r14, %rdi
callq 0xe5c8
movb (%r12), %al
movb (%r14), %cl
movb %cl, (%r12)
movb %al, (%r14)
movq 0x8(%r12), %rax
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%r12)
movq %rax, 0x8(%r14)
movq %r12, %rdi
callq 0xe5c8
movq %r14, %rdi
callq 0xe0aa
movl $0x30, %r14d
leaq (%rsp,%r14), %rdi
addq $0x170, %rdi            # imm = 0x170
callq 0xe0aa
addq $-0x10, %r14
cmpq $-0x10, %r14
jne 0x133c0
movl $0x10, %r14d
movl 0x24(%rsp), %r12d
leaq (%rsp,%r14), %rdi
addq $0x358, %rdi            # imm = 0x358
callq 0xe0aa
addq $-0x10, %r14
cmpq $-0x10, %r14
jne 0x133e5
movl $0x10, %r14d
leaq (%rsp,%r14), %rdi
addq $0x378, %rdi            # imm = 0x378
callq 0xe0aa
addq $-0x10, %r14
cmpq $-0x10, %r14
jne 0x13405
movl $0x10, %r14d
leaq (%rsp,%r14), %rdi
addq $0x30, %rdi
callq 0xe0aa
addq $-0x10, %r14
cmpq $-0x10, %r14
jne 0x13425
movl $0x10, %r14d
leaq (%rsp,%r14), %rdi
addq $0x218, %rdi            # imm = 0x218
callq 0xe0aa
addq $-0x10, %r14
cmpq $-0x10, %r14
jne 0x13442
leaq 0x338(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0xe11c
leaq 0xe3e6(%rip), %rsi      # 0x21862
movq %r15, %rdi
callq 0xe258
movq %rax, %r14
leaq 0x338(%rsp), %r15
movq %r15, %rdi
callq 0xe5c8
movb (%r14), %al
movb (%r15), %cl
movb %cl, (%r14)
movb %al, (%r15)
movq 0x8(%r14), %rax
movq 0x8(%r15), %rcx
movq %rcx, 0x8(%r14)
movq %rax, 0x8(%r15)
movq %r14, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe0aa
leaq 0x70(%rbx), %rsi
leaq 0x170(%rsp), %r14
movq %r14, %rdi
movq %rsi, 0x70(%rsp)
callq 0x148ec
movq (%rbx), %rsi
movq %r14, %rdi
callq 0xba40
cmpb $0x1, 0x31(%rbx)
jne 0x1355c
leaq 0x170(%rsp), %rdi
callq 0xaf56
leaq 0x328(%rsp), %rdi
movq %rax, %rsi
callq 0xf35c
leaq 0x118(%rbx), %rdi
leaq 0xe355(%rip), %rsi      # 0x2186d
callq 0xe258
movq %rax, %r14
leaq 0x328(%rsp), %r15
movq %r15, %rdi
callq 0xe5c8
movb (%r14), %al
movb (%r15), %cl
movb %cl, (%r14)
movb %al, (%r15)
movq 0x8(%r14), %rax
movq 0x8(%r15), %rcx
movq %rcx, 0x8(%r14)
movq %rax, 0x8(%r15)
movq %r14, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe0aa
movsd 0xe22c(%rip), %xmm0     # 0x21790
movapd 0x130(%rsp), %xmm1
subsd %xmm1, %xmm0
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movapd 0xe263(%rip), %xmm0     # 0x217e0
movapd %xmm1, 0x130(%rsp)
mulpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
leaq 0x170(%rsp), %rsi
movq %rbx, %rdi
movapd %xmm0, 0x2f0(%rsp)
callq 0x10c42
movsd %xmm0, 0x18(%rsp)
movsd 0x50(%rsp), %xmm0
movapd %xmm0, %xmm1
divsd 0xe1f5(%rip), %xmm1     # 0x217b8
movsd %xmm1, 0x2c0(%rsp)
ucomisd %xmm1, %xmm0
jbe 0x14602
leaq 0x118(%rbx), %rax
movq %rax, 0x28(%rsp)
movl $0x80, %ecx
leaq 0x170(%rsp), %rax
leaq (%rax,%rcx), %rdx
movq %rdx, 0x158(%rsp)
leaq 0x218(%rsp), %rdx
addq %rdx, %rcx
movq %rcx, 0x80(%rsp)
movl $0x98, %ecx
addq %rcx, %rdx
movq %rdx, 0x58(%rsp)
addq %rcx, %rax
movq %rax, 0x150(%rsp)
addq %rbx, %rcx
movq %rcx, 0x2e8(%rsp)
leaq 0xb0(%rbx), %rax
movq %rax, 0x2e0(%rsp)
leaq 0xc8(%rbx), %rax
movq %rax, 0x2d8(%rsp)
cvtsi2sd %r12d, %xmm2
movapd 0x130(%rsp), %xmm0
movapd 0x2f0(%rsp), %xmm1
subpd %xmm1, %xmm0
movapd %xmm0, 0x130(%rsp)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x148(%rsp)
movsd 0x50(%rsp), %xmm0
movapd %xmm0, 0x110(%rsp)
movapd %xmm1, 0x160(%rsp)
leaq 0xf0(%rbx), %rax
movq %rax, 0x2d0(%rsp)
leaq 0x108(%rbx), %rax
movq %rax, 0x2c8(%rsp)
leaq 0x30(%rsp), %r13
movq $0x0, 0x78(%rsp)
movsd %xmm2, 0x140(%rsp)
cmpb $0x1, 0x31(%rbx)
jne 0x1382a
leaq 0x218(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0xe11c
movb $0x0, 0x100(%rsp)
movq $0x0, 0x108(%rsp)
leaq 0x100(%rsp), %rbp
movq %rbp, %rdi
movapd 0x110(%rsp), %xmm0
callq 0x103ca
movq %rbp, %rdi
callq 0xe5c8
movq %r14, %rdi
leaq 0xe14a(%rip), %rsi      # 0x2187e
callq 0xe258
movq %rax, %r15
movq %rbp, %rdi
callq 0xe5c8
movb (%r15), %al
movb 0x100(%rsp), %cl
movb %cl, (%r15)
movb %al, 0x100(%rsp)
movq 0x8(%r15), %rax
movq 0x108(%rsp), %rcx
movq %rcx, 0x8(%r15)
movq %rax, 0x108(%rsp)
movq %r15, %rdi
callq 0xe5c8
movq %rbp, %rdi
callq 0xe0aa
leaq 0x120(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0xe11c
leaq 0x218(%rsp), %rdi
leaq 0xe842(%rip), %rsi      # 0x21fea
callq 0xe258
movq %rax, %r15
leaq 0x120(%rsp), %rbp
movq %rbp, %rdi
callq 0xe5c8
movb (%r15), %al
movb 0x120(%rsp), %cl
movb %cl, (%r15)
movb %al, 0x120(%rsp)
movq 0x8(%r15), %rax
movq 0x128(%rsp), %rcx
movq %rcx, 0x8(%r15)
movq %rax, 0x128(%rsp)
movq %r15, %rdi
callq 0xe5c8
movq %rbp, %rdi
callq 0xe0aa
movq 0x28(%rsp), %rdi
leaq 0xe05a(%rip), %rsi      # 0x21862
callq 0xe258
movq %rax, %rdi
leaq 0x218(%rsp), %rsi
callq 0x14a4e
leaq 0x218(%rsp), %rdi
callq 0xe0aa
movapd 0x160(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movapd %xmm0, 0x300(%rsp)
xorpd %xmm0, %xmm0
testl %r12d, %r12d
jle 0x14176
movapd %xmm0, 0x60(%rsp)
xorl %r15d, %r15d
movl $0x0, 0xc(%rsp)
leaq 0x218(%rsp), %r14
movq %r14, %rdi
leaq 0x170(%rsp), %rsi
callq 0x148ec
movq (%rbx), %rsi
movq %r14, %rdi
callq 0xafba
movq (%rbx), %rsi
movq %r14, %rdi
callq 0xba40
movq %rbx, %rdi
movq %r14, %rsi
movapd 0x160(%rsp), %xmm0
movapd 0x300(%rsp), %xmm1
callq 0x10c42
movsd %xmm0, 0x10(%rsp)
movapd %xmm0, %xmm1
subsd 0x18(%rsp), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
movapd %xmm1, 0x310(%rsp)
jbe 0x13c8a
movupd 0x218(%rsp), %xmm0
movupd 0x228(%rsp), %xmm1
movapd %xmm0, 0x170(%rsp)
movapd %xmm1, 0x180(%rsp)
movl 0x238(%rsp), %eax
movl %eax, 0x190(%rsp)
leaq 0x198(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x150a0
leaq 0x1b0(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0x14dbe
leaq 0x1c8(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0x14ea2
movq 0x158(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x14f5c
movq %r13, %rdi
movq 0x58(%rsp), %rsi
callq 0xf35c
movq %r13, %rdi
callq 0xe5c8
movb 0x208(%rsp), %al
movb 0x30(%rsp), %cl
movb %cl, 0x208(%rsp)
movb %al, 0x30(%rsp)
movq 0x210(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x210(%rsp)
movq %rax, 0x38(%rsp)
movq 0x150(%rsp), %rdi
callq 0xe5c8
movq %r13, %rdi
callq 0xe0aa
movq (%rbx), %rdi
callq 0x89fe
movsd %xmm0, 0x18(%rsp)
movq (%rbx), %rdi
callq 0x8a04
movsd %xmm0, 0x88(%rsp)
leaq 0x218(%rsp), %rdi
callq 0xaf68
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x13b0b
leaq 0x218(%rsp), %rdi
callq 0xaf6e
movsd 0x88(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x13b0b
incl 0xc(%rsp)
movsd 0x148(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
jbe 0x13b0b
movupd 0x218(%rsp), %xmm0
movupd 0x228(%rsp), %xmm1
movq 0x70(%rsp), %rax
movupd %xmm1, 0x10(%rax)
movupd %xmm0, (%rax)
movl 0x238(%rsp), %eax
movl %eax, 0x90(%rbx)
movq 0x2e8(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x150a0
movq 0x2e0(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0x14dbe
movq 0x2d8(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0x14ea2
movq 0x2d0(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x14f5c
movq %r13, %rdi
movq 0x58(%rsp), %rsi
callq 0xf35c
movq %r13, %rdi
callq 0xe5c8
movb 0x108(%rbx), %al
movb 0x30(%rsp), %cl
movb %cl, 0x108(%rbx)
movb %al, 0x30(%rsp)
movq 0x110(%rbx), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x110(%rbx)
movq %rax, 0x38(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0xe5c8
movq %r13, %rdi
callq 0xe0aa
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x148(%rsp)
movapd 0x60(%rsp), %xmm0
addsd 0x310(%rsp), %xmm0
movapd %xmm0, 0x60(%rsp)
incl %r15d
cmpb $0x1, 0x31(%rbx)
jne 0x13f47
movl %r15d, %r14d
leaq 0x170(%rsp), %rdi
callq 0xaf56
movq %r13, %rdi
movq %rax, %rsi
callq 0xf35c
movb $0x4, 0xf0(%rsp)
movq $0x1, 0xf8(%rsp)
leaq 0xf0(%rsp), %r15
movq %r15, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe5c8
movq %r13, %rdi
leaq 0xdd0c(%rip), %rsi      # 0x2188a
callq 0xe258
movq %rax, %rbp
movq %r15, %rdi
callq 0xe5c8
movb (%rbp), %al
movb 0xf0(%rsp), %cl
movb %cl, (%rbp)
movb %al, 0xf0(%rsp)
movq 0x8(%rbp), %rax
movq 0xf8(%rsp), %rcx
movq %rcx, 0x8(%rbp)
movq %rax, 0xf8(%rsp)
movq %rbp, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe0aa
movb $0x0, 0xe0(%rsp)
movq $0x0, 0xe8(%rsp)
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x103ca
movq %r15, %rdi
callq 0xe5c8
movq %r13, %rdi
leaq 0xdc8f(%rip), %rsi      # 0x21895
callq 0xe258
movq %rax, %rbp
movq %r15, %rdi
callq 0xe5c8
movb (%rbp), %al
movb 0xe0(%rsp), %cl
movb %cl, (%rbp)
movb %al, 0xe0(%rsp)
movq 0x8(%rbp), %rax
movq 0xe8(%rsp), %rcx
movq %rcx, 0x8(%rbp)
movq %rax, 0xe8(%rsp)
movq %rbp, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe0aa
movq 0x28(%rsp), %rdi
leaq 0xdc04(%rip), %rsi      # 0x21862
callq 0xe258
movq %rax, %rdi
callq 0x14b6c
movq %rax, %rdi
leaq 0xe375(%rip), %rsi      # 0x21fea
callq 0xe258
movq %rax, %rdi
movq %r13, %rsi
callq 0x14a4e
jmp 0x13f2e
movapd %xmm1, %xmm0
xorpd 0xdb5a(%rip), %xmm0     # 0x217f0
divsd 0x110(%rsp), %xmm0
callq 0x6660
movsd %xmm0, 0x88(%rsp)
callq 0x6100
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0xdb07(%rip), %xmm0     # 0x217c8
movsd 0x88(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x13f58
movupd 0x218(%rsp), %xmm0
movupd 0x228(%rsp), %xmm1
movapd %xmm0, 0x170(%rsp)
movapd %xmm1, 0x180(%rsp)
movl 0x238(%rsp), %eax
movl %eax, 0x190(%rsp)
leaq 0x198(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x150a0
leaq 0x1b0(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0x14dbe
leaq 0x1c8(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0x14ea2
movq 0x158(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x14f5c
movq %r13, %rdi
movq 0x58(%rsp), %rsi
callq 0xf35c
movapd 0x60(%rsp), %xmm0
addsd 0x310(%rsp), %xmm0
movapd %xmm0, 0x60(%rsp)
incl %r15d
movq %r13, %rdi
callq 0xe5c8
movb 0x208(%rsp), %al
movb 0x30(%rsp), %cl
movb %cl, 0x208(%rsp)
movb %al, 0x30(%rsp)
movq 0x210(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x210(%rsp)
movq %rax, 0x38(%rsp)
movq 0x150(%rsp), %rdi
callq 0xe5c8
movq %r13, %rdi
callq 0xe0aa
cmpb $0x1, 0x31(%rbx)
jne 0x13f47
movl %r15d, %r14d
leaq 0x170(%rsp), %rdi
callq 0xaf56
movq %r13, %rdi
movq %rax, %rsi
callq 0xf35c
movb $0x4, 0xd0(%rsp)
movq $0x1, 0xd8(%rsp)
leaq 0xd0(%rsp), %r15
movq %r15, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe5c8
movq %r13, %rdi
leaq 0xda63(%rip), %rsi      # 0x2188a
callq 0xe258
movq %rax, %rbp
movq %r15, %rdi
callq 0xe5c8
movb (%rbp), %al
movb 0xd0(%rsp), %cl
movb %cl, (%rbp)
movb %al, 0xd0(%rsp)
movq 0x8(%rbp), %rax
movq 0xd8(%rsp), %rcx
movq %rcx, 0x8(%rbp)
movq %rax, 0xd8(%rsp)
movq %rbp, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe0aa
movb $0x0, 0xc0(%rsp)
movq $0x0, 0xc8(%rsp)
leaq 0xc0(%rsp), %r15
movq %r15, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x103ca
movq %r15, %rdi
callq 0xe5c8
movq %r13, %rdi
leaq 0xd9e6(%rip), %rsi      # 0x21895
callq 0xe258
movq %rax, %rbp
movq %r15, %rdi
callq 0xe5c8
movb (%rbp), %al
movb 0xc0(%rsp), %cl
movb %cl, (%rbp)
movb %al, 0xc0(%rsp)
movq 0x8(%rbp), %rax
movq 0xc8(%rsp), %rcx
movq %rcx, 0x8(%rbp)
movq %rax, 0xc8(%rsp)
movq %rbp, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe0aa
movq 0x28(%rsp), %rdi
leaq 0xd95b(%rip), %rsi      # 0x21862
callq 0xe258
movq %rax, %rdi
callq 0x14b6c
movq %rax, %rdi
leaq 0xe0cc(%rip), %rsi      # 0x21fea
callq 0xe258
movq %rax, %rdi
movq %r13, %rsi
callq 0x14a4e
movq %r13, %rdi
callq 0xe0aa
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
jmp 0x140c2
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
jmp 0x140c5
cmpb $0x1, 0x31(%rbx)
jne 0x140c5
movl %r15d, %r14d
leaq 0x218(%rsp), %rdi
callq 0xaf56
movq %r13, %rdi
movq %rax, %rsi
callq 0xf35c
movb $0x4, 0xb0(%rsp)
movq $0x0, 0xb8(%rsp)
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe5c8
movq %r13, %rdi
leaq 0xd8d7(%rip), %rsi      # 0x2188a
callq 0xe258
movq %rax, %rbp
movq %r15, %rdi
callq 0xe5c8
movb (%rbp), %al
movb 0xb0(%rsp), %cl
movb %cl, (%rbp)
movb %al, 0xb0(%rsp)
movq 0x8(%rbp), %rax
movq 0xb8(%rsp), %rcx
movq %rcx, 0x8(%rbp)
movq %rax, 0xb8(%rsp)
movq %rbp, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe0aa
movb $0x0, 0xa0(%rsp)
movq $0x0, 0xa8(%rsp)
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x103ca
movq %r15, %rdi
callq 0xe5c8
movq %r13, %rdi
leaq 0xd85a(%rip), %rsi      # 0x21895
callq 0xe258
movq %rax, %rbp
movq %r15, %rdi
callq 0xe5c8
movb (%rbp), %al
movb 0xa0(%rsp), %cl
movb %cl, (%rbp)
movb %al, 0xa0(%rsp)
movq 0x8(%rbp), %rax
movq 0xa8(%rsp), %rcx
movq %rcx, 0x8(%rbp)
movq %rax, 0xa8(%rsp)
movq %rbp, %rdi
callq 0xe5c8
movq %r15, %rdi
callq 0xe0aa
movq 0x28(%rsp), %rdi
leaq 0xd7cf(%rip), %rsi      # 0x21862
callq 0xe258
movq %rax, %rdi
callq 0x14b6c
movq %rax, %rdi
leaq 0xdf40(%rip), %rsi      # 0x21fea
callq 0xe258
movq %rax, %rdi
movq %r13, %rsi
callq 0x14a4e
movq %r13, %rdi
callq 0xe0aa
movl %r14d, %r15d
movq 0x58(%rsp), %rdi
callq 0xe0aa
movq 0x298(%rsp), %rdi
testq %rdi, %rdi
je 0x140ec
movq 0x2a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6390
movq 0x270(%rsp), %rdi
testq %rdi, %rdi
je 0x14131
movq 0x290(%rsp), %rsi
subq %rdi, %rsi
callq 0x6390
xorl %eax, %eax
movq %rax, 0x270(%rsp)
movl %eax, 0x278(%rsp)
movq %rax, 0x280(%rsp)
movl %eax, 0x288(%rsp)
movq %rax, 0x290(%rsp)
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x1414e
movq 0x268(%rsp), %rsi
subq %rdi, %rsi
callq 0x6390
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x1416b
movq 0x250(%rsp), %rsi
subq %rdi, %rsi
callq 0x6390
decl %r12d
jne 0x1385e
jmp 0x14187
movapd %xmm0, 0x60(%rsp)
movl $0x0, 0xc(%rsp)
xorl %r15d, %r15d
movq 0x78(%rsp), %rax
leal 0x1(%rax), %r14d
cmpb $0x0, 0x30(%rbx)
movl 0x24(%rsp), %r12d
je 0x1448f
movl $0x11, %edx
movq 0x18df5(%rip), %rdi     # 0x2cfa0
leaq 0xd6e8(%rip), %rsi      # 0x2189a
callq 0x63f0
movq 0x18de2(%rip), %rdi     # 0x2cfa0
movl %r14d, %esi
callq 0x6620
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6370
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6270
movl $0x11, %edx
movq 0x18da4(%rip), %rdi     # 0x2cfa0
leaq 0xd6a9(%rip), %rsi      # 0x218ac
callq 0x63f0
movq 0x18d91(%rip), %rdi     # 0x2cfa0
movapd 0x110(%rsp), %xmm0
callq 0x6580
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6370
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6270
movl $0x16, %edx
movq 0x18d4d(%rip), %rdi     # 0x2cfa0
leaq 0xd719(%rip), %rsi      # 0x21973
callq 0x63f0
movq 0x18d3a(%rip), %rdi     # 0x2cfa0
movapd 0x60(%rsp), %xmm0
callq 0x6580
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6370
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6270
movl $0x1d, %edx
movq 0x18cf9(%rip), %rdi     # 0x2cfa0
leaq 0xd610(%rip), %rsi      # 0x218be
callq 0x63f0
movq 0x18ce6(%rip), %rdi     # 0x2cfa0
movl %r15d, %esi
callq 0x6620
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6370
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6270
movl $0x1d, %edx
movq 0x18ca8(%rip), %rdi     # 0x2cfa0
leaq 0xd5dd(%rip), %rsi      # 0x218dc
callq 0x63f0
movq 0x18c95(%rip), %rdi     # 0x2cfa0
movl 0xc(%rsp), %esi
callq 0x6620
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6370
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6270
movl $0x17, %edx
movq 0x18c56(%rip), %rdi     # 0x2cfa0
leaq 0xd5a9(%rip), %rsi      # 0x218fa
callq 0x63f0
movq 0x18c43(%rip), %rdi     # 0x2cfa0
movl %r12d, %esi
callq 0x6620
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6370
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6270
movl $0x14, %edx
movq 0x18c05(%rip), %rdi     # 0x2cfa0
leaq 0xd570(%rip), %rsi      # 0x21912
callq 0x63f0
movq 0x18bf2(%rip), %rdi     # 0x2cfa0
movapd 0x160(%rsp), %xmm0
callq 0x6580
movq %rax, %rbp
movl $0x10, %edx
movq %rax, %rdi
leaq 0xd559(%rip), %rsi      # 0x21927
callq 0x63f0
movq %rbp, %rdi
movapd 0x300(%rsp), %xmm0
callq 0x6580
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6370
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6270
movl $0xf, %edx
movq 0x18b86(%rip), %rdi     # 0x2cfa0
leaq 0xd517(%rip), %rsi      # 0x21938
callq 0x63f0
movq 0x70(%rsp), %rdi
callq 0xaf74
movq 0x18b69(%rip), %rdi     # 0x2cfa0
callq 0x6580
movq %rax, %rbp
movl $0x12, %edx
movq %rax, %rdi
leaq 0xd4fa(%rip), %rsi      # 0x21948
callq 0x63f0
movq 0x70(%rsp), %rdi
callq 0xaf80
movq %rbp, %rdi
callq 0x6580
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6370
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6270
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd 0x140(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd 0xd324(%rip), %xmm2     # 0x217d0
ucomisd %xmm0, %xmm2
ja 0x14602
movapd 0x60(%rsp), %xmm2
divsd %xmm1, %xmm2
andpd 0xd338(%rip), %xmm2     # 0x21800
movq 0x78(%rsp), %rcx
leal 0x2(%rcx), %eax
mulsd 0x50(%rsp), %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm2
movapd %xmm2, %xmm0
divsd 0xd2bb(%rip), %xmm0     # 0x217a8
movapd %xmm0, 0x110(%rsp)
cmpl $0x6, %ecx
jb 0x14504
movapd %xmm2, 0x110(%rsp)
cmpb $0x1, 0x31(%rbx)
jne 0x145ad
movq 0x28(%rsp), %rdi
leaq 0xd348(%rip), %rsi      # 0x21862
callq 0xe258
movq %rax, %rdi
callq 0x14b6c
movq %rax, %r15
movslq 0xc(%rsp), %rax
movb $0x5, 0x90(%rsp)
movq %rax, 0x98(%rsp)
leaq 0x90(%rsp), %rbp
movq %rbp, %rdi
callq 0xe5c8
movq %rbp, %rdi
callq 0xe5c8
movq %r15, %rdi
leaq 0xd3fa(%rip), %rsi      # 0x2195b
callq 0xe258
movq %rax, %r15
movq %rbp, %rdi
callq 0xe5c8
movb (%r15), %al
movb 0x90(%rsp), %cl
movb %cl, (%r15)
movb %al, 0x90(%rsp)
movq 0x8(%r15), %rax
movq 0x98(%rsp), %rcx
movq %rcx, 0x8(%r15)
movq %rax, 0x98(%rsp)
movq %r15, %rdi
callq 0xe5c8
movq %rbp, %rdi
callq 0xe0aa
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%rsp), %xmm0
movsd 0x140(%rsp), %xmm2
divsd %xmm2, %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0x130(%rsp), %xmm0
addpd 0x2f0(%rsp), %xmm0
movapd %xmm0, 0x160(%rsp)
movapd 0x110(%rsp), %xmm0
ucomisd 0x2c0(%rsp), %xmm0
movl %r14d, %eax
movq %rax, 0x78(%rsp)
ja 0x136cf
leaq 0x208(%rsp), %rbx
movq %rbx, %rdi
callq 0xe0aa
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x1462b
movq 0x200(%rsp), %rsi
subq %rdi, %rsi
callq 0x6390
movq 0x1c8(%rsp), %rdi
testq %rdi, %rdi
je 0x14670
movq 0x1e8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6390
xorl %eax, %eax
movq %rax, 0x1c8(%rsp)
movl %eax, 0x1d0(%rsp)
movq %rax, 0x1d8(%rsp)
movl %eax, 0x1e0(%rsp)
movq %rax, 0x1e8(%rsp)
movq 0x1b0(%rsp), %rdi
testq %rdi, %rdi
je 0x1468d
movq 0x1c0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6390
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0x146aa
movq 0x1a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6390
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x338(%rsp), %rdi
callq 0xe0aa
jmp 0x148e3
movq %rax, %rbx
leaq 0x348(%rsp), %rdi
callq 0xe0aa
jmp 0x146f6
movq %rax, %rbx
leaq 0x328(%rsp), %rdi
jmp 0x1483f
movq %rax, %rbx
movl $0x30, %r15d
leaq (%rsp,%r15), %rdi
addq $0x170, %rdi            # imm = 0x170
callq 0xe0aa
addq $-0x10, %r15
cmpq $-0x10, %r15
jne 0x146fc
xorl %ebp, %ebp
jmp 0x14720
movq %rax, %rbx
movb $0x1, %bpl
movl $0x10, %r15d
leaq (%rsp,%r15), %rdi
addq $0x358, %rdi            # imm = 0x358
callq 0xe0aa
addq $-0x10, %r15
cmpq $-0x10, %r15
jne 0x14726
jmp 0x1474a
jmp 0x14744
movq %rax, %rbx
movb $0x1, %bpl
movl $0x10, %r15d
leaq (%rsp,%r15), %rdi
addq $0x378, %rdi            # imm = 0x378
callq 0xe0aa
addq $-0x10, %r15
cmpq $-0x10, %r15
jne 0x14750
jmp 0x14774
jmp 0x1476e
movq %rax, %rbx
movb $0x1, %bpl
movl $0x10, %r15d
leaq (%rsp,%r15), %rdi
addq $0x30, %rdi
callq 0xe0aa
addq $-0x10, %r15
cmpq $-0x10, %r15
jne 0x1477a
jmp 0x1479b
jmp 0x14795
movq %rax, %rbx
movb $0x1, %bpl
movl $0x10, %r15d
leaq (%rsp,%r15), %rdi
addq $0x218, %rdi            # imm = 0x218
callq 0xe0aa
addq $-0x10, %r15
cmpq $-0x10, %r15
jne 0x147a1
leaq 0x170(%rsp), %r15
cmpq %r14, %r15
setne %al
andb %al, %bpl
cmpb $0x1, %bpl
jne 0x148e3
addq $-0x10, %r14
movq %r14, %rdi
callq 0xe0aa
cmpq %r15, %r14
jne 0x147d6
jmp 0x148e3
movq %rax, %rbx
jmp 0x148e3
jmp 0x148bb
jmp 0x148bb
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
jmp 0x1483f
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
jmp 0x14823
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0xe0aa
jmp 0x14837
jmp 0x148bb
jmp 0x148bb
movq %rax, %rbx
leaq 0x218(%rsp), %rdi
callq 0xe0aa
jmp 0x148d6
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
jmp 0x14899
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
jmp 0x14899
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
jmp 0x14899
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x14899
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
jmp 0x14899
jmp 0x148c6
jmp 0x148c6
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0xe0aa
jmp 0x148ab
jmp 0x148c6
jmp 0x148c6
jmp 0x148a8
jmp 0x148a8
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xe0aa
jmp 0x148c9
jmp 0x148bb
jmp 0x148c6
movq %rax, %rbx
jmp 0x148d6
jmp 0x148c6
jmp 0x148c6
jmp 0x148c6
movq %rax, %rbx
leaq 0x218(%rsp), %rdi
callq 0x149e4
leaq 0x170(%rsp), %rdi
callq 0x149e4
movq %rbx, %rdi
callq 0x6640
nop