LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/alexandres[P]terashuf/terashuf.cc
// Function: FenwickTree::FenwickTree(std::vector<unsigned long, std::allocator<unsigned long>> const&)
FenwickTree(const std::vector<ll> &w)
    {
        n = w.size();
        d = int(std::pow(2, std::ceil(std::log2(n)))); // number of intermediates
        S = std::vector<ll>(2 * d, 0);                 // intermediates + leaves
        heapify(w);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
xorl %r15d, %r15d
movq %r15, 0x10(%rdi)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
shrq $0x3, %rax
movl %eax, 0x18(%rdi)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x11f0
callq 0x1040
callq 0x10c0
cvttsd2si %xmm0, %eax
movl %eax, 0x1c(%rbx)
addl %eax, %eax
movslq %eax, %rsi
leaq 0x28(%rsp), %rdx
movq %r15, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x21d0
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x2152
subq %rdi, %rsi
callq 0x1110
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2152
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x1110
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22f0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x217e
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x1110
movq %r14, %rdi
callq 0x11e0
// File: /workspace/github_cpp_makefile_star2_O3/alexandres[P]terashuf/terashuf.cc
// Function: FenwickTree::findIndexAndDraw(unsigned long)
int findIndexAndDraw(ll p)
    {
        // Draw from from sumheap, O(log n) per draw.
        // Use binary search to find the index of the largest cumsum (represented as a
        // heap) value that is less than the probe p.
        ll i = 1;
        while (true)
        {
            S[i]--; // draw
            if (i >= d)
                break;
            // Determine if the value is in the left or right subtree.
            i *= 2;         // Point at left child
            ll left = S[i]; // Cumsum under left subtree.
            if (p > left)
            {              // Value is in right subtree.
                p -= left; // Subtract cumsum from left subtree
                i++;       // Point at right child
            }
        }
        return i - d; // return index after subtracting internal nodes
    }

// Assembly:
movq (%rdi), %rdx
movslq 0x1c(%rdi), %rcx
decq 0x8(%rdx)
movl $0x1, %eax
cmpq $0x2, %rcx
jb 0x21cc
movl $0x1, %eax
xorl %edi, %edi
movq %rax, %r8
shlq $0x4, %r8
movq (%rdx,%r8), %r8
xorl %r9d, %r9d
cmpq %r8, %rsi
seta %r9b
leaq (%r9,%rax,2), %rax
cmovbeq %rdi, %r8
subq %r8, %rsi
decq (%rdx,%rax,8)
cmpq %rcx, %rax
jb 0x21a3
subl %ecx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alexandres[P]terashuf/terashuf.cc
// Function: FenwickTree::heapify(std::vector<unsigned long, std::allocator<unsigned long>> const&)
void heapify(const std::vector<ll> &w)
    {
        // Create sumheap from weights `w` in O(n) time.
        for (int i = 0; i < n; i++)
            S[d + i] = w[i]; // store `w` at leaves.
        for (int i = d - 1; i > 0; i--)
            S[i] = S[2 * i] + S[2 * i + 1];
    }

// Assembly:
movslq 0x18(%rdi), %rcx
testq %rcx, %rcx
jle 0x231f
movq (%rsi), %rdx
movslq 0x1c(%rdi), %rax
movq %rax, %rsi
shlq $0x3, %rsi
addq (%rdi), %rsi
xorl %r8d, %r8d
movq (%rdx,%r8,8), %r9
movq %r9, (%rsi,%r8,8)
incq %r8
cmpq %r8, %rcx
jne 0x230d
jmp 0x2322
movl 0x1c(%rdi), %eax
cmpl $0x2, %eax
jl 0x2354
movq (%rdi), %rcx
movl %eax, %edx
leaq 0x1(%rdx), %rax
shlq $0x4, %rdx
addq %rcx, %rdx
addq $-0x8, %rdx
movq (%rdx), %rsi
addq -0x8(%rdx), %rsi
movq %rsi, -0x10(%rcx,%rax,8)
decq %rax
addq $-0x10, %rdx
cmpq $0x2, %rax
ja 0x233b
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::equivalentNumber(char const&) const
int Rubik::equivalentNumber(const char& c) const{
   int number = 0;
   if (tolower(c) == 'w')
      number = 1;
   else if (tolower(c) == 'o')
      number = 2;
   else if (tolower(c) == 'g')
      number = 3;
   else if (tolower(c) == 'r')
      number = 4;
   else if (tolower(c) == 'l')
      number = 5;
   else if (tolower(c) == 'y')
      number = 6;

  return number;
}

// Assembly:
pushq %rax
movsbl (%rsi), %edi
callq 0x2210
cmpl $0x71, %eax
jg 0x35b6
cmpl $0x67, %eax
je 0x35cc
cmpl $0x6c, %eax
je 0x35de
cmpl $0x6f, %eax
jne 0x35da
movl $0x2, %eax
jmp 0x35ea
cmpl $0x72, %eax
je 0x35d3
cmpl $0x77, %eax
je 0x35e5
cmpl $0x79, %eax
jne 0x35da
movl $0x6, %eax
jmp 0x35ea
movl $0x3, %eax
jmp 0x35ea
movl $0x4, %eax
jmp 0x35ea
xorl %eax, %eax
jmp 0x35ea
movl $0x5, %eax
jmp 0x35ea
movl $0x1, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O3/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::sequence(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<char, std::allocator<char>>&)
void Rubik::sequence(const string& sec, vector<char>& solution){
   for (unsigned int i=0; i<sec.size(); ++i){
      if ( sec[i] == 'R' )
         R(solution);
      else if ( sec[i] == 'r')
         r(solution);
      else if ( sec[i] == 'L')
         L(solution);
      else if ( sec[i] == 'l')
         l(solution);
      else if ( sec[i] == 'D')
         D(solution);
      else if ( sec[i] == 'd')
         d(solution);
      else if ( sec[i] == 'U')
         U(solution);
      else if ( sec[i] == 'u')
         u(solution);
      else if ( sec[i] == 'F')
         F(solution);
      else if ( sec[i] == 'f')
         f(solution);
      else if ( sec[i] == 'B')
         B(solution);
      else if ( sec[i] == 'b')
         b(solution);
      else
        cerr << "Error: invalid movement " << sec[i] << endl;
   }
}

// Assembly:
cmpq $0x0, 0x8(%rsi)
je 0x3eaa
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %r13d
xorl %ebp, %ebp
movq 0xe2b8(%rip), %r12      # 0x11ff0
movq (%r14), %rax
movzbl (%rax,%rbp), %eax
cmpl $0x61, %eax
jg 0x3d74
cmpl $0x4b, %eax
jg 0x3da0
cmpl $0x42, %eax
je 0x3de6
cmpl $0x44, %eax
je 0x3e20
cmpl $0x46, %eax
jne 0x3e54
movq %r15, %rdi
movq %rbx, %rsi
callq 0x42a8
jmp 0x3e8c
cmpl $0x6b, %eax
jg 0x3dc7
cmpl $0x62, %eax
je 0x3df6
cmpl $0x64, %eax
je 0x3e2d
cmpl $0x66, %eax
jne 0x3e54
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4344
jmp 0x3e8c
cmpl $0x4c, %eax
je 0x3e06
cmpl $0x52, %eax
je 0x3e3a
cmpl $0x55, %eax
jne 0x3e54
movq %r15, %rdi
movq %rbx, %rsi
callq 0x41c8
jmp 0x3e8c
cmpl $0x6c, %eax
je 0x3e13
cmpl $0x72, %eax
je 0x3e47
cmpl $0x75, %eax
jne 0x3e54
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4238
jmp 0x3e8c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x43e8
jmp 0x3e8c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x448e
jmp 0x3e8c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3fca
jmp 0x3e8c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4056
jmp 0x3e8c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x40e8
jmp 0x3e8c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4158
jmp 0x3e8c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3eac
jmp 0x3e8c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3f3e
jmp 0x3e8c
movl $0x18, %edx
movq %r12, %rdi
leaq 0x98c6(%rip), %rsi      # 0xd729
callq 0x21d0
movq (%r14), %rax
movb (%rax,%rbp), %al
movb %al, 0x7(%rsp)
movl $0x1, %edx
movq %r12, %rdi
leaq 0x7(%rsp), %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x20b0
movl %r13d, %ebp
incl %r13d
cmpq %rbp, 0x8(%r14)
ja 0x3d38
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::operator=(Rubik const&)
Rubik& Rubik::operator = (const Rubik& rubik){
   if (this != &rubik){
      int i;
      for (i=0; i<6; ++i)
         center[i].center = rubik.getCenter(i).center;

      for (i=0; i<12; ++i){
         edge[i].up   = rubik.getEdge(i).up;
         edge[i].down = rubik.getEdge(i).down;
      }

      for (i=0; i<8; ++i){
         corner[i].up    = rubik.getCorner(i).up;
         corner[i].left  = rubik.getCorner(i).left;
         corner[i].right = rubik.getCorner(i).right;
      }
   }
   return *this;
}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x9602
xorl %ecx, %ecx
movb (%rsi,%rcx), %dl
movb %dl, (%rax,%rcx)
incq %rcx
cmpq $0x6, %rcx
jne 0x95b4
xorl %ecx, %ecx
movb 0x6(%rsi,%rcx,2), %dl
movb %dl, 0x6(%rax,%rcx,2)
movb 0x7(%rsi,%rcx,2), %dl
movb %dl, 0x7(%rax,%rcx,2)
incq %rcx
cmpq $0xc, %rcx
jne 0x95c5
xorl %ecx, %ecx
movb 0x1e(%rsi,%rcx), %dl
movb %dl, 0x1e(%rax,%rcx)
movb 0x1f(%rsi,%rcx), %dl
movb %dl, 0x1f(%rax,%rcx)
movb 0x20(%rsi,%rcx), %dl
movb %dl, 0x20(%rax,%rcx)
addq $0x3, %rcx
cmpq $0x18, %rcx
jne 0x95e0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::mixRubik(int const&)
void Rubik::mixRubik(const int& number){
   int num;
   srand(time(NULL));
   vector<char> cad;
   num = number;
   for (int i=0; i<300; ++i){
      num = 1 + rand()%(12);
      if (num == 1)
         R(cad);
      else if (num == 2)
	      r(cad);
      else if (num == 3)
	      L(cad);
      else if (num == 4)
	      l(cad);
      else if (num == 5)
	      F(cad);
      else if (num == 6)
	      f(cad);
      else if (num == 7)
	      B(cad);
      else if (num == 8)
	      b(cad);
      else if (num == 9)
	      U(cad);
      else if (num == 10)
	      u(cad);
      else if (num == 11)
	      D(cad);
      else if (num == 12)
	      d(cad);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %edi, %edi
callq 0x2150
movl %eax, %edi
callq 0x2160
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movl $0x12c, %ebp            # imm = 0x12C
leaq 0x3dff(%rip), %r15      # 0xd43c
callq 0x2090
cltq
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x21, %rcx
addl %edx, %ecx
shll $0x2, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cmpl $0xb, %eax
ja 0x9712
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3eac
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4158
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42a8
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4238
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3fca
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4056
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x448e
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3f3e
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4344
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x43e8
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40e8
jmp 0x9712
movq %rbx, %rdi
movq %r14, %rsi
callq 0x41c8
decl %ebp
jne 0x963d
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x9730
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x9754
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::printNumbers(std::ostream&)
void Rubik::printNumbers(std::ostream& os){
   os << "                     _______________ \n";
   os << "                     | 01 | 02 | 03 |\n";
   os << "                     _______________ \n";
   os << "                     | 04 | 05 | 06 |\n";
   os << "                     _______________ \n";
   os << "                     | 07 | 08 | 09 |\n";
   os << "    _________________________________________________________________ \n";
   os << "    || 10 | 11 | 12 || 19 | 20 | 21 || 28 | 29 | 30 || 37 | 38 | 39 ||\n";
   os << "    _________________________________________________________________ \n";
   os << "    || 13 | 14 | 15 || 22 | 23 | 24 || 31 | 32 | 33 || 40 | 41 | 42 ||\n";
   os << "    _________________________________________________________________ \n";
   os << "    || 16 | 17 | 18 || 25 | 26 | 27 || 34 | 35 | 36 || 43 | 44 | 45 ||\n";
   os << "    _________________________________________________________________ \n";
   os << "                     | 46 | 47 | 48 |\n";
   os << "                     _______________ \n";
   os << "                     | 49 | 50 | 51 |\n";
   os << "                     _______________ \n";
   os << "                     | 52 | 53 | 54 |\n";
   os << "                     _______________ "<< endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x422f(%rip), %r14      # 0xe49e
movl $0x26, %edx
movq %r14, %rsi
callq 0x21d0
leaq 0x4242(%rip), %rsi      # 0xe4c5
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
movl $0x26, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x4245(%rip), %rsi      # 0xe4ec
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
movl $0x26, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x4248(%rip), %rsi      # 0xe513
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x425b(%rip), %r15      # 0xe53a
movl $0x47, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
leaq 0x428c(%rip), %rsi      # 0xe582
movl $0x47, %edx
movq %rbx, %rdi
callq 0x21d0
movl $0x47, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
leaq 0x42b0(%rip), %rsi      # 0xe5ca
movl $0x47, %edx
movq %rbx, %rdi
callq 0x21d0
movl $0x47, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
leaq 0x42d4(%rip), %rsi      # 0xe612
movl $0x47, %edx
movq %rbx, %rdi
callq 0x21d0
movl $0x47, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
leaq 0x42f8(%rip), %rsi      # 0xe65a
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
movl $0x26, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x42fb(%rip), %rsi      # 0xe681
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
movl $0x26, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x42fe(%rip), %rsi      # 0xe6a8
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x4311(%rip), %rsi      # 0xe6cf
movl $0x25, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2110
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7bb0(%rip), %r12      # 0x11fc8
leaq 0x4370(%rip), %r13      # 0xe78f
movq %r14, %rdi
movq %r15, %rsi
callq 0x21f0
movsbl 0x7(%rsp), %ebp
movl %ebp, %edi
callq 0x2210
movb $0x77, %cl
cmpl $0x31, %ebp
je 0xa49a
cmpl $0x77, %eax
je 0xa49a
movb $0x6f, %cl
cmpb $0x32, %bpl
je 0xa49a
cmpl $0x6f, %eax
je 0xa49a
movb $0x67, %cl
cmpb $0x33, %bpl
je 0xa49a
cmpl $0x67, %eax
je 0xa49a
movb $0x72, %cl
cmpb $0x34, %bpl
je 0xa49a
cmpl $0x72, %eax
je 0xa49a
movb $0x6c, %cl
cmpb $0x35, %bpl
je 0xa49a
cmpl $0x6c, %eax
je 0xa49a
movb $0x79, %cl
cmpb $0x36, %bpl
je 0xa49a
cmpl $0x79, %eax
je 0xa49a
movl $0x19, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x21d0
cmpb $0x66, (%rbx)
je 0xa41f
jmp 0xa49c
movb %cl, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb00f
movq %rax, 0x8(%rbx)
cmpb $0x42, (%rdx)
jne 0xb047
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4554
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5a8c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6d28
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8058
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rsp, %r14
movw $0x6f6c, 0x34(%r14)     # imm = 0x6F6C
movaps 0x24e8(%rip), %xmm0     # 0xd550
movaps %xmm0, (%r14)
movaps 0x24ed(%rip), %xmm0     # 0xd560
movaps %xmm0, 0x20(%r14)
movaps 0x24f1(%rip), %xmm0     # 0xd570
movaps %xmm0, 0x10(%r14)
movl $0x796c7279, 0x30(%r14) # imm = 0x796C7279
movq %r14, %rdi
callq 0x9604
movq 0x6f2d(%rip), %rbx      # 0x11fc8
leaq 0x302a(%rip), %rsi      # 0xe0cc
movl $0x13, %edx
movq %rbx, %rdi
callq 0x21d0
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb250
leaq 0x301f(%rip), %rsi      # 0xe0e0
movl $0x29, %edx
movq %rbx, %rdi
callq 0x21d0
movq %r14, %rdi
callq 0xa4ac
leaq 0x302d(%rip), %rsi      # 0xe10a
movl $0x49, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x3063(%rip), %rsi      # 0xe154
movl $0x3c, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x308c(%rip), %rsi      # 0xe191
movl $0x3f, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x30b8(%rip), %rsi      # 0xe1d1
movl $0xd, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x30b2(%rip), %rsi      # 0xe1df
movl $0x4f, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
leaq 0x30c4(%rip), %rsi      # 0xe22f
movl $0x14, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x309e(%rip), %rsi      # 0xe244
movl $0x36, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x309a(%rip), %rsi      # 0xe27b
movl $0x39, %edx
movq %rbx, %rdi
callq 0x21d0
movq %rbx, %rdi
callq 0xa260
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
addq $0x38, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
leaq 0x32(%rsp), %r15
movq %r15, %rdi
callq 0x95aa
leaq 0xf(%rsp), %rdx
movb $0x42, (%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0xaff8
movq 0x10(%rsp), %rdi
cmpq %rdi, 0x18(%rsp)
je 0xbda3
movl $0x1, %ebp
xorl %eax, %eax
leaq 0xf(%rsp), %r14
movb (%rdi,%rax), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movl %ebp, %eax
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rcx
subq %rdi, %rcx
incl %ebp
cmpq %rax, %rcx
ja 0xbd76
testq %rdi, %rdi
je 0xbdb5
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbdc2
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xbddc
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2210
movzbl %al, %eax
cmpl $0x71, %eax
jg 0xc02d
cmpl $0x67, %eax
je 0xc045
cmpl $0x6c, %eax
je 0xc059
cmpl $0x6f, %eax
jne 0xc057
leaq 0x243c(%rip), %rdi      # 0xe467
jmp 0xc069
cmpl $0x72, %eax
je 0xc04e
cmpl $0x77, %eax
je 0xc062
cmpl $0x79, %eax
jne 0xc057
leaq 0x2450(%rip), %rdi      # 0xe493
jmp 0xc069
leaq 0x2426(%rip), %rdi      # 0xe472
jmp 0xc069
leaq 0x2428(%rip), %rdi      # 0xe47d
jmp 0xc069
popq %rax
retq
leaq 0x2428(%rip), %rdi      # 0xe488
jmp 0xc069
leaq 0x23f3(%rip), %rdi      # 0xe45c
xorl %eax, %eax
popq %rcx
jmp 0x2040
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xc430
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_O3/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:
movb $0x1, %al
cmpq %rsi, %rdi
je 0xc4e4
xorl %ecx, %ecx
xorl %edx, %edx
movb (%rdi,%rdx), %r8b
cmpb (%rsi,%rdx), %r8b
movzbl %al, %eax
cmovnel %ecx, %eax
incq %rdx
cmpq $0x6, %rdx
jne 0xc453
testb $0x1, %al
jne 0xc4a4
xorl %ecx, %ecx
movsbl 0x6(%rdi,%rcx,2), %r8d
movzwl 0x6(%rsi,%rcx,2), %edx
movsbl %dl, %r9d
cmpl %r8d, %r9d
jne 0xc495
movsbl 0x7(%rdi,%rcx,2), %r8d
shrl $0x8, %edx
movsbl %dl, %edx
cmpl %r8d, %edx
je 0xc497
xorl %eax, %eax
cmpq $0xa, %rcx
ja 0xc4a4
incq %rcx
testb $0x1, %al
je 0xc470
testb $0x1, %al
jne 0xc4e4
movl $0x20, %ecx
xorl %edx, %edx
movb -0x2(%rsi,%rcx), %r8b
cmpb -0x2(%rdi,%rcx), %r8b
jne 0xc4d1
movb -0x1(%rsi,%rcx), %r8b
cmpb -0x1(%rdi,%rcx), %r8b
jne 0xc4d1
movb (%rsi,%rcx), %r8b
cmpb (%rdi,%rcx), %r8b
je 0xc4d3
xorl %eax, %eax
cmpq $0x6, %rdx
ja 0xc4e4
incq %rdx
addq $0x3, %rcx
testb $0x1, %al
je 0xc4af
andb $0x1, %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5841(%rip), %rbx      # 0x11fc8
leaq 0x24ad(%rip), %rsi      # 0xec3b
movl $0x7, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x248f(%rip), %rsi      # 0xec43
movl $0x28, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x247d(%rip), %rsi      # 0xec6c
movl $0x14, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x247e(%rip), %rsi      # 0xec81
movl $0x47, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x24b2(%rip), %rsi      # 0xecc9
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x24bd(%rip), %rsi      # 0xece8
movl $0x3d, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x24e7(%rip), %rsi      # 0xed26
movl $0x59, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x252d(%rip), %rsi      # 0xed80
movl $0x17, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x2531(%rip), %rsi      # 0xed98
movl $0x3b, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x2559(%rip), %rsi      # 0xedd4
movl $0x22, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x2568(%rip), %rsi      # 0xedf7
movl $0x24, %edx
movq %rbx, %rdi
callq 0x21d0
leaq 0x2579(%rip), %rsi      # 0xee1c
movl $0x45, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/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:
movslq 0x4beb(%rip), %rax      # 0x6118
testq %rax, %rax
jle 0x15c5
pushq %r15
pushq %r14
pushq %rbx
movq 0x4c96(%rip), %rcx      # 0x61d8
movq 0x4cb7(%rip), %rdx      # 0x6200
movq 0x4ca8(%rip), %rsi      # 0x61f8
movq 0x4c29(%rip), %rdi      # 0x6180
movq 0x4c52(%rip), %r8       # 0x61b0
xorl %r9d, %r9d
movq $0x0, (%rcx,%r9,8)
movq (%rdx,%r9,8), %r10
movq %r10, 0x4c7c(%rip)      # 0x61f0
movq (%rsi,%r9,8), %r11
movq %r11, 0x4c69(%rip)      # 0x61e8
movslq (%rdi,%r9,4), %rbx
testq %rbx, %rbx
jle 0x15b8
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movslq (%r10,%r14,4), %r15
xorps %xmm1, %xmm1
cvtsi2sdl (%r11,%r15,4), %xmm1
mulsd (%r8,%r15,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%r9,8)
incq %r14
cmpq %r14, %rbx
jne 0x158f
incq %r9
cmpq %rax, %r9
jne 0x1561
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
movq $0x0, 0x4b6e(%rip) # 0x61a8
movslq 0x4ac7(%rip), %rax      # 0x6108
testq %rax, %rax
jle 0x168f
movsd 0x4b4a(%rip), %xmm1     # 0x6198
xorpd %xmm0, %xmm0
movq 0x4ad7(%rip), %rcx      # 0x6130
xorl %edx, %edx
movsd 0x29a5(%rip), %xmm2     # 0x4008
xorps %xmm3, %xmm3
cvtsi2sdl (%rcx,%rdx,4), %xmm3
addsd %xmm1, %xmm3
movapd %xmm2, %xmm4
divsd %xmm3, %xmm4
mulsd %xmm4, %xmm4
addsd %xmm4, %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0x1663
movsd %xmm0, 0x4b19(%rip)     # 0x61a8
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1268(%rip), %rsi      # 0x40e4
callq 0x10f0
testq %rax, %rax
je 0x2ef0
movq %rax, %rbx
cmpl $0x0, 0x3298(%rip)      # 0x6128
jle 0x2ee0
leaq 0x1266(%rip), %r14      # 0x40ff
xorl %r15d, %r15d
movq 0x32ad(%rip), %rax      # 0x6150
movl (%rax,%r15,4), %edx
incl %edx
movq 0x32a8(%rip), %rax      # 0x6158
movl (%rax,%r15,4), %ecx
incl %ecx
movq 0x32b3(%rip), %rax      # 0x6170
movl (%rax,%r15,4), %r8d
incl %r8d
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1130
incq %r15
movslq 0x324d(%rip), %rax      # 0x6128
cmpq %rax, %r15
jl 0x2e9c
movq %rbx, %rdi
callq 0x10e0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x11ef(%rip), %rdi      # 0x40e6
xorl %eax, %eax
callq 0x1040
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2f0d
movb (%rdi), %al
movl $0x1, %ecx
testb %al, %al
js 0x2f10
testq %rsi, %rsi
je 0x2f84
leal -0x1(%rcx), %eax
addq %rax, (%rsi)
jmp 0x2f84
xorl %eax, %eax
retq
movl %eax, %ecx
andb $-0x20, %cl
cmpb $-0x40, %cl
jne 0x2f29
movb 0x1(%rdi), %dl
movl $0x2, %ecx
andb $-0x40, %dl
negb %dl
jo 0x2f00
movl %eax, %ecx
andb $-0x10, %cl
cmpb $-0x20, %cl
jne 0x2f4c
movb 0x1(%rdi), %cl
andb $-0x40, %cl
negb %cl
jno 0x2f4c
movb 0x2(%rdi), %dl
movl $0x3, %ecx
andb $-0x40, %dl
negb %dl
jo 0x2f00
movl %eax, %ecx
andb $-0x8, %cl
cmpb $-0x10, %cl
jne 0x2f79
movb 0x1(%rdi), %cl
andb $-0x40, %cl
negb %cl
jno 0x2f79
movb 0x2(%rdi), %cl
andb $-0x40, %cl
negb %cl
jno 0x2f79
movb 0x3(%rdi), %dl
movl $0x4, %ecx
andb $-0x40, %dl
negb %dl
jo 0x2f00
andb $-0x40, %al
xorl %ecx, %ecx
negb %al
setno %cl
negl %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x2ff8
leaq 0x5092(%rip), %rax      # 0x8024
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 0x2ff2
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
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2220
movl $0x1, %ecx
movl %eax, %eax
movq %rax, (%rbx)
movq %rax, %rdx
shrq $0x1e, %rdx
xorl %eax, %edx
imull $0x6c078965, %edx, %eax # imm = 0x6C078965
addl %ecx, %eax
movq %rax, (%rbx,%rcx,8)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0x302d
addl %r12d, %r12d
addl %r15d, %r15d
leaq 0x8(%rsp), %rsi
addl %ebp, %ebp
movq $0x270, 0x1380(%rbx) # imm = 0x270
leaq 0x1388(%rbx), %rdi
movl $0x5, %edx
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)
vzeroupper
callq 0x3332
vmovaps 0x9f57(%rip), %ymm0     # 0xd000
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_O3/WojciechMula[P]utf16utf8/src/random_utf16.cpp
// Function: RandomUTF16::generate()
uint32_t RandomUTF16::generate() {
    switch (utf8_length(gen)) {
        case 0: return val_1byte(gen);
        case 1: return val_2bytes(gen);
        case 2: return val_3bytes_a(gen);
        case 3: return val_3bytes_b(gen);
        case 4: return val_4bytes(gen);
        default:
            return val_1byte(gen);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x1388, %rdi           # imm = 0x1388
movq %rbx, %rsi
movq %rdi, %rdx
callq 0x37ac
decl %eax
movl $0x13b8, %edi           # imm = 0x13B8
movq %rbx, %rsi
cmpl $0x4, %eax
leaq 0x13c0(,%rax,8), %rax
cmovbq %rax, %rdi
addq %rbx, %rdi
movq %rdi, %rdx
popq %rbx
jmp 0x3ada
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
vxorps %xmm0, %xmm0, %xmm0
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq $0x0, 0x10(%rdi)
vmovups %xmm0, (%rdi)
movq %rdx, %rsi
callq 0x3298
movq 0x8(%rbx), %rsi
movq %rsi, %rax
subq (%rbx), %rax
sarq %rax
cmpq %r14, %rax
jae 0x31f1
leaq 0xa(%rsp), %r12
leaq 0xe(%rsp), %r13
movq %r15, %rdi
callq 0x30d2
movl %eax, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3dd0
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rcx
cmpl $0x1, %eax
jne 0x318a
cmpq %rcx, %rsi
je 0x31a1
movzwl 0xa(%rsp), %eax
jmp 0x31c3
cmpq %rcx, %rsi
je 0x31a6
movzwl 0xa(%rsp), %eax
movw %ax, (%rsi)
addq $0x2, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x31b9
movq %r12, %rdx
jmp 0x31d3
movq %rbx, %rdi
movq %r12, %rdx
callq 0x3be4
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rcx
cmpq %rcx, %rsi
je 0x31d0
movzwl 0xe(%rsp), %eax
movw %ax, (%rsi)
addq $0x2, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x31db
movq %r13, %rdx
movq %rbx, %rdi
callq 0x3be4
movq 0x8(%rbx), %rsi
movq %rsi, %rax
subq (%rbx), %rax
sarq %rax
cmpq %r14, %rax
jb 0x315c
movw $0x0, 0xc(%rsp)
cmpq 0x10(%rbx), %rsi
je 0x320d
movw $0x0, (%rsi)
addq $0x2, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x321a
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0x3cfa
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x3231
jmp 0x3231
jmp 0x3231
movq (%rbx), %rdi
movq %rax, %r14
testq %rdi, %rdi
je 0x3248
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3e1f
cmpl $0x110000, %edi         # imm = 0x110000
jae 0x3e3e
cmpl $0xffff, %edi           # imm = 0xFFFF
ja 0x3df8
movw %di, (%rsi)
movl $0x1, %eax
jmp 0x3e1d
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)
movl $0x2, %eax
movw %di, (%rdx)
popq %rcx
retq
leaq 0x9339(%rip), %rdi      # 0xd15f
leaq 0x9354(%rip), %rsi      # 0xd181
leaq 0x9362(%rip), %rcx      # 0xd196
movl $0x9, %edx
callq 0x2120
leaq 0x9385(%rip), %rdi      # 0xd1ca
leaq 0x9335(%rip), %rsi      # 0xd181
leaq 0x9343(%rip), %rcx      # 0xd196
movl $0xa, %edx
callq 0x2120
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9361(%rip), %r12      # 0xd1dc
movl %ebx, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3dd0
movl %eax, %eax
leaq 0x4(%rsp,%rax,2), %rax
movq %r15, %rcx
movzwl (%rcx), %edx
leaq 0x2(%rcx), %rsi
leal 0x2000(%rdx), %edi
cmpw $0xf800, %di            # imm = 0xF800
jae 0x3eab
movq %rsi, %rcx
jmp 0x3ee4
cmpw $0xdc00, %dx            # imm = 0xDC00
jae 0x3f13
cmpq %rax, %rsi
je 0x3f13
movzwl (%rsi), %esi
leal 0x2000(%rsi), %edi
cmpw $0xfbff, %di            # imm = 0xFBFF
jbe 0x3f13
shll $0xa, %edx
andl $0x3ff, %esi            # imm = 0x3FF
addq $0x4, %rcx
andl $0xffc00, %edx          # imm = 0xFFC00
leal 0x10000(%rdx,%rsi), %edx
movq %rcx, %rsi
cmpq %rax, %rsi
jne 0x3e92
cmpl %ebx, %edx
je 0x3ef9
movq %r12, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x2050
incl %ebx
cmpl $0x110000, %ebx         # imm = 0x110000
jne 0x3e7b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x92d0(%rip), %rdi      # 0xd1ea
callq 0x2270
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rdx, %rax
cmpq $0x5, %rsi
jl 0x47f4
addq %rdi, %rsi
leaq 0xca0c(%rip), %rcx      # 0x111a0
movq %rdi, %r8
movq %rdx, %rax
movsbl (%r8), %r9d
testw %r9w, %r9w
js 0x47ad
incq %r8
movw %r9w, (%rax)
jmp 0x47e7
movzbl %r9b, %r10d
shll $0x4, %r10d
movzbl 0xc(%r10,%rcx), %r9d
testq %r9, %r9
je 0x482f
addq %rcx, %r10
movl 0x4(%r10), %r11d
cmpl 0x8(%r10), %r11d
je 0x482f
movbel (%rdi), %r11d
pextl (%r10), %r11d, %r10d
cmpl $0x10000, %r10d         # imm = 0x10000
jae 0x47fc
movw %r10w, (%rax)
addq %r9, %r8
addq $0x2, %rax
leaq 0x4(%r8), %r9
cmpq %rsi, %r9
jb 0x479a
subq %rdx, %rax
sarq %rax
popq %rcx
retq
leal 0xf0000(%r10), %ecx
vpbroadcastw 0x8ab4(%rip), %xmm1 # 0xd2c0
shrl $0xa, %ecx
vmovd %ecx, %xmm0
vpinsrw $0x1, %r10d, %xmm0, %xmm0
vpternlogd $0xea, 0x8abc(%rip){1to4}, %xmm0, %xmm1 # 0xd2e0
vmovd %xmm1, (%rax)
movl $0x2, %eax
jmp 0x47fa
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/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), %rsi
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
movq %r14, %rdi
movq $0x4000, (%rsi)         # imm = 0x4000
callq 0x4a16
movq (%r14), %rbx
movq 0x8(%r14), %r12
cmpq %r12, %rbx
je 0x48a9
leaq 0x30(%rsp), %r14
leaq 0x28(%rsp), %r15
movq (%rbx), %rax
movq %rax, 0x28(%rsp)
movq %r14, %rdi
callq 0x4e78
movq %r15, %rdi
callq 0x4a5e
movq %r14, %rdi
callq 0x21a0
addq $0x8, %rbx
cmpq %r12, %rbx
jne 0x487b
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x48be
movq 0x20(%rsp), %rsi
movq %rbx, %rdi
subq %rbx, %rsi
callq 0x21d0
xorl %eax, %eax
addq $0x13b8, %rsp           # imm = 0x13B8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x48df
movq %rax, %rbx
movq %r14, %rdi
callq 0x21a0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x48f6
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22b0
jmp 0x4900
movq %rax, %rdi
callq 0x4f87
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x20(%rsp), %r15
leaq 0x8(%rdi), %r14
vxorps %xmm0, %xmm0, %xmm0
leaq 0x7(%rsp), %rcx
movl $0x5, %edx
xorl %r12d, %r12d
movq %r12, (%rdi)
movq %rdi, %rbx
movq %r12, 0x20(%r15)
vmovups %ymm0, (%r15)
movq %r14, %rdi
movq %r15, %rsi
vzeroupper
callq 0x6108
vmovups 0x791a(%rip), %xmm0     # 0xd330
movq %r12, 0x20(%rbx)
movl $0x3, 0x10(%r15)
vmovaps %xmm0, (%r15)
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x5, %edx
callq 0x5ee0
leaq 0x28(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5f28
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5a65
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x8(%rsp), %rdi
movq %rax, %r15
testq %rdi, %rdi
je 0x5a90
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x5a90
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x5aa4
movq 0x18(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r15, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5d1b
vmovsd (%rbx), %xmm0
vmovsd 0x28(%r14), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x5d36
vmovq %xmm0, %rax
jmp 0x5d1e
movq (%rbx), %rax
leaq 0x8(%rbx), %rsi
leaq 0x30(%r14), %rdi
movq %rax, 0x28(%r14)
callq 0x69f8
movl (%r14), %eax
testl %eax, %eax
je 0x5d49
vmovsd (%rbx), %xmm0
vucomisd 0x48(%r14), %xmm0
jbe 0x5d60
vmovq %xmm0, %rax
jmp 0x5d4c
movq (%rbx), %rax
leaq 0x8(%rbx), %rsi
leaq 0x50(%r14), %rdi
movq %rax, 0x48(%r14)
callq 0x69f8
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 0x6982
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl (%rdi), %edi
cmpl $-0x1, %edi
je 0x6789
movl $0x2403, %esi           # imm = 0x2403
movl $0x1, %edx
xorl %eax, %eax
callq 0x2240
cmpl $-0x1, %eax
jne 0x672c
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6e29(%rip), %rsi      # 0xd520
leaq 0x6e3d(%rip), %rdx      # 0xd53b
leaq 0x8(%rsp), %rdi
callq 0x4ef2
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x62b6
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x672c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movl (%rbx), %edi
movl $0x2400, %esi           # imm = 0x2400
movl $0x1, %edx
xorl %eax, %eax
callq 0x2240
cmpl $-0x1, %eax
jne 0x6789
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6de8(%rip), %rsi      # 0xd53c
leaq 0x6dfd(%rip), %rdx      # 0xd558
leaq 0x8(%rsp), %rdi
callq 0x4ef2
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x62b6
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x6789
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x6793
movq 0x8(%rsp), %rdi
movq %rax, %rbx
cmpq %r14, %rdi
je 0x67b4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x67b4
jmp 0x67b1
movq %rax, %rbx
movq %rbx, %rdi
callq 0x22b0