// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1b1971(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
movabsq $0x100000000, %rbx      # imm = 0x100000000
je 0x76adb
leaq 0x18be6a(%rip), %rax    # 0x2028d0
movq (%rax), %rax
cmpq $0x10000, %rax          # imm = 0x10000
je 0x76a7e
cmpq %rbx, %rax
je 0x76a7e
cmpq $0x80000, %rax          # imm = 0x80000
jne 0x76adb
leaq 0x1b0273(%rip), %r14    # 0x226cf8
movsd (%r14), %xmm0
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xc2faf
leaq 0x280c4c(%rip), %rax    # 0x2f76e8
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
callq 0x55392
leaq 0x280a18(%rip), %rax    # 0x2f74c8
cvtsi2sdl (%rax), %xmm2
leaq 0x280a5d(%rip), %rax    # 0x2f7518
addsd (%rax), %xmm2
movsd (%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x76bb6
divsd %xmm0, %xmm2
jmp 0x76bb6
callq 0xa386
leaq 0x280be1(%rip), %rax    # 0x2f76c8
movl (%rax), %eax
leaq 0x280a24(%rip), %rcx    # 0x2f7514
movl %eax, (%rcx)
leaq 0x2809e3(%rip), %rcx    # 0x2f74dc
movl %eax, (%rcx)
leaq 0x280bbe(%rip), %rax    # 0x2f76c0
movl (%rax), %eax
leaq 0x280a05(%rip), %rcx    # 0x2f7510
movl %eax, (%rcx)
leaq 0x2809c4(%rip), %rcx    # 0x2f74d8
movl %eax, (%rcx)
leaq 0x280ba7(%rip), %rax    # 0x2f76c4
movl (%rax), %eax
leaq 0x2809e6(%rip), %rcx    # 0x2f750c
movl %eax, (%rcx)
leaq 0x2809a5(%rip), %rcx    # 0x2f74d4
movl %eax, (%rcx)
leaq 0x280b94(%rip), %rax    # 0x2f76cc
movl (%rax), %eax
leaq 0x2809c7(%rip), %rcx    # 0x2f7508
movl %eax, (%rcx)
leaq 0x280986(%rip), %rcx    # 0x2f74d0
movl %eax, (%rcx)
leaq 0x280b7d(%rip), %rax    # 0x2f76d0
movl (%rax), %eax
leaq 0x2809a8(%rip), %rcx    # 0x2f7504
movl %eax, (%rcx)
leaq 0x280967(%rip), %rcx    # 0x2f74cc
movl %eax, (%rcx)
leaq 0x280b66(%rip), %rax    # 0x2f76d4
movl (%rax), %eax
leaq 0x280989(%rip), %rcx    # 0x2f7500
movl %eax, (%rcx)
leaq 0x280948(%rip), %rcx    # 0x2f74c8
movl %eax, (%rcx)
leaq 0x280b4f(%rip), %rcx    # 0x2f76d8
movsd (%rcx), %xmm0
leaq 0x28094c(%rip), %rcx    # 0x2f74e0
movsd %xmm0, (%rcx)
leaq 0x280979(%rip), %rcx    # 0x2f7518
movsd %xmm0, (%rcx)
cvtsi2sd %eax, %xmm2
addsd %xmm0, %xmm2
leaq 0x18e7a6(%rip), %rax    # 0x205358
mulsd (%rax), %xmm2
leaq 0x18e413(%rip), %rax    # 0x204fd0
cmpl $0x0, (%rax)
je 0x76bd8
leaq 0x2807fb(%rip), %rax    # 0x2f73c4
cmpl $0x0, (%rax)
jne 0x76bd8
movl $0x270f, 0xdda5c(%rip)  # imm = 0x270F
movsd %xmm2, -0x20(%rbp)
leaq 0x2808d9(%rip), %rax    # 0x2f74bd
cmpb $0x0, (%rax)
je 0x76bf4
xorpd %xmm0, %xmm0
callq 0x55462
jmp 0x76bf9
callq 0x554d3
cvttsd2si -0x20(%rbp), %r15d
leaq 0x18bcca(%rip), %r14    # 0x2028d0
movq (%r14), %rax
cmpq $0x10000, %rax          # imm = 0x10000
jne 0x76c42
leaq 0x18e75c(%rip), %rcx    # 0x205374
cmpl $0x0, (%rcx)
je 0x76c42
leaq 0x18e73c(%rip), %rax    # 0x205360
movsd (%rax), %xmm0
leaq 0x18e729(%rip), %rax    # 0x205358
movsd %xmm0, (%rax)
leaq 0x280692(%rip), %rax    # 0x2f72cc
movl $0x22b, (%rax)          # imm = 0x22B
jmp 0x76ca5
cmpq %rbx, %rax
jne 0x76ca5
leaq 0x28088e(%rip), %rax    # 0x2f74dc
movl (%rax), %edi
leaq 0x280881(%rip), %rax    # 0x2f74d8
movl (%rax), %esi
leaq 0x280874(%rip), %rax    # 0x2f74d4
movl (%rax), %edx
callq 0xc2f07
movsd %xmm0, -0x20(%rbp)
leaq 0x28085d(%rip), %rax    # 0x2f74d0
movl (%rax), %edi
leaq 0x280850(%rip), %rax    # 0x2f74cc
movl (%rax), %esi
leaq 0x280843(%rip), %rax    # 0x2f74c8
movl (%rax), %edx
xorpd %xmm0, %xmm0
callq 0xc2faf
addsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x2df113(%rip)   # 0x355db0
pushq $0x1
popq %rdi
callq 0x64e93
cmpl %r15d, 0xdd988(%rip)    # 0x154634
jne 0x76ce0
leaq 0x18bc2b(%rip), %rax    # 0x2028e0
xorl %ebx, %ebx
cmpl $0x0, (%rax)
je 0x76cef
leaq 0x27fae5(%rip), %rax    # 0x2f67a8
movb (%rax), %al
cmpb $0x60, %al
je 0x76cef
cmpb $0x4b, %al
je 0x76cef
cmpq $0x400, (%r14)          # imm = 0x400
jne 0x76cef
pushq $0x64
popq %rdi
callq 0x1f6f0
jmp 0x76cef
pushq $0x1
popq %rbx
movl %r15d, 0xdd94a(%rip)    # 0x154634
callq 0x694f6
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq