LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 %rdi, -0x30(%rbp)
movq 0x28(%rsi), %rdi
cmpq %rdi, 0x30(%rsi)
je 0x2d49
movq %rdx, %r15
movq %rsi, %r14
xorl %r12d, %r12d
movabsq $-0x71c71c71c71c71c7, %r13 # imm = 0x8E38E38E38E38E39
xorl %ebx, %ebx
addq %r12, %rdi
movq %r15, %rsi
callq 0x2030
testl %eax, %eax
je 0x2d5a
incq %rbx
movq 0x28(%r14), %rdi
movq 0x30(%r14), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r13, %rax
addq $0x48, %r12
cmpq %rbx, %rax
ja 0x2d1b
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x265c
movq %rbx, %rax
jmp 0x2da8
movq 0x28(%r14), %rbx
movq -0x30(%rbp), %r13
leaq 0x10(%r13), %r15
movq %r15, (%r13)
movq (%rbx,%r12), %rsi
movq 0x8(%rbx,%r12), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x30fa
movq 0x20(%rbx,%r12), %rax
movq %rax, 0x20(%r13)
leaq 0x28(%r13), %rdi
leaq 0x38(%r13), %rax
movq %rax, 0x28(%r13)
movq 0x28(%rbx,%r12), %rsi
movq 0x30(%rbx,%r12), %rdx
addq %rsi, %rdx
callq 0x30fa
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%r13), %rdi
cmpq %r15, %rdi
je 0x2dce
movq (%r15), %rsi
incq %rsi
callq 0x2180
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq (%rdi), %r14
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq -0x38(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x30fa
movq (%rbx), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21f0
movl %eax, %r14d
cmpq %r15, %rbx
je 0x2e2c
movq -0x28(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x2180
testl %r14d, %r14d
sete %al
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x30fa
movq (%rbx), %rbx
leaq -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x60(%rbp), %rdi
callq 0x30fa
movq -0x60(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21f0
movl %eax, %ebx
cmpq %r12, %r14
je 0x2eb5
movq -0x50(%rbp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x2180
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x2eca
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2180
testl %ebx, %ebx
sete %al
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x2ef4
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movl %esi, -0x2c(%rbp)
movslq %esi, %rdx
movq (%rdi), %rcx
movq 0x8(%rdi), %rsi
movq %rsi, %rax
subq %rcx, %rax
sarq $0x3, %rax
movabsq $-0x71c71c71c71c71c7, %rdi # imm = 0x8E38E38E38E38E39
imulq %rdi, %rax
movq %rdx, -0x38(%rbp)
cmpq %rdx, %rax
jb 0x512d
movl $0x1, %r15d
leaq 0x214b(%rip), %r12      # 0x7219
xorl %r13d, %r13d
movl -0x2c(%rbp), %eax
movl %eax, %ebx
testl %eax, %eax
jle 0x5104
movq (%r14), %rax
leaq (,%r13,8), %rcx
addq %r13, %rcx
movq (%rax,%rcx,8), %rdx
movq %r12, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2040
decl %ebx
jne 0x50da
movq (%r14), %rcx
movq 0x8(%r14), %rsi
incl %r15d
incq %r13
movq %rsi, %rax
subq %rcx, %rax
sarq $0x3, %rax
movabsq $-0x71c71c71c71c71c7, %rdx # imm = 0x8E38E38E38E38E39
imulq %rdx, %rax
xorl %edx, %edx
divq -0x38(%rbp)
cmpq %r13, %rax
ja 0x50d1
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6556
movq %rax, (%r14)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2250
addq $0x8, %r14
jmp 0x653e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
testl %edi, %edi
je 0x680e
movb $0x1, 0x39f6(%rip)      # 0xa194
leaq 0x3c53(%rip), %rdi      # 0xa3f8
leaq 0x3bf4(%rip), %rsi      # 0xa3a0
callq 0x20e0
movq 0x3c08(%rip), %rax      # 0xa3c0
movq %rax, 0x3c59(%rip)      # 0xa418
leaq 0x3c5a(%rip), %rdi      # 0xa420
leaq 0x3bfb(%rip), %rsi      # 0xa3c8
callq 0x6928
leaq 0x3c5f(%rip), %rdi      # 0xa438
leaq 0x3c00(%rip), %rsi      # 0xa3e0
callq 0x6928
movq 0x3c84(%rip), %rsi      # 0xa470
leaq 0x3c7d(%rip), %rdi      # 0xa470
callq 0x6e68
leaq 0x100e(%rip), %rdi      # 0x780d
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2220
movq %rsi, %rbx
movb $0x0, 0x397c(%rip)      # 0xa194
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x30fa
leaq 0x3bbb(%rip), %rdi      # 0xa3f8
movq %r14, %rsi
callq 0x2a9a
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x685a
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2180
movq 0x3c0f(%rip), %rsi      # 0xa470
leaq 0x3c08(%rip), %rdi      # 0xa470
callq 0x6e68
movq (%rbx), %rsi
leaq 0x817(%rip), %rdi       # 0x708e
xorl %eax, %eax
callq 0x2040
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x68a1
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2270
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2cf0
movl 0x10(%r14), %edx
cmpl %ebx, %edx
cmovael %ebx, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2170
testq %r12, %r12
je 0x2cfd
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 0x2090
callq 0x2330
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x2d07
// File: /workspace/github_cpp_makefile_star2_O3/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 0xaeb7(%rip), %rax      # 0xdce8
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x2e4a
callq 0x2280
movq $0x0, 0x8(%rbx)
movl $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_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x62d9(%rip), %rsi      # 0x91db
movl $0xd, %edx
movq %rbx, %rdi
callq 0x2230
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x2120
leaq 0x62c7(%rip), %rsi      # 0x91e9
movl $0x9, %edx
movq %rax, %rdi
callq 0x2230
cmpl $0x0, 0x10(%r14)
je 0x2fb3
xorl %r13d, %r13d
leaq 0xe(%rsp), %r15
leaq 0xf(%rsp), %r12
movq 0x8(%r14), %rax
movb (%rax,%r13), %al
movl %eax, %ecx
shrb $0x4, %cl
leal 0x30(%rcx), %edx
addb $0x57, %cl
cmpb $-0x60, %al
movzbl %dl, %eax
movzbl %cl, %ecx
cmovbl %eax, %ecx
movb %cl, 0xe(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2230
movq 0x8(%r14), %rcx
movb (%rcx,%r13), %cl
andb $0xf, %cl
leal 0x30(%rcx), %edx
leal 0x57(%rcx), %esi
cmpb $0xa, %cl
movzbl %dl, %ecx
movzbl %sil, %edx
cmovbl %ecx, %edx
movb %dl, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2230
incq %r13
movl 0x10(%r14), %eax
cmpq %rax, %r13
jb 0x2f43
leaq 0x6239(%rip), %rsi      # 0x91f3
movl $0xf, %edx
movq %rbx, %rdi
callq 0x2230
movsd 0x18(%r14), %xmm0
movq %rbx, %rdi
callq 0x2310
movq %rax, %r15
leaq 0x6224(%rip), %rsi      # 0x9203
movl $0x8, %edx
movq %rax, %rdi
callq 0x2230
movzbl 0x20(%r14), %esi
movq %r15, %rdi
callq 0x2340
leaq 0x6765(%rip), %rsi      # 0x9765
movl $0x1, %edx
movq %rax, %rdi
callq 0x2230
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movsd %xmm2, 0x20(%rsp)
movsd %xmm1, 0x18(%rsp)
movsd %xmm0, 0x10(%rsp)
movl %r9d, %r15d
movl %r8d, %r12d
movl %ecx, %r13d
movl %edx, %ebp
movq %rdi, %r14
leaq 0xacd3(%rip), %rax      # 0xdd28
movq %rax, (%rdi)
leaq 0x28(%rdi), %rbx
leaq 0x38(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movq %rax, 0x8(%rsp)
movq %rax, 0x28(%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4658
movl %r13d, 0x48(%r14)
movl %r12d, 0x4c(%r14)
movl %r15d, 0x50(%r14)
movl 0x60(%rsp), %eax
movl %eax, 0x54(%r14)
movl 0x68(%rsp), %eax
movl %eax, 0x58(%r14)
movl 0x70(%rsp), %eax
movl %eax, 0x5c(%r14)
movq $0x0, 0x60(%r14)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x68(%r14)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x70(%r14)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x78(%r14)
testl %ebp, %ebp
je 0x30e7
movq %r14, %rdi
callq 0x3124
jmp 0x30ef
movq %r14, %rdi
callq 0x33d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq 0x8(%rsp), %rdi
je 0x311b
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x2370
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x28(%rdi), %rsi
movq 0x30(%rdi), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x4658
leaq 0x5f5a(%rip), %rsi      # 0x9361
movq %r14, %rdi
callq 0x2390
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x4658
leaq 0x5f35(%rip), %rsi      # 0x9369
leaq 0x20(%rsp), %rdi
callq 0x2390
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x4658
leaq 0x5f0d(%rip), %rsi      # 0x936f
movq %rsp, %rdi
callq 0x2390
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3478
callq 0x21c0
movq 0x40(%rsp), %rdi
leaq 0x5ef3(%rip), %rsi      # 0x9377
callq 0x2260
movq %rax, 0x18(%rbx)
movl $0xfffffff3, %ebp       # imm = 0xFFFFFFF3
testq %rax, %rax
je 0x34ad
movq %rbx, %rdi
callq 0x3914
movq %rbx, %rdi
callq 0x38b4
testl %eax, %eax
je 0x3500
movl %eax, %ebp
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x34c3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21e0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x34da
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21e0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x34f1
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21e0
movl %ebp, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x350e
callq 0x21c0
movq 0x20(%rsp), %rdi
leaq 0x5e5d(%rip), %rsi      # 0x9377
callq 0x2260
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x34ad
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x3536
callq 0x21c0
movq (%rsp), %rdi
leaq 0x5e36(%rip), %rsi      # 0x9377
callq 0x2260
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x34ad
movq %rbx, %rdi
callq 0x3bb2
jmp 0x34ab
jmp 0x3570
jmp 0x3564
movq %rax, %rbx
jmp 0x3589
jmp 0x356b
movq %rax, %rbx
jmp 0x35a0
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3589
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21e0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x35a0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21e0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x35b7
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2370
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa75d(%rip), %rax      # 0xdd28
movq %rax, (%rdi)
callq 0x3628
movq %rbx, %rdi
callq 0x383e
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 0x3604
callq 0x2280
movq 0x28(%rbx), %rdi
addq $0x38, %rbx
cmpq %rbx, %rdi
je 0x361d
movq (%rbx), %rsi
incq %rsi
popq %rbx
jmp 0x21e0
popq %rbx
retq
movq %rax, %rdi
callq 0x45d9
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2050
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 0x3b5c
cmpl %ebp, %eax
je 0x3892
movq 0xa774(%rip), %rdi      # 0xdff0
leaq 0x5aad(%rip), %rsi      # 0x9330
movl $0x18, %edx
callq 0x2230
movl $0xfffffff5, %ebx       # imm = 0xFFFFFFF5
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %ebp, %ebp
xorl %edx, %edx
callq 0x2220
testl %ebx, %ebx
je 0x3ba4
movl %ebx, %r12d
movl %ebx, %edi
subl %r12d, %edi
addq %r14, %rdi
movl %r12d, %edx
movl $0x1, %esi
movq %r15, %rcx
callq 0x23a0
testl %eax, %eax
je 0x3ba1
subl %eax, %r12d
jne 0x3b7e
jmp 0x3ba4
movl %r12d, %ebp
subl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2050
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 0x3be2
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 0x3c2a
cmpl %ebx, %eax
je 0x3c23
movq 0xa3e3(%rip), %rdi      # 0xdff0
leaq 0x5735(%rip), %rsi      # 0x9349
movl $0x17, %edx
callq 0x2230
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rax
movl %r8d, %ebp
movl %ecx, %r13d
movq %rdx, %r14
movq %rdi, %r12
movl %esi, %eax
addl %ecx, %esi
movq %rsi, (%rsp)
movq %r12, %rdi
movq %rax, %r15
movq %rax, %rsi
xorl %edx, %edx
callq 0x2220
testl %r13d, %r13d
je 0x3cb9
movl %r13d, %ebx
movl %r13d, %edi
subl %ebx, %edi
addq %r14, %rdi
movl %ebx, %edx
movl $0x1, %esi
movq %r12, %rcx
callq 0x22c0
testl %eax, %eax
je 0x3c82
subl %eax, %ebx
jne 0x3c61
jmp 0x3cb9
movq %r12, %rdi
callq 0x22e0
testl %eax, %eax
sete %al
notb %bpl
orb %al, %bpl
testb $0x1, %bpl
jne 0x3cbb
movq %r12, %rdi
callq 0x2210
movl %eax, %edi
movq (%rsp), %rsi
callq 0x2290
xorl %ebp, %ebp
testl %eax, %eax
movq %r15, %rax
je 0x3c49
jmp 0x3cbb
xorl %ebx, %ebx
subl %ebx, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movl %edx, %r12d
movl %esi, %r14d
movq %rdi, %rbx
movq $0x0, (%r8)
leal (%r12,%r14), %r13d
cmpl 0x4c(%rdi), %r13d
jbe 0x3e7d
movq 0xa20f(%rip), %r15      # 0xdff0
leaq 0x55c9(%rip), %rsi      # 0x93b1
movl $0x29, %edx
movq %r15, %rdi
callq 0x2230
movl %r14d, %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x55d1(%rip), %rsi      # 0x93db
movl $0x4, %edx
movq %rax, %rdi
callq 0x2230
decl %r13d
movq %r14, %rdi
movq %r13, %rsi
callq 0x2120
movq %rax, %r14
leaq 0x55b1(%rip), %rsi      # 0x93e0
movl $0x1d, %edx
movq %rax, %rdi
callq 0x2230
movl 0x4c(%rbx), %esi
decl %esi
movq %r14, %rdi
callq 0x2120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movl $0xfffffff9, %ebp       # imm = 0xFFFFFFF9
jmp 0x3f44
movq %r8, %rbp
movq %rcx, %r15
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq *(%rax)
movsd %xmm0, (%rbp)
xorl %ebp, %ebp
testl %r12d, %r12d
je 0x3f44
movq %rsp, %r13
movl 0x50(%rbx), %esi
movq %r13, %rdi
callq 0x2c84
movq 0x10(%rbx), %rdi
movl 0x50(%rbx), %ecx
movl %ecx, %esi
imull %r14d, %esi
addl 0x48(%rbx), %esi
movq 0x8(%rsp), %rdx
movl $0x1, %r8d
callq 0x3c2a
cmpl 0x50(%rbx), %eax
jne 0x3ef1
movq %r15, %rdi
movq %r13, %rsi
callq 0x45e4
movq %r13, %rdi
callq 0x2e26
incl %r14d
decl %r12d
jne 0x3ea4
jmp 0x3f44
movq 0xa0f8(%rip), %rbx      # 0xdff0
leaq 0x54ff(%rip), %rsi      # 0x93fe
movl $0x23, %edx
movq %rbx, %rdi
callq 0x2230
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0xa0c6(%rip), %rdi      # 0xdff0
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq %rsp, %rdi
callq 0x2e26
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3f57
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2e26
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/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, %r13d
movl %esi, %r14d
movq %rdi, %rbx
movq $0x0, (%r8)
leal (%r14,%r13), %r12d
cmpl 0x4c(%rdi), %r12d
jbe 0x4029
movq 0xa03c(%rip), %r15      # 0xdff0
leaq 0x5467(%rip), %rsi      # 0x9422
movl $0x2b, %edx
movq %r15, %rdi
callq 0x2230
movl %r14d, %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x53fe(%rip), %rsi      # 0x93db
movl $0x4, %edx
movq %rax, %rdi
callq 0x2230
decl %r12d
movq %r14, %rdi
movq %r12, %rsi
callq 0x2120
movq %rax, %r14
leaq 0x53de(%rip), %rsi      # 0x93e0
movl $0x1d, %edx
movq %rax, %rdi
callq 0x2230
movl 0x4c(%rbx), %esi
decl %esi
movq %r14, %rdi
callq 0x2120
movq %rax, %r14
movl $0xfffffff9, %ebx       # imm = 0xFFFFFFF9
jmp 0x40a9
movq %r8, %rbp
movq %rcx, %r15
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
movl %r13d, %edx
callq *(%rax)
movsd %xmm0, (%rbp)
testl %r13d, %r13d
je 0x4085
movl %r13d, %ecx
movl 0x50(%rbx), %eax
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %r12
xorl %r13d, %r13d
movq 0x10(%rbx), %rdi
movl %eax, %esi
imull %r14d, %esi
addl 0x48(%rbx), %esi
movq (%r15), %rcx
movq 0x8(%rcx,%r13), %rdx
movl %eax, %ecx
callq 0x3b5c
cmpl 0x50(%rbx), %eax
jne 0x4089
addq $0x28, %r13
incl %r14d
cmpq %r13, %r12
jne 0x4058
xorl %ebx, %ebx
jmp 0x40d0
movq 0x9f60(%rip), %r14      # 0xdff0
leaq 0x53b7(%rip), %rsi      # 0x944e
movl $0x25, %edx
movq %r14, %rdi
callq 0x2230
movl $0xfffffff5, %ebx       # imm = 0xFFFFFFF5
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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)
movq $0x0, 0x10(%rcx)
movl $0x1, %edx
callq 0x3dae
movl %eax, %ebp
testl %eax, %eax
jne 0x411b
movq (%rsp), %rsi
movq %rbx, %rdi
callq 0x2e90
movq %rsp, %rdi
callq 0x4610
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4610
movq %rbx, %rdi
callq 0x2370
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leal (%rdx,%r14), %r15d
cmpl 0x4c(%rdi), %r15d
jbe 0x426c
movq 0x9e1d(%rip), %r12      # 0xdff0
leaq 0x529a(%rip), %rsi      # 0x9474
movl $0x35, %edx
movq %r12, %rdi
callq 0x2230
movl %r14d, %esi
movq %r12, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x51df(%rip), %rsi      # 0x93db
movl $0x4, %edx
movq %rax, %rdi
callq 0x2230
decl %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0x2120
movq %rax, %r14
leaq 0x5289(%rip), %rsi      # 0x94aa
movl $0x16, %edx
movq %rax, %rdi
callq 0x2230
movl 0x4c(%rbx), %esi
decl %esi
movq %r14, %rdi
callq 0x2120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x4299
xorl %eax, %eax
cmpl %r14d, %r15d
jbe 0x4299
movq 0x8(%rbx), %rsi
movl %r14d, %edi
movl %r14d, %ecx
notb %cl
andb $0x7, %cl
movl $0x1, %r8d
shll %cl, %r8d
shrl $0x3, %edi
orb %r8b, (%rsi,%rdi)
incl %r14d
decl %edx
jne 0x4273
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leal (%rdx,%r14), %r15d
cmpl 0x4c(%rdi), %r15d
jbe 0x4362
movq 0x9d27(%rip), %r12      # 0xdff0
leaq 0x51f1(%rip), %rsi      # 0x94c1
movl $0x39, %edx
movq %r12, %rdi
callq 0x2230
movl %r14d, %esi
movq %r12, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x50e9(%rip), %rsi      # 0x93db
movl $0x4, %edx
movq %rax, %rdi
callq 0x2230
decl %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0x2120
movq %rax, %r14
leaq 0x5193(%rip), %rsi      # 0x94aa
movl $0x16, %edx
movq %rax, %rdi
callq 0x2230
movl 0x4c(%rbx), %esi
decl %esi
movq %r14, %rdi
callq 0x2120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x4392
xorl %eax, %eax
cmpl %r14d, %r15d
jbe 0x4392
movq 0x8(%rbx), %rsi
movl %r14d, %edi
shrl $0x3, %edi
movl %r14d, %ecx
notb %cl
andb $0x7, %cl
movl $0x1, %r8d
shll %cl, %r8d
notb %r8b
andb %r8b, (%rsi,%rdi)
incl %r14d
decl %edx
jne 0x4369
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/buffercache.cc
// Function: BufferCache::CheckDeleteOldest()
ERROR_T BufferCache::CheckDeleteOldest()
{
  // In a real buffer cache, we would use a priority queue to make this O(1)

  map<SIZE_T, Block, cache_compare_lessthan>::iterator oldestptr=blockmap.end();
  double oldest = curtime+1;

  // Only delete if the cache is full
  if (blockmap.size() < cachesize) {
    return ERROR_NOERROR;
  }

  // Find oldest

  for (map<SIZE_T, Block, cache_compare_lessthan>::iterator i=blockmap.begin();
	 i!=blockmap.end();
	 ++i) {
       if ((*i).second.lastaccessed<oldest) { 
	 oldestptr=i;
	 oldest=(*i).second.lastaccessed;
       }
  }
  
  // write and delete it if it exists
 
  if (oldestptr!=blockmap.end()) { 
    if ((*oldestptr).second.dirty) {
      double reqtime;
      int rc=disk->Write((*oldestptr).first,
			 (*oldestptr).second,
			 reqtime);
      curtime+=reqtime;
      diskwrites++;
      if (rc!=ERROR_NOERROR) { 
	return rc;
      }
    }
    blockmap.erase(oldestptr);
  }
  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl 0x8(%rdi), %eax
xorl %ebp, %ebp
cmpq %rax, 0x38(%rdi)
jb 0x4a3d
movq %rdi, %rbx
leaq 0x18(%rdi), %r12
movq 0x28(%rdi), %rax
cmpq %r12, %rax
je 0x4a3d
leaq 0x10(%rbx), %r14
movsd 0x40(%rbx), %xmm0
addsd 0x4c30(%rip), %xmm0     # 0x95f8
movq %r12, %r15
movsd 0x40(%rax), %xmm1
ucomisd %xmm1, %xmm0
cmovaq %rax, %r15
minsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq %rax, %rdi
callq 0x2140
movsd (%rsp), %xmm0
cmpq %r12, %rax
jne 0x49cb
cmpq %r12, %r15
je 0x4a3d
cmpb $0x1, 0x48(%r15)
jne 0x4a30
movq (%rbx), %rdi
movl 0x20(%r15), %esi
leaq 0x28(%r15), %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rcx
callq 0x4140
movl %eax, %ebp
movsd (%r12), %xmm0
addsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%rbx)
incl 0x5c(%rbx)
testl %eax, %eax
jne 0x4a3d
movq %r14, %rdi
movq %r15, %rsi
callq 0x50c8
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/buffercache.cc
// Function: BufferCache::Detach()
ERROR_T BufferCache::Detach()
{
  // write out all of our data and then throw it away

  for (map<SIZE_T, Block, cache_compare_lessthan>::iterator i=blockmap.begin();
	 i!=blockmap.end();
	 ++i) {
    if ((*i).second.dirty) { 
      double reqtime;
      int rc=disk->Write((*i).first,
			 (*i).second,
			 reqtime);
      curtime+=reqtime;
      diskwrites++;
      if (rc!=ERROR_NOERROR) { 
	return rc;
      }
    }
  }
  blockmap.clear();
  return ERROR_NOERROR;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
leaq 0x18(%rdi), %r12
cmpq %r12, %r14
je 0x4b0f
movq %rsp, %r15
cmpb $0x1, 0x48(%r14)
jne 0x4aff
movq (%rbx), %rdi
movl 0x20(%r14), %esi
leaq 0x28(%r14), %rdx
movq %r15, %rcx
callq 0x4140
movsd (%rsp), %xmm0
addsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%rbx)
incl 0x5c(%rbx)
testl %eax, %eax
jne 0x4b1d
movq %r14, %rdi
callq 0x2140
movq %rax, %r14
cmpq %r12, %rax
jne 0x4acf
addq $0x10, %rbx
movq %rbx, %rdi
callq 0x5104
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/buffercache.cc
// Function: BufferCache::ReadBlock(unsigned int, Block&)
ERROR_T BufferCache::ReadBlock(const SIZE_T inblocknum, Block &outblock) 
{
  map<SIZE_T, Block, cache_compare_lessthan>::iterator b;

  b = blockmap.find(inblocknum);

  if (b!=blockmap.end()) {
    // It's in  cache, just update its lastaccessed and return it
    outblock=(*b).second;
    (*b).second.lastaccessed=curtime;
    reads++;
    return ERROR_NOERROR;
  } else {
    // It's not in cache, so time to allocate it
    CheckDeleteOldest();
    // read it from disk
    if (!(disk->IsBlockAllocated(inblocknum))) { 
      if (PRINT_BUFFERCACHE_ALLOCATION_ERRORS) {
	cerr << "BufferCache::ReadBlock: Attempt to read unallocated block " << inblocknum<<endl;
      }
    }
    double reqtime;
    int rc = disk->Read(inblocknum,
			outblock,
			reqtime);
    curtime+=reqtime;
    diskreads++;
    if (rc!=ERROR_NOERROR) { 
      return rc;
    } else {
      outblock.lastaccessed=curtime;
      outblock.dirty=false;
      blockmap[inblocknum]=outblock;
      reads++;
      return ERROR_NOERROR;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x4bc1
leaq 0x18(%rbx), %rcx
movq %rcx, %r15
xorl %edx, %edx
cmpl %ebp, 0x20(%rax)
setb %dl
cmovaeq %rax, %r15
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x4ba0
cmpq %rcx, %r15
je 0x4bc1
cmpl %ebp, 0x20(%r15)
jbe 0x4c29
movq %rbx, %rdi
callq 0x4988
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x3f6a
movq (%rbx), %rdi
leaq 0x10(%rsp), %r15
movl %ebp, %esi
movq %r14, %rdx
movq %r15, %rcx
callq 0x40e2
movl %eax, %ebp
movsd (%r15), %xmm0
addsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%rbx)
incl 0x58(%rbx)
testl %eax, %eax
jne 0x4c45
leaq 0x10(%rbx), %rdi
movsd %xmm0, 0x18(%r14)
movb $0x0, 0x20(%r14)
leaq 0xc(%rsp), %rsi
callq 0x500a
movq %rax, %rdi
movq %r14, %rsi
callq 0x2e90
incl 0x50(%rbx)
jmp 0x4c45
leaq 0x28(%r15), %rsi
movq %r14, %rdi
callq 0x2e90
movsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%r15)
incl 0x50(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/buffercache.cc
// Function: BufferCache::WriteBlock(unsigned int, Block const&)
ERROR_T BufferCache::WriteBlock(const SIZE_T inblocknum, const Block &inblock)
{
  map<SIZE_T, Block, cache_compare_lessthan>::iterator b;
  
  b = blockmap.find(inblocknum);

  if (b!=blockmap.end()) {
    // It's in  cache, so just replace the block
    (*b).second=inblock;
    (*b).second.lastaccessed=curtime;
    (*b).second.dirty=true;
    writes++;
    return ERROR_NOERROR;
  } else {
    // It's not in cache, so time to allocate it
    CheckDeleteOldest();
    if (!(disk->IsBlockAllocated(inblocknum))) { 
      if (PRINT_BUFFERCACHE_ALLOCATION_ERRORS) {
	cerr << "BufferCache::WriteBlock: Attempt to write unallocated block " << inblocknum << endl;
      }
    }
    Block myblock=inblock;
    myblock.lastaccessed=curtime;
    myblock.dirty=true;
    blockmap[inblocknum]=myblock;
    writes++;
    return ERROR_NOERROR;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x4c9b
leaq 0x18(%rbx), %rcx
movq %rcx, %r15
xorl %edx, %edx
cmpl %ebp, 0x20(%rax)
setb %dl
cmovaeq %rax, %r15
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x4c7a
cmpq %rcx, %r15
je 0x4c9b
cmpl %ebp, 0x20(%r15)
jbe 0x4d09
leaq 0x10(%rbx), %r15
movq %rbx, %rdi
callq 0x4988
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x3f6a
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x2d24
movsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x18(%r12)
movb $0x1, 0x20(%r12)
leaq 0x4(%rsp), %rsi
movq %r15, %rdi
callq 0x500a
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x2e90
incl 0x54(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x2e26
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28(%r15), %rdi
movq %r14, %rsi
callq 0x2e90
movsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%r15)
movb $0x1, 0x48(%r15)
incl 0x54(%rbx)
jmp 0x4cfa
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2e26
movq %rbx, %rdi
callq 0x2370
nop
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/btree.cc
// Function: BTreeIndex::BTreeIndex(unsigned int, unsigned int, BufferCache*, bool)
BTreeIndex::BTreeIndex(SIZE_T keysize, 
 SIZE_T valuesize,
 BufferCache *cache,
 bool unique) 
{
  superblock.info.keysize=keysize;
  superblock.info.valuesize=valuesize;
  buffercache=cache;
  // note: ignoring unique now

  //Calculate maximum number of keys per bllock
  SIZE_T blockSize = buffercache->GetBlockSize();
  maxNumKeys = (blockSize - sizeof(NodeMetadata))/(16);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x887e(%rip), %rax      # 0xdd80
movq %rax, (%rdi)
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x7c4a
movl %r12d, 0x1c(%rbx)
movl %ebp, 0x20(%rbx)
movq %r15, 0x8(%rbx)
movq %r15, %rdi
callq 0x4b3c
movl %eax, %eax
movabsq $0xfffffffe4, %rcx      # imm = 0xFFFFFFFE4
addq %rax, %rcx
shrq $0x4, %rcx
movl %ecx, 0x40(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x7c5a
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/btree.cc
// Function: BTreeIndex::AllocateNode(unsigned int&)
ERROR_T BTreeIndex::AllocateNode(SIZE_T &n)
{
  n=superblock.info.freelist;

  if (n==0) { 
    return ERROR_NOSPACE;
  }

  BTreeNode node;

  node.Unserialize(buffercache,n);

  assert(node.info.nodetype==BTREE_UNALLOCATED_BLOCK);

  superblock.info.freelist=node.info.freelist;

  superblock.Serialize(buffercache,superblock_index);

  buffercache->NotifyAllocateBlock(n);

  return ERROR_NOERROR;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl 0x2c(%rdi), %eax
movl %eax, (%rsi)
testl %eax, %eax
je 0x5678
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7c4a
movq 0x8(%r14), %rsi
movl (%rbx), %edx
movq %r15, %rdi
callq 0x7e00
cmpl $0x0, 0x8(%rsp)
jne 0x5687
leaq 0x18(%r14), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x2c(%r14)
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
callq 0x7d3a
movq 0x8(%r14), %rdi
movl (%rbx), %esi
callq 0x4b52
leaq 0x8(%rsp), %rdi
callq 0x7c5a
xorl %eax, %eax
jmp 0x567d
movl $0xfffffff9, %eax       # imm = 0xFFFFFFF9
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x401a(%rip), %rdi      # 0x96a8
leaq 0x403f(%rip), %rsi      # 0x96d4
leaq 0x4041(%rip), %rcx      # 0x96dd
movl $0x52, %edx
callq 0x2110
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7c5a
movq %rbx, %rdi
callq 0x2370
nop
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/btree.cc
// Function: BTreeIndex::DeallocateNode(unsigned int const&)
ERROR_T BTreeIndex::DeallocateNode(const SIZE_T &n)
{
  BTreeNode node;

  node.Unserialize(buffercache,n);

  assert(node.info.nodetype!=BTREE_UNALLOCATED_BLOCK);

  node.info.nodetype=BTREE_UNALLOCATED_BLOCK;

  node.info.freelist=superblock.info.freelist;

  node.Serialize(buffercache,n);

  superblock.info.freelist=n;

  superblock.Serialize(buffercache,superblock_index);

  buffercache->NotifyDeallocateBlock(n);

  return ERROR_NOERROR;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7c4a
movq 0x8(%r14), %rsi
movl (%rbx), %edx
movq %r15, %rdi
callq 0x7e00
cmpl $0x0, 0x8(%rsp)
je 0x5742
leaq 0x8(%rsp), %rdi
movl $0x0, (%rdi)
movl 0x2c(%r14), %eax
movl %eax, 0x14(%rdi)
movq 0x8(%r14), %rsi
movl (%rbx), %edx
callq 0x7d3a
leaq 0x18(%r14), %rdi
movl (%rbx), %eax
movl %eax, 0x2c(%r14)
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
callq 0x7d3a
movq 0x8(%r14), %rdi
movl (%rbx), %esi
callq 0x4b62
leaq 0x8(%rsp), %rdi
callq 0x7c5a
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3fbf(%rip), %rdi      # 0x9708
leaq 0x3f84(%rip), %rsi      # 0x96d4
leaq 0x3fdd(%rip), %rcx      # 0x9734
movl $0x64, %edx
callq 0x2110
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7c5a
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/btree.cc
// Function: BTreeIndex::Display(std::ostream&, BTreeDisplayType) const
ERROR_T BTreeIndex::Display(ostream &o, BTreeDisplayType display_type) const
{
  ERROR_T rc;
  if (display_type==BTREE_DEPTH_DOT) { 
    o << "digraph tree { \n";
  }
  rc=DisplayInternal(superblock.info.rootnode,o,display_type);
  if (display_type==BTREE_DEPTH_DOT) { 
    o << "}\n";
  }
  return ERROR_NOERROR;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x1, %edx
jne 0x74a7
leaq 0x2361(%rip), %rsi      # 0x97d1
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2230
leaq 0x28(%r14), %rsi
movq %r14, %rdi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x6e54
leaq 0x234a(%rip), %rsi      # 0x97e2
movl $0x2, %edx
movq %rbx, %rdi
callq 0x2230
jmp 0x74b8
movl %edx, %ecx
leaq 0x28(%r14), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6e54
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/btree_ds.cc
// Function: NodeMetadata::Print(std::ostream&) const
ostream & NodeMetadata::Print(ostream &os) const 
{
  os << "NodeMetaData(nodetype="<<(nodetype==BTREE_UNALLOCATED_BLOCK ? "UNALLOCATED_BLOCK" :
				   nodetype==BTREE_SUPERBLOCK ? "SUPERBLOCK" :
				   nodetype==BTREE_ROOT_NODE ? "ROOT_NODE" :
				   nodetype==BTREE_INTERIOR_NODE ? "INTERIOR_NODE" :
				   nodetype==BTREE_LEAF_NODE ? "LEAF_NODE" : "UNKNOWN_TYPE")
     << ", keysize="<<keysize<<", valuesize="<<valuesize<<", blocksize="<<blocksize
     << ", rootnode="<<rootnode<<", freelist="<<freelist<<", numkeys="<<numkeys<<")";
  return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1e16(%rip), %rsi      # 0x9922
movl $0x16, %edx
movq %rbx, %rdi
callq 0x2230
movl (%r14), %eax
cmpq $0x4, %rax
jae 0x7b32
leaq 0x2063(%rip), %rcx      # 0x9b8c
movslq (%rcx,%rax,4), %r15
addq %rcx, %r15
jmp 0x7b47
cmpl $0x4, %eax
leaq 0x1e20(%rip), %rax      # 0x995c
leaq 0x1e23(%rip), %r15      # 0x9966
cmoveq %rax, %r15
movq %r15, %rdi
callq 0x20a0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2230
leaq 0x1e0f(%rip), %rsi      # 0x9973
movl $0xa, %edx
movq %rbx, %rdi
callq 0x2230
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x1df7(%rip), %rsi      # 0x997e
movl $0xc, %edx
movq %rax, %rdi
callq 0x2230
movl 0x8(%r14), %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x1981(%rip), %rsi      # 0x952b
movl $0xc, %edx
movq %rax, %rdi
callq 0x2230
movl 0xc(%r14), %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x1dbe(%rip), %rsi      # 0x998b
movl $0xb, %edx
movq %rax, %rdi
callq 0x2230
movl 0x10(%r14), %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x1da7(%rip), %rsi      # 0x9997
movl $0xb, %edx
movq %rax, %rdi
callq 0x2230
movl 0x14(%r14), %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x1d90(%rip), %rsi      # 0x99a3
movl $0xa, %edx
movq %rax, %rdi
callq 0x2230
movl 0x18(%r14), %esi
movq %r15, %rdi
callq 0x2120
leaq 0x1b32(%rip), %rsi      # 0x9765
movl $0x1, %edx
movq %rax, %rdi
callq 0x2230
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::~BTreeNode()
BTreeNode::~BTreeNode()
{
  if (data) { 
    delete [] data;
  }
  data=0;
  info.nodetype=BTREE_UNALLOCATED_BLOCK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x7c6c
callq 0x2280
movq $0x0, 0x20(%rbx)
movl $0x0, (%rbx)
popq %rbx
retq