// File: /workspace/github_cpp_makefile_star2_O3/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 0x993b8(%rip), %rdi     # 0x123782
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x8a407
leaq 0x2b1661(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1bbd(%rip), %rax    # 0x33bfa8
movsd %xmm0, (%rax)
leaq 0x2823c2(%rip), %rax    # 0x30c7b8
movsd %xmm0, (%rax)
leaq 0x282e37(%rip), %rax    # 0x30d238
movl $0x1c8, (%rax)          # imm = 0x1C8
callq 0x810b1
testl %eax, %eax
je 0x8a432
leaq 0x2b1629(%rip), %rax    # 0x33ba40
leaq 0x1(%rax), %rdi
cmpb $0x25, (%rax)
cmovneq %rax, %rdi
callq 0x9470
leaq 0x2b1b8a(%rip), %rax    # 0x33bfb8
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x8a452
leaq 0x2b15fe(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1b62(%rip), %rax    # 0x33bfb0
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x8a49a
leaq 0x2b15de(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1b52(%rip), %rax    # 0x33bfc0
movsd %xmm0, (%rax)
divsd 0x942be(%rip), %xmm0    # 0x11e738
mulsd 0x7ebde(%rip), %xmm0    # 0x109060
leaq 0x282577(%rip), %rax    # 0x30ca00
movsd %xmm0, (%rax)
leaq 0x282e68(%rip), %rax    # 0x30d2fc
movl $0x2c, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x8a4da
leaq 0x2b1596(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1b12(%rip), %rax    # 0x33bfc8
movsd %xmm0, (%rax)
mulsd 0x7ec96(%rip), %xmm0    # 0x109158
leaq 0x2822f7(%rip), %rax    # 0x30c7c0
movsd %xmm0, (%rax)
leaq 0x282d60(%rip), %rax    # 0x30d234
movl $0x2c, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x8a4fa
leaq 0x2b1556(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2b1ada(%rip), %rax    # 0x33bfd0
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x8a51a
leaq 0x2b1536(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2b1acb(%rip), %rdi    # 0x33bfe0
callq 0x9340
callq 0x810b1
testl %eax, %eax
je 0x8a53a
leaq 0x2b1516(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2824e2(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x8a581
leaq 0x2b14f6(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x2b1aae(%rip), %rcx    # 0x33c004
movl %eax, (%rcx)
xorl %ecx, %ecx
testb $-0x8, %al
setne %cl
leaq 0x282c72(%rip), %rax    # 0x30d1d8
movl $0xfdffffff, %edx       # imm = 0xFDFFFFFF
andl (%rax), %edx
shll $0x19, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
leaq 0x282c69(%rip), %rax    # 0x30d1e4
movl $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x8a5cd
leaq 0x2b14af(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x2b1a6b(%rip), %rcx    # 0x33c008
movl %eax, (%rcx)
xorl %ecx, %ecx
testb $0xc, %al
setne %cl
leaq 0x282ef7(%rip), %rdx    # 0x30d4a4
movl (%rdx), %esi
andl $-0x5, %esi
leal (%rsi,%rcx,4), %ecx
movl %ecx, (%rdx)
leaq 0x282c1a(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
andl $-0x11, %edx
shll $0x4, %eax
andl $0x10, %eax
orl %edx, %eax
movl %eax, (%rcx)
callq 0x810b1
testl %eax, %eax
je 0x8a5f7
leaq 0x2b1463(%rip), %rsi    # 0x33ba40
movb $0x0, 0x10(%rsi)
leaq 0x2b17e8(%rip), %rdi    # 0x33bdd0
callq 0x9340
leaq 0x283380(%rip), %rax    # 0x30d974
orb $0x1, (%rax)
popq %rbp
retq