// File: /workspace/github_cpp_makefile_star2_O3/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::Build(std::vector<std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>, std::allocator<std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>>>, bool)
void db::Build( vector<vector<vector<string> > > reallocated_keys, bool bf_only )
{
	cout << "DB Build started." << endl;

	string index_command = "rm -rf " + index_dir+"/*";
	string data_command = "rm -rf " + data_dir+"/*";
	string bf_command = "rm -rf " + bf_dir+"/*";
	system(bf_command.c_str());
	if ( bf_only==false ){
		system(data_command.c_str());
		system(index_command.c_str());
	}
	
	fp_vec = vector<uint64_t> (num_levels, 0);
	n_vec = vector<uint64_t> (num_levels, 0);
	ofstream file_settings (settings_file, ios::out);
	file_settings << P << endl;
	file_settings << B << endl;
	file_settings << E << endl;
	file_settings << K << endl;
	file_settings << num_filter_units << endl;
	hash_digests = vector<uint64_t> (num_filter_units, 0);
	file_settings << num_levels << endl;
	file_settings << last_sst_keys << endl;

	ofstream file_fence(fence_file, ios::out);
	for ( int i=0 ; i<num_levels ; i++ ){
                int len = fence_pointers[i].size();
		for ( int j=0 ; j<len ; j++ ){
			file_fence << fence_pointers[i][j] << endl;
		}
	}
	file_fence.close();
	if(fastlocal_bf){
		FastLocalBF tmpbf = FastLocalBF(bpk/num_filter_units);
		filter_size = tmpbf.CalculateSpace(B*P);
		last_filter_size = tmpbf.CalculateSpace(last_sst_keys);
		num_probes = tmpbf.num_probes_;
	}else{
		LegacyBF tmpbf = LegacyBF(bpk/num_filter_units);
		uint32_t dont_care;
		filter_size = tmpbf.CalculateSpace(B*P, &dont_care, &num_lines);
		last_filter_size = tmpbf.CalculateSpace(last_sst_keys, &dont_care, &last_num_lines);
		num_probes = tmpbf.num_probes_;

	}
	
	
	bf_prime = (char****) malloc  ( num_levels * sizeof(char***));
	blk_fp_prime = (char****) malloc  ( num_levels * sizeof(char***));
	blk_size_prime = (int**) malloc (num_levels*sizeof(int*));
	cout << "total lv " << num_levels << endl;
	for( int l = 0; l < num_levels; l++){
		cout << "lv " << l << endl;
		vector<vector<string> > keys_one_level = reallocated_keys[l];
		int num_sst = keys_one_level.size();
		bf_prime[l] = (char***) malloc (num_sst*sizeof(char**));
		blk_fp_prime[l] = (char***) malloc (num_sst*sizeof(char**));
		blk_size_prime[l] = (int*) malloc (num_sst*sizeof(int));
		file_settings << num_sst << endl;
		for(int sst_index = 0; sst_index < num_sst; sst_index++){
			vector<string> keys_one_sst = keys_one_level[sst_index];
			char** sst_bf = (char**) malloc (num_filter_units*sizeof(char*));
			string sst_bf_prefix = bf_dir + "level_" + to_string(l) + "-sst_" + to_string(sst_index);



			for(int blo = 0; blo < num_filter_units; blo++){
				string sst_bf_filename = sst_bf_prefix + "_" + to_string(blo) +".txt";
				//cout << sst_bf_filename << endl;
				int end = keys_one_sst.size();
				if(fastlocal_bf){
					FastLocalBF bf = FastLocalBF(bpk/num_filter_units);
					for( int i=0 ; i <end ; i++){
					
						BFHash bfHash (keys_one_sst[i]);	
						vector<uint64_t>* hash_digests = bfHash.getLevelwiseHashDigest(l);
						BFHash::reset = true;
						bf.AddKey(keys_one_sst[i], hash_digests->at(blo));
					}
					bf.Finish();
					flushBFfile(sst_bf_filename, bf.data_, bf.space_);
					char* blo_bf = ( char*) malloc (bf.space_*sizeof(char));
					memcpy(blo_bf, bf.data_, bf.space_);
					sst_bf[blo] = blo_bf;
				}else{
					LegacyBF bf = LegacyBF(bpk/num_filter_units);
					for( int i=0 ; i <end ; i++){
					
						BFHash bfHash (keys_one_sst[i]);	
						vector<uint64_t>* hash_digests = bfHash.getLevelwiseHashDigest(l);
						BFHash::reset = true;
						bf.AddKey(keys_one_sst[i], hash_digests->at(blo));
					}
					bf.Finish();
					flushBFfile(sst_bf_filename, bf.data_, bf.space_);
					char* blo_bf = ( char*) malloc (bf.space_*sizeof(char));
					memcpy(blo_bf, bf.data_, bf.space_);
					sst_bf[blo] = blo_bf;
				}
				//FastLocalBF bf (bpk/num_filter_units*1000);
				
			}
			bf_prime[l][sst_index] = sst_bf;

			// fence pointers
			
			string sst_index_filename = index_dir + "level_" + to_string(l) + "-sst_" + to_string(sst_index) + ".txt";
			// building index
			char** index_one_sst = (char**) malloc (ceil(keys_one_sst.size()/B)*sizeof(char*));
			int j = 0;
			for( int i=0; i<keys_one_sst.size() ; i+=B ){
				index_one_sst[j] = (char *) malloc ((K+1)*sizeof(char));
				strcpy(index_one_sst[j], keys_one_sst[i].c_str());
				j++;
			}
			blk_fp_prime[l][sst_index] = index_one_sst;
			blk_size_prime[l][sst_index] = j;
			flushIndexes(sst_index_filename, index_one_sst, j, K);
			string sst_data_filename = data_dir + "level_" + to_string(l) + "-sst_" + to_string(sst_index) + ".txt";
			for( int i=0 ; i<keys_one_sst.size() ; i++ ){
				keys_one_sst[i].resize(E, '0');
			}
			flushfile(sst_data_filename, &keys_one_sst);
		
		}
	}

	file_settings.close();

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6c8, %rsp            # imm = 0x6C8
movl %edx, %ebx
movq %rsi, 0x218(%rsp)
movq %rdi, %r15
movq 0x30ce1(%rip), %r14     # 0x38fd0
leaq 0x210ea(%rip), %rsi     # 0x293e0
movl $0x11, %edx
movq %r14, %rdi
callq 0x5470
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
leaq 0x40(%r15), %rdx
leaq 0x210bd(%rip), %rsi     # 0x293f2
leaq 0x2c0(%rsp), %r14
movq %r14, %rdi
callq 0xd04f
leaq 0x210ae(%rip), %rsi     # 0x293fa
movq %r14, %rdi
callq 0x5720
leaq 0x208(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x8384
movq %rdx, 0x1f8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x208(%rsp)
jmp 0x838c
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x200(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x2d0(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x83bd
callq 0x53d0
leaq 0x60(%r15), %rdx
leaq 0x2102a(%rip), %rsi     # 0x293f2
leaq 0x2c0(%rsp), %rdi
callq 0xd04f
leaq 0x2101e(%rip), %rsi     # 0x293fa
leaq 0x2c0(%rsp), %rdi
callq 0x5720
leaq 0x1e8(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x8419
movq %rdx, 0x1d8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1e8(%rsp)
jmp 0x8421
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x1e0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x2c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x844e
callq 0x53d0
leaq 0x20(%r15), %rdx
leaq 0x20f99(%rip), %rsi     # 0x293f2
leaq 0x2c0(%rsp), %rdi
callq 0xd04f
leaq 0x20f8d(%rip), %rsi     # 0x293fa
leaq 0x2c0(%rsp), %rdi
callq 0x5720
leaq 0x1c8(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x84aa
movq %rdx, 0x1b8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1c8(%rsp)
jmp 0x84b2
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x1c0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x2c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x84df
callq 0x53d0
movq 0x1b8(%rsp), %rdi
callq 0x5360
testb %bl, %bl
jne 0x850a
movq 0x1d8(%rsp), %rdi
callq 0x5360
movq 0x1f8(%rsp), %rdi
callq 0x5360
movslq 0xdc(%r15), %rsi
leaq 0x4c0(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x2c0(%rsp), %rdi
leaq 0xe8(%rsp), %rcx
callq 0xd0d0
movq 0x1b0(%r15), %rdi
movapd 0x2c0(%rsp), %xmm0
movupd %xmm0, 0x1b0(%r15)
movq 0x2d0(%rsp), %rax
movq %rax, 0x1c0(%r15)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x2c0(%rsp)
movq $0x0, 0x2d0(%rsp)
testq %rdi, %rdi
je 0x8592
callq 0x53d0
movq 0x2c0(%rsp), %rdi
testq %rdi, %rdi
je 0x8592
callq 0x53d0
movslq 0xdc(%r15), %rsi
leaq 0x4c0(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x2c0(%rsp), %rdi
leaq 0xe8(%rsp), %rcx
callq 0xd0d0
movq 0x1c8(%r15), %rdi
movapd 0x2c0(%rsp), %xmm0
movupd %xmm0, 0x1c8(%r15)
movq 0x2d0(%rsp), %rax
movq %rax, 0x1d8(%r15)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x2c0(%rsp)
movq $0x0, 0x2d0(%rsp)
testq %rdi, %rdi
je 0x861a
callq 0x53d0
movq 0x2c0(%rsp), %rdi
testq %rdi, %rdi
je 0x861a
callq 0x53d0
leaq 0x80(%r15), %rsi
leaq 0x2c0(%rsp), %rdi
movl $0x10, %edx
callq 0x5730
movl 0xc4(%r15), %esi
leaq 0x2c0(%rsp), %rdi
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movl 0xc8(%r15), %esi
leaq 0x2c0(%rsp), %rdi
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movl 0xcc(%r15), %esi
leaq 0x2c0(%rsp), %rdi
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movl 0xd0(%r15), %esi
leaq 0x2c0(%rsp), %rdi
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movl 0x110(%r15), %esi
leaq 0x2c0(%rsp), %rdi
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movslq 0x110(%r15), %rsi
leaq 0xe8(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x4c0(%rsp), %rdi
leaq 0x170(%rsp), %rcx
callq 0xd0d0
movq 0x170(%r15), %rdi
movapd 0x4c0(%rsp), %xmm0
movupd %xmm0, 0x170(%r15)
movq 0x4d0(%rsp), %rax
movq %rax, 0x180(%r15)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x4c0(%rsp)
movq $0x0, 0x4d0(%rsp)
testq %rdi, %rdi
je 0x87f1
callq 0x53d0
movq 0x4c0(%rsp), %rdi
testq %rdi, %rdi
je 0x87f1
callq 0x53d0
movl 0xdc(%r15), %esi
leaq 0x2c0(%rsp), %rdi
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movl 0x100(%r15), %esi
leaq 0x2c0(%rsp), %rdi
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
leaq 0xa0(%r15), %rsi
leaq 0x4c0(%rsp), %rdi
movl $0x10, %edx
callq 0x5730
movq %r15, 0x98(%rsp)
movl 0xdc(%r15), %eax
testl %eax, %eax
jle 0x894d
xorl %r15d, %r15d
leaq 0x4c0(%rsp), %rbx
movq 0x98(%rsp), %rcx
movq 0x140(%rcx), %rcx
leaq (%r15,%r15,2), %r12
movq 0x8(%rcx,%r12,8), %r13
subq (%rcx,%r12,8), %r13
shrq $0x5, %r13
testl %r13d, %r13d
jle 0x893e
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl $0x8, %ebp
movq 0x98(%rsp), %rax
movq 0x140(%rax), %rax
movq (%rax,%r12,8), %rax
movq -0x8(%rax,%rbp), %rsi
movq (%rax,%rbp), %rdx
movq %rbx, %rdi
callq 0x5470
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
addq $0x20, %rbp
decq %r13
jne 0x88d9
movq 0x98(%rsp), %rax
movl 0xdc(%rax), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x88a8
leaq 0x4c0(%rsp), %rdi
callq 0x5570
movq 0x98(%rsp), %r15
cmpb $0x1, 0x10c(%r15)
jne 0x8a49
movl 0x104(%r15), %eax
cltd
idivl 0x110(%r15)
leaq 0xe8(%rsp), %rdi
movl %eax, %esi
callq 0xd49c
movl 0xc4(%r15), %eax
imull 0xc8(%r15), %eax
movslq 0xe8(%rsp), %rsi
testq %rsi, %rsi
setle %dl
testl %eax, %eax
setle %dil
movl $0x5, %ecx
orb %dl, %dil
movl $0x5, %edx
jne 0x89e3
movl %eax, %eax
imulq %rsi, %rax
addq $0x7cfff, %rax          # imm = 0x7CFFF
shrq $0xc, %rax
movabsq $0x20c49ba5e353f7d, %rdx # imm = 0x20C49BA5E353F7D
mulq %rdx
shll $0x6, %edx
orl $0x5, %edx
testl %esi, %esi
setle %dil
movl %edx, 0x120(%r15)
movslq 0x100(%r15), %rax
testq %rax, %rax
setle %dl
orb %dil, %dl
jne 0x8a26
imulq %rsi, %rax
addq $0x7cfff, %rax          # imm = 0x7CFFF
shrq $0xc, %rax
movabsq $0x20c49ba5e353f7d, %rcx # imm = 0x20C49BA5E353F7D
mulq %rcx
movq %rdx, %rcx
shll $0x6, %ecx
orl $0x5, %ecx
movl %ecx, 0x124(%r15)
leaq 0x108(%rsp), %rdi
movl -0x1c(%rdi), %eax
movl %eax, 0x130(%r15)
callq 0xe170
jmp 0x8b07
movl 0x104(%r15), %eax
cltd
idivl 0x110(%r15)
xorpd %xmm0, %xmm0
leaq 0xe8(%rsp), %rbx
movupd %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x206c8(%rip), %xmm0    # 0x29148
movl %eax, (%rbx)
cvttsd2si %xmm0, %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
cmpl $0x1e, %ecx
movl $0x1e, %eax
cmovll %ecx, %eax
movl %eax, 0x4(%rbx)
movl 0xc4(%r15), %esi
imull 0xc8(%r15), %esi
leaq 0x128(%r15), %rcx
leaq 0x170(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x7398
movl %eax, 0x120(%r15)
movl 0x100(%r15), %esi
leaq 0x12c(%r15), %rcx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x7398
movl %eax, 0x124(%r15)
movl 0x4(%rbx), %eax
movl %eax, 0x130(%r15)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x8b07
callq 0x53d0
movslq 0xdc(%r15), %rbx
shlq $0x3, %rbx
movq %rbx, %rdi
callq 0x5530
movq %rax, 0x158(%r15)
movq %rbx, %rdi
callq 0x5530
movq %rax, 0x160(%r15)
movq %rbx, %rdi
callq 0x5530
movq %rax, 0x168(%r15)
movq 0x3048a(%rip), %rdi     # 0x38fd0
leaq 0x208b0(%rip), %rsi     # 0x293fd
movl $0x9, %edx
callq 0x5470
movl 0xdc(%r15), %esi
movq 0x3046b(%rip), %rdi     # 0x38fd0
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
cmpl $0x0, 0xdc(%r15)
jle 0xa0ca
leaq 0x68(%rsp), %r13
movq $0x0, 0x8(%rsp)
movq 0x30419(%rip), %rbx     # 0x38fd0
leaq 0x228(%rsp), %r14
movl $0x3, %edx
movq %rbx, %rdi
leaq 0x20835(%rip), %rsi     # 0x29403
callq 0x5470
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movq 0x8(%rsp), %r12
leaq (%r12,%r12,2), %rsi
shlq $0x3, %rsi
movq 0x218(%rsp), %rax
addq (%rax), %rsi
movq %r14, %rdi
callq 0x6e16
movq 0x230(%rsp), %rbp
subq 0x228(%rsp), %rbp
sarq $0x3, %rbp
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rbp
movq %rbp, %rbx
shlq $0x20, %rbx
movq %rbx, %r14
sarq $0x1d, %r14
movq %r14, %rdi
callq 0x5530
movq 0x158(%r15), %rcx
movq %rax, (%rcx,%r12,8)
movq %r14, %rdi
callq 0x5530
movq 0x160(%r15), %rcx
movq %rax, (%rcx,%r12,8)
sarq $0x1e, %rbx
movq %rbx, %rdi
callq 0x5530
movq 0x168(%r15), %rcx
movq %rax, (%rcx,%r12,8)
leaq 0x2c0(%rsp), %rdi
movq %rbp, 0xc0(%rsp)
movl %ebp, %esi
callq 0x5680
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
cmpl $0x0, 0xc0(%rsp)
leaq 0xf8(%rsp), %r14
leaq 0x158(%rsp), %rbx
jle 0xa096
movq 0xc0(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0xc0(%rsp)
xorl %eax, %eax
movq %rax, 0x50(%rsp)
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x228(%rsp), %rsi
movq %rbx, %rdi
callq 0x690a
movslq 0x110(%r15), %rdi
shlq $0x3, %rdi
callq 0x5530
movq %rax, %r12
movq %r13, 0x58(%rsp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x6c14
movq %rbx, %rdi
leaq 0x206a3(%rip), %rsi     # 0x29407
callq 0x5720
movl $0x1, %ebx
cmpq $0xa, 0x8(%rsp)
jb 0x8dba
movl $0x4, %ebx
movq 0x8(%rsp), %rax
cmpl $0x63, %eax
jbe 0x8db3
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x8db8
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x8dba
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x8d80
addl $-0x3, %ebx
jmp 0x8dba
addl $-0x2, %ebx
jmp 0x8dba
decl %ebx
movl %ebx, %esi
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
movl $0x2d, %edx
callq 0x5480
movq 0x10(%rsp), %rdi
movl %ebx, %esi
movq 0x8(%rsp), %rdx
callq 0xe1ba
movq 0x58(%rsp), %rcx
movl $0xf, %edi
cmpq %r13, %rcx
je 0x8dfa
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %r8
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x8e2b
movl $0xf, %edi
leaq 0x20(%rsp), %r9
cmpq %r9, %rsi
je 0x8e26
movq 0x20(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x8e37
leaq 0x58(%rsp), %rdi
callq 0x5150
jmp 0x8e45
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5450
leaq 0x40(%rsp), %rsi
movq %rsi, 0x30(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x8e6a
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x8e72
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x30(%rsp), %rdi
leaq 0x20573(%rip), %rsi     # 0x2940e
callq 0x5720
movq %r14, 0xe8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x8ecc
movq %rdx, 0xe8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xf8(%rsp)
jmp 0x8ed5
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x50(%rsp), %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0xf0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl $0x1, %ebx
cmpq $0xa, %rsi
jb 0x8f41
movl $0x4, %ebx
movl %esi, %eax
cmpl $0x63, %eax
jbe 0x8f3a
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x8f3f
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x8f41
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x8f07
addl $-0x3, %ebx
jmp 0x8f41
addl $-0x2, %ebx
jmp 0x8f41
decl %ebx
movl %ebx, %esi
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x78(%rsp), %rdi
movl $0x2d, %edx
callq 0x5480
movq 0x78(%rsp), %rdi
movl %ebx, %esi
movq 0x50(%rsp), %rdx
callq 0xe1ba
movq 0xe8(%rsp), %rcx
movl $0xf, %edi
cmpq %r14, %rcx
je 0x8f8a
movq 0xf8(%rsp), %rdi
movq 0xf0(%rsp), %r8
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq 0x78(%rsp), %rdi
jbe 0x8fcd
movl $0xf, %r10d
leaq 0x88(%rsp), %r9
cmpq %r9, %rsi
je 0x8fc8
movq 0x88(%rsp), %r10
cmpq %r10, %rax
jbe 0x8fdc
leaq 0xe8(%rsp), %rdi
callq 0x5150
jmp 0x8fe5
xorl %esi, %esi
xorl %edx, %edx
callq 0x5450
leaq 0x180(%rsp), %rsi
movq %rsi, 0x170(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x9016
movq %rdx, 0x170(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x180(%rsp)
jmp 0x901e
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x178(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x9055
callq 0x53d0
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9067
callq 0x53d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x907b
callq 0x53d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x908f
callq 0x53d0
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x909e
callq 0x53d0
cmpl $0x0, 0x110(%r15)
jle 0x95fe
xorl %ebx, %ebx
movq %r13, 0x58(%rsp)
movq 0x170(%rsp), %rsi
movq 0x178(%rsp), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x6c14
movq %r14, %rdi
leaq 0x2032f(%rip), %rsi     # 0x2940c
callq 0x5720
movl $0x1, %r14d
cmpq $0xa, %rbx
jb 0x9134
movl $0x4, %r14d
movl %ebx, %eax
cmpl $0x63, %eax
jbe 0x912b
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x9131
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x9134
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r14d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x90f6
addl $-0x3, %r14d
jmp 0x9134
addl $-0x2, %r14d
jmp 0x9134
decl %r14d
movl %r14d, %esi
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
movl $0x2d, %edx
callq 0x5480
movq 0x10(%rsp), %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0xe1ba
movq 0x58(%rsp), %rcx
movl $0xf, %edi
cmpq %r13, %rcx
je 0x9173
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %r8
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq 0xf8(%rsp), %r14
jbe 0x91ac
movl $0xf, %edi
leaq 0x20(%rsp), %r9
cmpq %r9, %rsi
je 0x91a7
movq 0x20(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x91b8
leaq 0x58(%rsp), %rdi
callq 0x5150
jmp 0x91c6
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5450
movq %r14, 0xe8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x91ef
movq %rdx, 0xe8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xf8(%rsp)
jmp 0x91f8
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0xf0(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xe8(%rsp), %rdi
leaq 0x20ad6(%rip), %rsi     # 0x29cfd
callq 0x5720
leaq 0x40(%rsp), %rsi
movq %rsi, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9254
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x925c
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9286
callq 0x53d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x929a
callq 0x53d0
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x92a9
callq 0x53d0
movq 0x160(%rsp), %r14
subq 0x158(%rsp), %r14
shrq $0x5, %r14
cmpb $0x1, 0x10c(%r15)
jne 0x944c
movl 0x104(%r15), %eax
cltd
idivl 0x110(%r15)
leaq 0xe8(%rsp), %rdi
movl %eax, %esi
callq 0xd49c
testl %r14d, %r14d
jle 0x93a8
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
movq 0x158(%rsp), %rsi
addq %r13, %rsi
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
callq 0xd5b6
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
callq 0x116e6
leaq 0x300b0(%rip), %rcx     # 0x393d8
movb $0x1, (%rcx)
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
jbe 0xa1a3
movq (%rcx,%rbx,8), %rcx
movq %rcx, 0x10(%rsp)
movq 0x138(%rsp), %rax
movq 0x148(%rsp), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rax
je 0x9375
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, 0x138(%rsp)
jmp 0x9387
leaq 0x108(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe228
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x939b
callq 0x53d0
addq $0x20, %r13
decq %r14
jne 0x92fc
leaq 0xe8(%rsp), %rdi
callq 0xd60c
leaq 0x2b0(%rsp), %r14
leaq 0x2a0(%rsp), %r13
movq %r14, 0x2a0(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x6c14
movq 0xf8(%rsp), %rdx
movl 0x100(%rsp), %ecx
movq %r13, %rsi
callq 0xa69a
movq 0x2a0(%rsp), %rdi
cmpq %r14, %rdi
je 0x940b
callq 0x53d0
movl 0x100(%rsp), %r14d
movq %r14, %rdi
callq 0x5530
movq %rax, %rbp
movq 0xf8(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x5330
movq %rbp, (%r12,%rbx,8)
leaq 0x108(%rsp), %rdi
callq 0xe170
leaq 0x68(%rsp), %r13
jmp 0x95cf
movl 0x104(%r15), %eax
cltd
idivl 0x110(%r15)
leaq 0xf8(%rsp), %rcx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movl %eax, 0xe8(%rsp)
mulsd 0x1fcbf(%rip), %xmm0    # 0x29148
cvttsd2si %xmm0, %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovll %ecx, %eax
cmpl $0x1e, %eax
movl $0x1e, %ecx
cmovgel %ecx, %eax
movl %eax, 0xec(%rsp)
testl %r14d, %r14d
jle 0x9528
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movq 0x158(%rsp), %rsi
addq %r15, %rsi
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
callq 0xd5b6
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
callq 0x116e6
leaq 0x2fef3(%rip), %rcx     # 0x393d8
movb $0x1, (%rcx)
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
jbe 0xa1b4
movq (%rcx,%rbx,8), %rdx
leaq 0xe8(%rsp), %rdi
callq 0x7138
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x951f
callq 0x53d0
addq $0x20, %r15
decq %r14
jne 0x94b9
leaq 0xe8(%rsp), %rdi
callq 0x7174
leaq 0x290(%rsp), %r14
leaq 0x280(%rsp), %r15
movq %r14, 0x280(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x6c14
movq 0x110(%rsp), %rdx
movl 0xf4(%rsp), %ecx
movq %r15, %rsi
callq 0xa69a
movq 0x280(%rsp), %rdi
cmpq %r14, %rdi
je 0x958b
callq 0x53d0
movslq 0xf4(%rsp), %r14
movq %r14, %rdi
callq 0x5530
movq %rax, %rbp
movq 0x110(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x5330
movq %rbp, (%r12,%rbx,8)
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
movq 0x98(%rsp), %r15
je 0x95cf
callq 0x53d0
leaq 0xf8(%rsp), %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x95eb
callq 0x53d0
incq %rbx
movslq 0x110(%r15), %rax
cmpq %rax, %rbx
jl 0x90ae
movq 0x158(%r15), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rsp), %rcx
movq %r12, (%rax,%rcx,8)
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
callq 0x6c14
movq %rbx, %rdi
leaq 0x1fdc1(%rip), %rsi     # 0x29407
callq 0x5720
movl $0x1, %ebx
cmpq $0xa, 0x8(%rsp)
leaq 0xd8(%rsp), %r12
jb 0x96a4
movl $0x4, %ebx
movq 0x8(%rsp), %rax
cmpl $0x63, %eax
jbe 0x969d
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x96a2
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x96a4
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x966a
addl $-0x3, %ebx
jmp 0x96a4
addl $-0x2, %ebx
jmp 0x96a4
decl %ebx
movl %ebx, %esi
movq %r12, 0xc8(%rsp)
leaq 0xc8(%rsp), %rdi
movl $0x2d, %edx
callq 0x5480
movq 0xc8(%rsp), %rdi
movl %ebx, %esi
movq 0x8(%rsp), %rdx
callq 0xe1ba
movq 0x78(%rsp), %rcx
movl $0xf, %edi
leaq 0x88(%rsp), %rax
cmpq %rax, %rcx
je 0x96f3
movq 0x88(%rsp), %rdi
movq 0x80(%rsp), %r8
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq 0x78(%rsp), %rdi
leaq 0xc8(%rsp), %r10
jbe 0x9739
movl $0xf, %r9d
cmpq %r12, %rsi
je 0x9734
movq 0xd8(%rsp), %r9
cmpq %r9, %rax
jbe 0x9740
callq 0x5150
jmp 0x974c
movq %r10, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5450
leaq 0x20(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x9771
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x9779
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x10(%rsp), %rdi
leaq 0x1fc6c(%rip), %rsi     # 0x2940e
callq 0x5720
movq %r13, 0x58(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97ca
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0x97d4
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq 0x50(%rsp), %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl $0x1, %ebx
cmpq $0xa, %rsi
jb 0x983d
movl $0x4, %ebx
movl %esi, %eax
cmpl $0x63, %eax
jbe 0x9836
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x983b
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x983d
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x9803
addl $-0x3, %ebx
jmp 0x983d
addl $-0x2, %ebx
jmp 0x983d
decl %ebx
movl %ebx, %esi
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0xa0(%rsp), %rdi
movl $0x2d, %edx
callq 0x5480
movq 0xa0(%rsp), %rdi
movl %ebx, %esi
movq 0x50(%rsp), %rdx
callq 0xe1ba
movq 0x58(%rsp), %rcx
movl $0xf, %edi
cmpq %r13, %rcx
je 0x9889
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %r8
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x98c6
movl $0xf, %edi
leaq 0xb0(%rsp), %r9
cmpq %r9, %rsi
je 0x98c1
movq 0xb0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x98d2
leaq 0x58(%rsp), %rdi
callq 0x5150
jmp 0x98e3
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5450
leaq 0x40(%rsp), %rsi
movq %rsi, 0x30(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x9908
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x9910
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x30(%rsp), %rdi
leaq 0x203c4(%rip), %rsi     # 0x29cfd
callq 0x5720
movq %r14, 0xe8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x996a
movq %rdx, 0xe8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xf8(%rsp)
jmp 0x9973
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0xf0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x99a2
callq 0x53d0
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x99bc
callq 0x53d0
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x99cb
callq 0x53d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x99df
callq 0x53d0
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x99f1
callq 0x53d0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x9a08
callq 0x53d0
movq 0x158(%rsp), %r13
movq 0x160(%rsp), %rbp
movq %rbp, %rbx
subq %r13, %rbx
sarq $0x5, %rbx
movslq 0xc8(%r15), %rcx
movq %rbx, %rax
xorl %edx, %edx
movq %rcx, 0x1b0(%rsp)
divq %rcx
movq %rax, %xmm0
punpckldq 0x1f71a(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1f722(%rip), %xmm0    # 0x29170
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x1f6b6(%rip), %xmm1    # 0x29118
cvttsd2si %xmm1, %rax
xorl %r12d, %r12d
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x1f6d7(%rip), %xmm1    # 0x29150
cvttsd2si %xmm1, %rdi
andq %rcx, %rdi
orq %rax, %rdi
callq 0x5530
movq %rax, %r14
cmpq %r13, %rbp
je 0x9af4
movslq 0xd0(%r15), %rax
incq %rax
movq %rax, 0x220(%rsp)
movq 0x1b0(%rsp), %r15
shlq $0x5, %r15
xorl %r12d, %r12d
movq %r14, %rbp
xorl %r14d, %r14d
movq 0x220(%rsp), %rdi
callq 0x5530
movq %rax, (%rbp,%r12,8)
movq (%r13), %rsi
movq %rax, %rdi
callq 0x53c0
incq %r12
addq 0x1b0(%rsp), %r14
addq %r15, %r13
cmpq %r14, %rbx
ja 0x9ab8
movq 0x98(%rsp), %r15
movq %rbp, %r14
movq 0x160(%r15), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rsp), %rdx
movq %r14, (%rax,%rdx,8)
movq 0x168(%r15), %rax
movq (%rax,%rcx,8), %rax
movl %r12d, (%rax,%rdx,4)
leaq 0x270(%rsp), %r13
movq %r13, 0x260(%rsp)
movq 0xe8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x260(%rsp), %rbx
movq %rbx, %rdi
callq 0x6c14
movl 0xd0(%r15), %r8d
movq %rbx, %rsi
movq %r14, %rdx
movl %r12d, %ecx
leaq 0xf8(%rsp), %r14
callq 0xa766
movq 0x260(%rsp), %rdi
cmpq %r13, %rdi
je 0x9b7e
callq 0x53d0
leaq 0xd8(%rsp), %r12
movq %r12, 0xc8(%rsp)
movq 0x60(%r15), %rsi
movq 0x68(%r15), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
callq 0x6c14
leaq 0x68(%rsp), %r13
movq %rbx, %rdi
leaq 0x1f84f(%rip), %rsi     # 0x29407
callq 0x5720
movl $0x1, %ebx
cmpq $0xa, 0x8(%rsp)
jb 0x9c0e
movl $0x4, %ebx
movq 0x8(%rsp), %rax
cmpl $0x63, %eax
jbe 0x9c07
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x9c0c
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x9c0e
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x9bd4
addl $-0x3, %ebx
jmp 0x9c0e
addl $-0x2, %ebx
jmp 0x9c0e
decl %ebx
movl %ebx, %esi
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0xa0(%rsp), %rdi
movl $0x2d, %edx
callq 0x5480
movq 0xa0(%rsp), %rdi
movl %ebx, %esi
movq 0x8(%rsp), %rdx
callq 0xe1ba
movq 0xc8(%rsp), %rcx
movl $0xf, %edi
cmpq %r12, %rcx
je 0x9c60
movq 0xd8(%rsp), %rdi
movq 0xd0(%rsp), %r8
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq 0x78(%rsp), %rbx
jbe 0x9ca5
movl $0xf, %edi
leaq 0xb0(%rsp), %r9
cmpq %r9, %rsi
je 0x9ca0
movq 0xb0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x9cb4
leaq 0xc8(%rsp), %rdi
callq 0x5150
jmp 0x9cc5
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5450
leaq 0x88(%rsp), %rsi
movq %rsi, 0x78(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x9cf0
movq %rdx, 0x78(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x88(%rsp)
jmp 0x9cf8
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x80(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq %rbx, %rdi
leaq 0x1f6ec(%rip), %rsi     # 0x2940e
callq 0x5720
leaq 0x20(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9d4f
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x9d57
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x50(%rsp), %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl $0x1, %ebx
cmpq $0xa, %rsi
jb 0x9dc0
movl $0x4, %ebx
movl %esi, %eax
cmpl $0x63, %eax
jbe 0x9db9
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x9dbe
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x9dc0
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x9d86
addl $-0x3, %ebx
jmp 0x9dc0
addl $-0x2, %ebx
jmp 0x9dc0
decl %ebx
movl %ebx, %esi
leaq 0x1a0(%rsp), %rax
movq %rax, 0x190(%rsp)
leaq 0x190(%rsp), %rdi
movl $0x2d, %edx
callq 0x5480
movq 0x190(%rsp), %rdi
movl %ebx, %esi
movq 0x50(%rsp), %rdx
callq 0xe1ba
movq 0x10(%rsp), %rcx
movl $0xf, %edi
leaq 0x20(%rsp), %rax
cmpq %rax, %rcx
je 0x9e11
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %r8
movq 0x190(%rsp), %rsi
movq 0x198(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x9e4e
movl $0xf, %edi
leaq 0x1a0(%rsp), %r9
cmpq %r9, %rsi
je 0x9e49
movq 0x1a0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x9e5a
leaq 0x10(%rsp), %rdi
callq 0x5150
jmp 0x9e6b
leaq 0x190(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5450
movq %r13, 0x58(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x9e8b
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0x9e95
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x58(%rsp), %rdi
leaq 0x1fe3f(%rip), %rsi     # 0x29cfd
callq 0x5720
leaq 0x40(%rsp), %rsi
movq %rsi, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9eeb
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x9ef3
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x9f1a
callq 0x53d0
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x9f34
callq 0x53d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9f48
callq 0x53d0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x9f5f
callq 0x53d0
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x9f79
callq 0x53d0
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x9f8b
callq 0x53d0
movq 0x158(%rsp), %rdi
cmpq %rdi, 0x160(%rsp)
leaq 0x250(%rsp), %r12
je 0x9fe1
xorl %ebx, %ebx
xorl %r14d, %r14d
addq %rbx, %rdi
movslq 0xcc(%r15), %rsi
movl $0x30, %edx
callq 0x5140
incq %r14
movq 0x158(%rsp), %rdi
movq 0x160(%rsp), %rax
subq %rdi, %rax
sarq $0x5, %rax
addq $0x20, %rbx
cmpq %r14, %rax
ja 0x9faa
movq %r12, 0x240(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x240(%rsp), %rbx
movq %rbx, %rdi
callq 0x6c14
movq %rbx, %rsi
leaq 0x158(%rsp), %rdx
leaq 0xf8(%rsp), %r14
callq 0xa886
movq 0x240(%rsp), %rdi
cmpq %r12, %rdi
je 0xa030
callq 0x53d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
leaq 0x158(%rsp), %rbx
je 0xa04c
callq 0x53d0
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0xa05e
callq 0x53d0
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0xa078
callq 0x53d0
movq %rbx, %rdi
callq 0x698e
movq 0x50(%rsp), %rax
incq %rax
cmpq 0xc0(%rsp), %rax
jne 0x8d0d
leaq 0x228(%rsp), %r14
movq %r14, %rdi
callq 0x6bc8
movq 0x8(%rsp), %rdx
incq %rdx
movslq 0xdc(%r15), %rax
movq %rdx, 0x8(%rsp)
cmpq %rax, %rdx
movq 0x2ef0c(%rip), %rbx     # 0x38fd0
jl 0x8bbf
leaq 0x2c0(%rsp), %rbx
movq %rbx, %rdi
callq 0x5570
movq 0x2eecf(%rip), %rax     # 0x38fb0
movq (%rax), %r14
movq 0x18(%rax), %r15
leaq 0x4c8(%rsp), %rdi
movq %r14, -0x8(%rdi)
movq -0x18(%r14), %rax
movq %r15, 0x4c0(%rsp,%rax)
callq 0x5350
movl $0xf8, %r12d
leaq 0x4c0(%rsp), %rdi
addq %r12, %rdi
callq 0x5160
leaq 0x2c8(%rsp), %rdi
movq %r14, -0x8(%rdi)
movq -0x18(%r14), %rax
movq %r15, 0x2c0(%rsp,%rax)
callq 0x5350
addq %r12, %rbx
movq %rbx, %rdi
callq 0x5160
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0xa15d
callq 0x53d0
movq 0x1d8(%rsp), %rdi
leaq 0x1e8(%rsp), %rax
cmpq %rax, %rdi
je 0xa177
callq 0x53d0
movq 0x1f8(%rsp), %rdi
leaq 0x208(%rsp), %rax
cmpq %rax, %rdi
je 0xa191
callq 0x53d0
addq $0x6c8, %rsp            # imm = 0x6C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1eec9(%rip), %rdi     # 0x29073
movq %rbx, %rsi
xorl %eax, %eax
callq 0x55d0
leaq 0x1eeb8(%rip), %rdi     # 0x29073
movq %rbx, %rsi
xorl %eax, %eax
callq 0x55d0
jmp 0xa469
jmp 0xa23c
jmp 0xa23c
jmp 0xa22a
jmp 0xa22a
jmp 0xa22a
movq %rax, %rbx
movq 0x2c0(%rsp), %rdi
cmpq %r14, %rdi
jne 0xa658
jmp 0xa65d
movq %rax, %rbx
jmp 0xa65d
movq %rax, %rbx
movq 0x2c0(%rsp), %rdi
cmpq %r14, %rdi
jne 0xa672
jmp 0xa677
movq %rax, %rbx
jmp 0xa677
movq %rax, %rbx
leaq 0x2d0(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0xa687
movq %rax, %rbx
jmp 0xa643
jmp 0xa469
jmp 0xa469
movq %rax, %rbx
jmp 0xa60b
jmp 0xa411
jmp 0xa469
movq %rax, %rbx
movq 0x240(%rsp), %rdi
cmpq %r12, %rdi
je 0xa510
callq 0x53d0
jmp 0xa510
jmp 0xa505
movq %rax, %rbx
jmp 0xa28d
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa28d
callq 0x53d0
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0xa2ac
callq 0x53d0
jmp 0xa2ac
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0xa2d2
callq 0x53d0
jmp 0xa2d2
movq %rax, %rbx
leaq 0xf8(%rsp), %r14
jmp 0xa524
jmp 0xa31d
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xa309
callq 0x53d0
jmp 0xa309
movq %rax, %rbx
movq 0x260(%rsp), %rdi
cmpq %r13, %rdi
jne 0xa51f
jmp 0xa524
jmp 0xa4ba
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0xa320
callq 0x53d0
jmp 0xa320
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
jmp 0xa595
movq %rax, %rbx
jmp 0xa524
movq %rax, %rbx
jmp 0xa353
jmp 0xa36f
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0xa353
callq 0x53d0
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0xa37c
callq 0x53d0
jmp 0xa37c
movq %rax, %rbx
jmp 0xa3c6
movq %rax, %rbx
jmp 0xa390
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xa390
callq 0x53d0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0xa3ac
callq 0x53d0
jmp 0xa3ac
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0xa3c6
callq 0x53d0
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
jne 0xa51f
jmp 0xa524
movq %rax, %rbx
jmp 0xa5b9
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0xa41c
callq 0x53d0
jmp 0xa41c
jmp 0xa402
movq %rax, %rbx
jmp 0xa456
movq %rax, %rbx
jmp 0xa442
movq %rax, %rbx
jmp 0xa42e
movq %rax, %rbx
jmp 0xa5c6
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0xa42e
callq 0x53d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa442
callq 0x53d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xa456
callq 0x53d0
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
jne 0xa5b4
jmp 0xa5b9
movq %rax, %rbx
jmp 0xa5d3
movq %rax, %rbx
movq 0x280(%rsp), %rdi
cmpq %r14, %rdi
jne 0xa574
jmp 0xa579
movq %rax, %rbx
movq 0x2a0(%rsp), %rdi
cmpq %r14, %rdi
jne 0xa553
jmp 0xa558
movq %rax, %rbx
jmp 0xa58b
jmp 0xa535
jmp 0xa53a
movq %rax, %rbx
jmp 0xa4d9
movq %rax, %rbx
jmp 0xa59f
jmp 0xa4ef
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0xa4d9
callq 0x53d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xa4f2
callq 0x53d0
jmp 0xa4f2
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
jne 0xa59a
jmp 0xa59f
movq %rax, %rbx
leaq 0xf8(%rsp), %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa524
callq 0x53d0
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
jne 0xa59a
jmp 0xa59f
jmp 0xa567
movq %rax, %rbx
jmp 0xa579
movq %rax, %rbx
jmp 0xa558
jmp 0xa541
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq 0x58(%rsp), %rdi
cmpq %rax, %rdi
je 0xa558
callq 0x53d0
leaq 0x108(%rsp), %rdi
callq 0xe170
jmp 0xa58b
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0xa579
callq 0x53d0
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0xa58b
callq 0x53d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa59f
callq 0x53d0
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0xa5b9
callq 0x53d0
leaq 0x158(%rsp), %rdi
callq 0x698e
leaq 0x228(%rsp), %rdi
callq 0x6bc8
movq 0x2e9d6(%rip), %rax     # 0x38fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x4c8(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x4c0(%rsp,%rcx)
callq 0x5350
leaq 0x5b8(%rsp), %rdi
callq 0x5160
movq 0x2e99e(%rip), %rax     # 0x38fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x2c8(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x2c0(%rsp,%rcx)
callq 0x5350
leaq 0x3b8(%rsp), %rdi
callq 0x5160
leaq 0x1c8(%rsp), %rax
movq 0x1b8(%rsp), %rdi
cmpq %rax, %rdi
je 0xa65d
callq 0x53d0
leaq 0x1e8(%rsp), %rax
movq 0x1d8(%rsp), %rdi
cmpq %rax, %rdi
je 0xa677
callq 0x53d0
leaq 0x208(%rsp), %rax
movq 0x1f8(%rsp), %rdi
cmpq %rax, %rdi
je 0xa691
callq 0x53d0
movq %rbx, %rdi
callq 0x56b0
nop