// File: cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::Print(std::ostream&) const
ostream & DiskSystem::Print(ostream &os) const
{
  os << "DiskSystem(diskfilestem="<<diskfilestem
     << ", offset="<<offset
     << ", numblocks="<<numblocks
     << ", blocksize="<<blocksize
     << ", numheads="<<numheads
     << ", blockspertrack="<<blockspertrack
     << ", numtracks="<<numtracks
     << ", last_track="<<last_track
     << ", last_sector="<<last_sector
     << ", averageseeklatency="<<averageseeklatency
     << ", trackseeklatency="<<trackseeklatency
     << ", rotationallatency="<<rotationallatency
     << ", bitmap=";

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

  os <<")";
  return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x9e98(%rip), %rsi      # 0x1050b
callq 0x31f0
movq -0x20(%rbp), %rsi
movq %rax, %rdi
addq $0x28, %rsi
callq 0x31c0
movq %rax, %rdi
leaq 0x9e92(%rip), %rsi      # 0x10524
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x48(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9e7e(%rip), %rsi      # 0x1052e
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x4c(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9e6d(%rip), %rsi      # 0x1053b
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x50(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9e5c(%rip), %rsi      # 0x10548
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x54(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9e4a(%rip), %rsi      # 0x10554
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x58(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9e3e(%rip), %rsi      # 0x10566
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x5c(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9e2d(%rip), %rsi      # 0x10573
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x60(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9e1d(%rip), %rsi      # 0x10581
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x64(%rax), %esi
callq 0x3320
movq %rax, %rdi
leaq 0x9e0e(%rip), %rsi      # 0x10590
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movsd 0x68(%rax), %xmm0
callq 0x3440
movq %rax, %rdi
leaq 0x9e04(%rip), %rsi      # 0x105a6
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movsd 0x70(%rax), %xmm0
callq 0x3440
movq %rax, %rdi
leaq 0x9df8(%rip), %rsi      # 0x105ba
callq 0x31f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movsd 0x78(%rax), %xmm0
callq 0x3440
movq %rax, %rdi
leaq 0x9ded(%rip), %rsi      # 0x105cf
callq 0x31f0
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x4c(%rcx), %eax
jae 0x6854
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x14(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x14(%rbp), %edx
andl $0x7, %edx
movl $0x7, %ecx
subl %edx, %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x6837
movq -0x10(%rbp), %rdi
leaq 0x9da9(%rip), %rsi      # 0x105d9
callq 0x31f0
jmp 0x6847
movq -0x10(%rbp), %rdi
leaq 0x9ff6(%rip), %rsi      # 0x10838
callq 0x31f0
jmp 0x6849
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x67ee
movq -0x10(%rbp), %rdi
leaq 0x9efe(%rip), %rsi      # 0x1075d
callq 0x31f0
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop