// File: /workspace/github_cpp_makefile_star2_O2/isaacbrodsky[P]K-means-plus-plus/k-means-multi.cpp
// Function: Cluster_set::Read_control_data(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Cluster_set::Read_control_data(string sControlFilename) {

	// local variables
	string sTitle;
	bool bNot_done;
	unsigned int uRandomSeed;

	// initialize loop flag
	bNot_done = true;

	// declare an input stream to read the data
	ifstream strInput_stream;

	// open the input stream to read the key
	strInput_stream.open(sControlFilename.c_str());

	// check if the file was OK
	if (strInput_stream.is_open()){
		while(bNot_done){ // read to the end of the control file

			strInput_stream >> sTitle; // read the control label
			if (strInput_stream.fail() // Check for failed read
				|| sTitle == "#EOF") { // read the end of file label
				bNot_done =  false;
			} // if
			else if (sTitle == "#k-count"){ // read the count of neighbors
				strInput_stream >> iK_count;
			} // if
			else if (sTitle == "#input-filename"){ // read the input filename
				strInput_stream >> sIn_file;
			} // if
			else if (sTitle == "#output-filename"){ // read the output filename
				strInput_stream >> sOut_file;
			} // if
			else if (sTitle == "#use-labels"){ // read the use-labels flag
				strInput_stream >> bUseLabels;
			} // if
			else if (sTitle == "#tolerance"){ // read the stopping criteria
				strInput_stream >> fTolerance;
			} // if
			else if (sTitle == "#plus-plus"){ // control k-means++ initialization
				strInput_stream >> bUsePlusPlus;
			} // if
			else if (sTitle == "#plus-plus-random-seed"){ // Specify k-means++ random seed
				strInput_stream >> uRandomSeed;
				mtRandom.seed(uRandomSeed);
			} // if
			else if (sTitle == "#plus-plus-threads"){ // Specify k-means++ number of threads
				strInput_stream >> iNumPlusPlusThreads;
			} // if
			else if (sTitle == "#num-threads"){ // Number of parallel threads
				strInput_stream >> iNumThreads;
			} // if
			else{
				cout << "Unrecognized directive in control file." << endl;
			}
		} // while read control file
	} // if control file open
	else { // print error message
		cout << "Error reading the file " << sControlFilename << endl << endl;
	}

	strInput_stream.close();  // close filestream

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x60(%rsp), %rdi
callq 0x3320
movq (%r14), %rsi
leaq 0x60(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x31b0
leaq 0xd8(%rsp), %rdi
callq 0x3060
testb %al, %al
je 0x3ce0
leaq 0x1434(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x1430(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0xa8(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0xa1(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0x78(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0xa0(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x58(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x38(%rbx), %r15
addq $0x30, %rbx
leaq 0x60(%rsp), %r12
leaq 0x40(%rsp), %r13
leaq 0x4577(%rip), %rbp      # 0x80d7
leaq 0x4575(%rip), %r14      # 0x80dc
movq %r12, %rdi
movq %r13, %rsi
callq 0x3330
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x80(%rsp,%rax)
jne 0x3d0e
movq %r13, %rdi
movq %rbp, %rsi
callq 0x52c8
testb %al, %al
jne 0x3d0e
movq %r13, %rdi
movq %r14, %rsi
callq 0x52c8
movq %rbx, %rsi
testb %al, %al
je 0x3bb8
movq %r12, %rdi
callq 0x31a0
jmp 0x3b67
movq %r13, %rdi
leaq 0x4523(%rip), %rsi      # 0x80e5
callq 0x52c8
movq %r15, %rsi
testb %al, %al
jne 0x3be6
movq %r13, %rdi
leaq 0x451d(%rip), %rsi      # 0x80f5
callq 0x52c8
movq 0x38(%rsp), %rsi
testb %al, %al
je 0x3bf3
movq %r12, %rdi
callq 0x3330
jmp 0x3b67
movq %r13, %rdi
leaq 0x4509(%rip), %rsi      # 0x8106
callq 0x52c8
movq 0x30(%rsp), %rsi
testb %al, %al
je 0x3c18
movq %r12, %rdi
callq 0x3250
jmp 0x3b67
movq %r13, %rdi
leaq 0x44f0(%rip), %rsi      # 0x8112
callq 0x52c8
testb %al, %al
je 0x3c3d
movq %r12, %rdi
movq 0x20(%rsp), %rsi
callq 0x3490
jmp 0x3b67
movq %r13, %rdi
leaq 0x44d6(%rip), %rsi      # 0x811d
callq 0x52c8
movq 0x28(%rsp), %rsi
testb %al, %al
jne 0x3c0b
movq %r13, %rdi
leaq 0x44c9(%rip), %rsi      # 0x8128
callq 0x52c8
testb %al, %al
je 0x3c88
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x3440
movl 0x4(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0x52d6
jmp 0x3b67
movq %r13, %rdi
leaq 0x44ad(%rip), %rsi      # 0x813f
callq 0x52c8
movq 0x18(%rsp), %rsi
testb %al, %al
jne 0x3bae
movq %r13, %rdi
leaq 0x44a4(%rip), %rsi      # 0x8152
callq 0x52c8
movq 0x8(%rsp), %rsi
testb %al, %al
jne 0x3bae
movq 0x92f9(%rip), %rdi      # 0xcfc0
leaq 0x4491(%rip), %rsi      # 0x815f
callq 0x32d0
movq %rax, %rdi
callq 0x3120
jmp 0x3b67
movq 0x92d9(%rip), %rdi      # 0xcfc0
leaq 0x4499(%rip), %rsi      # 0x8187
callq 0x32d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3120
leaq 0x60(%rsp), %rdi
callq 0x3040
leaq 0x60(%rsp), %rdi
callq 0x3080
leaq 0x40(%rsp), %rdi
callq 0x30f0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3d52
jmp 0x3d45
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3080
leaq 0x40(%rsp), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x3450