// File: 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
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rsi, -0x260(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x258(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4440
movb $0x1, -0x31(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x43f0
jmp 0x5640
movq -0x260(%rbp), %rdi
callq 0x4120
movq %rax, %rsi
leaq -0x240(%rbp), %rdi
movl $0x8, %edx
callq 0x4210
jmp 0x5662
leaq -0x240(%rbp), %rdi
callq 0x44b0
movb %al, -0x261(%rbp)
jmp 0x5676
movb -0x261(%rbp), %al
testb $0x1, %al
jne 0x5685
jmp 0x59ed
jmp 0x5687
testb $0x1, -0x31(%rbp)
je 0x59eb
leaq -0x240(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4410
jmp 0x56a3
movq -0x240(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x240(%rbp,%rax), %rdi
callq 0x4030
movb %al, -0x262(%rbp)
jmp 0x56c3
movb -0x262(%rbp), %al
testb $0x1, %al
jne 0x56f3
jmp 0x56cf
leaq 0x10e61(%rip), %rsi     # 0x16537
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x263(%rbp)
jmp 0x56e7
movb -0x263(%rbp), %al
testb $0x1, %al
jne 0x56f3
jmp 0x5736
movb $0x0, -0x31(%rbp)
jmp 0x59e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x5a84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x40c0
jmp 0x5a84
leaq 0x10dff(%rip), %rsi     # 0x1653c
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x264(%rbp)
jmp 0x574e
movb -0x264(%rbp), %al
testb $0x1, %al
jne 0x575a
jmp 0x5778
movq -0x258(%rbp), %rsi
addq $0x30, %rsi
leaq -0x240(%rbp), %rdi
callq 0x41f0
jmp 0x5773
jmp 0x59e4
leaq 0x10dc6(%rip), %rsi     # 0x16545
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x265(%rbp)
jmp 0x5790
movb -0x265(%rbp), %al
testb $0x1, %al
jne 0x579c
jmp 0x57ba
movq -0x258(%rbp), %rsi
addq $0x38, %rsi
leaq -0x240(%rbp), %rdi
callq 0x4410
jmp 0x57b5
jmp 0x59e2
leaq 0x10d94(%rip), %rsi     # 0x16555
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x266(%rbp)
jmp 0x57d2
movb -0x266(%rbp), %al
testb $0x1, %al
jne 0x57de
jmp 0x57fc
movq -0x258(%rbp), %rsi
addq $0x58, %rsi
leaq -0x240(%rbp), %rdi
callq 0x4410
jmp 0x57f7
jmp 0x59e0
leaq 0x10d63(%rip), %rsi     # 0x16566
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x267(%rbp)
jmp 0x5814
movb -0x267(%rbp), %al
testb $0x1, %al
jne 0x5820
jmp 0x5841
movq -0x258(%rbp), %rsi
addq $0xa0, %rsi
leaq -0x240(%rbp), %rdi
callq 0x42d0
jmp 0x583c
jmp 0x59de
leaq 0x10d2a(%rip), %rsi     # 0x16572
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x268(%rbp)
jmp 0x5859
movb -0x268(%rbp), %al
testb $0x1, %al
jne 0x5865
jmp 0x5883
movq -0x258(%rbp), %rsi
addq $0x78, %rsi
leaq -0x240(%rbp), %rdi
callq 0x4070
jmp 0x587e
jmp 0x59dc
leaq 0x10cf3(%rip), %rsi     # 0x1657d
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x269(%rbp)
jmp 0x589b
movb -0x269(%rbp), %al
testb $0x1, %al
jne 0x58a7
jmp 0x58c8
movq -0x258(%rbp), %rsi
addq $0xa1, %rsi
leaq -0x240(%rbp), %rdi
callq 0x42d0
jmp 0x58c3
jmp 0x59da
leaq 0x10cb9(%rip), %rsi     # 0x16588
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x26a(%rbp)
jmp 0x58e0
movb -0x26a(%rbp), %al
testb $0x1, %al
jne 0x58ec
jmp 0x591d
leaq -0x240(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4050
jmp 0x58fe
movq -0x258(%rbp), %rdi
addq $0xa8, %rdi
movl -0x38(%rbp), %eax
movl %eax, %esi
callq 0xa270
jmp 0x5918
jmp 0x59d8
leaq 0x10c7b(%rip), %rsi     # 0x1659f
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x26b(%rbp)
jmp 0x5935
movb -0x26b(%rbp), %al
testb $0x1, %al
jne 0x5941
jmp 0x595f
movq -0x258(%rbp), %rsi
addq $0x1430, %rsi           # imm = 0x1430
leaq -0x240(%rbp), %rdi
callq 0x41f0
jmp 0x595d
jmp 0x59d6
leaq 0x10c4c(%rip), %rsi     # 0x165b2
leaq -0x30(%rbp), %rdi
callq 0xa240
movb %al, -0x26c(%rbp)
jmp 0x5977
movb -0x26c(%rbp), %al
testb $0x1, %al
jne 0x5983
jmp 0x59a1
movq -0x258(%rbp), %rsi
addq $0x1434, %rsi           # imm = 0x1434
leaq -0x240(%rbp), %rdi
callq 0x41f0
jmp 0x599f
jmp 0x59d4
movq 0x1c618(%rip), %rdi     # 0x21fc0
leaq 0x10c10(%rip), %rsi     # 0x165bf
callq 0x4350
movq %rax, -0x278(%rbp)
jmp 0x59bd
movq -0x278(%rbp), %rdi
movq 0x1c5bd(%rip), %rsi     # 0x21f88
callq 0x4390
jmp 0x59d2
jmp 0x59d4
jmp 0x59d6
jmp 0x59d8
jmp 0x59da
jmp 0x59dc
jmp 0x59de
jmp 0x59e0
jmp 0x59e2
jmp 0x59e4
jmp 0x59e6
jmp 0x5687
jmp 0x5a58
movq 0x1c5cc(%rip), %rdi     # 0x21fc0
leaq 0x10bec(%rip), %rsi     # 0x165e7
callq 0x4350
movq %rax, -0x280(%rbp)
jmp 0x5a09
movq -0x260(%rbp), %rsi
movq -0x280(%rbp), %rdi
callq 0x42f0
movq %rax, -0x288(%rbp)
jmp 0x5a25
movq -0x288(%rbp), %rdi
movq 0x1c555(%rip), %rsi     # 0x21f88
callq 0x4390
movq %rax, -0x290(%rbp)
jmp 0x5a41
movq -0x290(%rbp), %rdi
movq 0x1c539(%rip), %rsi     # 0x21f88
callq 0x4390
jmp 0x5a56
jmp 0x5a58
leaq -0x240(%rbp), %rdi
callq 0x4080
jmp 0x5a66
leaq -0x240(%rbp), %rdi
callq 0x40c0
leaq -0x30(%rbp), %rdi
callq 0x4200
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x4200
movq -0x248(%rbp), %rdi
callq 0x4530
nopl (%rax)