// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, %rbx
movl $0x0, 0xc(%rsp)
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0xac09
movq %rax, 0x8(%r14)
leaq 0x12(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x94d4
leaq 0xb(%rsp), %rdx
movb $0x42, (%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0xaf5e
movq 0x7395(%rip), %r15      # 0x11fc8
leaq 0x31ca(%rip), %rsi      # 0xde04
movl $0xe, %edx
movq %r15, %rdi
callq 0x21d0
movq 0x8(%r14), %rsi
subq (%r14), %rsi
movq %r15, %rdi
callq 0x2100
leaq 0x31b6(%rip), %rsi      # 0xde13
movl $0x17, %edx
movq %rax, %rdi
callq 0x21d0
leaq 0x31ba(%rip), %rsi      # 0xde2b
movl $0x58, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x31ff(%rip), %rsi      # 0xde84
movl $0x46, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x3232(%rip), %rsi      # 0xdecb
movl $0x33, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x3252(%rip), %rsi      # 0xdeff
movl $0x45, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x3284(%rip), %r12      # 0xdf45
movl $0xf, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21d0
movq 0x7300(%rip), %r13      # 0x11fd8
leaq 0xb(%rsp), %rsi
movq %r13, %rdi
callq 0x21f0
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdi
movl $0xa, %edx
callq 0x20f0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %rax, %rbp
leaq 0x322d(%rip), %rsi      # 0xdf55
movl $0x16, %edx
movq %rax, %rdi
callq 0x21d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %rbx, %rdi
callq 0xa412
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4406
leaq 0xc(%rsp), %rbp
movq %r14, %rsi
movq %rbp, %rdx
callq 0x33c0
movq %rbx, %rdi
callq 0xa412
leaq 0x31dd(%rip), %rsi      # 0xdf6c
movl $0x20, %edx
movq %r15, %rdi
callq 0x21d0
movl $0xf, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21d0
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdi
movl $0xa, %edx
callq 0x20f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x593e
movq %r14, %rsi
movq %rbp, %rdx
callq 0x33c0
movq %rbx, %rdi
callq 0xa412
leaq 0x31aa(%rip), %rsi      # 0xdf8d
movl $0x36, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x31cd(%rip), %rsi      # 0xdfc4
movl $0x29, %edx
movq %r15, %rdi
callq 0x21d0
movl $0xf, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21d0
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdi
movl $0xa, %edx
callq 0x20f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6bda
movq %r14, %rsi
movq %rbp, %rdx
callq 0x33c0
movq %rbx, %rdi
callq 0xa412
leaq 0x31a3(%rip), %rsi      # 0xdfee
movl $0x2a, %edx
movq %r15, %rdi
callq 0x21d0
movl $0xf, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21d0
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdi
movl $0xa, %edx
callq 0x20f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7f36
movq %r14, %rsi
movq %rbp, %rdx
callq 0x33c0
movq %rbx, %rdi
callq 0xa412
leaq 0x317a(%rip), %rsi      # 0xe019
movl $0x20, %edx
movq %r15, %rdi
callq 0x21d0
movl $0xf, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21d0
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdi
movl $0xa, %edx
callq 0x20f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x864a
movq %r14, %rsi
movq %rbp, %rdx
callq 0x33c0
movq %rbx, %rdi
callq 0xa412
leaq 0x3147(%rip), %rsi      # 0xe03a
movl $0x43, %edx
movq %r15, %rdi
callq 0x21d0
movl $0xf, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21d0
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdi
movl $0xa, %edx
callq 0x20f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8aba
movq %r14, %rsi
movq %rbp, %rdx
callq 0x33c0
movq %rbx, %rdi
callq 0xa412
leaq 0x3137(%rip), %rdi      # 0xe07e
xorl %eax, %eax
callq 0x2040
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop