LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Card.cpp
// Function: Card::Card(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Card::Card(std::string c, std::string p) {
	content = c;
	type = 'w';
	numOfAnswers = 0;
	owner = p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
xorl %eax, %eax
movb %al, 0x10(%rdi)
leaq 0x28(%rdi), %r14
leaq 0x38(%rdi), %rcx
movq %rcx, 0x28(%rdi)
andq $0x0, 0x30(%rdi)
movb %al, 0x38(%rdi)
callq 0x20e0
movb $0x77, 0x20(%rbx)
andl $0x0, 0x24(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x20e0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %r14, %rdi
callq 0x22e8
movq %rbx, %rdi
callq 0x22e8
movq %r15, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Player.cpp
// Function: Player::takeCard(int)
Card Player::takeCard(int index) {
	if (index > hand.size() || index < 0) {
		return Card();
	}
	Card temp = hand[index];
	hand = deleteCard(hand, index);
	return temp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rsi), %rsi
movq 0x30(%r14), %rax
subq %rsi, %rax
pushq $0x48
popq %rcx
cqto
idivq %rcx
testl %r15d, %r15d
js 0x2a1b
movslq %r15d, %rcx
cmpq %rcx, %rax
jb 0x2a1b
addq $0x28, %r14
imulq $0x48, %rcx, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x2caa
leaq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x2cec
leaq -0x48(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl %r15d, %edx
callq 0x2a52
leaq -0x48(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x30be
movq %r15, %rdi
callq 0x2c42
leaq -0x30(%rbp), %rdi
callq 0x2c42
jmp 0x2a23
movq %rbx, %rdi
callq 0x25dc
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x30(%rbp), %rdi
callq 0x2c42
jmp 0x2a42
movq %rax, %r14
movq %rbx, %rdi
callq 0x2d46
movq %r14, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Player.cpp
// Function: deleteCard(std::vector<Card, std::allocator<Card>>, int)
std::vector<Card> deleteCard(std::vector<Card> cards, int index) {
	std::vector<Card> temp;
	for (int i = 0; i < (int)cards.size(); i++) {
		if (i != index) {
			temp.push_back(cards[i]);
		}
	}
	return temp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x30(%rbp)
andq $0x0, 0x10(%rdi)
movl %edx, %eax
imulq $0x48, %rax, %r15
xorl %r12d, %r12d
pushq $0x48
popq %r13
xorl %ebx, %ebx
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
cqto
idivq %r13
cltq
cmpq %rax, %rbx
jge 0x2ab1
cmpq %r12, %r15
je 0x2aa8
addq %r12, %rsi
movq -0x30(%rbp), %rdi
callq 0x2c6e
incq %rbx
addq $0x48, %r12
jmp 0x2a81
movq -0x30(%rbp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x30(%rbp), %rdi
callq 0x2c42
movq %r14, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Player.cpp
// Function: Player::takeCard(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Card Player::takeCard(std::string content) {
	for (int i = 0; i < hand.size(); i++) {
		if (hand[i].content.compare(content) == 0) {
			return hand[i];
		}
	}
	return Card();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
pushq $-0x48
popq %r15
pushq $-0x1
popq %r13
pushq $0x48
popq %rbx
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rax
subq %rcx, %rax
cqto
idivq %rbx
incq %r13
cmpq %r13, %rax
jbe 0x2b40
leaq (%rcx,%r15), %rdi
addq $0x48, %rdi
addq $0x48, %r15
movq %r12, %rsi
callq 0x2030
testl %eax, %eax
jne 0x2afb
addq 0x28(%r14), %r15
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2caa
jmp 0x2b4c
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x25dc
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Player.cpp
// Function: Player::isEqual(Player)
bool Player::isEqual(Player p) {
	if(strcmp(name.c_str(), p.getName().c_str()) == 0) {
		return true;
	}
	else {
		return false;
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq (%rdi), %rbx
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x21f0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x2200
testl %eax, %eax
sete %bl
movq %r14, %rdi
callq 0x22e8
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Player.cpp
// Function: Player::isEqual(Player, Player)
bool Player::isEqual(Player p, Player q) {
	if(strcmp(p.getName().c_str(), q.getName().c_str()) == 0) {
		return true;
	}
	else {
		return false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x21f0
movq (%rbx), %rbx
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x21f0
leaq -0x50(%rbp), %r14
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x2200
testl %eax, %eax
sete %bl
movq %r14, %rdi
callq 0x22e8
leaq -0x30(%rbp), %rdi
callq 0x22e8
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x22e8
movq %rbx, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Client.cpp
// Function: printAnswers(std::vector<Card, std::allocator<Card>>, int)
void printAnswers(vector<Card> answers, int numOfAnswers) {
	int count = 1;
	for (int i = 0; i < answers.size()/numOfAnswers; i++) {
		for (int j = 0; j < numOfAnswers; j++) {
			printf("%d %s\n", count, answers[i].content.c_str());
		}
		count++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq %esi, %rax
testl %eax, %eax
movl $0x0, %ecx
movq %rax, -0x38(%rbp)
cmovgl %eax, %ecx
movl %ecx, -0x2c(%rbp)
pushq $0x1
popq %r14
leaq 0x1dec(%rip), %r15      # 0x61ef
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cqto
pushq $0x48
popq %rcx
idivq %rcx
xorl %edx, %edx
divq -0x38(%rbp)
movl -0x2c(%rbp), %r13d
cmpq %r12, %rax
ja 0x443e
jmp 0x444c
movq (%rbx), %rax
imulq $0x48, %r12, %rcx
movq (%rax,%rcx), %rdx
movq %r15, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x2040
subl $0x1, %r13d
jae 0x4426
incl %r14d
incq %r12
jmp 0x4406
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Client.cpp
// Function: composeNOTIFYMessage(char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string composeNOTIFYMessage(char purpose, string playerName) {
	if(purpose == 'j') {
		return "NOTIFY " + self.getName() + "\nCP: " + playerName;
	}
	else if(purpose == 'w') {
		return "NOTIFY " + self.getName() + "\nwinner: " + playerName;
	}
	else if(purpose == 'q') {
		return "NOTIFY " + self.getName() + "\nquit: " + playerName;
	}
	else {
		return "";
	}
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rdi, %rbx
cmpl $0x77, %esi
je 0x451e
cmpl $0x71, %esi
je 0x44d3
cmpl $0x6a, %esi
jne 0x4584
leaq 0x4f24(%rip), %rsi      # 0x93b0
leaq -0x78(%rbp), %r15
movq %r15, %rdi
callq 0x292e
leaq 0x1ddf(%rip), %rsi      # 0x627e
leaq -0x58(%rbp), %rdi
movq %r15, %rdx
callq 0x5407
leaq 0x1dd4(%rip), %rdx      # 0x6286
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x53de
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x53b5
jmp 0x4567
leaq 0x4ed6(%rip), %rsi      # 0x93b0
leaq -0x78(%rbp), %r15
movq %r15, %rdi
callq 0x292e
leaq 0x1d91(%rip), %rsi      # 0x627e
leaq -0x58(%rbp), %rdi
movq %r15, %rdx
callq 0x5407
leaq 0x1d96(%rip), %rdx      # 0x6296
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x53de
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x53b5
jmp 0x4567
leaq 0x4e8b(%rip), %rsi      # 0x93b0
leaq -0x78(%rbp), %r15
movq %r15, %rdi
callq 0x292e
leaq 0x1d46(%rip), %rsi      # 0x627e
leaq -0x58(%rbp), %rdi
movq %r15, %rdx
callq 0x5407
leaq 0x1d41(%rip), %rdx      # 0x628c
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x53de
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x53b5
leaq -0x38(%rbp), %rdi
callq 0x22e8
leaq -0x58(%rbp), %rdi
callq 0x22e8
leaq -0x78(%rbp), %rdi
callq 0x22e8
jmp 0x4597
leaq 0x1c94(%rip), %rsi      # 0x621f
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
callq 0x52fa
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x45a9
jmp 0x45a9
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x22e8
jmp 0x45be
jmp 0x45bb
jmp 0x45bb
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x22e8
jmp 0x45d0
jmp 0x45cd
jmp 0x45cd
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x22e8
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Client.cpp
// Function: substitute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, char)
string substitute(string target, string replacement[], char subChar) {
	string newString = target;
	int s = 0;
	for (int i = 0; i < newString.length(); i++) {
		if (newString[i] == subChar) {
			newString = newString.substr(0, i) + replacement[s] + newString.substr(i+1);
			s++;
		}
	}
	return newString;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, %r14d
movq %rdx, -0x40(%rbp)
movq %rdi, %r13
callq 0x21f0
xorl %r12d, %r12d
leaq -0x60(%rbp), %r15
leaq -0xc0(%rbp), %rbx
movl $0x0, -0x2c(%rbp)
movq (%r13), %rax
movq 0x8(%r13), %rcx
cmpq %r12, %rcx
jbe 0x46ce
cmpb %r14b, (%rax,%r12)
je 0x4635
incq %r12
jmp 0x4621
movq %r15, %rdi
movq %r13, -0x38(%rbp)
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x2190
movl -0x2c(%rbp), %edx
shlq $0x5, %rdx
addq -0x40(%rbp), %rdx
leaq -0x80(%rbp), %rdi
movq %r15, %rsi
callq 0x53b5
incq %r12
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rdx
pushq $-0x1
popq %rcx
callq 0x2190
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5435
movq -0x38(%rbp), %r13
movq %r13, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x21b0
leaq -0xa0(%rbp), %rdi
callq 0x22e8
movq %rbx, %rdi
callq 0x22e8
movq %r15, %rdi
callq 0x22e8
leaq -0x60(%rbp), %r15
movq %r15, %rdi
callq 0x22e8
incl -0x2c(%rbp)
jmp 0x4619
movq %r13, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0xc0(%rbp), %rdi
callq 0x22e8
jmp 0x46f7
movq %rax, %r14
leaq -0x80(%rbp), %rdi
callq 0x22e8
jmp 0x4705
movq %rax, %r14
leaq -0x60(%rbp), %rdi
callq 0x22e8
jmp 0x4713
movq %rax, %r14
movq -0x38(%rbp), %rdi
callq 0x22e8
movq %r14, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Client.cpp
// Function: composeSENDMessage[abi:cxx11](char, Card)
string composeSENDMessage(char type, Card cardToSend) {
	char* t;
	if(type == 'n') {
		return "ANSWER " + self.getName() + "\n" + cardToSend.content;
	}
	else if(type == 'd') {
		return "ADD " + self.getName() + "\n" + cardToSend.content;
	}
	else {
		return "";
	}
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rdi, %rbx
cmpl $0x64, %esi
je 0x4f69
cmpl $0x6e, %esi
jne 0x4fcf
leaq 0x448b(%rip), %rsi      # 0x93b0
leaq -0x78(%rbp), %r15
movq %r15, %rdi
callq 0x292e
leaq 0x1330(%rip), %rsi      # 0x6268
leaq -0x58(%rbp), %rdi
movq %r15, %rdx
callq 0x5407
leaq 0x12d3(%rip), %rdx      # 0x621e
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x53de
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x53b5
jmp 0x4fb2
leaq 0x4440(%rip), %rsi      # 0x93b0
leaq -0x78(%rbp), %r15
movq %r15, %rdi
callq 0x292e
leaq 0x12ed(%rip), %rsi      # 0x6270
leaq -0x58(%rbp), %rdi
movq %r15, %rdx
callq 0x5407
leaq 0x1288(%rip), %rdx      # 0x621e
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x53de
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x53b5
leaq -0x38(%rbp), %rdi
callq 0x22e8
leaq -0x58(%rbp), %rdi
callq 0x22e8
leaq -0x78(%rbp), %rdi
callq 0x22e8
jmp 0x4fe2
leaq 0x1249(%rip), %rsi      # 0x621f
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
callq 0x52fa
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4ff2
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x22e8
jmp 0x5005
jmp 0x5002
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x22e8
jmp 0x5015
jmp 0x5012
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x22e8
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Client.cpp
// Function: splitString(char**, char*, char const*)
void splitString(char* parts[], char* target, const char* delim) {
	char* tok;
	tok = std::strtok(target, delim);
	int i = 0;
	while(tok != NULL) {
		parts[i] = tok;
		tok = strtok(NULL, delim);
		i++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x2250
testq %rax, %rax
je 0x5056
movq %rax, (%r14)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2250
addq $0x8, %r14
jmp 0x503e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Client.cpp
// Function: countChars(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char)
int countChars(string l, char s) {
	int elements = 0;
	for (int i = 0; i < l.length(); i++) {
		if (l[i] == s) {
			elements++;
		}
	}
	if (s == '_' && elements == 0) {
		return 1;
	}
	return elements;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
xorl %edx, %edx
xorl %ecx, %ecx
cmpq %rdx, %rax
je 0x5082
movq (%rdi), %r8
xorl %r9d, %r9d
cmpb %sil, (%r8,%rdx)
sete %r9b
addl %r9d, %ecx
incq %rdx
jmp 0x5067
testl %ecx, %ecx
movl $0x1, %eax
cmovnel %ecx, %eax
cmpb $0x5f, %sil
cmovnel %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Client.cpp
// Function: parseNotify(char**)
int parseNotify(char* notifyMessage[]) {
	if(strcmp((const char*)notifyMessage[0], "CP:") == 0) {
		setJudge(strcmp(self.getName().c_str(), (const char*)notifyMessage[1]) == 0, string(notifyMessage[1]));
	}
	else if(strcmp((const char*)notifyMessage[0], "winner:") == 0) {
		if(strcmp(self.getName().c_str(), (const char*)notifyMessage[1]) == 0) {
			printf("You have won this round!\n");
			self.addPoint();
		}
	}
	else if(strcmp((const char*)notifyMessage[0], "players:") == 0) {
		printf("Receiving %d answers from %s.\n", atoi(notifyMessage[1]), notifyMessage[1]);
		if (atoi(notifyMessage[1]) == 0) {
			printf("No more players.\nQuitting now.\n");
			exit(EXIT_FAILURE);
		}
		return atoi(notifyMessage[1]);
	}
	else if(strcmp((const char*)notifyMessage[0], "quit:") == 0) {
		exit(EXIT_FAILURE);
	}
	else {
		return -1;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq (%rdi), %r14
leaq 0x117f(%rip), %rsi      # 0x622e
movq %r14, %rdi
callq 0x2200
testl %eax, %eax
je 0x5104
leaq 0x1170(%rip), %rsi      # 0x6232
movq %r14, %rdi
callq 0x2200
testl %eax, %eax
je 0x516b
leaq 0x1161(%rip), %rsi      # 0x623a
movq %r14, %rdi
callq 0x2200
testl %eax, %eax
je 0x51b7
leaq 0x1172(%rip), %rsi      # 0x6262
movq %r14, %rdi
callq 0x2200
testl %eax, %eax
je 0x51f5
pushq $-0x1
jmp 0x515d
leaq 0x42a5(%rip), %rsi      # 0x93b0
leaq -0x60(%rbp), %r14
movq %r14, %rdi
callq 0x292e
movq (%r14), %rdi
movq 0x8(%rbx), %r14
movq %r14, %rsi
callq 0x2200
movl %eax, %ebx
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
movq %r14, %rsi
callq 0x52fa
xorl %edi, %edi
testl %ebx, %ebx
sete %dil
leaq -0x40(%rbp), %rsi
callq 0x521f
leaq -0x40(%rbp), %rdi
callq 0x22e8
leaq -0x60(%rbp), %rdi
callq 0x22e8
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x423e(%rip), %rsi      # 0x93b0
leaq -0x60(%rbp), %r14
movq %r14, %rdi
callq 0x292e
movq (%r14), %rdi
movq 0x8(%rbx), %rsi
callq 0x2200
movl %eax, %r15d
movq %r14, %rdi
callq 0x22e8
pushq $0x1
popq %rbx
testl %r15d, %r15d
jne 0x515e
leaq 0x1650(%rip), %rdi      # 0x67f4
callq 0x2230
leaq 0x4200(%rip), %rdi      # 0x93b0
callq 0x296e
jmp 0x515e
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x2240
leaq 0x1079(%rip), %rdi      # 0x6243
movl %eax, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2040
movq 0x8(%rbx), %rdi
callq 0x2240
movl %eax, %ebx
testl %eax, %eax
jne 0x515e
leaq 0x15e5(%rip), %rdi      # 0x67d5
callq 0x2230
pushq $0x1
popq %rdi
callq 0x21a0
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x22e8
jmp 0x520e
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x22e8
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/muzuka[P]Cards-Against-Humanity-Online/Client.cpp
// Function: setJudge(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void setJudge(bool j, string name) {
	if (j) {
		isJudge = true;
		judge = self;
		answers.clear();
		printf("You are the new judge!\n");
	}
	else {
		isJudge = false;
		judge.setName(name);
		answers.clear();
		printf("The new judge is %s.\n", name.c_str());
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
testl %edi, %edi
je 0x5268
movb $0x1, 0x3f6f(%rip)      # 0x91a4
leaq 0x41cc(%rip), %rdi      # 0x9408
leaq 0x416d(%rip), %rsi      # 0x93b0
callq 0x5368
leaq 0x4231(%rip), %rdi      # 0x9480
callq 0x53a8
leaq 0x15b2(%rip), %rdi      # 0x680d
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2230
movq %rsi, %rbx
movb $0x0, 0x3f32(%rip)      # 0x91a4
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x21f0
leaq 0x4183(%rip), %rdi      # 0x9408
movq %r14, %rsi
callq 0x2946
leaq -0x30(%rbp), %rdi
callq 0x22e8
leaq 0x41e3(%rip), %rdi      # 0x9480
callq 0x53a8
movq (%rbx), %rsi
leaq 0xdb8(%rip), %rdi       # 0x6064
xorl %eax, %eax
callq 0x2040
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x22e8
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/block.cc
// Function: Block::Resize(unsigned int, bool)
ERROR_T Block::Resize(const SIZE_T newlen, const bool copy)
{
  BYTE_T *d;
  
  try {
    d = new BYTE_T [newlen];
  }
  catch (...) {
    return ERROR_NOMEM;
  }

  if (copy) { 
    memcpy(d,data,MIN(newlen,length));
  }
  
  if (data) { delete [] data; }
  data = d;

  length=newlen;

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %edi
callq 0x2030
movq %rax, %r15
movq 0x8(%r14), %r12
testb %bpl, %bpl
je 0x2b4e
movl 0x10(%r14), %edx
cmpl %ebx, %edx
cmovael %ebx, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2160
testq %r12, %r12
je 0x2b5b
movq %r12, %rdi
callq 0x2280
movq %r15, 0x8(%r14)
movl %ebx, 0x10(%r14)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x2080
callq 0x2340
pushq $-0x2
popq %rax
jmp 0x2b65
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/block.cc
// Function: Block::~Block()
Block::~Block() 
{ 
  if (data) { delete [] data; data=0; }
  length=0;
  lastaccessed=-1;
  dirty=false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xa06f(%rip), %rax      # 0xcce8
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x2c8f
callq 0x2280
andq $0x0, 0x8(%rbx)
andl $0x0, 0x10(%rbx)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x18(%rbx)
movb $0x0, 0x20(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/block.cc
// Function: Block::Print(std::ostream&) const
ostream & Block::Print(ostream &os) const
{
  os << "Block(length="<<length<<", data=0x";
  for (SIZE_T i=0;i<length;i++) { 
    os << high2hex(data[i]) << low2hex(data[i]);
  }
  os << ", lastaccessed="<<lastaccessed<<", dirty="<<dirty<<")";
  return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x54b1(%rip), %rsi      # 0x81db
movq %rbx, %rdi
callq 0x21b0
movl 0x10(%r14), %esi
movq %rax, %rdi
callq 0x2120
leaq 0x54a4(%rip), %rsi      # 0x81e9
movq %rax, %rdi
callq 0x21b0
xorl %r15d, %r15d
movl $0xff, %ebp
movl 0x10(%r14), %eax
cmpq %rax, %r15
jae 0x2db3
movq 0x8(%r14), %rax
movb (%rax,%r15), %al
movl %eax, %ecx
shrb $0x4, %cl
leal 0x30(%rcx), %edx
addb $0x57, %cl
cmpb $-0x60, %al
movzbl %dl, %eax
movzbl %cl, %esi
cmovbl %eax, %esi
andl %ebp, %esi
movq %rbx, %rdi
callq 0x2240
movq 0x8(%r14), %rcx
movb (%rcx,%r15), %cl
andb $0xf, %cl
leal 0x30(%rcx), %edx
leal 0x57(%rcx), %esi
cmpb $0xa, %cl
movzbl %dl, %ecx
movzbl %sil, %esi
cmovbl %ecx, %esi
andl %ebp, %esi
movq %rax, %rdi
callq 0x2240
incq %r15
jmp 0x2d55
leaq 0x5439(%rip), %rsi      # 0x81f3
movq %rbx, %rdi
callq 0x21b0
movsd 0x18(%r14), %xmm0
movq %rax, %rdi
callq 0x2320
leaq 0x542c(%rip), %rsi      # 0x8203
movq %rax, %rdi
callq 0x21b0
movzbl 0x20(%r14), %esi
movq %rax, %rdi
callq 0x2350
leaq 0x5972(%rip), %rsi      # 0x8765
movq %rax, %rdi
callq 0x21b0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::DiskSystem(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, double, double, double)
DiskSystem::DiskSystem(const string &filestem,
		       const bool   create,
		       const SIZE_T offset,
		       const SIZE_T blcks,
		       const SIZE_T blcksize,
		       const SIZE_T heads,
		       const SIZE_T blckspertrack,
		       const SIZE_T tracks,
		       const double avgseek,
		       const double trackseek,
		       const double rotlat) :
  bitmap(0),
  datafilefd(0),
  configfilefd(0),
  bitmapfilefd(0),
  diskfilestem(filestem), 
  offset(offset),
  numblocks(blcks),
  blocksize(blcksize),
  numheads(heads),
  blockspertrack(blckspertrack),
  numtracks(tracks),
  last_track(0),
  last_sector(0),
  averageseeklatency(avgseek),
  trackseeklatency(trackseek),
  rotationallatency(rotlat)
{
  if (create) { 
    // Only in this case are the parameters used:
    InitFromInMemoryConfig();
  } else {
    InitFromConfigFile();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm2, 0x10(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
movl %r9d, %ebp
movl %r8d, %r15d
movl %ecx, %r12d
movl %edx, %r13d
movq %rdi, %r14
leaq 0x9ee7(%rip), %rax      # 0xcd28
movq %rax, (%rdi)
leaq 0x28(%rdi), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movq %rbx, %rdi
callq 0x2290
movl %r12d, 0x48(%r14)
movl %r15d, 0x4c(%r14)
movl %ebp, 0x50(%r14)
movl 0x50(%rsp), %eax
movl %eax, 0x54(%r14)
movl 0x58(%rsp), %eax
movl %eax, 0x58(%r14)
movl 0x60(%rsp), %eax
movl %eax, 0x5c(%r14)
andq $0x0, 0x60(%r14)
movsd (%rsp), %xmm0
movsd %xmm0, 0x68(%r14)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x70(%r14)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x78(%r14)
testl %r13d, %r13d
je 0x2eb6
movq %r14, %rdi
callq 0x2ee0
jmp 0x2ebe
movq %r14, %rdi
callq 0x30dc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::InitFromConfigFile()
ERROR_T DiskSystem::InitFromConfigFile()
{
  string configname = diskfilestem + ".config";
  string dataname = diskfilestem + ".data";
  string bitmapname = diskfilestem + ".bitmap";
  
  if (configfilefd) { fclose(configfilefd); }
  
  if ((configfilefd = fopen(configname.c_str(),"r+"))==0) { 
    return ERROR_NOFILE;
  }

  int rc = ReadConfig();
  
  if (rc) { 
    return rc;
  }

  rc=SanityCheckConfig();

  if (rc) { 
    return rc;
  }

  if (datafilefd) { fclose(datafilefd);}

  if ((datafilefd = fopen(dataname.c_str(),"r+"))==0) { 
    return ERROR_NOFILE;
  }


  if (bitmapfilefd) { fclose(bitmapfilefd);}

  if ((bitmapfilefd = fopen(bitmapname.c_str(),"r+"))==0) { 
    return ERROR_NOFILE;
  }
  
  rc = ReadBitMap();

  if (rc) { 
    return rc;
  }

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
leaq 0x526f(%rip), %rdx      # 0x8361
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x3ffb
leaq 0x5263(%rip), %rdx      # 0x8369
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x3ffb
leaq 0x5255(%rip), %rdx      # 0x836f
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3ffb
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3133
callq 0x21c0
movq 0x40(%rsp), %rdi
leaq 0x5238(%rip), %rsi      # 0x8377
callq 0x2260
movq %rax, 0x18(%rbx)
pushq $-0xd
popq %rbp
testq %rax, %rax
je 0x3166
movq %rbx, %rdi
callq 0x3532
movq %rbx, %rdi
callq 0x34e4
testl %eax, %eax
je 0x318d
movl %eax, %ebp
movq %rsp, %rdi
callq 0x20b0
leaq 0x20(%rsp), %rdi
callq 0x20b0
leaq 0x40(%rsp), %rdi
callq 0x20b0
movl %ebp, %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x319b
callq 0x21c0
movq 0x20(%rsp), %rdi
leaq 0x51d0(%rip), %rsi      # 0x8377
callq 0x2260
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x3166
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x31c3
callq 0x21c0
movq (%rsp), %rdi
leaq 0x51a9(%rip), %rsi      # 0x8377
callq 0x2260
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x3166
movq %rbx, %rdi
callq 0x37ca
jmp 0x3164
movq %rax, %rbx
jmp 0x31fe
movq %rax, %rbx
jmp 0x3208
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20b0
leaq 0x20(%rsp), %rdi
callq 0x20b0
leaq 0x40(%rsp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::~DiskSystem()
DiskSystem::~DiskSystem()
{
  WriteConfig();
  WriteBitMap();
  fclose(configfilefd);
  fclose(bitmapfilefd);
  fclose(datafilefd);
  delete [] bitmap;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x9b03(%rip), %rax      # 0xcd28
movq %rax, (%rdi)
callq 0x3274
movq %rbx, %rdi
callq 0x3476
movq 0x18(%rbx), %rdi
callq 0x21c0
movq 0x20(%rbx), %rdi
callq 0x21c0
movq 0x10(%rbx), %rdi
callq 0x21c0
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x325e
callq 0x2280
addq $0x28, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x20b0
movq %rax, %rdi
callq 0x3ff0
nop
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::WriteBitMap()
ERROR_T DiskSystem::WriteBitMap()
{
  rewind(bitmapfilefd);
  
  SIZE_T numbitmapbytes = numblocks / 8 + (numblocks%8 != 0); 

  if (mywrite(bitmapfilefd,0,bitmap,numbitmapbytes)!=numbitmapbytes) { 
    cerr << "Can't write bitmap file\n";
    return ERROR_IMPLBUG;
  }
  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x2040
movl 0x4c(%rbx), %eax
movl %eax, %ebp
shrl $0x3, %ebp
andl $0x7, %eax
cmpl $0x1, %eax
sbbl $-0x1, %ebp
movq 0x8(%rbx), %rdx
movq 0x20(%rbx), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
movl %ebp, %ecx
callq 0x377d
cmpl %ebp, %eax
je 0x34c3
movq 0x9b3c(%rip), %rdi      # 0xcff0
leaq 0x4e75(%rip), %rsi      # 0x8330
callq 0x21b0
pushq $-0xb
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: mywrite(_IO_FILE*, unsigned int, unsigned char const*, int)
static SIZE_T mywrite(FILE *f, const SIZE_T off, const BYTE_T *buf, const int len)
{
  SIZE_T left=len;
  SIZE_T sent;

  fseek(f,off,SEEK_SET);
  while (left>0) {
    sent=fwrite(&(buf[len-left]),1,left,f);
    if (sent<0) {	
      return 0;
    } else if (sent==0) {
      break;
    } else {
      left-=sent;
    }
  }
  return len-left;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %r15
movl %esi, %esi
xorl %edx, %edx
callq 0x2220
pushq $0x1
popq %r12
movl %ebx, %ebp
testl %ebp, %ebp
je 0x37bc
movl %ebx, %edi
subl %ebp, %edi
addq %r14, %rdi
movl %ebp, %edx
movq %r12, %rsi
movq %r15, %rcx
callq 0x23b0
testl %eax, %eax
je 0x37bc
subl %eax, %ebp
jmp 0x379c
subl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::ReadBitMap()
ERROR_T DiskSystem::ReadBitMap()
{
  rewind(bitmapfilefd);
  
  SIZE_T numbitmapbytes = numblocks / 8 + (numblocks%8 != 0); 

  if (bitmap) { delete [] bitmap; } ;

  bitmap = new BYTE_T [numbitmapbytes];

  if (myread(bitmapfilefd,0,bitmap,numbitmapbytes,false)!=numbitmapbytes) { 
    cerr << "Can't read bitmap file\n";
    return ERROR_IMPLBUG;
  }
  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x20(%rdi), %rdi
callq 0x2040
movl 0x4c(%r14), %eax
movl %eax, %ebx
shrl $0x3, %ebx
andl $0x7, %eax
cmpl $0x1, %eax
sbbl $-0x1, %ebx
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x37fa
callq 0x2280
movl %ebx, %edi
callq 0x2030
movq %rax, 0x8(%r14)
movq 0x20(%r14), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
movq %rax, %rdx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x383b
cmpl %ebx, %eax
je 0x3834
movq 0x97cb(%rip), %rdi      # 0xcff0
leaq 0x4b1d(%rip), %rsi      # 0x8349
callq 0x21b0
pushq $-0xb
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: myread(_IO_FILE*, unsigned int, unsigned char*, int, bool)
static SIZE_T myread(FILE *f, const SIZE_T off, BYTE_T *buf, const int len, bool trunconeof=true)
{
  SIZE_T left=len;
  SIZE_T sent;

  fseek(f,off,SEEK_SET);
  while (left>0) {
    sent=fread(&(buf[len-left]),1,left,f);
    if (sent<0) {	
      return 0;
    } else if (sent==0) {
      // if we reached this point, the likely cause is that we
      // are trying to read a block which has not been allocated yet
      // Hence, we will try to ftruncate to this size and then retry the
      // read.  However, we don't want to loop forever doing this,
      // hence the trunconeof parameter
      if (!feof(f)) { 
	// OK, the end of file is not the problem
	break;
      } else {
	// EOF case... should we truncate and try again?
	if (!trunconeof) { 
	  break;
	} else {
	  // yes!
	  if (ftruncate(fileno(f),off+len)) { 
	    // uh oh, something weird is going on
	    break;
	  } else {
	    // OK, now retry, but don't truncate a second time
	    return myread(f,off,buf,len,false);
	  }
	}
      }
    } else {
      left-=sent;
    }
  }
  return len-left;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %r13d
movl %ecx, %r15d
movq %rdx, %r14
movq %rdi, %r12
movl %esi, %eax
movq %rax, 0x10(%rsp)
addl %ecx, %esi
movq %rsi, 0x8(%rsp)
pushq $0x1
popq %rbp
movq %r12, %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x2220
movl %r15d, %ebx
testl %ebx, %ebx
je 0x38cd
movl %r15d, %edi
subl %ebx, %edi
addq %r14, %rdi
movl %ebx, %edx
movq %rbp, %rsi
movq %r12, %rcx
callq 0x22d0
testl %eax, %eax
je 0x3899
subl %eax, %ebx
jmp 0x3878
movq %r12, %rdi
callq 0x22f0
testl %eax, %eax
sete %al
notb %r13b
orb %al, %r13b
testb $0x1, %r13b
jne 0x38cd
movq %r12, %rdi
callq 0x2210
movl %eax, %edi
movq 0x8(%rsp), %rsi
callq 0x22a0
xorl %r13d, %r13d
testl %eax, %eax
je 0x3866
subl %ebx, %r15d
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::ModelAccess(unsigned int, unsigned int)
double DiskSystem::ModelAccess(const SIZE_T offblock, const SIZE_T numblock) 
{

  SIZE_T req_trackstart = (offblock) / (numheads*blockspertrack);
  SIZE_T req_sectorstart=  (offblock) % (numheads*blockspertrack);

  SIZE_T req_trackend = (offblock+numblock-1) / (numheads*blockspertrack);
  SIZE_T req_sectorend=  (offblock+numblock-1) % (numheads*blockspertrack);

  SIZE_T trackhop = (SIZE_T) fabs((double)req_trackstart-(double)last_track);
  double trackhopfrac = (double)trackhop/(double)numtracks;

  // This is a simplistic model.  
  double trackbytracktime = trackhop*trackseeklatency;
  double longseektime = (trackhopfrac/(0.5))*averageseeklatency;
  double timeinseek = trackbytracktime<longseektime ? trackbytracktime : longseektime;

  // Now we are on the first track and we need to wait for the first
  // sector to show up

  SIZE_T sectorhop = (req_sectorstart >= last_sector) ? (req_sectorstart-last_sector) : (blockspertrack - (last_sector - req_sectorstart));
  double sectorhopfrac = (double)sectorhop/(double)blockspertrack;
  double timeinrotation=rotationallatency*sectorhopfrac;

  // Now we've got to read numblockelements

  // The number of side by side tracks we'll deal with:
  SIZE_T numtrackbytrackhops = req_trackend-req_trackstart;
  double timeintrackbytrackhops = numtrackbytrackhops*trackseeklatency;

  // The total number of sectors read
  double timeinreadsectors = rotationallatency*((double)numblock/(double)blockspertrack);

  last_track=req_trackend;
  last_sector=req_sectorend;

  return timeinseek+timeinrotation+timeintrackbytrackhops+timeinreadsectors;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ecx
movl %esi, %r8d
movl 0x58(%rdi), %r10d
movl 0x5c(%rdi), %r14d
movl 0x54(%rdi), %r11d
imull %r10d, %r11d
movl 0x60(%rdi), %r15d
movsd 0x70(%rdi), %xmm0
movl %esi, %eax
xorl %edx, %edx
divl %r11d
movl %eax, %esi
movl %edx, %r9d
xorl %ebx, %ebx
subl 0x64(%rdi), %r9d
cmovbl %r10d, %ebx
cvtsi2sd %rsi, %xmm1
cvtsi2sd %r15, %xmm2
subsd %xmm2, %xmm1
andpd 0x48ef(%rip), %xmm1     # 0x8220
cvttsd2si %xmm1, %rax
movl %eax, %eax
cvtsi2sd %rax, %xmm2
movapd %xmm0, %xmm1
mulsd %xmm2, %xmm1
cvtsi2sd %r14, %xmm3
divsd %xmm3, %xmm2
addsd %xmm2, %xmm2
mulsd 0x68(%rdi), %xmm2
leal (%r8,%rcx), %eax
decl %eax
xorl %edx, %edx
divl %r11d
leal (%r9,%rbx), %r8d
cvtsi2sd %r8, %xmm3
minsd %xmm2, %xmm1
cvtsi2sd %r10, %xmm2
divsd %xmm2, %xmm3
movsd 0x78(%rdi), %xmm4
mulsd %xmm4, %xmm3
movl %eax, 0x60(%rdi)
subl %esi, %eax
cvtsi2sd %rax, %xmm5
addsd %xmm1, %xmm3
mulsd %xmm0, %xmm5
addsd %xmm3, %xmm5
movl %ecx, %eax
cvtsi2sd %rax, %xmm0
divsd %xmm2, %xmm0
mulsd %xmm4, %xmm0
addsd %xmm5, %xmm0
movl %edx, 0x64(%rdi)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::Read(unsigned int, unsigned int, std::vector<Block, std::allocator<Block>>&, double&)
ERROR_T DiskSystem::Read(const SIZE_T   inoffblock,
			 const SIZE_T   numblock,
			 vector<Block> &blocks,
			 double        &reqtime)
{
  reqtime=0;

  if (inoffblock+numblock > numblocks) { 
    cerr << "DiskSystem::Read: Attempt to read blocks "<<inoffblock<<" to "<<(inoffblock+numblock-1)<<", but maxmimum block is only "<<(numblocks-1)<<endl;
    return ERROR_NOSPACE;
  }

  reqtime=ModelAccess(inoffblock,numblock);

  for (SIZE_T i=0;i<numblock;i++) { 
    Block b(blocksize);
    if (!IsBlockAllocated(inoffblock+i)) { 
      if (PRINT_DISKSYSTEM_ALLOCATION_ERRORS) {
	cerr <<"DiskSystem::Read: reading unallocated block "<<(i+inoffblock)<<endl;
      }
    }
    if (myread(datafilefd,offset+(inoffblock+i)*blocksize,b.data,blocksize,true)!=blocksize) { 
      cerr << "DiskSystem::Read: myread has failed"<<endl;
      return ERROR_IMPLBUG;
    }
    blocks.push_back(b);
  }

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x8(%rsp)
movl %edx, %r12d
movl %esi, %r14d
andq $0x0, (%r8)
movq %rdi, %rbx
leal (%r12,%r14), %r15d
cmpl 0x4c(%rdi), %r15d
jbe 0x3a44
movq 0x960b(%rip), %rdi      # 0xcff0
leaq 0x49c5(%rip), %rsi      # 0x83b1
callq 0x21b0
movl %r14d, %esi
movq %rax, %rdi
callq 0x2120
leaq 0x49d8(%rip), %rsi      # 0x83db
movq %rax, %rdi
callq 0x21b0
decl %r15d
movq %rax, %rdi
movq %r15, %rsi
callq 0x2120
leaq 0x49c0(%rip), %rsi      # 0x83e0
movq %rax, %rdi
callq 0x21b0
movl 0x4c(%rbx), %esi
decl %esi
movq %rax, %rdi
callq 0x2120
movq %rax, %rdi
callq 0x20c0
pushq $-0x7
jmp 0x3ad5
movq %r8, %r13
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq *(%rax)
movsd %xmm0, (%r13)
leaq 0x10(%rsp), %r13
subl $0x1, %r12d
jb 0x3ad8
movl 0x50(%rbx), %esi
movq %r13, %rdi
callq 0x2aea
movq 0x10(%rbx), %rdi
movl 0x50(%rbx), %ecx
movl %ecx, %esi
imull %r14d, %esi
addl 0x48(%rbx), %esi
movq 0x18(%rsp), %rdx
pushq $0x1
popq %r8
callq 0x383b
movl %eax, %r15d
movl 0x50(%rbx), %ebp
cmpl %ebp, %eax
jne 0x3aa8
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x4034
jmp 0x3ac3
movq 0x9541(%rip), %rdi      # 0xcff0
leaq 0x4948(%rip), %rsi      # 0x83fe
callq 0x21b0
movq %rax, %rdi
callq 0x20c0
movq %r13, %rdi
callq 0x2c6e
incl %r14d
cmpl %ebp, %r15d
je 0x3a60
pushq $-0xb
popq %rax
jmp 0x3ada
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2c6e
movq %rbx, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::Write(unsigned int, unsigned int, std::vector<Block, std::allocator<Block>> const&, double&)
ERROR_T DiskSystem::Write(const SIZE_T   inoffblock,
			  const SIZE_T   numblock,
			  const vector<Block> &blocks,
			  double        &reqtime)
{
  reqtime=0;

  if (inoffblock+numblock > numblocks) { 
    cerr << "DiskSystem::Write: Attempt to write blocks "<<inoffblock<<" to "<<(inoffblock+numblock-1)<<", but maxmimum block is only "<<(numblocks-1)<<endl;
    return ERROR_NOSPACE;
  }

  reqtime=ModelAccess(inoffblock,numblock);

  for (SIZE_T i=0;i<numblock;i++) { 
    if (!IsBlockAllocated(inoffblock+i)) { 
      if (PRINT_DISKSYSTEM_ALLOCATION_ERRORS) {
	cerr <<"DiskSystem::Write: writing unallocated block "<<(i+inoffblock)<<endl;
      }
    }
    if (mywrite(datafilefd,offset+(inoffblock+i)*blocksize,blocks[i].data,blocksize)!=blocksize) {  
      cerr << "DiskSystem::Write: mywrite has failed"<<endl;
      return ERROR_IMPLBUG;
    }
  }

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
andq $0x0, (%r8)
movq %rdi, %rbx
leal (%r14,%rbp), %r12d
cmpl 0x4c(%rdi), %r12d
jbe 0x3b98
movq 0x94ac(%rip), %rdi      # 0xcff0
leaq 0x48d7(%rip), %rsi      # 0x8422
callq 0x21b0
movl %r14d, %esi
movq %rax, %rdi
callq 0x2120
leaq 0x4879(%rip), %rsi      # 0x83db
movq %rax, %rdi
callq 0x21b0
decl %r12d
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
leaq 0x4861(%rip), %rsi      # 0x83e0
movq %rax, %rdi
callq 0x21b0
movl 0x4c(%rbx), %esi
decl %esi
movq %rax, %rdi
callq 0x2120
pushq $-0x7
jmp 0x3bff
movq %r8, %r13
movq %rcx, %r15
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq *(%rax)
movsd %xmm0, (%r13)
movl %ebp, %eax
imulq $0x28, %rax, %r13
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x3c09
movq 0x10(%rbx), %rdi
movl 0x50(%rbx), %ecx
movl %ecx, %esi
imull %r14d, %esi
addl 0x48(%rbx), %esi
movq (%r15), %rax
movq 0x8(%rax,%rbp), %rdx
callq 0x377d
addq $0x28, %rbp
incl %r14d
cmpl 0x50(%rbx), %eax
je 0x3bbc
movq 0x93ff(%rip), %rdi      # 0xcff0
leaq 0x4856(%rip), %rsi      # 0x844e
callq 0x21b0
pushq $-0xb
popq %r12
movq %rax, %rdi
callq 0x20c0
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::Read(unsigned int, Block&, double&)
ERROR_T DiskSystem::Read(const SIZE_T inoffblock, Block &blocks, double &reqtime)
{
  vector<Block> bl;

  ERROR_T rc = Read(inoffblock,1,bl,reqtime);

  if (rc!=ERROR_NOERROR) { 
    return rc;
  }

  blocks = bl[0];

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r8
movq %rdx, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rcx
movaps %xmm0, (%rcx)
andq $0x0, 0x10(%rcx)
pushq $0x1
popq %rdx
callq 0x39b4
movl %eax, %ebp
testl %eax, %eax
jne 0x3c50
movq (%rsp), %rsi
movq %rbx, %rdi
callq 0x2cbe
movq %rsp, %rdi
callq 0x4060
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4060
movq %rbx, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::NotifyAllocateBlocks(unsigned int, unsigned int)
ERROR_T DiskSystem::NotifyAllocateBlocks(const SIZE_T offset, const SIZE_T innumblocks)
{
  if (offset+innumblocks > numblocks) { 
    cerr << "Disksystem: NotifyAllocateBlocks: Attempt to allocate"<<offset<<" to "<<(offset+innumblocks-1)<<" but maximum block is "<<(numblocks-1)<<endl;
    return ERROR_NOSUCHBLOCK;
  }


  for (SIZE_T i=offset; i<(offset+innumblocks); i++) { 
    if (IsBlockAllocated(i)) {
      if (PRINT_DISKSYSTEM_ALLOCATION_ERRORS) {
	cerr << "Disksystem: NotifyAllocateBlocks: Block "<<i<<" is being allocated, but it's already allocated!"<<endl;
      }
    }
    SETBIT(i);
  }

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
addl %esi, %r14d
cmpl 0x4c(%rdi), %r14d
jbe 0x3d58
movq 0x92f4(%rip), %rdi      # 0xcff0
leaq 0x4771(%rip), %rsi      # 0x8474
callq 0x21b0
movl %ebp, %esi
movq %rax, %rdi
callq 0x2120
leaq 0x46c2(%rip), %rsi      # 0x83db
movq %rax, %rdi
callq 0x21b0
decl %r14d
movq %rax, %rdi
movq %r14, %rsi
callq 0x2120
leaq 0x4774(%rip), %rsi      # 0x84aa
movq %rax, %rdi
callq 0x21b0
movl 0x4c(%rbx), %esi
decl %esi
movq %rax, %rdi
callq 0x2120
movq %rax, %rdi
callq 0x20c0
pushq $-0x3
popq %rax
jmp 0x3d7e
pushq $0x1
popq %rax
cmpl %r14d, %ebp
jae 0x3d7c
movq 0x8(%rbx), %rdx
movl %ebp, %esi
shrl $0x3, %esi
movl %ebp, %ecx
notb %cl
andb $0x7, %cl
movl %eax, %edi
shll %cl, %edi
orb %dil, (%rdx,%rsi)
incl %ebp
jmp 0x3d5b
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::NotifyDeallocateBlocks(unsigned int, unsigned int)
ERROR_T DiskSystem::NotifyDeallocateBlocks(const SIZE_T offset,const SIZE_T innumblocks)
{
  if (offset+innumblocks > numblocks) { 
    cerr << "Disksystem: NotifyDeallocateBlocks: Attempt to deallocate"<<offset<<" to "<<(offset+innumblocks-1)<<" but maximum block is "<<(numblocks-1)<<endl;
    return ERROR_NOSUCHBLOCK;
  }


  for (SIZE_T i=offset; i<(offset+innumblocks); i++) { 
    if (!IsBlockAllocated(i)) {
      if (PRINT_DISKSYSTEM_ALLOCATION_ERRORS) {
	cerr << "Disksystem: NotifyDeallocateBlocks: Block "<<i<<" is being deallocated, but it's already deallocated!"<<endl;
      }
    }
    CLEARBIT(i);
  }

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
addl %esi, %r14d
cmpl 0x4c(%rdi), %r14d
jbe 0x3dfc
movq 0x9250(%rip), %rdi      # 0xcff0
leaq 0x471a(%rip), %rsi      # 0x84c1
callq 0x21b0
movl %ebp, %esi
movq %rax, %rdi
callq 0x2120
leaq 0x461e(%rip), %rsi      # 0x83db
movq %rax, %rdi
callq 0x21b0
decl %r14d
movq %rax, %rdi
movq %r14, %rsi
callq 0x2120
leaq 0x46d0(%rip), %rsi      # 0x84aa
movq %rax, %rdi
callq 0x21b0
movl 0x4c(%rbx), %esi
decl %esi
movq %rax, %rdi
callq 0x2120
movq %rax, %rdi
callq 0x20c0
pushq $-0x3
popq %rax
jmp 0x3e25
pushq $0x1
popq %rax
cmpl %r14d, %ebp
jae 0x3e23
movq 0x8(%rbx), %rdx
movl %ebp, %esi
shrl $0x3, %esi
movl %ebp, %ecx
notb %cl
andb $0x7, %cl
movl %eax, %edi
shll %cl, %edi
notb %dil
andb %dil, (%rdx,%rsi)
incl %ebp
jmp 0x3dff
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::Print(std::ostream&) const
ostream & DiskSystem::Print(ostream &os) const
{
  os << "DiskSystem(diskfilestem="<<diskfilestem
     << ", offset="<<offset
     << ", numblocks="<<numblocks
     << ", blocksize="<<blocksize
     << ", numheads="<<numheads
     << ", blockspertrack="<<blockspertrack
     << ", numtracks="<<numtracks
     << ", last_track="<<last_track
     << ", last_sector="<<last_sector
     << ", averageseeklatency="<<averageseeklatency
     << ", trackseeklatency="<<trackseeklatency
     << ", rotationallatency="<<rotationallatency
     << ", bitmap=";

  for (SIZE_T i=0;i<numblocks;i++) { 
    if (GETBIT(i)) { 
      os <<"*";
    } else {
      os <<".";
    }
  }

  os <<")";
  return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x46bc(%rip), %rsi      # 0x84fb
movq %rbx, %rdi
callq 0x21b0
leaq 0x28(%r14), %rsi
movq %rax, %rdi
callq 0x2180
leaq 0x46ba(%rip), %rsi      # 0x8514
movq %rax, %rdi
callq 0x21b0
movl 0x48(%r14), %esi
movq %rax, %rdi
callq 0x2120
leaq 0x46a9(%rip), %rsi      # 0x851e
movq %rax, %rdi
callq 0x21b0
movl 0x4c(%r14), %esi
movq %rax, %rdi
callq 0x2120
leaq 0x469b(%rip), %rsi      # 0x852b
movq %rax, %rdi
callq 0x21b0
movl 0x50(%r14), %esi
movq %rax, %rdi
callq 0x2120
leaq 0x468d(%rip), %rsi      # 0x8538
movq %rax, %rdi
callq 0x21b0
movl 0x54(%r14), %esi
movq %rax, %rdi
callq 0x2120
leaq 0x467e(%rip), %rsi      # 0x8544
movq %rax, %rdi
callq 0x21b0
movl 0x58(%r14), %esi
movq %rax, %rdi
callq 0x2120
leaq 0x4675(%rip), %rsi      # 0x8556
movq %rax, %rdi
callq 0x21b0
movl 0x5c(%r14), %esi
movq %rax, %rdi
callq 0x2120
leaq 0x4667(%rip), %rsi      # 0x8563
movq %rax, %rdi
callq 0x21b0
movl 0x60(%r14), %esi
movq %rax, %rdi
callq 0x2120
leaq 0x465a(%rip), %rsi      # 0x8571
movq %rax, %rdi
callq 0x21b0
movl 0x64(%r14), %esi
movq %rax, %rdi
callq 0x2120
leaq 0x464e(%rip), %rsi      # 0x8580
movq %rax, %rdi
callq 0x21b0
movsd 0x68(%r14), %xmm0
movq %rax, %rdi
callq 0x2320
leaq 0x4647(%rip), %rsi      # 0x8596
movq %rax, %rdi
callq 0x21b0
movsd 0x70(%r14), %xmm0
movq %rax, %rdi
callq 0x2320
leaq 0x463e(%rip), %rsi      # 0x85aa
movq %rax, %rdi
callq 0x21b0
movsd 0x78(%r14), %xmm0
movq %rax, %rdi
callq 0x2320
leaq 0x4636(%rip), %rsi      # 0x85bf
movq %rax, %rdi
callq 0x21b0
xorl %ebp, %ebp
leaq 0x48a6(%rip), %r15      # 0x8840
leaq 0x4628(%rip), %r12      # 0x85c9
cmpl 0x4c(%r14), %ebp
jae 0x3fd5
movq 0x8(%r14), %rax
movl %ebp, %ecx
shrl $0x3, %ecx
movzbl (%rax,%rcx), %eax
movl %ebp, %ecx
notb %cl
movzbl %cl, %ecx
andl $0x7, %ecx
btl %ecx, %eax
movq %r15, %rsi
jae 0x3fc9
movq %r12, %rsi
movq %rbx, %rdi
callq 0x21b0
incl %ebp
jmp 0x3fa1
leaq 0x4789(%rip), %rsi      # 0x8765
movq %rbx, %rdi
callq 0x21b0
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq