// File: jkingan[P]ladyheather/heathgps.cpp
// Function: get_norcvr_message()
int get_norcvr_message()
{
static int last_tick = (9999);
int this_tick;
double ss;

   // system clock driven receiverless mode handler
   // returns 1 if screen was updated because seconds ticked

   if(sim_file && ((rcvr_type == TICC_RCVR) || (rcvr_type == THERMO_RCVR) || (rcvr_type == Z12_RCVR))) {
      sim_jd += jtime(0,0,0, adev_period);   // aaaaaapppppp
      set_gregorian_time(sim_jd);
      ss = (((double) seconds) + pri_frac);
      if(adev_period > 0.0) ss /= adev_period;
   }
   else {
      get_clock_time();   // get system clock time in UTC

      year = pri_year = clk_year;
      month = pri_month = clk_month;
      day = pri_day = clk_day;

      hours = pri_hours = clk_hours;
      minutes = pri_minutes = clk_minutes;
      seconds = pri_seconds = clk_seconds;
      pri_frac = raw_frac = clk_frac;
      ss = (((double) seconds) + pri_frac) * nav_rate;
   }

   this_tick = (int) ss;
//sprintf(debug_text, "nr:%g  usnr:%d  last:%d this:%d  ss=%g  frac:%g", nav_rate,user_set_nav_rate, last_tick, this_tick, ss, pri_frac);
//if(rcvr_type == TICC_RCVR) last_tick = (9999);  // aaaahhhh make sure every sample gets into the plot queue
if(lte_lite && (have_sawtooth == 0)) last_tick = 9999;

   if(timing_mode == TMODE_GPS) {     // convert utc time to gps time
      utc_to_gps();
   }
   else {
      adjust_rcvr_time(0.0);  // incorporarte possibly negative fractional second into time variables
   }

   if((rcvr_type == TICC_RCVR) && user_set_nav_rate) {
      nav_rate = user_nav_rate;
      have_nav_rate = 555;
   }
if(rcvr_type == Z12_RCVR) {
   jd_zda = jdate(year,month,day) + jtime(hours,minutes,seconds,0.0);
   poll_z12_time(1);
}

   if(last_tick != this_tick) {  // aaaaahhhhh
      last_tick = this_tick;
//if(debug_file) fprintf(debug_file, "Tick!\n");
      update_gps_screen(555);
      return 1;
   }

   if(calc_rcvr) {  // calculator only mode - keep calculator active and zoomed
      if(zoom_screen == '`') ;
      else if(zoom_screen == 'K') ;
      else if(rcvr_type == NO_RCVR) { // toots
         start_calc_zoom(100);
      }
   }

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x1eaf61(%rip), %rax    # 0x29d5a0
cmpq $0x0, (%rax)
je 0xb270c
leaq 0x1c5460(%rip), %rax    # 0x277ab0
cmpq $0x10000, (%rax)        # imm = 0x10000
je 0xb2683
leaq 0x1c5450(%rip), %rax    # 0x277ab0
cmpq $0x80000, (%rax)        # imm = 0x80000
je 0xb2683
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq 0x1c5436(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0xb270c
leaq 0x1e984e(%rip), %rax    # 0x29bed8
movsd (%rax), %xmm0
xorl %edx, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x122210
leaq 0x2ba228(%rip), %rax    # 0x36c8c8
addsd (%rax), %xmm0
leaq 0x2ba21d(%rip), %rax    # 0x36c8c8
movsd %xmm0, (%rax)
leaq 0x2ba212(%rip), %rax    # 0x36c8c8
movsd (%rax), %xmm0
callq 0x7fb00
leaq 0x2b9fe2(%rip), %rax    # 0x36c6a8
cvtsi2sdl (%rax), %xmm0
leaq 0x2ba027(%rip), %rax    # 0x36c6f8
addsd (%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
leaq 0x1e97f7(%rip), %rax    # 0x29bed8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xb2707
leaq 0x1e97e3(%rip), %rax    # 0x29bed8
movsd (%rax), %xmm1
movsd -0x10(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0xb27fa
callq 0xa750
leaq 0x2ba190(%rip), %rax    # 0x36c8a8
movl (%rax), %ecx
leaq 0x2b9fd3(%rip), %rax    # 0x36c6f4
movl %ecx, (%rax)
leaq 0x2b9f92(%rip), %rax    # 0x36c6bc
movl %ecx, (%rax)
leaq 0x2ba16d(%rip), %rax    # 0x36c8a0
movl (%rax), %ecx
leaq 0x2b9fb4(%rip), %rax    # 0x36c6f0
movl %ecx, (%rax)
leaq 0x2b9f73(%rip), %rax    # 0x36c6b8
movl %ecx, (%rax)
leaq 0x2ba156(%rip), %rax    # 0x36c8a4
movl (%rax), %ecx
leaq 0x2b9f95(%rip), %rax    # 0x36c6ec
movl %ecx, (%rax)
leaq 0x2b9f54(%rip), %rax    # 0x36c6b4
movl %ecx, (%rax)
leaq 0x2ba143(%rip), %rax    # 0x36c8ac
movl (%rax), %ecx
leaq 0x2b9f76(%rip), %rax    # 0x36c6e8
movl %ecx, (%rax)
leaq 0x2b9f35(%rip), %rax    # 0x36c6b0
movl %ecx, (%rax)
leaq 0x2ba12c(%rip), %rax    # 0x36c8b0
movl (%rax), %ecx
leaq 0x2b9f57(%rip), %rax    # 0x36c6e4
movl %ecx, (%rax)
leaq 0x2b9f16(%rip), %rax    # 0x36c6ac
movl %ecx, (%rax)
leaq 0x2ba115(%rip), %rax    # 0x36c8b4
movl (%rax), %ecx
leaq 0x2b9f38(%rip), %rax    # 0x36c6e0
movl %ecx, (%rax)
leaq 0x2b9ef7(%rip), %rax    # 0x36c6a8
movl %ecx, (%rax)
leaq 0x2ba0fe(%rip), %rax    # 0x36c8b8
movsd (%rax), %xmm0
leaq 0x2b9efb(%rip), %rax    # 0x36c6c0
movsd %xmm0, (%rax)
leaq 0x2b9f28(%rip), %rax    # 0x36c6f8
movsd %xmm0, (%rax)
leaq 0x2b9ecd(%rip), %rax    # 0x36c6a8
cvtsi2sdl (%rax), %xmm0
leaq 0x2b9f12(%rip), %rax    # 0x36c6f8
addsd (%rax), %xmm0
leaq 0x1c7d47(%rip), %rax    # 0x27a538
mulsd (%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
cvttsd2si -0x10(%rbp), %eax
movl %eax, -0x8(%rbp)
leaq 0x1c79a7(%rip), %rax    # 0x27a1b0
cmpl $0x0, (%rax)
je 0xb2824
leaq 0x2b9d8f(%rip), %rax    # 0x36c5a4
cmpl $0x0, (%rax)
jne 0xb2824
movl $0x270f, 0x116e08(%rip) # imm = 0x270F
leaq 0x2b9e72(%rip), %rax    # 0x36c69d
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xb283a
callq 0x7fc70
jmp 0xb2842
xorps %xmm0, %xmm0
callq 0x7fbf0
leaq 0x1c5267(%rip), %rax    # 0x277ab0
cmpq $0x10000, (%rax)        # imm = 0x10000
jne 0xb2881
leaq 0x1c7cfb(%rip), %rax    # 0x27a554
cmpl $0x0, (%rax)
je 0xb2881
leaq 0x1c7cdb(%rip), %rax    # 0x27a540
movsd (%rax), %xmm0
leaq 0x1c7cc8(%rip), %rax    # 0x27a538
movsd %xmm0, (%rax)
leaq 0x2b9c31(%rip), %rax    # 0x36c4ac
movl $0x22b, (%rax)          # imm = 0x22B
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq 0x1c521e(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0xb28fd
leaq 0x2b9e1e(%rip), %rax    # 0x36c6bc
movl (%rax), %edi
leaq 0x2b9e11(%rip), %rax    # 0x36c6b8
movl (%rax), %esi
leaq 0x2b9e04(%rip), %rax    # 0x36c6b4
movl (%rax), %edx
callq 0x122140
movsd %xmm0, -0x18(%rbp)
leaq 0x2b9ded(%rip), %rax    # 0x36c6b0
movl (%rax), %edi
leaq 0x2b9de0(%rip), %rax    # 0x36c6ac
movl (%rax), %esi
leaq 0x2b9dd3(%rip), %rax    # 0x36c6a8
movl (%rax), %edx
xorps %xmm0, %xmm0
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x18(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x31869d(%rip)   # 0x3caf90
movl $0x1, %edi
callq 0x962d0
movl 0x116d29(%rip), %eax    # 0x1c962c
cmpl -0x8(%rbp), %eax
je 0xb2924
movl -0x8(%rbp), %eax
movl %eax, 0x116d1b(%rip)    # 0x1c962c
movl $0x22b, %edi            # imm = 0x22B
callq 0x9d790
movl $0x1, -0x4(%rbp)
jmp 0xb2979
leaq 0x1c5195(%rip), %rax    # 0x277ac0
cmpl $0x0, (%rax)
je 0xb2972
leaq 0x2b9051(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x60, %eax
jne 0xb2941
jmp 0xb2970
leaq 0x2b9040(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x4b, %eax
jne 0xb2952
jmp 0xb296e
leaq 0x1c5157(%rip), %rax    # 0x277ab0
cmpq $0x400, (%rax)          # imm = 0x400
jne 0xb296c
movl $0x64, %edi
callq 0x2e280
jmp 0xb296e
jmp 0xb2970
jmp 0xb2972
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)