LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x422c
movq 0x10(%r12), %rdi
movq %r14, %rsi
callq 0x3918
movq (%r12), %r12
jmp 0x4214
testq %r14, %r14
je 0x424e
leaq 0x20(%r14), %rdi
callq 0x3d04
movq (%r14), %rdi
testq %rdi, %rdi
je 0x424e
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_O3/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 0x42f8
movq %r14, %rdi
callq 0x3aba
movsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
cmoval %r15d, %ebp
maxsd %xmm1, %xmm0
incl %r12d
cmpl $0xb, %r12d
jne 0x42ab
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4367
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 0x4314
movq (%rbx), %r15
jmp 0x4367
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
cmpq %rbx, %r15
jne 0x4337
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rsp, %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq 0x18(%rdi), %r12
movq 0x20(%rdi), %rax
movq 0x10(%r12), %rcx
leaq 0x20(%rsp), %r15
movsd 0x68(%rcx), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x43d0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x43df
movq %r14, %rdi
movq %r15, %rdx
callq 0x452e
movq 0x20(%rbx), %rax
movq (%r12), %r12
movq 0x10(%r12), %rcx
cmpq 0x10(%rax), %rcx
jne 0x43aa
movq (%rsp), %r14
movq 0x8(%rsp), %r15
cmpq %r15, %r14
je 0x442d
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 0x4651
movq %r14, %rdi
movq %r15, %rsi
callq 0x474a
movq (%rsp), %r14
xorps %xmm0, %xmm0
cvtsi2sdl 0x4(%rbx), %xmm0
mulsd 0x2bfb(%rip), %xmm0     # 0x7038
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x2bf3(%rip), %xmm0     # 0x7040
sarq $0x3f, %rcx
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movsd (%r14,%rdx,8), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x10(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x3280
movsd 0x18(%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x448c
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x44a5
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2684(%rip), %rsi      # 0x70ab
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3450
cmpq $-0x1, %rax
je 0x4a76
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 0x4a76
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 0x4adc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x54e8
jmp 0x4ab6
movq 0x54d5(%rip), %rsi      # 0x9fb8
leaq 0x20(%rsp), %rdi
callq 0x31a0
leaq 0xa0(%rsp), %rdi
callq 0x30b0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x4b10
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 0x4b50
movq %rax, %r14
movq %rbx, %rdi
callq 0x5526
movq 0x547f(%rip), %rsi      # 0x9fb8
leaq 0x20(%rsp), %rdi
callq 0x31a0
leaq 0xa0(%rsp), %rdi
callq 0x30b0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x4b66
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4998(%rip), %rdi      # 0xa2b8
xorl %esi, %esi
callq 0x3380
leaq 0x495a(%rip), %rdi      # 0xa288
xorl %esi, %esi
callq 0x32d0
leaq 0x18(%rsp), %rcx
movq %r14, (%rcx)
movq %rbx, 0x8(%rcx)
leaq 0xab(%rip), %rdx        # 0x59f3
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3490
testl %eax, %eax
jne 0x599e
leaq 0x5fb(%rip), %rdx       # 0x5f5a
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rcx
xorl %esi, %esi
callq 0x3490
testl %eax, %eax
jne 0x59ae
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 0x59be
testl %eax, %eax
jne 0x59ce
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq 0x462b(%rip), %rdi      # 0x9fd0
leaq 0x17ec(%rip), %rsi      # 0x7198
jmp 0x59dc
movq 0x461b(%rip), %rdi      # 0x9fd0
leaq 0x17fb(%rip), %rsi      # 0x71b7
jmp 0x59dc
movq 0x460b(%rip), %rdi      # 0x9fd0
leaq 0x1807(%rip), %rsi      # 0x71d3
jmp 0x59dc
movq 0x45fb(%rip), %rdi      # 0x9fd0
leaq 0x1811(%rip), %rsi      # 0x71ed
callq 0x3260
movq %rax, %rdi
callq 0x3100
movl $0x1, %edi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3f84
movq %rsp, %r14
movq %r14, 0x8(%r14)
movq %r14, (%r14)
movq $0x0, 0x10(%r14)
leaq 0x4328(%rip), %r15      # 0xa2b8
leaq 0x18(%rsp), %rbp
leaq 0x30(%rsp), %r13
movq %r14, %rdi
callq 0x614e
movq %r14, 0x8(%rsp)
movq %r14, (%rsp)
movq $0x0, 0x10(%rsp)
movq %r15, %rdi
callq 0x3370
leaq 0x431d(%rip), %r12      # 0xa2e0
cmpq %r12, 0x4316(%rip)      # 0xa2e0
jne 0x5fdb
leaq 0x42b5(%rip), %rdi      # 0xa288
movq %r15, %rsi
callq 0x33a0
movq %r14, %rdi
movq %r12, %rsi
callq 0x3480
movq 0x4303(%rip), %rax      # 0xa2f0
movq 0x10(%rsp), %rcx
movq %rcx, 0x42f7(%rip)      # 0xa2f0
movq %rax, 0x10(%rsp)
movq %r15, %rdi
callq 0x31b0
movq (%rsp), %r12
cmpq %r14, %r12
je 0x5f9a
leaq 0x10(%r12), %rsi
movq %rbp, %rdi
callq 0x44ae
movq 0x18(%rsp), %rdi
movsd (%rdi), %xmm0
ucomisd 0x1163(%rip), %xmm0     # 0x7190
jne 0x6031
jnp 0x607b
movq %r13, %rdi
movq %rbp, %rsi
callq 0x44ae
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4020
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x605e
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x6075
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq (%r12), %r12
jmp 0x600a
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %rsp, %rdi
callq 0x614e
leaq 0x48(%rsp), %rdi
callq 0x3faa
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x60e5
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x60cc
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
jmp 0x60cc
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x60e8
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
jmp 0x60e8
movq %rax, %rbx
movq %rsp, %rdi
callq 0x614e
leaq 0x48(%rsp), %rdi
callq 0x3faa
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4f01
testb %al, %al
je 0x62e4
movq 0x30(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %edi
callq 0x5908
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x62c1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x62d8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x3ce5(%rip), %rdi      # 0x9fd0
leaq 0xfcd(%rip), %rsi       # 0x72bf
movl $0x24, %edx
callq 0x32b0
movq 0x3ccd(%rip), %rdi      # 0x9fd0
callq 0x3100
movl $0x1, %edi
callq 0x32e0
jmp 0x6314
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x632e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x6345
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4dd4(%rip), %rsi      # 0x6039
leaq 0x4fcb(%rip), %rax      # 0x6237
cmovneq %rax, %rsi
testb $0x2, %dil
leaq 0x4dc1(%rip), %rdx      # 0x603c
cmoveq %rax, %rdx
testb $0x4, %dil
leaq 0x4db8(%rip), %rcx      # 0x6042
cmoveq %rax, %rcx
testb $0x8, %dil
leaq 0x4db0(%rip), %r8       # 0x6049
cmoveq %rax, %r8
testb $0x10, %dil
leaq 0x4da8(%rip), %r9       # 0x6050
cmoveq %rax, %r9
leaq 0x4d75(%rip), %rdi      # 0x6028
xorl %eax, %eax
jmp 0x1030
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4d08(%rip), %xmm0     # 0x6008
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 0x4cd4(%rip), %xmm3     # 0x6008
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 0x4ce5(%rip), %rdi      # 0x6055
movb $0x4, %al
callq 0x1030
leaq 0x4eb8(%rip), %rdi      # 0x6236
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1110
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4b5b(%rip), %xmm0     # 0x6008
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 0x4b27(%rip), %xmm3     # 0x6008
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 0x4b39(%rip), %rdi      # 0x6055
movb $0x4, %al
callq 0x1030
leaq 0x4d0c(%rip), %rdi      # 0x6236
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1110
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2c93
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 0x2c76
xorl %r13d, %r13d
movb (%r14,%r13), %al
xorb %al, (%r12,%r13)
incq %r13
cmpq %rbx, %r13
jae 0x2c79
movl 0xc(%r15), %eax
cmpq %rax, %r13
jb 0x2c5b
jmp 0x2c79
xorl %r13d, %r13d
addq %r13, %r14
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
subq %r13, %rbx
jne 0x2c51
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2d48
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x14(%r15), %esi
testl %esi, %esi
jne 0x2d03
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)
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 0x2cee
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2dbb
popq %rbx
retq
movq %rdi, %rbx
movl (%rdi), %edi
callq 0x1150
movq 0x8(%rbx), %rdi
movl $0x4, %esi
popq %rbx
jmp 0x10f0
movq %rax, %rdi
callq 0x4c28
// File: /workspace/github_cpp_makefile_star2_O3/bitwiseshiftleft[P]crandom/crandom.cpp
// Function: short crandom::generator_base::random<short>(short, short)
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
cmpw %bx, %bp
jg 0x2f4d
movq %rdi, %r14
jne 0x2ec5
xorl %r12d, %r12d
jmp 0x2edc
movswl %bp, %eax
movswl %bx, %ecx
subl %eax, %ecx
bsrl %ecx, %ecx
movl $0x2, %r12d
shll %cl, %r12d
decl %r12d
leaq 0xe(%rsp), %r15
movl 0x14(%r14), %ecx
testl %ecx, %ecx
je 0x2f1a
cmpl $0x2, %ecx
jb 0x2f29
addl $-0x2, %ecx
movl %ecx, 0x14(%r14)
movq 0x18(%r14), %rdx
movzwl (%rdx,%rcx), %eax
movw $0x0, (%rdx,%rcx)
andl %r12d, %eax
addl %ebp, %eax
cmpw %bp, %ax
setl %cl
cmpw %bx, %ax
setg %dl
orb %cl, %dl
jne 0x2ee1
jmp 0x2f40
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movl 0x14(%r14), %ecx
jmp 0x2ee9
movl $0x2, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2cd8
movzwl 0xe(%rsp), %eax
jmp 0x2f03
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x1070
movl $0x0, (%rax)
movq 0x606c(%rip), %rsi      # 0x8fd0
movq %rax, %rdi
xorl %edx, %edx
callq 0x1130
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4ace
movq %rbx, %rdi
movq %r12, %rsi
callq 0x54b6
jmp 0x4aa5
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x4adc
callq 0x21b0
movq 0x44cd(%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 0x4b21
callq 0x21b0
movq 0x4488(%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_O3/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), %rcx    # 0x179720
leaq 0x174d37(%rip), %rdx    # 0x177720
leal 0x1(%rcx), %eax
movl %eax, 0x176d2e(%rip)    # 0x179720
movq -0x30(%rbp), %rsi
movq %rsi, (%rdx,%rcx,8)
cmpl $0x400, %eax            # imm = 0x400
jne 0x2a13
leaq 0x174d18(%rip), %rdi    # 0x177720
callq 0x4644
movl 0x176d0d(%rip), %eax    # 0x179720
movl 0x10682b(%rip), %ecx    # 0x109244
shll $0xa, %ecx
addl %eax, %ecx
movslq 0x16acef(%rip), %rax    # 0x16d714
leal 0x1(%rax), %edx
movl %edx, 0x16ace6(%rip)    # 0x16d714
leaq 0x16ac1f(%rip), %rdx    # 0x16d654
movl %ecx, (%rdx,%rax,4)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x1067ec(%rip)    # 0x109244
leaq 0x35c5(%rip), %rdi      # 0x6024
leaq 0x35bc(%rip), %rsi      # 0x6022
callq 0x2260
testq %rax, %rax
je 0x2ae6
movq %rax, %rbx
movq 0x6556(%rip), %rdi      # 0x8fd0
leaq 0x35bb(%rip), %rsi      # 0x603c
movl $0x14, %edx
callq 0x2240
leaq 0x16abc2(%rip), %r14    # 0x16d654
movl $0xc0, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x2320
movq %rbx, %rdi
callq 0x21e0
movslq 0x10678e(%rip), %rcx    # 0x109244
cmpq $0x1f, %rcx
jg 0x2add
leaq (%rcx,%r14), %rax
addq $0xa0, %rax
incl %ecx
cmpb $0x0, (%rax)
je 0x2add
movl %ecx, 0x106771(%rip)    # 0x109244
incq %rax
incl %ecx
cmpl $0x21, %ecx
jne 0x2ac8
popq %rbx
popq %r14
popq %rbp
jmp 0x2622
movl $0x0, 0x106754(%rip)    # 0x109244
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x10673d(%rip), %rax    # 0x109244
leaq 0x16ab46(%rip), %rcx    # 0x16d654
movb $0x1, 0xa0(%rax,%rcx)
leaq 0x3507(%rip), %rdi      # 0x6024
leaq 0x352d(%rip), %rsi      # 0x6051
callq 0x2260
testq %rax, %rax
je 0x2b58
movq %rax, %rbx
leaq 0x16ab1c(%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 0x34f4(%rip), %rdi      # 0x6053
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2180
// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0x16ab93(%rip), %rcx    # 0x16d718
leaq 0x106ac4(%rip), %rdx    # 0x109650
xorl %eax, %eax
leaq (%rcx,%r14,4), %r12
leaq -0x2800(%r14), %rcx
xorl %r13d, %r13d
cmpl $-0x1, (%r12)
je 0x2bb1
decq %r13
addq $0x4, %r12
cmpq %r13, %rcx
jne 0x2b9c
jmp 0x2c17
movslq 0x16aa98(%rip), %rax    # 0x16d650
leaq (%rax,%rax,4), %rax
movq %r14, %r15
subq %r13, %r15
leaq (%rdx,%rax,8), %rdi
addq $0x8, %rdi
movl %r15d, -0x8(%rdi)
movq %rbx, %rsi
callq 0x20f0
leaq 0x106a73(%rip), %rdx    # 0x109650
leaq 0x16ab34(%rip), %rcx    # 0x16d718
incl 0x16aa66(%rip)          # 0x16d650
movl 0x106654(%rip), %eax    # 0x109244
shll $0xa, %eax
addl 0x176b27(%rip), %eax    # 0x179720
movl %eax, (%r12)
incq %r15
addq $-0x27ff, %r14          # imm = 0xD801
movb $0x1, %al
cmpq %r13, %r14
movq %r15, %r14
jne 0x2b8e
jmp 0x2c1b
testb $0x1, %al
je 0x2c2a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x639f(%rip), %rdi      # 0x8fd0
leaq 0x342e(%rip), %rsi      # 0x6066
movl $0x12, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3402(%rip), %rsi      # 0x6079
leaq -0x3d8(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x23c0
movq 0x633e(%rip), %rdi      # 0x8fd0
leaq 0x33ef(%rip), %rsi      # 0x6088
movl $0x16, %edx
callq 0x2240
movl $0x0, 0x16a9a3(%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 0x10697e(%rip), %r14    # 0x109650
movq 0x62d7(%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 0x2d71
movq %r12, %rdi
movq %r15, %rsi
movl $0x18, %edx
callq 0x2350
movslq 0x16a92c(%rip), %rax    # 0x16d650
leaq (%rax,%rax,4), %rax
leaq (%r14,%rax,8), %rsi
movq %r12, %rdi
callq 0x2120
movslq 0x16a915(%rip), %rcx    # 0x16d650
leaq (%rcx,%rcx,4), %rcx
leaq (%r14,%rcx,8), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x22b0
incl 0x16a8fb(%rip)          # 0x16d650
movq %r12, %rdi
movq %r13, %rsi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x20a0
jmp 0x2cd9
leaq -0x3d8(%rbp), %rdi
callq 0x2060
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2d8f
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 0x2dda
movq %rax, %rbx
jmp 0x2def
jmp 0x2dda
movq %rax, %rbx
movq 0x61f0(%rip), %rsi      # 0x8fb0
leaq -0x1d0(%rbp), %rdi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x20a0
jmp 0x2ddd
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2def
callq 0x21b0
leaq -0x3d8(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x325b(%rip), %rsi      # 0x6079
leaq -0x228(%rbp), %rdi
movl $0x10, %edx
callq 0x2210
movq 0x619a(%rip), %rdi      # 0x8fd0
leaq 0x3262(%rip), %rsi      # 0x609f
movl $0x14, %edx
callq 0x2240
cmpl $0x0, 0x16a802(%rip)    # 0x16d650
jle 0x2ebd
leaq 0x106809(%rip), %r13    # 0x109660
xorl %ebx, %ebx
leaq 0x3254(%rip), %r14      # 0x60b4
leaq 0x34f5(%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 0x16a79c(%rip), %rax    # 0x16d650
addq $0x28, %r13
cmpq %rax, %rbx
jl 0x2e67
leaq -0x228(%rbp), %rdi
callq 0x22e0
movq 0x60f8(%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 0x2f13
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
callq 0x2310
movq %rbx, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O3/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
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x169e10(%rip), %eax    # 0x16d650
testl %eax, %eax
jle 0x392d
xorl %r13d, %r13d
leaq 0x105dfe(%rip), %rcx    # 0x109650
xorl %edx, %edx
movq %rdx, -0x38(%rbp)
movq 0x8(%rbx), %r14
movslq %eax, %r15
leaq (,%r13,4), %rax
addq %r13, %rax
leaq (%rcx,%rax,8), %r12
movq 0x10(%r12), %rdx
cmpq %r14, %rdx
jne 0x388e
testq %rdx, %rdx
je 0x389c
movq (%rbx), %rsi
movq 0x8(%r12), %rdi
callq 0x2200
testl %eax, %eax
je 0x389c
incq %r13
addq $0x28, %r12
cmpq %r15, %r13
jl 0x386e
jmp 0x3907
movl (%r12), %eax
movl %eax, -0x2c(%rbp)
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
movl $0x8, %edx
movq 0x5719(%rip), %r14      # 0x8fd0
movq %r14, %rdi
leaq 0x2822(%rip), %rsi      # 0x60e3
callq 0x2240
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2240
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2a78(%rip), %rsi      # 0x635c
callq 0x2240
movslq 0x169d60(%rip), %rax    # 0x16d650
incq %r13
movb $0x1, %dl
cmpq %rax, %r13
leaq 0x105d51(%rip), %rcx    # 0x109650
jl 0x3854
jmp 0x390d
testb $0x1, -0x38(%rbp)
je 0x392d
movl -0x2c(%rbp), %eax
leaq 0x169e01(%rip), %rcx    # 0x16d718
movl $0xffffffff, (%rcx,%rax,4) # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x569c(%rip), %r14      # 0x8fd0
leaq 0x278e(%rip), %rsi      # 0x60c9
movl $0x6, %edx
movq %r14, %rdi
callq 0x2240
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2240
leaq 0x2772(%rip), %rsi      # 0x60d0
movl $0x12, %edx
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5247(%rip), %rdi      # 0x8fd0
leaq 0x235c(%rip), %rsi      # 0x60ec
movl $0x28, %edx
callq 0x2240
cmpl $0x0, 0x1698af(%rip)    # 0x16d650
jle 0x3e27
leaq 0x1058b2(%rip), %r13    # 0x109660
xorl %r14d, %r14d
movq 0x5218(%rip), %rbx      # 0x8fd0
leaq -0x32c(%rbp), %r15
leaq 0x2352(%rip), %r12      # 0x6118
movq -0x8(%r13), %rsi
movq (%r13), %rdx
movq %rbx, %rdi
callq 0x2240
movl $0x2, %edx
movq %rax, %rdi
leaq 0x2330(%rip), %rsi      # 0x6115
callq 0x2240
movl -0x10(%r13), %esi
movq %r15, %rdi
callq 0x2f2a
movl -0x22c(%rbp), %esi
movq %rbx, %rdi
callq 0x2380
movl $0x8, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2240
incq %r14
movslq 0x169832(%rip), %rax    # 0x16d650
addq $0x28, %r13
cmpq %rax, %r14
jl 0x3dc6
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x55da
movq %r15, %rdi
callq 0x33af
movl %eax, %r14d
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x3e85
callq 0x21b0
cmpl $-0x1, %r14d
je 0x3f11
leaq -0x344(%rbp), %rdi
movl %r14d, %esi
callq 0x2f2a
movl $0x41, %r15d
leaq 0x2276(%rip), %rbx      # 0x6121
leaq 0x10539e(%rip), %r14    # 0x109250
movl -0x344(%rbp,%r15,4), %edi
testl %edi, %edi
je 0x3ee1
callq 0x3187
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
incq %r15
cmpq $0xc1, %r15
jne 0x3eb2
movq 0x50e8(%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 0x3f4f
movq 0x50b8(%rip), %r14      # 0x8fd0
leaq 0x21aa(%rip), %rsi      # 0x60c9
movl $0x6, %edx
movq %r14, %rdi
callq 0x2240
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2240
leaq 0x218e(%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_O3/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 0x55da
movq %r13, %rdi
callq 0x33af
movl %eax, %r12d
movq (%r13), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3fb6
callq 0x21b0
cmpl $-0x1, %r12d
je 0x3ff9
leaq -0x34c(%rbp), %rdi
movl %r12d, %esi
callq 0x2f2a
cmpl $0x1ffff, %r14d         # imm = 0x1FFFF
jle 0x4034
testl %ebx, %ebx
jg 0x4098
movq 0x4fed(%rip), %rdi      # 0x8fd0
leaq 0x213c(%rip), %rsi      # 0x6126
movl $0x12, %edx
callq 0x2240
jmp 0x40b2
movq 0x4fd0(%rip), %rbx      # 0x8fd0
leaq 0x20c2(%rip), %rsi      # 0x60c9
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2240
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x2240
leaq 0x20a6(%rip), %rsi      # 0x60d0
movl $0x12, %edx
jmp 0x40cc
leal 0x3ff(%r14), %eax
testl %r14d, %r14d
cmovnsl %r14d, %eax
sarl $0xa, %eax
movslq %eax, %r13
movl $0x400, %r14d           # imm = 0x400
cmpl %r14d, %ebx
cmovbl %ebx, %r14d
leaq 0x20c5(%rip), %r15      # 0x6121
leaq 0x1051ed(%rip), %r12    # 0x109250
movl -0x248(%rbp,%r13,4), %edi
testl %edi, %edi
je 0x4098
testl %ebx, %ebx
jle 0x3fdc
callq 0x3187
movq %r15, %rdi
movl %r14d, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2050
incq %r13
cmpq $0x80, %r13
jne 0x4063
movq 0x4f31(%rip), %rdi      # 0x8fd0
leaq 0x2093(%rip), %rsi      # 0x6139
movl $0x1c, %edx
callq 0x2240
xorl %ebx, %ebx
movq 0x4f17(%rip), %rdi      # 0x8fd0
movl %ebx, %esi
callq 0x2380
leaq 0x2051(%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
// File: /workspace/github_cpp_makefile_star2_O3/jasperandrew[P]cs350-project2/./classes.cpp
// Function: WriteBuffer::WriteBuffer()
WriteBuffer::WriteBuffer(){
    num_blocks = 0;
    inode_counter = 0;
    for(int i = 0; i < 8; i++){
        seg_summary[i] = new Block(3);
        addBlock(seg_summary[i]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, 0x2000(%rdi)
movl $0x401, %r15d           # imm = 0x401
movl $0x1f10, %edi           # imm = 0x1F10
callq 0x21f0
movq %rax, %r14
movl $0x3, (%rax)
leaq 0xb08(%rax), %rdi
movl $0x408, %edx            # imm = 0x408
xorl %esi, %esi
callq 0x2100
movq %r14, (%rbx,%r15,8)
movslq 0x2000(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x2000(%rbx)
movq %r14, (%rbx,%rax,8)
cmpl $0x400, %ecx            # imm = 0x400
jne 0x4600
movq %rbx, %rdi
callq 0x4644
incq %r15
cmpq $0x409, %r15            # imm = 0x409
jne 0x45b2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jasperandrew[P]cs350-project2/./lab7.h
// Function: Block::writeToSegment()
void writeToSegment(){
            if(type == 0)
                memcpy(mem_segment+(mem_segment_idx++ * BLOCK_SZ), data, BLOCK_SZ);
            else if(type == 1)
                memcpy(mem_segment+(mem_segment_idx++ * BLOCK_SZ), &inode_data, sizeof(inode));
            else if(type == 2)
                memcpy(mem_segment+(mem_segment_idx++ * BLOCK_SZ), block_data, BLOCK_SZ);
            else if(type ==3)
                memcpy(mem_segment+(mem_segment_idx++ * BLOCK_SZ), seg_sum_arr, BLOCK_SZ);
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %eax
cmpq $0x3, %rax
ja 0x54b4
movq %rdi, %rsi
leaq 0xc00(%rip), %rcx       # 0x6004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq 0x103e2c(%rip), %rax    # 0x109240
leal 0x1(%rax), %ecx
movl %ecx, 0x103e23(%rip)    # 0x109240
shlq $0xa, %rax
leaq 0x3e18(%rip), %rdi      # 0x9240
addq %rax, %rdi
addq $0x4, %rsi
jmp 0x547d
movslq 0x103e08(%rip), %rax    # 0x109240
leal 0x1(%rax), %ecx
movl %ecx, 0x103dff(%rip)    # 0x109240
shlq $0xa, %rax
leaq 0x3df4(%rip), %rdi      # 0x9240
addq %rax, %rdi
addq $0x708, %rsi            # imm = 0x708
jmp 0x547d
movslq 0x103de1(%rip), %rax    # 0x109240
leal 0x1(%rax), %ecx
movl %ecx, 0x103dd8(%rip)    # 0x109240
shlq $0xa, %rax
leaq 0x3dcd(%rip), %rdi      # 0x9240
addq %rax, %rdi
addq $0xb0c, %rsi            # imm = 0xB0C
movl $0x400, %edx            # imm = 0x400
jmp 0x54ae
movslq 0x103db5(%rip), %rax    # 0x109240
leal 0x1(%rax), %ecx
movl %ecx, 0x103dac(%rip)    # 0x109240
shlq $0xa, %rax
leaq 0x3da1(%rip), %rdi      # 0x9240
addq %rax, %rdi
addq $0x404, %rsi            # imm = 0x404
movl $0x304, %edx            # imm = 0x304
popq %rbp
jmp 0x2170
popq %rbp
retq