// File: /workspace/github_cpp_makefile_star2_O3/cpottamus[P]btree_lab/disksystem.cc
// Function: DiskSystem::WriteConfig()
ERROR_T DiskSystem::WriteConfig()
{
  ftruncate(fileno(configfilefd),0);
  rewind(configfilefd);
  fprintf(configfilefd,"# disksystem config file version 0.9\n");
  fprintf(configfilefd,"# filestem\n");
  fprintf(configfilefd,"%s\n",diskfilestem.c_str());
  fprintf(configfilefd,"# offset\n");
  fprintf(configfilefd,"%u\n",offset);
  fprintf(configfilefd,"# numblocks\n");
  fprintf(configfilefd,"%u\n",numblocks);
  fprintf(configfilefd,"# blocksize\n");
  fprintf(configfilefd,"%u\n",blocksize);
  fprintf(configfilefd,"# numheads\n");
  fprintf(configfilefd,"%u\n",numheads);
  fprintf(configfilefd,"# blockspertrack\n");
  fprintf(configfilefd,"%u\n",blockspertrack);
  fprintf(configfilefd,"# numtracks\n");
  fprintf(configfilefd,"%u\n",numtracks);
  fprintf(configfilefd,"# averageseeklatency\n");
  fprintf(configfilefd,"%lf\n",averageseeklatency);
  fprintf(configfilefd,"# trackseeklatency\n");
  fprintf(configfilefd,"%lf\n",trackseeklatency);
  fprintf(configfilefd,"# rotationalatency\n");
  fprintf(configfilefd,"%lf\n",rotationallatency);
  fflush(configfilefd);

  return ERROR_NOERROR;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x2210
movl %eax, %edi
xorl %esi, %esi
callq 0x2290
movq 0x18(%rbx), %rdi
callq 0x2050
movq 0x18(%rbx), %rcx
leaq 0x5c08(%rip), %rdi      # 0x925d
movl $0x25, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rcx
leaq 0x5c14(%rip), %rdi      # 0x9283
movl $0xb, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movq 0x28(%rbx), %rdx
leaq 0x5c02(%rip), %rsi      # 0x928f
xorl %eax, %eax
callq 0x22a0
movq 0x18(%rbx), %rcx
leaq 0x5bf4(%rip), %rdi      # 0x9293
movl $0x9, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movl 0x48(%rbx), %edx
leaq 0x5be1(%rip), %r14      # 0x929d
movq %r14, %rsi
xorl %eax, %eax
callq 0x22a0
movq 0x18(%rbx), %rcx
leaq 0x5bd0(%rip), %rdi      # 0x92a1
movl $0xc, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movl 0x4c(%rbx), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x22a0
movq 0x18(%rbx), %rcx
leaq 0x5bb2(%rip), %rdi      # 0x92ae
movl $0xc, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movl 0x50(%rbx), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x22a0
movq 0x18(%rbx), %rcx
leaq 0x5b94(%rip), %rdi      # 0x92bb
movl $0xb, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movl 0x54(%rbx), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x22a0
movq 0x18(%rbx), %rcx
leaq 0x5b75(%rip), %rdi      # 0x92c7
movl $0x11, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movl 0x58(%rbx), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x22a0
movq 0x18(%rbx), %rcx
leaq 0x5b5c(%rip), %rdi      # 0x92d9
movl $0xc, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movl 0x5c(%rbx), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x22a0
movq 0x18(%rbx), %rcx
leaq 0x5b3e(%rip), %rdi      # 0x92e6
movl $0x15, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movsd 0x68(%rbx), %xmm0
leaq 0x5b35(%rip), %r14      # 0x92fc
movq %r14, %rsi
movb $0x1, %al
callq 0x22a0
movq 0x18(%rbx), %rcx
leaq 0x5b25(%rip), %rdi      # 0x9301
movl $0x13, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movsd 0x70(%rbx), %xmm0
movq %r14, %rsi
movb $0x1, %al
callq 0x22a0
movq 0x18(%rbx), %rcx
leaq 0x5b0c(%rip), %rdi      # 0x9315
movl $0x13, %esi
movl $0x1, %edx
callq 0x23a0
movq 0x18(%rbx), %rdi
movsd 0x78(%rbx), %xmm0
movq %r14, %rsi
movb $0x1, %al
callq 0x22a0
movq 0x18(%rbx), %rdi
callq 0x2250
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq