LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/yuroitaki[P]enigma_machine/rotor.cpp
// Function: Rotor::store_encrypt(int)
void Rotor::store_encrypt(int rotor_id){
  ifstream input_1,input_2;
  vector<const char*>* buffer_files;
  buffer_files = (config_rot->get_rotor_files());
  int buffer;
  int count = 0;
  
  input_1.open(config_rot->get_file(RP));      //function to read rotor position file
  vector<int> buffer_num;
  while(input_1>>buffer){
    buffer_num.push_back(buffer);
  }
  ground_position = buffer_num[rotor_id];
  input_1.close();

  input_2.open((*buffer_files)[rotor_id]);     //function to read rotor mapping file
  
  while(input_2>>buffer){
    count++;
    if(count < 27){
      forward_encryption.push_back(buffer);
    }else                                       //storing the notch positions
      notch.push_back(buffer);                         
  }
  input_2.close();  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x230(%rsp), %rdi
callq 0x2140
leaq 0x28(%rsp), %rdi
callq 0x2140
movq (%rbx), %rdi
callq 0x3738
movq %rax, %r14
movq (%rbx), %rdi
movl $0x12c, %esi            # imm = 0x12C
callq 0x370c
leaq 0x230(%rsp), %rdi
pushq $0x8
popq %rdx
movq %rax, %rsi
callq 0x20d0
leaq 0x10(%rsp), %r15
andq $0x0, 0x10(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
leaq 0x230(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x20c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3c8a
movq %r15, %rdi
movq %r13, %rsi
callq 0x3760
jmp 0x3c64
movslq %ebp, %r15
movq 0x10(%rsp), %rax
movl (%rax,%r15,4), %eax
movl %eax, 0x50(%rbx)
leaq 0x230(%rsp), %rdi
callq 0x2040
movq (%r14), %rax
movq (%rax,%r15,8), %rsi
leaq 0x28(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x20d0
xorl %r13d, %r13d
leaq 0x28(%rsp), %r14
leaq 0xc(%rsp), %r15
leaq 0x38(%rbx), %r12
addq $0x8, %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x20c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3d04
leal 0x1(%r13), %ebp
cmpl $0x1a, %r13d
movq %r12, %rdi
cmovbq %rbx, %rdi
movq %r15, %rsi
callq 0x3760
movl %ebp, %r13d
jmp 0x3ccf
leaq 0x28(%rsp), %rdi
callq 0x2040
leaq 0x10(%rsp), %rdi
callq 0x2966
leaq 0x28(%rsp), %rdi
callq 0x2050
leaq 0x230(%rsp), %rdi
callq 0x2050
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3d48
movq %rax, %rbx
jmp 0x3d68
movq %rax, %rbx
jmp 0x3d5e
jmp 0x3d51
jmp 0x3d51
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2966
leaq 0x28(%rsp), %rdi
callq 0x2050
leaq 0x230(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/yuroitaki[P]enigma_machine/rotor.cpp
// Function: Rotor::shift_ground(int)
void Rotor::shift_ground(int signal){              
  int len = forward_encryption.size();
  int len_n = notch.size();
  int initial_pos = 0;
  
  if(signal== SETUP){           //signal to differentiate btwn the rotation during initial setup or mapping
    initial_pos = ground_position;
  }
  if(signal== RUN){
    initial_pos = 1;       //the position of the element that is going to be shifted to be the '0th' element
  }
  int shift_space = len - initial_pos;
  vector<int> buffer_forward_encryption = forward_encryption;     
  vector<int> buffer_backward_encryption = backward_encryption;
   
  for(int i=0;i<len;i++){                 //shuffle/shift function
    if(i<initial_pos){           
      forward_encryption[i+shift_space]=buffer_forward_encryption[i];
      backward_encryption[i+shift_space]=buffer_backward_encryption[i];
    }
    else{
      forward_encryption[i-initial_pos] = buffer_forward_encryption[i];
      backward_encryption[i-initial_pos] = buffer_backward_encryption[i];
    } 
  }
  if (signal==RUN){               //to check if notch is reached during mapping
    for(int i=0;i<len_n;i++){
      if(notch[i]==backward_encryption[0]){
	set_notch_stat(true);
      }
      else{
	if(notch_reached != true){ //to prevent the overwriting of notch status by subsequent notch position 
	  set_notch_stat(false);
	}
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x8(%rdi), %rsi
movq 0x8(%rdi), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rdi), %r13
movq 0x40(%rdi), %r12
subq 0x38(%rdi), %r12
movl 0x50(%rdi), %ebp
leaq 0x18(%rsp), %rdi
movq %rsi, 0x10(%rsp)
callq 0x3f66
leaq 0x20(%rbx), %r15
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x3f66
shrq $0x2, %r12
subq 0x8(%rsp), %r13
shrq $0x2, %r13
xorl %eax, %eax
cmpl $-0x1, %r14d
cmovnel %eax, %ebp
cmpl $-0x2, %r14d
pushq $0x1
popq %r8
cmovnel %ebp, %r8d
movl %r13d, %r9d
subl %r8d, %r9d
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rdx
movq (%rdx), %rdx
movq 0x30(%rsp), %rsi
movq (%r15), %rdi
movslq %r8d, %r8
movslq %r9d, %r9
testl %r13d, %r13d
cmovlel %eax, %r13d
movq %r8, %r10
negq %r10
cmpq %rax, %r13
je 0x3e81
cmpq %r8, %rax
movl %r14d, %ebp
movl (%rcx,%rax,4), %r11d
movq %r10, %r14
cmovlq %r9, %r14
addq %rax, %r14
movl %r11d, (%rdx,%r14,4)
movl (%rsi,%rax,4), %r11d
movl %r11d, (%rdi,%r14,4)
movl %ebp, %r14d
incq %rax
jmp 0x3e54
cmpl $-0x2, %r14d
jne 0x3ebf
movq 0x20(%rbx), %rax
movq 0x38(%rbx), %rcx
movb 0x58(%rbx), %sil
xorl %edx, %edx
testl %r12d, %r12d
cmovlel %edx, %r12d
cmpq %rdx, %r12
je 0x3ebf
movl (%rcx,%rdx,4), %r8d
movb $0x1, %dil
cmpl (%rax), %r8d
je 0x3eb4
testb %sil, %sil
jne 0x3eba
xorl %edi, %edi
movb %dil, 0x58(%rbx)
movl %edi, %esi
incq %rdx
jmp 0x3e9c
leaq 0x30(%rsp), %rdi
callq 0x2966
leaq 0x18(%rsp), %rdi
callq 0x2966
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2966
movq %rbx, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/js850[P]lbfgs_cpp/example.cpp
// Function: func2(double*, double*, unsigned long)
double func2(double * x, double * g, size_t N)
{
  size_t i;
  double dot = 0.;
  for (i=0; i<N; ++i) {
    dot += x[i] * x[i];
    g[i] = 2. * x[i];
  }
  return dot;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorpd %xmm0, %xmm0
xorl %eax, %eax
cmpq %rax, %rdx
je 0x12fa
movsd (%rdi,%rax,8), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm0
addsd %xmm1, %xmm1
movsd %xmm1, (%rsi,%rax,8)
incq %rax
jmp 0x12d6
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/js850[P]lbfgs_cpp/example.cpp
// Function: main
int main(){
  int N = 3;
  int M = 4;
  vector<double> x0(N);

  x0[0] = .13;
  x0[1] = 1.23;
  x0[2] = -5.03;

  LBFGS_ns::LBFGS lbfgs(&func2, &x0[0], N, M);
  lbfgs.set_max_iter(30);
  lbfgs.set_iprint(1);
  lbfgs.run();
  
  double const * x = lbfgs.get_x();
  cout << "final result:\n";
  cout << "x: " << x[0] << " " << x[1] << " " << x[2] << "\n";
  cout << "f: " << lbfgs.get_f() << "\n";
  cout << "rms: " << lbfgs.get_rms() << "\n";
  cout << "nfev: " << lbfgs.get_nfev() << "\n";
  cout << "success: " << lbfgs.success() << "\n";

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
leaq -0x28(%rbp), %rbx
pushq $0x3
popq %r14
leaq -0x110(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x151e
movq (%rbx), %rdx
movabsq $0x3fc0a3d70a3d70a4, %rax # imm = 0x3FC0A3D70A3D70A4
movq %rax, (%rdx)
movabsq $0x3ff3ae147ae147ae, %rax # imm = 0x3FF3AE147AE147AE
movq %rax, 0x8(%rdx)
movabsq $-0x3febe147ae147ae1, %rax # imm = 0xC0141EB851EB851F
movq %rax, 0x10(%rdx)
leaq -0x8b(%rip), %rsi       # 0x12cc
leaq -0x110(%rbp), %rdi
pushq $0x4
popq %r8
movq %r14, %rcx
callq 0x187c
movabsq $0x10000001e, %rax      # imm = 0x10000001E
leaq -0x110(%rbp), %rdi
movq %rax, 0x28(%rdi)
callq 0x261e
movq -0xd8(%rbp), %rbx
movq 0x3c46(%rip), %rdi      # 0x4fd8
leaq 0x1c6b(%rip), %rsi      # 0x3004
callq 0x10b0
movq 0x3c33(%rip), %rdi      # 0x4fd8
leaq 0x1c67(%rip), %rsi      # 0x3013
callq 0x10b0
movsd (%rbx), %xmm0
movq %rax, %rdi
callq 0x1100
leaq 0x1e07(%rip), %rsi      # 0x31cb
movq %rax, %rdi
callq 0x10b0
movsd 0x8(%rbx), %xmm0
movq %rax, %rdi
callq 0x1100
leaq 0x1deb(%rip), %rsi      # 0x31cb
movq %rax, %rdi
callq 0x10b0
movsd 0x10(%rbx), %xmm0
movq %rax, %rdi
callq 0x1100
leaq 0x1d50(%rip), %rsi      # 0x314c
movq %rax, %rdi
callq 0x10b0
movq 0x3bcd(%rip), %rdi      # 0x4fd8
leaq 0x1c05(%rip), %rsi      # 0x3017
callq 0x10b0
movsd -0xc0(%rbp), %xmm0
movq %rax, %rdi
callq 0x1100
leaq 0x1d1e(%rip), %rsi      # 0x314c
movq %rax, %rdi
callq 0x10b0
movq 0x3b9b(%rip), %rdi      # 0x4fd8
leaq 0x1bd7(%rip), %rsi      # 0x301b
callq 0x10b0
movsd -0xa0(%rbp), %xmm0
movq %rax, %rdi
callq 0x1100
leaq 0x1cec(%rip), %rsi      # 0x314c
movq %rax, %rdi
callq 0x10b0
movq 0x3b69(%rip), %rdi      # 0x4fd8
leaq 0x1bab(%rip), %rsi      # 0x3021
callq 0x10b0
movl -0xdc(%rbp), %esi
movq %rax, %rdi
callq 0x1140
leaq 0x1cbc(%rip), %rsi      # 0x314c
movq %rax, %rdi
callq 0x10b0
movq 0x3b39(%rip), %rdi      # 0x4fd8
leaq 0x1b82(%rip), %rsi      # 0x3028
callq 0x10b0
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x264c
movzbl %al, %esi
movq %rbx, %rdi
callq 0x1130
leaq 0x1c80(%rip), %rsi      # 0x314c
movq %rax, %rdi
callq 0x10b0
leaq -0x110(%rbp), %rdi
callq 0x1570
leaq -0x28(%rbp), %rdi
callq 0x1666
xorl %eax, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x14fe
movq %rax, %rbx
jmp 0x150d
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x1570
leaq -0x28(%rbp), %rdi
callq 0x1666
movq %rbx, %rdi
callq 0x1150
// File: /workspace/github_cpp_makefile_star2_O2/js850[P]lbfgs_cpp/lbfgs.cpp
// Function: vecdot(std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>)
double vecdot(std::vector<double> const v1, std::vector<double> const v2)
{
  assert(v1.size() == v2.size());
  size_t i;
  double dot = 0.;
  for (i=0; i<v1.size(); ++i) {
    dot += v1[i] * v2[i];
  }
  return dot;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
movq (%rsi), %rdx
movq 0x8(%rsi), %rsi
subq %rdx, %rsi
cmpq %rsi, %rcx
jne 0x17e1
sarq $0x3, %rcx
xorpd %xmm0, %xmm0
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x17df
movsd (%rax,%rsi,8), %xmm1
mulsd (%rdx,%rsi,8), %xmm1
addsd %xmm1, %xmm0
incq %rsi
jmp 0x17c7
popq %rbp
retq
leaq 0x18c8(%rip), %rdi      # 0x30b0
leaq 0x18d8(%rip), %rsi      # 0x30c7
leaq 0x18db(%rip), %rcx      # 0x30d1
pushq $0x1b
popq %rdx
callq 0x1070
// File: /workspace/github_cpp_makefile_star2_O2/js850[P]lbfgs_cpp/lbfgs.cpp
// Function: LBFGS_ns::LBFGS::one_iteration()
void LBFGS::one_iteration()
{
  std::vector<double> x_old = x_;
  std::vector<double> g_old = g_;

  compute_lbfgs_step();

  double stepsize = backtracking_linesearch();

  update_memory(x_old, g_old, x_, g_);
  if ((iprint_ > 0) && (iter_number_ % iprint_ == 0)){
    cout << "lbgs: " << iter_number_ 
      << " f " << f_ 
      << " rms " << rms_
      << " stepsize " << stepsize << "\n";
  }
  iter_number_ += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x38(%rdi), %r14
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x269c
leaq 0x58(%rbx), %r15
leaq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0x269c
movq %rbx, %rdi
callq 0x1d28
movq %rbx, %rdi
callq 0x20c0
movsd %xmm0, -0x20(%rbp)
leaq -0x50(%rbp), %rsi
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rcx
movq %r15, %r8
callq 0x244e
movl 0x2c(%rbx), %ecx
testl %ecx, %ecx
jle 0x1ce3
movl 0x30(%rbx), %eax
cltd
idivl %ecx
testl %edx, %edx
jne 0x1ce3
movq 0x336f(%rip), %rdi      # 0x4fd8
leaq 0x14a5(%rip), %rsi      # 0x3115
callq 0x10b0
movl 0x30(%rbx), %esi
movq %rax, %rdi
callq 0x1140
leaq 0x1495(%rip), %rsi      # 0x311c
movq %rax, %rdi
callq 0x10b0
movsd 0x50(%rbx), %xmm0
movq %rax, %rdi
callq 0x1100
leaq 0x147d(%rip), %rsi      # 0x3120
movq %rax, %rdi
callq 0x10b0
movsd 0x70(%rbx), %xmm0
movq %rax, %rdi
callq 0x1100
leaq 0x1467(%rip), %rsi      # 0x3126
movq %rax, %rdi
callq 0x10b0
movq %rax, %rdi
movsd -0x20(%rbp), %xmm0
callq 0x1100
leaq 0x1471(%rip), %rsi      # 0x314c
movq %rax, %rdi
callq 0x10b0
incl 0x30(%rbx)
leaq -0x38(%rbp), %rdi
callq 0x1666
leaq -0x50(%rbp), %rdi
callq 0x1666
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1d0a
movq %rax, %rbx
jmp 0x1d16
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x1666
leaq -0x50(%rbp), %rdi
callq 0x1666
movq %rbx, %rdi
callq 0x1150
nop
// File: /workspace/github_cpp_makefile_star2_O2/js850[P]lbfgs_cpp/lbfgs.cpp
// Function: LBFGS_ns::LBFGS::run()
void LBFGS::run()
{
  // iterate until the stop criterion is satisfied or maximum number of
  // iterations is reached
  while (iter_number_ < maxiter_)
  {
    if (stop_criterion_satisfied()){
      break;
    }
    one_iteration();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x30(%rbx), %eax
cmpl 0x28(%rbx), %eax
jge 0x2645
movsd 0x10(%rbx), %xmm0
ucomisd 0x70(%rbx), %xmm0
jae 0x2645
movq %rbx, %rdi
callq 0x1bee
jmp 0x2627
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/command.cc
// Function: microshell::core::DiskCommand::handle_child(microshell::core::Shell*)
void DiskCommand::handle_child(Shell *shell) {
  char **argv = util::get_raw_array(this->argv);
  // TODO(andrei) Pass environment to child, while ensuring no shenanigans can
  // take place (no Shellshock risk).
  char **parent_env = nullptr; //environ;
  execve(argv[0], argv, parent_env);
  // Note: 'execve' doesn't return if it's successful.
  shell->eout("Failed to 'execve'. OS says [" + string(strerror(errno))
               + "]. errno = " + to_string(errno));
  shell->eout("Terminating child.");
  exit(-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %rbx
addq $0x8, %rdi
callq 0xc3bd
movq (%rax), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x5390
callq 0x5050
movq %rax, %r14
movl (%rax), %edi
callq 0x50b0
leaq -0x98(%rbp), %rdi
leaq -0x11(%rbp), %rdx
movq %rax, %rsi
callq 0x50d0
leaq 0x747d(%rip), %rsi      # 0xd0af
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rdx
callq 0x60b8
leaq 0x7428(%rip), %rdx      # 0xd074
leaq -0x58(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x5f7f
movl (%r14), %esi
leaq -0x78(%rbp), %rdi
callq 0x60e6
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x6047
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0xa9c4
leaq -0x38(%rbp), %rdi
callq 0x5100
leaq -0x78(%rbp), %rdi
callq 0x5100
leaq -0x58(%rbp), %rdi
callq 0x5100
leaq -0xb8(%rbp), %rdi
callq 0x5100
leaq -0x98(%rbp), %rdi
callq 0x5100
leaq 0x740e(%rip), %rsi      # 0xd0cd
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x50d0
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0xa9c4
leaq -0x38(%rbp), %rdi
callq 0x5100
pushq $-0x1
popq %rdi
callq 0x5270
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
jmp 0x5d39
jmp 0x5d40
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x5100
jmp 0x5d05
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x5100
jmp 0x5d13
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x5100
jmp 0x5d21
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x5100
jmp 0x5d32
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x5100
jmp 0x5d43
movq %rax, %rbx
movq %rbx, %rdi
callq 0x53a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/command.cc
// Function: microshell::core::CdBuiltin::invoke(microshell::core::Shell*)
int CdBuiltin::invoke(Shell *shell) {
  if(argv.size() > 1) {
    string dir = argv[1];
    // TODO(andrei) Centralized code to resolve path.
    // Example: shell->resolve(path)
    // Figures out if path is relative or absolute, resolves ~, .. etc.
    string full_path = util::merge_paths(shell->get_working_directory(), dir);
    if(util::is_directory(full_path)) {
      shell->set_working_directory(full_path);
      return 1;
    }
    else {
      shell->eout("cd: no such directory: " + dir);
      return 0;
    }
  }

  // TODO(andrei) Proper tilde expansion and home folder lookup.
  shell->set_working_directory("~");
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rax
subq %rsi, %rax
cmpq $0x21, %rax
jb 0x5e9a
addq $0x20, %rsi
leaq -0x28(%rbp), %rdi
callq 0x52c0
movq %rbx, %rdi
callq 0xaf30
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rdx
movq %rax, %rsi
callq 0xc1e9
leaq -0x48(%rbp), %rdi
callq 0xc505
testb %al, %al
je 0x5ec8
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0xaf3a
pushq $0x1
popq %rbx
jmp 0x5ef3
leaq 0x726b(%rip), %rsi      # 0xd10c
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x50d0
leaq -0x28(%rbp), %rsi
movq %rbx, %rdi
callq 0xaf3a
leaq -0x28(%rbp), %rdi
callq 0x5100
pushq $0x1
popq %rbx
jmp 0x5f05
leaq 0x7225(%rip), %rsi      # 0xd0f4
leaq -0x68(%rbp), %rdi
leaq -0x28(%rbp), %rdx
callq 0x5fd1
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0xa9c4
leaq -0x68(%rbp), %rdi
callq 0x5100
xorl %ebx, %ebx
leaq -0x48(%rbp), %rdi
callq 0x5100
leaq -0x28(%rbp), %rdi
callq 0x5100
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x5100
jmp 0x5f28
jmp 0x5f25
jmp 0x5f33
movq %rax, %rbx
jmp 0x5f3f
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x5100
jmp 0x5f36
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x5100
movq %rbx, %rdi
callq 0x53a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/./shell.h
// Function: microshell::core::Shell::get()
static Shell* get() {
    if (nullptr == Shell::instance) {
      cerr << "Tried to access shell before initialization." << endl;
      ::exit(-1);
    }

    return Shell::instance;
  }

// Assembly:
leaq 0x11309(%rip), %rax     # 0x17258
movq (%rax), %rax
testq %rax, %rax
je 0x5f58
retq
pushq %rbp
movq %rsp, %rbp
movq 0x1108d(%rip), %rdi     # 0x16ff0
leaq 0x71a7(%rip), %rsi      # 0xd111
callq 0x5200
movq %rax, %rdi
callq 0x5110
pushq $-0x1
popq %rdi
callq 0x5270
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/main.cc
// Function: handler(int)
void handler(int sig) {
  void *array[10];
  size_t size;

  size = backtrace(array, 10);

  fprintf(stderr, "Error: signal %d:\n", sig);
  backtrace_symbols_fd(array, size, STDERR_FILENO);
  exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movl %edi, %ebx
leaq -0x70(%rbp), %r14
pushq $0xa
popq %rsi
movq %r14, %rdi
callq 0x5310
movl %eax, %r15d
movq 0xd36c(%rip), %rax      # 0x16fd0
movq (%rax), %rdi
leaq 0x447e(%rip), %rsi      # 0xe0ec
movl %ebx, %edx
xorl %eax, %eax
callq 0x52e0
pushq $0x2
popq %rdx
movq %r14, %rdi
movl %r15d, %esi
callq 0x5370
pushq $0x1
popq %rdi
callq 0x5270
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/main.cc
// Function: main
int main(int argc, char **argv) {
  // Enable stack traces on crashes.
  signal(SIGSEGV, handler);

  microshell::core::Shell *shell = microshell::core::Shell::initialize(util::argv_to_strvec(argc, argv));
  return shell->interactive();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x6b(%rip), %rsi       # 0x9c3c
pushq $0xb
popq %rdi
callq 0x5260
leaq -0x30(%rbp), %r15
movq %r15, %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0xc15c
movq %r15, %rdi
callq 0x9cfc
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x678c
movq %rbx, %rdi
callq 0xa9ec
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x678c
movq %rbx, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: microshell::core::handle_sigint(int)
void handle_sigint(int signo) {
  // TODO(andrei) This will be invalid for a brief moment between when this
  // signal handler is set up and when the shell initialization finishes.
  Shell *shell = Shell::get();

  if(SIGINT != signo) {
    // TODO(andrei) Signal2name.
    shell->fatal("Signal mismatch.  Expecting SIGINT, got " + to_string(signo));
  }

  if(shell->get_waiting_for_child()) {
    shell->info("C-c while child was running.");
  }
  else {
    shell->info("C-c while NO child was running. Terminating shell.");
    // TODO(andrei) Ensure that we synchronize properly.
    shell->exit();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl %edi, %r14d
callq 0x5f48
movq %rax, %rbx
cmpl $0x2, %r14d
jne 0xa3b6
cmpb $0x1, 0xe8(%rbx)
jne 0xa37a
leaq 0x3fb3(%rip), %rsi      # 0xe309
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x50d0
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0xa478
leaq -0x38(%rbp), %rdi
callq 0x5100
jmp 0xa3ab
leaq 0x3fa5(%rip), %rsi      # 0xe326
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x50d0
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0xa478
leaq -0x38(%rbp), %rdi
callq 0x5100
movq %rbx, %rdi
callq 0xa502
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x58(%rbp), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x60e6
leaq 0x3f14(%rip), %rsi      # 0xe2e0
leaq -0x38(%rbp), %rdi
movq %r15, %rdx
callq 0x60b8
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0xa418
jmp 0xa3e6
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
jmp 0xa40b
jmp 0xa3f1
movq %rax, %rbx
jmp 0xa410
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x5100
jmp 0xa407
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x5100
movq %rbx, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: microshell::core::Shell::exit()
void Shell::exit() {
  if(this->exit_requested) {
    this->fatal("Requested exit twice.");
  }

  // This way, the shell gets a chance to shut down in a clean fashion without
  // having to call `exit()'.
  // TODO(andrei) Test that nothing else is ever run after `exit_requested' is
  // set, no matter where.
  this->exit_requested = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
cmpb $0x1, (%rdi)
je 0xa521
movb $0x1, (%rbx)
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3fe4(%rip), %rsi      # 0xe50c
leaq -0x38(%rbp), %r14
leaq -0x11(%rbp), %rdx
movq %r14, %rdi
callq 0x50d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa418
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x5100
movq %rbx, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: microshell::core::handle_sigtstp(int)
void handle_sigtstp(int signo) {
  Shell *shell = Shell::get();

  if(SIGTSTP != signo) {
    shell->fatal(
      "Signal mismatch.  Expecting SIGTSTP, got " +
      string(strsignal(signo)) +
      "."
    );
  }

  if(shell->get_waiting_for_child()) {
    shell->info("Suspending foreground job.  Use `fg' to continue it in the "
        "foreground, or `bg' to continue it in the background.");
  }

  // Otherwise, we just ignore the signal.
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movl %edi, %r14d
callq 0x5f48
movq %rax, %rbx
cmpl $0x14, %r14d
jne 0xa5ae
cmpb $0x1, 0xe8(%rbx)
jne 0xa5a5
leaq 0x3e00(%rip), %rsi      # 0xe383
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x50d0
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0xa478
leaq -0x38(%rbp), %rdi
callq 0x5100
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl %r14d, %edi
callq 0x53b0
leaq -0x78(%rbp), %rdi
leaq -0x11(%rbp), %rdx
movq %rax, %rsi
callq 0x50d0
leaq 0x3d8c(%rip), %rsi      # 0xe359
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x60b8
leaq 0x3e75(%rip), %rdx      # 0xe456
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x5f7f
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0xa418
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x5100
jmp 0xa60b
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x5100
jmp 0xa619
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
jmp 0xa626
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x5100
jmp 0xa632
jmp 0xa62f
movq %rax, %rbx
movq %rbx, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: microshell::core::Shell::load_default_modules()
int Shell::load_default_modules() {
  this->load_module(
    make_shared<sample_module::SampleModule>(sample_module::SampleModule())
  );
  this->load_module(
    make_shared<job_control::JobControl>(job_control::JobControl())
  );
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0xc209(%rip), %rax      # 0x16b48
addq $0x10, %rax
leaq -0x18(%rbp), %rsi
movq %rax, (%rsi)
leaq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0xb75f
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb668
leaq -0x30(%rbp), %rdi
callq 0x6480
leaq 0xba87(%rip), %rax      # 0x163f8
addq $0x10, %rax
leaq -0x18(%rbp), %rsi
movq %rax, (%rsi)
leaq -0x28(%rbp), %r14
movq %r14, %rdi
callq 0xb875
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb77e
leaq -0x20(%rbp), %rdi
callq 0x6480
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
jmp 0xa9b7
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x6480
movq %rbx, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: microshell::core::Shell::interactive()
int Shell::interactive() {
  while (!exit_requested) {
    string command_text = read_command();
    if(0 == command_text.length()) {
      cout << endl;
      continue;
    }

    shared_ptr<Command> command;
    string error;
    if(parse_command(command_text, command, &error)) {
      interpret_command(*command);
    }
    else {
      eout(error);
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r14
leaq -0x50(%rbp), %rbx
leaq -0x80(%rbp), %r15
leaq -0x40(%rbp), %r13
leaq -0x60(%rbp), %r12
cmpb $0x0, (%r14)
jne 0xaa9b
movq %r15, %rdi
movq %r14, %rsi
callq 0xaad8
cmpq $0x0, -0x78(%rbp)
je 0xaa64
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq %rbx, -0x60(%rbp)
andq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0xab9a
testb %al, %al
je 0xaa72
movq -0x40(%rbp), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x10(%rax)
jmp 0xaa7d
movq 0xc55d(%rip), %rdi      # 0x16fc8
callq 0x5110
jmp 0xaa8e
movq %r14, %rdi
movq %r12, %rsi
callq 0xa9c4
movq %r12, %rdi
callq 0x5100
leaq -0x38(%rbp), %rdi
callq 0x6480
movq %r15, %rdi
callq 0x5100
jmp 0xaa10
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0xaac6
movq %rax, %r14
leaq -0x60(%rbp), %rdi
callq 0x5100
leaq -0x38(%rbp), %rdi
callq 0x6480
leaq -0x80(%rbp), %rdi
callq 0x5100
movq %r14, %rdi
callq 0x53a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: microshell::core::Shell::read_command[abi:cxx11]()
string Shell::read_command() {
  unique_ptr<char> line(readline(get_prompt().c_str()));

  // This happens if e.g. the user enters an EOF character (C-D).
  if(!line) {
    this->exit();
    return "";
  }

  string command(line.get());
  if(command.size() > 0) {
    add_history(line.get());
  }
  return command;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0xb0ba
movq (%r15), %rdi
callq 0x51e0
movq %rax, %r15
movq %rax, -0x20(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5100
testq %r15, %r15
je 0xab35
leaq -0x40(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x50d0
cmpq $0x0, 0x8(%rbx)
je 0xab50
movq -0x20(%rbp), %rdi
callq 0x52b0
jmp 0xab50
movq %r14, %rdi
callq 0xa502
leaq 0x35ba(%rip), %rsi      # 0xe0fe
leaq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x50d0
leaq -0x20(%rbp), %rdi
callq 0xb5b6
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0xab78
jmp 0xab78
movq %rax, %r14
movq %rbx, %rdi
callq 0x5100
jmp 0xab7b
movq %rax, %r14
leaq -0x20(%rbp), %rdi
callq 0xb5b6
jmp 0xab92
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x5100
movq %r14, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: microshell::core::Shell::expand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
string Shell::expand(const string& param) const {
  // TODO(andrei) Variable expansions happen first.

  if(0 == param.find("~")) {
    string rest = param.substr(1);
    return util::merge_paths(home_directory, rest);
  }

  return param;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2299(%rip), %rsi      # 0xd10c
movq %rdx, %rdi
xorl %edx, %edx
callq 0x5410
testq %rax, %rax
je 0xae8f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x52c0
jmp 0xaebf
leaq -0x40(%rbp), %r12
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
callq 0x5220
addq $0x60, %r14
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0xc1e9
leaq -0x40(%rbp), %rdi
callq 0x5100
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x5100
movq %rbx, %rdi
callq 0x53a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: microshell::core::Shell::resolve_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
string Shell::resolve_path(const string& path) const {
  if(util::is_absolute_path(path)) {
    return path;
  }

  // The VFS can handle the `..' sequences, but we want to handle them
  // ourselves in order to display the path in a clearer way.

  return util::merge_paths(working_directory, path);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, %rdi
callq 0xc1b8
testb %al, %al
je 0xaf10
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52c0
jmp 0xaf22
addq $0x40, %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xc1e9
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: microshell::core::Shell::resolve_binary_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*) const
bool Shell::resolve_binary_name(const string& name, string* full_path) const {
  // No lookup needed for absolute paths.
  if(util::is_absolute_path(name)) {
    *full_path = name;
    return true;
  }

  // Search in our current directory.
  {
    string path = util::merge_paths(working_directory, name);
    if(util::is_file(path)) {
      *full_path = path;
      return true;
    }
  }

  // Search the PATH.
  for(const string& p : this->path) {
    string path = util::merge_paths(p, name);
    if(util::is_file(path)) {
      *full_path = path;
      return true;
    }
  }

  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq %rsi, %rdi
callq 0xc1b8
testb %al, %al
je 0xb1ca
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5150
jmp 0xb250
leaq 0x40(%r12), %rsi
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xc1e9
movq %r15, %rdi
callq 0xc4a1
testb %al, %al
je 0xb1f8
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x5150
jmp 0xb247
movq %r15, %rdi
callq 0x5100
movq 0x28(%r12), %r13
movq 0x30(%r12), %r12
cmpq %r12, %r13
je 0xb237
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0xc1e9
movq %r15, %rdi
callq 0xc4a1
testb %al, %al
jne 0xb23b
movq %r15, %rdi
callq 0x5100
addq $0x20, %r13
jmp 0xb20a
xorl %eax, %eax
jmp 0xb252
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x5150
leaq -0x48(%rbp), %rdi
callq 0x5100
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb265
jmp 0xb265
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x5100
movq %rbx, %rdi
callq 0x53a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/shell.cc
// Function: int microshell::core::Shell::load_module<microshell::modules::sample_module::SampleModule>(std::shared_ptr<microshell::modules::sample_module::SampleModule>)
int Shell::load_module(shared_ptr<MODULE_TYPE> module) {
  module->initialize(*this);
  auto builtins = module->get_builtins();
  for(auto bf = builtins.begin(); bf != builtins.end(); ++bf) {
    // TODO(andrei) Use managed memory in builtin registry.
    // TODO(andrei) Builtin factories should know the builtin's name.
    BuiltinRegistry::instance()->register_factory<MODULE_TYPE>(
      (*bf)->get_name(), *bf
    );
  }
  loaded_modules.push_back(module);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
movq (%rbx), %rdi
movq (%rdi), %rax
movq %rsi, -0x38(%rbp)
callq *(%rax)
movq %rbx, -0x30(%rbp)
movq (%rbx), %rsi
movq (%rsi), %rax
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq *0x8(%rax)
movq (%rbx), %r12
leaq -0x68(%rbp), %r15
leaq -0x70(%rbp), %r13
cmpq -0x58(%rbp), %r12
je 0xb6ec
callq 0x6146
movq %rax, %r14
movq (%r12), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x9bfc
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0xbd34
movq %r15, %rdi
callq 0x6480
addq $0x10, %r12
jmp 0xb6aa
movq -0x38(%rbp), %r14
addq $0xd0, %r14
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0xbf84
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbd82
leaq -0x40(%rbp), %rdi
callq 0x6480
leaq -0x60(%rbp), %rdi
callq 0xbd56
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
jmp 0xb744
movq %rax, %rbx
movq %r15, %rdi
callq 0x6480
jmp 0xb74e
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0xbd56
movq %rbx, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/util.cc
// Function: util::argv_to_strvec[abi:cxx11](int, char**)
vector<string> argv_to_strvec(int count, char** const argv) {
    vector<string> vargv;
    for(int i = 0; i < count; ++i) {
      vargv.emplace_back(argv[i]);
    }
    return vargv;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
xorl %r15d, %r15d
testl %esi, %esi
cmovgl %esi, %r15d
subq $0x1, %r15
jb 0xc197
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5bc
addq $0x8, %r14
jmp 0xc180
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x678c
movq %r14, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/util.cc
// Function: util::split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
std::vector<std::string> split(const std::string &s, char delim) {
    std::vector<std::string> elems;
    std::stringstream ss(s);
    std::string item;
    while (std::getline(ss, item, delim)) {
      elems.push_back(item);
    }
    return elems;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movl %edx, %r14d
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq -0x1c8(%rbp), %rdi
pushq $0x18
popq %rdx
callq 0x5350
leaq -0x30(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movsbl %r14b, %r14d
leaq -0x1c8(%rbp), %r15
leaq -0x40(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x53d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xc2c2
movq %rbx, %rdi
movq %r12, %rsi
callq 0xc5f4
jmp 0xc299
leaq -0x40(%rbp), %rdi
callq 0x5100
leaq -0x1c8(%rbp), %rdi
callq 0x5180
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0xc307
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x5100
leaq -0x1c8(%rbp), %rdi
callq 0x5180
movq %rbx, %rdi
callq 0x678c
movq %r14, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/util.cc
// Function: util::merge_with(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<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>>>>> const&, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<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>>>>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string merge_with(const std::vector<std::string>::iterator& start,
                         const std::vector<std::string>::iterator& end,
                         const std::string delimitator) {
    std::stringstream ss;
    for(auto it = start; it != end; ++it) {
      ss << *it;
      if(it + 1 != end) {
        ss << delimitator;
      }
    }

    return ss.str();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq -0x1b0(%rbp), %rdi
callq 0x5170
movq (%r12), %r12
leaq -0x1a0(%rbp), %r13
cmpq (%r15), %r12
je 0xc374
movq %r13, %rdi
movq %r12, %rsi
callq 0x51c0
addq $0x20, %r12
cmpq (%r15), %r12
je 0xc34e
movq %r13, %rdi
movq %r14, %rsi
callq 0x51c0
jmp 0xc34e
leaq -0x198(%rbp), %rsi
movq %rbx, %rdi
callq 0x5340
leaq -0x1b0(%rbp), %rdi
callq 0x5180
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc3a6
movq %rax, %rbx
leaq -0x1b0(%rbp), %rdi
callq 0x5180
movq %rbx, %rdi
callq 0x53a0
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/util.cc
// Function: util::get_raw_array(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>>>> const&)
char** get_raw_array(const std::vector<std::string>& v) {
    char** ret = new char*[v.size() + 1];
    for(size_t i = 0; i < v.size(); ++i) {
      ret[i] = ::strdup(v[i].c_str());
    }
    ret[v.size()] = nullptr;
    return ret;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %r15
movq 0x8(%rdi), %r14
subq %r15, %r14
sarq $0x5, %r14
leaq 0x1(%r14), %rax
shrq $0x3d, %rax
leaq 0x8(,%r14,8), %rcx
xorl %r12d, %r12d
negq %rax
movl $0x0, %edi
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x5030
movq %rax, %rbx
cmpq %r12, %r14
je 0xc419
movq (%r15), %rdi
callq 0x53c0
movq %rax, (%rbx,%r12,8)
incq %r12
addq $0x20, %r15
jmp 0xc3ff
andq $0x0, (%rbx,%r14,8)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/util.cc
// Function: util::getcwd(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool getcwd(std::string *cwd) {
    // Note: PATH_MAX might not be sufficient.
    // See: insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
    static char dir[PATH_MAX];
    if(::getcwd(dir, sizeof(dir))) {
      *cwd = std::string(dir);
      return true;
    }
    
    return false;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0xae2f(%rip), %rdi      # 0x17270
movl $0x1000, %esi           # imm = 0x1000
callq 0x5130
movq %rax, %rbx
testq %rax, %rax
je 0xc47d
leaq 0xae16(%rip), %rsi      # 0x17270
leaq -0x40(%rbp), %r15
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
callq 0x50d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x5290
movq %r15, %rdi
callq 0x5100
testq %rbx, %rbx
setne %al
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/AndreiBarsan[P]uShell/util.cc
// Function: util::get_current_home[abi:cxx11]()
string get_current_home() {
    char* home;
    if(nullptr == (home = ::getenv("HOME"))) {
      home = ::getpwuid(::getuid())->pw_dir;
      return string(home);
    }
    else {
      string ret(home);
      return ret;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2246(%rip), %rdi      # 0xe797
callq 0x5280
testq %rax, %rax
je 0xc567
leaq -0x9(%rbp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
jmp 0xc57e
callq 0x5120
movl %eax, %edi
callq 0x5250
movq 0x20(%rax), %rsi
leaq -0xa(%rbp), %rdx
movq %rbx, %rdi
callq 0x50d0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/szmer[P]brill/./src/corpus.cpp
// Function: Corpus::compare_corpora(Corpus*, Corpus*)
double Corpus::compare_corpora(Corpus * fst, Corpus * sec) {
	if(fst->sentences.size() != sec->sentences.size())
		throw "compare_corpora: unequal number of sentences!";

	int word_count = 0;
	int err_count = 0;

	for(unsigned int si = 0; si < fst->sentences.size(); si++) {
		if(fst->sentences[si].size() != sec->sentences[si].size())
			throw "compare_corpora: unequal size of one of the sentences!";

		word_count += fst->sentences[si].size(); // count each word

		for(unsigned int wi = 0; wi < fst->sentences[si].size(); wi++) // find actual disagreements
			if(fst->sentences[si][wi].tag != sec->sentences[si][wi].tag)
				err_count ++;
	}

	if(word_count == 0)
		throw "compare_corpora: corpora seem to be empty!";

	return ((double)word_count - (double)err_count) / (double)word_count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
movq %rax, %rdx
subq %rcx, %rdx
movq 0x8(%rsi), %rsi
subq (%rbx), %rsi
cmpq %rsi, %rdx
jne 0x25d3
movq %rdi, %r14
xorl %esi, %esi
xorl %r12d, %r12d
xorl %r8d, %r8d
movl %r8d, %r8d
subq %rcx, %rax
cqto
pushq $0x18
popq %rdi
idivq %rdi
cmpq %r8, %rax
jbe 0x2588
movl %esi, -0x2c(%rbp)
movq %r8, -0x40(%rbp)
imulq $0x18, %r8, %r13
movq (%rcx,%r13), %rax
movq 0x8(%rcx,%r13), %rdx
movq %rdx, %r8
subq %rax, %r8
movq (%rbx), %rsi
movq 0x8(%rsi,%r13), %rdi
subq (%rsi,%r13), %rdi
cmpq %rdi, %r8
jne 0x25b0
shrq $0x6, %r8
movq %r8, -0x38(%rbp)
xorl %esi, %esi
movl %esi, %r15d
subq %rax, %rdx
sarq $0x6, %rdx
cmpq %r15, %rdx
jbe 0x2572
movq %r15, %rcx
shlq $0x6, %rcx
leaq (%rax,%rcx), %rdi
addq $0x20, %rdi
movq (%rbx), %rax
movq (%rax,%r13), %rax
leaq (%rax,%rcx), %rsi
addq $0x20, %rsi
callq 0x4d7f
movzbl %al, %eax
addl %eax, %r12d
leal 0x1(%r15), %esi
movq (%r14), %rcx
movq (%rcx,%r13), %rax
movq 0x8(%rcx,%r13), %rdx
jmp 0x2528
movl -0x2c(%rbp), %esi
addl -0x38(%rbp), %esi
movq -0x40(%rbp), %r8
incl %r8d
movq 0x8(%r14), %rax
jmp 0x24d8
testl %esi, %esi
je 0x25e4
cvtsi2sd %esi, %xmm1
cvtsi2sd %r12d, %xmm2
movapd %xmm1, %xmm0
subsd %xmm2, %xmm0
divsd %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x20f0
leaq 0x5abf(%rip), %rcx      # 0x807e
movq %rcx, (%rax)
movq 0x99ff(%rip), %rsi      # 0xbfc8
movq %rax, %rdi
xorl %edx, %edx
callq 0x22b0
pushq $0x8
popq %rdi
callq 0x20f0
leaq 0x5a6e(%rip), %rcx      # 0x8050
jmp 0x25bf
pushq $0x8
popq %rdi
callq 0x20f0
leaq 0x5ac2(%rip), %rcx      # 0x80b5
jmp 0x25bf
nop
// File: /workspace/github_cpp_makefile_star2_O2/szmer[P]brill/./src/corpus.cpp
// Function: Corpus::load_tagset[abi:cxx11](char const*)
vector<string> Corpus::load_tagset(const char* fname) {
	vector<string> tagset;
	ifstream ts_file(fname);

	char buff [256];
	while(ts_file.good()) {

		ts_file.getline(buff, 256);
		if(ts_file.gcount() == 256 && buff[255] != '\0')
			throw "load_tagset: tagset file has a line longer than 256 characters!";
		if(string(buff).size() > 0)
			tagset.push_back(string(buff));
	}

	return tagset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x38(%rbp)
andq $0x0, 0x10(%rdi)
leaq -0x260(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x2300
leaq -0x260(%rbp), %r14
leaq -0x360(%rbp), %r15
leaq -0x58(%rbp), %r12
leaq -0x29(%rbp), %r13
movq -0x260(%rbp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, -0x240(%rbp,%rax)
jne 0x2a2e
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
movq %r15, %rsi
callq 0x2080
cmpq $0x100, -0x258(%rbp) # imm = 0x100
jne 0x29eb
cmpb $0x0, -0x261(%rbp)
jne 0x2a50
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x4d8c
movq -0x50(%rbp), %rbx
movq %r12, %rdi
callq 0x2368
testq %rbx, %rbx
je 0x29b0
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x4d8c
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x61b0
movq %r12, %rdi
callq 0x2368
jmp 0x29b0
leaq -0x260(%rbp), %rdi
callq 0x2060
movq -0x38(%rbp), %rax
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x20f0
leaq 0x5747(%rip), %rcx      # 0x81a6
movq %rcx, (%rax)
movq 0x955f(%rip), %rsi      # 0xbfc8
movq %rax, %rdi
xorl %edx, %edx
callq 0x22b0
movq %rax, %r14
jmp 0x2a9b
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0x2368
jmp 0x2a8f
jmp 0x2a8c
jmp 0x2a8c
jmp 0x2a8c
movq %rax, %r14
leaq -0x260(%rbp), %rdi
callq 0x2060
movq -0x38(%rbp), %rdi
callq 0x4f3e
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/szmer[P]brill/Brill-test.cpp
// Function: main
int main(int argc, char ** argv) {

	if(argc != 4) {
		cout << "Usage: Brill-test CORPUS_FILE TAGSET_FILE TRANSFORMATIONS_FILE" << endl;
		return 1;
	}

	try {
		Corpus base_corp = Corpus::load_file(argv[1]);
		RulesApplier appl(argv[2], argv[3], & base_corp);

		appl.transform(& base_corp); // discard returned corpus, we need only the scores

		cout << "Unigrams: " << appl.baseline_score << endl;
		cout << "Transformations: " << appl.final_score << endl;
	}

	catch(const char * e) {
		cout << e << endl;
		return 1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
cmpl $0x4, %edi
jne 0x4cee
movq %rsi, %rbx
movq 0x8(%rsi), %rsi
leaq -0x58(%rbp), %rdi
callq 0x25f6
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
leaq -0xd0(%rbp), %rdi
leaq -0x58(%rbp), %rcx
callq 0x42ea
leaq -0x118(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x468a
leaq -0x118(%rbp), %rdi
callq 0x4f1e
movq 0x734c(%rip), %rdi      # 0xbfd8
leaq 0x3744(%rip), %rsi      # 0x83d7
callq 0x2180
movsd -0x68(%rbp), %xmm0
movq %rax, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x20e0
movq 0x7324(%rip), %rdi      # 0xbfd8
leaq 0x3727(%rip), %rsi      # 0x83e2
callq 0x2180
movsd -0x60(%rbp), %xmm0
movq %rax, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x20e0
leaq -0xd0(%rbp), %rdi
callq 0x544e
leaq -0x58(%rbp), %rdi
callq 0x4f1e
xorl %eax, %eax
jmp 0x4d0c
movq 0x72e3(%rip), %rdi      # 0xbfd8
leaq 0x369c(%rip), %rsi      # 0x8398
callq 0x2180
movq %rax, %rdi
callq 0x20e0
pushq $0x1
popq %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %rbp
retq
movq %rdx, %r14
movq %rax, %rbx
jmp 0x4d3a
movq %rdx, %r14
movq %rax, %rbx
jmp 0x4d43
movq %rdx, %r14
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x544e
leaq -0x58(%rbp), %rdi
callq 0x4f1e
cmpl $0x1, %r14d
jne 0x4d77
movq %rbx, %rdi
callq 0x20b0
movq 0x7280(%rip), %rdi      # 0xbfd8
movq %rax, %rsi
callq 0x2180
movq %rax, %rdi
callq 0x20e0
callq 0x2280
jmp 0x4d09
movq %rax, %rbx
callq 0x2280
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/rapirent[P]JPEG/./util.h
// Function: read_word_to_bigendian(_IO_FILE*)
uint16_t read_word_to_bigendian(FILE* fp)
{
    byte high,low;
    fread(&high, 1, 1, fp);
    fread(&low, 1, 1, fp);
    word word_value = 0x0000;
    word_value = ((word_value | high) << 8) &0xff00;
    word_value = word_value | low;
    return word_value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x7(%rsp), %r14
pushq $0x1
popq %r15
movq %r14, %rdi
movq %r15, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x51c0
leaq 0x6(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x51c0
movzbl (%r14), %ecx
shll $0x8, %ecx
movzbl (%r12), %eax
orl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq