// File: /workspace/github_cpp_makefile_star2_O2/Rubenmp[P]Rubik/src/defineRubik.cpp
// Function: Rubik::solveStepByStep(std::vector<char, std::allocator<char>>&)
void Rubik::solveStepByStep(vector<char>& solution){
   unsigned int mov = 0;
   char xar;
   solution.clear();

   Rubik aux(*this);
   aux.solve(solution);
   cout << "You will need " << solution.size() << " movements to solve it.";
   cout << "Rubik's cube has 12 different movements (and double movements: F2, B2, R2, L2, U2, D2). ";
   cout << "\"FBRLUD\" movements indicates clockwise, \"fbrlud\" the opposite movement";
   cout << "\n\t F(ront), B(ack), R(igth), L(eft), U(p), D(own) \n";
   cout << "You will have 3 seconds per movement, there will be pauses to check.\n";
   cout << "Press any key: ";
   cin >> xar; cin.ignore(1024,'\n');

   cout << endl << "Initial rubik's cube: " << endl;
   printAll();

   //sleep(2);
   whiteCross(solution);
   explainMovements(solution, mov); //
   printAll();
   cout << "\n### The white cross it's made.\n";
   cout << "Press any key: ";
   cin.ignore(1024, '\n');

   cornersFirstStep(solution);
   explainMovements(solution, mov);
   printAll();
   cout << "## You will need just a corner to complete first side.";
   cout << "We will do it later, it will be faster. \n";
   cout << "Press any key: ";
   cin.ignore(1024, '\n');

   secondStep(solution);
   explainMovements(solution, mov);
   printAll();
   cout << "## First side and central ring completed.\n";
   cout << "Press any key: ";
   cin.ignore(1024, '\n');

   yellowCross(solution);
   explainMovements(solution, mov);
   printAll();
   cout << "### The yellow cross it's made. ";
   cout << "Press any key: ";
   cin.ignore(1024, '\n');


   permutationFinalCorners(solution);
   explainMovements(solution, mov);
   printAll();
   cout << "### The final corners are good located, but probably not oriented. ";
   cout << "Press any key: ";
   cin.ignore(1024, '\n');

   positionFinalCorners(solution);
   explainMovements(solution, mov);
   printAll();
   printf (BT_ON "\n\n\t---> ¡¡ Good job :D !! <---\n" RESET);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
andl $0x0, 0xc(%rsp)
movq %rdi, %rbx
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x99cc
movq %rax, 0x8(%r14)
leaq 0x12(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x84de
leaq 0xb(%rsp), %rdx
movb $0x42, (%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x9c90
movq 0x65d2(%rip), %r15      # 0xffc8
leaq 0x242b(%rip), %rsi      # 0xbe28
movq %r15, %rdi
callq 0x21b0
movq 0x8(%r14), %rsi
subq (%r14), %rsi
movq %rax, %rdi
callq 0x2140
leaq 0x241c(%rip), %rsi      # 0xbe37
movq %rax, %rdi
callq 0x21b0
leaq 0x2425(%rip), %rsi      # 0xbe4f
movq %r15, %rdi
callq 0x21b0
leaq 0x246f(%rip), %rsi      # 0xbea8
movq %r15, %rdi
callq 0x21b0
leaq 0x24a7(%rip), %rsi      # 0xbeef
movq %r15, %rdi
callq 0x21b0
leaq 0x24cc(%rip), %rsi      # 0xbf23
movq %r15, %rdi
callq 0x21b0
leaq 0x2503(%rip), %rsi      # 0xbf69
movq %r15, %rdi
movq %rsi, %rbp
callq 0x21b0
movq 0x6560(%rip), %r13      # 0xffd8
leaq 0xb(%rsp), %rsi
movq %r13, %rdi
callq 0x2210
pushq $0xa
popq %rdx
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdi
callq 0x2130
movq %r15, %rdi
callq 0x20f0
leaq 0x24d5(%rip), %rsi      # 0xbf79
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x9364
movq %rbx, %rdi
movq %r14, %rsi
callq 0x411a
leaq 0xc(%rsp), %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x3054
movq %rbx, %rdi
callq 0x9364
leaq 0x24aa(%rip), %rsi      # 0xbf90
movq %r15, %rdi
callq 0x21b0
movq %r15, %rdi
movq %rbp, %rsi
callq 0x21b0
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdi
pushq $0xa
popq %r13
movl %r13d, %edx
callq 0x2130
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52d4
movq %r14, %rsi
movq %r12, %rdx
callq 0x3054
movq %rbx, %rdi
callq 0x9364
leaq 0x247f(%rip), %rsi      # 0xbfb1
movq %r15, %rdi
callq 0x21b0
leaq 0x24a7(%rip), %rsi      # 0xbfe8
movq %r15, %rdi
callq 0x21b0
movq %r15, %rdi
movq %rbp, %rsi
callq 0x21b0
movl $0x400, %esi            # imm = 0x400
movq 0x6478(%rip), %rdi      # 0xffd8
movq %rdi, %r12
movl %r13d, %edx
movl %r13d, %ebp
callq 0x2130
movq %rbx, %rdi
movq %r14, %rsi
callq 0x626a
movq %r14, %rsi
leaq 0xc(%rsp), %rdx
movq %rdx, %r13
callq 0x3054
movq %rbx, %rdi
callq 0x9364
leaq 0x247a(%rip), %rsi      # 0xc012
movq %r15, %rdi
callq 0x21b0
movq %r15, %rdi
leaq 0x23bf(%rip), %rsi      # 0xbf69
callq 0x21b0
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movl %ebp, %edx
callq 0x2130
movq %rbx, %rdi
movq %r14, %rsi
callq 0x72a6
movq %r14, %rsi
movq %r13, %rdx
callq 0x3054
movq %rbx, %rdi
callq 0x9364
leaq 0x245a(%rip), %rsi      # 0xc03d
movq %r15, %rdi
callq 0x21b0
movq %r15, %rdi
leaq 0x2374(%rip), %rsi      # 0xbf69
callq 0x21b0
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movl %ebp, %edx
callq 0x2130
movq %rbx, %rdi
movq %r14, %rsi
callq 0x78ba
movq %r14, %rsi
movq %r13, %rdx
callq 0x3054
movq %rbx, %rdi
callq 0x9364
leaq 0x2430(%rip), %rsi      # 0xc05e
movq %r15, %rdi
callq 0x21b0
movq %r15, %rdi
leaq 0x2329(%rip), %rsi      # 0xbf69
callq 0x21b0
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movl %ebp, %edx
callq 0x2130
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7c94
movq %r14, %rsi
movq %r13, %rdx
callq 0x3054
movq %rbx, %rdi
callq 0x9364
leaq 0x2429(%rip), %rdi      # 0xc0a2
xorl %eax, %eax
callq 0x2030
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop