LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]lj_simd/force_soa.cpp
// Function: SoADataManager::calc_distance(int, int)
double
    calc_distance(int i, int j) {
      const double dx = q[X][i] - q[X][j];
      const double dy = q[Y][i] - q[Y][j];
      const double dz = q[Z][i] - q[Z][j];
      return dx * dx + dy * dy + dz * dz;
    }

// Assembly:
movq 0x10(%rdi), %rax
movslq %esi, %rcx
movslq %edx, %rdx
vmovsd (%rax,%rcx,8), %xmm0
vmovsd 0x61a800(%rax,%rcx,8), %xmm2
vsubsd (%rax,%rdx,8), %xmm0, %xmm1
vmovsd 0x30d400(%rax,%rcx,8), %xmm0
vsubsd 0x61a800(%rax,%rdx,8), %xmm2, %xmm2
vsubsd 0x30d400(%rax,%rdx,8), %xmm0, %xmm0
vmulsd %xmm0, %xmm0, %xmm0
vfmadd231sd %xmm1, %xmm1, %xmm0 # xmm0 = (xmm1 * xmm1) + xmm0
vfmadd231sd %xmm2, %xmm2, %xmm0 # xmm0 = (xmm2 * xmm2) + xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH02_VariablesAndBasicTypes/examples/dbl_ptr.cc
// Function: main
int main()
{
    int ival = 1024;
    int *pi = &ival;   // pi points to an int
    int **ppi = &pi;   // ppi points to a pointer to an int
    cout << "The value of ival\n"
         << "direct value: " << ival << "\n"
         << "indirect value: " << *pi << "\n"
         << "doubly indirect value: " << **ppi
         << endl;

	int i = 2; 
	int *p1 = &i;     // p1 points to i
	*p1 = *p1 * *p1;  // equivalent to i = i * i
	cout << "i  = " << i << endl;

	*p1 *= *p1;       // equivalent to i *= i
	cout << "i  = " << i << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x2e0e(%rip), %rbx      # 0x3fd8
leaq 0xe33(%rip), %rsi       # 0x2004
movq %rbx, %rdi
callq 0x1050
leaq 0xe40(%rip), %rsi       # 0x2020
movq %rax, %rdi
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1070
leaq 0xe19(%rip), %r14       # 0x2015
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
leaq 0xe10(%rip), %rsi       # 0x201e
movq %rax, %rdi
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1070
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
leaq 0xde2(%rip), %rsi       # 0x2017
movq %rax, %rdi
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1070
movq %rax, %rdi
callq 0x1030
leaq 0xdd6(%rip), %r14       # 0x202f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1050
pushq $0x4
popq %rsi
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1030
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1050
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/point.cpp
// Function: Point::Point(std::vector<double, std::allocator<double>>)
Point::Point(vector<double> new_pos) {
  pos = new_pos;
  dimension = new_pos.size();
  num_neighbors = 0;
  kth_neighbor_distance = 0;
  // ave_k_neighbor_distance = 0;
  ave_reachability_distance = 0;
  lof_val = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x28(%rdi), %rax
andl $0x0, 0x28(%rdi)
andq $0x0, 0x30(%rdi)
movq %rax, 0x38(%rdi)
movq %rax, 0x40(%rdi)
andq $0x0, 0x48(%rdi)
callq 0x29b8
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x3, %rax
movl %eax, 0x18(%rbx)
andl $0x0, 0x50(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rbx)
andq $0x0, 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
leaq 0x20(%rbx), %rdi
callq 0x2a96
movq %rbx, %rdi
callq 0x2b4c
movq %r14, %rdi
callq 0x23f0
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/point.cpp
// Function: Point::insertNeighbor(Point*)
void Point::insertNeighbor(Point* neighbor_point) {
  double new_dist = distance(this, neighbor_point);
  PointDistancePair new_pair(neighbor_point, new_dist);
  neighbors.insert(new_pair);
  num_neighbors++;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rdi, %rsi
movq %rbx, %rdx
callq 0x270c
leaq 0x8(%rsp), %rsi
movq %rbx, (%rsi)
movsd %xmm0, 0x8(%rsi)
leaq 0x20(%r14), %rdi
callq 0x2bee
incl 0x50(%r14)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/point.cpp
// Function: Point::distance(Point const*, Point const*) const
double Point::distance(const Point* p1, const Point* p2) const {
  int d = p1->dimension;
  double sum = 0;
  for (int i = 0; i < d; i++) {
    sum += pow((p1->pos[i] - p2->pos[i]), 2);
  }
  return sqrt(sum);
}

// Assembly:
movl 0x18(%rsi), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
xorpd %xmm0, %xmm0
cmpq %rcx, %rax
je 0x273c
movq (%rsi), %rdi
movsd (%rdi,%rcx,8), %xmm1
movq (%rdx), %rdi
subsd (%rdi,%rcx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rcx
jmp 0x271a
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x21e0
sqrtsd %xmm0, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/point.cpp
// Function: Point::addNewNeighbor(Point*)
void Point::addNewNeighbor(Point* new_point) {
  double new_dist = distance(this, new_point);
  PointDistancePair new_pair(new_point, new_dist);
  neighbors.insert(new_pair);
  num_neighbors++;

  // If the new point is within k nearest neighbor of it, then the kth_neighbor_distance needs to be updated
  if (new_dist <= kth_neighbor_distance) {
    updateStats();
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rdi, %rsi
movq %r14, %rdx
callq 0x270c
movsd %xmm0, (%rsp)
leaq 0x8(%rsp), %rsi
movq %r14, (%rsi)
movsd %xmm0, 0x8(%rsi)
leaq 0x20(%rbx), %rdi
callq 0x2bee
incl 0x50(%rbx)
movsd 0x58(%rbx), %xmm0
ucomisd (%rsp), %xmm0
jb 0x279a
movq %rbx, %rdi
callq 0x27a2
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/point.cpp
// Function: Point::updateStats()
void Point::updateStats() {
  if (num_neighbors >= k) {
    kth_neighbor_distance = calcKthNeighborDistance(); 
    // ave_k_neighbor_distance = calcAveKDistance();
    ave_reachability_distance = calcAveReachabilityDistance();
    lof_val = calcLof();
  }
}

// Assembly:
movl 0x50(%rdi), %eax
cmpl 0x1c(%rdi), %eax
jl 0x27d3
pushq %rbx
movq %rdi, %rbx
callq 0x2834
movsd %xmm0, 0x58(%rbx)
movq %rbx, %rdi
callq 0x2860
movsd %xmm0, 0x60(%rbx)
movq %rbx, %rdi
callq 0x28ca
movsd %xmm0, 0x68(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/point.cpp
// Function: Point::removeNeighbor(Point*)
void Point::removeNeighbor(Point* remove_point) {
  double dist = distance(this, remove_point);
  PointDistancePair temp_pair(remove_point, dist);
  neighbors.erase(neighbors.find(temp_pair));
  num_neighbors--;
  
  // If the removed point is within k nearest neighbors of it, update stats field
  if (dist <= kth_neighbor_distance) {
    updateStats();
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rdi, %rsi
movq %r14, %rdx
callq 0x270c
movsd %xmm0, (%rsp)
leaq 0x8(%rsp), %rsi
movq %r14, (%rsi)
movsd %xmm0, 0x8(%rsi)
leaq 0x20(%rbx), %r14
movq %r14, %rdi
callq 0x2da2
movq %r14, %rdi
movq %rax, %rsi
callq 0x2e18
decl 0x50(%rbx)
movsd 0x58(%rbx), %xmm0
ucomisd (%rsp), %xmm0
jb 0x282c
movq %rbx, %rdi
callq 0x27a2
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/point.cpp
// Function: Point::calcAveReachabilityDistance() const
double Point::calcAveReachabilityDistance() const {
  double sum = 0;
  auto it = neighbors.begin();
  int counter = 0;
  while (it->dist <= kth_neighbor_distance) {
    sum += calcReachabilityDistance(this, it->p);
    it++;
    counter++;
  }
  return sum / counter;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x38(%rdi), %r14
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %ebp, %ebp
movsd 0x58(%rbx), %xmm0
ucomisd 0x28(%r14), %xmm0
jb 0x28b3
movq 0x20(%r14), %rdx
movq %rbx, %rsi
callq 0x2942
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq %r14, %rdi
callq 0x2280
movq %rax, %r14
incl %ebp
jmp 0x287b
cvtsi2sd %ebp, %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/lof.cpp
// Function: Lof::Lof(int)
Lof::Lof(int ws) {
  window_size = ws;
  point_count = 0;
  dimension = 0;
  group_size = 0;
  threshold = 0;
}

// Assembly:
leaq 0x18(%rdi), %rax
movq %rax, 0x20(%rdi)
movq %rax, 0x18(%rdi)
andq $0x0, 0x28(%rdi)
movl %esi, 0x4(%rdi)
andl $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/lof.cpp
// Function: Lof::~Lof()
Lof::~Lof() {
  auto it = all_points.begin();
  while (it != all_points.end()) {
    delete *it;
    it++;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x18, %rbx
pushq $0x70
popq %r14
movq %rbx, %r12
movq (%r12), %r12
cmpq %rbx, %r12
je 0x2ec6
movq 0x10(%r12), %r15
testq %r15, %r15
je 0x2eb9
movq %r15, %rdi
callq 0x32a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x2250
jmp 0x2e9e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3356
nop
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/lof.cpp
// Function: Lof::removeFrontPoint()
void Lof::removeFrontPoint() {
  Point* front_point = all_points.front();
  for (auto it = next(all_points.begin()); it != all_points.end(); it++) {
    (*it)->removeNeighbor(front_point);
  }
  delete front_point;
  all_points.pop_front();
  point_count--;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq 0x18(%rdi), %rdi
movq 0x10(%rdi), %r15
pushq $0x1
popq %rsi
callq 0x3330
movq %rax, %r12
cmpq %r14, %r12
je 0x30b6
movq 0x10(%r12), %rdi
movq %r15, %rsi
callq 0x27d4
movq (%r12), %r12
jmp 0x309e
testq %r15, %r15
je 0x30c3
movq %r15, %rdi
callq 0x32a0
pushq $0x70
popq %rsi
movq %r15, %rdi
callq 0x2250
movq %r14, %rdi
callq 0x334e
decl 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/lof.cpp
// Function: Lof::decideGroupSize()
int Lof::decideGroupSize() {
  Point* p = all_points.back();
  double max_lof = 0;
  double lof = 0;
  int max_lof_k = 0;
  int test_k = 2;
  int group_num = 2;
  while (group_num <= 10) {
    test_k = window_size / group_num;
    changeGroupSize(test_k);
    lof = p->calcLof();
    if (lof > max_lof) {
      max_lof = lof;
      max_lof_k = test_k;
    }
    // cout << "test_k = " << test_k << ", lof = " << lof <<endl;
    group_num++;
  }
  // cout << "best k = " << max_lof_k << endl;
  return max_lof_k;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq 0x10(%rax), %r14
pushq $0x2
popq %r12
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
cmpl $0xb, %r12d
je 0x3146
movl 0x4(%rbx), %eax
cltd
idivl %r12d
movl %eax, %r15d
movq %rbx, %rdi
movl %eax, %esi
movsd %xmm0, 0x8(%rsp)
callq 0x3156
movq %r14, %rdi
callq 0x28ca
movsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
cmoval %r15d, %ebp
maxsd %xmm1, %xmm0
incl %r12d
jmp 0x3107
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/lof.cpp
// Function: Lof::changeGroupSize(int)
void Lof::changeGroupSize(int k_val) {
  group_size = k_val;
  
  // In the first iteration, update fields k, kth_neighbor_distance and ave_k_neighbor_distance of all existing points
  auto it = all_points.begin();
  while (it != all_points.end()) {
    (*it)->setK(k_val);
    (*it)->setKthNeighborDistance((*it)->calcKthNeighborDistance());
    // (*it)->setAveKNeighborDistance((*it)->calcAveKDistance());
    it++;
  }
  
  // In the second iteration, update ave_reachability_distance field of all points
  it = all_points.begin();
  while (it != all_points.end()) {
    double ar = (*it)->calcAveReachabilityDistance();
    (*it)->setAveReachabilityDistance((*it)->calcAveReachabilityDistance());
    (*it)->setLofVal((*it)->calcLof());
    it++;
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0x8(%rdi)
addq $0x18, %rbx
movq %rbx, %r15
movq (%r15), %r15
cmpq %rbx, %r15
je 0x318c
movq 0x10(%r15), %r14
movl %ebp, 0x1c(%r14)
movq %r14, %rdi
callq 0x2834
movsd %xmm0, 0x58(%r14)
jmp 0x316c
movq %rbx, %r15
movq (%r15), %r15
cmpq %rbx, %r15
je 0x31c6
movq 0x10(%r15), %rdi
callq 0x2860
movq 0x10(%r15), %r14
movq %r14, %rdi
callq 0x2860
movsd %xmm0, 0x60(%r14)
movq 0x10(%r15), %r14
movq %r14, %rdi
callq 0x28ca
movsd %xmm0, 0x68(%r14)
jmp 0x318f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/lof.cpp
// Function: Lof::decideThreshold()
double Lof::decideThreshold() {
  // Collect all lof_vals in a vector lof_vals, sort the vector and find the median
  vector<double> lof_vals;
  auto it = all_points.begin();
  while (*it != all_points.back()) {
    lof_vals.push_back((*it)->getLofVal());
    it++;
  }
  sort(lof_vals.begin(), lof_vals.end());
  
  double t = lof_vals[window_size * 0.9];
  return t;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
leaq 0x18(%rdi), %r12
leaq 0x8(%rsp), %r15
movq (%r12), %r12
movq 0x10(%r12), %rax
movq 0x20(%rbx), %rcx
cmpq 0x10(%rcx), %rax
je 0x3225
movsd 0x68(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x34aa
jmp 0x31fa
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x35eb
cvtsi2sdl 0x4(%rbx), %xmm0
mulsd 0x1de7(%rip), %xmm0     # 0x5028
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x1ddf(%rip), %xmm0     # 0x5030
sarq $0x3f, %rcx
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x10(%rsp), %rdi
movq (%rdi), %rax
movsd (%rax,%rdx,8), %xmm0
movsd %xmm0, (%rsp)
callq 0x2b4c
movsd (%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x328a
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2b4c
movq %rbx, %rdi
callq 0x23f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/p2_helper.cpp
// Function: splitString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string> splitString(string ip) {
  // Find the '#' and get rid of anything after, including '#'
  size_t pos;
  pos = ip.find("#");
  if (pos != string::npos) {
    ip = ip.substr(0, pos);
  }

  // Split the string by white spaces
  string buf;
  stringstream ss(ip);

  vector<string> tokens;

  while (ss >> buf) {
    tokens.push_back(buf);
  }
  return tokens;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1637(%rip), %rsi      # 0x50a8
movq %r14, %rdi
xorl %edx, %edx
callq 0x2450
cmpq $-0x1, %rax
je 0x3aa9
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2260
movq %r14, %rdi
movq %r15, %rsi
callq 0x22b0
movq %r15, %rdi
callq 0x20f0
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x28(%rsp), %rdi
pushq $0x18
popq %rdx
movq %r14, %rsi
callq 0x2390
andq $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
leaq 0x28(%rsp), %r14
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x22d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3b05
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4108
jmp 0x3adf
leaq 0x28(%rsp), %rdi
callq 0x21a0
leaq 0x8(%rsp), %rdi
callq 0x20f0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
jmp 0x3b43
movq %rax, %r14
movq %rbx, %rdi
callq 0x4134
leaq 0x28(%rsp), %rdi
callq 0x21a0
leaq 0x8(%rsp), %rdi
callq 0x20f0
movq %r14, %rdi
callq 0x23f0
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/p2_helper.cpp
// Function: splitCsv(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<double> splitCsv(string ip) {
  vector<double> out;
  // Split the string by comma
  string buf;
  stringstream ss(ip);

  vector<double> empty_vector;
  
  while (getline(ss, buf, ',')) {
    size_t idx = 0;
    double d = stod(buf, &idx);
    if (idx < buf.size()) {
      cout << "Detect invalid number. " << endl;
      return empty_vector;
    }
    if (d < 0) {
      cout << "Detect negative point, invalid. " << endl;
      return empty_vector;
    }
    out.push_back(d);
  }
  return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x20(%rsp)
andq $0x0, 0x10(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x70(%rsp), %rdi
pushq $0x18
popq %rdx
callq 0x2390
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
leaq 0x70(%rsp), %r15
leaq 0x50(%rsp), %r12
pushq $0x2c
popq %rbp
leaq 0x28(%rsp), %r13
movq %rsp, %r14
leaq 0x48(%rsp), %rbx
movq %r15, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x2420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3cca
andq $0x0, 0x28(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x4155
movsd %xmm0, 0x48(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x58(%rsp), %rax
jb 0x3cee
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x3cf7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x416e
jmp 0x3c75
movaps (%rsp), %xmm0
movq 0x20(%rsp), %rbx
movups %xmm0, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
jmp 0x3d3a
leaq 0x13c1(%rip), %rsi      # 0x50b6
jmp 0x3cfe
leaq 0x13d0(%rip), %rsi      # 0x50ce
movq 0x52c3(%rip), %rdi      # 0x8fc8
callq 0x2230
movq %rax, %rdi
callq 0x2100
movapd 0x30(%rsp), %xmm0
movq 0x20(%rsp), %rbx
movupd %xmm0, (%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rbx)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x2b4c
leaq 0x70(%rsp), %rdi
callq 0x21a0
leaq 0x50(%rsp), %rdi
callq 0x20f0
movq %rsp, %rdi
callq 0x2b4c
movq %rbx, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3d95
jmp 0x3d7e
jmp 0x3d7e
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2b4c
leaq 0x70(%rsp), %rdi
callq 0x21a0
leaq 0x50(%rsp), %rdi
callq 0x20f0
movq %rsp, %rdi
callq 0x2b4c
movq %rbx, %rdi
callq 0x23f0
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/p2_helper.cpp
// Function: displayPos(std::vector<double, std::allocator<double>>)
void displayPos(vector<double> pos) {
  int n = pos.size();
  for (int i = 0; i < n; i++) {
    cout << pos[i] << ", ";
  }
  cout << endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %r12
subq (%rdi), %r12
shrq $0x3, %r12
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
movq 0x4f02(%rip), %r14      # 0x8fc8
leaq 0xf53(%rip), %r15       # 0x5020
cmpq %r13, %r12
je 0x40f3
movq (%rbx), %rax
movsd (%rax,%r13,8), %xmm0
movq %r14, %rdi
callq 0x23a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
incq %r13
jmp 0x40cd
movq 0x4ece(%rip), %rdi      # 0x8fc8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2100
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/thread_org.cpp
// Function: thread_org_func(int, char const*, char const*)
void thread_org_func(int ws, const char* h, const char* p) {
  // Initialize the mutex before trying to use it
  pthread_mutex_init(&lock, NULL);
  pthread_cond_init(&has_new, NULL);

  // Push host and port to the arguments of socket_thread
  Socket_arg sa;
  sa.h = h;
  sa.p = p;

  // Initialize socket_thread
  pthread_t socket_thread;
  int socket_thread_res = pthread_create(&socket_thread, NULL, socket_thread_func, &sa);
  if (socket_thread_res != 0) {
    cout << "Socket_thread creation failed!" << endl;
    exit(1);
  }

  // Initialize lof_thread
  pthread_t lof_thread;
  int lof_thread_res = pthread_create(&lof_thread, NULL, lof_thread_func, &ws);
  if (lof_thread_res != 0) {
    cout << "lof_thread creation failed!" << endl;
    exit(1);
  }

  int socket_thread_end_res = pthread_join(socket_thread, NULL);
  int lof_thread_end_res = pthread_join(lof_thread, NULL);
  if (socket_thread_end_res != 0) {
    cout << "socket_thread_end failed!" << endl;
    exit(1);
  }
  if (lof_thread_end_res != 0) {
    cout << "lof_thread_end failed!" << endl;
    exit(1);
  }
  return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, 0x4(%rsp)
leaq 0x4c00(%rip), %rdi      # 0x9288
xorl %esi, %esi
callq 0x2350
leaq 0x4bc2(%rip), %rdi      # 0x9258
xorl %esi, %esi
callq 0x2290
leaq 0x18(%rsp), %rcx
movq %r14, (%rcx)
movq %rbx, 0x8(%rcx)
leaq 0xa9(%rip), %rdx        # 0x4759
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x2410
testl %eax, %eax
jne 0x4706
leaq 0x47e(%rip), %rdx       # 0x4b45
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rcx
xorl %esi, %esi
callq 0x2410
testl %eax, %eax
jne 0x4716
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x2210
movl %eax, %ebx
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x2210
testl %ebx, %ebx
jne 0x4726
testl %eax, %eax
jne 0x4736
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq 0x48bb(%rip), %rdi      # 0x8fc8
leaq 0xa54(%rip), %rsi       # 0x5168
jmp 0x4744
movq 0x48ab(%rip), %rdi      # 0x8fc8
leaq 0xa63(%rip), %rsi       # 0x5187
jmp 0x4744
movq 0x489b(%rip), %rdi      # 0x8fc8
leaq 0xa6f(%rip), %rsi       # 0x51a3
jmp 0x4744
movq 0x488b(%rip), %rdi      # 0x8fc8
leaq 0xa79(%rip), %rsi       # 0x51bd
callq 0x2230
movq %rax, %rdi
callq 0x2100
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/thread_org.cpp
// Function: lof_thread_func(void*)
void* lof_thread_func(void* ws) {
  int ws_int = *(int*)ws;
  Lof lof_data(ws_int);
  
  list<vector<double>> new_points;

  while (true) {
    new_points.clear();
    // Wait for new point come to shared data
    pthread_mutex_lock(&lock);
    if (shared_data.empty()) {
      pthread_cond_wait(&has_new, &lock);
    }
    new_points.swap(shared_data);
    pthread_mutex_unlock(&lock);

    auto it = new_points.begin();
    for (; it != new_points.end(); it++) {
      vector<double> new_point_pos = *it;
      // Check if the first element of new_point_pos is -1
      // If yes, all data is processed, return the thread
      if (new_point_pos[0] == -1) {
        return NULL;
      }
      // Add the new point to all_points list
      lof_data.addPoint(new_point_pos);
    }
    
  }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl (%rdi), %esi
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x2e68
leaq 0x18(%rsp), %r12
movq %r12, 0x8(%r12)
movq %r12, (%r12)
andq $0x0, 0x10(%r12)
leaq 0x470b(%rip), %r15      # 0x9288
movq %rsp, %rbp
leaq 0x30(%rsp), %r13
movq %r12, %rdi
callq 0x4cd8
movq %r15, %rdi
callq 0x2340
leaq 0x4714(%rip), %r14      # 0x92b0
cmpq %r14, 0x470d(%rip)      # 0x92b0
jne 0x4bb4
leaq 0x46ac(%rip), %rdi      # 0x9258
movq %r15, %rsi
callq 0x2360
movq %r12, %rdi
movq %r14, %rsi
callq 0x4cf0
movq %r15, %rdi
callq 0x21b0
movq %r12, %r14
movq (%r14), %r14
cmpq %r12, %r14
je 0x4b85
leaq 0x10(%r14), %rsi
movq %rbp, %rdi
callq 0x32b6
movq (%rsp), %rax
movsd (%rax), %xmm0
ucomisd 0x572(%rip), %xmm0      # 0x5160
jne 0x4bf2
jnp 0x4c1a
movq %r13, %rdi
movq %rbp, %rsi
callq 0x32b6
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2eda
movq %r13, %rdi
callq 0x2b4c
movq %rbp, %rdi
callq 0x2b4c
jmp 0x4bca
movq %rsp, %rdi
callq 0x2b4c
leaq 0x18(%rsp), %rdi
callq 0x4d18
leaq 0x48(%rsp), %rdi
callq 0x2e88
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4c65
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2b4c
jmp 0x4c5b
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2b4c
jmp 0x4c68
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4d18
leaq 0x48(%rsp), %rdi
callq 0x2e88
movq %rbx, %rdi
callq 0x23f0
// File: /workspace/github_cpp_makefile_star2_O2/ChristalC[P]Online-Outlier-Detection/p2.cpp
// Function: main
int main() {
  // Read input from stdin to get window size, host and port
  int ws;
  string host_str, port_str;

  if (!readInput(ws, host_str, port_str)) {
    cout << "Invalid Input. The program is ended!" << endl;
    exit(1);
  }

  const char* host = host_str.c_str();
  const char* port = port_str.c_str();

  thread_org_func(ws, host, port);

  return 0;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xc(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x3daf
testb %al, %al
je 0x4f8e
movq 0x30(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %edi
callq 0x4670
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0x30(%rsp), %rdi
callq 0x20f0
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
retq
movq 0x4033(%rip), %rdi      # 0x8fc8
leaq 0x2f3(%rip), %rsi       # 0x528f
callq 0x2230
movq %rax, %rdi
callq 0x2100
pushq $0x1
popq %rdi
callq 0x22a0
jmp 0x4fb3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0x30(%rsp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x23f0
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/test_random.cpp
// Function: print_features(unsigned int)
void print_features(unsigned int features) {
  printf("   w/%s%s%s%s%s\n",
         (features) ? "" : "??",
         (features & SSE2)  ? " SSE2"  : "",
         (features & SSSE3) ? " SSSE3" : "",
         (features & AESNI) ? " AESNI" : "",
         (features & XOP)   ? " XOP"   : "");
}

// Assembly:
testl %edi, %edi
leaq 0x2dc4(%rip), %rsi      # 0x4039
leaq 0x2fbb(%rip), %rax      # 0x4237
cmovneq %rax, %rsi
testb $0x2, %dil
leaq 0x2db1(%rip), %rdx      # 0x403c
cmoveq %rax, %rdx
testb $0x4, %dil
leaq 0x2da8(%rip), %rcx      # 0x4042
cmoveq %rax, %rcx
testb $0x8, %dil
leaq 0x2da0(%rip), %r8       # 0x4049
cmoveq %rax, %r8
testb $0x10, %dil
leaq 0x2d98(%rip), %r9       # 0x4050
cmoveq %rax, %r9
leaq 0x2d65(%rip), %rdi      # 0x4028
xorl %eax, %eax
jmp 0x1030
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/test_random.cpp
// Function: test_rand(int)
void test_rand(int n) {
  int i;
  double start=now();
  for (i=0; i<n; i++) {
    rand();
  }
  start = now() - start;
  
  printf("%0.1f ME (%0.1f MB) / %0.3f sec = %0.1f MB/sec",
         i / 1000000.0,
         i * sizeof(int) / 1000000.0,
         start,
         i * sizeof(int) / 1000000.0 / start);
  printf("\n\n");
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x1343
movsd %xmm0, (%rsp)
xorl %ebp, %ebp
testl %ebx, %ebx
cmovgl %ebx, %ebp
movl %ebp, %ebx
subl $0x1, %ebx
jb 0x12ee
callq 0x1040
jmp 0x12e2
callq 0x1343
movapd %xmm0, %xmm2
subsd (%rsp), %xmm2
cvtsi2sd %ebp, %xmm0
movsd 0x2d00(%rip), %xmm3     # 0x4008
movl %ebp, %eax
shlq $0x2, %rax
cvtsi2sd %rax, %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movapd %xmm1, %xmm3
divsd %xmm2, %xmm3
leaq 0x2d2b(%rip), %rdi      # 0x4055
movb $0x4, %al
callq 0x1030
leaq 0x2efe(%rip), %rdi      # 0x4236
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1110
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/test_random.cpp
// Function: test_drand48(int)
void test_drand48(int n) {
  int i;
  double start=now();
  for (i=0; i<n; i++) {
    drand48();
  }
  start = now() - start;
  
  printf("%0.1f ME (%0.1f MB) / %0.3f sec = %0.1f MB/sec",
         i / 1000000.0,
         i * 6 / 1000000.0,
         start,
         i * 6 / 1000000.0 / start);
  printf("\n\n");
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x1343
movsd %xmm0, (%rsp)
xorl %ebp, %ebp
testl %ebx, %ebx
cmovgl %ebx, %ebp
movl %ebp, %ebx
subl $0x1, %ebx
jb 0x140f
callq 0x10d0
jmp 0x1403
callq 0x1343
movapd %xmm0, %xmm2
subsd (%rsp), %xmm2
cvtsi2sd %ebp, %xmm0
movsd 0x2bdf(%rip), %xmm3     # 0x4008
imull $0x6, %ebp, %eax
cvtsi2sd %eax, %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movapd %xmm1, %xmm3
divsd %xmm2, %xmm3
leaq 0x2c0e(%rip), %rdi      # 0x4055
movb $0x4, %al
callq 0x1030
leaq 0x2de1(%rip), %rdi      # 0x4236
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1110
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/./intrinsics.h
// Function: HAVE(unsigned int)
static inline int HAVE(unsigned int feature) {
  if (!MIGHT_HAVE(feature)) return 0;
  if (MUST_HAVE(feature))   return 1;
  if (unlikely(!crandom_features))
    crandom_features = crandom_detect_features();
  return likely((crandom_features & feature) == feature);
}

// Assembly:
xorl %eax, %eax
testl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
je 0x1734
retq
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
testl %edi, %edi
je 0x1757
leaq 0x5dab(%rip), %r14      # 0x74f0
movl (%r14), %ecx
testl %ecx, %ecx
je 0x1762
notl %ecx
xorl %eax, %eax
testl %ecx, %ebx
sete %al
jmp 0x175a
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x3ce0
movl %eax, %ecx
movl %eax, (%r14)
jmp 0x174c
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/test_random.cpp
// Function: void test<crandom::prg_generator<crandom::v_chacha<12, 128>>, float, false>(int, unsigned int, unsigned int, crandom::prg_generator<crandom::v_chacha<12, 128>>*)
void test(int n, unsigned int new_features, unsigned int of_features, gen *generator) {
  unsigned int old_features = crandom_features,
    good = HAVE(new_features) && ((new_features & MUST_MASK) == (MUST_MASK & of_features));
  int i;
  crandom_features = (crandom_features & ~of_features) | new_features | 1;
  print_features(crandom_features);
  
  t out = 0;
  if (good) {
  
    double start=now();
    for (i=0; i<n; i++) {
      if (slow) {
        t x;
        generator->randomize_slow_case((unsigned char *) &x, sizeof(x));
        out += x;
      } else {
        out += generator->template random<t>();
      }
    }
    start = now() - start;
    
    printf("%0.1f ME (%0.1f MB) / %0.3f sec = %0.1f MB/sec",
           i / 1000000.0,
           i * sizeof(t) / 1000000.0,
           start,
           i * sizeof(t) / 1000000.0 / start);
    printf("\n\n");
  } else {
    printf("(unsupported)\n\n");
  }
  
  crandom_features = old_features;
  opacify(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %r15d
movl %edi, %ebp
leaq 0x595b(%rip), %r13      # 0x74f0
movl (%r13), %eax
movl %eax, 0x4(%rsp)
movl %esi, %edi
callq 0x1729
notl %r14d
andl (%r13), %r14d
movl %eax, %r12d
orl %r15d, %r14d
orl $0x1, %r14d
movl %r14d, (%r13)
movl %r14d, %edi
callq 0x126c
testl %r12d, %r12d
je 0x1c7b
callq 0x1343
movsd %xmm0, 0x8(%rsp)
xorl %r14d, %r14d
testl %ebp, %ebp
cmovgl %ebp, %r14d
xorps %xmm0, %xmm0
movl %r14d, %ebp
movaps %xmm0, 0x10(%rsp)
subl $0x1, %ebp
jb 0x1c04
movq %rbx, %rdi
callq 0x2352
movaps 0x10(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, %xmm0
jmp 0x1be4
callq 0x1343
movaps %xmm0, %xmm2
subsd 0x8(%rsp), %xmm2
cvtsi2sd %r14d, %xmm0
movsd 0x23e9(%rip), %xmm3     # 0x4008
movl %r14d, %eax
shlq $0x2, %rax
cvtsi2sd %rax, %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movapd %xmm1, %xmm3
divsd %xmm2, %xmm3
leaq 0x2413(%rip), %rdi      # 0x4055
movb $0x4, %al
callq 0x1030
leaq 0x25e6(%rip), %rdi      # 0x4236
callq 0x1110
movaps 0x10(%rsp), %xmm0
cvttss2si %xmm0, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
subss 0x23b2(%rip), %xmm0     # 0x4020
cvttss2si %xmm0, %rax
andq %rdx, %rax
orq %rcx, %rax
jmp 0x1c89
leaq 0x25a7(%rip), %rdi      # 0x4229
callq 0x1110
xorl %eax, %eax
movl 0x4(%rsp), %ecx
movl %ecx, (%r13)
movq %rax, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/./crandom.hpp
// Function: unsigned int crandom::generator_base::random<unsigned int>()
inline
  T random() {
    // T out; randomize(out); return out;
    //   Clang optimizes memcpy to a couple movs, but it still insists on
    //   copying through memory.  Therefore this is faster:
    if (unlikely(!fill)) refill();
    if (likely(fill >= sizeof(T))) {
      fill -= sizeof(T);
      T out = *(T*)(buffer+fill);
      bzero(buffer+fill, sizeof(T));
      return out;
    } else {
      T out;
      randomize_slow_case((unsigned char *)&out, sizeof(T));
      return out;
    }
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x14(%rdi), %ecx
testl %ecx, %ecx
je 0x227e
cmpl $0x4, %ecx
jb 0x228c
addl $-0x4, %ecx
movl %ecx, 0x14(%rbx)
movq 0x18(%rbx), %rdx
movl (%rdx,%rcx), %eax
andl $0x0, (%rdx,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl 0x14(%rbx), %ecx
jmp 0x2260
leaq 0x4(%rsp), %r14
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2490
movl (%r14), %eax
jmp 0x2276
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/crandom.cpp
// Function: crandom::generator_base::stir(unsigned char const*, unsigned long)
void generator_base::stir
(const unsigned char *entropy, size_t n) {
  unsigned char *k = key();
  size_t i;
  while (n > 0) {
    for (i=0; i<n && i<key_size; i++) {
      k[i] ^= entropy[i];
    }
    n -= i;
    entropy += i;
    refill();
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rdi), %r15d
movl 0xc(%rdi), %eax
addq 0x18(%rdi), %r15
subq %rax, %r15
testq %rdx, %rdx
je 0x2447
xorl %eax, %eax
movq %rdx, %r12
subq %rax, %r12
jbe 0x2436
movl 0xc(%r14), %ecx
cmpq %rcx, %rax
jae 0x2436
movb (%rbx,%rax), %cl
xorb %cl, (%r15,%rax)
incq %rax
jmp 0x2419
addq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %r12, %rdx
jmp 0x2412
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/crandom.cpp
// Function: crandom::generator_base::randomize_slow_case(unsigned char*, unsigned long)
void generator_base::randomize_slow_case
(unsigned char *output, size_t n) {
  while (n>0) {
    if (!fill) refill();
  
    size_t transfer = (n > fill) ? fill : n;
    
    fill -= transfer;
    n -= transfer;
    
    memcpy(output, buffer + fill, transfer);
    bzero(buffer + fill, transfer);
    
    output += transfer;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rbx, %rbx
je 0x24f5
movl 0x14(%r15), %esi
testl %esi, %esi
jne 0x24bb
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movl 0x14(%r15), %esi
movl %esi, %r12d
cmpq %r12, %rbx
cmovbq %rbx, %r12
subl %r12d, %esi
movl %esi, 0x14(%r15)
subq %r12, %rbx
addq 0x18(%r15), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x10c0
movl 0x14(%r15), %edi
addq 0x18(%r15), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x1090
addq %r12, %r14
jmp 0x24a1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/crandom.cpp
// Function: crandom::dev_random_handle::~dev_random_handle()
dev_random_handle::~dev_random_handle() {
  // FIXME it doesn't...
  if (!--(*ref)) {
    close(fd);
    delete ref;
  }
}

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rax
decl (%rax)
je 0x256d
popq %rbx
retq
movq %rdi, %rbx
movl (%rdi), %edi
callq 0x1160
movq 0x8(%rbx), %rdi
pushq $0x4
popq %rsi
popq %rbx
jmp 0x10f0
movq %rax, %rdi
callq 0x2f96
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/crandom.cpp
// Function: unsigned __int128 crandom::generator_base::random<unsigned __int128>(unsigned __int128, unsigned __int128)
T generator_base::random(T min, T max) {
  if (min > max) {
    // todo
    throw 0;
  } else {
    T mask = prec_mask(max-min), x;
    do {
      x = (random<T>() & mask) + min;
    } while (x < min || x > max);
    return x;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpq %rsi, %rcx
movq %r8, %rax
sbbq %rdx, %rax
jb 0x2cae
movq %rcx, %rax
xorq %rsi, %rax
movq %r8, %r9
xorq %rdx, %r9
orq %rax, %r9
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
jne 0x2c29
movq %r8, %r14
movq %rdi, %rbx
xorl %r13d, %r13d
xorl %r8d, %r8d
jmp 0x2c5a
movq %rdi, %rbx
movq %rcx, %rax
subq %rsi, %rax
movq %r8, %r14
movq %r8, %rcx
sbbq %rdx, %rcx
bsrq %rax, %rax
movzbl %al, %edx
pushq $0x2
popq %rdi
xorl %esi, %esi
callq 0x1120
movq %rax, %r13
movq %rdx, %r8
addq $-0x1, %r13
adcq $-0x1, %r8
movq %rbx, 0x20(%rsp)
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %rbp
movq 0x20(%rsp), %rdi
movq %r8, %rbx
callq 0x22a4
movq %rbx, %r8
andq %rbx, %rdx
andq %r13, %rax
addq %rbp, %rax
adcq %r12, %rdx
setb %cl
cmpq %rax, %r15
movq %r14, %rsi
sbbq %rdx, %rsi
setb %sil
orb %cl, %sil
jne 0x2c6e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x4
popq %rdi
callq 0x1070
andl $0x0, (%rax)
movq 0x4310(%rip), %rsi      # 0x6fd0
movq %rax, %rdi
xorl %edx, %edx
callq 0x1140
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/crandom.cpp
// Function: void crandom::generator_base::permutation<signed char>(signed char*, unsigned int)
void
generator_base::permutation(integer *elements, u_int32_t n) {
  u_int32_t i;
  for (i=0; i<n; i++) elements[i] = i;
  for (i=1; i<n; i++) {
    u_int32_t j = random<u_int32_t>(0,i);
    integer tmp = elements[i];
    elements[i] = elements[j];
    elements[j] = tmp;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r12d
xorl %eax, %eax
cmpq %rax, %r12
je 0x2cea
movb %al, (%rbx,%rax)
incq %rax
jmp 0x2cdd
pushq $0x1
popq %r15
cmpq %r12, %r15
jae 0x2d15
movq %r14, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x29dc
movb (%rbx,%r15), %cl
movl %eax, %eax
movb (%rbx,%rax), %dl
movb %dl, (%rbx,%r15)
movb %cl, (%rbx,%rax)
incq %r15
jmp 0x2cee
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/chacha.c
// Function: quarter_round_sse2
static inline void
  quarter_round_sse2(ssereg *a, ssereg *b, ssereg *c, ssereg *d) {
    *a = add(*a,*b); *d = sse2_rotate(16, *d ^ *a);
    *c = add(*c,*d); *b = sse2_rotate(12, *b ^ *c);
    *a = add(*a,*b); *d = sse2_rotate(8,  *d ^ *a);
    *c = add(*c,*d); *b = sse2_rotate(7,  *b ^ *c);
  }

// Assembly:
movdqa (%rsi), %xmm0
paddd (%rdi), %xmm0
movdqa %xmm0, (%rdi)
pxor (%rcx), %xmm0
movdqa %xmm0, %xmm1
psrld $0x10, %xmm1
pslld $0x10, %xmm0
por %xmm1, %xmm0
movdqa %xmm0, (%rcx)
paddd (%rdx), %xmm0
movdqa %xmm0, (%rdx)
pxor (%rsi), %xmm0
movdqa %xmm0, %xmm1
psrld $0x14, %xmm1
pslld $0xc, %xmm0
por %xmm1, %xmm0
movdqa %xmm0, (%rsi)
paddd (%rdi), %xmm0
movdqa %xmm0, (%rdi)
pxor (%rcx), %xmm0
movdqa %xmm0, %xmm1
psrld $0x18, %xmm1
pslld $0x8, %xmm0
por %xmm1, %xmm0
movdqa %xmm0, (%rcx)
paddd (%rdx), %xmm0
movdqa %xmm0, (%rdx)
pxor (%rsi), %xmm0
movdqa %xmm0, %xmm1
psrld $0x19, %xmm1
pslld $0x7, %xmm0
por %xmm1, %xmm0
movdqa %xmm0, (%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/bitwiseshiftleft[P]crandom/chacha.c
// Function: quarter_round
static inline void
quarter_round(u_int32_t *a, u_int32_t *b, u_int32_t *c, u_int32_t *d) {
  *a = *a + *b; *d = rotate(16, *d^*a);
  *c = *c + *d; *b = rotate(12, *b^*c);
  *a = *a + *b; *d = rotate(8,  *d^*a);
  *c = *c + *d; *b = rotate(7,  *b^*c);
}

// Assembly:
movl (%rsi), %eax
addl (%rdi), %eax
movl %eax, (%rdi)
xorl (%rcx), %eax
roll $0x10, %eax
movl %eax, (%rcx)
addl (%rdx), %eax
movl %eax, (%rdx)
xorl (%rsi), %eax
roll $0xc, %eax
movl %eax, (%rsi)
addl (%rdi), %eax
movl %eax, (%rdi)
xorl (%rcx), %eax
roll $0x8, %eax
movl %eax, (%rcx)
addl (%rdx), %eax
movl %eax, (%rdx)
xorl (%rsi), %eax
roll $0x7, %eax
movl %eax, (%rsi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jasperandrew[P]cs350-project2/lab7.cpp
// Function: split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, 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>>>>&)
vector<string> &split(const string &s, char delim, vector<string> &elems) {
    stringstream ss(s);
    string item;
    while(getline(ss, item, delim)){
        elems.push_back(item);
    }
    return elems;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %rsi
leaq -0x1c8(%rbp), %r14
pushq $0x18
popq %rdx
movq %r14, %rdi
callq 0x2330
leaq -0x30(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movsbl %r15b, %r15d
leaq -0x40(%rbp), %r12
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x23b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3ddb
movq %rbx, %rdi
movq %r12, %rsi
callq 0x474e
jmp 0x3db2
leaq -0x40(%rbp), %rdi
callq 0x20f0
leaq -0x1c8(%rbp), %rdi
callq 0x2170
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x20f0
leaq -0x1c8(%rbp), %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/jasperandrew[P]cs350-project2/./lab7.h
// Function: transferImap(unsigned int*)
void transferImap(block_num * imap_data)
{
    for(int i = 0; i < 256; i++)
    {
        if(imap_data[i] == 0) return;
        g_imap.list[g_imap.idx++] = imap_data[i];
       // cout << "imap_data: "<< i << " " << g_imap.list[g_imap.idx-1] << "\n";
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
leaq 0x16a14f(%rip), %rcx    # 0x16c718
cmpq $0x100, %rax            # imm = 0x100
je 0x25f2
movl (%rdi,%rax,4), %edx
testl %edx, %edx
je 0x25f2
movslq 0x174139(%rip), %rsi    # 0x176718
leal 0x1(%rsi), %r8d
movl %r8d, 0x17412e(%rip)    # 0x176718
movl %edx, (%rcx,%rsi,4)
incq %rax
jmp 0x25c9
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jasperandrew[P]cs350-project2/./lab7.h
// Function: readImaps()
void readImaps()
{
    for(int i = 0; i < 40; i++)
    {
        if((Checkpoint_Region.imaps[i]) == 0){
            Checkpoint_Region_counter = i;
            break;

        }
        int block_number = Checkpoint_Region.imaps[i];
        int seg_idx = block_number/1024;
        int seg_block = block_number % 1024;

        if(seg_idx == current_segment){
            //cout << current_segment<< "\n";
            transferImap(wbuffer.getBlock(seg_block-1)->getBlockData());
        }else{
            string seg_path = "DRIVE/SEGMENT" + to_string(seg_idx+1);
            FILE * fp;
            fp = fopen(seg_path.c_str(),"r");
            block_num tmpB[BLOCK_SZ/4];
            fseek(fp, (BLOCK_SZ * (seg_block-1)), SEEK_SET);
            fread(tmpB, sizeof(block_num), BLOCK_SZ/4, fp);
            fclose(fp);
            transferImap(tmpB);
        } 
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
leaq 0x16a045(%rip), %r15    # 0x16c654
xorl %r13d, %r13d
movl $0x400, %r12d           # imm = 0x400
leaq -0x48(%rbp), %rbx
cmpq $0x28, %r13
je 0x2704
movl (%r15), %eax
testl %eax, %eax
je 0x26fd
cltd
idivl %r12d
movl %edx, %r14d
cmpl 0x105c06(%rip), %eax    # 0x108244
jne 0x2661
movslq %r14d, %rax
leaq 0x1740d6(%rip), %rcx    # 0x176720
movq -0x8(%rcx,%rax,8), %rdi
movl $0x708, %eax            # imm = 0x708
addq %rax, %rdi
callq 0x25bc
jmp 0x26f1
incl %eax
leaq -0x450(%rbp), %r12
movq %r12, %rdi
movl %eax, %esi
callq 0x44ba
movq %rbx, %rdi
leaq 0x2996(%rip), %rsi      # 0x5014
movq %r12, %rdx
callq 0x448c
movq %r12, %rdi
callq 0x20f0
movq -0x48(%rbp), %rdi
leaq 0x2989(%rip), %rsi      # 0x5022
callq 0x2240
movq %rax, %r12
shll $0xa, %r14d
addl $0xfffffc00, %r14d      # imm = 0xFFFFFC00
movslq %r14d, %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x2220
movl $0x100, %edx            # imm = 0x100
leaq -0x450(%rbp), %r14
movq %r14, %rdi
pushq $0x4
popq %rsi
movq %r12, %rcx
callq 0x2310
movq %r12, %rdi
callq 0x21f0
movq %r14, %rdi
callq 0x25bc
movq %rbx, %rdi
callq 0x20f0
movl $0x400, %r12d           # imm = 0x400
incq %r13
addq $0x4, %r15
jmp 0x261c
movl %r13d, 0x16a010(%rip)   # 0x16c714
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x450(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2390
nop
// File: /workspace/github_cpp_makefile_star2_O2/jasperandrew[P]cs350-project2/./lab7.h
// Function: writeImaps()
void writeImaps(){
    for(int i = 0; i < 10240; i+=(BLOCK_SZ/4))
    {
        if(g_imap.list[i] == 0) break;
        Block * imap_block = new Block(2);
        imap_block->addInodeData(i);
    } 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x169fcb(%rip), %r12    # 0x16c718
xorl %ebx, %ebx
pushq $0x2
popq %r14
cmpq $0x27ff, %rbx           # imm = 0x27FF
ja 0x2795
cmpl $0x0, (%r12)
je 0x2795
movl $0x1f10, %edi           # imm = 0x1F10
callq 0x2200
movq %rax, %r15
movq %rax, %rdi
movl %r14d, %esi
callq 0x451a
movq %r15, %rdi
movl %ebx, %esi
callq 0x279e
addq $0x100, %rbx            # imm = 0x100
addq $0x400, %r12            # imm = 0x400
jmp 0x2753
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jasperandrew[P]cs350-project2/./classes.cpp
// Function: Block::addInodeData(int)
void Block::addInodeData(int start_index)
{
    int iter = start_index;
    for(; iter < start_index+256; iter++)
    {
        if(g_imap.list[iter] == 0) break;
        block_data[iter-start_index] = g_imap.list[iter];
        cout <<"input value: " <<g_imap.list[iter] << "\n";
    }
    wbuffer.addBlock(this);
    addToCheckpointRegion();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %esi, %r13
shlq $0x2, %r13
xorl %r14d, %r14d
leaq 0x169f58(%rip), %r15    # 0x16c718
cmpq $0x100, %r14            # imm = 0x100
je 0x2822
leaq (,%r14,4), %rax
addq %r13, %rax
movl (%r15,%rax), %eax
testl %eax, %eax
je 0x2822
leaq (,%r14,4), %r12
movl %eax, 0x708(%rbx,%r14,4)
movq 0x57d5(%rip), %rdi      # 0x7fc8
leaq 0x2a01(%rip), %rsi      # 0x51fb
callq 0x21e0
addq %r13, %r12
movl (%r15,%r12), %esi
movq %rax, %rdi
callq 0x2370
movq %rax, %rdi
leaq 0x2b44(%rip), %rsi      # 0x535c
callq 0x21e0
incq %r14
jmp 0x27c0
leaq 0x173ef7(%rip), %rdi    # 0x176720
movq %rbx, %rsi
callq 0x31be
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d3e