LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/m-wiesner[P]Jotto/ScoreKeeper.cpp
// Function: ScoreKeeper::submit_score(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Guesser*)
bool ScoreKeeper::submit_score (const string& guess, Guesser *g)// submit score of string to guesser
{
    if (codewords[g->get_player()] == guess)
    {
        cout << endl;
        cout << "!!! " << g->get_player() << " GUESSED " << guess;
        cout << " AND WON !!!" << endl;
        return false;
    }
     
    int s = score(guess, codewords[g->get_player()]); 
    g->add_guess(guess, s);
    g->print_guesses();
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x3ce2
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d50
movq %rax, %rdi
movq %r14, %rsi
callq 0x4468
movl %eax, %ebx
leaq -0x48(%rbp), %rdi
callq 0x2100
testb %bl, %bl
je 0x4b8f
movq 0x54b5(%rip), %r12      # 0x9fd0
movq %r12, %rdi
callq 0x2110
leaq 0x1ae6(%rip), %rsi      # 0x6610
movq %r12, %rdi
callq 0x2230
movq %rax, %r12
leaq -0x48(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x3ce2
movq %r12, %rdi
movq %r13, %rsi
callq 0x2200
leaq 0x1abf(%rip), %rsi      # 0x6615
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
leaq -0x48(%rbp), %rdi
callq 0x2100
movq 0x5457(%rip), %rdi      # 0x9fd0
leaq 0x1a9f(%rip), %rsi      # 0x661f
callq 0x2230
movq %rax, %rdi
callq 0x2110
jmp 0x4c0d
leaq -0x90(%rbp), %rdi
movq %r14, %rsi
callq 0x22f0
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x3ce2
leaq -0x48(%rbp), %rsi
movq %r12, %rdi
callq 0x4d50
leaq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x22f0
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3583
movl %eax, %r12d
leaq -0x70(%rbp), %rdi
callq 0x2100
leaq -0x48(%rbp), %rdi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2100
leaq -0x4c(%rbp), %rdx
movl %r12d, (%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x3c92
movq %r15, %rdi
callq 0x3e52
xorb $0x1, %bl
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2100
jmp 0x4c37
movq %rax, %rbx
jmp 0x4c40
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2100
leaq -0x90(%rbp), %rdi
jmp 0x4c52
jmp 0x4c4b
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2360
nop
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/ullur.cpp
// Function: multiget(std::unordered_map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long>>>>>&, unsigned long)
std::vector< uint64_t > multiget( std::unordered_map< uint64_t, std::vector< uint64_t > > &db, uint64_t key ){
	std::vector< uint64_t > out;
	std::unordered_map< uint64_t, std::vector< uint64_t > >::iterator it;
	
	it = db.find( key );
	if( it != db.end() ){
		for( size_t i = 0 ; i < (it->second).size() ; ++i ){
			out.push_back( (it->second)[i] );
			}
		}
	
	return out;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movq %rsp, %rsi
movq %rdx, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rax, %rdi
callq 0x3b50
movq %rax, %r14
testq %rax, %rax
je 0x2699
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rax
subq %rsi, %rax
sarq $0x3, %rax
cmpq %rax, %r12
jae 0x2699
addq %r15, %rsi
movq %rbx, %rdi
callq 0x3932
incq %r12
addq $0x8, %r15
jmp 0x2671
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x26aa
movq %rax, %r14
movq %rbx, %rdi
callq 0x3b42
movq %r14, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/ullur.cpp
// Function: send_string(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void send_string( int sock, std::string str ){
	const char *data = str.c_str();
	size_t L = 0;
	int n;
	while( L < str.size() ){
		n = send( sock, data + L, str.size() - L, 0 );
		
		if( n >= 0 ){ L += n; }
		else {
			std::cout << "Error: " << strerror( errno ) << ", L = "<< L << std::endl;
			return;
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
movq (%rsi), %r15
xorl %ebx, %ebx
movq 0x8(%r14), %rdx
subq %rbx, %rdx
jbe 0x26f2
leaq (%r15,%rbx), %rsi
movl %ebp, %edi
xorl %ecx, %ecx
callq 0x2180
testl %eax, %eax
js 0x26fd
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %rbx
jmp 0x26ce
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x68d4(%rip), %rdi      # 0x8fd8
leaq 0x3945(%rip), %rsi      # 0x6050
callq 0x2260
movq %rax, %r14
callq 0x2030
movl (%rax), %edi
callq 0x2100
movq %r14, %rdi
movq %rax, %rsi
callq 0x2260
leaq 0x3927(%rip), %rsi      # 0x6058
movq %rax, %rdi
callq 0x2260
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21d0
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2170
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/ullur.cpp
// Function: handle_put[abi:cxx11](double, double, unsigned long)
std::string handle_put( double x, double y, uint64_t id ){
	std::string out;
	uint64_t H;
	H = compute_hash( x, y );
	hashes.insert( H );
	//database.insert( std::pair< uint64_t, uint64_t >( H, id ) );
	if( database.find( H ) != database.end() ){
		database[H].push_back( id );
		}
	else{
		database[H] = std::vector< uint64_t >();
		database[H].push_back( id );
		}
	out = "Ok.\r\n";

	return out;
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
callq 0x48ec
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0x6acd(%rip), %rdi      # 0x9268
callq 0x3d0e
leaq 0x6af1(%rip), %rdi      # 0x9298
movq %rsp, %rsi
callq 0x3b50
testq %rax, %rax
jne 0x27e9
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
leaq 0x6acf(%rip), %rdi      # 0x9298
movq %rsp, %rsi
callq 0x3e68
leaq 0x10(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x4192
movq %r14, %rdi
callq 0x3b42
leaq 0x6aa8(%rip), %rdi      # 0x9298
movq %rsp, %rsi
callq 0x3e68
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x3932
leaq 0x3853(%rip), %rsi      # 0x605f
movq %rbx, %rdi
callq 0x23e0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3b42
jmp 0x2833
jmp 0x2830
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/ullur.cpp
// Function: handle_geo_put[abi:cxx11](double, double, unsigned long)
std::string handle_geo_put( double x, double y, uint64_t id ){
	// lat = -90 .. 90
	// lon = -180 .. 180

	x = (x + 90.0)/(2*90.0);
	y = (y + 180)/(2*180.0);

	return handle_put( x, y, id );
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addsd 0x37b9(%rip), %xmm0     # 0x6008
movsd 0x37b9(%rip), %xmm2     # 0x6010
divsd %xmm2, %xmm0
addsd %xmm2, %xmm1
divsd 0x37b1(%rip), %xmm1     # 0x6018
callq 0x276a
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/ullur.cpp
// Function: handle_geo_get[abi:cxx11](double, double, double)
std::string handle_geo_get( double x, double y, double r ){
	// lat = -90 .. 90
	// lon = -180 .. 180

	x = (x + 90.0)/(2*90.0);
	y = (y + 180)/(2*180.0);

	r = r / ( 6380e3 * 3.14159265358979323 * 2 ); // Divide by Earth's circumfence

	return handle_get( x, y, r );
	}

// Assembly:
pushq %rbx
addsd 0x347d(%rip), %xmm0     # 0x6008
movq %rdi, %rbx
movsd 0x347a(%rip), %xmm3     # 0x6010
divsd %xmm3, %xmm0
addsd %xmm3, %xmm1
divsd 0x3472(%rip), %xmm1     # 0x6018
divsd 0x347a(%rip), %xmm2     # 0x6028
callq 0x2871
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/ullur.cpp
// Function: handle_geo_getr[abi:cxx11](double, double, double, double)
std::string handle_geo_getr( double x0, double y0, double x1, double y1 ){
	// lat = -90 .. 90
	// lon = -180 .. 180

	x0 = (x0 + 90.0)/(2*90.0);
	y0 = (y0 + 180)/(2*180.0);

	x1 = (x1 + 90.0)/(2*90.0);
	y1 = (y1 + 180)/(2*180.0);

	return handle_getr( x0, y0, x1, y1 );
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movsd 0x3140(%rip), %xmm4     # 0x6008
addsd %xmm4, %xmm0
movsd 0x313c(%rip), %xmm5     # 0x6010
divsd %xmm5, %xmm0
addsd %xmm5, %xmm1
movsd 0x3134(%rip), %xmm6     # 0x6018
divsd %xmm6, %xmm1
addsd %xmm4, %xmm2
divsd %xmm5, %xmm2
addsd %xmm5, %xmm3
divsd %xmm6, %xmm3
callq 0x2bb8
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/ullur.cpp
// Function: handle_del[abi:cxx11](unsigned long)
std::string handle_del( uint64_t id ){
	std::unordered_map< uint64_t, std::vector< uint64_t > >::iterator it;
	/* Fix this, probably broken... */
	
	it = database.find( id );
	if( it != database.end() ){
		hashes.erase( it->first );
		database.erase( it );
		}
	

	return "Ok.\r\n";
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rax
movq %rsi, (%rax)
leaq 0x637d(%rip), %rdi      # 0x9298
movq %rax, %rsi
callq 0x3b50
testq %rax, %rax
je 0x2f4d
movq %rax, %r14
movq %rax, %rsi
addq $0x8, %rsi
leaq 0x632f(%rip), %rdi      # 0x9268
callq 0x4244
leaq 0x6353(%rip), %rdi      # 0x9298
movq %r14, %rsi
callq 0x43ea
leaq 0x310b(%rip), %rsi      # 0x605f
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x2120
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/libhash.cpp
// Function: compute_hash(double, double)
uint64_t compute_hash( double x, double y ){
	uint64_t out = 0;
	double cx, cy, d;
	cx = cy = 0.5;
	d = 0.25;
	
	x = x - floor( x );
	y = y - floor( y );
	
	for( size_t i = 0 ; i < 32 ; ++i ){
		uint64_t p = 0;
		
		if( x >= cx ){
			p |= 1;
			cx += d;
			}
		else {
			cx -= d;
			}
		
		if( y <= cy ){
			p |= 2;
			cy -= d;
			}
		else{
			cy += d;
			}
		
		//std::cout << p << " ";
		
		d /= 2.0;
		out |= p;
		if( i < 32 - 1 ){
			out <<= 2;
			}
		}
	//std::cout << std::endl;
	return out;
	}

// Assembly:
subq $0x18, %rsp
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
callq 0x2390
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x2390
movsd 0x10(%rsp), %xmm8
subsd %xmm0, %xmm8
movsd 0x1830(%rip), %xmm0     # 0x6160
movsd 0x16f8(%rip), %xmm1     # 0x6030
pushq $0x20
popq %rcx
xorl %eax, %eax
movapd 0x16fb(%rip), %xmm2     # 0x6040
movapd %xmm1, %xmm3
movapd %xmm1, %xmm4
movq %rcx, %rdx
subq $0x1, %rdx
jb 0x49c6
xorl %esi, %esi
movsd 0x8(%rsp), %xmm5
ucomisd %xmm3, %xmm5
setae %dil
movapd %xmm0, %xmm5
xorpd %xmm2, %xmm5
movapd %xmm0, %xmm6
jae 0x4978
movapd %xmm5, %xmm6
addsd %xmm6, %xmm3
movb %dil, %sil
leaq 0x2(%rsi), %rdi
ucomisd %xmm8, %xmm4
movapd %xmm8, %xmm6
cmpnlesd %xmm4, %xmm6
movapd %xmm6, %xmm7
andpd %xmm0, %xmm7
andnpd %xmm5, %xmm6
orpd %xmm7, %xmm6
cmovbq %rsi, %rdi
addsd %xmm6, %xmm4
mulsd %xmm1, %xmm0
orq %rax, %rdi
leaq (,%rdi,4), %rax
cmpq $0x1, %rcx
cmoveq %rdi, %rax
movq %rdx, %rcx
jmp 0x4950
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/libhash.cpp
// Function: mask_hash(unsigned long, unsigned long)
std::pair<uint64_t,uint64_t> mask_hash( uint64_t H, size_t N ){
	uint64_t  mask = 0;
	for( size_t i = 0 ; i < 32  ; ++i ){
		if( i < N ){
			mask |= 0x03;
			}
		if( i < 31 ){
			mask  <<= 0x02;
			}
		}
	
	return std::make_pair( H & mask, (H & mask) | (~mask) );
	
	}

// Assembly:
xorl %edx, %edx
xorl %eax, %eax
cmpq $0x20, %rax
je 0x49f8
movq %rdx, %rcx
orq $0x3, %rcx
cmpq %rsi, %rax
cmovaeq %rdx, %rcx
leaq (,%rcx,4), %rdx
cmpq $0x1f, %rax
cmoveq %rcx, %rdx
incq %rax
jmp 0x49cf
movq %rdx, %rax
andq %rdi, %rax
notq %rdx
orq %rdi, %rdx
retq
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/libhash.cpp
// Function: compute_position(unsigned long)
std::pair<double, double> compute_position( uint64_t H ){
	double cx, cy, d;

	cx = 0.5;
	cy = 0.5;
	d = 0.25;
	
	for( uint64_t i = 0 ; i < 32 ; ++i ){
		uint64_t p = 2*(31 - i);
		uint64_t value = (H >> p) & 0x3;
		int x,y;
		x = value & 1;
		y = (value & 2) >> 1;
		
		cx += (2*x-1)*d;
		cy -= (2*y-1)*d;
		
		
		
		d *= 0.5;
		}
	//std::cout << std::endl;
	return std::make_pair( cx, cy );
	}

// Assembly:
movapd 0x1763(%rip), %xmm0     # 0x6170
movsd 0x174b(%rip), %xmm1     # 0x6160
pushq $0x3e
popq %rcx
movapd 0x1620(%rip), %xmm2     # 0x6040
movsd 0x1608(%rip), %xmm3     # 0x6030
cmpq $-0x2, %rcx
je 0x4a6f
movq %rdi, %rax
shrq %cl, %rax
movl %eax, %edx
andl $0x1, %eax
leal -0x1(,%rax,2), %eax
cvtsi2sd %eax, %xmm4
andl $0x2, %edx
decl %edx
cvtsi2sd %edx, %xmm5
xorpd %xmm2, %xmm5
unpcklpd %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0]
movapd %xmm1, %xmm5
unpcklpd %xmm1, %xmm5            # xmm5 = xmm5[0],xmm1[0]
mulpd %xmm4, %xmm5
addpd %xmm5, %xmm0
mulsd %xmm3, %xmm1
addq $-0x2, %rcx
jmp 0x4a28
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
retq
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/libhash.cpp
// Function: get_near_indices(unsigned long, unsigned long)
std::vector< std::pair<uint64_t, uint64_t> > get_near_indices( uint64_t level, uint64_t H ){
	std::vector< std::pair<uint64_t, uint64_t> > out;
	
	double dz = 1.0/( 1 << level );
	
	std::pair<double, double> pos = compute_position( H );
	
	uint64_t h;
	
	for( int p = -1 ; p < 2 ; ++p ){
		for( int q = -1 ; q < 2 ; ++q ){
			double x, y;
			x = pos.first + dz * p;
			y = pos.second + dz * q;
			
			h = compute_hash( x, y );
			
			out.push_back( mask_hash( h, level ) );
			
			
			}
		}
	
	
	return out;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
pushq $0x1
popq %rax
movl %r14d, %ecx
shll %cl, %eax
cvtsi2sd %eax, %xmm0
movsd 0x16bd(%rip), %xmm1     # 0x6168
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq %rdx, %rdi
callq 0x4a05
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x18(%rsp)
pushq $-0x1
popq %rbp
leaq 0x28(%rsp), %r15
movl %ebp, %r12d
cmpl $0x2, %r12d
je 0x4b40
cvtsi2sd %r12d, %xmm0
mulsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movl %ebp, %r13d
cmpl $0x2, %r13d
je 0x4b3b
cvtsi2sd %r13d, %xmm1
mulsd 0x8(%rsp), %xmm1
addsd 0x18(%rsp), %xmm1
movsd 0x20(%rsp), %xmm0
callq 0x48ec
movq %rax, %rdi
movq %r14, %rsi
callq 0x49cb
movq %rax, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4cf4
incl %r13d
jmp 0x4af4
incl %r12d
jmp 0x4ad4
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x41e4
movq %r14, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/libhash.cpp
// Function: extract_points(std::set<unsigned long, std::less<unsigned long>, std::allocator<unsigned long>>&, std::vector<std::pair<unsigned long, unsigned long>, std::allocator<std::pair<unsigned long, unsigned long>>>&)
std::vector< uint64_t > extract_points( std::set<uint64_t> & points, std::vector< std::pair<uint64_t, uint64_t> > &areas ){
	std::vector<uint64_t> out;
	
	for( size_t i = 0 ; i < areas.size() ; ++i ){
		std::set<uint64_t>::iterator start, stop, it;
			start = points.lower_bound( areas[i].first );
			stop = points.upper_bound( areas[i].second );
		
			for( it = start ; it != stop ; it++ ){
				out.push_back( *it );
				}
				}
	
	return out;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
xorl %ebp, %ebp
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x4, %rax
cmpq %rax, %rbp
jae 0x4c07
movq %rbp, %r13
shlq $0x4, %r13
addq %r13, %rsi
movq %r15, %rdi
callq 0x4e50
movq %rax, %r12
movq (%r14), %rax
leaq (%rax,%r13), %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0x4e60
movq %rax, %r13
cmpq %r13, %r12
je 0x4c02
leaq 0x20(%r12), %rsi
movq %rbx, %rdi
callq 0x3932
movq %r12, %rdi
callq 0x22c0
movq %rax, %r12
jmp 0x4be3
incq %rbp
jmp 0x4ba5
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4c1d
jmp 0x4c1d
movq %rax, %r14
movq %rbx, %rdi
callq 0x3b42
movq %r14, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O2/mgronhol[P]Ullur/libhash.cpp
// Function: filter_points(std::vector<unsigned long, std::allocator<unsigned long>>&, std::unordered_map<unsigned long, unsigned long, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, unsigned long>>>&, std::pair<double, double>, double)
std::vector<uint64_t> filter_points( std::vector< uint64_t > &keys, std::unordered_map<uint64_t, uint64_t> &values, std::pair<double, double> point, double radius ){
	std::vector<uint64_t> out;
	std::pair<double, double> pos;
	
	radius = radius*radius;
	for( size_t i = 0 ; i < keys.size() ; ++i ){
		pos = compute_position( keys[i] );
		if( get_squared_distance( pos, point ) <= radius ){
			out.push_back( values[ keys[i] ] );
			}
		}
	
	
	return out;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorpd %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movupd %xmm0, (%rdi)
mulsd %xmm2, %xmm2
movsd %xmm2, 0x10(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%r15), %r12
movq 0x8(%r15), %rax
subq %r12, %rax
sarq $0x3, %rax
cmpq %rax, %rbp
jae 0x4ccf
movq (%r12,%r13), %rdi
callq 0x4a05
subsd (%rsp), %xmm0
subsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x4cc6
addq %r13, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x4e70
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3932
incq %rbp
addq $0x8, %r13
jmp 0x4c6e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3b42
movq %r14, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/utils.cpp
// Function: str2int(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int str2int(const string& str) {
	stringstream ss(str);
	int num;
	ss >> num;
	return num;
}

// Assembly:
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdi, %rsi
leaq 0x8(%rsp), %rbx
pushq $0x18
popq %rdx
movq %rbx, %rdi
callq 0x2300
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x2140
movl 0x4(%rsp), %ebx
leaq 0x8(%rsp), %rdi
callq 0x2180
movl %ebx, %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/main.cpp
// Function: findNearestExclude(Student const&, std::vector<Student, std::allocator<Student>> const&, unsigned long)
size_t findNearestExclude(const Student& key, const vector<Student>& group, size_t exclude) {
	double d = 1e10;
	size_t ans = exclude;

	for (size_t i = 0; i < group.size(); ++i) {
		if (i != exclude && key.dist(group[i]) < d) {
			d = key.dist(group[i]);
			ans = i;
		}
	}

	return ans;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movsd 0x5b06(%rip), %xmm0     # 0x9070
movsd %xmm0, 0x10(%rsp)
xorl %r13d, %r13d
movl $0x88, %ebp
movq %rdx, 0x8(%rsp)
xorl %r12d, %r12d
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
cqto
idivq %rbp
cmpq %rax, %r12
jae 0x35d5
cmpq %r12, %rbx
je 0x35c9
addq %r13, %rsi
movq %r15, %rdi
callq 0x6870
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x35c9
movq (%r14), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x6870
movsd %xmm0, 0x10(%rsp)
movq %r12, 0x8(%rsp)
incq %r12
addq $0x88, %r13
jmp 0x3580
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/main.cpp
// Function: CombGroupIntoPairs(std::vector<Student, std::allocator<Student>>&, std::vector<Student, std::allocator<Student>>&, std::vector<std::pair<Student, Student>, std::allocator<std::pair<Student, Student>>>&, std::vector<Student, std::allocator<Student>>&)
void CombGroupIntoPairs(vector<Student>& group, vector<Student>& comb, vector<pair<Student, Student> >& pairs, vector<Student>& special) {
	random_shuffle(group.begin(), group.end());
	size_t len;
	while ((len = group.size()) >= 2) {
		// 给当前group里最后一个人配对，将配对的结果也交换到group的最后，方便删除
		size_t goal = findNearestExclude(group[len-1], group, len);
		if (goal != len-2)
			swap(group[goal], group[len-2]);
		pairs.push_back(make_pair(group[len-1], group[len-2]));

		// 两者取平均作为组合的特征
		Student tmp(group[len-2]);
		tmp += group[len-1];
		tmp /= 2;
		comb.push_back(tmp);

		// 将两个人从group中删掉
		group.pop_back();
		group.pop_back();
	}

	if (group.size() == 1)
		special.push_back(group[0]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rcx, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rdi
movq 0x8(%r12), %rsi
callq 0x3840
leaq 0x8(%rsp), %r13
movq (%r12), %rsi
movq 0x8(%r12), %rcx
subq %rsi, %rcx
movq %rcx, %rax
cqto
movl $0x88, %edi
idivq %rdi
cmpq $0x2, %rax
jb 0x3703
movq %rax, %rbx
decq %rax
imulq $0x88, %rax, %rbp
addq %rbp, %rsi
movq %rsi, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x354b
addq $-0x2, %rbx
cmpq %rbx, %rax
je 0x3680
movq (%r12), %rcx
imulq $0x88, %rax, %rdi
addq %rcx, %rdi
imulq $0x88, %rbx, %rsi
addq %rcx, %rsi
callq 0x38b1
movq (%r12), %rdx
leaq (%rdx,%rbp), %rsi
imulq $0x88, %rbx, %rbx
addq %rbx, %rdx
movq %r13, %rdi
callq 0x3f46
movq %r14, %rdi
movq %r13, %rsi
callq 0x4636
movq %r13, %rdi
callq 0x38fe
addq (%r12), %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3918
addq (%r12), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x68ce
movq %r13, %rdi
movsd 0x59a2(%rip), %xmm0     # 0x9078
callq 0x68fe
movq %r15, %rdi
movq %r13, %rsi
callq 0x379e
movq %r12, %rdi
callq 0x3994
movq %r12, %rdi
callq 0x3994
movq %r13, %rdi
callq 0x37ce
jmp 0x3619
cmpq $0x88, %rcx
jne 0x3715
movq (%rsp), %rdi
callq 0x379e
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x38fe
jmp 0x3743
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x37ce
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/./KMeans.h
// Function: KMeans<Student>::train_inc()
void train_inc() {
		for (size_t iter = 0; iter < MaxIters; ++iter) {
			for (size_t e = 0; e < size; ++e) {
				for (size_t c = 0; c < K; ++c) {
					double distance = elements[e].dist(centroids[c]);
					if (distance < dist[e]) {
						dist[e] = distance;
						my_centroids[e] = c;
					}
				}
				if (my_centroids[e] != my_centroids_map[e]) {
					size_t oldC = my_centroids_map[e], newC = my_centroids[e];
					// printf("hehe, change c=%d, for e=%d, oldC=%d\n", int(newC), int(e), int(oldC));

					my_centroids_map[e] = newC;
					my_points_map[oldC].erase(e);
					my_points_map[newC].insert(e);
					update_centroid(oldC);
					update_centroid(newC);
				}
			}

			printf("Iteration [%d], SSE=%lf\n", int(iter), SSE());
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x78(%rdi), %r14
leaq 0xa8(%rdi), %r15
xorl %r12d, %r12d
leaq 0x8(%rsp), %r13
cmpq 0x10(%rbx), %r12
jae 0x3c43
movq %r12, 0x20(%rsp)
xorl %eax, %eax
movq %rax, 0x8(%rsp)
cmpq 0x8(%rbx), %rax
jae 0x3c1d
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
cmpq (%rbx), %r12
jae 0x3b7b
imulq $0x88, %rax, %rdi
addq 0x18(%rbx), %rdi
movq 0x30(%rbx), %rsi
addq %rbp, %rsi
callq 0x6870
movq 0x8(%rsp), %rax
movq 0x48(%rbx), %rcx
movsd (%rcx,%rax,8), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3b6f
movsd %xmm0, (%rcx,%rax,8)
movq 0x60(%rbx), %rcx
movq %r12, (%rcx,%rax,8)
incq %r12
addq $0x88, %rbp
jmp 0x3b2d
movq 0x60(%rbx), %rcx
movq (%rcx,%rax,8), %r12
movq %r14, %rdi
movq %r13, %rsi
callq 0x4f3a
cmpq (%rax), %r12
je 0x3c10
movq %r14, %rdi
movq %r13, %rsi
callq 0x4f3a
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rax
movq 0x60(%rbx), %rcx
movq (%rcx,%rax,8), %r12
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x4f3a
movq %r12, (%rax)
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5790
movq %rax, %rdi
movq %r13, %rsi
callq 0x5954
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x5790
movq %rax, %rdi
movq %r13, %rsi
callq 0x53b4
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x57e0
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x57e0
movq 0x8(%rsp), %rax
incq %rax
jmp 0x3b19
movq %rbx, %rdi
callq 0x4f8a
leaq 0x55c2(%rip), %rdi      # 0x91ee
movq 0x20(%rsp), %r12
movl %r12d, %esi
movb $0x1, %al
callq 0x2040
incq %r12
jmp 0x3b08
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/./KMeans.h
// Function: KMeans<Student>::explain() const
void explain() const {
		for (size_t c = 0; c < K; ++c) {
			printf("In centroids [%d], there have:\n", int(c));
			for (size_t e = 0; e < size; ++e) {
				if (my_centroids[e] == c)
					elements[e].output(cout);
			}

			printf("-----------\n\n\n");
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb369(%rip), %r15      # 0xefd0
leaq 0x55b9(%rip), %r12      # 0x9227
xorl %r13d, %r13d
cmpq (%rbx), %r13
jae 0x3cc4
leaq 0x558a(%rip), %rdi      # 0x9207
movl %r13d, %esi
xorl %eax, %eax
callq 0x2040
xorl %ebp, %ebp
xorl %r14d, %r14d
cmpq 0x8(%rbx), %r14
jae 0x3cb7
movq 0x60(%rbx), %rax
cmpq %r13, (%rax,%r14,8)
jne 0x3cab
movq 0x18(%rbx), %rdi
addq %rbp, %rdi
movq %r15, %rsi
callq 0x6498
incq %r14
addq $0x88, %rbp
jmp 0x3c8c
movq %r12, %rdi
callq 0x22f0
incq %r13
jmp 0x3c71
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/./KMeans.h
// Function: KMeans<Student>::getSortedRepresentative()
vector<size_t> getSortedRepresentative() {
		vector<size_t> rep(K);
		for (size_t i = 0; i < K; ++i) {
			rep[i] = getBestPointInCluster(i);
		}
		sort(rep.begin(), rep.end());
		return rep;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0xf(%rsp), %rdx
callq 0x4990
xorl %r15d, %r15d
cmpq (%r14), %r15
jae 0x3d0f
movq %r14, %rdi
movq %r15, %rsi
callq 0x5afc
movq (%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x3cf3
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x5b95
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x3d2a
movq %rax, %r14
movq %rbx, %rdi
callq 0x4d6e
movq %r14, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/./KMeans.h
// Function: KMeans<Student>::Init()
void Init() {
		srand(time(0));
		vector<size_t> ranks(size);
		for (int i = 0; i < size; ++i) {
			ranks[i] = i;
		}
		random_shuffle(ranks.begin(), ranks.end());
		for (int i = 0; i < size; ++i) {
			if (i < K) {
				my_centroids[ranks[i]] = i;
				centroids[i] = elements[ranks[i]];
				my_points_map[i].insert(ranks[i]);
				my_centroids_map[ranks[i]] = i;
				dist[ranks[i]] = 0.0;
				// printf("At first, i=%d, ranks[i]=%d\n", i, int(ranks[i]));
				// centroids[i].output();
			} else {
				// default centroid is 0
				my_centroids[ranks[i]] = 0;
				my_centroids_map[ranks[i]] = 0;
				my_points_map[0].insert(ranks[i]);
				dist[ranks[i]] = centroids[0].dist(elements[ranks[i]]);
			}
		}

		printf("After initialization, SSE=%lf\n", SSE());
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x21e0
movl %eax, %edi
callq 0x21f0
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x4990
movq (%r14), %rdi
cmpq %r15, 0x8(%rbx)
jbe 0x4a2c
movq %r15, (%rdi,%r15,8)
incq %r15
jmp 0x4a1d
movq 0x18(%rsp), %rsi
callq 0x4e47
leaq 0x78(%rbx), %r14
leaq 0xa8(%rbx), %r15
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
cmpq %rbp, 0x8(%rbx)
jbe 0x4b31
movq 0x60(%rbx), %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rbp,8), %rsi
movq (%rsi), %rcx
cmpq %rbp, (%rbx)
jbe 0x4ac6
movq %rbp, (%rax,%rcx,8)
imulq $0x88, (%rsi), %rsi
addq 0x18(%rbx), %rsi
imulq $0x88, %rbp, %rdi
addq 0x30(%rbx), %rdi
callq 0x4ea6
movq %rbp, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4eea
leaq (,%rbp,8), %r13
movq 0x10(%rsp), %rsi
addq %r13, %rsi
movq %rax, %rdi
callq 0x53b4
addq 0x10(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x4f3a
movq %rbp, (%rax)
xorps %xmm0, %xmm0
jmp 0x4b17
andq $0x0, (%rax,%rcx,8)
movq %r14, %rdi
callq 0x4f3a
andq $0x0, (%rax)
andq $0x0, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4eea
leaq (,%rbp,8), %rsi
addq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x53b4
movq 0x30(%rbx), %rdi
movq 0x10(%rsp), %rax
imulq $0x88, (%rax,%rbp,8), %rsi
addq 0x18(%rbx), %rsi
callq 0x6870
movq 0x10(%rsp), %rax
movq (%rax,%rbp,8), %rax
movq 0x48(%rbx), %rcx
movsd %xmm0, (%rcx,%rax,8)
incq %rbp
jmp 0x4a48
movq %rbx, %rdi
callq 0x4f8a
leaq 0x468f(%rip), %rdi      # 0x91cf
movb $0x1, %al
callq 0x2040
leaq 0x10(%rsp), %rdi
callq 0x4d6e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4b66
jmp 0x4b66
jmp 0x4b66
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4d6e
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/./KMeans.h
// Function: KMeans<Student>::SSE()
double SSE() {
		double error = 0.0;

		for (size_t e = 0; e < size; ++e) {
			// double tmp = centroids[my_centroids[e]].dist(elements[e]);
			// error += tmp * tmp;
			error += centroids[my_centroids[e]].dist(elements[e]);;
		}

		return error;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq 0x8(%rbx), %r15
jae 0x4fea
movq 0x60(%rbx), %rax
imulq $0x88, (%rax,%r15,8), %rdi
addq 0x30(%rbx), %rdi
movq 0x18(%rbx), %rsi
addq %r14, %rsi
movsd %xmm0, 0x8(%rsp)
callq 0x6870
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
incq %r15
addq $0x88, %r14
jmp 0x4fa0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/./KMeans.h
// Function: KMeans<Student>::update_centroid(unsigned long)
void update_centroid(size_t c) {
		set<size_t>& points = my_points_map[c];
		set<size_t>::iterator it = points.begin();
		centroids[c].clear();
		while (it != points.end()) {
			centroids[c] += elements[*it];
			++it;
		}
		if (points.size() > 1)
			centroids[c] /= points.size();
		// printf("heheheh size=%d, c=%d\n", int(points.size()), int(c));
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r12
movq %rsi, (%r12)
addq $0xa8, %rdi
movq %r12, %rsi
callq 0x5790
movq %rax, %r14
movq 0x18(%rax), %r15
imulq $0x88, (%r12), %rdi
addq 0x30(%rbx), %rdi
callq 0x68ae
movq %r14, %r12
addq $0x8, %r12
cmpq %r12, %r15
je 0x584f
imulq $0x88, 0x20(%r15), %rsi
addq 0x18(%rbx), %rsi
imulq $0x88, (%rsp), %rdi
addq 0x30(%rbx), %rdi
callq 0x68ce
movq %r15, %rdi
callq 0x2240
movq %rax, %r15
jmp 0x5820
movq 0x28(%r14), %rax
cmpq $0x2, %rax
jb 0x588b
movq %rax, %xmm1
punpckldq 0x37ea(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x37f2(%rip), %xmm1     # 0x9060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
imulq $0x88, (%rsp), %rdi
addq 0x30(%rbx), %rdi
callq 0x68fe
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/./KMeans.h
// Function: KMeans<Student>::getBestPointInCluster(unsigned long)
size_t getBestPointInCluster(size_t c) {
		set<size_t>& points = my_points_map[c];
		set<size_t>::iterator it = points.begin();

		double d = 1e10, tmpD;
		size_t ans = size;
		while (it != points.end()) {
			if ((tmpD = centroids[c].dist(elements[*it])) < d) {
				d = tmpD;
				ans = *it;
			}
			++it;
		}

		return ans;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rax
movq %rsi, (%rax)
addq $0xa8, %rdi
movq %rax, %rsi
callq 0x5790
movq %rax, %r14
movq 0x18(%rax), %r12
movq 0x8(%rbx), %r15
addq $0x8, %r14
movsd 0x3538(%rip), %xmm0     # 0x9070
movsd %xmm0, 0x8(%rsp)
cmpq %r14, %r12
je 0x5b86
imulq $0x88, 0x10(%rsp), %rdi
addq 0x30(%rbx), %rdi
imulq $0x88, 0x20(%r12), %rsi
addq 0x18(%rbx), %rsi
callq 0x6870
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x5b79
movq 0x20(%r12), %r15
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x2240
movq %rax, %r12
jmp 0x5b3e
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/Student.cpp
// Function: Student::Student(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>>>> const&)
Student::Student(const vector<string>& row)
: Element(size, question_ratio), id(row[0]), name(row[1]) {
	for (int i = 2; i < row.size(); ++i)
		data[i-2] = str2int(row[i]);

	raw_data = data;

	data[2] = sqrt_trans(data[2] += 1);	// 起床时间
	data[3] = sqrt_trans(data[3] += 1);	// 就寝时间
	data[12] = sqrt_trans(data[12] += 1);// 家庭收入水平
	data[10] *= MAX[10];	// 性格分明，尽量不要出现三个安静+1个活跃
	for (int i = 0; i < size; ++i)
		if (MAX[i] > MIN[i])
			data[i] = (data[i] - MIN[i]) / (MAX[i] - MIN[i]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x3006(%rip), %rdx      # 0x9260
pushq $0xf
popq %rsi
callq 0x6808
leaq 0x30(%rbx), %r14
movq (%r12), %rsi
movq %r14, %rdi
callq 0x22a0
movq %r14, (%rsp)
leaq 0x50(%rbx), %r15
movq (%r12), %rsi
addq $0x20, %rsi
movq %r15, %rdi
callq 0x22a0
leaq 0x70(%rbx), %r13
andq $0x0, 0x80(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x70(%rbx)
pushq $0x2
popq %rbp
pushq $0x40
popq %r14
movq (%r12), %rdi
movq 0x8(%r12), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0x62d9
addq %r14, %rdi
callq 0x2dbc
cvtsi2sd %eax, %xmm0
movq (%rbx), %rax
movsd %xmm0, -0x10(%rax,%rbp,8)
incq %rbp
addq $0x20, %r14
jmp 0x62a6
movq %r13, %rdi
movq %rbx, %rsi
callq 0x501e
movq (%rbx), %rax
movupd 0x10(%rax), %xmm0
addpd 0x2f4c(%rip), %xmm0     # 0x9240
mulpd %xmm0, %xmm0
movupd %xmm0, 0x10(%rax)
movsd 0x60(%rax), %xmm0
addsd 0x2f46(%rip), %xmm0     # 0x9250
mulsd %xmm0, %xmm0
movsd %xmm0, 0x60(%rax)
movsd 0x50(%rax), %xmm0
mulsd 0x2f38(%rip), %xmm0     # 0x9258
movsd %xmm0, 0x50(%rax)
xorl %ecx, %ecx
leaq 0x3032(%rip), %rdx      # 0x9360
leaq 0x2fab(%rip), %rsi      # 0x92e0
cmpq $0x78, %rcx
je 0x6367
movsd (%rcx,%rdx), %xmm0
movsd (%rcx,%rsi), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x6361
movsd (%rax,%rcx), %xmm2
subsd %xmm1, %xmm2
subsd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, (%rax,%rcx)
addq $0x8, %rcx
jmp 0x6335
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6382
movq %rax, %r12
jmp 0x6395
movq %rax, %r12
jmp 0x639e
movq %rax, %r12
movq %r13, %rdi
callq 0x3e12
movq %r15, %rdi
callq 0x20e0
movq (%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x3df0
movq %r12, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/Student.cpp
// Function: operator>>(std::istream&, Student&)
istream& operator >> (istream& is, Student& stu) {
	vector<string> row(Student::size);
	for (int i = 0; i < Student::size; ++i)
		is >> row[i];
	stu = Student(row);
	return is;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdi
pushq $0xf
popq %rsi
leaq 0x18(%rsp), %rdx
callq 0x6658
xorl %r15d, %r15d
cmpq $0x1e0, %r15            # imm = 0x1E0
je 0x63f6
movq (%rsp), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0x2270
addq $0x20, %r15
jmp 0x63d8
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x6242
leaq 0x18(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4576
movq %r15, %rdi
callq 0x37ce
movq %rsp, %rdi
callq 0x3e68
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x6435
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3e68
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/Student.cpp
// Function: Student::display() const
void Student::display() const {
	printf("Id is %s", id.c_str());
	for (int i = 0; i < size; ++i)
		printf(", %.3lf", data[i]);
	printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rsi
leaq 0x30ee(%rip), %rdi      # 0x9549
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x2040
leaq 0x30e6(%rip), %r14      # 0x9552
cmpq $0xf, %r15
je 0x648a
movq (%rbx), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
movb $0x1, %al
callq 0x2040
incq %r15
jmp 0x646c
pushq $0xa
popq %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/Student.cpp
// Function: Student::output(std::ostream&) const
void Student::output(ostream& out) const {
	out << id << ',' << name;

	for (int i = 0; i < size; ++i) {
		if (i == 4) {
			out << ",\"";
			bool have = false;
			for (int j = 0; j < 6; ++i, ++j) {
				if (!have && answers[i][int(raw_data[i])].size() > 0) {
					have = true;
					out << answers[i][int(raw_data[i])];
				}
				else if (answers[i][int(raw_data[i])].size() > 0)
					out << ',' << answers[i][int(raw_data[i])];
			}
			out << "\"";
			--i;
		}
		else
			out << ',' << answers[i][int(raw_data[i])];
	}
	out << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rdi), %rsi
movq %rbx, %rdi
callq 0x21d0
pushq $0x2c
popq %rsi
movq %rax, %rdi
callq 0x2250
leaq 0x50(%r14), %rsi
movq %rax, %rdi
callq 0x21d0
xorl %ebp, %ebp
leaq 0x8d5b(%rip), %r13      # 0xf230
cmpl $0xf, %ebp
jge 0x65f0
movq %rbx, %rdi
cmpl $0x4, %ebp
jne 0x65a2
leaq 0x3069(%rip), %rsi      # 0x955a
callq 0x2200
xorl %r12d, %r12d
pushq $0x4
popq %r15
xorl %ebp, %ebp
cmpq $0x480, %r12            # imm = 0x480
je 0x65d9
movq 0x70(%r14), %rax
cvttsd2si (%rax,%r15,8), %eax
cltq
testb $0x1, %bpl
jne 0x654f
movq %rax, %rcx
shlq $0x5, %rcx
leaq (%rcx,%r13), %rdx
cmpq $0x0, 0x308(%r12,%rdx)
je 0x654f
addq %r12, %rcx
leaq (%rcx,%r13), %rsi
addq $0x300, %rsi            # imm = 0x300
movq %rbx, %rdi
callq 0x21d0
movb $0x1, %bpl
jmp 0x6593
shlq $0x5, %rax
addq %r13, %rax
cmpq $0x0, 0x308(%r12,%rax)
je 0x6593
movq %rbx, %rdi
pushq $0x2c
popq %rsi
callq 0x2250
movq 0x70(%r14), %rcx
cvttsd2si (%rcx,%r15,8), %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %r12, %rcx
leaq (%rcx,%r13), %rsi
addq $0x300, %rsi            # imm = 0x300
movq %rax, %rdi
callq 0x21d0
incq %r15
addq $0xc0, %r12
jmp 0x64ff
pushq $0x2c
popq %rsi
callq 0x2250
movslq %ebp, %rcx
movq 0x70(%r14), %rdx
cvttsd2si (%rdx,%rcx,8), %edx
movslq %edx, %rsi
imulq $0xc0, %rcx, %rcx
addq %r13, %rcx
shlq $0x5, %rsi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x21d0
incl %ebp
jmp 0x64d5
movq %rbx, %rdi
leaq 0x2f78(%rip), %rsi      # 0x955b
callq 0x2200
pushq $0xa
popq %rbp
jmp 0x64d5
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20f0
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/Element.cpp
// Function: Element::dist(Element const&) const
double Element::dist(const Element& e) const {
	double d = 0.0, tmp;
	for (size_t i = 0; i < data.size(); ++i) {
		tmp = data[i] - e.data[i];
		d += tmp * tmp * weights[i];
	}

	return d;
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movq (%rsi), %rdx
movq 0x18(%rdi), %rsi
xorpd %xmm0, %xmm0
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x68ac
movsd (%rax,%rdi,8), %xmm1
subsd (%rdx,%rdi,8), %xmm1
mulsd %xmm1, %xmm1
mulsd (%rsi,%rdi,8), %xmm1
addsd %xmm1, %xmm0
incq %rdi
jmp 0x688b
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/transform.cpp
// Function: transform_original_data(char const*)
int transform_original_data(const char* inputFile) {
	const char* outputFile = file_after_process;
	const char* studentsListFile = "data/students_list_2016.csv";
	transform(inputFile, outputFile, studentsListFile);
	return 0;
}

// Assembly:
pushq %rax
leaq 0x885c(%rip), %rax      # 0xf1e8
movq (%rax), %rsi
leaq 0x2bf9(%rip), %rdx      # 0x958f
callq 0x699f
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/transform.cpp
// Function: readStudentsList(char const*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
void readStudentsList(const char* fileName, map<string, string>& list) {
	// CSVReader reader;
	// vector<vector<string> > data;
	// reader.read(fileName, data);
	// for (int i = 0; i < data.size(); ++i)
	// 	list[data[i][1]] = data[i][0];

	CSVMapContainer mc(1);
	CSVReader::read(fileName, &mc);
	mc.getColData(list, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x8044
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x7604
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x81f6
leaq 0x8(%rsp), %rdi
callq 0x6dc6
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6dc6
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/CSVReader/CSVReader.cpp
// Function: CSVReader::read(char const*, CSVContainerAdapter*, bool)
void CSVReader::read(const char* fileName, CSVContainerAdapter* adapter, bool haveHeader) {
	fstream in(fileName, ios::in);
	string line;

	if (haveHeader)
		getline(in, line, line_delimiter);

	while (getline(in, line, line_delimiter)) {
		line_to_cells(line, adapter);
	}

	in.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %rsi
leaq -0x240(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x2290
leaq -0x20(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
testl %r14d, %r14d
je 0x7656
movsbl 0x7bbb(%rip), %edx      # 0xf201
leaq -0x240(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2370
movsbl 0x7ba4(%rip), %edx      # 0xf201
leaq -0x240(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2370
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7689
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x76d8
jmp 0x7656
leaq -0x240(%rbp), %rdi
callq 0x2050
leaq -0x30(%rbp), %rdi
callq 0x20e0
leaq -0x240(%rbp), %rdi
callq 0x2070
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x76b8
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x20e0
leaq -0x240(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/CSVReader/CSVReader.cpp
// Function: CSVReader::escape_double_quots(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void CSVReader::escape_double_quots(string& str) {
	string tmp;
	bool last_is_quot = false;
	int len = str.length();
	for (int i = 0; i < len; ++i) {
		if (last_is_quot && str[i] == DOUBLE_QUOTS) {
			tmp.erase(tmp.size()-1, 1);
			last_is_quot = false;
		} else {
			last_is_quot = str[i] == DOUBLE_QUOTS;
			tmp.push_back(str[i]);
		}
	}

	str = tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
movb $0x0, (%rax)
movl 0x8(%rdi), %r12d
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
leaq -0x48(%rbp), %r14
xorl %r15d, %r15d
cmpq %r13, %r12
je 0x792a
movq (%rbx), %rax
movb (%rax,%r13), %al
cmpb $0x22, %al
sete %cl
andb %cl, %r15b
cmpb $0x1, %r15b
jne 0x7914
movq -0x40(%rbp), %rsi
decq %rsi
movq %r14, %rdi
pushq $0x1
popq %rdx
callq 0x2080
xorl %r15d, %r15d
jmp 0x7925
cmpb $0x22, %al
sete %r15b
movsbl %al, %esi
movq %r14, %rdi
callq 0x21b0
incq %r13
jmp 0x78e3
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x2120
leaq -0x48(%rbp), %rdi
callq 0x20e0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7950
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/CSVReader/CSVVectorContainer.cpp
// Function: CSVVectorContainer::display() const
void CSVVectorContainer::display() const {
	for (int i = 0; i < m_table.size(); ++i) {
		for (int j = 0; j < m_table[i].size(); ++j)
			cout << m_table[i][j] << '\t';
		cout << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %esi, %esi
movq 0x761c(%rip), %r14      # 0xefd0
movq 0x20(%rbx), %rcx
movq 0x28(%rbx), %rax
subq %rcx, %rax
cqto
pushq $0x18
popq %rdi
idivq %rdi
cmpq %rsi, %rax
jbe 0x7a23
movq %rsi, -0x30(%rbp)
imulq $0x18, %rsi, %r13
xorl %r12d, %r12d
xorl %r15d, %r15d
movq (%rcx,%r13), %rsi
movq 0x8(%rcx,%r13), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x7a12
addq %r12, %rsi
movq %r14, %rdi
callq 0x21d0
movq %rax, %rdi
pushq $0x9
popq %rsi
callq 0x2250
incq %r15
movq 0x20(%rbx), %rcx
addq $0x20, %r12
jmp 0x79da
movq %r14, %rdi
callq 0x20f0
movq -0x30(%rbp), %rsi
incq %rsi
jmp 0x79b4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cooljacket[P]Dormitory-distribution/CSVReader/CSVVectorContainer.cpp
// Function: CSVVectorContainer::getColData(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>>>>&, unsigned long) const
void CSVVectorContainer::getColData(vector<string>& data, size_t indexOfCol) const {
	for (int i = 0; i < m_table.size(); ++i) {
		if (indexOfCol >= m_table[i].size())
			throw logic_error("The index of column is large than the row's size.");
		data.push_back(m_table[i][indexOfCol]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, -0x30(%rbp)
movq %rdi, %r15
pushq $0x8
popq %r12
xorl %r13d, %r13d
movq %rdx, %rbx
shlq $0x5, %rbx
movq 0x20(%r15), %rcx
movq 0x28(%r15), %rax
subq %rcx, %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
cmpq %r13, %rax
jbe 0x7aa4
movq -0x8(%rcx,%r12), %rsi
movq (%rcx,%r12), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r14, %rax
jbe 0x7ab3
addq %rbx, %rsi
movq -0x30(%rbp), %rdi
callq 0x7af6
incq %r13
addq $0x18, %r12
jmp 0x7a62
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x2100
movq %rax, %rbx
leaq 0x1b1b(%rip), %rsi      # 0x95e0
movq %rax, %rdi
callq 0x22c0
movq 0x750c(%rip), %rsi      # 0xefe0
movq 0x74ed(%rip), %rdx      # 0xefc8
movq %rbx, %rdi
callq 0x2330
movq %rax, %r14
movq %rbx, %rdi
callq 0x2170
movq %r14, %rdi
callq 0x2350