LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sagardoshi[P]NegotiationsEncounter/src/PlayerCharacter.cpp
// Function: PlayerCharacter::takeBackOffer(Inventory*)
void PlayerCharacter::takeBackOffer(Inventory* table) {
    map<string, int>::iterator it;
    string item = "";
    int amount = 0;

    for (it = table->inventory.begin(); it != table->inventory.end(); it++) {
        item = it->first;
        amount = it->second;
        if (amount > 0) {
            table->inventory[item] = 0; // Take item(s) off table
            inventory[item] += amount;  // Put item(s) back into bag

        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x619(%rip), %rsi       # 0xc3b8
leaq 0x8(%rsp), %r15
leaq 0x7(%rsp), %rdx
movq %r15, %rdi
callq 0x3860
leaq 0x38(%rbx), %r12
movq 0x50(%rbx), %r13
addq $0x40, %rbx
addq $0x38, %r14
cmpq %rbx, %r13
je 0xbe02
leaq 0x20(%r13), %rsi
movq %r15, %rdi
callq 0x3170
movl 0x40(%r13), %ebp
testl %ebp, %ebp
jle 0xbdf5
movq %r12, %rdi
movq %r15, %rsi
callq 0x5bb4
andl $0x0, (%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x5bb4
addl %ebp, (%rax)
movq %r13, %rdi
callq 0x31a0
movq %rax, %r13
jmp 0xbdc1
leaq 0x8(%rsp), %rdi
callq 0x3130
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/nmmmnu[P]HM3/test/test_checkedvalue.cc
// Function: void test_pass<CalcError, (CalcError)0, (CalcError)2>(bool)
void test_pass(bool const success){
	constexpr int n = 5;

	const float dividor	= success ? 1 : 0;
	const auto  expected	= success ? OK : ERR;

	const auto v = test_function<T, OK, ERR>(n, dividor);

	PRINTF_TEST("bool",	v == success		);
	PRINTF_TEST("code()",	v.code() == expected	);

	if (success)
	PRINTF_TEST("get()",	v.get() == n		);

	printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0xe60(%rip), %r14       # 0x2004
leaq 0xe71(%rip), %r15       # 0x201c
leaq 0xe77(%rip), %rdx       # 0x2029
leaq 0xe75(%rip), %r12       # 0x202e
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x1030
leaq 0xe61(%rip), %rdx       # 0x2031
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x1030
testl %ebx, %ebx
je 0x1207
leaq 0xe19(%rip), %rdi       # 0x2004
leaq 0xe2a(%rip), %rsi       # 0x201c
leaq 0xe3f(%rip), %rdx       # 0x2038
leaq 0xe2e(%rip), %rcx       # 0x202e
xorl %eax, %eax
callq 0x1030
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: expandVector(vector&)
void expandVector(vector& v) {
	int* new_keys = new int[v.size+1];
	double* new_values = new double[v.size+1];
	for(int i=0; i<v.size; i++) {
		new_keys[i] = v.keys[i];
		new_values[i] = v.values[i];
	}

	if(v.keys != 0)
		delete v.keys;
	if(v.values != 0)
		delete v.values;

	v.size++;
	v.keys = new_keys;
	v.values = new_values;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq (%rdi), %r12
pushq $-0x1
popq %rax
cmpq %rax, %r12
leaq 0x4(,%r12,4), %rdi
cmovlq %rax, %rdi
leaq 0x8(,%r12,8), %r15
cmovlq %rax, %r15
callq 0x1030
movq %rax, %r14
movq %r15, %rdi
callq 0x1030
movq %rax, %r15
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdi
xorl %ecx, %ecx
testl %r12d, %r12d
movl $0x0, %edx
cmovgl %r12d, %edx
cmpq %rcx, %rdx
je 0x12dd
movl (%rax,%rcx,4), %esi
movl %esi, (%r14,%rcx,4)
movsd (%rdi,%rcx,8), %xmm0
movsd %xmm0, (%r15,%rcx,8)
incq %rcx
jmp 0x12c1
testq %rax, %rax
je 0x12ee
movq %rax, %rdi
callq 0x10b0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x12f8
callq 0x10b0
incl (%rbx)
movq %r14, 0x8(%rbx)
movq %r15, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: scalar(vector const&, vector const&)
double scalar(const vector& v1, const vector& v2) {
	double result = 0;
	int i1 = 0, i2 = 0;
	while(i1 < v1.size && i2 < v2.size) {
		if(v1.keys[i1] == v2.keys[i2]) {
			result += v1.values[i1] * v2.values[i2];
			i1++;
			i2++;
		} else if (v1.keys[i1] < v2.keys[i2]) {
			i1++;
		} else {
			i2++;
		}
	}
	return result;
}

// Assembly:
pushq %rbx
movl (%rdi), %eax
movl (%rsi), %ecx
movq 0x8(%rdi), %rdx
movq 0x8(%rsi), %r8
movq 0x10(%rdi), %rdi
movq 0x10(%rsi), %rsi
xorl %r9d, %r9d
xorpd %xmm0, %xmm0
xorl %r10d, %r10d
movslq %r9d, %r11
movslq %r10d, %r10
cmpl %eax, %r9d
jge 0x136b
cmpl %ecx, %r10d
jge 0x136b
movl (%r8,%r10,4), %ebx
cmpl %ebx, (%rdx,%r11,4)
je 0x134e
jl 0x1366
incq %r10
jmp 0x1333
movsd (%rdi,%r11,8), %xmm1
mulsd (%rsi,%r10,8), %xmm1
addsd %xmm1, %xmm0
incl %r9d
incl %r10d
jmp 0x132d
incl %r9d
jmp 0x132d
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: distanceSQ(vector const&, vector const&)
double distanceSQ(const vector& v1, const vector& v2) {
	double result = 0;
	int i1 = 0, i2 = 0;
	while(i1 < v1.size && i2 < v2.size) {
		double diff;
		if(v1.keys[i1] == v2.keys[i2]) {
			diff = v1.values[i1] - v2.values[i2];
			i1++;
			i2++;
		} else if (v1.keys[i1] < v2.keys[i2]) {
			diff = v1.values[i1];
			i1++;
		} else {
			diff = v2.values[i2];
			i2++;
		}
		result += diff * diff;
	}
	return result;
}

// Assembly:
pushq %rbp
pushq %rbx
movl (%rdi), %eax
movl (%rsi), %ecx
movq 0x8(%rdi), %rdx
movq 0x8(%rsi), %r8
movq 0x10(%rsi), %rsi
movq 0x10(%rdi), %rdi
xorl %r9d, %r9d
xorpd %xmm0, %xmm0
xorl %r10d, %r10d
cmpl %eax, %r9d
jge 0x13d5
cmpl %ecx, %r10d
jge 0x13d5
movslq %r9d, %rbx
movslq %r10d, %r11
movl (%r8,%r11,4), %ebp
cmpl %ebp, (%rdx,%rbx,4)
jne 0x13b6
movsd (%rdi,%rbx,8), %xmm1
subsd (%rsi,%r11,8), %xmm1
incl %r9d
jmp 0x13c8
jge 0x13c2
movsd (%rdi,%rbx,8), %xmm1
incl %r9d
jmp 0x13cb
movsd (%rsi,%r11,8), %xmm1
incl %r10d
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
jmp 0x138d
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: clone(vector&, vector&)
void clone(vector& dest, vector& src) {
	if(dest.keys != 0)
		delete dest.keys;
	if(dest.values != 0)
		delete dest.values;
	dest.size = src.size;
	dest.keys = new int[dest.size];
	dest.values = new double[dest.size];
	for(int i=0; i<dest.size; i++) {
		dest.keys[i] = src.keys[i];
		dest.values[i] = src.values[i];
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x13f5
callq 0x10b0
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x1403
callq 0x10b0
movslq (%rbx), %r13
movl %r13d, (%r14)
leaq (,%r13,4), %rdi
testq %r13, %r13
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
leaq (,%r13,8), %r12
cmovsq %rax, %r12
callq 0x1030
movq %rax, %r15
movq %rax, 0x8(%r14)
movq %r12, %rdi
callq 0x1030
movq %rax, 0x10(%r14)
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
xorl %esi, %esi
cmpq %r13, %rsi
jge 0x1464
movl (%rcx,%rsi,4), %edi
movl %edi, (%r15,%rsi,4)
movsd (%rdx,%rsi,8), %xmm0
movsd %xmm0, (%rax,%rsi,8)
incq %rsi
jmp 0x1449
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: recomputeCentroid(cluster&)
void recomputeCentroid(cluster& cl) {
	vector &centroid = cl.centroid;
	list<vector*> vectors;
	for(int i=0; i<cl.members.size();i++)
		vectors.add(&(cl.members.get(i)->v));

	centroid.size = 0;
	computeCentroid(centroid, vectors);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movabsq $0x200000000, %rax      # imm = 0x200000000
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
pushq $0x10
popq %rdi
callq 0x1030
movq %rax, 0x8(%r14)
xorl %r12d, %r12d
movq %rsp, %r15
movslq 0x18(%rbx), %rax
cmpq %rax, %r12
jge 0x1685
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rax
addq $0x8, %rax
movq %rax, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1bfe
incq %r12
jmp 0x165c
andl $0x0, (%rbx)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x146e
movq 0x10(%rsp), %rdi
callq 0x10b0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x16ad
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x10b0
movq %rbx, %rdi
callq 0x1150
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: selectSeeds(cluster*, list<article_entry*>&, int)
void selectSeeds(cluster* clusters, entryList &l, int k) {
	int index = 0;
	for(int i=0; i<l.size(); i++) {
		index = i % k;
		cluster &cl = clusters[index];
		article_entry* e = l.get(i);
		cl.members.add(e);
	}
	printf("Computing centroids ");
	for(int i=0; i<k; i++) {
		printf("%d ", i);
		recomputeCentroid(clusters[i]);
	}
	printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
xorl %r12d, %r12d
leaq 0x8(%rsp), %r13
movslq (%r15), %rax
cmpq %rax, %r12
jge 0x1713
movl %r12d, %eax
cltd
idivl %ebx
movq 0x8(%r15), %rax
movq (%rax,%r12,8), %rax
movq %rax, 0x8(%rsp)
imulq $0x28, %rdx, %rax
leaq (%r14,%rax), %rdi
addq $0x18, %rdi
movq %r13, %rsi
callq 0x1c80
incq %r12
jmp 0x16df
leaq 0x1906(%rip), %rdi      # 0x3020
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x1040
testl %ebx, %ebx
cmovlel %r15d, %ebx
leaq 0x1904(%rip), %r15      # 0x3035
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x1757
movq %r15, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x1040
movq %r14, %rdi
callq 0x162a
incq %r12
addq $0x28, %r14
jmp 0x1734
pushq $0xa
popq %rdi
callq 0x10e0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: findBestCluster(cluster*, int, vector&)
cluster& findBestCluster(cluster* clusters, int k, vector& v) {
	int best_cl = 0;
	double best_dist = INFINITY;
	for(int i=0; i<k; i++) {
		double dist = distanceSQ(v, clusters[i].centroid);
		if(dist < best_dist) {
			best_dist = dist;
			best_cl = i;
		}
	}
	return clusters[best_cl];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
xorl %r13d, %r13d
testl %esi, %esi
cmovlel %r13d, %r14d
movq %rdi, %r15
movsd 0x1876(%rip), %xmm0     # 0x3008
movq %rdi, %r12
xorl %ebp, %ebp
cmpq %r13, %r14
je 0x17c6
movq %rbx, %rdi
movq %r12, %rsi
movsd %xmm0, (%rsp)
callq 0x136d
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmoval %r13d, %ebp
minsd %xmm1, %xmm0
incq %r13
addq $0x28, %r12
jmp 0x1797
movslq %ebp, %rax
imulq $0x28, %rax, %rax
addq %rax, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: calculateRSS(cluster&)
double calculateRSS(cluster& c) {
	double result = 0;
	for (int i=0; i<c.members.size(); i++) {
		result += distanceSQ(c.centroid, c.members.get(i)->v);
	}
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x18(%rdi), %r14d
movq 0x20(%rdi), %r15
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
xorpd %xmm0, %xmm0
cmpq %r12, %r14
je 0x1835
movq (%r15,%r12,8), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
movsd %xmm0, (%rsp)
callq 0x136d
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r12
jmp 0x1803
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: printRSS(cluster*, int)
double printRSS(cluster* clusters, int n) {
	double result = 0;
	for(int i=0; i<n; i++) {
		double rss = calculateRSS(clusters[i]);
		printf("Cluster %d: RSS = %f Members = %d\n", i, rss, clusters[i].members.size());
		result += rss;
	}
	printf("Total RSS = %f\n", result);
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
testl %esi, %esi
cmovlel %r15d, %ebx
xorpd %xmm0, %xmm0
leaq 0x17d4(%rip), %r12      # 0x3039
cmpq %r15, %rbx
movsd %xmm0, 0x8(%rsp)
je 0x18a4
movq %r14, %rdi
callq 0x17e2
movsd %xmm0, 0x10(%rsp)
movl 0x18(%r14), %edx
movq %r12, %rdi
movl %r15d, %esi
movb $0x1, %al
callq 0x1040
movsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
incq %r15
addq $0x28, %r14
jmp 0x1865
leaq 0x17b1(%rip), %rdi      # 0x305c
movb $0x1, %al
callq 0x1040
movsd 0x8(%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: normalize(article_entry*)
void normalize(article_entry* entry) {
	double factor = 0;
	for(int i=0; i<entry->v.size; i++) {
		double d = entry->v.values[i];
		factor += d * d;
	}
	factor = sqrt(factor);
	for (int i=0; i<entry->v.size; i++) {
		entry->v.values[i] = entry->v.values[i] / factor;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
xorpd %xmm0, %xmm0
cmpq %rcx, %rax
je 0x1afc
movq 0x18(%rbx), %rdx
movsd (%rdx,%rcx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rcx
jmp 0x1ae1
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1b0c
sqrtsd %xmm0, %xmm0
jmp 0x1b11
callq 0x1090
movl 0x8(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
cmpq %rcx, %rax
je 0x1b37
movq 0x18(%rbx), %rdx
movsd (%rdx,%rcx,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rdx,%rcx,8)
incq %rcx
jmp 0x1b1b
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans.cpp
// Function: kmeans(list<article_entry*>&)
void kmeans(list<article_entry*> &l) {
	// Normalize vectors
	printf("Normalizing vectors\n");
	for(int i=0; i<l.size(); i++)
		normalize(l.get(i));
	clusterize(CLUSTERS, l);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1550(%rip), %rdi      # 0x3097
callq 0x1130
xorl %r14d, %r14d
movslq (%rbx), %rax
cmpq %rax, %r14
jge 0x1b69
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1acf
incq %r14
jmp 0x1b4f
pushq $0xa
popq %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x18c4
nop
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/list.h
// Function: list<iter*>::add(iter* const&)
void add(const T& el) {
		if(s == cap) {
			int new_c = cap << 1;
			T* new_arr = new T[new_c];
			for (int i=0; i<cap; i++)
				new_arr[i] = arr[i];
			delete arr;
			arr = new_arr;
			cap = new_c;
		}
		arr[s] = el;
		s++;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %r12d
cmpl 0x4(%rdi), %r12d
jne 0x1bd2
leal (%r12,%r12), %ebp
movslq %ebp, %rax
leaq (,%rax,8), %rcx
testl %eax, %eax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
callq 0x1030
movq %rax, %r15
movq 0x8(%rbx), %rdi
xorl %eax, %eax
testl %r12d, %r12d
cmovlel %eax, %r12d
cmpq %rax, %r12
je 0x1bd8
movq (%rdi,%rax,8), %rcx
movq %rcx, (%r15,%rax,8)
incq %rax
jmp 0x1bc0
movq 0x8(%rbx), %r15
jmp 0x1be7
callq 0x10b0
movq %r15, 0x8(%rbx)
movl %ebp, 0x4(%rbx)
movl (%rbx), %r12d
movq (%r14), %rax
movslq %r12d, %rcx
movq %rax, (%r15,%rcx,8)
incl %ecx
movl %ecx, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/list.h
// Function: list<article_entry*>::clear()
void clear() {
		s = 0;
		cap = 2;
		delete arr;
		arr = new T[cap];
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movabsq $0x200000000, %rax      # imm = 0x200000000
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
callq 0x10b0
movslq 0x4(%rbx), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
callq 0x1030
movq %rax, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans_main.cpp
// Function: save(list<article_entry*>&, hash<double>&, char const*)
void save(list<article_entry*> &entries, hash<double> &h, const char* name) {
	article_entry* entry = new article_entry;
	entries.add(entry);
	int size = h.size;
	entry->v.size = size;
	int* keys = new int[size];
	double* values = new double[size];
	for(int i=0; i<size; i++) {
		keys[i] = h.keys[i];
		values[i] = h.data[i];
	}
	int nameLength = strlen(name);
	char* entry_name = new char[nameLength + 1];
	for(int i=0; i<nameLength; i++)
		entry_name[i] = name[i];
	entry_name[nameLength] = 0;
	entry->name = entry_name;
	entry->v.keys = keys;
	entry->v.values = values;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
pushq $0x20
popq %rdi
callq 0x10c0
andl $0x0, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1c80
movslq 0x4(%r13), %rbp
movq (%r15), %rax
movq %rax, 0x8(%rsp)
movl %ebp, 0x8(%rax)
leaq (,%rbp,4), %rdi
testq %rbp, %rbp
pushq $-0x1
popq %r12
cmovsq %r12, %rdi
leaq (,%rbp,8), %r15
cmovsq %r12, %r15
callq 0x1030
movq %rax, %r14
movq %r15, %rdi
callq 0x1030
movq %rax, %r15
movq 0x8(%r13), %rax
movq 0x10(%r13), %rcx
xorl %edx, %edx
testl %ebp, %ebp
movl $0x0, %esi
cmovgl %ebp, %esi
cmpq %rdx, %rsi
je 0x1e2a
movl (%rcx,%rdx,4), %edi
movl %edi, (%r14,%rdx,4)
movsd (%rax,%rdx,8), %xmm0
movsd %xmm0, (%r15,%rdx,8)
incq %rdx
jmp 0x1e0e
movq %rbx, %rdi
callq 0x1070
movq %rax, %rbp
movq %rax, %r13
shlq $0x20, %r13
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %r13, %rax
sarq $0x20, %rax
cmovnsq %rax, %r12
movq %r12, %rdi
callq 0x1030
xorl %ecx, %ecx
testl %ebp, %ebp
movl $0x0, %edx
cmovgl %ebp, %edx
cmpq %rcx, %rdx
je 0x1e77
movb (%rbx,%rcx), %sil
movb %sil, (%rax,%rcx)
incq %rcx
jmp 0x1e65
sarq $0x20, %r13
movb $0x0, (%rax,%r13)
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq 0x10(%rsp), %rax
movq %r14, 0x10(%rax)
movq %r15, 0x18(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans_main.cpp
// Function: processFile(char const*, char const*, ptree<int>&, list<article_entry*>&)
void processFile(const char* path, const char* name, ptree<int>& p, list<article_entry*> &entries) {
	if(*name == '.')
		return;
	int fd = open(path, O_RDONLY);
	if(fd < 0) {
		printf("Cannot open file %s\nCode = %d\n", path, fd);
		return;
	}
	char* fullData = 0;
	readFullData(fd, &fullData);
	close(fd);

	char buffer[4096];
	int offset = 0;
	
	hash<double> h;
	int* index_ptr = 0;
	int index = 0;
	while(readToken(fullData, offset, buffer, 4096)) {
		if(strlen(buffer) <= 3)
			continue;
		index_ptr = p.get(buffer);
		if(index_ptr == 0) {
			p.add(buffer, tokenCount);
			index = tokenCount;
			tokenCount++;
		} else {
			index = *index_ptr;
		}

		int tf = h.get(index, 0);
		tf++;
		h.insert(index, tf);
	}

	save(entries, h, name);

	delete fullData;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1058, %rsp           # imm = 0x1058
cmpb $0x2e, (%rsi)
je 0x1fdc
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
xorl %eax, %eax
callq 0x1080
movl %eax, %ebp
testl %eax, %eax
js 0x1fee
movq %r12, 0x20(%rsp)
movq %r14, 0x28(%rsp)
leaq 0x18(%rsp), %rsi
andq $0x0, (%rsi)
movl %ebp, %edi
callq 0x2899
movl %ebp, %edi
callq 0x1160
leaq 0x34(%rsp), %r12
andl $0x0, (%r12)
leaq 0x38(%rsp), %r13
movq %r13, %rdi
callq 0x22a8
leaq 0xc(%rsp), %rbp
andl $0x0, (%rbp)
leaq 0x50(%rsp), %r14
leaq 0x10(%rsp), %rbx
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x27fd
testb %al, %al
je 0x1fbe
movq %r14, %rdi
callq 0x1070
cmpq $0x4, %rax
jb 0x1f28
movq %r15, %rdi
movq %r14, %rsi
callq 0x22d2
testq %rax, %rax
je 0x1f63
movl (%rax), %eax
jmp 0x1f83
movl 0x316f(%rip), %edx      # 0x50d8
movq %r15, %rdi
movq %r14, %rsi
callq 0x2314
movl 0x315e(%rip), %eax      # 0x50d8
leal 0x1(%rax), %ecx
movl %ecx, 0x3155(%rip)      # 0x50d8
movl %eax, 0xc(%rsp)
andq $0x0, 0x10(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x2396
cvttsd2si (%rax), %eax
incl %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x23cc
jmp 0x1f28
leaq 0x38(%rsp), %rsi
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rdx
callq 0x1d7c
movq 0x18(%rsp), %rdi
callq 0x10b0
addq $0x1058, %rsp           # imm = 0x1058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10c3(%rip), %rdi      # 0x30b8
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
addq $0x1058, %rsp           # imm = 0x1058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1040
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/kmeans_main.cpp
// Function: main
int main(int argc, char** argv) {
	setbuf(stdout, NULL);
	if(argc < 2) {
		printf("Not enough arguments\n");
		printf("Usage: %s <input_dir> <output_file>", argv[0]);
		return 1;
	}

	const char* inputPath = argv[1];
	processDirectory(inputPath);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movq 0x2d6e(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x10f0
cmpl $0x1, %ebp
jg 0x2297
leaq 0xea9(%rip), %rdi       # 0x3124
callq 0x1130
movq (%rbx), %rsi
leaq 0xe76(%rip), %rdi       # 0x3100
xorl %eax, %eax
callq 0x1040
pushq $0x1
popq %r14
jmp 0x22a0
movq 0x8(%rbx), %rdi
callq 0x2012
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/hash.h
// Function: hash<double>::hash()
hash<T>::hash() {
  hash<T>& h = *this;
  h.cap = 2;
  h.size = 0;
  h.keys = new int[cap];
  for (int i=0; i<cap; i++) {
    h.keys[i] = -1;
  }
  h.data = new T[cap];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq $0x2, (%rdi)
pushq $0x8
popq %rdi
callq 0x1030
movq %rax, 0x10(%rbx)
orq $-0x1, (%rax)
pushq $0x10
popq %rdi
callq 0x1030
movq %rax, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::get(char const*)
T* ptree<T>::get(const char* str) {
	const char* s = str;
	int state = 0;
	while(*s != '\0' && state >= 0) {
		int c = getIndex(*s);
		state = table[state][c];
		s++;
	}

	if(state == -1 || !flags[state])
		return 0;

	return values + state;
}

// Assembly:
movq (%rdi), %rcx
xorl %eax, %eax
movsbq (%rsi), %rdx
testq %rdx, %rdx
je 0x22f6
testl %eax, %eax
js 0x22f6
movl %eax, %eax
movq (%rcx,%rax,8), %rax
movl -0xc0(%rax,%rdx,4), %eax
incq %rsi
jmp 0x22d7
cmpl $-0x1, %eax
je 0x2310
movq 0x10(%rdi), %rcx
cltq
cmpb $0x1, (%rcx,%rax)
jne 0x2310
shlq $0x2, %rax
addq 0x8(%rdi), %rax
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::add(char const*, int)
void ptree<T>::add(const char* str, T i) {
	const char* s = str;
	int state = 0;
	while(*s != '\0') {
		int c = getIndex(*s);
		int n_state = table[state][c];
		if(n_state == -1) {
			break;
		}
		state = n_state;
		s++;
	}

	while(*s != '\0') {
		int c = getIndex(*s);
		int n_state = buildState();
		table[state][c] = n_state;
		state = n_state;
		s++;
	}
	values[state] = i;
	flags[state] = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
movq (%rdi), %rdx
incq %rsi
xorl %edi, %edi
movl %edi, %eax
movq %rsi, %r15
movsbq -0x1(%rsi), %rcx
testq %rcx, %rcx
je 0x2373
movslq %eax, %rsi
movq (%rdx,%rsi,8), %rsi
movl -0xc0(%rsi,%rcx,4), %edi
leaq 0x1(%r15), %rsi
cmpl $-0x1, %edi
jne 0x232a
jmp 0x2373
movsbq %cl, %r13
movq %r14, %rdi
callq 0x251a
movq (%r14), %rcx
movq (%rcx,%r12,8), %rcx
movl %eax, -0xc0(%rcx,%r13,4)
movb (%r15), %cl
incq %r15
movslq %eax, %r12
testb %cl, %cl
jne 0x2352
movq 0x8(%r14), %rax
movl %ebx, (%rax,%r12,4)
movq 0x10(%r14), %rax
movb $0x1, (%rax,%r12)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/hash.h
// Function: hash<double>::insert(int const&, double const&)
void hash<T>::insert(const int& key, const T& el) {
  int index = bin_search(keys, size, key);
  if(index >= 0) {
    this->data[index] = el;
  } else {
    if(size >= cap)
      expand();
    index = -index - 1;
    for (int i = size; i > index; i--) {
      keys[i] = keys[i-1];
      data[i] = data[i-1];
    }
    keys[index] = key;
    data[index] = el;
    size++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movl 0x4(%rbx), %esi
movq %r15, %rdx
callq 0x267a
movl %eax, %ebp
testl %eax, %eax
js 0x2403
movsd (%r14), %xmm0
movq 0x8(%rbx), %rax
movl %ebp, %ecx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x2452
movl 0x4(%rbx), %ecx
cmpl (%rbx), %ecx
jl 0x2415
movq %rbx, %rdi
callq 0x26ac
movl 0x4(%rbx), %ecx
notl %ebp
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdx
cmpl %ebp, %ecx
jle 0x2439
movl %ecx, %esi
decl %ecx
movl (%rdx,%rcx,4), %edi
movl %edi, (%rdx,%rsi,4)
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rsi,8)
jmp 0x241f
movl (%r15), %ecx
movq 0x10(%rbx), %rdx
movl %ebp, %esi
movl %ecx, (%rdx,%rsi,4)
movsd (%r14), %xmm0
movsd %xmm0, (%rax,%rsi,8)
incl 0x4(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::ptree()
ptree<T>::ptree() {
	cap = 1;
	size = 1;
	table = new int*[cap];
	table[0] = new int[SIZE];
	for(int i=0; i<SIZE; i++)
		table[0][i] = -1;
	values = new T[cap];
	values[0] = -1;
	flags = new bool[cap];
	flags[0] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x18(%rdi)
pushq $0x8
popq %rdi
callq 0x1030
movq %rax, %r14
movq %rax, (%rbx)
movslq 0x2c47(%rip), %r15      # 0x50d0
leaq (,%r15,4), %rax
testq %r15, %r15
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x1030
movq %rax, (%r14)
xorl %ecx, %ecx
cmpq %r15, %rcx
jge 0x24b3
orl $-0x1, (%rax,%rcx,4)
incq %rcx
jmp 0x24a5
pushq $0x4
popq %rdi
callq 0x1030
movq %rax, 0x8(%rbx)
orl $-0x1, (%rax)
pushq $0x1
popq %rdi
callq 0x1030
movq %rax, 0x10(%rbx)
movb $0x0, (%rax)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::~ptree()
ptree<T>::~ptree() {
	for(int i=0; i<size; i++)
		delete table[i];
	delete table;
	delete values;
	delete flags;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x1c(%rbx), %rax
movq (%rbx), %rdi
cmpq %rax, %r14
jge 0x24fc
movq (%rdi,%r14,8), %rdi
callq 0x10b0
incq %r14
jmp 0x24e2
callq 0x10b0
movq 0x8(%rbx), %rdi
callq 0x10b0
movq 0x10(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10b0
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::buildState()
int ptree<T>::buildState() {
	if(size == cap)
		expand();
	if(size == 1423)
		size = size;

	int result = size;
	size++;
	table[result] = new int[SIZE];
	for(int i=0; i<SIZE; i++)
		table[result][i] = -1;
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movl 0x1c(%rdi), %ebx
cmpl 0x18(%rdi), %ebx
jne 0x2536
movq %r14, %rdi
callq 0x258e
movl 0x1c(%r14), %ebx
leal 0x1(%rbx), %eax
movl %eax, 0x1c(%r14)
movslq 0x2b8c(%rip), %r15      # 0x50d0
leaq (,%r15,4), %rax
testq %r15, %r15
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x1030
movq (%r14), %rdx
movslq %ebx, %rcx
movq %rax, (%rdx,%rcx,8)
movq (%r14), %rax
xorl %edx, %edx
movslq %r15d, %rsi
cmpq %rsi, %rdx
jge 0x2586
movq (%rax,%rcx,8), %rsi
orl $-0x1, (%rsi,%rdx,4)
incq %rdx
movl 0x2b4c(%rip), %r15d     # 0x50d0
jmp 0x256a
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/ptree.h
// Function: ptree<int>::expand()
void ptree<T>::expand() {
	int new_cap = cap << 1;
	int** new_table = new int*[new_cap];
	T* new_values = new T[new_cap];
	bool* new_flags = new bool[new_cap];
	for(int i=0; i<cap; i++) {
		new_table[i] = table[i];
		new_values[i] = values[i];
		new_flags[i] = flags[i];
	}
	for(int i=cap; i<new_cap; i++) {
		new_table[i] = 0;
		new_flags[i] = 0;
	}

	delete table;
	delete values;
	delete flags;

	table = new_table;
	values = new_values;
	flags = new_flags;
	cap = new_cap;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x18(%rdi), %r13
leal (,%r13,2), %eax
movl %eax, 0x4(%rsp)
movslq %eax, %rbp
testl %ebp, %ebp
pushq $-0x1
popq %rax
movq %rbp, %r12
cmovsq %rax, %r12
leaq (,%rbp,4), %r15
testl %ebp, %ebp
cmovsq %rax, %r15
leaq (,%rbp,8), %rdi
testl %ebp, %ebp
cmovsq %rax, %rdi
callq 0x1030
movq %rax, %r14
movq %r15, %rdi
callq 0x1030
movq %rax, %r15
movq %r12, %rdi
callq 0x1030
movq %rax, %r12
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
xorl %edx, %edx
testl %r13d, %r13d
movl $0x0, %esi
cmovgl %r13d, %esi
cmpq %rdx, %rsi
je 0x263d
movq (%rdi,%rdx,8), %r8
movq %r8, (%r14,%rdx,8)
movl (%rax,%rdx,4), %r8d
movl %r8d, (%r15,%rdx,4)
movb (%rcx,%rdx), %r8b
movb %r8b, (%r12,%rdx)
incq %rdx
jmp 0x260e
andq $0x0, (%r14,%r13,8)
movb $0x0, (%r12,%r13)
incq %r13
cmpq %rbp, %r13
jl 0x2630
callq 0x10b0
movq 0x8(%rbx), %rdi
callq 0x10b0
movq 0x10(%rbx), %rdi
callq 0x10b0
movq %r14, (%rbx)
movq %r15, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movl 0x4(%rsp), %eax
movl %eax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/utils.h
// Function: int bin_search<int>(int*, int, int const&)
inline int bin_search(T* array, int n, const T& x) {
  int left = 0;
  int right = n;
  int current;
  while (left < right) {
    current = (left + right) / 2;
    if(array[current] == x) {
      return current;
    } else if (array[current] > x) {
      right = current;
    } else if (array[current] < x) {
      left = current + 1;
    }
  }
  return -(right + 1);
}

// Assembly:
movl (%rdx), %ecx
xorl %edx, %edx
cmpl %esi, %edx
jge 0x26a7
leal (%rsi,%rdx), %eax
shrl %eax
movl (%rdi,%rax,4), %r8d
cmpl %ecx, %r8d
je 0x26ab
leal 0x1(%rax), %r9d
cmpl %ecx, %r8d
cmovgel %edx, %r9d
cmovgl %edx, %r9d
cmovgl %eax, %esi
movl %r9d, %edx
jmp 0x267e
notl %esi
movl %esi, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/hash.h
// Function: hash<double>::expand()
void hash<T>::expand() {
  hash<T>& table = *this;
  int new_c = table.cap + 1;
  expand_array(table.keys, table.cap, new_c);
  expand_array(table.data, table.cap, new_c);
  table.cap = new_c;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %esi
leal 0x1(%rsi), %ebp
addq $0x10, %rdi
movl %ebp, %edx
callq 0x26d8
leaq 0x8(%rbx), %rdi
movl (%rbx), %esi
movl %ebp, %edx
callq 0x2725
movl %ebp, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/kmeans/../common/utils.h
// Function: void expand_array<int>(int*&, int, int)
inline void expand_array(T*& array, const int n, const int new_n) {
  T* new_array = new T[new_n];
  for (int i=0; i<n; i++) {
    new_array[i] = array[i];
  }
  delete array;
  array = new_array;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movl %edx, %eax
shlq $0x2, %rax
testl %edx, %edx
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x1030
movq %rax, %r15
movq (%rbx), %rdi
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
cmpq %rax, %r14
je 0x2717
movl (%rdi,%rax,4), %ecx
movl %ecx, (%r15,%rax,4)
incq %rax
jmp 0x2706
callq 0x10b0
movq %r15, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH17_SpecializedLibraryFacilities/examples/rand6.cc
// Function: bad_randVec()
vector<unsigned> bad_randVec()
{
	default_random_engine e;    
	uniform_int_distribution<unsigned> u(0,9);
	vector<unsigned> ret;
	for (size_t i = 0; i < 100; ++i)
    	ret.push_back(u(e));
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq -0x38(%rbp), %r14
movq $0x1, (%r14)
movabsq $0x900000000, %rax      # imm = 0x900000000
leaq -0x40(%rbp), %r15
movq %rax, (%r15)
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
pushq $0x64
popq %r13
leaq -0x2c(%rbp), %r12
subq $0x1, %r13
jb 0x12d0
movq %r15, %rdi
movq %r14, %rsi
callq 0x14f0
movl %eax, -0x2c(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1680
jmp 0x12af
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 0x153c
movq %r14, %rdi
callq 0x1110
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH17_SpecializedLibraryFacilities/examples/rand6.cc
// Function: good_randVec()
vector<unsigned> good_randVec()
{
	// because engines and distributions retain state, they usually should be
	// defined as static so that new numbers are generated on each call
	static default_random_engine e;    
	static uniform_int_distribution<unsigned> u(0,9);
	vector<unsigned> ret;
	for (size_t i = 0; i < 100; ++i)
    	ret.push_back(u(e));
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x2dbc(%rip), %al       # 0x40c8
testb %al, %al
je 0x1372
movb 0x2dc2(%rip), %al       # 0x40d8
testb %al, %al
je 0x139e
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
pushq $0x64
popq %r13
leaq 0x2d9c(%rip), %r14      # 0x40d0
leaq 0x2d85(%rip), %r15      # 0x40c0
leaq -0x2c(%rbp), %r12
subq $0x1, %r13
jb 0x1360
movq %r14, %rdi
movq %r15, %rsi
callq 0x14f0
movl %eax, -0x2c(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1680
jmp 0x133f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2d4f(%rip), %rdi      # 0x40c8
callq 0x1120
testl %eax, %eax
je 0x1310
movq $0x1, 0x2d33(%rip) # 0x40c0
leaq 0x2d34(%rip), %rdi      # 0x40c8
callq 0x1090
jmp 0x1310
leaq 0x2d33(%rip), %rdi      # 0x40d8
callq 0x1120
testl %eax, %eax
je 0x131e
movabsq $0x900000000, %rax      # imm = 0x900000000
movq %rax, 0x2d0d(%rip)      # 0x40d0
leaq 0x2d0e(%rip), %rdi      # 0x40d8
callq 0x1090
jmp 0x131e
movq %rax, %r14
movq %rbx, %rdi
callq 0x153c
movq %r14, %rdi
callq 0x1110
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH17_SpecializedLibraryFacilities/examples/rand6.cc
// Function: main
int main()
{
	vector<unsigned> v1(bad_randVec());
	vector<unsigned> v2(bad_randVec());

	// will print equal
	cout << ((v1 == v2) ? "equal" : "not equal") << endl;

	// very unlikely to print equal
	if (good_randVec() == good_randVec())
		cout << "equal!" << endl;
	else
		cout << "not equal" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
leaq -0x70(%rbp), %rdi
callq 0x126c
leaq -0x58(%rbp), %rdi
callq 0x126c
leaq -0x70(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x14fd
leaq 0xbf0(%rip), %rsi       # 0x2008
leaq 0xbe5(%rip), %rbx       # 0x2004
testb %al, %al
cmoveq %rbx, %rsi
movq 0x2bac(%rip), %rdi      # 0x3fd8
callq 0x10c0
movq %rax, %rdi
callq 0x1070
leaq -0x40(%rbp), %rdi
callq 0x12f5
leaq -0x28(%rbp), %rdi
callq 0x12f5
leaq -0x40(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x14fd
movl %eax, %r14d
leaq -0x28(%rbp), %rdi
callq 0x153c
leaq -0x40(%rbp), %rdi
callq 0x153c
leaq 0xb9a(%rip), %rax       # 0x200e
testb %r14b, %r14b
cmovneq %rax, %rbx
movq 0x2b56(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1070
leaq -0x58(%rbp), %rdi
callq 0x153c
leaq -0x70(%rbp), %rdi
callq 0x153c
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x153c
jmp 0x14c0
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x153c
jmp 0x14d5
jmp 0x14d2
movq %rax, %rbx
jmp 0x14de
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x153c
leaq -0x70(%rbp), %rdi
callq 0x153c
movq %rbx, %rdi
callq 0x1110
nop
// File: /workspace/github_cpp_makefile_star2_O2/SoftwearDevelopment[P]xattr_syscall_wrapper/getxattr.cc
// Function: main
int main(int argc, char** argv) {
  if (argc != 3) {
    std::cerr << "USAGE: getxattr [FILE] [XATTR] > data" << std::endl;
    return 1;
  }

  auto &file = argv[1], &attr = argv[2];
  std::vector<char> payload;

  // load the data

  size_t alloc = 1024*4; // One page
  while (true) {
    payload.resize(alloc);
    ssize_t len = getxattr(file, attr, payload.data(), payload.size());
    alloc *=2;

    if (len >= 0) { // success
      payload.resize(len);
      break;

    } else if (errno != ERANGE) { // unknown error
      fatal_errno(file, "getxattr");

    } else if (alloc > max_buf_size) { // to large
      std::cerr << "getxattr error: Xattr larger than " << max_buf_size << " bytes. "
                << "Refusing to allocate more.";
      return 1;
    }
  }

  // return the data

  std::cout.write(payload.data(), payload.size());
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
cmpl $0x3, %edi
jne 0x13bf
movq %rsi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
andq $0x0, 0x10(%r14)
movaps %xmm0, (%r14)
movl $0x1000, %r15d          # imm = 0x1000
leaq 0x48(%rsp), %r12
leaq 0x28(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x149e
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
subq %rdx, %rcx
callq 0x1040
testq %rax, %rax
jns 0x13df
addq %r15, %r15
callq 0x1030
cmpl $0x22, (%rax)
jne 0x1370
cmpq $0x6400001, %r15        # imm = 0x6400001
jb 0x1327
jmp 0x1409
movq %rax, %rbp
movq 0x8(%rbx), %rsi
movq %r12, %rdi
leaq 0xf(%rsp), %rdx
callq 0x1536
movq %r13, %rdi
leaq 0xc9c(%rip), %rsi       # 0x202a
leaq 0xe(%rsp), %rdx
callq 0x1536
movslq (%rbp), %rdx
movq %r12, %rdi
movq %r13, %rsi
pushq $0x1
popq %rcx
callq 0x14ca
movq %r13, %rdi
callq 0x10a0
movq %r12, %rdi
callq 0x10a0
jmp 0x1327
movq 0x2c2a(%rip), %rdi      # 0x3ff0
leaq 0xc37(%rip), %rsi       # 0x2004
callq 0x1130
movq %rax, %rdi
callq 0x10b0
pushq $0x1
popq %rbx
jmp 0x1454
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x149e
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
subq %rsi, %rdx
xorl %ebx, %ebx
movq 0x2bce(%rip), %rdi      # 0x3fd0
callq 0x1170
jmp 0x144a
movq 0x2be0(%rip), %rdi      # 0x3ff0
leaq 0xc1c(%rip), %rsi       # 0x2033
callq 0x1130
movl $0x6400000, %esi        # imm = 0x6400000
movq %rax, %rdi
callq 0x10e0
leaq 0xc26(%rip), %rsi       # 0x2056
movq %rax, %rdi
callq 0x1130
leaq 0xc20(%rip), %rsi       # 0x205f
movq %rax, %rdi
callq 0x1130
pushq $0x1
popq %rbx
leaq 0x10(%rsp), %rdi
callq 0x157c
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1489
jmp 0x1489
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x10a0
jmp 0x147b
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x10a0
jmp 0x148c
jmp 0x1489
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x157c
movq %rbx, %rdi
callq 0x11a0
// File: /workspace/github_cpp_makefile_star2_O2/Juan313[P]RockPaperScissor/RPS.cpp
// Function: Rock::fight(Tool*)
int Rock::fight(Tool *comp)
{
	int result;
	//Checks the type used by the computer, adjusts strength
	//accordingly and then stores the difference between
	//player and computer strenght in result.
	if(comp->getType()=='p')
	{
		result = this->getStrength() - 2*comp->getStrength();
	}
	else if(comp->getType()=='s')
	{
                result = 2*this->getStrength() - comp->getStrength();
        }
	else
	{
		result = this->getStrength() - comp->getStrength();
	}
	
	//Checks the value stored in result and changes its value to 
	//1,2,or 3 if the player won, lost, or tied respectivey
	if(result<0)
	result = 2;
	else if(result>0)
	result = 1;
	else
	result = 3;

	return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2964
cmpb $0x70, %al
jne 0x24ac
movq %rbx, %rdi
callq 0x2960
movl %eax, %ebx
movq %r14, %rdi
callq 0x2960
addl %eax, %eax
jmp 0x24d0
movq %r14, %rdi
callq 0x2964
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2960
movl %eax, %ebx
cmpb $0x73, %bpl
jne 0x24c8
addl %ebx, %ebx
movq %r14, %rdi
callq 0x2960
subl %eax, %ebx
xorl %eax, %eax
testl %ebx, %ebx
sete %al
leal 0x1(%rax,%rax), %ecx
pushq $0x2
popq %rax
cmovnsl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Juan313[P]RockPaperScissor/RPS.cpp
// Function: Paper::fight(Tool*)
int Paper::fight(Tool *comp)
{
    int result;
    //Checks the type used by the computer, adjusts strength
    //accordingly and then stores the difference between
    //player and computer strenght in result.
    if(comp->getType()=='s')
    {
        result = this->getStrength() - 2*comp->getStrength();
    }
    else if(comp->getType()=='r')
    {
        result = 2*this->getStrength() - comp->getStrength();
    }
    else
    {
        result = this->getStrength() - comp->getStrength();
    }
    
    //Checks the value stored in result and changes its value to
    //1,2,or 3 if the player won, lost, or tied respectivey
    if(result<0)
        result = 2;
    else if(result>0)
        result = 1;
    else
        result = 3;
    
    return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2964
cmpb $0x73, %al
jne 0x2548
movq %rbx, %rdi
callq 0x2960
movl %eax, %ebx
movq %r14, %rdi
callq 0x2960
addl %eax, %eax
jmp 0x256c
movq %r14, %rdi
callq 0x2964
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2960
movl %eax, %ebx
cmpb $0x72, %bpl
jne 0x2564
addl %ebx, %ebx
movq %r14, %rdi
callq 0x2960
subl %eax, %ebx
xorl %eax, %eax
testl %ebx, %ebx
sete %al
leal 0x1(%rax,%rax), %ecx
pushq $0x2
popq %rax
cmovnsl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Juan313[P]RockPaperScissor/RPSGame.cpp
// Function: RPSGame::RPSGame(int, int, int, int, int, int)
RPSGame::RPSGame (int hr, int hp, int hs, int cr, int cp, int cs) {
    human_rock = new Rock(hr);
    human_paper = new Paper(hp);
    human_scissors = new Scissors(hs);
    computer_rock = new Rock(cr);
    computer_paper = new Paper(cp);
    computer_scissors = new Scissors(cs);
    computer_wins = 0;
    human_wins = 0;
    ties = 0;
    last_winner = 0;    // lets AI know its first round
    unsigned seed = time(0);    // seed srand
    srand(seed);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movl %r8d, %r12d
movl %ecx, %r13d
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
movl 0x40(%rsp), %eax
movl %eax, (%rsp)
pushq $0x10
popq %rdi
callq 0x2160
movq %rax, %rbx
movq %rax, %rdi
movl %r15d, %esi
callq 0x2468
movq %rbx, (%r14)
pushq $0x10
popq %rdi
callq 0x2160
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
callq 0x2504
movq %rbx, 0x8(%r14)
pushq $0x10
popq %rdi
callq 0x2160
movq %rax, %rbx
movq %rax, %rdi
movl %r13d, %esi
callq 0x25a0
movq %rbx, 0x10(%r14)
pushq $0x10
popq %rdi
callq 0x2160
movq %rax, %rbx
movq %rax, %rdi
movl %r12d, %esi
callq 0x2468
movq %rbx, 0x18(%r14)
pushq $0x10
popq %rdi
callq 0x2160
movq %rax, %rbx
movq %rax, %rdi
movl 0x4(%rsp), %esi
callq 0x2504
movq %rbx, 0x20(%r14)
pushq $0x10
popq %rdi
callq 0x2160
movq %rax, %rbx
movq %rax, %rdi
movl (%rsp), %esi
callq 0x25a0
movq %rbx, 0x28(%r14)
andq $0x0, 0x30(%r14)
andl $0x0, 0x38(%r14)
andl $0x0, 0x40(%r14)
xorl %edi, %edi
callq 0x2130
movl %eax, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2140
jmp 0x27bb
jmp 0x27bb
jmp 0x27bb
jmp 0x27bb
jmp 0x27bb
movq %rax, %r14
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x2170
movq %r14, %rdi
callq 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O2/Juan313[P]RockPaperScissor/RPSGame.cpp
// Function: RPSGame::~RPSGame()
RPSGame::~RPSGame() {
  delete human_rock;
  delete human_paper;
  delete human_scissors;
  delete computer_rock;
  delete computer_paper;
  delete computer_scissors;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x27e4
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x27f3
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x2802
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2811
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x2820
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x2830
movq (%rdi), %rax
popq %rbx
jmpq *0x8(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Juan313[P]RockPaperScissor/RPSGame.cpp
// Function: RPSGame::play(char, char)
int RPSGame::play (char humanChoice, char computerChoice) {
    int result;
    Tool* human;
    Tool* computer;
    
    // Set human choice
    if (humanChoice == 'r') {
        human = human_rock; 
    } else if (humanChoice == 'p') {
        human = human_paper; 
    } else {
        human = human_scissors; 
    }

    // Set computer choice
    if (computerChoice == 'r') {
        computer = computer_rock; 
    } else if (computerChoice == 'p') {
        computer = computer_paper;
    } else {
        computer = computer_scissors;
    }
    
    // Fight
    result = human->fight(computer);
    // Set results
    set_winner(result);
    set_human_last_tool(humanChoice); 
    set_comp_last_tool(computerChoice);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq %rdi, %rax
cmpl $0x72, %esi
je 0x2857
cmpl $0x70, %ebp
jne 0x2853
leaq 0x8(%r14), %rax
jmp 0x2857
leaq 0x10(%r14), %rax
movq (%rax), %rdi
xorl %eax, %eax
cmpb $0x70, %bl
setne %al
leaq 0x20(,%rax,8), %rax
cmpb $0x72, %bl
pushq $0x18
popq %rcx
cmovneq %rax, %rcx
movq (%r14,%rcx), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
movl %eax, %r15d
movq %r14, %rdi
movl %eax, %esi
callq 0x28a2
movb %bpl, 0x3c(%r14)
movb %bl, 0x3d(%r14)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Juan313[P]RockPaperScissor/RPSGame.cpp
// Function: RPSGame::set_winner(int)
void RPSGame::set_winner (int winner) {
    if (winner == 1) {
        set_human_wins(get_human_wins() + 1);
        set_last_winner(1);
    } else if (winner == 2) {
        set_computer_wins(get_computer_wins() + 1);
        set_last_winner(2);
    } else {
        set_ties(get_ties() + 1);
        set_last_winner(3);         // sets tie
    }
}

// Assembly:
cmpl $0x2, %esi
je 0x28b3
cmpl $0x1, %esi
jne 0x28ba
incl 0x30(%rdi)
pushq $0x1
jmp 0x28bf
incl 0x34(%rdi)
pushq $0x2
jmp 0x28bf
incl 0x38(%rdi)
pushq $0x3
popq %rax
movl %eax, 0x40(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Juan313[P]RockPaperScissor/input.cpp
// Function: readInt()
int readInt()
{
  int num;
  std::cin>>num;
  while (!(std::cin))
  {
    std::cout<<"The number provided is not an integer. Please enter again."<<std::endl;
    std::cin.clear();
    std::cin.ignore(256,'\n');
    std::cin>>num;
  }
  std::cin.ignore(256,'\n');
  return num;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x4665(%rip), %rbx      # 0x6fe0
leaq 0xc(%rsp), %r14
movq 0x4649(%rip), %r15      # 0x6fd0
leaq 0x16b7(%rip), %r12      # 0x4045
pushq $0xa
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20b0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
je 0x29df
movq %r15, %rdi
movq %r12, %rsi
callq 0x2150
movq %rax, %rdi
callq 0x2090
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %esi, %esi
callq 0x2210
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
movl %ebp, %edx
callq 0x20c0
jmp 0x2991
movq 0x45fa(%rip), %rdi      # 0x6fe0
pushq $0xa
popq %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x20c0
movl 0xc(%rsp), %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq