// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x2210
movl %eax, %edi
xorl %esi, %esi
callq 0x22a0
movq 0x18(%rbx), %rdi
callq 0x2040
movq 0x18(%rbx), %rcx
leaq 0x4fb7(%rip), %rdi      # 0x825d
pushq $0x25
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rcx
leaq 0x4fc3(%rip), %rdi      # 0x8283
pushq $0xb
popq %r12
movq %r12, %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movq 0x28(%rbx), %rdx
leaq 0x4fb1(%rip), %rsi      # 0x828f
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rbx), %rcx
leaq 0x4fa3(%rip), %rdi      # 0x8293
pushq $0x9
popq %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movl 0x48(%rbx), %edx
leaq 0x4f94(%rip), %r15      # 0x829d
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rbx), %rcx
leaq 0x4f83(%rip), %rdi      # 0x82a1
pushq $0xc
popq %r13
movq %r13, %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movl 0x4c(%rbx), %edx
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rbx), %rcx
leaq 0x4f65(%rip), %rdi      # 0x82ae
movq %r13, %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movl 0x50(%rbx), %edx
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rbx), %rcx
leaq 0x4f4b(%rip), %rdi      # 0x82bb
movq %r12, %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movl 0x54(%rbx), %edx
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rbx), %rcx
leaq 0x4f30(%rip), %rdi      # 0x82c7
pushq $0x11
popq %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movl 0x58(%rbx), %edx
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rbx), %rcx
leaq 0x4f1b(%rip), %rdi      # 0x82d9
movq %r13, %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movl 0x5c(%rbx), %edx
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rbx), %rcx
leaq 0x4f01(%rip), %rdi      # 0x82e6
pushq $0x15
popq %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movsd 0x68(%rbx), %xmm0
leaq 0x4efc(%rip), %r15      # 0x82fc
movq %r15, %rsi
movb $0x1, %al
callq 0x22b0
movq 0x18(%rbx), %rcx
leaq 0x4eec(%rip), %rdi      # 0x8301
pushq $0x13
popq %r12
movq %r12, %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movsd 0x70(%rbx), %xmm0
movq %r15, %rsi
movb $0x1, %al
callq 0x22b0
movq 0x18(%rbx), %rcx
leaq 0x4ed3(%rip), %rdi      # 0x8315
movq %r12, %rsi
movq %r14, %rdx
callq 0x23b0
movq 0x18(%rbx), %rdi
movsd 0x78(%rbx), %xmm0
movq %r15, %rsi
movb $0x1, %al
callq 0x22b0
movq 0x18(%rbx), %rdi
callq 0x2250
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop