LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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
movslq 0x18(%rdi), %rax
xorpd %xmm1, %xmm1
xorpd %xmm0, %xmm0
testq %rax, %rax
jle 0x3958
movq (%rbx), %rcx
movq (%r14), %rdx
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm2
subsd (%rdx,%rsi,8), %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm0
incq %rsi
cmpq %rsi, %rax
jne 0x393e
ucomisd %xmm1, %xmm0
jb 0x3964
sqrtsd %xmm0, %xmm0
jmp 0x3969
callq 0x31f0
movsd %xmm0, (%rsp)
leaq 0x8(%rsp), %rsi
movq %r14, (%rsi)
movsd %xmm0, 0x8(%rsi)
leaq 0x20(%rbx), %r14
movq %r14, %rdi
callq 0x3eda
movq %r14, %rdi
movq %rax, %rsi
callq 0x3f5a
decl 0x50(%rbx)
movsd 0x58(%rbx), %xmm0
ucomisd (%rsp), %xmm0
jb 0x39a9
movq %rbx, %rdi
callq 0x38e6
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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)
movq $0x0, 0x28(%rdi)
movl %esi, 0x4(%rdi)
movl $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %r15
addq $0x18, %rbx
cmpq %rbx, %r15
je 0x400b
movq 0x10(%r15), %r14
testq %r14, %r14
je 0x4006
leaq 0x20(%r14), %rdi
callq 0x3cf6
movq (%r14), %rdi
testq %rdi, %rdi
je 0x3ff9
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x3280
movl $0x70, %esi
movq %r14, %rdi
callq 0x3280
movq (%r15), %r15
jmp 0x3fce
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x4028
movq (%rdi), %r14
movl $0x18, %esi
callq 0x3280
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x4013
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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), %r15
movq 0x18(%rdi), %rax
movq (%rax), %r12
movq 0x10(%rax), %r14
cmpq %r15, %r12
je 0x423a
movq 0x10(%r12), %rdi
movq %r14, %rsi
callq 0x3918
movq (%r12), %r12
jmp 0x4222
testq %r14, %r14
je 0x4269
leaq 0x20(%r14), %rdi
callq 0x3cf6
movq (%r14), %rdi
testq %rdi, %rdi
je 0x425c
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x3280
movl $0x70, %esi
movq %r14, %rdi
callq 0x3280
movq 0x18(%rbx), %r14
decq 0x28(%rbx)
movq %r14, %rdi
callq 0x3410
movl $0x18, %esi
movq %r14, %rdi
callq 0x3280
decl 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
xorpd %xmm0, %xmm0
xorl %ebp, %ebp
movl $0x2, %r12d
movsd %xmm0, 0x8(%rsp)
movl 0x4(%rbx), %eax
cltd
idivl %r12d
movl %eax, %r15d
movq %rbx, %rdi
movl %eax, %esi
callq 0x4306
movq %r14, %rdi
callq 0x3aba
movsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
cmoval %r15d, %ebp
maxsd %xmm1, %xmm0
incl %r12d
cmpl $0xb, %r12d
jne 0x42b9
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, %rbx
movl %esi, 0x8(%rdi)
movq 0x18(%rdi), %r15
addq $0x18, %rbx
cmpq %rbx, %r15
je 0x4340
movl %esi, %ebp
movq 0x10(%r15), %r14
movl %ebp, 0x1c(%r14)
movq %r14, %rdi
callq 0x39b2
movsd %xmm0, 0x58(%r14)
movq (%r15), %r15
cmpq %rbx, %r15
jne 0x4322
movq (%rbx), %r15
cmpq %rbx, %r15
je 0x437a
movq 0x10(%r15), %rdi
callq 0x39ec
movq 0x10(%r15), %r14
movq %r14, %rdi
callq 0x39ec
movsd %xmm0, 0x60(%r14)
movq 0x10(%r15), %r14
movq %r14, %rdi
callq 0x3aba
movsd %xmm0, 0x68(%r14)
movq (%r15), %r15
jmp 0x4343
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x18(%rdi), %r12
movq 0x20(%rdi), %rcx
movq 0x10(%r12), %rax
cmpq 0x10(%rcx), %rax
je 0x4403
movq %rsp, %r14
leaq 0x20(%rsp), %r15
movsd 0x68(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x43e5
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x43f0
movq %r14, %rdi
movq %r15, %rdx
callq 0x4544
movq (%r12), %r12
movq 0x10(%r12), %rax
movq 0x20(%rbx), %rcx
cmpq 0x10(%rcx), %rax
jne 0x43bf
movq (%rsp), %r14
movq 0x8(%rsp), %r15
cmpq %r15, %r14
je 0x443e
movq %r15, %rax
subq %r14, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4667
movq %r14, %rdi
movq %r15, %rsi
callq 0x4760
xorps %xmm0, %xmm0
cvtsi2sdl 0x4(%rbx), %xmm0
mulsd 0x2bea(%rip), %xmm0     # 0x7038
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x2be2(%rip), %xmm0     # 0x7040
sarq $0x3f, %rcx
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq (%rsp), %rdi
movsd (%rdi,%rdx,8), %xmm0
testq %rdi, %rdi
je 0x4494
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
movsd %xmm0, 0x18(%rsp)
callq 0x3280
movsd 0x18(%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x44a2
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x44bb
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x264c(%rip), %rsi      # 0x70ab
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3450
cmpq $-0x1, %rax
je 0x4aae
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3290
movq %r14, %rdi
movq %r15, %rsi
callq 0x32f0
movq (%r15), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4aae
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x33e0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x20(%rsp), %r14
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3310
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4b14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5544
jmp 0x4aee
movq 0x549d(%rip), %rsi      # 0x9fb8
leaq 0x20(%rsp), %rdi
callq 0x31a0
leaq 0xa0(%rsp), %rdi
callq 0x30b0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x4b48
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
jmp 0x4b88
movq %rax, %r14
movq %rbx, %rdi
callq 0x5582
movq 0x5447(%rip), %rsi      # 0x9fb8
leaq 0x20(%rsp), %rdi
callq 0x31a0
leaq 0xa0(%rsp), %rdi
callq 0x30b0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x4b9e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 0x490c(%rip), %rdi      # 0xa2b8
xorl %esi, %esi
callq 0x3380
leaq 0x48ce(%rip), %rdi      # 0xa288
xorl %esi, %esi
callq 0x32d0
leaq 0x18(%rsp), %rcx
movq %r14, (%rcx)
movq %rbx, 0x8(%rcx)
leaq 0xab(%rip), %rdx        # 0x5a7f
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3490
testl %eax, %eax
jne 0x5a2a
leaq 0x60d(%rip), %rdx       # 0x5ff8
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rcx
xorl %esi, %esi
callq 0x3490
testl %eax, %eax
jne 0x5a3a
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3230
movl %eax, %ebx
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x3230
testl %ebx, %ebx
jne 0x5a4a
testl %eax, %eax
jne 0x5a5a
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq 0x459f(%rip), %rdi      # 0x9fd0
leaq 0x1760(%rip), %rsi      # 0x7198
jmp 0x5a68
movq 0x458f(%rip), %rdi      # 0x9fd0
leaq 0x176f(%rip), %rsi      # 0x71b7
jmp 0x5a68
movq 0x457f(%rip), %rdi      # 0x9fd0
leaq 0x177b(%rip), %rsi      # 0x71d3
jmp 0x5a68
movq 0x456f(%rip), %rdi      # 0x9fd0
leaq 0x1785(%rip), %rsi      # 0x71ed
callq 0x3260
movq %rax, %rdi
callq 0x3100
movl $0x1, %edi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3f98
movq %rsp, %r14
movq %r14, 0x8(%r14)
movq %r14, (%r14)
movq $0x0, 0x10(%r14)
leaq 0x428a(%rip), %r15      # 0xa2b8
leaq 0x18(%rsp), %rbp
leaq 0x30(%rsp), %r13
movq %r14, %rdi
callq 0x61ec
movq %r14, 0x8(%rsp)
movq %r14, (%rsp)
movq $0x0, 0x10(%rsp)
movq %r15, %rdi
callq 0x3370
leaq 0x427f(%rip), %r12      # 0xa2e0
cmpq %r12, 0x4278(%rip)      # 0xa2e0
jne 0x6079
leaq 0x4217(%rip), %rdi      # 0xa288
movq %r15, %rsi
callq 0x33a0
movq %r14, %rdi
movq %r12, %rsi
callq 0x3480
movq 0x4265(%rip), %rax      # 0xa2f0
movq 0x10(%rsp), %rcx
movq %rcx, 0x4259(%rip)      # 0xa2f0
movq %rax, 0x10(%rsp)
movq %r15, %rdi
callq 0x31b0
movq (%rsp), %r12
cmpq %r14, %r12
je 0x6038
leaq 0x10(%r12), %rsi
movq %rbp, %rdi
callq 0x44c4
movq 0x18(%rsp), %rdi
movsd (%rdi), %xmm0
ucomisd 0x10c5(%rip), %xmm0     # 0x7190
jne 0x60cf
jnp 0x6119
movq %r13, %rdi
movq %rbp, %rsi
callq 0x44c4
movq %rbx, %rdi
movq %r13, %rsi
callq 0x402e
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x60fc
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x6113
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq (%r12), %r12
jmp 0x60a8
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %rsp, %rdi
callq 0x61ec
leaq 0x48(%rsp), %rdi
callq 0x3fbe
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6183
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x616a
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
jmp 0x616a
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x6186
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
jmp 0x6186
movq %rax, %rbx
movq %rsp, %rdi
callq 0x61ec
leaq 0x48(%rsp), %rdi
callq 0x3fbe
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
xorl %eax, %eax
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq 0xc(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x4f49
testb %al, %al
je 0x6390
movq 0x30(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %edi
callq 0x5994
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x636d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x6384
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x3c39(%rip), %rdi      # 0x9fd0
leaq 0xf21(%rip), %rsi       # 0x72bf
movl $0x24, %edx
callq 0x32b0
movq 0x3c21(%rip), %rdi      # 0x9fd0
callq 0x3100
movl $0x1, %edi
callq 0x32e0
jmp 0x63c0
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x63da
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x63f1
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3dd4(%rip), %rsi      # 0x5039
leaq 0x3fcb(%rip), %rax      # 0x5237
cmovneq %rax, %rsi
testb $0x2, %dil
leaq 0x3dc1(%rip), %rdx      # 0x503c
cmoveq %rax, %rdx
testb $0x4, %dil
leaq 0x3db8(%rip), %rcx      # 0x5042
cmoveq %rax, %rcx
testb $0x8, %dil
leaq 0x3db0(%rip), %r8       # 0x5049
cmoveq %rax, %r8
testb $0x10, %dil
leaq 0x3da8(%rip), %r9       # 0x5050
cmoveq %rax, %r9
leaq 0x3d75(%rip), %rdi      # 0x5028
xorl %eax, %eax
jmp 0x1030
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x1120
movq (%r14), %r12
movq 0x8(%r14), %r14
testl %ebx, %ebx
jle 0x12f3
movl %ebx, %ebp
callq 0x1040
decl %ebp
jne 0x12e7
movl %ebx, %r15d
cvtsi2sd %r14, %xmm0
divsd 0x3d08(%rip), %xmm0     # 0x5008
cvtsi2sd %r12, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1120
xorps %xmm0, %xmm0
cvtsi2sdq (%rbx), %xmm0
cvtsi2sdq 0x8(%rbx), %xmm2
movsd 0x3cd4(%rip), %xmm3     # 0x5008
divsd %xmm3, %xmm2
addsd %xmm0, %xmm2
subsd 0x8(%rsp), %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movl %r15d, %eax
shlq $0x2, %rax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movapd %xmm1, %xmm3
divsd %xmm2, %xmm3
leaq 0x3ce5(%rip), %rdi      # 0x5055
movb $0x4, %al
callq 0x1030
leaq 0x3eb8(%rip), %rdi      # 0x5236
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1110
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x1120
movq (%r14), %r12
movq 0x8(%r14), %r14
testl %ebx, %ebx
jle 0x149d
movl %ebx, %ebp
callq 0x10d0
decl %ebp
jne 0x1491
movl %ebx, %r15d
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x3b5b(%rip), %xmm0     # 0x5008
cvtsi2sd %r12, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1120
xorps %xmm0, %xmm0
cvtsi2sdq (%rbx), %xmm0
cvtsi2sdq 0x8(%rbx), %xmm2
movsd 0x3b27(%rip), %xmm3     # 0x5008
divsd %xmm3, %xmm2
addsd %xmm0, %xmm2
subsd 0x8(%rsp), %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
addl %r15d, %r15d
leal (%r15,%r15,2), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movapd %xmm1, %xmm3
divsd %xmm2, %xmm3
leaq 0x3b39(%rip), %rdi      # 0x5055
movb $0x4, %al
callq 0x1030
leaq 0x3d0c(%rip), %rdi      # 0x5236
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1110
// File: /workspace/github_cpp_makefile_star2_O1/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:
testq %rdx, %rdx
je 0x2ccf
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x8(%rdi), %r12d
movl 0xc(%rdi), %eax
addq 0x18(%rdi), %r12
subq %rax, %r12
cmpl $0x0, 0xc(%r15)
je 0x2cb2
xorl %r13d, %r13d
movb (%r14,%r13), %al
xorb %al, (%r12,%r13)
incq %r13
cmpq %rbx, %r13
jae 0x2cb5
movl 0xc(%r15), %eax
cmpq %rax, %r13
jb 0x2c97
jmp 0x2cb5
xorl %r13d, %r13d
addq %r13, %r14
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
subq %r13, %rbx
jne 0x2c8d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
testq %rdx, %rdx
je 0x2d83
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x0, 0x14(%r15)
jne 0x2d3a
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movl 0x14(%r15), %esi
cmpq %rsi, %rbx
movq %rsi, %r12
cmovbq %rbx, %r12
subl %r12d, %esi
movl %esi, 0x14(%r15)
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
subq %r12, %rbx
jne 0x2d2a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2df5
popq %rbx
retq
movq %rdi, %rbx
movl (%rdi), %edi
callq 0x1150
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x2df3
movl $0x4, %esi
popq %rbx
jmp 0x10f0
movq %rax, %rdi
callq 0x39dd
nop
// File: /workspace/github_cpp_makefile_star2_O1/bitwiseshiftleft[P]crandom/crandom.cpp
// Function: signed char crandom::generator_base::random<signed char>(signed char, signed char)
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 %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %ebp
cmpb %bl, %bpl
jg 0x2ec1
movq %rdi, %r14
jne 0x2e3f
xorl %r12d, %r12d
jmp 0x2e57
movsbl %bpl, %eax
movsbl %bl, %ecx
subl %eax, %ecx
bsrl %ecx, %ecx
movl $0x2, %r12d
shll %cl, %r12d
decb %r12b
leaq 0xf(%rsp), %r15
cmpl $0x0, 0x14(%r14)
je 0x2e93
movl 0x14(%r14), %ecx
testl %ecx, %ecx
je 0x2e9e
decl %ecx
movl %ecx, 0x14(%r14)
movq 0x18(%r14), %rdx
movb (%rdx,%rcx), %al
movb $0x0, (%rdx,%rcx)
andb %r12b, %al
addb %bpl, %al
cmpb %bpl, %al
setl %cl
cmpb %bl, %al
setg %dl
orb %cl, %dl
jne 0x2e5c
jmp 0x2eb4
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
jmp 0x2e63
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d14
movb 0xf(%rsp), %al
jmp 0x2e7c
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x1070
movl $0x0, (%rax)
movq 0x50f8(%rip), %rsi      # 0x7fd0
movq %rax, %rdi
xorl %edx, %edx
callq 0x1130
// File: /workspace/github_cpp_makefile_star2_O1/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
testl %edx, %edx
je 0x36fc
xorl %eax, %eax
movb %al, (%rbx,%rax)
incq %rax
cmpq %rax, %r12
jne 0x36f1
cmpl $0x2, %edx
jb 0x372c
movl $0x1, %r15d
movq %r14, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x32ce
movb (%rbx,%r15), %cl
movl %eax, %eax
movb (%rbx,%rax), %dl
movb %dl, (%rbx,%r15)
movb %cl, (%rbx,%rax)
incq %r15
cmpq %r15, %r12
jne 0x3707
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/bitwiseshiftleft[P]crandom/intrinsics.c
// Function: crandom_detect_features
unsigned int crandom_detect_features() {
  unsigned int out = GEN;
  
# if (defined(__i386__) || defined(__x86_64__))
    u_int32_t a,b,c,d;
    
    a=1; asm("cpuid" : "+a"(a), "=b"(b), "=c"(c), "=d"(d));
    out |= GEN;
    if (d & 1<<26) out |= SSE2;
    if (d & 1<< 9) out |= SSSE3;
    if (c & 1<<25) out |= AESNI;
    
    a=0x80000001; asm("cpuid" : "+a"(a), "=b"(b), "=c"(c), "=d"(d));
    if (c & 1<<11) out |= XOP;
# endif
  
  return out;
}

// Assembly:
pushq %rbx
movl $0x1, %eax
cpuid
movl %ecx, %esi
movl %edx, %eax
shrl $0x19, %eax
andl $0x2, %eax
shrl $0x7, %edx
andl $0x4, %edx
shrl $0x16, %esi
andl $0x8, %esi
orl %edx, %esi
orl %eax, %esi
movl $0x80000001, %eax       # imm = 0x80000001
cpuid
shrl $0x7, %ecx
andl $0x10, %ecx
leal (%rcx,%rsi), %eax
incl %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %rsi
leaq -0x1d0(%rbp), %r14
movq %r14, %rdi
movl $0x18, %edx
callq 0x2350
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movsbl %r15b, %r15d
leaq -0x48(%rbp), %r12
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x23d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4a3e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x540a
jmp 0x4a15
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x4a4c
callq 0x21b0
movq 0x455d(%rip), %rsi      # 0x8fb0
leaq -0x1d0(%rbp), %rdi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x20a0
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x4a91
callq 0x21b0
movq 0x4518(%rip), %rsi      # 0x8fb0
leaq -0x1d0(%rbp), %rdi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
pushq %rax
movq $-0x100, %rbx
leaq 0x16ae47(%rip), %r15    # 0x16d718
cmpl $0x0, (%r15)
je 0x291e
movl $0x1f10, %edi           # imm = 0x1F10
callq 0x21f0
movq %rax, %r14
movl $0x2, (%rax)
leaq 0x708(%rax), %rdi
addq $0x100, %rbx            # imm = 0x100
movl $0x404, %edx            # imm = 0x404
xorl %esi, %esi
callq 0x2100
movq %r14, %rdi
movl %ebx, %esi
callq 0x292a
addq $0x400, %r15            # imm = 0x400
cmpq $0x2700, %rbx           # imm = 0x2700
jb 0x28d1
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
subq $0x18, %rsp
movq %rdi, -0x30(%rbp)
movslq %esi, %r13
leal 0xff(%r13), %eax
cltq
movq %rax, -0x40(%rbp)
leaq -0x1(%r13), %rax
movq %rax, -0x38(%rbp)
shlq $0x2, %r13
xorl %ebx, %ebx
leaq 0x16adb4(%rip), %r15    # 0x16d718
movq 0x6665(%rip), %r14      # 0x8fd0
leaq (,%rbx,4), %rax
addq %r13, %rax
movl (%r15,%rax), %eax
testl %eax, %eax
je 0x29db
leaq (,%rbx,4), %r12
movq -0x30(%rbp), %rcx
movl %eax, 0x708(%rcx,%rbx,4)
movl $0xd, %edx
movq %r14, %rdi
leaq 0x385b(%rip), %rsi      # 0x61fb
callq 0x2240
addq %r13, %r12
movl (%r15,%r12), %esi
movq %r14, %rdi
callq 0x2380
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3999(%rip), %rsi      # 0x635c
callq 0x2240
movq -0x38(%rbp), %rax
addq %rbx, %rax
incq %rax
incq %rbx
cmpq -0x40(%rbp), %rax
jl 0x296b
movslq 0x176d3e(%rip), %rax    # 0x179720
leaq 0x174d37(%rip), %rcx    # 0x177720
leal 0x1(%rax), %edx
movl %edx, 0x176d2e(%rip)    # 0x179720
movq -0x30(%rbp), %rsi
movq %rsi, (%rcx,%rax,8)
cmpl $0x400, %edx            # imm = 0x400
jne 0x2a0e
leaq 0x174d17(%rip), %rdi    # 0x177720
callq 0x45b4
movl 0x106830(%rip), %eax    # 0x109244
shll $0xa, %eax
addl 0x176d03(%rip), %eax    # 0x179720
movslq 0x16acf0(%rip), %rcx    # 0x16d714
leal 0x1(%rcx), %edx
movl %edx, 0x16ace7(%rip)    # 0x16d714
leaq 0x16ac20(%rip), %rdx    # 0x16d654
movl %eax, (%rdx,%rcx,4)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jasperandrew[P]cs350-project2/./lab7.h
// Function: checkPointInit()
void checkPointInit()
{
    FILE * checkpoint_file;
    current_segment = 0;
    checkpoint_file = fopen("DRIVE/CHECKPOINT_REGION","r");
    if(checkpoint_file != NULL){
        if(DBG) cout << "reading checkpoint \n";
        fread(&Checkpoint_Region,sizeof(Checkpoint_Region), 1, checkpoint_file);
        fclose(checkpoint_file);
        for(int i = 0 ; i < 40; i++)
        {
            if(Checkpoint_Region.imaps[i]==0) break;
            //cout << "Imap location: " << Checkpoint_Region.imaps[i] << "\n";
        }

        for(; current_segment < 32; current_segment++){
            if(Checkpoint_Region.liveBits[current_segment] == 0){ 
                //cout <<"livebit: "  << current_segment << " value: " << Checkpoint_Region.liveBits[current_segment];
                //cout <<"current segment: "<< current_segment<< "\n";
                break;
            }
        }
        readImaps();
    }
    else{
        current_segment = 0;
        for(unsigned int imap: Checkpoint_Region.imaps)
        {
            imap = 0;
        }
        for(char liveBit: Checkpoint_Region.liveBits)
        {
            liveBit = 0;
        }
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0x0, 0x1067ed(%rip)    # 0x109244
leaq 0x35c6(%rip), %rdi      # 0x6024
leaq 0x35bd(%rip), %rsi      # 0x6022
callq 0x2260
testq %rax, %rax
je 0x2ae1
movq %rax, %r14
movq 0x6557(%rip), %rdi      # 0x8fd0
leaq 0x35bc(%rip), %rsi      # 0x603c
movl $0x14, %edx
callq 0x2240
leaq 0x16abc3(%rip), %rbx    # 0x16d654
movl $0xc0, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x2320
movq %r14, %rdi
callq 0x21e0
movslq 0x10678f(%rip), %rax    # 0x109244
cmpq $0x1f, %rax
jg 0x2ad8
leal 0x1(%rax), %ecx
cmpb $0x0, 0xa0(%rax,%rbx)
je 0x2ad8
incq %rax
movl %ecx, 0x106773(%rip)    # 0x109244
incl %ecx
cmpl $0x20, %eax
jne 0x2abe
popq %rbx
popq %r14
popq %rbp
jmp 0x2622
movl $0x0, 0x106759(%rip)    # 0x109244
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jasperandrew[P]cs350-project2/./lab7.h
// Function: writeCheckpoint()
void writeCheckpoint()
{
    writeImaps();
    FILE * checkpoint_file;
    Checkpoint_Region.liveBits[current_segment] = 1;
    checkpoint_file =  fopen("DRIVE/CHECKPOINT_REGION", "w");
    if(checkpoint_file != NULL)
    {
        fwrite(&Checkpoint_Region,sizeof(Checkpoint_Region), 1, checkpoint_file);
        fclose(checkpoint_file);
    }
    else perror("File Open Failed: ");
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x28b9
movslq 0x106742(%rip), %rax    # 0x109244
leaq 0x16ab4b(%rip), %rcx    # 0x16d654
movb $0x1, 0xa0(%rax,%rcx)
leaq 0x350c(%rip), %rdi      # 0x6024
leaq 0x3532(%rip), %rsi      # 0x6051
callq 0x2260
testq %rax, %rax
je 0x2b53
movq %rax, %rbx
leaq 0x16ab21(%rip), %rdi    # 0x16d654
movl $0xc0, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x2400
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x21e0
leaq 0x34f9(%rip), %rdi      # 0x6053
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2180
// File: /workspace/github_cpp_makefile_star2_O1/jasperandrew[P]cs350-project2/./lab7.h
// Function: lookForFreeSpots(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void lookForFreeSpots(string lfs_filename)
{
    bool found = false;
    for(int i = 0; i < 10240; i++)
    {
        if(g_imap.list[i] == UINT_MAX)
        {
            g_filemap[g_filemap_ctr].num = i;
            g_filemap[g_filemap_ctr].name = lfs_filename;
						g_filemap_ctr++;
						
            g_imap.list[i] = BLOCK_SZ * current_segment + wbuffer.getNumBlocks();
            found = true;
        }
    }
    if(!found) cout << "YER OUTTER SPACE!\n";
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x16ab9e(%rip), %r14    # 0x16d718
xorl %r15d, %r15d
leaq 0x106acc(%rip), %r12    # 0x109650
xorl %eax, %eax
cmpl $-0x1, (%r14)
jne 0x2bc5
movslq 0x16aabd(%rip), %rax    # 0x16d650
leaq (%rax,%rax,4), %rax
leaq (%r12,%rax,8), %rdi
addq $0x8, %rdi
movl %r15d, -0x8(%rdi)
movq %rbx, %rsi
callq 0x20f0
incl 0x16aa9f(%rip)          # 0x16d650
movl 0x10668d(%rip), %eax    # 0x109244
shll $0xa, %eax
addl 0x176b60(%rip), %eax    # 0x179720
movl %eax, (%r14)
movb $0x1, %al
incq %r15
addq $0x4, %r14
cmpq $0x2800, %r15           # imm = 0x2800
jne 0x2b86
testb $0x1, %al
je 0x2be2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x63e7(%rip), %rdi      # 0x8fd0
leaq 0x3476(%rip), %rsi      # 0x6066
movl $0x12, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2240
// File: /workspace/github_cpp_makefile_star2_O1/jasperandrew[P]cs350-project2/./lab7.h
// Function: readFileMap()
void readFileMap()
{
	ifstream filemap("DRIVE/FILE_MAP", ios::in);
	if(DBG) cout << "Reading from FILE_MAP\n";
	g_filemap_ctr = 0;
	string line;
	while(getline(filemap,line))
	{
		stringstream s(line);
		s >> g_filemap[g_filemap_ctr].num >> g_filemap[g_filemap_ctr].name;
		g_filemap_ctr++;
	}
	filemap.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp            # imm = 0x3B8
leaq 0x3450(%rip), %rsi      # 0x6079
leaq -0x3d8(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x23c0
movq 0x638c(%rip), %rdi      # 0x8fd0
leaq 0x343d(%rip), %rsi      # 0x6088
movl $0x16, %edx
callq 0x2240
movl $0x0, 0x16a9f1(%rip)    # 0x16d650
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x48(%rbp), %r15
leaq -0x1d0(%rbp), %r12
leaq 0x1069cc(%rip), %r14    # 0x109650
movq 0x6325(%rip), %r13      # 0x8fb0
movq -0x3d8(%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x23d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2d23
movq %r12, %rdi
movq %r15, %rsi
movl $0x18, %edx
callq 0x2350
movslq 0x16a97a(%rip), %rax    # 0x16d650
leaq (%rax,%rax,4), %rax
leaq (%r14,%rax,8), %rsi
movq %r12, %rdi
callq 0x2120
movslq 0x16a963(%rip), %rcx    # 0x16d650
leaq (%rcx,%rcx,4), %rcx
leaq (%r14,%rcx,8), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x22b0
incl 0x16a949(%rip)          # 0x16d650
movq %r12, %rdi
movq %r13, %rsi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x20a0
jmp 0x2c8b
leaq -0x3d8(%rbp), %rdi
callq 0x2060
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2d41
callq 0x21b0
leaq -0x3d8(%rbp), %rdi
callq 0x2070
addq $0x3b8, %rsp            # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d8c
movq %rax, %rbx
jmp 0x2da1
jmp 0x2d8c
movq %rax, %rbx
movq 0x623e(%rip), %rsi      # 0x8fb0
leaq -0x1d0(%rbp), %rdi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x20a0
jmp 0x2d8f
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2da1
callq 0x21b0
leaq -0x3d8(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O1/jasperandrew[P]cs350-project2/./lab7.h
// Function: writeFileMap()
void writeFileMap()
{
	ofstream filemap("DRIVE/FILE_MAP", ios::out);
	if(DBG) cout << "Writing to FILE_MAP\n";
	for(int i = 0; i < g_filemap_ctr; i++){
		filemap << g_filemap[i].num << "\t" << g_filemap[i].name << "\n";
	} 
	filemap.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
leaq 0x32a9(%rip), %rsi      # 0x6079
leaq -0x228(%rbp), %rdi
movl $0x10, %edx
callq 0x2210
movq 0x61e8(%rip), %rdi      # 0x8fd0
leaq 0x32b0(%rip), %rsi      # 0x609f
movl $0x14, %edx
callq 0x2240
cmpl $0x0, 0x16a850(%rip)    # 0x16d650
jle 0x2e6f
leaq 0x106857(%rip), %r13    # 0x109660
xorl %ebx, %ebx
leaq 0x32a2(%rip), %r14      # 0x60b4
leaq 0x3543(%rip), %r15      # 0x635c
movl -0x10(%r13), %esi
leaq -0x228(%rbp), %rdi
callq 0x2380
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2240
movq -0x8(%r13), %rsi
movq (%r13), %rdx
movq %r12, %rdi
callq 0x2240
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
incq %rbx
movslq 0x16a7ea(%rip), %rax    # 0x16d650
addq $0x28, %r13
cmpq %rax, %rbx
jl 0x2e19
leaq -0x228(%rbp), %rdi
callq 0x22e0
movq 0x6146(%rip), %rax      # 0x8fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x220(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x228(%rbp,%rcx)
callq 0x2190
leaq -0x130(%rbp), %rdi
callq 0x20a0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2ec5
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
callq 0x2310
movq %rbx, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O1/jasperandrew[P]cs350-project2/./lab7.h
// Function: remove(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void remove(string filename)
{
	bool removed = false;
	unsigned int remove_block;
	for(int i = 0; i < g_filemap_ctr; i++){
		if(g_filemap[i].name == filename){
			remove_block = g_filemap[i].num;
			g_filemap[i].num = -1;
			removed = true;
			if(DBG) cout << "Removed " << filename << "\n";
		}
	}
	if(!removed)
	{
	cout << "File '" << filename << "' does not exist!\n";
	return;
	}
	g_imap.list[remove_block] = UINT_MAX;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x169e64(%rip)    # 0x16d650
jle 0x3883
leaq 0x105e57(%rip), %r13    # 0x109650
xorl %r15d, %r15d
xorl %r14d, %r14d
movq 0x10(%r13), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x386b
testq %rdx, %rdx
je 0x381e
movq (%rbx), %rsi
movq 0x8(%r13), %rdi
callq 0x2200
testl %eax, %eax
jne 0x386b
movl (%r13), %r12d
movl $0xffffffff, (%r13)     # imm = 0xFFFFFFFF
movl $0x8, %edx
movq 0x579a(%rip), %r14      # 0x8fd0
movq %r14, %rdi
leaq 0x28a3(%rip), %rsi      # 0x60e3
callq 0x2240
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2240
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2af9(%rip), %rsi      # 0x635c
callq 0x2240
movb $0x1, %r14b
incq %r15
movslq 0x169ddb(%rip), %rax    # 0x16d650
addq $0x28, %r13
cmpq %rax, %r15
jl 0x37ff
movl %r12d, %eax
jmp 0x3888
xorl %r14d, %r14d
xorl %eax, %eax
testb $0x1, %r14b
je 0x38ab
leaq 0x169e83(%rip), %rcx    # 0x16d718
movl $0xffffffff, (%rcx,%rax,4) # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x571e(%rip), %r14      # 0x8fd0
leaq 0x2810(%rip), %rsi      # 0x60c9
movl $0x6, %edx
movq %r14, %rdi
callq 0x2240
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2240
leaq 0x27f4(%rip), %rsi      # 0x60d0
movl $0x12, %edx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2240
// File: /workspace/github_cpp_makefile_star2_O1/jasperandrew[P]cs350-project2/./lab7.h
// Function: list()
void list()
{
	cout << "\nFile List\n----------------------------\n";
	for(int i = 0; i < g_filemap_ctr;i++){
		cout << g_filemap[i].name << " (";
		cout << readInode(g_filemap[i].num).filesize << " bytes)\n";
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq 0x52d6(%rip), %rdi      # 0x8fd0
leaq 0x23eb(%rip), %rsi      # 0x60ec
movl $0x28, %edx
callq 0x2240
cmpl $0x0, 0x16993e(%rip)    # 0x16d650
jle 0x3d98
leaq 0x105941(%rip), %r13    # 0x109660
xorl %r14d, %r14d
movq 0x52a7(%rip), %rbx      # 0x8fd0
leaq -0x32c(%rbp), %r15
leaq 0x23e1(%rip), %r12      # 0x6118
movq -0x8(%r13), %rsi
movq (%r13), %rdx
movq %rbx, %rdi
callq 0x2240
movl $0x2, %edx
movq %rax, %rdi
leaq 0x23bf(%rip), %rsi      # 0x6115
callq 0x2240
movl -0x10(%r13), %esi
movq %r15, %rdi
callq 0x2edc
movl -0x22c(%rbp), %esi
movq %rbx, %rdi
callq 0x2380
movl $0x8, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2240
incq %r14
movslq 0x1698c1(%rip), %rax    # 0x16d650
addq $0x28, %r13
cmpq %rax, %r14
jl 0x3d37
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jasperandrew[P]cs350-project2/./lab7.h
// Function: cat(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void cat(string filename)
{		
		int inode_num = getInodeNum(filename);
		if(inode_num == -1){
			cout << "File '" << filename << "' does not exist!\n";
			return;
		}
		inode file_inode = readInode(inode_num);
		for(int i = 0; i < MAX_FILE_BLOCKS; i++){
			if(file_inode.datablocks[i]){
				readData(file_inode.datablocks[i]);
				printf("%.*s", BLOCK_SZ, block_buffer);
			}else{
				break;
			}
		}
		cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x330, %rsp            # imm = 0x330
movq %rdi, %rbx
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x5524
movq %r15, %rdi
callq 0x3361
movl %eax, %r14d
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x3df6
callq 0x21b0
cmpl $-0x1, %r14d
je 0x3e82
leaq -0x344(%rbp), %rdi
movl %r14d, %esi
callq 0x2edc
movl $0x41, %r15d
leaq 0x2305(%rip), %rbx      # 0x6121
leaq 0x10542d(%rip), %r14    # 0x109250
movl -0x344(%rbp,%r15,4), %edi
testl %edi, %edi
je 0x3e52
callq 0x3139
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
incq %r15
cmpq $0xc1, %r15
jne 0x3e23
movq 0x5177(%rip), %rbx      # 0x8fd0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
jmp 0x3ec0
movq 0x5147(%rip), %r14      # 0x8fd0
leaq 0x2239(%rip), %rsi      # 0x60c9
movl $0x6, %edx
movq %r14, %rdi
callq 0x2240
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2240
leaq 0x221d(%rip), %rsi      # 0x60d0
movl $0x12, %edx
movq %rax, %rdi
callq 0x2240
addq $0x330, %rsp            # imm = 0x330
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jasperandrew[P]cs350-project2/./lab7.h
// Function: display(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int)
void display(string filename, int how_many, int start)
{
		int inode_num = getInodeNum(filename);
		if(inode_num == -1){
			cout << "File '" << filename << "' does not exist!\n";
			return;
		}
		
		int start_block = start/BLOCK_SZ;
		int start_offset = start % BLOCK_SZ;
		int bytes_read = 0;
		
		inode file_inode = readInode(inode_num);
		for(int i = start_block; i < MAX_FILE_BLOCKS; i++){
			if(file_inode.datablocks[i]){
				if(bytes_read < how_many){
					readData(file_inode.datablocks[i]);
					if(how_many - bytes_read >= BLOCK_SZ)
						printf("%.*s", BLOCK_SZ, block_buffer);
					else
						printf("%.*s", how_many-bytes_read, block_buffer);
				}else{
					cout << "\n\nComplete! (read " << how_many << " bytes)\n";
					return;
				}
			}else{
				cout << "\n\nReached end of file (read " << bytes_read << " bytes)\n";
				return;
			}
		}
		
		if(bytes_read < how_many)
			cout << "\n\nReached end of file (read " << bytes_read << " bytes)\n";
		else
			cout << "\n\nComplete! (read " << how_many << " bytes)\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
movl %edx, %r14d
movl %esi, %ebx
movq %rdi, %r15
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x5524
movq %r13, %rdi
callq 0x3361
movl %eax, %r12d
movq (%r13), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3f27
callq 0x21b0
cmpl $-0x1, %r12d
je 0x3fd3
leaq -0x34c(%rbp), %rdi
movl %r12d, %esi
callq 0x2edc
cmpl $0x1ffff, %r14d         # imm = 0x1FFFF
jg 0x3fb3
leal 0x3ff(%r14), %eax
testl %r14d, %r14d
cmovnsl %r14d, %eax
sarl $0xa, %eax
movslq %eax, %r13
cmpl $0x7f, %r13d
movl $0x7f, %r15d
cmovgl %r13d, %r15d
incl %r15d
movl $0x400, %r14d           # imm = 0x400
cmpl %r14d, %ebx
cmovll %ebx, %r14d
leaq 0x1052ce(%rip), %r12    # 0x109250
movl -0x248(%rbp,%r13,4), %edi
testl %edi, %edi
je 0x3fb7
testl %ebx, %ebx
jle 0x400b
callq 0x3139
leaq 0x2183(%rip), %rdi      # 0x6121
movl %r14d, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2050
incq %r13
cmpq %r13, %r15
jne 0x3f82
testl %ebx, %ebx
jle 0x400b
movq 0x5012(%rip), %rdi      # 0x8fd0
leaq 0x2174(%rip), %rsi      # 0x6139
movl $0x1c, %edx
callq 0x2240
xorl %ebx, %ebx
jmp 0x4023
movq 0x4ff6(%rip), %rbx      # 0x8fd0
leaq 0x20e8(%rip), %rsi      # 0x60c9
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2240
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x2240
leaq 0x20cc(%rip), %rsi      # 0x60d0
movl $0x12, %edx
jmp 0x403d
movq 0x4fbe(%rip), %rdi      # 0x8fd0
leaq 0x210d(%rip), %rsi      # 0x6126
movl $0x12, %edx
callq 0x2240
movq 0x4fa6(%rip), %rdi      # 0x8fd0
movl %ebx, %esi
callq 0x2380
leaq 0x20e0(%rip), %rsi      # 0x6118
movl $0x8, %edx
movq %rax, %rdi
callq 0x2240
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq