// File: /workspace/github_cpp_makefile_star2_O3/bestcoder12[P]Sudoku_Game/functions.cpp
// Function: s_brd::Sudoku::Sudoku()
Sudoku::Sudoku() 
{
	/*
	 * Taking a string input for difficulty of the board so as 
	 * to enhance the readablity of the code and to remember 
	 * what value corresponds to which difficulty 
	 */
	
    string Difficulty; 
      
	cout << "Choose the difficulty from one of the below options: " << "\n";
	cout << "\n\tEasy\n";
	cout << "\tMedium\n";
	cout << "\tHard" << "\n";
	cout << "\n" << "\n";
	cout << "Your choice: ";		
	getline(cin,Difficulty); 
		
	
    if(Difficulty.compare("Easy") == 0) 
	{			
		filled = 30; 
	}
	else if(Difficulty.compare("Medium") == 0)
	{ 
		
		filled = 25; 
	}
	else if(Difficulty.compare("Hard") == 0)
	{
		
		filled = 20;  
	}
	else
	{
		cout << "Invalid option selected, defaulting to Easy..." << "\n";
		filled = 30;
	}

	/*
	 * Initializing the board with valid values
	 * that is initializing every element or cells of the board
	 * so as to have a solved board at the beginning from which 
	 * cells of required amount are unfilled.
	 */

	srand(time(0));
	
	/* Random numbers to be put in 1st row */
	int rand_nums[9];
	
	for (int o = 0; o < 9; o++)
	{
		rand_nums[o] = o+1; 
	}
	random_shuffle(rand_nums,rand_nums+9,mix_numbers);

	for (int i = 0; i < 9; i++)
	{
		
		board[0][i].set_Val(rand_nums[i],false);
	}
	
	for (int j = 1; j < 9; j++)
	{
		if (j%3 == 0)
		{
			shift_one(board,j);
		}
		else
		{
			shift_three(board,j);
		}
	}

	/* Copying solution board to sol_board */
	for (int k = 0; k < 9; k++)
	{
		for (int l = 0; l < 9; l++)
		{
			sol_board[k][l] = board[k][l];
		}
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
movq 0x3bbd(%rip), %rdi      # 0x5fc8
leaq 0x1c5e(%rip), %rsi      # 0x4070
movl $0x35, %edx
callq 0x2130
movq 0x3ba5(%rip), %rdi      # 0x5fc8
leaq 0x1ffc(%rip), %rsi      # 0x4426
movl $0x1, %edx
callq 0x2130
movq 0x3b8d(%rip), %rdi      # 0x5fc8
leaq 0x1c64(%rip), %rsi      # 0x40a6
movl $0x7, %edx
callq 0x2130
movq 0x3b75(%rip), %rdi      # 0x5fc8
leaq 0x1c54(%rip), %rsi      # 0x40ae
movl $0x8, %edx
callq 0x2130
movq 0x3b5d(%rip), %rdi      # 0x5fc8
leaq 0x1c45(%rip), %rsi      # 0x40b7
movl $0x5, %edx
callq 0x2130
movq 0x3b45(%rip), %rdi      # 0x5fc8
leaq 0x1f9c(%rip), %rsi      # 0x4426
movl $0x1, %edx
callq 0x2130
movq 0x3b2d(%rip), %rdi      # 0x5fc8
leaq 0x1f84(%rip), %rsi      # 0x4426
movl $0x1, %edx
callq 0x2130
movq 0x3b15(%rip), %rdi      # 0x5fc8
leaq 0x1f6c(%rip), %rsi      # 0x4426
movl $0x1, %edx
callq 0x2130
movq 0x3afd(%rip), %rdi      # 0x5fc8
leaq 0x1beb(%rip), %rsi      # 0x40bd
movl $0xd, %edx
callq 0x2130
movq 0x3af5(%rip), %rdi      # 0x5fd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %edx
movq 0x3ada(%rip), %rdi      # 0x5fd8
movq %rsp, %rsi
callq 0x21c0
leaq 0x1bbe(%rip), %rsi      # 0x40cb
movq %rsp, %rdi
callq 0x2060
movl $0x1e, %ebp
testl %eax, %eax
je 0x2582
leaq 0x1bab(%rip), %rsi      # 0x40d0
movq %rsp, %rdi
callq 0x2060
testl %eax, %eax
je 0x2576
leaq 0x1b80(%rip), %rsi      # 0x40b8
movq %rsp, %rdi
callq 0x2060
testl %eax, %eax
je 0x257d
movq 0x3a7d(%rip), %rdi      # 0x5fc8
leaq 0x1b85(%rip), %rsi      # 0x40d7
movl $0x2e, %edx
callq 0x2130
movq 0x3a65(%rip), %rdi      # 0x5fc8
leaq 0x1ebc(%rip), %rsi      # 0x4426
movl $0x1, %edx
callq 0x2130
jmp 0x2582
movl $0x19, %ebp
jmp 0x2582
movl $0x14, %ebp
movl %ebp, 0x288(%rbx)
xorl %edi, %edi
callq 0x20e0
movl %eax, %edi
callq 0x20f0
movdqa 0x1a72(%rip), %xmm0     # 0x4010
movl $0x1, %eax
movdqa 0x1a75(%rip), %xmm1     # 0x4020
movdqa 0x1a7d(%rip), %xmm2     # 0x4030
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
pcmpeqd %xmm4, %xmm4
movdqa 0x1a7c(%rip), %xmm5     # 0x4040
movdqa %xmm0, %xmm6
pxor %xmm1, %xmm6
movdqa %xmm2, %xmm8
pcmpgtd %xmm6, %xmm8
pshufd $0xf5, %xmm6, %xmm7     # xmm7 = xmm6[1,1,3,3]
pcmpeqd %xmm3, %xmm7
pand %xmm8, %xmm7
movdqa %xmm0, %xmm6
psubq %xmm4, %xmm6
movd %xmm7, %ecx
testb $0x1, %cl
je 0x25fb
movd %xmm6, 0x1c(%rsp,%rax,4)
pextrw $0x4, %xmm7, %ecx
testb $0x1, %cl
je 0x2610
pshufd $0xee, %xmm6, %xmm6     # xmm6 = xmm6[2,3,2,3]
movd %xmm6, 0x20(%rsp,%rax,4)
paddq %xmm5, %xmm0
addq $0x2, %rax
cmpq $0xb, %rax
jne 0x25c4
movl $0x4, %r15d
movl $0x2, %ebp
callq 0x2050
cltd
idivl %ebp
movslq %edx, %rax
shlq $0x2, %rax
cmpq %rax, %r15
je 0x264f
movl 0x20(%rsp,%r15), %ecx
movl 0x20(%rsp,%rax), %edx
movl %edx, 0x20(%rsp,%r15)
movl %ecx, 0x20(%rsp,%rax)
addq $0x4, %r15
incl %ebp
cmpq $0x24, %r15
jne 0x2629
xorl %eax, %eax
movl 0x20(%rsp,%rax,4), %ecx
movl %ecx, (%rbx,%rax,8)
movb $0x0, 0x4(%rbx,%rax,8)
incq %rax
cmpq $0x9, %rax
jne 0x265d
movl $0x1, %eax
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
movl $0x8, %edx
movl $0x6, %esi
movq %rbx, %rdi
imull $-0x55, %eax, %r9d
leaq (%rax,%rax,8), %r8
leaq (%rbx,%r8,8), %r8
cmpb $0x56, %r9b
jb 0x26cc
xorl %r9d, %r9d
cmpq $0x3, %r9
movl $0xfffffffd, %r10d      # imm = 0xFFFFFFFD
cmovbl %esi, %r10d
addl %r9d, %r10d
movb 0x4(%rdi,%r9,8), %r11b
movb %r11b, 0x4(%r8,%r10,8)
movl (%rdi,%r9,8), %r11d
movl %r11d, (%r8,%r10,8)
incq %r9
cmpq $0x9, %r9
jne 0x269e
jmp 0x26f6
xorl %r9d, %r9d
testq %r9, %r9
leal 0x2(%rcx,%r9), %r10d
cmoveq %rdx, %r10
movb 0x4(%rdi,%r9,8), %r11b
movb %r11b, 0x4(%r8,%r10,8)
movl (%rdi,%r9,8), %r11d
movl %r11d, (%r8,%r10,8)
incq %r9
cmpq $0x9, %r9
jne 0x26cf
incq %rax
addq $0x48, %rdi
cmpq $0x9, %rax
jne 0x2689
addq $0x28c, %rbx            # imm = 0x28C
xorl %eax, %eax
xorl %ecx, %ecx
movb -0x288(%rbx,%rcx,8), %dl
movb %dl, 0x4(%rbx,%rcx,8)
movl -0x28c(%rbx,%rcx,8), %edx
movl %edx, (%rbx,%rcx,8)
incq %rcx
cmpq $0x9, %rcx
jne 0x270e
incq %rax
addq $0x48, %rbx
cmpq $0x9, %rax
jne 0x270c
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x274f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2120
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2773
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2120
movq %rbx, %rdi
callq 0x21b0
nop