// File: /workspace/github_cpp_makefile_star2_O3/cdalitz[P]kdtree-cpp/demo_kdtree.cpp
// Function: main
int main(int argc, char** argv) {

  //
  // functionality tests
  //
  cout << "Functionality tests" << endl;
  cout << "-------------------" << endl;
  
  // 1.1) construction of kd-tree
  Kdtree::KdNodeVector nodes;
  double points[10][2] = {{1, 1}, {2, 1}, {1, 2}, {2, 4}, {3, 4},
                          {7, 2}, {8, 3}, {8, 5}, {7, 3}, {7, 3}};
  for (int i = 0; i < 10; ++i) {
    std::vector<double> point(2);
    point[0] = points[i][0];
    point[1] = points[i][1];
    nodes.push_back(Kdtree::KdNode(point));
  }
  Kdtree::KdTree tree(&nodes);
  cout << "Points in kd-tree:\n  ";
  print_nodes(tree.allnodes);

  // 1.2) kNN search
  Kdtree::KdNodeVector result;
  std::vector<double> test_point(2);
  test_point[0] = 8;
  test_point[1] = 3;
  tree.k_nearest_neighbors(test_point, 3, &result);
  cout << "3NNs of (" << test_point[0] << "," << test_point[1] << "):\n  ";
  print_nodes(result);

  // 1.3) kNN search with predicate
  struct Predicate : Kdtree::KdNodePredicate {
    std::vector<double> point;
    Predicate(std::vector<double> p) {
      this->point = p;
    }
    // only search for points with smaller y-coordinate
    bool operator()(const Kdtree::KdNode& kn) const {
      return this->point[1] > kn.point[1];
    }
  };
  Predicate pred(test_point);
  tree.k_nearest_neighbors(test_point, 3, &result, &pred);
  cout << "3NNs of (" << test_point[0] << "," << test_point[1] << ") with smaller y-coordinate:\n  ";
  print_nodes(result);

  // 1.4) range query
  test_point[0] = 8;
  test_point[1] = 2;
  tree.range_nearest_neighbors(test_point, 1.1, &result);
  cout << "Neighbors of (" << test_point[0] << "," << test_point[1] << ") with distance <= 1.1:\n  ";
  print_nodes(result);
  // same with maximum distance (distance_type=0)
  Kdtree::KdTree tree0(&nodes, 0);
  tree0.range_nearest_neighbors(test_point, 1.1, &result);
  cout << "Neighbors of (" << test_point[0] << "," << test_point[1] << ") with maximum distance <= 1.1:\n  ";
  print_nodes(result);

  //
  // speed tests
  //
  cout << "\nSpeed tests" << endl;
  cout << "-----------" << endl;

  double diff;
  size_t N = 500000;
  nodes.clear();
  for (size_t i = 0; i < N; ++i) {
    std::vector<double> point(2);
    point[0] = (double)rand() / RAND_MAX;
    point[1] = (double)rand() / RAND_MAX;
    nodes.push_back(Kdtree::KdNode(point));
  }
  
  // 2.1) build time
  clock_t begin = clock();
  Kdtree::KdTree tree2(&nodes);
  clock_t end = clock();
  diff = double(end - begin) / CLOCKS_PER_SEC;
  cout << "Creation time for " << N << " random points:\n  " << diff << "s" << endl;

  // 2.2) one kNN query
  test_point[0] = (double)rand() / RAND_MAX;
  test_point[1] = (double)rand() / RAND_MAX;
  begin = clock();
  tree.k_nearest_neighbors(test_point, 3, &result);
  end = clock();
  diff = double(end - begin) / CLOCKS_PER_SEC;
  cout << "3NN search time for one random point:\n  " << diff << "s" << endl;

  // 2.3) all NN query
  begin = clock();
  for (size_t i = 0; i < N; ++i) {
    std::vector<double> point(2);
    tree.k_nearest_neighbors(nodes[i].point, 2, &result);
  }
  end = clock();
  diff = double(end - begin) / CLOCKS_PER_SEC;
  cout << "Time for all nearest neighbor search:\n  " << diff << "s" << endl;

  // 2.4) range query
  double r = 0.3;
  begin = clock();
  tree.range_nearest_neighbors(test_point, r, &result);
  end = clock();
  diff = double(end - begin) / CLOCKS_PER_SEC;
  cout << "Range search time for one random point (r=" << r << "):\n  " << diff << endl;

  // 2.5) for comparison: loop version
  std::vector<Kdtree::CoordPoint> res;
  begin = clock();
  for (size_t i = 0; i < N; ++i) {
    if ((nodes[i].point[0] - test_point[0]) *
        (nodes[i].point[0] - test_point[0]) +
        (nodes[i].point[1] - test_point[1]) *
        (nodes[i].point[1] - test_point[1]) < r * r)
        res.push_back(nodes[i].point);
    }
    end = clock();
    diff = double(end - begin) / CLOCKS_PER_SEC;
    cout << "Loop version of a single range search for comparison:\n  " << diff << "s" << endl;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq 0x7acd(%rip), %rbx      # 0x9fc8
leaq 0x4b6a(%rip), %rsi      # 0x706c
movl $0x13, %edx
movq %rbx, %rdi
callq 0x2130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
leaq 0x4b43(%rip), %rsi      # 0x7080
movl $0x13, %edx
movq %rbx, %rdi
callq 0x2130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
xorpd %xmm0, %xmm0
leaq 0x60(%rsp), %rbx
movapd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
xorl %r12d, %r12d
leaq 0x4ca0(%rip), %r13      # 0x7230
leaq 0xb0(%rsp), %r14
leaq 0x120(%rsp), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, 0x120(%rsp)
movq $0x0, 0x130(%rsp)
movl $0x10, %edi
callq 0x2110
movq %rax, 0x120(%rsp)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x130(%rsp)
movq %rcx, 0x128(%rsp)
movapd (%r12,%r13), %xmm0
movupd %xmm0, (%rax)
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x3202
movq %rbx, %rdi
movq %r14, %rsi
callq 0x34aa
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x2626
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x2643
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
addq $0x10, %r12
cmpq $0xa0, %r12
jne 0x25a0
leaq 0xb0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movl $0x2, %edx
callq 0x3946
movq 0x7956(%rip), %rdi      # 0x9fc8
leaq 0x4a1b(%rip), %rsi      # 0x7094
movl $0x15, %edx
callq 0x2130
leaq 0xf8(%rsp), %rdi
callq 0x23ac
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
xorl %eax, %eax
movq %rax, 0x50(%rsp)
movq %rax, 0x10(%rsp)
movapd %xmm0, (%rsp)
movl $0x10, %edi
callq 0x2110
movq %rsp, %rsi
movq %rax, (%rsi)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x10(%rsi)
movq %rcx, 0x8(%rsi)
movapd 0x493e(%rip), %xmm0     # 0x7010
movupd %xmm0, (%rax)
leaq 0xb0(%rsp), %rdi
leaq 0x40(%rsp), %rcx
movl $0x3, %edx
xorl %r8d, %r8d
callq 0x3da2
movq 0x78d1(%rip), %rdi      # 0x9fc8
leaq 0x49ac(%rip), %rsi      # 0x70aa
movl $0x9, %edx
callq 0x2130
movq (%rsp), %rax
movsd (%rax), %xmm0
movq 0x78b1(%rip), %rdi      # 0x9fc8
callq 0x2160
movq %rax, %rbx
leaq 0x4942(%rip), %rsi      # 0x7068
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movq (%rsp), %rax
movsd 0x8(%rax), %xmm0
movq %rbx, %rdi
callq 0x2160
leaq 0x4969(%rip), %rsi      # 0x70b4
movl $0x5, %edx
movq %rax, %rdi
callq 0x2130
leaq 0x40(%rsp), %rdi
callq 0x23ac
leaq 0x98(%rsp), %rdi
movq %rsp, %rsi
callq 0x324c
leaq 0x7447(%rip), %r13      # 0x9bc0
leaq 0x80(%rsp), %rdi
movq %r13, -0x8(%rdi)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x98(%rsp), %rsi
callq 0x33a0
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x27bf
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
leaq 0xb0(%rsp), %rdi
movq %rsp, %rsi
leaq 0x40(%rsp), %rcx
leaq 0x78(%rsp), %r8
movl $0x3, %edx
callq 0x3da2
movq 0x77e3(%rip), %rdi      # 0x9fc8
leaq 0x48be(%rip), %rsi      # 0x70aa
movl $0x9, %edx
callq 0x2130
movq (%rsp), %rax
movsd (%rax), %xmm0
movq 0x77c3(%rip), %rdi      # 0x9fc8
callq 0x2160
movq %rax, %rbx
leaq 0x4854(%rip), %rsi      # 0x7068
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movq (%rsp), %rax
movsd 0x8(%rax), %xmm0
movq %rbx, %rdi
callq 0x2160
leaq 0x4881(%rip), %rsi      # 0x70ba
movl $0x1f, %edx
movq %rax, %rdi
callq 0x2130
leaq 0x40(%rsp), %rdi
callq 0x23ac
movq %rsp, %rsi
movq (%rsi), %rax
movaps 0x47c3(%rip), %xmm0     # 0x7020
movups %xmm0, (%rax)
leaq 0xb0(%rsp), %rdi
movsd 0x47d0(%rip), %xmm0     # 0x7040
leaq 0x40(%rsp), %rdx
callq 0x4228
movq 0x7747(%rip), %rdi      # 0x9fc8
leaq 0x4852(%rip), %rsi      # 0x70da
movl $0xe, %edx
callq 0x2130
movq (%rsp), %rax
movsd (%rax), %xmm0
movq 0x7727(%rip), %rdi      # 0x9fc8
callq 0x2160
movq %rax, %rbx
leaq 0x47b8(%rip), %rsi      # 0x7068
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movq (%rsp), %rax
movsd 0x8(%rax), %xmm0
movq %rbx, %rdi
callq 0x2160
leaq 0x4814(%rip), %rsi      # 0x70e9
movl $0x1a, %edx
movq %rax, %rdi
callq 0x2130
leaq 0x40(%rsp), %rdi
callq 0x23ac
leaq 0x120(%rsp), %rdi
leaq 0x60(%rsp), %rsi
xorl %edx, %edx
callq 0x3946
leaq 0x120(%rsp), %rdi
movq %rsp, %rsi
movsd 0x472d(%rip), %xmm0     # 0x7040
leaq 0x40(%rsp), %rdx
callq 0x4228
movq 0x76a4(%rip), %rdi      # 0x9fc8
leaq 0x47af(%rip), %rsi      # 0x70da
movl $0xe, %edx
callq 0x2130
movq (%rsp), %rax
movsd (%rax), %xmm0
movq 0x7684(%rip), %rdi      # 0x9fc8
callq 0x2160
movq %rax, %rbx
leaq 0x4715(%rip), %rsi      # 0x7068
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movq (%rsp), %rax
movsd 0x8(%rax), %xmm0
movq %rbx, %rdi
callq 0x2160
leaq 0x478c(%rip), %rsi      # 0x7104
movl $0x22, %edx
movq %rax, %rdi
callq 0x2130
leaq 0x40(%rsp), %rdi
callq 0x23ac
movq 0x7632(%rip), %rbx      # 0x9fc8
leaq 0x478a(%rip), %rsi      # 0x7127
movl $0xc, %edx
movq %rbx, %rdi
callq 0x2130
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq 0x7600(%rip), %rdi      # 0x9fc8
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x75ec(%rip), %rbx      # 0x9fc8
leaq 0x46a5(%rip), %rsi      # 0x7088
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2130
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq 0x75ba(%rip), %rdi      # 0x9fc8
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x60(%rsp), %rbx
movq 0x68(%rsp), %r14
cmpq %rbx, %r14
je 0x2a4f
movq %rbx, %r15
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2a41
movq 0x10(%r15), %rsi
subq %rdi, %rsi
callq 0x2120
addq $0x28, %r15
cmpq %r14, %r15
jne 0x2a2d
movq %rbx, 0x68(%rsp)
movl $0x7a120, %r12d         # imm = 0x7A120
leaq 0x198(%rsp), %rbx
leaq 0x20(%rsp), %r14
leaq 0x60(%rsp), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x10, %edi
callq 0x2110
movq %rax, 0x20(%rsp)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x30(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %rcx, 0x28(%rsp)
callq 0x2040
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x4592(%rip), %xmm1     # 0x7048
divsd %xmm1, %xmm0
movq 0x20(%rsp), %rax
movsd %xmm0, (%rax)
callq 0x2040
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x4571(%rip), %xmm0     # 0x7048
movq 0x20(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x3202
movq %r15, %rdi
movq %rbx, %rsi
callq 0x34aa
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0x2b1b
movq 0x1a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2b32
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
decq %r12
jne 0x2a67
callq 0x20a0
movq %rax, %rbx
leaq 0x198(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movl $0x2, %edx
callq 0x3946
callq 0x20a0
movq %rax, %r14
movq 0x745f(%rip), %rdi      # 0x9fc8
leaq 0x45c4(%rip), %rsi      # 0x7134
movl $0x12, %edx
callq 0x2130
movq 0x7447(%rip), %rdi      # 0x9fc8
movl $0x7a120, %esi          # imm = 0x7A120
callq 0x20b0
movq %rax, %r15
leaq 0x45b2(%rip), %rsi      # 0x7147
movl $0x12, %edx
movq %rax, %rdi
callq 0x2130
subq %rbx, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x449b(%rip), %xmm0     # 0x7050
movq %r15, %rdi
callq 0x2160
movq %rax, %rbx
leaq 0x456b(%rip), %rsi      # 0x7132
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
callq 0x2040
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x4439(%rip), %xmm1     # 0x7048
divsd %xmm1, %xmm0
movq %rsp, %r14
movq (%r14), %rax
movsd %xmm0, (%rax)
callq 0x2040
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x4417(%rip), %xmm0     # 0x7048
movq (%r14), %rax
movsd %xmm0, 0x8(%rax)
callq 0x20a0
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
leaq 0x40(%rsp), %rcx
movl $0x3, %edx
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x3da2
callq 0x20a0
movq %rax, %r14
movq 0x735b(%rip), %rdi      # 0x9fc8
leaq 0x44e6(%rip), %rsi      # 0x715a
movl $0x28, %edx
callq 0x2130
subq %rbx, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x43bf(%rip), %xmm0     # 0x7050
movq 0x7330(%rip), %rdi      # 0x9fc8
callq 0x2160
movq %rax, %rbx
leaq 0x448b(%rip), %rsi      # 0x7132
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
xorl %ebp, %ebp
callq 0x20a0
movq %rax, %rbx
leaq 0xb0(%rsp), %r14
leaq 0x40(%rsp), %r15
movl $0x10, %edi
callq 0x2110
movq %rax, %r12
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq 0x60(%rsp), %rsi
addq %rbp, %rsi
movl $0x2, %edx
movq %r14, %rdi
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x3da2
movl $0x10, %esi
movq %r12, %rdi
callq 0x2120
addq $0x28, %rbp
cmpq $0x1312d00, %rbp        # imm = 0x1312D00
jne 0x2cf2
callq 0x20a0
movq %rax, %r14
movq 0x727d(%rip), %rdi      # 0x9fc8
leaq 0x4431(%rip), %rsi      # 0x7183
movl $0x28, %edx
callq 0x2130
subq %rbx, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x42e1(%rip), %xmm0     # 0x7050
movq 0x7252(%rip), %rdi      # 0x9fc8
callq 0x2160
movq %rax, %rbx
leaq 0x43ad(%rip), %rsi      # 0x7132
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
callq 0x20a0
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
movq %rsp, %rsi
movsd 0x4284(%rip), %xmm0     # 0x7058
leaq 0x40(%rsp), %rdx
callq 0x4228
callq 0x20a0
movq %rax, %r14
movq 0x71db(%rip), %rdi      # 0x9fc8
leaq 0x43b8(%rip), %rsi      # 0x71ac
movl $0x2a, %edx
callq 0x2130
movq 0x71c3(%rip), %rdi      # 0x9fc8
movsd 0x424b(%rip), %xmm0     # 0x7058
callq 0x2160
movq %rax, %r15
leaq 0x4298(%rip), %rsi      # 0x70b4
movl $0x5, %edx
movq %rax, %rdi
callq 0x2130
subq %rbx, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x4214(%rip), %xmm0     # 0x7050
movq %r15, %rdi
callq 0x2160
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
xorl %r15d, %r15d
callq 0x20a0
movq %rax, %rbx
movsd 0x41c9(%rip), %xmm2     # 0x7060
movq 0x60(%rsp), %rsi
movq (%rsi,%r15), %rax
movq (%rsp), %rcx
movsd (%rax), %xmm0
subsd (%rcx), %xmm0
movsd 0x8(%rax), %xmm1
subsd 0x8(%rcx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm2
jbe 0x2edb
addq %r15, %rsi
movq %r14, %rdi
callq 0x32cc
movsd 0x4185(%rip), %xmm2     # 0x7060
addq $0x28, %r15
cmpq $0x1312d00, %r15        # imm = 0x1312D00
jne 0x2e97
callq 0x20a0
movq %rax, %r14
movq 0x70d1(%rip), %rdi      # 0x9fc8
leaq 0x42d9(%rip), %rsi      # 0x71d7
movl $0x38, %edx
callq 0x2130
subq %rbx, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x4135(%rip), %xmm0     # 0x7050
movq 0x70a6(%rip), %rdi      # 0x9fc8
callq 0x2160
movq %rax, %rbx
leaq 0x4201(%rip), %rsi      # 0x7132
movl $0x1, %edx
movq %rax, %rdi
callq 0x2130
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
leaq 0x20(%rsp), %rdi
callq 0x32f8
leaq 0x198(%rsp), %rdi
callq 0x38d0
leaq 0x120(%rsp), %rdi
callq 0x38d0
movq %r13, 0x78(%rsp)
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2fab
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2fc1
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
leaq 0x40(%rsp), %rdi
callq 0x334c
leaq 0xb0(%rsp), %rdi
callq 0x38d0
leaq 0x60(%rsp), %rdi
callq 0x334c
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x309d
jmp 0x305e
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x301d
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x310d
movq 0xa8(%rsp), %rsi
jmp 0x3105
jmp 0x3054
movq %rax, %rbx
jmp 0x3123
jmp 0x314c
movq %rax, %rbx
jmp 0x312d
jmp 0x3068
movq %rax, %rbx
jmp 0x310d
jmp 0x3079
movq %rax, %rbx
jmp 0x30eb
jmp 0x309d
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x32f8
jmp 0x308e
jmp 0x3079
movq %rax, %rbx
jmp 0x308e
movq %rax, %rbx
movl $0x10, %esi
movq %r12, %rdi
callq 0x2120
leaq 0x198(%rsp), %rdi
callq 0x38d0
jmp 0x30de
movq %rax, %rbx
jmp 0x30de
movq %rax, %rbx
jmp 0x30c7
movq %rax, %rbx
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0x30c7
movq 0x1a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x30de
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
leaq 0x120(%rsp), %rdi
callq 0x38d0
movq %r13, 0x78(%rsp)
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x310d
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3123
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
leaq 0x40(%rsp), %rdi
callq 0x334c
leaq 0xb0(%rsp), %rdi
callq 0x38d0
leaq 0x60(%rsp), %rdi
callq 0x334c
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rbx
jmp 0x313a
movq %rax, %rbx
jmp 0x3176
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x3176
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x313a
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
jmp 0x313a
nop