LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x54f3(%rip), %xmm1     # 0x9220
cvttsd2si %xmm1, %rax
movl %eax, %eax
xorps %xmm2, %xmm2
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
xorps %xmm3, %xmm3
cvtsi2sd %r8, %xmm3
minsd %xmm2, %xmm1
xorps %xmm2, %xmm2
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
xorps %xmm0, %xmm0
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_O1/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 0x4048
movq 0xa01a(%rip), %r15      # 0xdff0
leaq 0x5445(%rip), %rsi      # 0x9422
movl $0x2b, %edx
movq %r15, %rdi
callq 0x2230
movl %r14d, %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x53dc(%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 0x53bc(%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 0x40c6
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 0x40a2
movl %r13d, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %r12
xorl %r13d, %r13d
movq 0x10(%rbx), %rdi
movl 0x50(%rbx), %ecx
movl %ecx, %esi
imull %r14d, %esi
addl 0x48(%rbx), %esi
movq (%r15), %rax
movq 0x8(%rax,%r13), %rdx
callq 0x3b78
cmpl 0x50(%rbx), %eax
jne 0x40a6
addq $0x28, %r13
incl %r14d
cmpq %r13, %r12
jne 0x4074
xorl %ebx, %ebx
jmp 0x40ed
movq 0x9f43(%rip), %r14      # 0xdff0
leaq 0x539a(%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
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3dbc
movl %eax, %ebp
testl %eax, %eax
jne 0x4139
xorl %ebp, %ebp
movq (%rsp), %rsi
movq %rbx, %rdi
callq 0x2eae
movq %rsp, %rdi
callq 0x462e
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x462e
movq %rbx, %rdi
callq 0x2370
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x428a
movq 0x9dff(%rip), %r12      # 0xdff0
leaq 0x527c(%rip), %rsi      # 0x9474
movl $0x35, %edx
movq %r12, %rdi
callq 0x2230
movl %r14d, %esi
movq %r12, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x51c1(%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 0x526b(%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 0x42b7
xorl %eax, %eax
cmpl %r14d, %r15d
jbe 0x42b7
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 0x4291
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4380
movq 0x9d09(%rip), %r12      # 0xdff0
leaq 0x51d3(%rip), %rsi      # 0x94c1
movl $0x39, %edx
movq %r12, %rdi
callq 0x2230
movl %r14d, %esi
movq %r12, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x50cb(%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 0x5175(%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 0x43b0
xorl %eax, %eax
cmpl %r14d, %r15d
jbe 0x43b0
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 0x4387
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
subq $0x18, %rsp
movl 0x8(%rdi), %eax
xorl %ebp, %ebp
cmpq %rax, 0x38(%rdi)
jb 0x4a23
movq %rdi, %rbx
leaq 0x18(%rdi), %r15
movq 0x28(%rdi), %rax
movq %r15, %r14
cmpq %r15, %rax
je 0x49d6
movsd 0x40(%rbx), %xmm0
addsd 0x4c4f(%rip), %xmm0     # 0x95f8
movq %r15, %r14
movsd 0x40(%rax), %xmm1
ucomisd %xmm1, %xmm0
cmovaq %rax, %r14
minsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq %rax, %rdi
callq 0x2140
movsd 0x8(%rsp), %xmm0
cmpq %r15, %rax
jne 0x49ac
cmpq %r15, %r14
je 0x4a23
cmpb $0x1, 0x48(%r14)
jne 0x4a12
movq (%rbx), %rdi
movl 0x20(%r14), %esi
leaq 0x28(%r14), %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rcx
callq 0x415e
movl %eax, %ebp
movsd (%r15), %xmm0
addsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%rbx)
incl 0x5c(%rbx)
testl %eax, %eax
jne 0x4a23
addq $0x10, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50ea
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
leaq 0x18(%rdi), %r12
cmpq %r12, %r14
sete %r13b
je 0x4b03
movq %rsp, %r15
cmpb $0x1, 0x48(%r14)
jne 0x4aed
movq (%rbx), %rdi
movl 0x20(%r14), %esi
leaq 0x28(%r14), %rdx
movq %r15, %rcx
callq 0x415e
movsd (%rsp), %xmm0
addsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%rbx)
incl 0x5c(%rbx)
testl %eax, %eax
cmovnel %eax, %ebp
jne 0x4b03
movq %r14, %rdi
callq 0x2140
movq %rax, %r14
cmpq %r12, %rax
sete %r13b
jne 0x4aba
jmp 0x4b03
testb $0x1, %r13b
je 0x4b17
addq $0x10, %rbx
movq %rbx, %rdi
callq 0x5126
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
movq 0x20(%rdi), %rdx
leaq 0x18(%rdi), %rax
movq %rax, %rcx
testq %rdx, %rdx
je 0x4bb5
movq %rax, %rcx
xorl %edi, %edi
cmpl %esi, 0x20(%rdx)
setb %dil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rdi,8), %rdx
testq %rdx, %rdx
jne 0x4b9e
movq %rax, %r15
cmpq %rax, %rcx
je 0x4bc7
cmpl %esi, 0x20(%rcx)
cmovaq %rax, %rcx
movq %rcx, %r15
cmpq %rax, %r15
je 0x4bea
leaq 0x28(%r15), %rsi
movq %r14, %rdi
callq 0x2eae
movsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%r15)
incl 0x50(%rbx)
xorl %eax, %eax
jmp 0x4c2b
movq %rbx, %rdi
callq 0x4970
movq (%rbx), %rdi
movl 0x4(%rsp), %esi
callq 0x3f8c
movq (%rbx), %rdi
movl 0x4(%rsp), %esi
leaq 0x8(%rsp), %r15
movq %r14, %rdx
movq %r15, %rcx
callq 0x40fe
movsd (%r15), %xmm0
addsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%rbx)
incl 0x58(%rbx)
testl %eax, %eax
je 0x4c35
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x10(%rbx), %rdi
movsd %xmm0, 0x18(%r14)
movb $0x0, 0x20(%r14)
leaq 0x4(%rsp), %rsi
callq 0x502e
movq %rax, %rdi
movq %r14, %rsi
callq 0x2eae
jmp 0x4be3
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
movq 0x20(%rdi), %rdx
leaq 0x18(%rdi), %rax
movq %rax, %rcx
testq %rdx, %rdx
je 0x4c9d
movq %rax, %rcx
xorl %edi, %edi
cmpl %esi, 0x20(%rdx)
setb %dil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rdi,8), %rdx
testq %rdx, %rdx
jne 0x4c86
movq %rax, %r15
cmpq %rax, %rcx
je 0x4caf
cmpl %esi, 0x20(%rcx)
cmovaq %rax, %rcx
movq %rcx, %r15
cmpq %rax, %r15
je 0x4cd5
leaq 0x28(%r15), %rdi
movq %r14, %rsi
callq 0x2eae
movsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%r15)
movb $0x1, 0x48(%r15)
incl 0x54(%rbx)
jmp 0x4d37
leaq 0x10(%rbx), %r15
movq %rbx, %rdi
callq 0x4970
movq (%rbx), %rdi
leaq 0x4(%rsp), %r12
movl (%r12), %esi
callq 0x3f8c
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x2d20
movsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x18(%r13)
movb $0x1, 0x20(%r13)
movq %r15, %rdi
movq %r12, %rsi
callq 0x502e
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x2eae
incl 0x54(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x2e22
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2e22
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/buffercache.cc
// Function: BufferCache::FlushBlock(unsigned int)
ERROR_T BufferCache::FlushBlock(const SIZE_T blocknum)
{
  map<SIZE_T, Block, cache_compare_lessthan>::iterator b;
  
  b = blockmap.find(blocknum);

  if (b==blockmap.end()) { 
    return ERROR_NOERROR;
  } else {
    if ((*b).second.dirty) { 
      double reqtime;
      int rc;
      rc=disk->Write((*b).first,
		     (*b).second,
		     reqtime);
      diskwrites++;
      curtime+=reqtime;
      if (rc!=ERROR_NOERROR) { 
	return rc;
      }
    }
    blockmap.erase(b);
    return ERROR_NOERROR;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x20(%rdi), %rdx
leaq 0x18(%rdi), %rcx
movq %rcx, %rax
testq %rdx, %rdx
je 0x4d98
movq %rcx, %rax
xorl %edi, %edi
cmpl %esi, 0x20(%rdx)
setb %dil
cmovaeq %rdx, %rax
movq 0x10(%rdx,%rdi,8), %rdx
testq %rdx, %rdx
jne 0x4d81
movq %rcx, %r14
cmpq %rcx, %rax
je 0x4daa
cmpl %esi, 0x20(%rax)
cmovaq %rcx, %rax
movq %rax, %r14
xorl %eax, %eax
cmpq %rcx, %r14
je 0x4df7
cmpb $0x1, 0x48(%r14)
jne 0x4de6
movq (%rbx), %rdi
movl 0x20(%r14), %esi
leaq 0x28(%r14), %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rcx
callq 0x415e
incl 0x5c(%rbx)
movsd (%r15), %xmm0
addsd 0x40(%rbx), %xmm0
movsd %xmm0, 0x40(%rbx)
testl %eax, %eax
jne 0x4df7
addq $0x10, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50ea
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x885a(%rip), %rax      # 0xdd80
movq %rax, (%rdi)
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x7d2a
movl %r12d, 0x1c(%rbx)
movl %ebp, 0x20(%rbx)
movq %r15, 0x8(%rbx)
movq %r15, %rdi
callq 0x4b3a
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 0x7d3a
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O1/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 0x569c
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7d2a
movq 0x8(%r14), %rsi
movl (%rbx), %edx
movq %r15, %rdi
callq 0x7eee
cmpl $0x0, 0x8(%rsp)
jne 0x56ab
leaq 0x18(%r14), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x2c(%r14)
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
callq 0x7e28
movq 0x8(%r14), %rdi
movl (%rbx), %esi
callq 0x4b50
leaq 0x8(%rsp), %rdi
callq 0x7d3a
xorl %eax, %eax
jmp 0x56a1
movl $0xfffffff9, %eax       # imm = 0xFFFFFFF9
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3fde(%rip), %rdi      # 0x9690
leaq 0x4003(%rip), %rsi      # 0x96bc
leaq 0x4005(%rip), %rcx      # 0x96c5
movl $0x52, %edx
callq 0x2110
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7d3a
movq %rbx, %rdi
callq 0x2370
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7d2a
movq 0x8(%r14), %rsi
movl (%rbx), %edx
movq %r15, %rdi
callq 0x7eee
cmpl $0x0, 0x8(%rsp)
je 0x5766
leaq 0x8(%rsp), %rdi
movl $0x0, (%rdi)
movl 0x2c(%r14), %eax
movl %eax, 0x14(%rdi)
movq 0x8(%r14), %rsi
movl (%rbx), %edx
callq 0x7e28
leaq 0x18(%r14), %rdi
movl (%rbx), %eax
movl %eax, 0x2c(%r14)
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
callq 0x7e28
movq 0x8(%r14), %rdi
movl (%rbx), %esi
callq 0x4b60
leaq 0x8(%rsp), %rdi
callq 0x7d3a
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3f83(%rip), %rdi      # 0x96f0
leaq 0x3f48(%rip), %rsi      # 0x96bc
leaq 0x3fa1(%rip), %rcx      # 0x971c
movl $0x64, %edx
callq 0x2110
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7d3a
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x1, %edx
jne 0x758a
leaq 0x2263(%rip), %rsi      # 0x97b9
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2230
leaq 0x28(%r14), %rsi
movq %r14, %rdi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x6f38
leaq 0x224f(%rip), %rsi      # 0x97ca
movl $0x2, %edx
movq %rbx, %rdi
callq 0x2230
jmp 0x759b
leaq 0x28(%r14), %rsi
movq %r14, %rdi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x6f38
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1d1e(%rip), %rsi      # 0x990a
movl $0x16, %edx
movq %rbx, %rdi
callq 0x2230
movl (%r14), %eax
cmpq $0x4, %rax
jae 0x7c12
leaq 0x1f6b(%rip), %rcx      # 0x9b74
movslq (%rcx,%rax,4), %r15
addq %rcx, %r15
jmp 0x7c27
cmpl $0x4, %eax
leaq 0x1d28(%rip), %rax      # 0x9944
leaq 0x1d2b(%rip), %r15      # 0x994e
cmoveq %rax, %r15
movq %r15, %rdi
callq 0x20a0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2230
leaq 0x1d17(%rip), %rsi      # 0x995b
movl $0xa, %edx
movq %rbx, %rdi
callq 0x2230
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x1cff(%rip), %rsi      # 0x9966
movl $0xc, %edx
movq %rax, %rdi
callq 0x2230
movl 0x8(%r14), %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x18a1(%rip), %rsi      # 0x952b
movl $0xc, %edx
movq %rax, %rdi
callq 0x2230
movl 0xc(%r14), %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x1cc6(%rip), %rsi      # 0x9973
movl $0xb, %edx
movq %rax, %rdi
callq 0x2230
movl 0x10(%r14), %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x1caf(%rip), %rsi      # 0x997f
movl $0xb, %edx
movq %rax, %rdi
callq 0x2230
movl 0x14(%r14), %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r15
leaq 0x1c98(%rip), %rsi      # 0x998b
movl $0xa, %edx
movq %rax, %rdi
callq 0x2230
movl 0x18(%r14), %esi
movq %r15, %rdi
callq 0x2120
leaq 0x1a3a(%rip), %rsi      # 0x974d
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_O1/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 0x7d4c
callq 0x2280
movq $0x0, 0x20(%rbx)
movl $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::BTreeNode(int, unsigned int, unsigned int, unsigned int)
BTreeNode::BTreeNode(int node_type, SIZE_T key_size, SIZE_T value_size, SIZE_T block_size)
{
  info.nodetype=node_type;
  info.keysize=key_size;
  info.valuesize=value_size;
  info.blocksize=block_size;
  info.rootnode=0;
  info.freelist=0;
  info.numkeys=0;				       
  data=0;
  if (info.nodetype!=BTREE_UNALLOCATED_BLOCK && info.nodetype!=BTREE_SUPERBLOCK) {
    data = new char [info.GetNumDataBytes()];
    memset(data,0,info.GetNumDataBytes());
  }
}

// Assembly:
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
movl %r8d, 0xc(%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movl $0x0, 0x18(%rdi)
movq %rax, 0x20(%rdi)
cmpl $0x2, %esi
jae 0x7d7f
retq
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebx
movq %rdi, %r14
addl $-0x1c, %ebx
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x20(%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20f0
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::BTreeNode(BTreeNode const&)
BTreeNode::BTreeNode(const BTreeNode &rhs) 
{
  info.nodetype=rhs.info.nodetype;
  info.keysize=rhs.info.keysize;
  info.valuesize=rhs.info.valuesize;
  info.blocksize=rhs.info.blocksize;
  info.rootnode=rhs.info.rootnode;
  info.freelist=rhs.info.freelist;
  info.numkeys=rhs.info.numkeys;				       
  data=0;
  if (rhs.data) { 
   data=new char [info.GetNumDataBytes()];
    memcpy(data,rhs.data,info.GetNumDataBytes());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl (%rsi), %eax
movl %eax, (%rdi)
movl 0x4(%rsi), %eax
movl %eax, 0x4(%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
movl 0xc(%rsi), %r15d
movl %r15d, 0xc(%rdi)
movl 0x10(%rsi), %eax
movl %eax, 0x10(%rdi)
movl 0x14(%rsi), %eax
movl %eax, 0x14(%rdi)
movl 0x18(%rsi), %eax
movl %eax, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
cmpq $0x0, 0x20(%rsi)
je 0x7e14
movq %rsi, %rbx
movq %rdi, %r14
addl $-0x1c, %r15d
movq %r15, %rdi
callq 0x2030
movq %rax, 0x20(%r14)
movq 0x20(%rbx), %rsi
movq %rax, %rdi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x2170
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::Serialize(BufferCache*, unsigned int) const
ERROR_T BTreeNode::Serialize(BufferCache *b, const SIZE_T blocknum) const
{
  assert((unsigned)info.blocksize==b->GetBlockSize());

  Block block(sizeof(info)+info.GetNumDataBytes());

  memcpy(block.data,&info,sizeof(info));
  if (info.nodetype!=BTREE_UNALLOCATED_BLOCK && info.nodetype!=BTREE_SUPERBLOCK) { 
    memcpy(block.data+sizeof(info),data,info.GetNumDataBytes());
  }

  return b->WriteBlock(blocknum,block);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl 0xc(%rdi), %ebp
movq %rsi, %rdi
callq 0x4b3a
cmpl %eax, %ebp
jne 0x7eba
movl 0xc(%r15), %esi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x2c80
movq 0x8(%r12), %rax
movups (%r15), %xmm0
movups 0xc(%r15), %xmm1
movups %xmm1, 0xc(%rax)
movups %xmm0, (%rax)
cmpl $0x2, (%r15)
jb 0x7e90
movq 0x10(%rsp), %rdi
addq $0x1c, %rdi
movq 0x20(%r15), %rsi
movl 0xc(%r15), %edx
addl $-0x1c, %edx
callq 0x2170
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x4c5c
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x2e22
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ad5(%rip), %rdi      # 0x9996
leaq 0x1afa(%rip), %rsi      # 0x99c2
leaq 0x1aff(%rip), %rcx      # 0x99ce
movl $0x64, %edx
callq 0x2110
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2e22
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::Unserialize(BufferCache*, unsigned int)
ERROR_T  BTreeNode::Unserialize(BufferCache *b, const SIZE_T blocknum)
{
  Block block;

  ERROR_T rc;

  rc=b->ReadBlock(blocknum,block);

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

  memcpy(&info,block.data,sizeof(info));
  
  if (data) { 
    delete [] data;
    data=0;
  }

  assert(b->GetBlockSize()==(unsigned)info.blocksize);

  if (info.nodetype!=BTREE_UNALLOCATED_BLOCK && info.nodetype!=BTREE_SUPERBLOCK) {
    data = new char [info.GetNumDataBytes()];
    memcpy(data,block.data+sizeof(info),info.GetNumDataBytes());
  }
  
  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
movq %r15, %rdi
callq 0x2c54
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x4b78
movl %eax, %ebp
testl %eax, %eax
jne 0x7f83
movq 0x8(%rsp), %rax
movups (%rax), %xmm0
movups 0xc(%rax), %xmm1
movups %xmm1, 0xc(%rbx)
movups %xmm0, (%rbx)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x7f47
callq 0x2280
movq $0x0, 0x20(%rbx)
movq %r14, %rdi
callq 0x4b3a
movl 0xc(%rbx), %r14d
cmpl %r14d, %eax
jne 0x7f98
xorl %ebp, %ebp
cmpl $0x2, (%rbx)
jb 0x7f83
addl $-0x1c, %r14d
movq %r14, %rdi
callq 0x2030
movq %rax, 0x20(%rbx)
movq 0x8(%rsp), %rsi
addq $0x1c, %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x2170
movq %rsp, %rdi
callq 0x2e22
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a6f(%rip), %rdi      # 0x9a0e
leaq 0x1a1c(%rip), %rsi      # 0x99c2
leaq 0x1a8d(%rip), %rcx      # 0x9a3a
movl $0x84, %edx
callq 0x2110
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2e22
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::ResolveKey(unsigned int) const
char * BTreeNode::ResolveKey(const SIZE_T offset) const
{
  switch (info.nodetype) { 
  case BTREE_INTERIOR_NODE:
  case BTREE_ROOT_NODE:
    assert(offset<info.numkeys);
    return data+sizeof(SIZE_T)+offset*(sizeof(SIZE_T)+info.keysize);
    break;
  case BTREE_LEAF_NODE:
    assert(offset<info.numkeys);
    return data+sizeof(SIZE_T)+offset*(info.keysize+info.valuesize);
    break;
  default:
    return 0;
  }
}

// Assembly:
pushq %rax
movl (%rdi), %eax
leal -0x2(%rax), %ecx
cmpl $0x2, %ecx
jae 0x7ff4
cmpl %esi, 0x18(%rdi)
jbe 0x8018
movq 0x20(%rdi), %rax
movl %esi, %ecx
movl 0x4(%rdi), %edx
addq $0x4, %rdx
imulq %rcx, %rdx
addq %rdx, %rax
addq $0x4, %rax
jmp 0x8016
cmpl $0x4, %eax
jne 0x8014
cmpl %esi, 0x18(%rdi)
jbe 0x8037
movq 0x20(%rdi), %rax
movl 0x8(%rdi), %ecx
addl 0x4(%rdi), %ecx
imull %esi, %ecx
addq %rcx, %rax
addq $0x4, %rax
jmp 0x8016
xorl %eax, %eax
popq %rcx
retq
leaq 0x1a57(%rip), %rdi      # 0x9a76
leaq 0x199c(%rip), %rsi      # 0x99c2
leaq 0x1a5d(%rip), %rcx      # 0x9a8a
movl $0x94, %edx
callq 0x2110
leaq 0x1a38(%rip), %rdi      # 0x9a76
leaq 0x197d(%rip), %rsi      # 0x99c2
leaq 0x1a3e(%rip), %rcx      # 0x9a8a
movl $0x98, %edx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::ResolvePtr(unsigned int) const
char * BTreeNode::ResolvePtr(const SIZE_T offset) const
{
  switch (info.nodetype) { 
  case BTREE_INTERIOR_NODE:
  case BTREE_ROOT_NODE:
    assert(offset<=info.numkeys);
    return data+offset*(sizeof(SIZE_T)+info.keysize);
    break;
  case BTREE_LEAF_NODE:
    assert(offset==0);
    return data;
    break;
  default:
    return 0;
  }
}

// Assembly:
pushq %rax
movl (%rdi), %eax
leal -0x2(%rax), %ecx
cmpl $0x2, %ecx
jae 0x8079
cmpl %esi, 0x18(%rdi)
jb 0x808c
movl %esi, %ecx
movl 0x4(%rdi), %eax
addq $0x4, %rax
imulq %rcx, %rax
addq 0x20(%rdi), %rax
jmp 0x808a
cmpl $0x4, %eax
jne 0x8088
testl %esi, %esi
jne 0x80ab
movq 0x20(%rdi), %rax
jmp 0x808a
xorl %eax, %eax
popq %rcx
retq
leaq 0x1a27(%rip), %rdi      # 0x9aba
leaq 0x1928(%rip), %rsi      # 0x99c2
leaq 0x1a2e(%rip), %rcx      # 0x9acf
movl $0xa6, %edx
callq 0x2110
leaq 0x1a4d(%rip), %rdi      # 0x9aff
leaq 0x1909(%rip), %rsi      # 0x99c2
leaq 0x1a0f(%rip), %rcx      # 0x9acf
movl $0xaa, %edx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::ResolveVal(unsigned int) const
char * BTreeNode::ResolveVal(const SIZE_T offset) const
{
  switch (info.nodetype) { 
  case BTREE_LEAF_NODE:
    assert(offset<info.numkeys);
    return data+sizeof(SIZE_T)+offset*(info.keysize+info.valuesize)+info.keysize;
    break;
  default:
    return 0;
  }
}

// Assembly:
cmpl $0x4, (%rdi)
jne 0x80eb
cmpl %esi, 0x18(%rdi)
jbe 0x80ee
movl 0x4(%rdi), %eax
movl 0x8(%rdi), %ecx
addl %eax, %ecx
imull %esi, %ecx
addq 0x20(%rdi), %rcx
addq %rcx, %rax
addq $0x4, %rax
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x1980(%rip), %rdi      # 0x9a76
leaq 0x18c5(%rip), %rsi      # 0x99c2
leaq 0x1a05(%rip), %rcx      # 0x9b09
movl $0xb8, %edx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::GetKey(unsigned int, Block&) const
ERROR_T BTreeNode::GetKey(const SIZE_T offset, KEY_T &k) const
{
  char *p=ResolveKey(offset);

  if (p==0) { 
    return ERROR_NOMEM;
  }
  
  k.Resize(info.keysize,false);
  memcpy(k.data,p,info.keysize);
  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
callq 0x7fca
testq %rax, %rax
je 0x8150
movq %rax, %r15
movl 0x4(%r14), %esi
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2cb6
movq 0x8(%rbx), %rdi
movl 0x4(%r14), %edx
movq %r15, %rsi
callq 0x2170
jmp 0x8155
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::GetVal(unsigned int, Block&) const
ERROR_T BTreeNode::GetVal(const SIZE_T offset, VALUE_T &v) const
{
  char *p=ResolveVal(offset);

  if (p==0) { 
    return ERROR_NOMEM;
  }
  
  v.Resize(info.valuesize,false);
  memcpy(v.data,p,info.valuesize);
  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
callq 0x80ca
testq %rax, %rax
je 0x81bc
movq %rax, %r15
movl 0x8(%r14), %esi
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2cb6
movq 0x8(%rbx), %rdi
movl 0x8(%r14), %edx
movq %r15, %rsi
callq 0x2170
jmp 0x81c1
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/btree_ds.cc
// Function: BTreeNode::SetKeyVal(unsigned int, KeyValuePair const&)
ERROR_T BTreeNode::SetKeyVal(const SIZE_T offset, const KeyValuePair &p)
{
  ERROR_T rc=SetKey(offset,p.key);

  if (rc!=ERROR_NOERROR) { 
    return rc;
  } else {
    return SetVal(offset,p.value);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x7fca
movq %rax, %r15
testq %rax, %rax
je 0x82bc
movq 0x10(%rbx), %rsi
movl 0x4(%r14), %edx
movq %r15, %rdi
callq 0x2170
xorl %eax, %eax
jmp 0x82c1
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testq %r15, %r15
je 0x82ee
movq %r14, %rdi
movl %ebp, %esi
callq 0x80ca
testq %rax, %rax
je 0x82e9
movq 0x38(%rbx), %rsi
movl 0x8(%r14), %edx
movq %rax, %rdi
callq 0x2170
xorl %eax, %eax
jmp 0x82ee
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/It4innovations[P]Handicap/src/GraphLabelings/../Solvers/kSumProblemSolver.h
// Function: kSumProblemSolver<int>::solve2SUM(std::unique_ptr<int [], std::default_delete<int []>> const&, std::stack<int, std::deque<int, std::allocator<int>>>&)
void solve2SUM(const std::unique_ptr<T[]> & labels, std::stack<T> & solution) {
			int sum = 0, lhs = 0, rhs = this->labelsCount - 1;
			while (lhs < rhs) {
				sum = labels[lhs] + labels[rhs];
				if (sum < this->searchNumber) {
					lhs += 1;
				} else if (sum > this->searchNumber) {
					rhs -= 1;
				} else {
					solution.emplace(labels[lhs]);
					solution.emplace(labels[rhs]);
					rhs -= 1;
					lhs += 1;
				}
			}
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %ebp
cmpl $0x2, %ebp
jl 0x2c0a
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
decl %ebp
xorl %r13d, %r13d
movslq %r13d, %rax
movq (%r14), %rcx
movl (%rcx,%rax,4), %edx
movslq %ebp, %r12
movl (%rcx,%r12,4), %esi
addl %edx, %esi
cmpl 0x4(%r15), %esi
jl 0x2bfe
jle 0x2ba0
decl %ebp
jmp 0x2c01
movq 0x30(%rbx), %rsi
movq 0x40(%rbx), %rdi
addq $-0x4, %rdi
cmpq %rdi, %rsi
je 0x2bbd
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x2bc9
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdi
callq 0x4ba6
shlq $0x2, %r12
addq (%r14), %r12
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x2bf1
movl (%r12), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%rbx)
jmp 0x2bfc
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4ba6
decl %ebp
incl %r13d
cmpl %ebp, %r13d
jl 0x2b82
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/It4innovations[P]Handicap/src/GraphLabelings/../Solvers/kSumProblemSolver.h
// Function: kSumProblemSolver<int>::solve3SUM(std::unique_ptr<int [], std::default_delete<int []>> const&, std::stack<int, std::deque<int, std::allocator<int>>>&)
void solve3SUM(const std::unique_ptr<T[]> & labels, std::stack<T> & solution) {
			int sum, lhs, rhs, searchWeight;
			for (int i = labelsCount - 1; i >= 2; --i) {
				lhs = 0;
				rhs = i - 1;
				searchWeight = searchNumber - labels[i];
				if (searchWeight <= 0) continue;
				while (lhs < rhs) {
					sum = labels[lhs] + labels[rhs];
					if (sum < searchWeight) {
						lhs += 1;
					} else if (sum > searchWeight) {
						rhs -= 1;
					} else {
						solution.emplace(labels[lhs]);
						solution.emplace(labels[rhs]);
						solution.emplace(labels[i]);
						rhs -= 1;
						lhs += 1;
					}
				}
			}
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movslq (%rdi), %rcx
cmpq $0x3, %rcx
jl 0x2d50
movq %rdx, %rbx
movq %rsi, %r14
leaq -0x1(%rcx), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movl 0x4(%rax), %r15d
movq (%r14), %rax
movq %rcx, 0x10(%rsp)
subl -0x4(%rax,%rcx,4), %r15d
jle 0x2d3f
movq 0x10(%rsp), %rax
leal -0x2(%rax), %ebp
xorl %r13d, %r13d
movq 0x8(%rsp), %rax
leaq (,%rax,4), %rax
movq %rax, 0x20(%rsp)
movslq %r13d, %rax
movq (%r14), %rcx
movl (%rcx,%rax,4), %edx
movslq %ebp, %r12
movl (%rcx,%r12,4), %esi
addl %edx, %esi
cmpl %r15d, %esi
jl 0x2d33
jle 0x2ca6
decl %ebp
jmp 0x2d36
movq 0x30(%rbx), %rsi
movq 0x40(%rbx), %rdi
addq $-0x4, %rdi
cmpq %rdi, %rsi
je 0x2cc3
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x2ccf
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdi
callq 0x4ba6
shlq $0x2, %r12
addq (%r14), %r12
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x2cf7
movl (%r12), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%rbx)
jmp 0x2d02
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4ba6
movq (%r14), %rsi
addq 0x20(%rsp), %rsi
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x2d29
movl (%rsi), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%rbx)
jmp 0x2d31
movq %rbx, %rdi
callq 0x4ba6
decl %ebp
incl %r13d
cmpl %ebp, %r13d
jl 0x2c82
cmpq $0x3, 0x10(%rsp)
movq 0x8(%rsp), %rcx
jg 0x2c40
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/It4innovations[P]Handicap/src/GraphLabelings/../Solvers/kSumProblemSolver.h
// Function: kSumProblemSolver<int>::solve4SUM(std::unique_ptr<int [], std::default_delete<int []>> const&, std::stack<int, std::deque<int, std::allocator<int>>>&)
void solve4SUM(const std::unique_ptr<T[]> & labels, std::stack<T> & solution) {
			int sum, lhs, rhs, searchWeight;
			for (int i = labelsCount - 1; i >= 3; --i) {
				for (int j = i - 1; j >= 2; --j) {
					lhs = 0;
					rhs = j - 1;
					searchWeight = searchNumber - labels[i] - labels[j];
					if (searchWeight <= 0) continue;
					while (lhs < rhs) {
						sum = labels[lhs] + labels[rhs];
						if (sum < searchWeight) {
							lhs += 1;
						} else if (sum > searchWeight) {
							rhs -= 1;
						} else {
							solution.emplace(labels[lhs]);
							solution.emplace(labels[rhs]);
							solution.emplace(labels[j]);
							solution.emplace(labels[i]);
							rhs -= 1;
							lhs += 1;
						}
					}
				}
			}
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movslq (%rdi), %rcx
movq %rcx, 0x8(%rsp)
cmpq $0x4, %rcx
jl 0x2f15
movq %rdx, %rbx
movq %rsi, %r14
movq 0x8(%rsp), %rax
leal -0x2(%rax), %ecx
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
decq %rax
movq %rax, 0x8(%rsp)
movq %rcx, 0x28(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x10(%rsp), %rdx
leaq -0x1(%rdx), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movl 0x4(%rax), %r15d
movq (%r14), %rax
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movq %rdx, 0x18(%rsp)
addl (%rax,%rdx,4), %ecx
subl %ecx, %r15d
testl %r15d, %r15d
jle 0x2ef6
cmpl $0x2, 0x18(%rsp)
jl 0x2ef6
xorl %r13d, %r13d
movq 0x10(%rsp), %rax
movl %eax, %ebp
movslq %r13d, %rax
movq (%r14), %rcx
movl (%rcx,%rax,4), %edx
movslq %ebp, %r12
movl (%rcx,%r12,4), %esi
addl %edx, %esi
cmpl %r15d, %esi
jl 0x2eea
jle 0x2e1e
decl %ebp
jmp 0x2eed
movq 0x30(%rbx), %rsi
movq 0x40(%rbx), %rdi
addq $-0x4, %rdi
cmpq %rdi, %rsi
je 0x2e3b
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x2e47
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdi
callq 0x4ba6
shlq $0x2, %r12
addq (%r14), %r12
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x2e6f
movl (%r12), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%rbx)
jmp 0x2e7a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4ba6
movq 0x18(%rsp), %rax
leaq (,%rax,4), %rsi
addq (%r14), %rsi
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x2ea9
movl (%rsi), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%rbx)
jmp 0x2eb1
movq %rbx, %rdi
callq 0x4ba6
movq 0x8(%rsp), %rax
leaq (,%rax,4), %rsi
addq (%r14), %rsi
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x2ee0
movl (%rsi), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%rbx)
jmp 0x2ee8
movq %rbx, %rdi
callq 0x4ba6
decl %ebp
incl %r13d
cmpl %ebp, %r13d
jl 0x2dfa
cmpl $0x2, 0x18(%rsp)
jg 0x2daf
movq 0x28(%rsp), %rcx
decq %rcx
cmpq $0x4, 0x20(%rsp)
jg 0x2d93
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq