// File: /workspace/github_cpp_makefile_star2_O2/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::ReadConfig()
ERROR_T DiskSystem::ReadConfig()
{
  char buf[80];

#define GETNEXTVAL do { fgets(buf,80,configfilefd); } while (buf[0]=='#')  
#define PARSEUNSIGNED(x) do { sscanf(buf,"%u",x); } while (0)
#define PARSEDOUBLE(x) do { sscanf(buf,"%lf",x); } while (0)

  rewind(configfilefd);
  GETNEXTVAL;
  if (buf[strlen(buf)-1]=='\n') { 
    buf[strlen(buf)-1]=0;
  }
  diskfilestem = string(buf);
  GETNEXTVAL;
  PARSEUNSIGNED(&offset);
  GETNEXTVAL;
  PARSEUNSIGNED(&numblocks);
  GETNEXTVAL;
  PARSEUNSIGNED(&blocksize);
  GETNEXTVAL;
  PARSEUNSIGNED(&numheads);
  GETNEXTVAL;
  PARSEUNSIGNED(&blockspertrack);
  GETNEXTVAL;
  PARSEUNSIGNED(&numtracks);
  GETNEXTVAL;
  PARSEDOUBLE(&averageseeklatency);
  GETNEXTVAL;
  PARSEDOUBLE(&trackseeklatency);
  GETNEXTVAL;
  PARSEDOUBLE(&rotationallatency);

  return ERROR_NOERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x2040
leaq 0x10(%rsp), %r14
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x3553
movq %r14, %rdi
callq 0x2090
cmpb $0xa, -0x1(%rax,%r14)
jne 0x357d
movb $0x0, 0xf(%rsp,%rax)
leaq 0x68(%rsp), %r15
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x29f2
leaq 0x28(%rbx), %rdi
movq %r15, %rsi
callq 0x2270
movq %r15, %rdi
callq 0x20b0
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x35ae
leaq 0x48(%rbx), %rdx
leaq 0x4d5b(%rip), %rsi      # 0x8329
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x35e0
leaq 0x4c(%rbx), %rdx
leaq 0x4d29(%rip), %rsi      # 0x8329
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x3612
leaq 0x50(%rbx), %rdx
leaq 0x4cf7(%rip), %rsi      # 0x8329
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x3644
leaq 0x54(%rbx), %rdx
leaq 0x4cc5(%rip), %rsi      # 0x8329
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x3676
leaq 0x58(%rbx), %rdx
leaq 0x4c93(%rip), %rsi      # 0x8329
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x36a8
leaq 0x5c(%rbx), %rdx
leaq 0x4c61(%rip), %rsi      # 0x8329
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x36da
leaq 0x68(%rbx), %rdx
leaq 0x4c32(%rip), %rsi      # 0x832c
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x370c
leaq 0x70(%rbx), %rdx
leaq 0x4c00(%rip), %rsi      # 0x832c
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
pushq $0x50
popq %rbp
movq 0x18(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2310
cmpb $0x23, 0x10(%rsp)
je 0x373e
addq $0x78, %rbx
leaq 0x4bce(%rip), %rsi      # 0x832c
leaq 0x10(%rsp), %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21a0
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq