// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x3c0b(%rip), %rdi      # 0x4fc8
leaq 0x1c64(%rip), %rsi      # 0x3028
callq 0x10f0
leaq 0x200e(%rip), %rsi      # 0x33de
movq %rax, %rdi
callq 0x10f0
movq 0x3be9(%rip), %rdi      # 0x4fc8
leaq 0x1c78(%rip), %rsi      # 0x305e
callq 0x10f0
movq 0x3bd6(%rip), %rdi      # 0x4fc8
leaq 0x1c6d(%rip), %rsi      # 0x3066
callq 0x10f0
movq 0x3bc3(%rip), %rdi      # 0x4fc8
leaq 0x1c63(%rip), %rsi      # 0x306f
callq 0x10f0
leaq 0x1fc6(%rip), %rsi      # 0x33de
movq %rax, %rdi
callq 0x10f0
movq 0x3ba1(%rip), %rdi      # 0x4fc8
leaq 0x1fb0(%rip), %rsi      # 0x33de
callq 0x10f0
leaq 0x1fa4(%rip), %rsi      # 0x33de
movq %rax, %rdi
callq 0x10f0
movq 0x3b7f(%rip), %rdi      # 0x4fc8
leaq 0x1c25(%rip), %rsi      # 0x3075
callq 0x10f0
movq 0x3b7c(%rip), %rdi      # 0x4fd8
movq %rsp, %rsi
callq 0x1040
leaq 0x1c18(%rip), %rsi      # 0x3083
movq %rsp, %rdi
callq 0x1060
pushq $0x1e
popq %rbp
testl %eax, %eax
je 0x14cb
leaq 0x1c07(%rip), %rsi      # 0x3088
movq %rsp, %rdi
callq 0x1060
testl %eax, %eax
je 0x14c4
leaq 0x1bdc(%rip), %rsi      # 0x3070
movq %rsp, %rdi
callq 0x1060
testl %eax, %eax
je 0x14c8
movq 0x3b21(%rip), %rdi      # 0x4fc8
leaq 0x1be1(%rip), %rsi      # 0x308f
callq 0x10f0
leaq 0x1f24(%rip), %rsi      # 0x33de
movq %rax, %rdi
callq 0x10f0
jmp 0x14cb
pushq $0x19
jmp 0x14ca
pushq $0x14
popq %rbp
movl %ebp, 0x288(%rbx)
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x10d0
movl %eax, %edi
callq 0x10e0
cmpq $0x9, %r14
je 0x14f6
leaq 0x1(%r14), %rax
movl %eax, 0x20(%rsp,%r14,4)
movq %rax, %r14
jmp 0x14e2
leaq 0x44(%rsp), %rsi
leaq -0x1f8(%rip), %rdx      # 0x130a
leaq 0x20(%rsp), %rdi
callq 0x1cfd
xorl %eax, %eax
cmpq $0x9, %rax
je 0x1525
movl 0x20(%rsp,%rax,4), %ecx
movl %ecx, (%rbx,%rax,8)
movb $0x0, 0x4(%rbx,%rax,8)
incq %rax
jmp 0x150e
pushq $0x1
popq %rbp
movb $0x3, %r14b
movzbl %bpl, %eax
divb %r14b
cmpl $0x9, %ebp
je 0x1557
movzbl %al, %eax
imull $-0x3, %eax, %eax
movq %rbx, %rdi
movl %ebp, %esi
addb %bpl, %al
je 0x154e
callq 0x1319
jmp 0x1553
callq 0x135a
incl %ebp
jmp 0x152b
addq $0x28c, %rbx            # imm = 0x28C
xorl %eax, %eax
cmpq $0x9, %rax
je 0x1591
xorl %ecx, %ecx
cmpq $0x9, %rcx
je 0x1588
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
jmp 0x1568
incq %rax
addq $0x48, %rbx
jmp 0x1560
movq %rsp, %rdi
callq 0x1070
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x15a4
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1070
movq %rbx, %rdi
callq 0x1170
nop