// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Hn()
void parse_moto_Hn()
{
int i;
S32 sawtooth;
s16 accu;
int traim_flag;
int prn;
u32 frac;

   log_packet_id("traim info");
   if(moto_chans != 12) {
      moto_chans = 12;
      config_msg_ofs();
   }

   tsip_byte();   // pulse
   tsip_byte();   // synced to
   traim_status = tsip_byte();  // timing solution
   traim_flag = tsip_byte();    // traim status
   have_traim = 1;
//sprintf(debug_text2, "traim status:%d", traim_status);
   tsip_dword();  // Traim removed sats vector

   accu = tsip_word();     // time accuracy
   sawtooth = tsip_byte(); // sawtooth
   if(sawtooth & 0x80) sawtooth |= (~(S32)0xFF);
   have_sawtooth = 1;

   dac_voltage = (float) sawtooth;
   pps_offset = (double) accu;
   have_pps_offset = 6;
   have_rcvr_pps = 6;
//adadad   if(jitter_adev == 0) do_pps_adev(pps_offset);

   for(i=0; i<12; i++) {
      prn = tsip_byte();  // prn
      frac = tsip_dword(); // time fraction
      if(frac >= 1000000000) frac = 0;

      if(0 && (prn >= 1) && (prn <= MAX_PRN)) { 
         sat[prn].sat_bias = (float) (((double) frac) * 1.0E-9);
         sat[prn].last_bias_msg = 2;

         if(frac > 0) {
            if(have_bias == 0) need_redraw = 2047;
            have_bias = 2;
         }
      }
   }
//sprintf(debug_text2, "Hn: thresh:%d tmode:%d tstat:%d flag:%d   pps:%d  saw:%d  rate:%d  accu:%d ", 
//traim_threshold,traim_mode,traim_status,traim_flag,   pps_mode,sawtooth,pps_rate,accu);
//sprintf(debug_text, "baud:%d db:%d par:%d stop:%d", baud_rate,com[RCVR_PORT].data_bits,com[RCVR_PORT].parity,com[RCVR_PORT].stop_bits);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x88a20(%rip), %rdi     # 0x124de3
callq 0x58dc2
leaq 0x17ec55(%rip), %rax    # 0x21b024
cmpl $0xc, (%rax)
je 0x9c3df
movl $0xc, (%rax)
callq 0x4771f
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c3f5
leaq 0x1a2b7e(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c40b
leaq 0x1a2b68(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c421
leaq 0x1a2b52(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x17ec9d(%rip), %rcx    # 0x21b0c8
movl %eax, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c443
leaq 0x1a2b30(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
leaq 0x270f7e(%rip), %rax    # 0x30d3c8
movl $0x1, (%rax)
callq 0x58964
callq 0x588d2
movl %eax, %ebx
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c472
leaq 0x1a2b01(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movsbl %al, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl %eax, %ecx
leaq 0x270f3d(%rip), %rax    # 0x30d3c4
cvtsi2ss %ecx, %xmm0
movl $0x1, (%rax)
cvtss2sd %xmm0, %xmm0
leaq 0x270564(%rip), %rax    # 0x30ca00
movsd %xmm0, (%rax)
movswl %bx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leaq 0x270307(%rip), %rax    # 0x30c7b8
movsd %xmm0, (%rax)
leaq 0x270d7c(%rip), %rax    # 0x30d238
movl $0x6, %ecx
movl %ecx, (%rax)
leaq 0x270d7a(%rip), %rax    # 0x30d244
movl %ecx, (%rax)
movl $0xc, %ebx
leaq 0x1a2a98(%rip), %r14    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c4e8
orb $0x8, (%r14)
callq 0x58964
decl %ebx
jne 0x9c4d8
popq %rbx
popq %r14
popq %rbp
retq