// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: save_x72_state()
void save_x72_state()
{
   // save current settings to disk file since STUPID Symmetricom does not
   // save most settings to eeprom

   if(x72_file == 0) {
      return;
   }

   fseek(x72_file, 0L, SEEK_SET);


   if(user_set_x72_dmode) {
      fprintf(x72_file, "%d DISCIPLINE\n", last_x72_dmode);
   }
   if(user_set_x72_tc) {
      fprintf(x72_file, "%d TC\n", last_x72_tc);
   }
   if(user_set_x72_damping) {
      fprintf(x72_file, "%g DAMPING\n", last_x72_damping);
   }
   if(user_set_x72_jamthresh) {
      fprintf(x72_file, "%g JAMTHRESH\n", last_x72_jamthresh);
   }
   if(user_set_x72_holdover) {
      fprintf(x72_file, "%d HOLDOVER\n", last_x72_holdover);
   }


   if(user_set_x72_osc) {
      fprintf(x72_file, "%.1f OSC\n", x72_osc);
   }

   if(user_set_x72_dds) { 
      fprintf(x72_file, "%g DDS\n", last_x72_dds);
   }

   if(user_set_x72_acmos_freq) { 
      fprintf(x72_file, "%d DIVIDER\n", last_x72_acmos_freq);
   }

   if(user_set_x72_efc) { 
      fprintf(x72_file, "%d EFC\n", last_x72_efc);
   }

   if(user_set_x72_pps_enable) {
      fprintf(x72_file, "%d PPS\n", last_x72_pps_enable);
   }

   if(user_set_x72_srvc) {
      fprintf(x72_file, "%d SRVC\n", last_x72_srvc);
   }

   if(user_set_x72_tic) { 
      fprintf(x72_file, "%d TIC\n", last_x72_tic);
   }


   fprintf(x72_file, "\n0 EOF\n");

   fflush(x72_file);   // !!!!! we should probably close and re-open the file
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1c56a8(%rip), %rbx    # 0x2283b8
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x62f18
xorl %esi, %esi
xorl %edx, %edx
callq 0x93d0
leaq 0x1a21d8(%rip), %rax    # 0x204f04
cmpl $0x0, (%rax)
je 0x62d4b
movq (%rbx), %rdi
leaq 0x1a21e5(%rip), %rax    # 0x204f20
movl (%rax), %edx
leaq 0xab15e(%rip), %rsi     # 0x10dea2
xorl %eax, %eax
callq 0x9560
leaq 0x1a21a2(%rip), %rax    # 0x204ef4
cmpl $0x0, (%rax)
je 0x62d71
movq (%rbx), %rdi
leaq 0x1a21bb(%rip), %rax    # 0x204f1c
movl (%rax), %edx
leaq 0xab147(%rip), %rsi     # 0x10deb1
xorl %eax, %eax
callq 0x9560
leaq 0x1a2180(%rip), %rax    # 0x204ef8
cmpl $0x0, (%rax)
je 0x62d99
movq (%rbx), %rdi
leaq 0x1a2181(%rip), %rax    # 0x204f08
movsd (%rax), %xmm0
leaq 0xab126(%rip), %rsi     # 0x10deb8
movb $0x1, %al
callq 0x9560
leaq 0x1a215c(%rip), %rax    # 0x204efc
cmpl $0x0, (%rax)
je 0x62dc1
movq (%rbx), %rdi
leaq 0x1a2161(%rip), %rax    # 0x204f10
movsd (%rax), %xmm0
leaq 0xab10a(%rip), %rsi     # 0x10dec4
movb $0x1, %al
callq 0x9560
leaq 0x1a2138(%rip), %rax    # 0x204f00
cmpl $0x0, (%rax)
je 0x62de7
movq (%rbx), %rdi
leaq 0x1a2141(%rip), %rax    # 0x204f18
movl (%rax), %edx
leaq 0xab0f2(%rip), %rsi     # 0x10ded2
xorl %eax, %eax
callq 0x9560
leaq 0x1a20c6(%rip), %rax    # 0x204eb4
cmpl $0x0, (%rax)
je 0x62e0f
movq (%rbx), %rdi
leaq 0x1a1e6b(%rip), %rax    # 0x204c68
movsd (%rax), %xmm0
leaq 0xab0d7(%rip), %rsi     # 0x10dedf
movb $0x1, %al
callq 0x9560
leaq 0x1a209a(%rip), %rax    # 0x204eb0
cmpl $0x0, (%rax)
je 0x62e37
movq (%rbx), %rdi
leaq 0x1a20bb(%rip), %rax    # 0x204ee0
movsd (%rax), %xmm0
leaq 0xab0b9(%rip), %rsi     # 0x10dee9
movb $0x1, %al
callq 0x9560
leaq 0x1a207a(%rip), %rax    # 0x204eb8
cmpl $0x0, (%rax)
je 0x62e5d
movq (%rbx), %rdi
leaq 0x1a207f(%rip), %rax    # 0x204ecc
movl (%rax), %edx
leaq 0xab09b(%rip), %rsi     # 0x10def1
xorl %eax, %eax
callq 0x9560
leaq 0x1a2060(%rip), %rax    # 0x204ec4
cmpl $0x0, (%rax)
je 0x62e83
movq (%rbx), %rdi
leaq 0x1a205d(%rip), %rax    # 0x204ed0
movl (%rax), %edx
leaq 0xab081(%rip), %rsi     # 0x10defd
xorl %eax, %eax
callq 0x9560
leaq 0x1a2032(%rip), %rax    # 0x204ebc
cmpl $0x0, (%rax)
je 0x62ea9
movq (%rbx), %rdi
leaq 0x1a203b(%rip), %rax    # 0x204ed4
movl (%rax), %edx
leaq 0xab063(%rip), %rsi     # 0x10df05
xorl %eax, %eax
callq 0x9560
leaq 0x1a2018(%rip), %rax    # 0x204ec8
cmpl $0x0, (%rax)
je 0x62ecf
movq (%rbx), %rdi
leaq 0x1a201d(%rip), %rax    # 0x204edc
movl (%rax), %edx
leaq 0xab045(%rip), %rsi     # 0x10df0d
xorl %eax, %eax
callq 0x9560
leaq 0x1a1fea(%rip), %rax    # 0x204ec0
cmpl $0x0, (%rax)
je 0x62ef5
movq (%rbx), %rdi
leaq 0x1a1ff3(%rip), %rax    # 0x204ed8
movl (%rax), %edx
leaq 0xab028(%rip), %rsi     # 0x10df16
xorl %eax, %eax
callq 0x9560
movq (%rbx), %rcx
leaq 0xab01f(%rip), %rdi     # 0x10df1e
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
callq 0x9750
movq (%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9420
addq $0x8, %rsp
popq %rbx
popq %rbp
retq