// File: /workspace/github_cpp_makefile_star2_O3/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)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x60(%rsp), %rdi
callq 0x3320
movq (%r14), %rsi
leaq 0x60(%rsp), %rdi
movl $0x8, %edx
callq 0x31b0
leaq 0xd8(%rsp), %rdi
callq 0x3070
testb %al, %al
je 0x3f30
leaq 0x1434(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x1430(%rbx), %rax
movq %rax, 0x18(%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), %r14
leaq 0x30(%rbx), %rbp
leaq 0x60(%rsp), %r15
leaq 0x40(%rsp), %r12
leaq 0x43a4(%rip), %r13      # 0x8107
movq %r15, %rdi
movq %r12, %rsi
callq 0x3340
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x80(%rsp,%rax)
jne 0x3faf
movq %r12, %rdi
movq %r13, %rsi
callq 0x30a0
testl %eax, %eax
je 0x3faf
movq %r12, %rdi
leaq 0x436a(%rip), %rsi      # 0x810c
callq 0x30a0
movq %rbp, %rsi
testl %eax, %eax
je 0x3ea7
movq %r12, %rdi
leaq 0x4359(%rip), %rsi      # 0x8115
callq 0x30a0
movq %r14, %rsi
testl %eax, %eax
je 0x3eb4
movq %r12, %rdi
leaq 0x434f(%rip), %rsi      # 0x8125
callq 0x30a0
movq 0x38(%rsp), %rsi
testl %eax, %eax
je 0x3eb4
movq %r12, %rdi
leaq 0x4344(%rip), %rsi      # 0x8136
callq 0x30a0
movq 0x30(%rsp), %rsi
testl %eax, %eax
je 0x3ec1
movq %r12, %rdi
leaq 0x4334(%rip), %rsi      # 0x8142
callq 0x30a0
testl %eax, %eax
je 0x3ece
movq %r12, %rdi
leaq 0x4328(%rip), %rsi      # 0x814d
callq 0x30a0
movq 0x28(%rsp), %rsi
testl %eax, %eax
je 0x3ec1
movq %r12, %rdi
leaq 0x4317(%rip), %rsi      # 0x8158
callq 0x30a0
testl %eax, %eax
je 0x3ee0
movq %r12, %rdi
leaq 0x4317(%rip), %rsi      # 0x816f
callq 0x30a0
movq 0x18(%rsp), %rsi
testl %eax, %eax
je 0x3ea7
movq %r12, %rdi
leaq 0x4312(%rip), %rsi      # 0x8182
callq 0x30a0
movq 0x10(%rsp), %rsi
testl %eax, %eax
je 0x3ea7
movl $0x27, %edx
movq 0x8136(%rip), %rdi      # 0xbfc0
leaq 0x42fe(%rip), %rsi      # 0x818f
callq 0x3330
movq 0x8123(%rip), %rdi      # 0xbfc0
callq 0x3120
jmp 0x3d63
movq %r15, %rdi
callq 0x31a0
jmp 0x3d63
movq %r15, %rdi
callq 0x3340
jmp 0x3d63
movq %r15, %rdi
callq 0x3260
jmp 0x3d63
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x3480
jmp 0x3d63
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
callq 0x3440
movl 0xc(%rsp), %ecx
movq %rcx, 0xa8(%rbx)
movl $0x16, %eax
movq %rcx, %rdx
shrq $0x1e, %rdx
xorl %ecx, %edx
imull $0x6c078965, %edx, %ecx # imm = 0x6C078965
addl %eax, %ecx
addl $-0x15, %ecx
movq %rcx, (%rbx,%rax,8)
incq %rax
cmpq $0x285, %rax            # imm = 0x285
jne 0x3efd
movq $0x270, 0x1428(%rbx) # imm = 0x270
jmp 0x3d63
movq 0x8089(%rip), %rdi      # 0xbfc0
leaq 0x4279(%rip), %rsi      # 0x81b7
movl $0x17, %edx
callq 0x3330
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x806a(%rip), %rdi      # 0xbfc0
callq 0x3330
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31e0
leaq 0x60(%rsp), %rdi
callq 0x3050
leaq 0x60(%rsp), %rdi
callq 0x3080
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x3fdf
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32f0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4005
jmp 0x3ff8
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3080
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4021
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %rbx, %rdi
callq 0x3450
nop