LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::SanityCheckConfig()
ERROR_T DiskSystem::SanityCheckConfig()
{
  if (averageseeklatency<=0 || trackseeklatency<=0 || rotationallatency<=0) { 
    cerr << "Impossible performance.\n";
    return ERROR_BADCONFIG;
  }
  if (numblocks != (numheads*blockspertrack*numtracks)) {
    cerr << "Geometry mismatch.\n";
    return ERROR_BADCONFIG;
  }

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
xorps %xmm0, %xmm0
ucomisd 0x68(%rax), %xmm0
jae 0x569a
movq -0x18(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd 0x70(%rax), %xmm0
jae 0x569a
movq -0x18(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd 0x78(%rax), %xmm0
jb 0x56b6
movq 0x1194f(%rip), %rdi     # 0x16ff0
leaq 0xab98(%rip), %rsi      # 0x10240
callq 0x31f0
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x56ef
movq -0x18(%rbp), %rdx
movl 0x4c(%rdx), %eax
movl 0x54(%rdx), %ecx
imull 0x58(%rdx), %ecx
imull 0x5c(%rdx), %ecx
cmpl %ecx, %eax
je 0x56e8
movq 0x1191d(%rip), %rdi     # 0x16ff0
leaq 0xab7f(%rip), %rsi      # 0x10259
callq 0x31f0
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x56ef
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x32a0
cmpl $0x0, -0x28(%rbp)
jbe 0x5acd
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
subl -0x28(%rbp), %eax
movl %eax, %eax
addq %rax, %rdi
movl -0x28(%rbp), %eax
movl %eax, %edx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
callq 0x3460
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jae 0x5ab6
movl $0x0, -0x4(%rbp)
jmp 0x5ad6
cmpl $0x0, -0x2c(%rbp)
jne 0x5abe
jmp 0x5acd
movl -0x2c(%rbp), %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
jmp 0x5acb
jmp 0x5a7c
movl -0x24(%rbp), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x20(%rax), %rdi
callq 0x3040
movq -0x20(%rbp), %rax
movl 0x4c(%rax), %ecx
shrl $0x3, %ecx
movl 0x4c(%rax), %edx
andl $0x7, %edx
cmpl $0x0, %edx
setne %dl
andb $0x1, %dl
movzbl %dl, %edx
addl %edx, %ecx
movl %ecx, -0x14(%rbp)
cmpq $0x0, 0x8(%rax)
je 0x5b42
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x5b40
movq -0x28(%rbp), %rdi
callq 0x3310
jmp 0x5b42
movl -0x14(%rbp), %eax
movl %eax, %edi
callq 0x3030
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rax), %rdi
movq 0x8(%rax), %rdx
movl -0x14(%rbp), %ecx
xorl %r8d, %r8d
movl %r8d, %esi
callq 0x5ba0
cmpl -0x14(%rbp), %eax
je 0x5b8e
movq 0x11477(%rip), %rdi     # 0x16ff0
leaq 0xa7d9(%rip), %rsi      # 0x10359
callq 0x31f0
movl $0xfffffff5, -0x4(%rbp) # imm = 0xFFFFFFF5
jmp 0x5b95
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movb %r8b, %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
andb $0x1, %al
movb %al, -0x25(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x32a0
cmpl $0x0, -0x2c(%rbp)
jbe 0x5c7e
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
subl -0x2c(%rbp), %eax
movl %eax, %eax
addq %rax, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %edx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
callq 0x3360
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jae 0x5c12
movl $0x0, -0x4(%rbp)
jmp 0x5c87
cmpl $0x0, -0x30(%rbp)
jne 0x5c6c
movq -0x10(%rbp), %rdi
callq 0x3390
cmpl $0x0, %eax
jne 0x5c28
jmp 0x5c7e
testb $0x1, -0x25(%rbp)
jne 0x5c30
jmp 0x5c7e
movq -0x10(%rbp), %rdi
callq 0x3260
movl %eax, %edi
movl -0x14(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3330
cmpl $0x0, %eax
je 0x5c51
jmp 0x5c7e
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
xorl %r8d, %r8d
callq 0x5ba0
movl %eax, -0x4(%rbp)
jmp 0x5c87
movl -0x30(%rbp), %ecx
movl -0x2c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5c79
jmp 0x5bd4
movl -0x24(%rbp), %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x6980
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rcx
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %r8
movl $0x1, %edx
callq 0x5ea0
movl %eax, -0x5c(%rbp)
jmp 0x62ba
movl -0x5c(%rbp), %eax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x62ec
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x58(%rbp)
jmp 0x6315
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x69c0
jmp 0x6327
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x69a0
movq %rax, %rsi
movq -0x20(%rbp), %rdi
callq 0x4790
jmp 0x6307
movl $0x0, -0x4(%rbp)
movl $0x1, -0x58(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x69c0
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3400
// File: cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::Write(unsigned int, Block const&, double&)
ERROR_T DiskSystem::Write(const SIZE_T inoffblock, const Block &blocks, double &reqtime)
{
  vector<Block> bl;

  bl.push_back(blocks);

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

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

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0x6980
movq -0x60(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x68f0
jmp 0x636b
movq -0x68(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %r8
movl $0x1, %edx
leaq -0x40(%rbp), %rcx
callq 0x60e0
movl %eax, -0x6c(%rbp)
jmp 0x6389
movl -0x6c(%rbp), %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x63bb
movl -0x50(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x63c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x69c0
jmp 0x63db
movl $0x0, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x69c0
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3400
nopw %cs:(%rax,%rax)
// File: cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::NotifyAllocateBlocks(unsigned int, unsigned int)
ERROR_T DiskSystem::NotifyAllocateBlocks(const SIZE_T offset, const SIZE_T innumblocks)
{
  if (offset+innumblocks > numblocks) { 
    cerr << "Disksystem: NotifyAllocateBlocks: Attempt to allocate"<<offset<<" to "<<(offset+innumblocks-1)<<" but maximum block is "<<(numblocks-1)<<endl;
    return ERROR_NOSUCHBLOCK;
  }


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

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movl -0x14(%rbp), %eax
addl -0x18(%rbp), %eax
cmpl 0x4c(%rcx), %eax
jbe 0x64cc
movq 0x10b94(%rip), %rdi     # 0x16ff0
leaq 0xa021(%rip), %rsi      # 0x10484
callq 0x31f0
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9f6e(%rip), %rsi      # 0x103eb
callq 0x31f0
movq %rax, %rdi
movl -0x14(%rbp), %esi
addl -0x18(%rbp), %esi
subl $0x1, %esi
callq 0x3320
movq %rax, %rdi
leaq 0xa01d(%rip), %rsi      # 0x104ba
callq 0x31f0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x4c(%rax), %esi
subl $0x1, %esi
callq 0x3320
movq %rax, %rdi
movq 0x10b02(%rip), %rsi     # 0x16fc0
callq 0x3240
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x6536
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0x14(%rbp), %ecx
addl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jae 0x652f
movq -0x28(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x60a0
testb $0x1, %al
jne 0x64f1
jmp 0x64f3
jmp 0x64f3
jmp 0x64f5
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %edx
andl $0x7, %edx
movl $0x7, %ecx
subl %edx, %ecx
movl $0x1, %esi
shll %cl, %esi
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
jmp 0x6524
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x64d2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::NotifyDeallocateBlocks(unsigned int, unsigned int)
ERROR_T DiskSystem::NotifyDeallocateBlocks(const SIZE_T offset,const SIZE_T innumblocks)
{
  if (offset+innumblocks > numblocks) { 
    cerr << "Disksystem: NotifyDeallocateBlocks: Attempt to deallocate"<<offset<<" to "<<(offset+innumblocks-1)<<" but maximum block is "<<(numblocks-1)<<endl;
    return ERROR_NOSUCHBLOCK;
  }


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

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movl -0x14(%rbp), %eax
addl -0x18(%rbp), %eax
cmpl 0x4c(%rcx), %eax
jbe 0x65dc
movq 0x10a84(%rip), %rdi     # 0x16ff0
leaq 0x9f5e(%rip), %rsi      # 0x104d1
callq 0x31f0
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9e5e(%rip), %rsi      # 0x103eb
callq 0x31f0
movq %rax, %rdi
movl -0x14(%rbp), %esi
addl -0x18(%rbp), %esi
subl $0x1, %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9f0d(%rip), %rsi      # 0x104ba
callq 0x31f0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x4c(%rax), %esi
subl $0x1, %esi
callq 0x3320
movq %rax, %rdi
movq 0x109f2(%rip), %rsi     # 0x16fc0
callq 0x3240
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x6647
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0x14(%rbp), %ecx
addl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jae 0x6640
movq -0x28(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x60a0
testb $0x1, %al
jne 0x6601
jmp 0x6601
jmp 0x6603
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %edx
andl $0x7, %edx
movl $0x7, %ecx
subl %edx, %ecx
movl $0x1, %esi
shll %cl, %esi
xorl $-0x1, %esi
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %edx
andl %esi, %edx
movb %dl, (%rax,%rcx)
jmp 0x6635
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x65e2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x60(%rbp)
addq $0x10, %rdi
callq 0x8160
movq -0x60(%rbp), %rdi
movq %rax, -0x18(%rbp)
movsd 0x8fcb(%rip), %xmm0     # 0x10608
addsd 0x40(%rdi), %xmm0
movsd %xmm0, -0x20(%rbp)
addq $0x10, %rdi
callq 0x8190
movq -0x60(%rbp), %rcx
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jae 0x7668
movl $0x0, -0x4(%rbp)
jmp 0x77a2
movq -0x60(%rbp), %rdi
addq $0x10, %rdi
callq 0x81b0
movq %rax, -0x28(%rbp)
movq -0x60(%rbp), %rdi
addq $0x10, %rdi
callq 0x8160
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x81e0
testb $0x1, %al
jne 0x769d
jmp 0x76de
leaq -0x28(%rbp), %rdi
callq 0x8210
movsd 0x20(%rax), %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x76d1
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8210
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x76d3
leaq -0x28(%rbp), %rdi
callq 0x8230
jmp 0x7679
movq -0x60(%rbp), %rdi
addq $0x10, %rdi
callq 0x8160
movq %rax, -0x38(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x81e0
testb $0x1, %al
jne 0x7705
jmp 0x779b
leaq -0x18(%rbp), %rdi
callq 0x8210
testb $0x1, 0x28(%rax)
je 0x777e
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x70(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x8210
movl (%rax), %eax
movl %eax, -0x64(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x8210
movq -0x70(%rbp), %rdi
movl -0x64(%rbp), %esi
movq %rax, %rdx
addq $0x8, %rdx
leaq -0x40(%rbp), %rcx
callq 0x6330
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, -0x44(%rbp)
movsd -0x40(%rbp), %xmm0
addsd 0x40(%rax), %xmm0
movsd %xmm0, 0x40(%rax)
movl 0x5c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5c(%rax)
cmpl $0x0, -0x44(%rbp)
je 0x777c
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x77a2
jmp 0x777e
movq -0x60(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
callq 0x8260
movq %rax, -0x58(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x10, %rdi
callq 0x81b0
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
callq 0x8160
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x81e0
testb $0x1, %al
jne 0x78c8
jmp 0x7951
leaq -0x18(%rbp), %rdi
callq 0x8210
testb $0x1, 0x28(%rax)
je 0x7941
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x8210
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x8210
movq -0x48(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq %rax, %rdx
addq $0x8, %rdx
leaq -0x28(%rbp), %rcx
callq 0x6330
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, -0x2c(%rbp)
movsd -0x28(%rbp), %xmm0
addsd 0x40(%rax), %xmm0
movsd %xmm0, 0x40(%rax)
movl 0x5c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5c(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x793f
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7965
jmp 0x7941
jmp 0x7943
leaq -0x18(%rbp), %rdi
callq 0x8230
jmp 0x78a1
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
callq 0x82e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8300
movq -0x50(%rbp), %rdi
addq $0x10, %rdi
leaq -0x14(%rbp), %rsi
callq 0x8320
movq -0x50(%rbp), %rdi
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x10, %rdi
callq 0x8160
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x81e0
testb $0x1, %al
jne 0x7b35
jmp 0x7b8b
leaq -0x28(%rbp), %rdi
callq 0x8210
movq %rax, %rsi
addq $0x8, %rsi
movq -0x20(%rbp), %rdi
callq 0x4790
movq -0x50(%rbp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8210
movsd -0x58(%rbp), %xmm0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movsd %xmm0, 0x20(%rcx)
movl 0x50(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x50(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7c3e
movq -0x50(%rbp), %rdi
callq 0x7610
movq -0x50(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x60a0
testb $0x1, %al
jne 0x7ba9
jmp 0x7ba9
movq -0x50(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x6270
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, -0x44(%rbp)
movsd -0x40(%rbp), %xmm0
addsd 0x40(%rax), %xmm0
movsd %xmm0, 0x40(%rax)
movl 0x58(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x58(%rax)
cmpl $0x0, -0x44(%rbp)
je 0x7bef
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7c3e
movq -0x50(%rbp), %rdi
movsd 0x40(%rdi), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movq -0x20(%rbp), %rax
movb $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
addq $0x10, %rdi
leaq -0x14(%rbp), %rsi
callq 0x8350
movq -0x60(%rbp), %rsi
movq %rax, %rdi
callq 0x4790
movq -0x50(%rbp), %rax
movl 0x50(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x50(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8300
movq -0x78(%rbp), %rdi
addq $0x10, %rdi
leaq -0x14(%rbp), %rsi
callq 0x8320
movq -0x78(%rbp), %rdi
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x10, %rdi
callq 0x8160
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x81e0
testb $0x1, %al
jne 0x7cb8
jmp 0x7d29
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8210
movq -0x88(%rbp), %rsi
movq %rax, %rdi
addq $0x8, %rdi
callq 0x4790
movq -0x78(%rbp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x80(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8210
movsd -0x80(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
leaq -0x28(%rbp), %rdi
callq 0x8210
movq %rax, %rcx
movq -0x78(%rbp), %rax
movb $0x1, 0x28(%rcx)
movl 0x54(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x54(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7dc4
movq -0x78(%rbp), %rdi
callq 0x7610
movq -0x78(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x60a0
testb $0x1, %al
jne 0x7d47
jmp 0x7d47
movq -0x20(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x4570
movq -0x78(%rbp), %rdi
movsd 0x40(%rdi), %xmm0
movsd %xmm0, -0x48(%rbp)
movb $0x1, -0x40(%rbp)
addq $0x10, %rdi
leaq -0x14(%rbp), %rsi
callq 0x8350
movq %rax, -0x90(%rbp)
jmp 0x7d7c
movq -0x90(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4790
jmp 0x7d8e
movq -0x78(%rbp), %rax
movl 0x54(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x54(%rax)
movl $0x0, -0x4(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x46e0
jmp 0x7dc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x46e0
jmp 0x7dd0
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x3400
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8300
movq -0x58(%rbp), %rdi
addq $0x10, %rdi
leaq -0x14(%rbp), %rsi
callq 0x8320
movq -0x58(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
addq $0x10, %rdi
callq 0x8160
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x8430
testb $0x1, %al
jne 0x7e61
jmp 0x7e6d
movl $0x0, -0x4(%rbp)
jmp 0x7f0a
leaq -0x20(%rbp), %rdi
callq 0x8210
testb $0x1, 0x28(%rax)
je 0x7ee6
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8210
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8210
movq -0x68(%rbp), %rdi
movl -0x5c(%rbp), %esi
movq %rax, %rdx
addq $0x8, %rdx
leaq -0x38(%rbp), %rcx
callq 0x6330
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, -0x3c(%rbp)
movl 0x5c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5c(%rax)
movsd -0x38(%rbp), %xmm0
addsd 0x40(%rax), %xmm0
movsd %xmm0, 0x40(%rax)
cmpl $0x0, -0x3c(%rbp)
je 0x7ee4
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7f0a
jmp 0x7ee6
movq -0x58(%rbp), %rdi
addq $0x10, %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rsi
callq 0x8260
movq %rax, -0x50(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
leaq 0xd09b(%rip), %rax      # 0x16d78
movq %rax, (%rdi)
addq $0x18, %rdi
movq %rdi, -0x40(%rbp)
callq 0xee80
movq -0x38(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x1c(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x20(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rax), %rdi
callq 0x79c0
movl %eax, -0x30(%rbp)
jmp 0x9d13
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, -0x20(%rbp)
movl -0x20(%rbp), %ecx
subq $0x1c, %rcx
shrq $0x4, %rcx
movl %ecx, 0x40(%rax)
addq $0x40, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0xeea0
movq -0x28(%rbp), %rdi
callq 0x3400
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movl 0x2c(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x9ec6
movl $0xfffffff9, -0x4(%rbp) # imm = 0xFFFFFFF9
jmp 0x9f6e
leaq -0x40(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0xee80
movq -0x58(%rbp), %rax
movq -0x60(%rbp), %rdi
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0xf1a0
jmp 0x9eec
cmpl $0x0, -0x40(%rbp)
jne 0x9ef4
jmp 0x9f2a
leaq 0x67a5(%rip), %rdi      # 0x106a0
leaq 0x67ca(%rip), %rsi      # 0x106cc
movl $0x52, %edx
leaq 0x67c7(%rip), %rcx      # 0x106d5
callq 0x3130
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xeea0
jmp 0x9f77
movq -0x58(%rbp), %rax
movl -0x2c(%rbp), %ecx
movq %rax, %rdi
addq $0x18, %rdi
movl %ecx, 0x2c(%rax)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
callq 0xf080
jmp 0x9f49
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %esi
callq 0x7a20
jmp 0x9f5e
movl $0x0, -0x4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xeea0
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3400
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0xee80
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rdi
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl (%rax), %edx
callq 0xf1a0
jmp 0x9fbe
cmpl $0x0, -0x38(%rbp)
je 0x9fc6
jmp 0x9ffc
leaq 0x6733(%rip), %rdi      # 0x10700
leaq 0x66f8(%rip), %rsi      # 0x106cc
movl $0x64, %edx
leaq 0x674c(%rip), %rcx      # 0x1072c
callq 0x3130
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xeea0
jmp 0xa06a
movq -0x58(%rbp), %rax
movl $0x0, -0x38(%rbp)
movl 0x2c(%rax), %ecx
movl %ecx, -0x24(%rbp)
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl (%rax), %edx
leaq -0x38(%rbp), %rdi
callq 0xf080
jmp 0xa022
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movq %rax, %rdi
addq $0x18, %rdi
movl %ecx, 0x2c(%rax)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
callq 0xf080
jmp 0xa044
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
callq 0x7a60
jmp 0xa059
leaq -0x38(%rbp), %rdi
callq 0xeea0
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3400
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0xd4a1
movq -0x10(%rbp), %rdi
leaq 0x332d(%rip), %rsi      # 0x107c9
callq 0x31f0
movq -0x20(%rbp), %rdi
movq %rdi, %rsi
addq $0x18, %rsi
addq $0x10, %rsi
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
callq 0xcae0
movl %eax, -0x18(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0xd4d5
movq -0x10(%rbp), %rdi
leaq 0x330a(%rip), %rsi      # 0x107da
callq 0x31f0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1c17(%rip), %rsi      # 0x1091a
callq 0x31f0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, -0x18(%rbp)
cmpl $0x0, (%rax)
jne 0xed25
leaq 0x19fb(%rip), %rax      # 0x1071a
movq %rax, -0x28(%rbp)
jmp 0xed9e
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xed3b
leaq 0x1bfc(%rip), %rax      # 0x10931
movq %rax, -0x30(%rbp)
jmp 0xed96
movq -0x20(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xed51
leaq 0x1bf1(%rip), %rax      # 0x1093c
movq %rax, -0x38(%rbp)
jmp 0xed8e
movq -0x20(%rbp), %rax
cmpl $0x3, (%rax)
jne 0xed67
leaq 0x1be5(%rip), %rax      # 0x10946
movq %rax, -0x40(%rbp)
jmp 0xed86
movq -0x20(%rbp), %rax
movl (%rax), %edx
leaq 0x1bea(%rip), %rax      # 0x1095e
leaq 0x1bd9(%rip), %rcx      # 0x10954
cmpl $0x4, %edx
cmoveq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x31f0
movq %rax, %rdi
leaq 0x1bb6(%rip), %rsi      # 0x1096b
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x1ba3(%rip), %rsi      # 0x10976
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x174a(%rip), %rsi      # 0x1053b
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x1b74(%rip), %rsi      # 0x10983
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x1b62(%rip), %rsi      # 0x1098f
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x1b50(%rip), %rsi      # 0x1099b
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x18f4(%rip), %rsi      # 0x1075d
callq 0x31f0
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, 0x20(%rax)
je 0xeed8
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xeed6
movq -0x18(%rbp), %rdi
callq 0x3310
jmp 0xeed8
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movl $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x14(%rax)
movl $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
cmpl $0x0, (%rax)
je 0xef89
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
je 0xef89
movq -0x20(%rbp), %rdi
callq 0xec40
movl %eax, %eax
movl %eax, %edi
callq 0x3030
movq -0x20(%rbp), %rdi
movq %rax, 0x20(%rdi)
movq 0x20(%rdi), %rax
movq %rax, -0x28(%rbp)
callq 0xec40
movq -0x28(%rbp), %rdi
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x3100
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rcx
movl 0x14(%rcx), %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xf043
movq -0x18(%rbp), %rdi
callq 0xec40
movl %eax, %eax
movl %eax, %edi
callq 0x3030
movq -0x18(%rbp), %rdi
movq %rax, 0x20(%rdi)
movq 0x20(%rdi), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
callq 0xec40
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl %eax, %eax
movl %eax, %edx
callq 0x3190
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl 0xc(%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x79c0
movl %eax, %ecx
movl -0x50(%rbp), %eax
cmpl %ecx, %eax
jne 0xf0b5
jmp 0xf0d4
leaq 0x18ea(%rip), %rdi      # 0x109a6
leaq 0x190f(%rip), %rsi      # 0x109d2
movl $0x64, %edx
leaq 0x190f(%rip), %rcx      # 0x109de
callq 0x3130
movq -0x58(%rbp), %rdi
callq 0xec40
movl %eax, %eax
addq $0x1c, %rax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x4420
movq -0x58(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax), %rdx
movq %rdx, (%rcx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rcx)
movq 0x10(%rax), %rdx
movq %rdx, 0x10(%rcx)
movl 0x18(%rax), %edx
movl %edx, 0x18(%rcx)
cmpl $0x0, (%rax)
je 0xf14e
movq -0x58(%rbp), %rax
cmpl $0x1, (%rax)
je 0xf14e
movq -0x58(%rbp), %rdi
movq -0x38(%rbp), %rax
addq $0x1c, %rax
movq %rax, -0x68(%rbp)
movq 0x20(%rdi), %rax
movq %rax, -0x60(%rbp)
callq 0xec40
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movl %eax, %eax
movl %eax, %edx
callq 0x3190
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x40(%rbp), %rdx
callq 0x7c50
movl %eax, -0x6c(%rbp)
jmp 0xf163
leaq -0x40(%rbp), %rdi
callq 0x46e0
movl -0x6c(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x46e0
movq -0x48(%rbp), %rdi
callq 0x3400
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x43e0
movq -0x70(%rbp), %rdx
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x7ad0
movl %eax, -0x64(%rbp)
jmp 0xf1e0
movl -0x64(%rbp), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0xf218
movl -0x4c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x60(%rbp)
jmp 0xf32b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x46e0
jmp 0xf340
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
cmpq $0x0, 0x20(%rax)
je 0xf26a
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, %rax
je 0xf25e
movq -0x80(%rbp), %rdi
callq 0x3310
movq -0x78(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rdi
callq 0x79c0
movl %eax, -0x84(%rbp)
jmp 0xf27b
movl -0x84(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0xf28c
jmp 0xf2ab
leaq 0x178b(%rip), %rdi      # 0x10a1e
leaq 0x1738(%rip), %rsi      # 0x109d2
movl $0x84, %edx
leaq 0x17a4(%rip), %rcx      # 0x10a4a
callq 0x3130
movq -0x78(%rbp), %rax
cmpl $0x0, (%rax)
je 0xf31d
movq -0x78(%rbp), %rax
cmpl $0x1, (%rax)
je 0xf31d
movq -0x78(%rbp), %rdi
callq 0xec40
movl %eax, %eax
movl %eax, %edi
callq 0x3030
movq %rax, -0x90(%rbp)
jmp 0xf2d8
movq -0x78(%rbp), %rdi
movq -0x90(%rbp), %rax
movq %rax, 0x20(%rdi)
movq 0x20(%rdi), %rax
movq %rax, -0xa0(%rbp)
movq -0x40(%rbp), %rax
addq $0x1c, %rax
movq %rax, -0x98(%rbp)
callq 0xec40
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movl %eax, %eax
movl %eax, %edx
callq 0x3190
movl $0x0, -0x4(%rbp)
movl $0x1, -0x60(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x46e0
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3400
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl (%rax), %eax
movl %eax, -0x18(%rbp)
addl $-0x2, %eax
subl $0x2, %eax
jb 0xf383
jmp 0xf376
movl -0x18(%rbp), %eax
subl $0x4, %eax
je 0xf3d3
jmp 0xf423
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0xf391
jmp 0xf3b0
leaq 0x16ee(%rip), %rdi      # 0x10a86
leaq 0x1633(%rip), %rsi      # 0x109d2
movl $0x94, %edx
leaq 0x16ef(%rip), %rcx      # 0x10a9a
callq 0x3130
movq -0x20(%rbp), %rdx
movq 0x20(%rdx), %rax
addq $0x4, %rax
movl -0x14(%rbp), %ecx
movl 0x4(%rdx), %edx
addq $0x4, %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0xf42b
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0xf3e1
jmp 0xf400
leaq 0x169e(%rip), %rdi      # 0x10a86
leaq 0x15e3(%rip), %rsi      # 0x109d2
movl $0x98, %edx
leaq 0x169f(%rip), %rcx      # 0x10a9a
callq 0x3130
movq -0x20(%rbp), %rsi
movq 0x20(%rsi), %rax
addq $0x4, %rax
movl -0x14(%rbp), %ecx
movl 0x4(%rsi), %edx
addl 0x8(%rsi), %edx
imull %edx, %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0xf42b
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl (%rax), %eax
movl %eax, -0x18(%rbp)
addl $-0x2, %eax
subl $0x2, %eax
jb 0xf473
jmp 0xf466
movl -0x18(%rbp), %eax
subl $0x4, %eax
je 0xf4bf
jmp 0xf4f4
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x18(%rcx), %eax
ja 0xf481
jmp 0xf4a0
leaq 0x1642(%rip), %rdi      # 0x10aca
leaq 0x1543(%rip), %rsi      # 0x109d2
movl $0xa6, %edx
leaq 0x1644(%rip), %rcx      # 0x10adf
callq 0x3130
movq -0x20(%rbp), %rdx
movq 0x20(%rdx), %rax
movl -0x14(%rbp), %ecx
movl 0x4(%rdx), %edx
addq $0x4, %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0xf4fc
cmpl $0x0, -0x14(%rbp)
jne 0xf4c7
jmp 0xf4e6
leaq 0x1641(%rip), %rdi      # 0x10b0f
leaq 0x14fd(%rip), %rsi      # 0x109d2
movl $0xaa, %edx
leaq 0x15fe(%rip), %rcx      # 0x10adf
callq 0x3130
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xf4fc
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl (%rax), %eax
subl $0x4, %eax
jne 0xf586
jmp 0xf530
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0xf53e
jmp 0xf55d
leaq 0x1541(%rip), %rdi      # 0x10a86
leaq 0x1486(%rip), %rsi      # 0x109d2
movl $0xb8, %edx
leaq 0x15c1(%rip), %rcx      # 0x10b19
callq 0x3130
movq -0x20(%rbp), %rcx
movq 0x20(%rcx), %rax
addq $0x4, %rax
movl -0x14(%rbp), %edx
movl 0x4(%rcx), %esi
addl 0x8(%rcx), %esi
imull %esi, %edx
movl %edx, %edx
addq %rdx, %rax
movl 0x4(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0xf58e
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)