// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_brandy_f()
void parse_brandy_f()
{

   // frequency controller info

   log_packet_id("freq controller");

   if(get_msg_field()) {  // 2 -
      inst_phase = atof(msg_field);
      pps_offset = inst_phase;
      have_pps_offset = 456;
   }

   if(get_msg_field()) {  // 3 - documentation says this should be item 4!
      if(msg_field[0] == '%') { // value out of range
         avg_phase = atof(&msg_field[1]);
      }
      else {
         avg_phase = atof(msg_field);
      }
   }

   if(get_msg_field()) {  // 4 - always 0 on GPS-4  - documentation says this should be item 3!  
      phase_control_val = atof(msg_field);
   }

   if(get_msg_field()) {  // 5 -
      freq_control_val = atof(msg_field);
      dac_voltage = (DATA_SIZE) ((freq_control_val / 32767.0) * 100.0);
      have_dac = 44;
   }

   if(get_msg_field()) {  // 6 - last freq correction
      last_freq_corr = atof(msg_field);
      osc_offset = (last_freq_corr * 1.0E12);
      have_osc_offset = 44;
   }

   if(get_msg_field()) {  // 7 - frequency trend
      freq_trend = atof(msg_field);
   }

   if(get_msg_field()) {  // 8 - date of last correction
      msg_field[32] = 0;
      strcpy(last_correction, msg_field);
   }

   if(get_msg_field()) {  // 9 - temperature (not valid on GPS-4)
      temperature = (DATA_SIZE) atof(msg_field);
//    have_temperature = 1;  // temp reading not valid
   }

   if(get_msg_field()) {  // 10 -
      phase_status = atohex(msg_field);
      if(phase_status & 0xF8) minor_alarms |= MINOR_PLL;
      else                    minor_alarms &= (~MINOR_PLL);
      have_pll = 1;
   }

   if(get_msg_field()) {  // 11 -
      pll_constraint = atohex(msg_field);

      if(pll_constraint & 0x0C) time_flags |= TFLAGS_INVALID;
      else                      time_flags &= (~TFLAGS_INVALID);

      if(pll_constraint & 0x01) minor_alarms |= MINOR_OSC_CTRL;
      else                      minor_alarms &= (~MINOR_OSC_CTRL);

   }

   if(get_msg_field()) {  // 12 - osc type
      msg_field[16] = 0;
      strcpy(brandy_osc, msg_field);
      have_info |= (MANUF_PARAMS);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x992b2(%rip), %rdi     # 0x1236a2
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0x8a42d
leaq 0x2b163b(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1b97(%rip), %rax    # 0x33bfa8
movsd %xmm0, (%rax)
leaq 0x28239c(%rip), %rax    # 0x30c7b8
movsd %xmm0, (%rax)
leaq 0x282e11(%rip), %rax    # 0x30d238
movl $0x1c8, (%rax)          # imm = 0x1C8
callq 0x811da
testl %eax, %eax
je 0x8a458
leaq 0x2b1603(%rip), %rax    # 0x33ba40
leaq 0x1(%rax), %rdi
cmpb $0x25, (%rax)
cmovneq %rax, %rdi
callq 0x9470
leaq 0x2b1b64(%rip), %rax    # 0x33bfb8
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8a478
leaq 0x2b15d8(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1b3c(%rip), %rax    # 0x33bfb0
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8a4c0
leaq 0x2b15b8(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1b2c(%rip), %rax    # 0x33bfc0
movsd %xmm0, (%rax)
divsd 0x941e8(%rip), %xmm0    # 0x11e688
mulsd 0x7ebb8(%rip), %xmm0    # 0x109060
leaq 0x282551(%rip), %rax    # 0x30ca00
movsd %xmm0, (%rax)
leaq 0x282e42(%rip), %rax    # 0x30d2fc
movl $0x2c, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8a500
leaq 0x2b1570(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1aec(%rip), %rax    # 0x33bfc8
movsd %xmm0, (%rax)
mulsd 0x7ec68(%rip), %xmm0    # 0x109150
leaq 0x2822d1(%rip), %rax    # 0x30c7c0
movsd %xmm0, (%rax)
leaq 0x282d3a(%rip), %rax    # 0x30d234
movl $0x2c, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8a520
leaq 0x2b1530(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1ab4(%rip), %rax    # 0x33bfd0
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8a540
leaq 0x2b1510(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2b1aa5(%rip), %rdi    # 0x33bfe0
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0x8a560
leaq 0x2b14f0(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2824bc(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8a5a7
leaq 0x2b14d0(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x2b1a88(%rip), %rcx    # 0x33c004
movl %eax, (%rcx)
xorl %ecx, %ecx
testb $-0x8, %al
setne %cl
leaq 0x282c4c(%rip), %rax    # 0x30d1d8
movl $0xfdffffff, %edx       # imm = 0xFDFFFFFF
andl (%rax), %edx
shll $0x19, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
leaq 0x282c43(%rip), %rax    # 0x30d1e4
movl $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8a5f3
leaq 0x2b1489(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x2b1a45(%rip), %rcx    # 0x33c008
movl %eax, (%rcx)
xorl %ecx, %ecx
testb $0xc, %al
setne %cl
leaq 0x282ed1(%rip), %rdx    # 0x30d4a4
movl (%rdx), %esi
andl $-0x5, %esi
leal (%rsi,%rcx,4), %ecx
movl %ecx, (%rdx)
leaq 0x282bf4(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
andl $-0x11, %edx
shll $0x4, %eax
andl $0x10, %eax
orl %edx, %eax
movl %eax, (%rcx)
callq 0x811da
testl %eax, %eax
je 0x8a61d
leaq 0x2b143d(%rip), %rsi    # 0x33ba40
movb $0x0, 0x10(%rsi)
leaq 0x2b17c2(%rip), %rdi    # 0x33bdd0
callq 0x9340
leaq 0x28335a(%rip), %rax    # 0x30d974
orb $0x1, (%rax)
popq %rbp
retq