// File: /workspace/github_cpp_makefile_star2_O3/nikosgalanis[P]Vectors-Similarity-Search-and-Clustering/programs/LSH/lsh_main.cc
// Function: main
int main(int argc, char* argv[]) {
	// first step: parse the arguments
	char* input_file = NULL, *query_file = NULL, *output_file = NULL;
	int k, L, n_neighbors, radius;
	double sum1 = 0, sum2 = 0;
	
	// parse the comand line arguments given
	parse_lsh_args(argc, argv, &input_file, &output_file, &query_file,
	&k, &L, &n_neighbors, &radius);
	// parse the dataset in order to get a vector of our feature vector
	vector<vector<double>> feature_vectors = parse_input(input_file);

	// parse the query set in order to find all of the queries that the user wants to ask
	vector<vector<double>> query_vectors = parse_input(query_file);

	// make sure that there is at least one element in the dataset and the queryset
	assert(feature_vectors.size() && query_vectors.size());
	
	// create the output file that we are going to use to print the LSH results
	ofstream output;
	output.open(output_file);

	// lsh initialization values that we've learned from our dataset
	int n_points = feature_vectors.size();
	int space_dimension = feature_vectors.at(1).size();

	// defalt lsh values, that we've learned for theory
	uint64_t m = pow(2,32) - 5;
	uint32_t M = 256;
	uint32_t w = our_math::compute_w_value(feature_vectors, 1000);
	uint32_t c = 1; 
	int correct_computed = 0;
	// initialize our LSH class with the deature vectors and the aprropriate given values
	LSH<double> lsh_instant(L, m, M, n_points, k, space_dimension, w, feature_vectors);

	// initialize our brute force class, in order to find the true distance of the query and its neighbors
	BruteForce<double> bf_instant(n_points, space_dimension, feature_vectors);

	// run all the queries with LSH
	for (uint64_t i = 0; i < query_vectors.size(); i++) {
		// output the query number in the file
		output << "Query: " << i << endl;

		auto k_start = std::chrono::high_resolution_clock::now();
		// run the k-nearest neighbor algorithm, in order to obtain n neighbors
		list<pair<int,double>> kNNs = lsh_instant.kNearestNeighbour(query_vectors.at(i), n_neighbors);
		auto k_end = std::chrono::high_resolution_clock::now();

		duration<double> knn_time_span = duration_cast<duration<double>>(k_end - k_start);  
		
		auto b_start = std::chrono::high_resolution_clock::now();
		// run the brute force algorithm, in order to obtain the true nearest neighbors
		list<pair<int, double>> kBF = bf_instant.kNeighboursBF(query_vectors.at(i), n_neighbors);
		auto b_end = std::chrono::high_resolution_clock::now();

		duration<double> bf_time_span = duration_cast<duration<double>>(b_end - b_start);  

		// denote the number of neighbor we are dealing with
		int k_value = 0;

		// itterate the list of results of the knn
		list<pair<int,double>>::iterator knn_it = kNNs.begin();
		list<pair<int,double>>::iterator bf_it = kBF.begin();

		for (; knn_it != kNNs.end() && bf_it != kBF.end() ; knn_it++, bf_it++) {
			// hold the results of the knn here
			auto knn_tuple = knn_it;
			auto bf_tuple = bf_it;
			// output the findings of kNN
			output << "Nearest neighbor-" << k_value + 1 << ": " << knn_tuple->first << endl;
			// by the LSH
			output << "DistanceLSH:" << knn_tuple->second << endl;
			// and by brute force
			output << "DistanceTrue:" << bf_tuple->second << endl;
			if (knn_tuple->second == bf_tuple->second) {
				correct_computed++;
			}

			k_value++;
		}
		
		// Print the time elapsed while computing the neighbors with kNN and BF
		output << "tLSH: " << knn_time_span.count() << endl;
		output << "tTrue: " << bf_time_span.count() << endl;
		sum1 += knn_time_span.count();
		sum2 += bf_time_span.count();

		// RUn the Range Search algorithm
		list<pair<int, double>> range_search = lsh_instant.RangeSearch(query_vectors.at(i), radius, c);

		// print in the output file all of our findings
		output << "R-near neighbors:" << endl;
		for (list<pair<int,double>>::iterator it = range_search.begin(); it != range_search.end(); it++) {
			output << it->first << endl;
		}
		
		output << "\n\n\n";
	}
	cout << "mean lsh time " << sum1 / query_vectors.size() << endl;
	cout << "mean bf time " << sum2 / query_vectors.size() << endl;
	cout << "corectly computed neighbours " << correct_computed  << " out of " << n_neighbors * query_vectors.size() << endl;

	output.close();
	
	free(input_file);
	free(query_file);
	free(output_file);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
xorl %eax, %eax
leaq 0xa8(%rsp), %rbx
movq %rax, (%rbx)
leaq 0x88(%rsp), %r8
movq %rax, (%r8)
leaq 0x80(%rsp), %rcx
movq %rax, (%rcx)
subq $0x8, %rsp
leaq 0x4c(%rsp), %rax
leaq 0x14(%rsp), %r10
leaq 0x50(%rsp), %r11
leaq 0x54(%rsp), %r9
movq %rbx, %rdx
pushq %rax
pushq %r10
pushq %r11
callq 0x27df
addq $0x20, %rsp
movq (%rbx), %rsi
leaq 0x1b0(%rsp), %rdi
leaq 0x238(%rsp), %rdx
callq 0x20c0
leaq 0x50(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x25dc
leaq 0x1c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39c1
callq 0x2200
movq 0x88(%rsp), %rsi
leaq 0x190(%rsp), %rdi
leaq 0x238(%rsp), %rdx
callq 0x20c0
leaq 0x10(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x25dc
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a06
callq 0x2200
movq 0x58(%rsp), %rax
cmpq 0x50(%rsp), %rax
je 0x43f9
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x43f9
leaq 0x238(%rsp), %rdi
callq 0x2390
movq 0x80(%rsp), %rsi
leaq 0x238(%rsp), %rdi
movl $0x10, %edx
callq 0x2040
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rbx
subq %rax, %rbx
sarq $0x3, %rbx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rbx
cmpq $0x1, %rbx
jbe 0x4418
movq 0x20(%rax), %r15
subq 0x18(%rax), %r15
leaq 0xf8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x47b2
leaq 0xf8(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x45e3
movsd %xmm0, 0x28(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x3546
movl 0x48(%rsp), %r14d
movl 0x4c(%rsp), %ebp
leaq 0x178(%rsp), %r12
leaq 0x50(%rsp), %rsi
movq %r12, %rdi
callq 0x47b2
shrq $0x3, %r15
cvttsd2si 0x28(%rsp), %rax
subq $0x8, %rsp
leaq 0x1d8(%rsp), %rdi
movl $0xfffffffb, %edx       # imm = 0xFFFFFFFB
movl %r14d, %esi
movl $0x100, %ecx            # imm = 0x100
movl %ebx, %r8d
movl %ebp, %r9d
pushq %r12
pushq %rax
pushq %r15
callq 0x4844
addq $0x20, %rsp
leaq 0x178(%rsp), %rdi
callq 0x3546
leaq 0xe0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x47b2
leaq 0x160(%rsp), %rdi
movl %ebx, -0x8(%rdi)
movl %r15d, -0x4(%rdi)
leaq 0xe0(%rsp), %rsi
callq 0x47b2
leaq 0xe0(%rsp), %rdi
callq 0x3546
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x4127
movq $0x0, (%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x38(%rsp)
leaq 0xc8(%rsp), %r14
leaq 0xb0(%rsp), %r12
movsd %xmm0, 0x30(%rsp)
movl $0x0, 0x28(%rsp)
movl $0x7, %edx
leaq 0x238(%rsp), %rdi
leaq 0x3700(%rip), %rsi      # 0x72a7
callq 0x2240
leaq 0x238(%rsp), %rdi
movq (%rsp), %rsi
callq 0x2160
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
callq 0x2050
movq %rax, %r13
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
movq (%rsp), %rsi
cmpq %rsi, %rdx
jbe 0x43d9
leaq (%rsi,%rsi,2), %rcx
movq %rcx, 0x78(%rsp)
leaq (%rax,%rcx,8), %rsi
leaq 0x140(%rsp), %rbx
movq %rbx, %rdi
callq 0x382a
movl 0xc(%rsp), %ecx
movq %r14, %rdi
leaq 0x1d0(%rsp), %rsi
movq %rbx, %rdx
callq 0x4d04
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x3c61
callq 0x2200
callq 0x2050
subq %r13, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x354a(%rip), %xmm0     # 0x71c0
movsd %xmm0, 0x70(%rsp)
callq 0x2050
movq %rax, %r13
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq (%rsp), %rdx
jbe 0x43c7
movq 0x78(%rsp), %rcx
leaq (%rax,%rcx,8), %rsi
leaq 0x128(%rsp), %rbx
movq %rbx, %rdi
callq 0x382a
movl 0xc(%rsp), %ecx
movq %r12, %rdi
leaq 0x158(%rsp), %rsi
movq %rbx, %rdx
callq 0x510a
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x3cef
callq 0x2200
callq 0x2050
subq %r13, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x34b9(%rip), %xmm0     # 0x71c0
movsd %xmm0, 0x68(%rsp)
movq 0xc8(%rsp), %r15
movq 0xb0(%rsp), %rbp
cmpq %r14, %r15
setne %al
cmpq %r12, %rbp
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3e8c
movl $0x1, %r13d
movl $0x11, %edx
leaq 0x238(%rsp), %rdi
leaq 0x3561(%rip), %rsi      # 0x72af
callq 0x2240
leaq 0x238(%rsp), %rdi
movl %r13d, %esi
callq 0x23b0
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x356b(%rip), %rsi      # 0x72e0
callq 0x2240
movl 0x10(%r15), %esi
movq %rbx, %rdi
callq 0x23b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movl $0xc, %edx
leaq 0x238(%rsp), %rdi
leaq 0x34fd(%rip), %rsi      # 0x72c1
callq 0x2240
movsd 0x18(%r15), %xmm0
leaq 0x238(%rsp), %rdi
callq 0x2310
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movl $0xd, %edx
leaq 0x238(%rsp), %rdi
leaq 0x34b4(%rip), %rsi      # 0x72ce
callq 0x2240
movsd 0x18(%rbp), %xmm0
leaq 0x238(%rsp), %rdi
callq 0x2310
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movsd 0x18(%r15), %xmm0
xorl %eax, %eax
ucomisd 0x18(%rbp), %xmm0
sete %al
addl %eax, 0x28(%rsp)
movq (%r15), %r15
movq (%rbp), %rbp
cmpq %r12, %rbp
setne %al
cmpq %r14, %r15
je 0x3e8c
incl %r13d
testb %al, %al
jne 0x3d3a
movl $0x6, %edx
leaq 0x238(%rsp), %rdi
leaq 0x343c(%rip), %rsi      # 0x72dc
callq 0x2240
leaq 0x238(%rsp), %rdi
movsd 0x70(%rsp), %xmm0
callq 0x2310
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movl $0x7, %edx
leaq 0x238(%rsp), %rdi
leaq 0x33ed(%rip), %rsi      # 0x72e3
callq 0x2240
leaq 0x238(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
callq 0x2310
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq (%rsp), %rdx
jbe 0x43e7
movq 0x78(%rsp), %rcx
leaq (%rax,%rcx,8), %rsi
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
callq 0x382a
xorps %xmm0, %xmm0
cvtsi2sdl 0x44(%rsp), %xmm0
leaq 0x90(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x540e
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb2
callq 0x2200
movl $0x11, %edx
leaq 0x238(%rsp), %rdi
leaq 0x3325(%rip), %rsi      # 0x72eb
callq 0x2240
movq 0x238(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x238(%rsp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
leaq 0x238(%rsp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movsd 0x38(%rsp), %xmm0
addsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x30(%rsp), %xmm0
addsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x90(%rsp), %r15
movq (%r15), %r15
leaq 0x90(%rsp), %rax
cmpq %rax, %r15
je 0x407d
movl 0x10(%r15), %esi
leaq 0x238(%rsp), %rdi
callq 0x23b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
jmp 0x4030
movl $0x3, %edx
leaq 0x238(%rsp), %rdi
leaq 0x326c(%rip), %rsi      # 0x72fd
callq 0x2240
movq 0x90(%rsp), %rdi
leaq 0x90(%rsp), %r15
cmpq %r15, %rdi
je 0x40bb
movq (%rdi), %rbx
callq 0x2200
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0x40ab
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x40d8
movq (%rdi), %rbx
callq 0x2200
movq %rbx, %rdi
cmpq %r12, %rbx
jne 0x40c8
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x40f5
movq (%rdi), %rbx
callq 0x2200
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x40e5
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
movq (%rsp), %rdx
incq %rdx
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movq %rdx, (%rsp)
cmpq %rax, %rdx
jb 0x3b93
jmp 0x413f
xorpd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
movl $0x0, 0x28(%rsp)
movsd %xmm0, 0x38(%rsp)
movq 0x5e92(%rip), %rdi      # 0x9fd8
leaq 0x31b4(%rip), %rsi      # 0x7301
movl $0xe, %edx
callq 0x2240
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movq %rax, %xmm0
punpckldq 0x3060(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x3068(%rip), %xmm0     # 0x71f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x38(%rsp), %xmm0
divsd %xmm1, %xmm0
movq 0x5e33(%rip), %rdi      # 0x9fd8
callq 0x2310
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq 0x5dfd(%rip), %rdi      # 0x9fd8
leaq 0x312e(%rip), %rsi      # 0x7310
movl $0xd, %edx
callq 0x2240
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movq %rax, %xmm0
punpckldq 0x2fcb(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2fd3(%rip), %xmm0     # 0x71f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
divsd %xmm1, %xmm0
movq 0x5d9e(%rip), %rdi      # 0x9fd8
callq 0x2310
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq 0x5d68(%rip), %rdi      # 0x9fd8
leaq 0x30a7(%rip), %rsi      # 0x731e
movl $0x1d, %edx
callq 0x2240
movq 0x5d50(%rip), %rdi      # 0x9fd8
movl 0x28(%rsp), %esi
callq 0x23b0
movq %rax, %rbx
leaq 0x30a1(%rip), %rsi      # 0x733c
movl $0x8, %edx
movq %rax, %rdi
callq 0x2240
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rsi
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rsi
imulq %rax, %rsi
movq %rbx, %rdi
callq 0x2160
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
leaq 0x238(%rsp), %rdi
callq 0x22a0
movq 0xa8(%rsp), %rdi
callq 0x2250
movq 0x88(%rsp), %rdi
callq 0x2250
movq 0x80(%rsp), %rdi
callq 0x2250
leaq 0x160(%rsp), %rdi
callq 0x3546
leaq 0x220(%rsp), %rdi
callq 0x3546
leaq 0x208(%rsp), %rdi
callq 0x5b0e
leaq 0x1f0(%rsp), %rdi
callq 0x6be2
movq 0x5c62(%rip), %rax      # 0x9fd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x240(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x238(%rsp,%rcx)
callq 0x21c0
leaq 0x330(%rsp), %rdi
callq 0x20a0
leaq 0x10(%rsp), %rdi
callq 0x3546
leaq 0x50(%rsp), %rdi
callq 0x3546
xorl %eax, %eax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f77(%rip), %rdi      # 0x7345
movq (%rsp), %rsi
xorl %eax, %eax
callq 0x22e0
leaq 0x2f65(%rip), %rdi      # 0x7345
xorl %eax, %eax
callq 0x22e0
leaq 0x2f57(%rip), %rdi      # 0x7345
movq (%rsp), %rsi
xorl %eax, %eax
callq 0x22e0
leaq 0x2e48(%rip), %rdi      # 0x7248
leaq 0x2e70(%rip), %rsi      # 0x7277
leaq 0x2e82(%rip), %rcx      # 0x7290
movl $0x25, %edx
callq 0x2150
leaq 0x2f26(%rip), %rdi      # 0x7345
movl $0x1, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22e0
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
jmp 0x45a8
movq %rax, %rbx
jmp 0x45ad
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
jmp 0x4460
jmp 0x446e
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x3546
jmp 0x45ba
jmp 0x446e
jmp 0x446e
movq %rax, %rbx
jmp 0x45ba
movq %rax, %rbx
jmp 0x45c7
movq %rax, %rbx
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x45d1
callq 0x2200
jmp 0x45d1
movq %rax, %rbx
jmp 0x45d1
movq %rax, %rbx
leaq 0x1c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x45db
callq 0x2200
jmp 0x45db
movq %rax, %rbx
jmp 0x45db
jmp 0x4537
jmp 0x4563
jmp 0x4563
movq %rax, %rbx
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x4566
callq 0x2200
jmp 0x4566
jmp 0x4537
jmp 0x4537
movq %rax, %rbx
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x45a0
callq 0x2200
jmp 0x45a0
jmp 0x4519
movq %rax, %rbx
jmp 0x4583
movq %rax, %rbx
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x4583
callq 0x2200
jmp 0x4583
jmp 0x453e
movq %rax, %rbx
jmp 0x45a0
jmp 0x4563
movq %rax, %rbx
leaq 0x90(%rsp), %r15
movq (%r15), %rdi
cmpq %r15, %rdi
je 0x4566
movq (%rdi), %r13
callq 0x2200
movq %r13, %rdi
cmpq %r15, %r13
jne 0x4551
jmp 0x4566
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x4583
movq (%rdi), %r15
callq 0x2200
movq %r15, %rdi
cmpq %r12, %r15
jne 0x4573
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x45a0
movq (%rdi), %r15
callq 0x2200
movq %r15, %rdi
cmpq %r14, %r15
jne 0x4590
leaq 0x160(%rsp), %rdi
callq 0x3546
leaq 0x1d0(%rsp), %rdi
callq 0x56fa
leaq 0x238(%rsp), %rdi
callq 0x22d0
leaq 0x10(%rsp), %rdi
callq 0x3546
leaq 0x50(%rsp), %rdi
callq 0x3546
movq %rbx, %rdi
callq 0x23c0