// File: /workspace/github_cpp_makefile_star2_O1/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 0x88b15(%rip), %rdi     # 0x124d03
callq 0x58e77
leaq 0x17ee2a(%rip), %rax    # 0x21b024
cmpl $0xc, (%rax)
je 0x9c20a
movl $0xc, (%rax)
callq 0x47650
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c220
leaq 0x1a2d53(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c236
leaq 0x1a2d3d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c24c
leaq 0x1a2d27(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x17ee72(%rip), %rcx    # 0x21b0c8
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c26e
leaq 0x1a2d05(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
leaq 0x271153(%rip), %rax    # 0x30d3c8
movl $0x1, (%rax)
callq 0x589b0
callq 0x588f0
movl %eax, %ebx
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c29d
leaq 0x1a2cd6(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movsbl %al, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl %eax, %ecx
leaq 0x271112(%rip), %rax    # 0x30d3c4
cvtsi2ss %ecx, %xmm0
movl $0x1, (%rax)
cvtss2sd %xmm0, %xmm0
leaq 0x270739(%rip), %rax    # 0x30ca00
movsd %xmm0, (%rax)
movswl %bx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leaq 0x2704dc(%rip), %rax    # 0x30c7b8
movsd %xmm0, (%rax)
leaq 0x270f51(%rip), %rax    # 0x30d238
movl $0x6, %ecx
movl %ecx, (%rax)
leaq 0x270f4f(%rip), %rax    # 0x30d244
movl %ecx, (%rax)
movl $0xc, %ebx
leaq 0x1a2c6d(%rip), %r14    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9c313
orb $0x8, (%r14)
callq 0x589b0
decl %ebx
jne 0x9c303
popq %rbx
popq %r14
popq %rbp
retq