LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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 $0x58, %rsp
movsd %xmm0, 0x50(%rsp)
movsd %xmm1, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movsd 0x2a1f(%rip), %xmm0     # 0xd030
movsd %xmm0, 0x30(%rsp)
movsd 0x2a11(%rip), %xmm0     # 0xd030
movsd %xmm0, 0x38(%rsp)
movsd 0x2b33(%rip), %xmm0     # 0xd160
movsd %xmm0, 0x28(%rsp)
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x50(%rsp), %xmm0
callq 0x2420
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x48(%rsp), %xmm0
callq 0x2420
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movq $0x0, 0x20(%rsp)
cmpq $0x20, 0x20(%rsp)
jae 0xa787
movq $0x0, 0x18(%rsp)
movsd 0x50(%rsp), %xmm0
ucomisd 0x38(%rsp), %xmm0
jb 0xa6d5
movq 0x18(%rsp), %rax
orq $0x1, %rax
movq %rax, 0x18(%rsp)
movsd 0x28(%rsp), %xmm0
addsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
jmp 0xa6eb
movsd 0x28(%rsp), %xmm1
movsd 0x38(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x48(%rsp), %xmm1
movsd 0x30(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xa723
movq 0x18(%rsp), %rax
orq $0x2, %rax
movq %rax, 0x18(%rsp)
movsd 0x28(%rsp), %xmm1
movsd 0x30(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
jmp 0xa735
movsd 0x28(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x28(%rsp), %xmm0
movsd 0x28dd(%rip), %xmm1     # 0xd020
divsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x18(%rsp), %rax
orq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
cmpq $0x1f, 0x20(%rsp)
jae 0xa772
movq 0x40(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0x40(%rsp)
jmp 0xa774
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0xa690
movq 0x40(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
cmpq $0x20, 0x18(%rsp)
jae 0xa80a
movq 0x18(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0xa7e2
movq 0x20(%rsp), %rax
orq $0x3, %rax
movq %rax, 0x20(%rsp)
cmpq $0x1f, 0x18(%rsp)
jae 0xa7f8
movq 0x20(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0x20(%rsp)
jmp 0xa7fa
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0xa7c0
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
andq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
andq %rcx, %rax
notq %rcx
orq %rcx, %rax
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xaf70
movq %rax, 0x38(%rsp)
movq %rdx, 0x40(%rsp)
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rdx
addq $0x48, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x40(%rsp)
movsd 0x27bf(%rip), %xmm0     # 0xd030
movsd %xmm0, 0x38(%rsp)
movsd 0x27b1(%rip), %xmm0     # 0xd030
movsd %xmm0, 0x30(%rsp)
movsd 0x28d3(%rip), %xmm0     # 0xd160
movsd %xmm0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
cmpq $0x20, 0x20(%rsp)
jae 0xa979
movl $0x1f, %eax
subq 0x20(%rsp), %rax
shlq %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0x18(%rsp), %rcx
shrq %cl, %rax
andq $0x3, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
andq $0x1, %rax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
andq $0x2, %rax
shrq %rax
movl %eax, 0x8(%rsp)
movl 0xc(%rsp), %eax
shll %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm0
movsd 0x28(%rsp), %xmm2
movsd 0x38(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movl 0x8(%rsp), %eax
shll %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm0
movsd 0x28(%rsp), %xmm2
movsd 0x30(%rsp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x26d6(%rip), %xmm0     # 0xd030
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0xa89c
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xafb0
movsd %xmm0, 0x48(%rsp)
movsd %xmm1, 0x50(%rsp)
movsd 0x48(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0xa8, %rsp
movq %rdi, 0x10(%rsp)
movq %rdi, %rax
movq %rax, 0x18(%rsp)
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movb $0x0, 0x8f(%rsp)
callq 0x4cc0
movb 0x98(%rsp), %cl
movl $0x1, %eax
shll %cl, %eax
cvtsi2sd %eax, %xmm1
movsd 0x2765(%rip), %xmm0     # 0xd168
divsd %xmm1, %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x90(%rsp), %rdi
callq 0xa860
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x28(%rsp)
jmp 0xaa2b
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd %xmm1, 0x70(%rsp)
movsd %xmm0, 0x78(%rsp)
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
cmpl $0x2, 0x54(%rsp)
jge 0xab44
movl $0xffffffff, 0x50(%rsp) # imm = 0xFFFFFFFF
cmpl $0x2, 0x50(%rsp)
jge 0xab32
movsd 0x70(%rsp), %xmm1
movsd 0x80(%rsp), %xmm0
cvtsi2sdl 0x54(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x78(%rsp), %xmm1
movsd 0x80(%rsp), %xmm0
cvtsi2sdl 0x50(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x48(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
callq 0xa5f0
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0xa7a0
movq %rdx, (%rsp)
movq %rax, 0x8(%rsp)
jmp 0xaae2
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq %rax, 0x38(%rsp)
leaq 0x30(%rsp), %rsi
callq 0xaff0
jmp 0xab06
jmp 0xab08
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0xaa5e
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
callq 0x4d40
jmp 0xab6d
jmp 0xab34
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0xaa4b
movb $0x1, 0x8f(%rsp)
testb $0x1, 0x8f(%rsp)
jne 0xab60
movq 0x10(%rsp), %rdi
callq 0x4d40
movq 0x18(%rsp), %rax
addq $0xa8, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0x2440
nopw (%rax,%rax)
// File: mgronhol[P]Ullur/libhash.cpp
// Function: get_squared_distance(std::pair<double, double>&, std::pair<double, double>&)
double get_squared_distance( std::pair<double, double> &A, std::pair<double, double> &B ){
	double dx, dy;
	dx = A.first - B.first;
	dy = A.second - B.second;
	return dx*dx + dy*dy;
	}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movsd (%rax), %xmm0
movq -0x10(%rsp), %rax
subsd (%rax), %xmm0
movsd %xmm0, -0x18(%rsp)
movq -0x8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq -0x10(%rsp), %rax
subsd 0x8(%rax), %xmm0
movsd %xmm0, -0x20(%rsp)
movsd -0x18(%rsp), %xmm0
movsd -0x18(%rsp), %xmm2
movsd -0x20(%rsp), %xmm1
mulsd -0x20(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
retq
nopl (%rax)
// File: 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:
subq $0xa8, %rsp
movq %rdi, 0x30(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movb $0x0, 0x8f(%rsp)
callq 0x4a20
movq $0x0, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x90(%rsp), %rdi
callq 0xb020
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0xad88
leaq 0x78(%rsp), %rdi
callq 0xb040
leaq 0x70(%rsp), %rdi
callq 0xb040
leaq 0x68(%rsp), %rdi
callq 0xb040
movq 0x98(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0xb0a0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0xb060
movq %rax, 0x20(%rsp)
jmp 0xaca4
movq 0x20(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0xb0a0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0xb0c0
movq %rax, 0x10(%rsp)
jmp 0xacf2
movq 0x10(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x8d20
testb $0x1, %al
jne 0xad25
jmp 0xad6d
leaq 0x68(%rsp), %rdi
callq 0xb100
movq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x4b00
jmp 0xad3e
jmp 0xad40
leaq 0x68(%rsp), %rdi
xorl %esi, %esi
callq 0x8d90
movq %rax, 0x40(%rsp)
jmp 0xad10
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x4b90
jmp 0xadb1
jmp 0xad6f
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0xac25
movb $0x1, 0x8f(%rsp)
testb $0x1, 0x8f(%rsp)
jne 0xada4
movq 0x30(%rsp), %rdi
callq 0x4b90
movq 0x38(%rsp), %rax
addq $0xa8, %rsp
retq
movq 0x58(%rsp), %rdi
callq 0x2440
nopl (%rax,%rax)
// File: 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:
subq $0xa8, %rsp
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0xa0(%rsp)
movsd %xmm0, 0x90(%rsp)
movsd %xmm1, 0x98(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movsd %xmm2, 0x78(%rsp)
movb $0x0, 0x77(%rsp)
callq 0x4a20
leaq 0x60(%rsp), %rdi
callq 0x4da0
jmp 0xae1a
movsd 0x78(%rsp), %xmm0
mulsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x88(%rsp), %rdi
callq 0x4ae0
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0xaf40
movq 0x88(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x4b70
movq (%rax), %rdi
callq 0xa860
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x18(%rsp)
jmp 0xae85
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x38(%rsp)
movsd %xmm0, 0x40(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x4dc0
leaq 0x60(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xab80
movaps %xmm0, %xmm1
movsd 0x78(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xaf2b
movq 0x80(%rsp), %rax
movq %rax, (%rsp)
movq 0x88(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x4b70
movq (%rsp), %rdi
movq %rax, %rsi
callq 0xb120
movq %rax, 0x8(%rsp)
jmp 0xaefe
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x4b00
jmp 0xaf0f
jmp 0xaf2b
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x4b90
jmp 0xaf63
jmp 0xaf2d
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0xae35
movb $0x1, 0x77(%rsp)
testb $0x1, 0x77(%rsp)
jne 0xaf56
movq 0x28(%rsp), %rdi
callq 0x4b90
movq 0x30(%rsp), %rax
addq $0xa8, %rsp
retq
movq 0x58(%rsp), %rdi
callq 0x2440
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movl $0x10, %edi
movl $0x8, %esi
callq 0x55e0
movq -0x1b8(%rbp), %rsi
movl %eax, %edx
leaq -0x190(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x33f0
movq -0x1b0(%rbp), %rdi
leaq -0x194(%rbp), %rsi
callq 0x3170
jmp 0x558a
movl -0x194(%rbp), %eax
movl %eax, -0x1bc(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x31e0
movl -0x1bc(%rbp), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x31e0
movq -0x1a0(%rbp), %rdi
callq 0x3440
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movsd 0x15e7c(%rip), %xmm0    # 0x1c038
movsd %xmm0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x67b0
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x6268
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0x6255
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x67e0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x14020
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x6255
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x67e0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x14020
movsd %xmm0, -0x20(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x6257
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x61d1
movq -0x28(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
cmpq (%rcx), %rax
jae 0x7090
movq -0x10(%rbp), %rax
movl %eax, %esi
leaq 0x151ed(%rip), %rdi     # 0x1c1f7
movb $0x0, %al
callq 0x3050
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
cmpq 0x8(%rcx), %rax
jae 0x7071
movq -0x20(%rbp), %rdi
addq $0x60, %rdi
movq -0x18(%rbp), %rsi
callq 0x11020
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x7061
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
callq 0x67e0
movq %rax, %rdi
movq 0x22f74(%rip), %rsi     # 0x29fd0
callq 0x132c0
jmp 0x7063
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x7019
leaq 0x1519f(%rip), %rdi     # 0x1c217
movb $0x0, %al
callq 0x3050
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x6fec
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x58(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movb $0x0, -0x11(%rbp)
movq (%rax), %rax
movq %rax, -0x50(%rbp)
leaq -0x12(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0xb6b0
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0xb6d0
jmp 0x70ee
leaq -0x12(%rbp), %rdi
callq 0xb740
movq $0x0, -0x30(%rbp)
movq -0x60(%rbp), %rcx
movq -0x30(%rbp), %rax
cmpq (%rcx), %rax
jae 0x716f
movq -0x60(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x11040
movq %rax, -0x70(%rbp)
jmp 0x711f
movq -0x58(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x71e0
movq -0x70(%rbp), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x70ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x12(%rbp), %rdi
callq 0xb740
jmp 0x71b5
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x7280
jmp 0x71b5
movq -0x58(%rbp), %rdi
callq 0xcf90
movq -0x58(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0xcfc0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x11150
jmp 0x7198
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x71ab
movq -0x58(%rbp), %rdi
callq 0x7280
movq -0x68(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3440
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
cmpq 0x8(%rcx), %rax
jae 0xd323
movq -0x20(%rbp), %rdi
movq %rdi, %rax
addq $0x30, %rax
movq %rax, -0x30(%rbp)
addq $0x60, %rdi
movq -0x18(%rbp), %rsi
callq 0x71e0
movq -0x30(%rbp), %rdi
movq (%rax), %rsi
callq 0x6930
movq -0x20(%rbp), %rdi
movq %rax, -0x28(%rbp)
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
callq 0x6930
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x14020
addsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xd2b4
movsd -0x10(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0xa8, %rdi
leaq -0x10(%rbp), %rsi
callq 0x103a0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10ed0
movq -0x30(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x30, %rdi
movq -0x10(%rbp), %rsi
callq 0x6930
movq %rax, %rdi
callq 0x140f0
movq -0x18(%rbp), %rdi
callq 0x10f00
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x10e10
testb $0x1, %al
jne 0x10522
jmp 0x1056f
movq -0x30(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x40(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x10f30
movq -0x40(%rbp), %rdi
movq (%rax), %rsi
callq 0x6930
movq -0x30(%rbp), %rdi
movq %rax, -0x38(%rbp)
addq $0x30, %rdi
movq -0x10(%rbp), %rsi
callq 0x6930
movq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x14160
leaq -0x20(%rbp), %rdi
callq 0x10f50
jmp 0x10502
movq -0x18(%rbp), %rdi
callq 0x10f80
cmpq $0x1, %rax
jbe 0x105d1
movq -0x18(%rbp), %rdi
callq 0x10f80
movq -0x30(%rbp), %rdi
movq %rax, %xmm0
movaps 0xbab9(%rip), %xmm1     # 0x1c050
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xbabd(%rip), %xmm1     # 0x1c060
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
addq $0x30, %rdi
movq -0x10(%rbp), %rsi
callq 0x6930
movsd -0x48(%rbp), %xmm0
movq %rax, %rdi
callq 0x141f0
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
addq $0xa8, %rdi
leaq -0x10(%rbp), %rsi
callq 0x103a0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10ed0
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x20(%rbp)
movsd 0xafb0(%rip), %xmm0     # 0x1c038
movsd %xmm0, -0x28(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10f00
movq %rax, -0x40(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x10e10
testb $0x1, %al
jne 0x110b8
jmp 0x11138
movq -0x48(%rbp), %rdi
addq $0x30, %rdi
movq -0x10(%rbp), %rsi
callq 0x6930
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x50(%rbp)
addq $0x18, %rax
movq %rax, -0x58(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x10f30
movq -0x58(%rbp), %rdi
movq (%rax), %rsi
callq 0x6930
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x14020
movaps %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1112a
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x10f30
movq (%rax), %rax
movq %rax, -0x38(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x10f50
jmp 0x11095
movq -0x38(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x7700
movq -0xd0(%rbp), %rdx
leaq -0x28(%rbp), %rdi
movl $0xf, %esi
callq 0x136a0
jmp 0x1316a
leaq -0x29(%rbp), %rdi
callq 0x7ee0
movl $0x0, -0x40(%rbp)
cmpl $0xf, -0x40(%rbp)
jge 0x131e4
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movslq -0x40(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x13710
movq -0xd8(%rbp), %rdi
movq %rax, %rsi
callq 0x3360
jmp 0x131a9
jmp 0x131ab
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x1317a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x7ee0
jmp 0x13236
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x7aa0
jmp 0x13236
leaq -0xc8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x12de0
jmp 0x131f6
movq -0x10(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xa690
leaq -0xc8(%rbp), %rdi
callq 0x66c0
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x7aa0
movq -0xe0(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3440
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
addq $0x30, %rdi
callq 0x30f0
movq %rax, %rsi
leaq 0x92d2(%rip), %rdi      # 0x1c539
movb $0x0, %al
callq 0x3050
movl $0x0, -0xc(%rbp)
cmpl $0xf, -0xc(%rbp)
jge 0x132a5
movq -0x18(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x13730
movsd (%rax), %xmm0
leaq 0x92af(%rip), %rdi      # 0x1c542
movb $0x1, %al
callq 0x3050
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x13275
leaq 0x8f78(%rip), %rdi      # 0x1c224
movb $0x0, %al
callq 0x3050
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x80c0
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x140e2
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x13730
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x13730
movsd -0x48(%rbp), %xmm0
movq -0x30(%rbp), %rdi
subsd (%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
mulsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
addq $0x18, %rdi
movq -0x28(%rbp), %rsi
callq 0x13730
movsd -0x40(%rbp), %xmm0
movsd (%rax), %xmm2
movsd -0x18(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x14048
movsd -0x18(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x15f2d(%rip), %rax     # 0x2a270
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0x822e(%rip), %rax      # 0x1c57f
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x14370
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: cooljacket[P]Dormitory-distribution/transform.cpp
// Function: province2int(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void province2int(string& province) {
	if (province.find(GuangDong) != string::npos)
		province = "0";
	else
		province = "1";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x15811(%rip), %rax     # 0x2a268
movq (%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
cmpq $-0x1, %rax
je 0x14a7b
movq -0x8(%rbp), %rdi
leaq 0x7aab(%rip), %rsi      # 0x1c51f
callq 0x3390
jmp 0x14a8b
movq -0x8(%rbp), %rdi
leaq 0x7b15(%rip), %rsi      # 0x1c59b
callq 0x3390
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x68(%rbp), %rdi
movq %rdi, -0x80(%rbp)
movl $0x1, %esi
callq 0x19030
movq -0x80(%rbp), %rsi
movq -0x8(%rbp), %rdi
movl $0x1, %edx
callq 0x17370
jmp 0x14ad9
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0x68(%rbp), %rdi
callq 0x19350
jmp 0x14aec
leaq -0x68(%rbp), %rdi
callq 0x14b20
addq $0x80, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x14b20
movq -0x70(%rbp), %rdi
callq 0x3440
nopl (%rax)
// File: 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
subq $0x270, %rsp            # imm = 0x270
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x228(%rbp), %rdi
movl $0x8, %edx
callq 0x3380
leaq -0x248(%rbp), %rdi
callq 0x33a0
testb $0x1, -0x11(%rbp)
je 0x173fe
movsbl 0x12ed1(%rip), %edx     # 0x2a289
leaq -0x228(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x3470
jmp 0x173cd
jmp 0x173fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x3180
leaq -0x228(%rbp), %rdi
callq 0x3090
jmp 0x17490
jmp 0x17400
movsbl 0x12e82(%rip), %edx     # 0x2a289
leaq -0x228(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x3470
movq %rax, -0x260(%rbp)
jmp 0x17423
movq -0x260(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3350
movb %al, -0x261(%rbp)
jmp 0x17441
movb -0x261(%rbp), %al
testb $0x1, %al
jne 0x1744d
jmp 0x17461
movq -0x10(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq 0x174a0
jmp 0x1745f
jmp 0x17400
leaq -0x228(%rbp), %rdi
callq 0x3060
jmp 0x1746f
leaq -0x248(%rbp), %rdi
callq 0x3180
leaq -0x228(%rbp), %rdi
callq 0x3090
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq -0x250(%rbp), %rdi
callq 0x3440
nopl (%rax)
// File: 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
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x33a0
movb $0x0, -0x29(%rbp)
movq -0x8(%rbp), %rdi
callq 0x33d0
movl %eax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x177b3
testb $0x1, -0x29(%rbp)
je 0x1775d
movq -0x8(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x34a0
movq %rax, -0x50(%rbp)
jmp 0x17711
movq -0x50(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x1775d
leaq -0x28(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x31b0
movq -0x58(%rbp), %rdi
movq %rax, %rsi
decq %rsi
movl $0x1, %edx
callq 0x30a0
jmp 0x17740
movb $0x0, -0x29(%rbp)
jmp 0x177a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3180
jmp 0x177d1
movq -0x8(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x34a0
movq %rax, -0x60(%rbp)
jmp 0x17770
movq -0x60(%rbp), %rax
movb (%rax), %al
subb $0x22, %al
sete -0x29(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x34a0
movq %rax, -0x68(%rbp)
jmp 0x1778f
movq -0x68(%rbp), %rax
movsbl (%rax), %esi
leaq -0x28(%rbp), %rdi
callq 0x3220
jmp 0x177a1
jmp 0x177a3
jmp 0x177a5
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x176ec
movq -0x8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3040
jmp 0x177c2
leaq -0x28(%rbp), %rdi
callq 0x3180
addq $0x70, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3440
nopw (%rax,%rax)
// File: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x18(%rbp), %rdi
movslq -0xc(%rbp), %rax
movq %rax, -0x20(%rbp)
addq $0x20, %rdi
callq 0x65e0
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jae 0x17929
movl $0x0, -0x10(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x20, %rdi
movslq -0xc(%rbp), %rsi
callq 0x17b70
movq %rax, %rdi
callq 0x13680
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x17908
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movslq -0xc(%rbp), %rsi
callq 0x17b70
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x13660
movq %rax, %rsi
movq 0x126e5(%rip), %rdi     # 0x29fd0
callq 0x3240
movq %rax, %rdi
movl $0x9, %esi
callq 0x3320
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x17897
movq 0x126c1(%rip), %rdi     # 0x29fd0
movq 0x126a2(%rip), %rsi     # 0x29fb8
callq 0x32b0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1786b
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x1c(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0x20, %rdi
callq 0x65e0
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jae 0x17a54
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
addq $0x20, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x17b70
movq %rax, %rdi
callq 0x13680
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jb 0x17a15
movl $0x10, %edi
callq 0x3120
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
leaq 0x4bf0(%rip), %rsi      # 0x1c5d0
callq 0x33b0
jmp 0x179e7
movq -0x50(%rbp), %rdi
movq 0x125ee(%rip), %rsi     # 0x29fe0
movq 0x125cf(%rip), %rdx     # 0x29fc8
callq 0x3420
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x31d0
jmp 0x17a5a
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
addq $0x20, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x17b70
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x13660
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x17a70
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x17973
addq $0x60, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: cooljacket[P]Dormitory-distribution/CSVReader/CSVMapContainer.cpp
// Function: CSVMapContainer::addToRowDone()
void CSVMapContainer::addToRowDone() {
	if (m_indexOfKeyRow >= m_row.size())
		throw logic_error("The key's index is large than the size of row.");
	if (m_table.find(m_row[m_indexOfKeyRow]) != m_table.end())
		throw logic_error("The key is duplicate.");
	m_table[m_row[m_indexOfKeyRow]] = m_row;
	m_row.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movq 0x50(%rdi), %rax
movq %rax, -0x30(%rbp)
addq $0x8, %rdi
callq 0x13680
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jb 0x19144
movl $0x10, %edi
callq 0x3120
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x350b(%rip), %rsi      # 0x1c617
callq 0x33b0
jmp 0x19113
movq -0x40(%rbp), %rdi
movq 0x10ec2(%rip), %rsi     # 0x29fe0
movq 0x10ea3(%rip), %rdx     # 0x29fc8
callq 0x3420
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x31d0
jmp 0x1923c
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, -0x48(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movq 0x50(%rax), %rsi
callq 0x13710
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x194d0
movq -0x38(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x20, %rdi
callq 0x19500
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x194a0
testb $0x1, %al
jne 0x19197
jmp 0x191e7
movl $0x10, %edi
callq 0x3120
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
leaq 0x3494(%rip), %rsi      # 0x1c646
callq 0x33b0
jmp 0x191b9
movq -0x50(%rbp), %rdi
movq 0x10e1c(%rip), %rsi     # 0x29fe0
movq 0x10dfd(%rip), %rdx     # 0x29fc8
callq 0x3420
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x31d0
jmp 0x1923c
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x58(%rbp)
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, -0x60(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movq 0x50(%rax), %rsi
callq 0x13710
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x19530
movq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x19610
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
callq 0x17b50
addq $0x60, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)
// File: cooljacket[P]Dormitory-distribution/CSVReader/CSVMapContainer.cpp
// Function: CSVMapContainer::display() const
void CSVMapContainer::display() const {
	map<string, vector<string> >::const_iterator it = m_table.begin();
	while (it != m_table.end()) {
		const vector<string>& row = it->second;
		for (int i = 0; i < row.size(); ++i)
			cout << row[i] << '\t';
		cout << endl;
		++it;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x20, %rdi
callq 0x19860
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
callq 0x198c0
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x19890
testb $0x1, %al
jne 0x19298
jmp 0x19322
leaq -0x10(%rbp), %rdi
callq 0x198f0
addq $0x20, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x13680
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x19301
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rsi
callq 0x13660
movq %rax, %rsi
movq 0x10cec(%rip), %rdi     # 0x29fd0
callq 0x3240
movq %rax, %rdi
movl $0x9, %esi
callq 0x3320
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x192b0
movq 0x10cc8(%rip), %rdi     # 0x29fd0
movq 0x10ca9(%rip), %rsi     # 0x29fb8
callq 0x32b0
leaq -0x10(%rbp), %rdi
callq 0x19910
jmp 0x19271
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: cooljacket[P]Dormitory-distribution/CSVReader/CSVMapContainer.cpp
// Function: CSVMapContainer::getColData(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>>>>>&, unsigned long) const
void CSVMapContainer::getColData(map<string, string>& data, size_t indexOfCol) const {
	map<string, vector<string> >::const_iterator it = m_table.begin();
	while (it != m_table.end()) {
		const vector<string>& row = it->second;
		if (indexOfCol >= row.size())
			throw logic_error("The index of column is large than the row's size.");
		data[it->first] = row[indexOfCol];
		++it;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
addq $0x20, %rdi
callq 0x19860
movq %rax, -0x20(%rbp)
movq -0x48(%rbp), %rdi
addq $0x20, %rdi
callq 0x198c0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x19890
testb $0x1, %al
jne 0x193a0
jmp 0x19466
leaq -0x20(%rbp), %rdi
callq 0x198f0
addq $0x20, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
callq 0x13680
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jb 0x1941e
movl $0x10, %edi
callq 0x3120
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
leaq 0x31e7(%rip), %rsi      # 0x1c5d0
callq 0x33b0
jmp 0x193f0
movq -0x58(%rbp), %rdi
movq 0x10be5(%rip), %rsi     # 0x29fe0
movq 0x10bc6(%rip), %rdx     # 0x29fc8
callq 0x3420
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x31d0
jmp 0x1946c
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x13660
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x198f0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x14d20
movq -0x60(%rbp), %rsi
movq %rax, %rdi
callq 0x3040
leaq -0x20(%rbp), %rdi
callq 0x19910
jmp 0x19379
addq $0x70, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)
nop
// File: sopanpatra160[P]OOO_Superscalar_Processor_Simulator/cache.cc
// Function: cache::lru_update(unsigned int, unsigned int)
void cache::lru_update(unsigned int ind, unsigned int blk){
	unsigned int tmp;
	tmp=lru_store[ind][blk];
	for (unsigned int j=0; j<a; j++){
		if(lru_store[ind][j]<tmp)
			lru_store[ind][j]++;
	}
	lru_store[ind][blk]=0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x40(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x10(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0x222f
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x18(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
jae 0x2222
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x18(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x2224
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x21e1
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x10(%rbp), %ecx
movl $0x0, (%rax,%rcx,4)
popq %rbp
retq
nopw (%rax,%rax)
// File: sopanpatra160[P]OOO_Superscalar_Processor_Simulator/cache.cc
// Function: cache::lfu_update_block(unsigned int, unsigned int, unsigned int)
void cache::lfu_update_block(unsigned int ind, unsigned int blk, unsigned int hit){
	//For HIT  block count = block count +1
	if(hit == 1){
		lfu_block_store[ind][blk]+=1;
	}
	//For MISS block count = set count + 1
	else if(hit == 0){
		lfu_block_store[ind][blk]=lfu_set_store[ind]+1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0x228c
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x10(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x22b6
cmpl $0x0, -0x14(%rbp)
jne 0x22b4
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rcx
movl -0xc(%rbp), %edx
movl (%rcx,%rdx,4), %edx
addl $0x1, %edx
movq 0x48(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x10(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x22b6
popq %rbp
retq
nopl (%rax,%rax)
// File: sopanpatra160[P]OOO_Superscalar_Processor_Simulator/cache.cc
// Function: cache::lru_block2evict(unsigned int)
unsigned int cache::lru_block2evict(unsigned int ind){

	unsigned int max=0;
	for(unsigned int j=0;j<a; j++){	
		if(lru_store[ind][max]<lru_store[ind][j])
			max=j;
	}
	return max;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0x24f8
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rax
movl -0xc(%rbp), %edx
movq (%rax,%rdx,8), %rax
movl -0x10(%rbp), %edx
movl (%rax,%rdx,4), %eax
movq 0x40(%rcx), %rcx
movl -0xc(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
movl -0x14(%rbp), %edx
cmpl (%rcx,%rdx,4), %eax
jae 0x24eb
movl -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x24ed
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x24b1
movl -0x10(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: sopanpatra160[P]OOO_Superscalar_Processor_Simulator/cache.cc
// Function: cache::lfu_block2evict(unsigned int)
unsigned int cache::lfu_block2evict(unsigned int ind){
	unsigned int min=0;
	for(unsigned int j=0; j<a; j++){	
		if(lfu_block_store[ind][min]>lfu_block_store[ind][j])
			min=j;
	}
	return min;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0x2568
movq -0x20(%rbp), %rcx
movq 0x48(%rcx), %rax
movl -0xc(%rbp), %edx
movq (%rax,%rdx,8), %rax
movl -0x10(%rbp), %edx
movl (%rax,%rdx,4), %eax
movq 0x48(%rcx), %rcx
movl -0xc(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
movl -0x14(%rbp), %edx
cmpl (%rcx,%rdx,4), %eax
jbe 0x255b
movl -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x255d
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2521
movl -0x10(%rbp), %eax
popq %rbp
retq
nopl (%rax)