// File: /workspace/github_cpp_makefile_star2_O2/splatlab[P]debgr/main.cc
// Function: main
int main(int argc, char *argv[])
{
	QF cf, last_cf, first_cf, exact_cf;
	QFi cfi;
	QF local_qfs[50];
	int mode = atoi(argv[1]);
	int qbits = atoi(argv[2]);
	int qbits_aux = atoi(argv[3]);
	int numthreads = atoi(argv[4]);
	int num_hash_bits = qbits+8;	  // we use 8 bits for remainders in the main QF
	int num_hash_bits_exact = 2*K;	  // for exact k-mer counting
	int num_hash_bits_aux = 2*(K-1);  // for exact counting.
	string first_ext(".first");
	string last_ext(".last");
	string exact_ext(".exact");
	string ser_ext(".ser");
	string log_ext(".log");
	string cluster_ext(".cluster");
	string freq_ext(".freq");
	struct timeval start1, start2, end1, end2;
	struct timezone tzp;
	uint32_t OVERHEAD_SIZE = 65535;

	for (int i = 5; i < argc; i++) {
		auto* fr = new reader;
		if (getFileReader(mode, argv[i], fr)) {
			file_pointer* fp = new file_pointer;
			fp->mode = mode;
			fp->freader.reset(fr);
			fp->part_buffer = new char[OVERHEAD_SIZE];
			ip_files.push(fp);
			num_files++;
		} else {
			delete fr;
		}
	}

	string ds_file = string(argv[5]) + ser_ext;
	string ds_file_first = string(argv[5]) + first_ext;
	string ds_file_last = string(argv[5]) + last_ext;
	string ds_file_exact = string(argv[5]) + exact_ext;
	string log_file = string(argv[5]) + log_ext;
	string cluster_file = string(argv[5]) + cluster_ext;
	//string freq_file = string(argv[5]) + freq_ext;
	
	uint32_t seed = time(NULL);
	//Initialize the main  QF and aux QFs
	qf_init(&cf, (1ULL<<qbits), num_hash_bits, 0, true, "", seed);
	qf_init(&exact_cf, (1ULL<<qbits), num_hash_bits_exact, 0, true, "", seed);
	qf_init(&first_cf, (1ULL<<qbits_aux), num_hash_bits_aux, 0, true, "", seed);
	qf_init(&last_cf, (1ULL<<qbits_aux), num_hash_bits_aux, 0, true, "", seed);

	boost::thread_group prod_threads;

	for (int i = 0; i < numthreads; i++) {
		qf_init(&local_qfs[i], (1ULL << QBITS_LOCAL_QF), num_hash_bits, 0, true,
						"", seed);
		flush_object* obj = (flush_object*)malloc(sizeof(flush_object));
		obj->local_qf = &local_qfs[i];
		obj->main_qf = &cf;
		obj->first_qf = &first_cf;
		obj->last_qf = &last_cf;
		obj->exact_qf = &exact_cf;
		prod_threads.add_thread(new boost::thread(fastq_to_uint64kmers_prod,
																							obj));
	}

	cout << "Reading from the fastq file and inserting in the QF" << endl;
	gettimeofday(&start1, &tzp);
	prod_threads.join_all();
	qf_serialize(&cf, ds_file.c_str());
	qf_serialize(&exact_cf, ds_file_exact.c_str());
	qf_serialize(&first_cf, ds_file_first.c_str());
	qf_serialize(&last_cf, ds_file_last.c_str());
	gettimeofday(&end1, &tzp);
	print_time_elapsed("", &start1, &end1);

	cout << "Calc freq distribution: " << endl;
	//ofstream freq_file;
	//freq_file.open(freq_file.c_str());
	uint64_t max_cnt = 0;
	qf_iterator(&cf, &cfi, 0);
	gettimeofday(&start2, &tzp);
	do {
		uint64_t key = 0, value = 0, count = 0;
		qfi_get(&cfi, &key, &value, &count);
		//freq_file << key << " " << count << endl;
		if (max_cnt < count)
			max_cnt = count;
	} while (!qfi_next(&cfi));
	gettimeofday(&end2, &tzp);
	print_time_elapsed("", &start2, &end2);

	cout << "Maximum freq: " << max_cnt << endl;
	//freq_file.close();

	cout << "Num distinct elem: " << cf.metadata->ndistinct_elts << endl;
	cout << "Total num elems: " << cf.metadata->nelts << endl;

	//to validate the invertible hashing and exact QF
	qf_iterator(&exact_cf, &cfi, 0);
	do {
		uint64_t key = 0, value = 0, count = 0;
		qfi_get(&cfi, &key, &value, &count);
		//cout << int_to_str_node(HashUtil::hash_64i(key, BITMASK(2*K))) << endl;
	} while (!qfi_next(&cfi));
	cout << "Exact: Num distinct elem: " << exact_cf.metadata->ndistinct_elts << endl;
	cout << "Exact: Total num elems: " << exact_cf.metadata->nelts << endl;

	//to validate the invertible hashing and exact QF
	qf_iterator(&first_cf, &cfi, 0);
	do {
		uint64_t key = 0, value = 0, count = 0;
		qfi_get(&cfi, &key, &value, &count);
		//cout << int_to_str_node(HashUtil::hash_64i(key, BITMASK(2*K))) << endl;
	} while (!qfi_next(&cfi));
	cout << "First: Num distinct elem: " << first_cf.metadata->ndistinct_elts << endl;
	cout << "First: Total num elems: " << first_cf.metadata->nelts << endl;

	//to validate the invertible hashing and exact QF
	qf_iterator(&last_cf, &cfi, 0);
	do {
		uint64_t key = 0, value = 0, count = 0;
		qfi_get(&cfi, &key, &value, &count);
		//cout << int_to_str_node(HashUtil::hash_64i(key, BITMASK(2*K))) << endl;
	} while (!qfi_next(&cfi));
	cout << "Last: Num distinct elem: " << last_cf.metadata->ndistinct_elts << endl;
	cout << "Last: Total num elems: " << last_cf.metadata->nelts << endl;

#ifdef LOG_WAIT_TIME
	ofstream wait_time_log;
	wait_time_log.open(log_file.c_str());
	wait_time_log << "Id\tTotalTimeSingle\tTotalTimeSpinning\tNumLocks\tNumSingleAttempt\tPercentageSpinningTimes"
		<< endl;
	for (uint32_t i=0; i<cf.num_locks; i++)
		wait_time_log << i << "\t" << cf.wait_times[i].total_time_single << "\t\t\t" 
			<< cf.wait_times[i].total_time_spinning << "\t\t\t" 
			<< cf.wait_times[i].locks_taken << "\t\t\t" 
			<< cf.wait_times[i].locks_acquired_single_attempt << "\t\t\t"
			<< ((double)(cf.wait_times[i].locks_taken
									 -cf.wait_times[i].locks_acquired_single_attempt)
					/(double)cf.wait_times[i].locks_taken)*100
			<< endl;
	wait_time_log.close();
#endif

#ifdef LOG_CLUSTER_LENGTH
	ofstream cluster_len_log;
	cluster_len_log.open(cluster_file.c_str());
	cluster_len_log << "StartingIndex\tLength" << endl;
	for (uint32_t i = 0; i < cfi.num_clusters; i++)
		cluster_len_log << cfi.c_info[i].start_index << "\t\t" << 
			cfi.c_info[i].length << endl;
	cluster_len_log.close();

#endif

	//destroy the QF and reclaim the memory
	qf_destroy(&cf, true);
	qf_destroy(&first_cf, true);
	qf_destroy(&last_cf, true);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8f8, %rsp            # imm = 0x8F8
movq %rsi, %r15
movl %edi, %r13d
movq 0x8(%rsi), %rdi
callq 0x5540
movl %eax, %r12d
movq 0x10(%r15), %rdi
callq 0x5540
movl %eax, 0x20(%rsp)
movq 0x18(%r15), %rdi
callq 0x5540
movl %eax, 0x2c(%rsp)
movq 0x20(%r15), %rdi
callq 0x5540
movl %eax, %ebx
leaq 0x6cb3(%rip), %rsi      # 0xd050
leaq 0x2b0(%rsp), %rdi
leaq 0x2d0(%rsp), %rdx
callq 0x5110
leaq 0x6c9e(%rip), %rsi      # 0xd057
leaq 0x290(%rsp), %rdi
leaq 0x2d0(%rsp), %rdx
callq 0x5110
leaq 0x6c88(%rip), %rsi      # 0xd05d
leaq 0x270(%rsp), %rdi
leaq 0x2d0(%rsp), %rdx
callq 0x5110
leaq 0x6c73(%rip), %rsi      # 0xd064
leaq 0x250(%rsp), %rdi
leaq 0x2d0(%rsp), %rdx
callq 0x5110
leaq 0x6c5c(%rip), %rsi      # 0xd069
leaq 0x230(%rsp), %rdi
leaq 0x2d0(%rsp), %rdx
callq 0x5110
leaq 0x6c45(%rip), %rsi      # 0xd06e
leaq 0x210(%rsp), %rdi
leaq 0x2d0(%rsp), %rdx
callq 0x5110
movq %rbx, 0x80(%rsp)
leaq 0x6c2a(%rip), %rsi      # 0xd077
leaq 0x420(%rsp), %rdi
leaq 0x2d0(%rsp), %rdx
callq 0x5110
movl 0x20(%rsp), %eax
addl $0x8, %eax
movl %eax, 0x28(%rsp)
movslq %r13d, %rbp
pushq $0x5
popq %r14
pushq $0x20
popq %rbx
cmpq %rbp, %r14
jge 0x6519
movq %rbx, %rdi
callq 0x5340
movq %rax, %r13
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rax)
movups %xmm0, (%rax)
movq (%r15,%r14,8), %rsi
movl %r12d, %edi
movq %rax, %rdx
callq 0x6295
testb %al, %al
je 0x6509
pushq $0x30
popq %rdi
callq 0x5340
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movq %rax, 0x2d0(%rsp)
movl %r12d, 0x18(%rax)
movq %rax, %rdi
movq %r13, %rsi
callq 0x9974
movl $0xffff, %edi           # imm = 0xFFFF
callq 0x5040
movq 0x2d0(%rsp), %rcx
movq %rax, 0x10(%rcx)
leaq 0xdea5(%rip), %rdi      # 0x14398
leaq 0x2d0(%rsp), %rsi
callq 0x97c8
lock
incl 0xdf29(%rip)            # 0x14430
jmp 0x6511
movq %r13, %rdi
callq 0x5310
incq %r14
jmp 0x6477
movq 0x28(%r15), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0x5110
leaq 0x1b0(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
leaq 0x250(%rsp), %rdx
callq 0x74df
leaq 0x2d0(%rsp), %rdi
callq 0x5130
movq 0x28(%r15), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0xf0(%rsp), %rdx
callq 0x5110
leaq 0x110(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
leaq 0x2b0(%rsp), %rdx
callq 0x74df
leaq 0x2d0(%rsp), %rdi
callq 0x5130
movq 0x28(%r15), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
callq 0x5110
leaq 0xf0(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
leaq 0x290(%rsp), %rdx
callq 0x74df
leaq 0x2d0(%rsp), %rdi
callq 0x5130
movq 0x28(%r15), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x5110
leaq 0xd0(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
leaq 0x270(%rsp), %rdx
callq 0x74df
leaq 0x2d0(%rsp), %rdi
callq 0x5130
movq 0x28(%r15), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0x170(%rsp), %rdx
callq 0x5110
leaq 0x190(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
leaq 0x230(%rsp), %rdx
callq 0x74df
leaq 0x2d0(%rsp), %rdi
callq 0x5130
movq 0x28(%r15), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5110
leaq 0x170(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
leaq 0x210(%rsp), %rdx
callq 0x74df
leaq 0x2d0(%rsp), %rdi
callq 0x5130
xorl %edi, %edi
callq 0x5300
movq %rax, %r15
pushq $0x1
popq %r14
movq %r14, %rbx
movl 0x20(%rsp), %ecx
shlq %cl, %rbx
movslq 0x28(%rsp), %rdx
movl %r15d, (%rsp)
leaq 0x7279(%rip), %r9       # 0xd949
leaq 0x68(%rsp), %rdi
pushq $0x1
popq %r8
movq %rbx, %rsi
movq %rdx, 0x20(%rsp)
xorl %ecx, %ecx
callq 0xa338
movl %r15d, (%rsp)
leaq 0x7256(%rip), %r9       # 0xd949
leaq 0x88(%rsp), %rdi
pushq $0x38
popq %rdx
pushq $0x1
popq %r8
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0xa338
movl 0x2c(%rsp), %ecx
shlq %cl, %r14
movl %r15d, (%rsp)
leaq 0x722b(%rip), %r9       # 0xd949
leaq 0x38(%rsp), %rdi
pushq $0x36
popq %rdx
pushq $0x1
popq %r8
movq %r14, %rsi
xorl %ecx, %ecx
callq 0xa338
movl %r15d, (%rsp)
leaq 0x720a(%rip), %r9       # 0xd949
leaq 0x50(%rsp), %rdi
pushq $0x36
popq %rdx
pushq $0x1
popq %r8
movq %r14, %rsi
xorl %ecx, %ecx
callq 0xa338
leaq 0x2d0(%rsp), %rdi
callq 0x74fe
xorl %ebx, %ebx
movq 0x80(%rsp), %rax
testl %eax, %eax
cmovlel %ebx, %eax
imulq $0x18, %rax, %r12
leaq 0x2d0(%rsp), %r13
cmpq %rbx, %r12
je 0x681c
leaq (%rsp,%rbx), %rbp
addq $0x440, %rbp            # imm = 0x440
movl %r15d, (%rsp)
movl $0x10000, %esi          # imm = 0x10000
movq %rbp, %rdi
movq 0x20(%rsp), %rdx
xorl %ecx, %ecx
pushq $0x1
popq %r8
leaq 0x719a(%rip), %r9       # 0xd949
callq 0xa338
pushq $0x38
popq %rdi
callq 0x5470
movq %rax, %r14
movq %rbp, 0x10(%rax)
leaq 0x68(%rsp), %rax
movq %rax, 0x18(%r14)
leaq 0x38(%rsp), %rax
movq %rax, (%r14)
leaq 0x50(%rsp), %rax
movq %rax, 0x8(%r14)
leaq 0x88(%rsp), %rax
movq %rax, 0x20(%r14)
pushq $0x10
popq %rdi
callq 0x5340
movq %rax, %rbp
movq %rax, %rdi
leaq 0x751(%rip), %rsi       # 0x6f4f
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x7584
movq %r13, %rdi
movq %rbp, %rsi
callq 0x7536
addq $0x18, %rbx
jmp 0x677d
movq 0xd7a5(%rip), %rdi      # 0x13fc8
leaq 0x6853(%rip), %rsi      # 0xd07d
callq 0x5320
movq %rax, %rdi
callq 0x5140
leaq 0x200(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x55a0
leaq 0x2d0(%rsp), %rdi
callq 0x75ca
movq 0x1b0(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0xa76a
movq 0xd0(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0xa76a
movq 0x110(%rsp), %rsi
leaq 0x38(%rsp), %rdi
callq 0xa76a
movq 0xf0(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0xa76a
leaq 0x1e0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x55a0
leaq 0x708f(%rip), %rsi      # 0xd949
leaq 0x150(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5110
leaq 0x150(%rsp), %rdi
leaq 0x200(%rsp), %rsi
leaq 0x1e0(%rsp), %rdx
callq 0x5a27
leaq 0x150(%rsp), %rdi
callq 0x5130
movq 0xd6cb(%rip), %rdi      # 0x13fc8
leaq 0x67ad(%rip), %rsi      # 0xd0b1
callq 0x5320
movq %rax, %rdi
callq 0x5140
leaq 0x68(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
xorl %edx, %edx
callq 0xbce1
leaq 0x1f0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x55a0
xorl %ebx, %ebx
leaq 0xa0(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x18(%rsp), %r12
leaq 0x10(%rsp), %r13
andq $0x0, 0x8(%rsp)
andq $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0xbe9e
movq 0x10(%rsp), %rbp
movq %r14, %rdi
callq 0xbf26
cmpq %rbp, %rbx
cmovbeq %rbp, %rbx
testl %eax, %eax
je 0x6950
leaq 0x1d0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x55a0
leaq 0x6fa5(%rip), %rsi      # 0xd949
leaq 0x130(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5110
leaq 0x130(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
callq 0x5a27
leaq 0x130(%rsp), %rdi
callq 0x5130
movq 0xd5e1(%rip), %rdi      # 0x13fc8
leaq 0x66dc(%rip), %rsi      # 0xd0ca
callq 0x5320
movq %rax, %rdi
movq %rbx, %rsi
callq 0x51f0
movq %rax, %rdi
callq 0x5140
movq 0xd5bb(%rip), %rdi      # 0x13fc8
leaq 0x66cc(%rip), %rsi      # 0xd0e0
callq 0x5320
movq 0x70(%rsp), %rcx
movq 0x60(%rcx), %rsi
movq %rax, %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x5140
movq 0xd58f(%rip), %rdi      # 0x13fc8
leaq 0x66bb(%rip), %rsi      # 0xd0fb
callq 0x5320
movq 0x70(%rsp), %rcx
movq 0x58(%rcx), %rsi
movq %rax, %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x5140
leaq 0x88(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
xorl %edx, %edx
callq 0xbce1
leaq 0xa0(%rsp), %rbx
leaq 0x8(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x10(%rsp), %r12
andq $0x0, 0x8(%rsp)
andq $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0xbe9e
movq %rbx, %rdi
callq 0xbf26
testl %eax, %eax
je 0x6a8c
movq 0xd506(%rip), %rdi      # 0x13fc8
leaq 0x6610(%rip), %rsi      # 0xd0d9
callq 0x5320
movq 0x90(%rsp), %rcx
movq 0x60(%rcx), %rsi
movq %rax, %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x5140
movq 0xd4d7(%rip), %rdi      # 0x13fc8
leaq 0x65fc(%rip), %rsi      # 0xd0f4
callq 0x5320
movq 0x90(%rsp), %rcx
movq 0x58(%rcx), %rsi
movq %rax, %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x5140
leaq 0x38(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
xorl %edx, %edx
callq 0xbce1
leaq 0xa0(%rsp), %rbx
leaq 0x8(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x10(%rsp), %r12
andq $0x0, 0x8(%rsp)
andq $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0xbe9e
movq %rbx, %rdi
callq 0xbf26
testl %eax, %eax
je 0x6b44
movq 0xd44e(%rip), %rdi      # 0x13fc8
leaq 0x658c(%rip), %rsi      # 0xd10d
callq 0x5320
movq 0x40(%rsp), %rcx
movq 0x60(%rcx), %rsi
movq %rax, %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x5140
movq 0xd422(%rip), %rdi      # 0x13fc8
leaq 0x657b(%rip), %rsi      # 0xd128
callq 0x5320
movq 0x40(%rsp), %rcx
movq 0x58(%rcx), %rsi
movq %rax, %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x5140
leaq 0x50(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
xorl %edx, %edx
callq 0xbce1
leaq 0xa0(%rsp), %rbx
leaq 0x8(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x10(%rsp), %r12
andq $0x0, 0x8(%rsp)
andq $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0xbe9e
movq %rbx, %rdi
callq 0xbf26
testl %eax, %eax
je 0x6bf6
movq 0xd39c(%rip), %rdi      # 0x13fc8
leaq 0x650e(%rip), %rsi      # 0xd141
callq 0x5320
movq 0x58(%rsp), %rcx
movq 0x60(%rcx), %rsi
movq %rax, %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x5140
movq 0xd370(%rip), %rdi      # 0x13fc8
leaq 0x64fc(%rip), %rsi      # 0xd15b
callq 0x5320
movq 0x58(%rsp), %rcx
movq 0x58(%rcx), %rsi
movq %rax, %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x5140
leaq 0x68(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0xa610
leaq 0x38(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0xa610
leaq 0x50(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0xa610
leaq 0x2d0(%rsp), %rdi
callq 0x762c
leaq 0x170(%rsp), %rdi
callq 0x5130
leaq 0x190(%rsp), %rdi
callq 0x5130
leaq 0xd0(%rsp), %rdi
callq 0x5130
leaq 0xf0(%rsp), %rdi
callq 0x5130
leaq 0x110(%rsp), %rdi
callq 0x5130
leaq 0x1b0(%rsp), %rdi
callq 0x5130
leaq 0x420(%rsp), %rdi
callq 0x5130
leaq 0x210(%rsp), %rdi
callq 0x5130
leaq 0x230(%rsp), %rdi
callq 0x5130
leaq 0x250(%rsp), %rdi
callq 0x5130
leaq 0x270(%rsp), %rdi
callq 0x5130
leaq 0x290(%rsp), %rdi
callq 0x5130
leaq 0x2b0(%rsp), %rdi
callq 0x5130
xorl %eax, %eax
addq $0x8f8, %rsp            # imm = 0x8F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
jmp 0x6d8b
jmp 0x6e89
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x5130
jmp 0x6e8c
jmp 0x6e89
jmp 0x6e5c
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
jmp 0x6ea1
movq %rax, %rbx
jmp 0x6ea6
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
jmp 0x6eae
movq %rax, %rbx
jmp 0x6eb3
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
jmp 0x6ebb
movq %rax, %rbx
jmp 0x6ec0
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
jmp 0x6ec8
movq %rax, %rbx
jmp 0x6ecd
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
jmp 0x6ed5
movq %rax, %rbx
jmp 0x6eda
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
jmp 0x6ee2
jmp 0x6f4a
movq %rax, %rbx
jmp 0x6ef4
movq %rax, %rbx
jmp 0x6f01
movq %rax, %rbx
jmp 0x6f0e
movq %rax, %rbx
jmp 0x6f1b
movq %rax, %rbx
jmp 0x6f28
movq %rax, %rbx
jmp 0x6f35
movq %rax, %rbx
jmp 0x6e99
jmp 0x6e89
jmp 0x6e89
movq %rax, %rbx
movq %rbp, %rdi
callq 0x5310
jmp 0x6e8c
jmp 0x6e89
jmp 0x6e89
jmp 0x6e89
jmp 0x6e89
jmp 0x6e89
jmp 0x6e89
jmp 0x6e89
jmp 0x6e89
jmp 0x6e89
jmp 0x6f4a
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
callq 0x762c
leaq 0x170(%rsp), %rdi
callq 0x5130
leaq 0x190(%rsp), %rdi
callq 0x5130
leaq 0xd0(%rsp), %rdi
callq 0x5130
leaq 0xf0(%rsp), %rdi
callq 0x5130
leaq 0x110(%rsp), %rdi
callq 0x5130
leaq 0x1b0(%rsp), %rdi
callq 0x5130
leaq 0x420(%rsp), %rdi
callq 0x5130
leaq 0x210(%rsp), %rdi
callq 0x5130
leaq 0x230(%rsp), %rdi
callq 0x5130
leaq 0x250(%rsp), %rdi
callq 0x5130
leaq 0x270(%rsp), %rdi
callq 0x5130
leaq 0x290(%rsp), %rdi
callq 0x5130
leaq 0x2b0(%rsp), %rdi
callq 0x5130
movq %rbx, %rdi
callq 0x5600
movq %rax, %rbx
jmp 0x6ee7