// File: 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
leaq 0x20a76d(%rip), %rax    # 0x29d598
cmpq $0x0, (%rax)
jne 0x92e36
jmp 0x93096
leaq 0x20a75b(%rip), %rax    # 0x29d598
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x93e0
leaq 0x1e7292(%rip), %rax    # 0x27a0e4
cmpl $0x0, (%rax)
je 0x92e78
leaq 0x20a73a(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e7298(%rip), %rax    # 0x27a100
movl (%rax), %edx
leaq 0xf43d6(%rip), %rsi     # 0x187247
movb $0x0, %al
callq 0x9550
leaq 0x1e7255(%rip), %rax    # 0x27a0d4
cmpl $0x0, (%rax)
je 0x92ea5
leaq 0x20a70d(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e7267(%rip), %rax    # 0x27a0fc
movl (%rax), %edx
leaq 0xf43b8(%rip), %rsi     # 0x187256
movb $0x0, %al
callq 0x9550
leaq 0x1e722c(%rip), %rax    # 0x27a0d8
cmpl $0x0, (%rax)
je 0x92ed4
leaq 0x20a6e0(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e7226(%rip), %rax    # 0x27a0e8
movsd (%rax), %xmm0
leaq 0xf4390(%rip), %rsi     # 0x18725d
movb $0x1, %al
callq 0x9550
leaq 0x1e7201(%rip), %rax    # 0x27a0dc
cmpl $0x0, (%rax)
je 0x92f03
leaq 0x20a6b1(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e71ff(%rip), %rax    # 0x27a0f0
movsd (%rax), %xmm0
leaq 0xf436d(%rip), %rsi     # 0x187269
movb $0x1, %al
callq 0x9550
leaq 0x1e71d6(%rip), %rax    # 0x27a0e0
cmpl $0x0, (%rax)
je 0x92f30
leaq 0x20a682(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e71d8(%rip), %rax    # 0x27a0f8
movl (%rax), %edx
leaq 0xf434e(%rip), %rsi     # 0x187277
movb $0x0, %al
callq 0x9550
leaq 0x1e715d(%rip), %rax    # 0x27a094
cmpl $0x0, (%rax)
je 0x92f5f
leaq 0x20a655(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e6efb(%rip), %rax    # 0x279e48
movsd (%rax), %xmm0
leaq 0xf432c(%rip), %rsi     # 0x187284
movb $0x1, %al
callq 0x9550
leaq 0x1e712a(%rip), %rax    # 0x27a090
cmpl $0x0, (%rax)
je 0x92f8e
leaq 0x20a626(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e7144(%rip), %rax    # 0x27a0c0
movsd (%rax), %xmm0
leaq 0xf4307(%rip), %rsi     # 0x18728e
movb $0x1, %al
callq 0x9550
leaq 0x1e7103(%rip), %rax    # 0x27a098
cmpl $0x0, (%rax)
je 0x92fbb
leaq 0x20a5f7(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e7101(%rip), %rax    # 0x27a0ac
movl (%rax), %edx
leaq 0xf42e2(%rip), %rsi     # 0x187296
movb $0x0, %al
callq 0x9550
leaq 0x1e70e2(%rip), %rax    # 0x27a0a4
cmpl $0x0, (%rax)
je 0x92fe8
leaq 0x20a5ca(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e70d8(%rip), %rax    # 0x27a0b0
movl (%rax), %edx
leaq 0xf42c1(%rip), %rsi     # 0x1872a2
movb $0x0, %al
callq 0x9550
leaq 0x1e70ad(%rip), %rax    # 0x27a09c
cmpl $0x0, (%rax)
je 0x93015
leaq 0x20a59d(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e70af(%rip), %rax    # 0x27a0b4
movl (%rax), %edx
leaq 0xf429c(%rip), %rsi     # 0x1872aa
movb $0x0, %al
callq 0x9550
leaq 0x1e708c(%rip), %rax    # 0x27a0a8
cmpl $0x0, (%rax)
je 0x93042
leaq 0x20a570(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e708a(%rip), %rax    # 0x27a0bc
movl (%rax), %edx
leaq 0xf4277(%rip), %rsi     # 0x1872b2
movb $0x0, %al
callq 0x9550
leaq 0x1e7057(%rip), %rax    # 0x27a0a0
cmpl $0x0, (%rax)
je 0x9306f
leaq 0x20a543(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0x1e7059(%rip), %rax    # 0x27a0b8
movl (%rax), %edx
leaq 0xf4253(%rip), %rsi     # 0x1872bb
movb $0x0, %al
callq 0x9550
leaq 0x20a522(%rip), %rax    # 0x29d598
movq (%rax), %rdi
leaq 0xf4243(%rip), %rsi     # 0x1872c3
movb $0x0, %al
callq 0x9550
leaq 0x20a50a(%rip), %rax    # 0x29d598
movq (%rax), %rdi
callq 0x9430
popq %rbp
retq
nopl (%rax,%rax)