LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::readSticker(char&, std::istream&)
void Rubik::readSticker(char& c, std::istream& is){
   char caracter;
   c = 'f';
   do{
      is >> caracter;
      if( ( tolower(caracter) == 'w') || ( caracter == '1' ) )
         c = 'w';
      else if( ( tolower(caracter) == 'o') || ( caracter == '2' ) )
         c = 'o';
      else if( ( tolower(caracter) == 'g') || ( caracter == '3' ) )
         c = 'g';
      else if( ( tolower(caracter) == 'r') || ( caracter == '4' ) )
         c = 'r';
      else if( ( tolower(caracter) == 'l') || ( caracter == '5' ) )
         c = 'l';
      else if( ( tolower(caracter) == 'y') || ( caracter == '6' ) )
         c = 'y';
      else
         cout << "Invalid char. Try again:\n";
   }while (c == 'f');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movb $0x66, (%rsi)
leaq 0x7(%rsp), %r15
movq 0x6cf2(%rip), %r12      # 0xffc8
leaq 0x34b2(%rip), %r13      # 0xc78f
movq %r14, %rdi
movq %r15, %rsi
callq 0x2210
movsbl 0x7(%rsp), %ebp
movl %ebp, %edi
callq 0x2230
movb $0x77, %cl
cmpl $0x31, %ebp
je 0x9353
cmpl $0x77, %eax
je 0x9353
movb $0x6f, %cl
cmpb $0x32, %bpl
je 0x9353
cmpl $0x6f, %eax
je 0x9353
movb $0x67, %cl
cmpb $0x33, %bpl
je 0x9353
cmpl $0x67, %eax
je 0x9353
movb $0x72, %cl
cmpb $0x34, %bpl
je 0x9353
cmpl $0x72, %eax
je 0x9353
movb $0x6c, %cl
cmpb $0x35, %bpl
je 0x9353
cmpl $0x6c, %eax
je 0x9353
movb $0x79, %cl
cmpb $0x36, %bpl
je 0x9353
cmpl $0x79, %eax
je 0x9353
movq %r12, %rdi
movq %r13, %rsi
callq 0x21b0
cmpb $0x66, (%rbx)
je 0x92dd
jmp 0x9355
movb %cl, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::solve(std::vector<char, std::allocator<char>>&, char const&)
void Rubik::solve(vector<char>& solution, const char &method){
   solution.clear();
   if (method == 'B'){ // Beginners method
     firstStep(solution); // White face
     secondStep(solution); // Middle step
     thirdStep(solution); // Bottom face
   }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x9ca7
movq %rax, 0x8(%rbx)
cmpb $0x42, (%rdx)
jne 0x9cd4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x40f8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x626a
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x7284
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::fileExample()
void Rubik::fileExample(){
  Rubik rubik = Rubik::randomRubik();
  cout << "Input file example:";
  cout << rubik;
  cout << "\nThis file represents this Rubik's cube:\n";
  rubik.printAll();
  cout << "\n\nLetters can be in capital letters, lowercase or number in {1, ... , 6}.";
  cout << "\nEach line is a side of Rubik's cube, the program read from ";
  cout << "left to right and from top to bottom without spaces, tabulator ";
  cout << "or new lines.";
  cout << "\nEach side is read first top three colours, then middle ones, and down colours:";
  cout << endl << "\t1 2 3\n\t4 5 6\n\t7 8 9" << endl;
  cout << "Order: top, left, frontal, right, back and down faces." << endl;
  cout << "Numbers of sequence with green side in front of you are:\n";
  Rubik::printNumbers(cout);
  cout << endl;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
leaq 0x2(%rsp), %r14
movq %r14, %rdi
callq 0x9dd0
movq 0x62d1(%rip), %rbx      # 0xffc8
leaq 0x23ce(%rip), %rsi      # 0xc0cc
movq %rbx, %rdi
callq 0x21b0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9dfa
leaq 0x23c8(%rip), %rsi      # 0xc0e0
movq %rbx, %rdi
callq 0x21b0
movq %r14, %rdi
callq 0x9364
leaq 0x23db(%rip), %rsi      # 0xc10a
movq %rbx, %rdi
callq 0x21b0
leaq 0x2416(%rip), %rsi      # 0xc154
movq %rbx, %rdi
callq 0x21b0
leaq 0x2444(%rip), %rsi      # 0xc191
movq %rbx, %rdi
callq 0x21b0
leaq 0x2475(%rip), %rsi      # 0xc1d1
movq %rbx, %rdi
callq 0x21b0
leaq 0x2474(%rip), %rsi      # 0xc1df
movq %rbx, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x20f0
leaq 0x24ad(%rip), %rsi      # 0xc22f
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x20f0
leaq 0x24ab(%rip), %rsi      # 0xc244
movq %rbx, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x20f0
leaq 0x24cb(%rip), %rsi      # 0xc27b
movq %rbx, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x919c
movq %rbx, %rdi
callq 0x20f0
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::exportSolution(std::ostream&) const
void Rubik::exportSolution(std::ostream& os) const{
   vector<char> solution;
   Rubik aux = *this;
   aux.solve(solution);

   for(unsigned int i=0; i<solution.size(); ++i)
      os << solution[i];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
andq $0x0, 0x10(%r14)
leaq 0x2a(%rsp), %r15
movq %r15, %rdi
callq 0x84de
leaq 0xf(%rsp), %rdx
movb $0x42, (%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x9c90
xorl %r14d, %r14d
movl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
cmpq %r14, %rcx
jbe 0xa37a
movsbl (%rax,%r14), %esi
movq %rbx, %rdi
callq 0x2200
incl %r14d
jmp 0xa353
leaq 0x10(%rsp), %rdi
callq 0x2f90
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0xa390
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2f90
movq %rbx, %rdi
callq 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::printColour(char const&) const
void Rubik::printColour(const char& c) const{
   char colour = tolower(c);

   if (colour == 'w')
      printf(WHITE "W" RESET);
   else if (colour == 'o')
      printf(BLACK "O" RESET);
   else if (colour == 'g')
      printf(GREEN "G" RESET);
   else if (colour == 'r')
      printf(RED "R" RESET);
   else if (colour == 'l')
      printf(BLUE "L" RESET);
   else if (colour == 'y')
      printf(YELLOW "Y" RESET);
}

// Assembly:
pushq %rax
movsbl (%rsi), %edi
callq 0x2230
cmpb $0x67, %al
je 0xa586
movzbl %al, %eax
cmpl $0x6c, %eax
je 0xa57d
cmpl $0x79, %eax
je 0xa560
cmpl $0x72, %eax
je 0xa572
cmpl $0x77, %eax
je 0xa569
cmpl $0x6f, %eax
jne 0xa57b
leaq 0x1f09(%rip), %rdi      # 0xc467
jmp 0xa58d
leaq 0x1f2c(%rip), %rdi      # 0xc493
jmp 0xa58d
leaq 0x1eec(%rip), %rdi      # 0xc45c
jmp 0xa58d
leaq 0x1f04(%rip), %rdi      # 0xc47d
jmp 0xa58d
popq %rax
retq
leaq 0x1f04(%rip), %rdi      # 0xc488
jmp 0xa58d
leaq 0x1ee5(%rip), %rdi      # 0xc472
xorl %eax, %eax
popq %rcx
jmp 0x2030
nop
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::getCorner(int const&) const
Corner Rubik::getCorner(const int& position) const{
   Corner ret;
   ret.up = ret.left = ret.right = 'f';

   if (position >= 0 && position < 8){
      ret.up    = corner[position].up;
      ret.left  = corner[position].left;
      ret.right = corner[position].right;
   }

   return ret;
}

// Assembly:
movl (%rsi), %esi
movb $0x66, %al
movb $0x66, %cl
movb $0x66, %dl
cmpq $0x7, %rsi
ja 0xa924
leaq (%rsi,%rsi,2), %rdx
movb 0x1e(%rdi,%rdx), %al
movb 0x1f(%rdi,%rdx), %cl
movb 0x20(%rdi,%rdx), %dl
movzbl %dl, %edx
shll $0x10, %edx
movzbl %cl, %ecx
shll $0x8, %ecx
orl %edx, %ecx
movzbl %al, %eax
orl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::operator==(Rubik const&)
bool Rubik::operator == (const Rubik& rubik){
   bool equal = true;
   int i;
   if (this != &rubik){
      for (i=0; i<6; ++i){
         if (center[i].center != rubik.getCenter(i).center)
            equal = false;
      }

      for (i=0; i<12 && !equal; ++i){
         if (edge[i].up != rubik.getEdge(i).up ||
             edge[i].down != rubik.getEdge(i).down)
            equal = false;
      }

      for (i=0; i<8 && !equal; ++i){
         if (corner[i].up != rubik.getCorner(i).up     ||
             corner[i].left != rubik.getCorner(i).left ||
             corner[i].right != rubik.getCorner(i).right)
            equal = false;
      }
   }

   return equal;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rsi, %rdi
je 0xaa05
movq %rsi, %r14
movq %rdi, %r15
movb $0x1, %bl
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x6, %rcx
je 0xa971
movb (%r15,%rcx), %dl
cmpb (%r14,%rcx), %dl
movzbl %bl, %ebx
cmovnel %eax, %ebx
incq %rcx
jmp 0xa958
xorl %eax, %eax
cmpq $0xb, %rax
ja 0xa9a8
testb $0x1, %bl
jne 0xa9a8
movsbl 0x6(%r15,%rax,2), %edx
movzwl 0x6(%r14,%rax,2), %ecx
movsbl %cl, %esi
cmpl %edx, %esi
jne 0xa9a1
movsbl 0x7(%r15,%rax,2), %edx
shrl $0x8, %ecx
movsbl %cl, %ecx
cmpl %edx, %ecx
je 0xa9a3
xorl %ebx, %ebx
incq %rax
jmp 0xa973
addq $0x20, %r15
xorl %r13d, %r13d
leaq 0x4(%rsp), %r12
movl %r13d, 0x4(%rsp)
cmpq $0x7, %r13
ja 0xaa07
testb $0x1, %bl
jne 0xaa07
movsbl -0x2(%r15), %ebp
movq %r14, %rdi
movq %r12, %rsi
callq 0xa906
movsbl %al, %ecx
cmpl %ebp, %ecx
jne 0xa9fa
movsbl -0x1(%r15), %ecx
movl %eax, %edx
shrl $0x8, %edx
movsbl %dl, %edx
cmpl %ecx, %edx
jne 0xa9fa
movsbl (%r15), %ecx
shrl $0x10, %eax
movsbl %al, %eax
cmpl %ecx, %eax
je 0xa9fc
xorl %ebx, %ebx
incq %r13
addq $0x3, %r15
jmp 0xa9b4
movb $0x1, %bl
andb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: guide()
void guide(){
   cout << "\tThe rubik's cube will be read from file or keyboard.\n";
   cout << "\tThe standard position for the rubik's cube is: green side in front of you and white side up.\n";

   cout << "\t-W (WHITE, top side)\t-O (ORANGE, left side)\t-G (GREEN, front side)\n";
   cout << "\t-R (RED, right side)" << "\t-L (BLUE, back side)" << "\t-Y (YELLOW, below side)\n";
   cout << "\tIf your rubik's cube has different patterns or colours, look at this:\n\t";
   printf (RED "-Example 1: " RESET);
   cout << "If the center of the left side is red, in all stickers you should select orange.\n\t";
   printf (RED "-Example 2: " RESET);
   cout << "If the center of the back side is black, in your black stickers you should select blue.\n";
   cout << "\tThe program will read 54 colours, one side each time.\n";
   
   Rubik::printNumbers(cout);

   cout << "\tYou can use three different options: \n\t";
   printf (WHITE  "W/w/1, " RESET);
   printf (BLACK  "O/o/2"   RESET " (\"orange\"), ");
   printf (GREEN  "G/g/3, " RESET);
   printf (RED    "R/r/4, " RESET);
   printf (BLUE   "L/l/5, " RESET);
   printf (YELLOW "Y/y/6 "  RESET);
   cout << "\n\tYou will be able to change the colours." << endl;
}

// Assembly:
pushq %rbx
movq 0x5586(%rip), %rbx      # 0xffc8
leaq 0x1dd6(%rip), %rsi      # 0xc81f
movq %rbx, %rdi
callq 0x21b0
leaq 0x1dfe(%rip), %rsi      # 0xc856
movq %rbx, %rdi
callq 0x21b0
leaq 0x1e4e(%rip), %rsi      # 0xc8b5
movq %rbx, %rdi
callq 0x21b0
leaq 0x1e84(%rip), %rsi      # 0xc8fa
movq %rbx, %rdi
callq 0x21b0
leaq 0x1e8b(%rip), %rsi      # 0xc910
movq %rax, %rdi
callq 0x21b0
leaq 0x1e92(%rip), %rsi      # 0xc926
movq %rax, %rdi
callq 0x21b0
leaq 0x1e9d(%rip), %rsi      # 0xc940
movq %rbx, %rdi
callq 0x21b0
leaq 0x1ed7(%rip), %rdi      # 0xc989
xorl %eax, %eax
callq 0x2030
leaq 0x1edf(%rip), %rsi      # 0xc99f
movq %rbx, %rdi
callq 0x21b0
leaq 0x1f23(%rip), %rdi      # 0xc9f2
xorl %eax, %eax
callq 0x2030
leaq 0x1f2b(%rip), %rsi      # 0xca08
movq %rbx, %rdi
callq 0x21b0
leaq 0x1f75(%rip), %rsi      # 0xca61
movq %rbx, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x919c
leaq 0x1f96(%rip), %rsi      # 0xca99
movq %rbx, %rdi
callq 0x21b0
leaq 0x1fb0(%rip), %rdi      # 0xcac2
xorl %eax, %eax
callq 0x2030
leaq 0x1fb3(%rip), %rdi      # 0xcad3
xorl %eax, %eax
callq 0x2030
leaq 0x1fc1(%rip), %rdi      # 0xcaef
xorl %eax, %eax
callq 0x2030
leaq 0x1fc4(%rip), %rdi      # 0xcb00
xorl %eax, %eax
callq 0x2030
leaq 0x1fc7(%rip), %rdi      # 0xcb11
xorl %eax, %eax
callq 0x2030
leaq 0x1fca(%rip), %rdi      # 0xcb22
xorl %eax, %eax
callq 0x2030
leaq 0x1fcc(%rip), %rsi      # 0xcb32
movq %rbx, %rdi
callq 0x21b0
movq %rax, %rdi
popq %rbx
jmp 0x20f0
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: presentation()
void presentation(){
   cout << "\t";
   printf (BT_ON BLUE " #############################################################" RESET "\n");
   cout << "\t -";
   printf (BT_ON "This program solves rubik's cubes 3x3" RESET "\n");
   cout << "\t";
   printf (BT_ON BLUE " #############################################################" RESET "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x5445(%rip), %rbx      # 0xffc8
leaq 0x1f36(%rip), %r14      # 0xcac0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21b0
leaq 0x230e(%rip), %r15      # 0xceaa
movq %r15, %rdi
callq 0x2260
leaq 0x1fb1(%rip), %rsi      # 0xcb5c
movq %rbx, %rdi
callq 0x21b0
leaq 0x22c2(%rip), %rdi      # 0xce7c
callq 0x2260
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21b0
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2260
// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: arguments(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void arguments(string name){
	cout << "Usage: " << name << " [option] [<input_file> [<output_file>]]" << endl;
  cout << "Where options are: \n";
  cout << "\t-e\t explanation of valid <input_file> (same format for <output_file>)\n";
  cout << "\t-h\t print this help and exit\n";
  cout << "\t-i\t interactive mode of resolution, without extra arguments\n";
  cout << "\t-MX\t execute movement X(in {U,u,D,d,L,l,R,r,F,f,B,b}) to cube in <input_file> (modified)";
  cout << "\t-m\t explain movements\n";
  cout << "\t-p\t print cube in human-readable format, need <input_file>";
  cout << "\t-r\t random Rubik's cube solution\n";
  cout << "\t-R\t generate a random Rubik's cube\n";
  cout << "\t-s\t show if a Rubik's cube is solved (y[es]/n[o]), need <input_file>" << endl;    
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x53a5(%rip), %rbx      # 0xffc8
leaq 0x2011(%rip), %rsi      # 0xcc3b
movq %rbx, %rdi
callq 0x21b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2180
leaq 0x1fff(%rip), %rsi      # 0xcc43
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x20f0
leaq 0x2011(%rip), %rsi      # 0xcc6c
movq %rbx, %rdi
callq 0x21b0
leaq 0x2017(%rip), %rsi      # 0xcc81
movq %rbx, %rdi
callq 0x21b0
leaq 0x2050(%rip), %rsi      # 0xccc9
movq %rbx, %rdi
callq 0x21b0
leaq 0x2060(%rip), %rsi      # 0xcce8
movq %rbx, %rdi
callq 0x21b0
leaq 0x208f(%rip), %rsi      # 0xcd26
movq %rbx, %rdi
callq 0x21b0
leaq 0x20da(%rip), %rsi      # 0xcd80
movq %rbx, %rdi
callq 0x21b0
leaq 0x20e3(%rip), %rsi      # 0xcd98
movq %rbx, %rdi
callq 0x21b0
leaq 0x2110(%rip), %rsi      # 0xcdd4
movq %rbx, %rdi
callq 0x21b0
leaq 0x2124(%rip), %rsi      # 0xcdf7
movq %rbx, %rdi
callq 0x21b0
leaq 0x213a(%rip), %rsi      # 0xce1c
movq %rbx, %rdi
callq 0x21b0
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/hkbu-victor[P]SFastLDA/super_fast_final1_d.cpp
// Function: show_help()
void show_help(){
	printf("\nHKBU SuperFast Gibb's sampling for LDA\n");
	printf("\n doc-by-doc LDA modeling\n");
	printf("=====================================\n");
	printf("Command line usage:\n");
	printf("super_fast_final1_d -alpha <double> -beta <double> -ntopics <int> -niters <int> -dfile <string> -seed <int> -ofile <string>\n");
	printf("=====================================\n");
	printf("Parameters \t Type \t\t Descriptions\n");
	printf("-alpha\t\t<double> Hyper-parameter for documents-topic distributions\n");
	printf("-beta\t\t<double> Hyper-parameter for word-topic distributions \n");
	printf("-ntopics\t\t<int> Number of topics \n");
	printf("-niters\t\t<int> Number of Gibbs sampling iterations \n");
	printf("-seed\t\t<int> Random seed \n");
	printf("-dfile\t\t<file> Input training data file \n");
	printf("-ofile\t\t<file> The output WP file and Z file (in text format)\n");
}

// Assembly:
pushq %rbx
leaq 0x308b(%rip), %rdi      # 0x430f
callq 0x1130
leaq 0x30a7(%rip), %rdi      # 0x4337
callq 0x1130
leaq 0x3145(%rip), %rbx      # 0x43e1
movq %rbx, %rdi
callq 0x1130
leaq 0x30a6(%rip), %rdi      # 0x4351
callq 0x1130
leaq 0x30ae(%rip), %rdi      # 0x4365
callq 0x1130
movq %rbx, %rdi
callq 0x1130
leaq 0x313c(%rip), %rdi      # 0x4407
callq 0x1130
leaq 0x3152(%rip), %rdi      # 0x4429
callq 0x1130
leaq 0x3189(%rip), %rdi      # 0x446c
callq 0x1130
leaq 0x31bb(%rip), %rdi      # 0x44aa
callq 0x1130
leaq 0x31d1(%rip), %rdi      # 0x44cc
callq 0x1130
leaq 0x31f9(%rip), %rdi      # 0x4500
callq 0x1130
leaq 0x3207(%rip), %rdi      # 0x451a
callq 0x1130
leaq 0x3224(%rip), %rdi      # 0x4543
popq %rbx
jmp 0x1130
// File: /workspace/github_cpp_makefile_star2_O2/hkbu-victor[P]SFastLDA/super_fast_final1_d.cpp
// Function: parse_args(int, char**)
int parse_args(int argc, char **argv){
	char *arg;

	dFile = NULL; oFile = NULL;
	T = 0; NN = 0; SEED = 0;
	argALPHA = 0.0, BETA = 0.01;

	if (argc < 10){
		show_help();
		return -1;
	}

	int i = 0;
	while (i < argc){
		arg = argv[i];

		if (strcmp(arg,"-dfile")==0){
			dFile = argv[++i];
		} else if (strcmp(arg,"-ofile")==0){
			oFile = argv[++i];
		} else if (strcmp(arg,"-alpha")==0){
			argALPHA = atof(argv[++i]);
		} else if (strcmp(arg,"-beta")==0){
			BETA = atof(argv[++i]);
		} else if (strcmp(arg,"-ntopics")==0){
			T = atoi(argv[++i]);
		} else if (strcmp(arg,"-niters")==0){
			NN = atoi(argv[++i]);
		} else if (strcmp(arg,"-seed")==0){
			SEED = atoi(argv[++i]);
		} else {
            // any more
		}

		i++;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
andq $0x0, 0x4da0(%rip)      # 0x60d8
andq $0x0, 0x4da0(%rip)      # 0x60e0
andl $0x0, 0x4db9(%rip)      # 0x6100
andl $0x0, 0x4db6(%rip)      # 0x6104
andl $0x0, 0x4db3(%rip)      # 0x6108
andq $0x0, 0x4e23(%rip)      # 0x6180
movabsq $0x3f847ae147ae147b, %rax # imm = 0x3F847AE147AE147B
movq %rax, 0x4e1a(%rip)      # 0x6188
cmpl $0xa, %edi
jge 0x1380
callq 0x127c
pushq $-0x1
popq %rax
jmp 0x14d4
movq %rsi, %rbx
movl %edi, %r14d
leaq 0x2c93(%rip), %r15      # 0x4020
xorl %r13d, %r13d
cmpl %r14d, %r13d
jge 0x14d2
movslq %r13d, %r12
movq (%rbx,%r12,8), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1110
testl %eax, %eax
je 0x1452
movq %rbp, %rdi
leaq 0x2c6a(%rip), %rsi      # 0x4027
callq 0x1110
testl %eax, %eax
je 0x1463
movq %rbp, %rdi
leaq 0x2c5a(%rip), %rsi      # 0x402e
callq 0x1110
testl %eax, %eax
je 0x1474
movq %rbp, %rdi
leaq 0x2c4a(%rip), %rsi      # 0x4035
callq 0x1110
testl %eax, %eax
je 0x148b
movq %rbp, %rdi
leaq 0x2c39(%rip), %rsi      # 0x403b
callq 0x1110
testl %eax, %eax
je 0x14a2
movq %rbp, %rdi
leaq 0x2c2b(%rip), %rsi      # 0x4044
callq 0x1110
testl %eax, %eax
je 0x14b7
movq %rbp, %rdi
leaq 0x2c1c(%rip), %rsi      # 0x404c
callq 0x1110
testl %eax, %eax
jne 0x14ca
incl %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x1140
movl %eax, 0x4cb8(%rip)      # 0x6108
jmp 0x14ca
incl %r13d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x4c77(%rip)      # 0x60d8
jmp 0x14ca
incl %r13d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x4c6e(%rip)      # 0x60e0
jmp 0x14ca
incl %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x1100
movsd %xmm0, 0x4cf7(%rip)     # 0x6180
jmp 0x14ca
incl %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x1100
movsd %xmm0, 0x4ce8(%rip)     # 0x6188
jmp 0x14ca
incl %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x1140
movl %eax, 0x4c4b(%rip)      # 0x6100
jmp 0x14ca
incl %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x1140
movl %eax, 0x4c3a(%rip)      # 0x6104
incl %r13d
jmp 0x1390
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/hkbu-victor[P]SFastLDA/super_fast_final1_d.cpp
// Function: eval_ALPHA_W_2_norm()
void eval_ALPHA_W_2_norm(){
    double dtemp;
    for (int wi=0; wi<W; wi++){
        ALPHA_W_2_norm[ wi ] = 0.0;
        wi_idx = wpIdx[wi];
        wi_array = wpVal[wi];
        for (int j=0; j<W_pair_count[wi]; j++){
         	dtemp = (double) wi_array[ wi_idx[j] ] * ALPHA[ wi_idx[j] ];
            ALPHA_W_2_norm[ wi ] += dtemp*dtemp;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x4bf0(%rip), %eax      # 0x6110
movq 0x4ca9(%rip), %rcx      # 0x61d0
movq 0x4cca(%rip), %rdx      # 0x61f8
movq 0x4cbb(%rip), %rsi      # 0x61f0
movq 0x4c3c(%rip), %rdi      # 0x6178
xorl %r8d, %r8d
testl %eax, %eax
cmovlel %r8d, %eax
xorl %r9d, %r9d
cmpq %rax, %r9
je 0x15ad
andq $0x0, (%rcx,%r9,8)
movq (%rdx,%r9,8), %r10
movq %r10, 0x4c8b(%rip)      # 0x61e8
movq (%rsi,%r9,8), %r11
movq %r11, 0x4c78(%rip)      # 0x61e0
movl (%rdi,%r9,4), %ebx
movq 0x4c35(%rip), %r14      # 0x61a8
testl %ebx, %ebx
cmovlel %r8d, %ebx
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x15a8
movslq (%r10,%r15,4), %r12
cvtsi2sdl (%r11,%r12,4), %xmm1
mulsd (%r14,%r12,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%r9,8)
incq %r15
jmp 0x1580
incq %r9
jmp 0x1548
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/hkbu-victor[P]SFastLDA/super_fast_final1_d.cpp
// Function: eval_ONE_OVER_Z_2_norm()
void eval_ONE_OVER_Z_2_norm(){
     double dtemp;
     ONE_OVER_Z_2_norm = 0.0;
     for (int topic=0; topic<T; topic++){
         dtemp = 1.0/(WBETA + (double) ztot[topic]);
         ONE_OVER_Z_2_norm += dtemp*dtemp;
     }
}

// Assembly:
andq $0x0, 0x4b7f(%rip)      # 0x61a0
movl 0x4ad9(%rip), %eax      # 0x6100
movsd 0x4b61(%rip), %xmm0     # 0x6190
movq 0x4af2(%rip), %rcx      # 0x6128
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
xorpd %xmm1, %xmm1
movsd 0x29bf(%rip), %xmm2     # 0x4008
cmpq %rdx, %rax
je 0x1674
cvtsi2sdl (%rcx,%rdx,4), %xmm3
addsd %xmm0, %xmm3
movapd %xmm2, %xmm4
divsd %xmm3, %xmm4
mulsd %xmm4, %xmm4
addsd %xmm4, %xmm1
movsd %xmm1, 0x4b31(%rip)     # 0x61a0
incq %rdx
jmp 0x1649
retq
// File: /workspace/github_cpp_makefile_star2_O2/hkbu-victor[P]SFastLDA/super_fast_final1_d.cpp
// Function: export_results(char*)
int export_results(char *filename)
{
	int i;

	FILE *fh;
	fh = fopen(filename, "w");
    if (fh == NULL){
      printf("\nFile writting error !!!");
      exit (-1);
    }

    for (i=0; i<nTokens; i++){
    	fprintf(fh, "%d %d %d\n", d[ i ] + 1, w[ i ] + 1, z[ i ] + 1);
    }

	fclose(fh);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x1788(%rip), %rsi      # 0x40b4
callq 0x10e0
testq %rax, %rax
je 0x2999
movq %rax, %rbx
leaq 0x178f(%rip), %r14      # 0x40cf
xorl %r15d, %r15d
movslq 0x37d6(%rip), %rax      # 0x6120
cmpq %rax, %r15
jge 0x2989
movq 0x37f2(%rip), %rax      # 0x6148
movl (%rax,%r15,4), %edx
incl %edx
movq 0x37ed(%rip), %rax      # 0x6150
movl (%rax,%r15,4), %ecx
incl %ecx
movq 0x37f8(%rip), %rax      # 0x6168
movl (%rax,%r15,4), %r8d
incl %r8d
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1120
incq %r15
jmp 0x2943
movq %rbx, %rdi
callq 0x10d0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1716(%rip), %rdi      # 0x40b6
xorl %eax, %eax
callq 0x1040
pushq $-0x1
popq %rdi
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/exprtk_montecarlo_pi.cpp
// Function: void monte_carlo_pi<double>()
void monte_carlo_pi()
{
   typedef exprtk::symbol_table<T> symbol_table_t;
   typedef exprtk::expression<T>   expression_t;
   typedef exprtk::parser<T>       parser_t;

   const std::string monte_carlo_pi_program =
      " var max_samples := 5 * 10^7;              "
      " var count       := 0;                     "
      "                                           "
      " for (var i := 0; i < max_samples; i += 1) "
      " {                                         "
      "    if ((rnd_01^2 + rnd_01^2) <= 1)        "
      "       count += 1;                         "
      " };                                        "
      "                                           "
      " (4 * count) / max_samples;                ";

   rnd_01<T> rnd01;

   symbol_table_t symbol_table;
   symbol_table.add_function("rnd_01",rnd01);

   expression_t expression;
   expression.register_symbol_table(symbol_table);

   parser_t parser;
   parser.compile(monte_carlo_pi_program,expression);

   const T approximate_pi = expression.value();

   const T real_pi = T(3.141592653589793238462643383279502); // or close enough...

   printf("pi ~ %20.17f\terror: %20.17f\n",
          approximate_pi,
          std::abs(real_pi - approximate_pi));
}

// Assembly:
pushq %rbx
subq $0xaf0, %rsp            # imm = 0xAF0
leaq 0x12addf(%rip), %rsi    # 0x23b111
leaq 0x30(%rsp), %rdi
leaq 0x1c8(%rsp), %rdx
callq 0x1102e8
leaq 0x50(%rsp), %rdi
callq 0x110566
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x110596
leaq 0x12af5e(%rip), %rsi    # 0x23b2c0
leaq 0x1c8(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x1102e8
leaq 0x8(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x1105ba
leaq 0x1c8(%rsp), %rdi
callq 0x10e5e8
leaq 0x10(%rsp), %rdi
callq 0x11061a
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x11067a
leaq 0x78(%rsp), %rdi
pushq $0x7f
popq %rsi
callq 0x1106d6
leaq 0x1c8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x1107e6
leaq 0x78(%rsp), %rdi
callq 0x110dfe
leaq 0x1c8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x110e46
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movsd 0x125c00(%rip), %xmm1   # 0x236008
subsd %xmm0, %xmm1
andpd 0x125ccc(%rip), %xmm1   # 0x2360e0
leaq 0x12aeac(%rip), %rdi    # 0x23b2c7
movb $0x2, %al
callq 0x10e060
leaq 0x1c8(%rsp), %rdi
callq 0x1112c8
leaq 0x10(%rsp), %rdi
callq 0x111402
leaq 0x8(%rsp), %rdi
callq 0x111418
leaq 0x30(%rsp), %rdi
callq 0x10e5e8
addq $0xaf0, %rsp            # imm = 0xAF0
popq %rbx
retq
jmp 0x110458
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
callq 0x1112c8
jmp 0x11047e
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x110dfe
jmp 0x11047e
jmp 0x11047b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x111402
jmp 0x1104a1
jmp 0x11049e
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
callq 0x10e5e8
jmp 0x1104a1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x111418
jmp 0x1104b2
jmp 0x1104af
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x10e5e8
movq %rbx, %rdi
callq 0x10e310
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH05_Statements/examples/rangefor.cc
// Function: main
int main()
{
	vector<int> ivec;
	vector<int> v = {0,1,2,3,4,5,6,7,8,9};

	// range variable must be a reference so we can write to the elements
	for (auto &r : v)   // for each element in v
		r *= 2;         // double the value of each element in v
	
	// print every element in v
	for (int r : v)
		cout << r << " "; // print the elements in v
	cout << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
xorps %xmm0, %xmm0
andq $0x0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movups 0xda6(%rip), %xmm0      # 0x2014
leaq -0x90(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0xd84(%rip), %xmm0      # 0x2004
movaps %xmm0, (%rsi)
movabsq $0x900000008, %rax      # imm = 0x900000008
movq %rax, 0x20(%rsi)
leaq -0x40(%rbp), %rdi
pushq $0xa
popq %rdx
leaq -0x21(%rbp), %rcx
callq 0x133a
movq -0x40(%rbp), %r15
movq -0x38(%rbp), %r12
movq %r15, %rax
cmpq %r12, %rax
je 0x12b9
shll (%rax)
addq $0x4, %rax
jmp 0x12ac
movq 0x2d18(%rip), %rbx      # 0x3fd8
leaq 0xd65(%rip), %r14       # 0x202c
cmpq %r12, %r15
je 0x12e8
movl (%r15), %esi
movq %rbx, %rdi
callq 0x10f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x10a0
addq $0x4, %r15
jmp 0x12c7
movq 0x2ce9(%rip), %rdi      # 0x3fd8
callq 0x1060
leaq -0x40(%rbp), %rdi
callq 0x137e
leaq -0x60(%rbp), %rdi
callq 0x137e
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x131c
movq %rax, %rbx
jmp 0x1328
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x137e
leaq -0x60(%rbp), %rdi
callq 0x137e
movq %rbx, %rdi
callq 0x1100
nop
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/include/reference.h
// Function: utf8_to_unicode32(unsigned char const*, unsigned long*)
static inline uint32_t utf8_to_unicode32(const uint8_t *c, size_t *index)
{
	uint32_t v;
	int size;
	const uint8_t m6 = 63, m5 = 31, m4 = 15, m3 = 7;

	if (c==NULL)
		return 0;

	size = utf8_char_size(c);

	if (size > 0 && index)
		*index += size-1;

	switch (size)
	{
		case 1:
			v = c[0];
			break;
		case 2:
			v = c[0] & m5;
			v = v << 6 | (c[1] & m6);
			break;
		case 3:
			v = c[0] & m4;
			v = v << 6 | (c[1] & m6);
			v = v << 6 | (c[2] & m6);
			break;
		case 4:
			v = c[0] & m3;
			v = v << 6 | (c[1] & m6);
			v = v << 6 | (c[2] & m6);
			v = v << 6 | (c[3] & m6);
			break;
		case 0:				// not a first UTF-8 byte
		case -1:			// corrupt UTF-8 letter
		default:
			v = -1;
			break;
	}

	return v;
}

// Assembly:
testq %rdi, %rdi
je 0x2cf8
movb (%rdi), %al
testb %al, %al
js 0x2cfb
pushq $0x1
popq %rcx
testq %rsi, %rsi
je 0x2d6c
leal -0x1(%rcx), %eax
addq %rax, (%rsi)
jmp 0x2d6c
xorl %eax, %eax
retq
movl %eax, %ecx
andb $-0x20, %cl
cmpb $-0x40, %cl
jne 0x2d13
movb 0x1(%rdi), %cl
andb $-0x40, %cl
negb %cl
jno 0x2d13
pushq $0x2
jmp 0x2cea
movl %eax, %ecx
andb $-0x10, %cl
cmpb $-0x20, %cl
jne 0x2d35
movb 0x1(%rdi), %cl
andb $-0x40, %cl
negb %cl
jno 0x2d35
movb 0x2(%rdi), %cl
andb $-0x40, %cl
negb %cl
jno 0x2d35
pushq $0x3
jmp 0x2cea
movl %eax, %ecx
andb $-0x8, %cl
cmpb $-0x10, %cl
jne 0x2d61
movb 0x1(%rdi), %cl
andb $-0x40, %cl
negb %cl
jno 0x2d61
movb 0x2(%rdi), %cl
andb $-0x40, %cl
negb %cl
jno 0x2d61
movb 0x3(%rdi), %cl
andb $-0x40, %cl
negb %cl
jno 0x2d61
pushq $0x4
jmp 0x2cea
andb $-0x40, %al
xorl %ecx, %ecx
negb %al
setno %cl
negl %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x2de0
leaq 0x42aa(%rip), %rax      # 0x7024
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movzbl (%rdi), %eax
retq
movzbl (%rdi), %eax
movzbl 0x1(%rdi), %ecx
andl $0xf, %eax
andl $0x3f, %ecx
shll $0xc, %eax
shll $0x6, %ecx
orl %eax, %ecx
movzbl 0x2(%rdi), %eax
jmp 0x2dda
movzbl (%rdi), %eax
movzbl 0x1(%rdi), %ecx
movzbl 0x2(%rdi), %edx
andl $0x7, %eax
andl $0x3f, %ecx
andl $0x3f, %edx
shll $0xc, %eax
shll $0x6, %ecx
orl %eax, %ecx
movzbl 0x3(%rdi), %eax
orl %ecx, %edx
shll $0x6, %edx
andl $0x3f, %eax
orl %edx, %eax
retq
movzbl (%rdi), %ecx
movzbl 0x1(%rdi), %eax
andl $0x1f, %ecx
shll $0x6, %ecx
andl $0x3f, %eax
orl %ecx, %eax
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/src/random_utf16.cpp
// Function: RandomUTF16::RandomUTF16(std::random_device&, int, int, int, int)
RandomUTF16::RandomUTF16(std::random_device& rd, int prob_1byte, int prob_2bytes, int prob_3bytes, int prob_4bytes)
    : gen(rd())
    , utf8_length({double(2*prob_1byte),
                   double(2*prob_2bytes),
                   double(prob_3bytes),
                   double(prob_3bytes),
                   double(2*prob_4bytes)}) {}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq %rsi, %rdi
movl %r9d, %ebp
movl %r8d, %r14d
movl %ecx, %r15d
movl %edx, %r12d
callq 0x21e0
movl %eax, %esi
movq %rbx, %rdi
callq 0x316e
addl %r12d, %r12d
addl %r15d, %r15d
leaq 0x8(%rsp), %rsi
addl %ebp, %ebp
leaq 0x1388(%rbx), %rdi
vmovd %r12d, %xmm0
vpinsrd $0x1, %r15d, %xmm0, %xmm0
vpinsrd $0x2, %r14d, %xmm0, %xmm0
vpshufd $0xa4, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,2]
vcvtdq2pd %xmm0, %ymm0
vmovupd %ymm0, (%rsi)
vcvtsi2sd %ebp, %xmm1, %xmm0
vmovsd %xmm0, 0x20(%rsi)
pushq $0x5
popq %rdx
vzeroupper
callq 0x31e4
vmovaps 0x9099(%rip), %ymm0     # 0xc000
movabsq $0x10ffff00010000, %rax # imm = 0x10FFFF00010000
vmovups %ymm0, 0x13b8(%rbx)
movq %rax, 0x13d8(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/src/random_utf16.cpp
// Function: RandomUTF16::generate(unsigned long)
std::vector<uint16_t> RandomUTF16::generate(size_t count)
{
    std::vector<uint16_t> result;
    result.reserve(count);
    while (result.size() < count) {
        const uint32_t value = generate();
        uint16_t W1;
        uint16_t W2;
        if (utf16::encode(value, W1, W2) == 1)
            result.push_back(W1);
        else {
            result.push_back(W1);
            result.push_back(W2);
        }
    }

    result.push_back(0); // EOS for scalar code

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
andq $0x0, 0x10(%rdi)
vxorps %xmm0, %xmm0, %xmm0
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
vmovups %xmm0, (%rdi)
movq %rdx, %rsi
callq 0x30ba
leaq 0xe(%rsp), %r12
leaq 0xc(%rsp), %r13
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq %rax
cmpq %r14, %rax
jae 0x303f
movq %r15, %rdi
callq 0x2f90
movl %eax, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3bc8
movq %r12, %rsi
cmpl $0x1, %eax
je 0x3035
movq %rbx, %rdi
movq %r12, %rsi
callq 0x314e
movq %r13, %rsi
movq %rbx, %rdi
callq 0x314e
jmp 0x2ffb
leaq 0xa(%rsp), %rsi
andw $0x0, (%rsi)
movq %rbx, %rdi
callq 0x3ae4
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x3067
jmp 0x3067
jmp 0x3067
movq %rbx, %rdi
movq %rax, %r14
callq 0x3972
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/src/scalar_utf16.cpp
// Function: utf16::encode(unsigned int, unsigned short&, unsigned short&)
int encode(uint32_t value, uint16_t& W1, uint16_t& W2) {
        assert(value <= 0xd800 || value > 0xdfff);
        assert(value <= 0x10ffff);
        if (value <= 0xffff) {
            W1 = uint16_t(value);
            return 1;
        } else {
            value -= 0x10000;
            W1 = uint16_t(0xd800 | ((value >> 10) & 0x03ff));
            W2 = uint16_t(0xdc00 | (value & 0x03ff));
            return 2;
        }
    }

// Assembly:
pushq %rax
leal -0xe000(%rdi), %eax
cmpl $0xfffff801, %eax       # imm = 0xFFFFF801
jae 0x3c12
cmpl $0x110000, %edi         # imm = 0x110000
jae 0x3c2b
cmpl $0xffff, %edi           # imm = 0xFFFF
ja 0x3bed
movw %di, (%rsi)
pushq $0x1
jmp 0x3c0f
leal 0xff0000(%rdi), %eax
andl $0x3ff, %edi            # imm = 0x3FF
shrl $0xa, %eax
orl $0xdc00, %edi           # imm = 0xDC00
orl $0xd800, %eax           # imm = 0xD800
movw %ax, (%rsi)
movw %di, (%rdx)
pushq $0x2
popq %rax
popq %rcx
retq
leaq 0x847a(%rip), %rdi      # 0xc093
leaq 0x8495(%rip), %rsi      # 0xc0b5
leaq 0x84a3(%rip), %rcx      # 0xc0ca
pushq $0x9
jmp 0x3c42
leaq 0x84cc(%rip), %rdi      # 0xc0fe
leaq 0x847c(%rip), %rsi      # 0xc0b5
leaq 0x848a(%rip), %rcx      # 0xc0ca
pushq $0xa
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/src/scalar_utf16.cpp
// Function: utf16::test_utf16_encode_and_decode()
void test_utf16_encode_and_decode() {
        uint16_t array[2];
        for (uint32_t v = 0x10000; v <= 0x10ffff; v++) {
            uint32_t decoded = 0;
            const int n = encode(v, array[0], array[1]);

            decode(array, n,
                [&decoded](uint32_t vv) { decoded = vv; },
                [](const uint16_t*, const uint16_t*, Error) { puts("critical error"); abort(); });

            if (decoded != v)
                printf("%06x != %06x\n", v, decoded);
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0x10000, %ebx          # imm = 0x10000
leaq 0x6(%rsp), %r14
leaq 0x4(%rsp), %r15
leaq 0x84aa(%rip), %r12      # 0xc110
cmpl $0x110000, %ebx         # imm = 0x110000
je 0x3cf9
movl %ebx, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3bc8
movl %eax, %eax
leaq 0x4(%rsp,%rax,2), %rax
xorl %edx, %edx
movq %r15, %rsi
cmpq %rax, %rsi
je 0x3ce2
movzwl (%rsi), %edx
movq %rsi, %rcx
addq $0x2, %rsi
leal 0x2000(%rdx), %edi
cmpw $0xf800, %di            # imm = 0xF800
jb 0x3c8b
cmpw $0xdc00, %dx            # imm = 0xDC00
jae 0x3d05
cmpq %rax, %rsi
je 0x3d05
movzwl (%rsi), %esi
leal 0x2000(%rsi), %edi
cmpw $0xfbff, %di            # imm = 0xFBFF
jbe 0x3d05
shll $0xa, %edx
andl $0x3ff, %esi            # imm = 0x3FF
addq $0x4, %rcx
andl $0xffc00, %edx          # imm = 0xFFC00
leal 0x10000(%rdx,%rsi), %edx
movq %rcx, %rsi
jmp 0x3c8b
cmpl %ebx, %edx
je 0x3cf2
movq %r12, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x2040
incl %ebx
jmp 0x3c66
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x3d0a
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/src/pext.cpp
// Function: pext_convert_utf8_to_utf16(unsigned char const*, unsigned long, unsigned short*)
size_t pext_convert_utf8_to_utf16(const uint8_t* input, size_t size, uint16_t* output) {
    uint16_t* output_start = output;
    const uint8_t* end = input + size;
    const uint8_t* curr = input;
    while (curr + 4 < end)
    {
        if (int8_t(*curr) >= 0) {
            *output++ = *curr++;
            continue;
        }

        const auto& entry = pext_lookup[*curr];
        if (entry.utf8_length == 0)
            // wrong leading byte
            abort();

        uint32_t value;
        memcpy(&value, input, 4);
        value = __builtin_bswap32(value);

        if ((entry.utf8_bits_mask) == entry.utf8_bits_expected)
            // wrong encoding
            abort();

        value = _pext_u32(value, entry.pext_mask);

        if (value <= 0xffff) {
            *output++ = static_cast<uint16_t>(value);
        } else {
            value -= 0x10000;
            *output++ = uint16_t(0xd800 | ((value >> 10) & 0x03ff));
            *output++ = uint16_t(0xdc00 | (value & 0x03ff));
            return 2;
        }

        curr += entry.utf8_length;
    }
    
    // TODO process the tail

    return output - output_start;
}

// Assembly:
pushq %rax
addq %rdi, %rsi
leaq 0xbd1d(%rip), %rcx      # 0x10190
xorl %eax, %eax
movq %rdi, %r8
leaq 0x4(%r8), %r9
cmpq %rsi, %r9
jae 0x44d6
movsbl (%r8), %r9d
testw %r9w, %r9w
js 0x4495
incq %r8
movw %r9w, (%rdx,%rax)
jmp 0x44d0
movzbl %r9b, %r10d
shll $0x4, %r10d
movzbl 0xc(%r10,%rcx), %r9d
testq %r9, %r9
je 0x450d
addq %rcx, %r10
movl 0x4(%r10), %r11d
cmpl 0x8(%r10), %r11d
je 0x450d
movbel (%rdi), %r11d
pextl (%r10), %r11d, %r10d
cmpl $0x10000, %r10d         # imm = 0x10000
jae 0x44db
movw %r10w, (%rdx,%rax)
addq %r9, %r8
addq $0x2, %rax
jmp 0x4478
sarq %rax
jmp 0x450b
leal 0xf0000(%r10), %ecx
vpbroadcastw 0x7c55(%rip), %xmm1 # 0xc140
shrl $0xa, %ecx
vmovd %ecx, %xmm0
vpinsrw $0x1, %r10d, %xmm0, %xmm0
vpternlogd $0xea, 0x7c5d(%rip){1to4}, %xmm0, %xmm1 # 0xc160
vmovd %xmm1, (%rdx,%rax)
pushq $0x2
popq %rax
popq %rcx
retq
callq 0x2100
nop
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/benchmarks/benchmark_from_utf8.cpp
// Function: main
int main() {
    // todo: Daniel finds the endless stream of numbers too much
    // Because some schemes use branching, you need to have a sizeable input if you
    // want fair results, given that we repeat the tests many times (we need to account
    // for branch predictors learning the branches).
    std::vector<size_t> input_size{16384};
    for (const size_t size: input_size) {
        Benchmark bench(size);
        bench.run_from_utf8();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x13b8, %rsp           # imm = 0x13B8
leaq 0x28(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq $0x4000, (%rbx)         # imm = 0x4000
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x46c2
movq (%r14), %r15
movq 0x8(%r14), %r12
leaq 0x30(%rsp), %r14
cmpq %r12, %r15
je 0x457d
movq (%r15), %rax
movq %rax, 0x28(%rsp)
movq %r14, %rdi
callq 0x49da
movq %rbx, %rdi
callq 0x46fa
movq %r14, %rdi
callq 0x6562
addq $0x8, %r15
jmp 0x4552
leaq 0x10(%rsp), %rdi
callq 0x65ce
xorl %eax, %eax
addq $0x13b8, %rsp           # imm = 0x13B8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x45a8
movq %r14, %rdi
movq %rax, %rbx
callq 0x6562
leaq 0x10(%rsp), %rdi
callq 0x65ce
movq %rbx, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/benchmarks/event_counter.h
// Function: event_collector::event_collector()
event_collector() : linux_events(vector<int>{
    PERF_COUNT_HW_CPU_CYCLES,
    PERF_COUNT_HW_INSTRUCTIONS,
    PERF_COUNT_HW_BRANCH_MISSES,
    PERF_COUNT_HW_CACHE_REFERENCES,
    PERF_COUNT_HW_CACHE_MISSES
  }) {}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
callq 0x553e
vmovups 0x70cd(%rip), %xmm0     # 0xc180
andq $0x0, 0x20(%rbx)
leaq 0x20(%rsp), %rsi
movl $0x3, 0x10(%rsi)
vmovaps %xmm0, (%rsi)
leaq 0x8(%rsp), %rdi
pushq $0x5
popq %rdx
leaq 0x7(%rsp), %rcx
callq 0x5572
leaq 0x28(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x55aa
leaq 0x8(%rsp), %rdi
callq 0x58b0
addq $0x38, %rsp
popq %rbx
popq %r14
retq
leaq 0x8(%rsp), %rdi
movq %rax, %r14
callq 0x58b0
jmp 0x510c
movq %rax, %r14
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x57ca
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/benchmarks/event_counter.h
// Function: event_collector::end()
inline event_count& end() {
    time_point<steady_clock> end_clock = steady_clock::now();
#if defined(__linux)
    linux_events.end(count.event_counts);
#endif
    count.elapsed = end_clock - start_clock;
    return count;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x21c0
leaq 0x28(%rbx), %rdi
leaq 0x8(%rbx), %rsi
movq %rax, %r14
callq 0x5d56
subq 0x20(%rbx), %r14
movq %rbx, %rax
vcvtsi2sd %r14, %xmm0, %xmm0
vdivsd 0x6e74(%rip), %xmm0, %xmm0 # 0xc168
vmovsd %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/benchmarks/event_counter.h
// Function: event_aggregate::operator<<(event_count const&)
void operator<<(const event_count& other) {
    if (iterations == 0 || other.elapsed < best.elapsed) {
      best = other;
    }
    if (iterations == 0 || other.elapsed > worst.elapsed) {
      worst = other;
    }
    iterations++;
    total += other;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl (%rdi), %eax
movq %rsi, %rbx
movq %rdi, %r14
testl %eax, %eax
je 0x5330
vmovsd 0x28(%r14), %xmm0
vucomisd (%rbx), %xmm0
jbe 0x5343
leaq 0x28(%r14), %rdi
movq %rbx, %rsi
callq 0x5ecc
movl (%r14), %eax
testl %eax, %eax
je 0x534f
vmovsd (%rbx), %xmm0
vucomisd 0x48(%r14), %xmm0
jbe 0x535e
leaq 0x48(%r14), %rdi
movq %rbx, %rsi
callq 0x5ecc
movl (%r14), %eax
incl %eax
movq %rbx, %rsi
movl %eax, (%r14)
addq $0x8, %r14
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5ee8
nop
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/benchmarks/linux-perf-events.h
// Function: LinuxEvents<0>::LinuxEvents(std::vector<int, std::allocator<int>>)
explicit LinuxEvents(std::vector<int> config_vec) : fd(0), working(true) {
    memset(&attribs, 0, sizeof(attribs));
    attribs.type = TYPE;
    attribs.size = sizeof(attribs);
    attribs.disabled = 1;
    attribs.exclude_kernel = 1;
    attribs.exclude_hv = 1;

    attribs.sample_period = 0;
    attribs.read_format = PERF_FORMAT_GROUP | PERF_FORMAT_ID;
    const int pid = 0;  // the current process
    const int cpu = -1; // all CPUs
    const unsigned long flags = 0;

    int group = -1; // no group
    num_events = config_vec.size();
    ids.resize(config_vec.size());
    uint32_t i = 0;
    for (auto config : config_vec) {
      attribs.config = config;
      fd = static_cast<int>(syscall(__NR_perf_event_open, &attribs, pid, cpu, group, flags));
      if (fd == -1) {
        report_error("perf_event_open");
      }
      ioctl(fd, PERF_EVENT_IOC_ID, &ids[i++]);
      if (group == -1) {
        group = fd;
      }
    }

    temp_result_vec.resize(num_events * 2 + 1);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
vxorps %xmm0, %xmm0, %xmm0
andl $0x0, (%rdi)
movq %rdi, %r15
movb $0x1, 0x4(%rdi)
movq %rsi, %rbx
leaq 0x90(%rdi), %rax
addq $0xa8, %rdi
vmovups %zmm0, 0x48(%r15)
vmovups %zmm0, 0x8(%r15)
vmovups %zmm0, 0x80(%r15)
movl $0x80, 0xc(%r15)
movq $0x61, 0x30(%r15)
movq $0xc, 0x28(%r15)
movq %rax, 0x8(%rsp)
movq 0x8(%rsi), %rsi
subq (%rbx), %rsi
sarq $0x2, %rsi
movq %rsi, 0x88(%r15)
movq %rdi, 0x10(%rsp)
vzeroupper
callq 0x593a
movq (%rbx), %r14
movq 0x8(%rbx), %rcx
leaq 0x8(%r15), %rax
movq %rax, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
pushq $-0x1
popq %rbp
leaq 0x28(%rsp), %r13
xorl %ebx, %ebx
cmpq 0x20(%rsp), %r14
je 0x56de
movslq (%r14), %rax
movq 0x18(%rsp), %rsi
movl $0x12a, %edi            # imm = 0x12A
xorl %edx, %edx
movq %rax, 0x10(%r15)
pushq $-0x1
popq %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x2050
movl %eax, (%r15)
cmpl $-0x1, %eax
jne 0x56b0
leaq 0x6cc0(%rip), %rsi      # 0xc34a
leaq 0x7(%rsp), %rdx
movq %r13, %rdi
movq %r13, %r12
callq 0x2090
movq %r15, %rdi
movq %r12, %rsi
callq 0x596c
movq %r12, %rdi
callq 0x20b0
movl (%r15), %eax
movl %ebx, %edx
shlq $0x3, %rdx
addq 0xa8(%r15), %rdx
movl $0x80082407, %esi       # imm = 0x80082407
movl %eax, %edi
xorl %eax, %eax
callq 0x2200
cmpl $-0x1, %ebp
jne 0x56d3
movl (%r15), %ebp
incl %ebx
addq $0x4, %r14
jmp 0x564d
movq 0x88(%r15), %rax
leaq 0x1(%rax,%rax), %rsi
movq 0x8(%rsp), %rdi
callq 0x593a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5707
jmp 0x5707
movq %rax, %rbx
jmp 0x5719
leaq 0x28(%rsp), %rdi
movq %rax, %rbx
callq 0x20b0
movq 0x10(%rsp), %rdi
callq 0x65ce
movq 0x8(%rsp), %rdi
callq 0x65ce
movq %rbx, %rdi
callq 0x22a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/benchmarks/linux-perf-events.h
// Function: LinuxEvents<0>::start()
inline void start() {
    if (fd != -1) {
      if (ioctl(fd, PERF_EVENT_IOC_RESET, PERF_IOC_FLAG_GROUP) == -1) {
        report_error("ioctl(PERF_EVENT_IOC_RESET)");
      }

      if (ioctl(fd, PERF_EVENT_IOC_ENABLE, PERF_IOC_FLAG_GROUP) == -1) {
        report_error("ioctl(PERF_EVENT_IOC_ENABLE)");
      }
    }
  }

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movl (%rdi), %edi
cmpl $-0x1, %edi
je 0x5d31
pushq $0x1
popq %rdx
movl $0x2403, %esi           # imm = 0x2403
xorl %eax, %eax
callq 0x2200
cmpl $-0x1, %eax
jne 0x5cee
leaq 0x6692(%rip), %rsi      # 0xc35a
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2090
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x596c
leaq 0x10(%rsp), %rdi
callq 0x20b0
movl (%rbx), %edi
pushq $0x1
popq %rdx
movl $0x2400, %esi           # imm = 0x2400
xorl %eax, %eax
callq 0x2200
cmpl $-0x1, %eax
jne 0x5d31
leaq 0x666b(%rip), %rsi      # 0xc376
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2090
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x596c
leaq 0x10(%rsp), %rdi
callq 0x20b0
addq $0x30, %rsp
popq %rbx
retq
jmp 0x5d39
leaq 0x10(%rsp), %rdi
movq %rax, %rbx
callq 0x20b0
jmp 0x5d4d
jmp 0x5d4a
movq %rax, %rbx
movq %rbx, %rdi
callq 0x22a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/WojciechMula[P]utf16utf8/benchmarks/linux-perf-events.h
// Function: LinuxEvents<0>::end(std::vector<unsigned long long, std::allocator<unsigned long long>>&)
inline void end(std::vector<unsigned long long> &results) {
    if (fd != -1) {
      if (ioctl(fd, PERF_EVENT_IOC_DISABLE, PERF_IOC_FLAG_GROUP) == -1) {
        report_error("ioctl(PERF_EVENT_IOC_DISABLE)");
      }

      if (read(fd, temp_result_vec.data(), temp_result_vec.size() * 8) == -1) {
        report_error("read");
      }
    }
    // our actual results are in slots 1,3,5, ... of this structure
    // we really should be checking our ids obtained earlier to be safe
    for (uint32_t i = 1; i < temp_result_vec.size(); i += 2) {
      results[i / 2] = temp_result_vec[i];
    }
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl (%rdi), %edi
movq %rsi, %rbx
cmpl $-0x1, %edi
je 0x5dfb
pushq $0x1
popq %rdx
movl $0x2401, %esi           # imm = 0x2401
xorl %eax, %eax
callq 0x2200
cmpl $-0x1, %eax
jne 0x5daf
leaq 0x660a(%rip), %rsi      # 0xc393
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2090
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x596c
leaq 0x8(%rsp), %rdi
callq 0x20b0
movq 0x90(%r14), %rsi
movq 0x98(%r14), %rdx
movl (%r14), %edi
subq %rsi, %rdx
callq 0x2210
cmpq $-0x1, %rax
jne 0x5dfb
leaq 0x65dc(%rip), %rsi      # 0xc3b1
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2090
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x596c
leaq 0x8(%rsp), %rdi
callq 0x20b0
pushq $0x1
popq %rsi
movq 0x90(%r14), %rax
movq 0x98(%r14), %rcx
movq (%rbx), %rdx
subq %rax, %rcx
sarq $0x3, %rcx
movl %esi, %esi
cmpq %rsi, %rcx
jbe 0x5e30
movq (%rax,%rsi,8), %rdi
movl %esi, %r8d
shrl %r8d
addl $0x2, %esi
movq %rdi, (%rdx,%r8,8)
jmp 0x5e16
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x5e3a
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x20b0
jmp 0x5e4e
jmp 0x5e4b
movq %rax, %rbx
movq %rbx, %rdi
callq 0x22a0