// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x1bbf34(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
je 0x8251a
leaq 0x196433(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x10000, %rax          # imm = 0x10000
je 0x824bf
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
je 0x824bf
cmpq $0x80000, %rax          # imm = 0x80000
jne 0x8251a
leaq 0x1ba832(%rip), %rbx    # 0x23ccf8
movsd (%rbx), %xmm0
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd492e
leaq 0x28b20c(%rip), %rax    # 0x30d6e8
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
callq 0x5c71d
leaq 0x28afd8(%rip), %rax    # 0x30d4c8
cvtsi2sdl (%rax), %xmm2
leaq 0x28b01d(%rip), %rax    # 0x30d518
addsd (%rax), %xmm2
movsd (%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x825f5
divsd %xmm0, %xmm2
jmp 0x825f5
callq 0xa477
leaq 0x28b1a2(%rip), %rax    # 0x30d6c8
movl (%rax), %eax
leaq 0x28afe5(%rip), %rcx    # 0x30d514
movl %eax, (%rcx)
leaq 0x28afa4(%rip), %rcx    # 0x30d4dc
movl %eax, (%rcx)
leaq 0x28b17f(%rip), %rax    # 0x30d6c0
movl (%rax), %eax
leaq 0x28afc6(%rip), %rcx    # 0x30d510
movl %eax, (%rcx)
leaq 0x28af85(%rip), %rcx    # 0x30d4d8
movl %eax, (%rcx)
leaq 0x28b168(%rip), %rax    # 0x30d6c4
movl (%rax), %eax
leaq 0x28afa7(%rip), %rcx    # 0x30d50c
movl %eax, (%rcx)
leaq 0x28af66(%rip), %rcx    # 0x30d4d4
movl %eax, (%rcx)
leaq 0x28b155(%rip), %rax    # 0x30d6cc
movl (%rax), %eax
leaq 0x28af88(%rip), %rcx    # 0x30d508
movl %eax, (%rcx)
leaq 0x28af47(%rip), %rcx    # 0x30d4d0
movl %eax, (%rcx)
leaq 0x28b13e(%rip), %rax    # 0x30d6d0
movl (%rax), %eax
leaq 0x28af69(%rip), %rcx    # 0x30d504
movl %eax, (%rcx)
leaq 0x28af28(%rip), %rcx    # 0x30d4cc
movl %eax, (%rcx)
leaq 0x28b127(%rip), %rax    # 0x30d6d4
movl (%rax), %eax
leaq 0x28af4a(%rip), %rcx    # 0x30d500
movl %eax, (%rcx)
leaq 0x28af09(%rip), %rcx    # 0x30d4c8
movl %eax, (%rcx)
leaq 0x28b110(%rip), %rcx    # 0x30d6d8
movsd (%rcx), %xmm0
leaq 0x28af0d(%rip), %rcx    # 0x30d4e0
movsd %xmm0, (%rcx)
leaq 0x28af3a(%rip), %rcx    # 0x30d518
movsd %xmm0, (%rcx)
cvtsi2sd %eax, %xmm2
addsd %xmm0, %xmm2
leaq 0x198d67(%rip), %rax    # 0x21b358
mulsd (%rax), %xmm2
leaq 0x1989d4(%rip), %rax    # 0x21afd0
cmpl $0x0, (%rax)
je 0x82617
leaq 0x28adbc(%rip), %rax    # 0x30d3c4
cmpl $0x0, (%rax)
jne 0x82617
movl $0x270f, 0xe801d(%rip)  # imm = 0x270F
movsd %xmm2, -0x18(%rbp)
leaq 0x28ae9a(%rip), %rax    # 0x30d4bd
cmpb $0x0, (%rax)
je 0x82633
xorpd %xmm0, %xmm0
callq 0x5c7ed
jmp 0x8265d
leaq 0x28b0ee(%rip), %rax    # 0x30d728
xorps %xmm0, %xmm0
cvtsi2sdl (%rax), %xmm0
callq 0x5c7ed
leaq 0x28ae57(%rip), %rax    # 0x30d4a4
andb $-0x2, (%rax)
leaq 0x28ad75(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
cvttsd2si -0x18(%rbp), %ebx
leaq 0x196267(%rip), %r14    # 0x2188d0
movq (%r14), %rax
cmpq $0x10000, %rax          # imm = 0x10000
jne 0x826a5
leaq 0x198cf9(%rip), %rcx    # 0x21b374
cmpl $0x0, (%rcx)
je 0x826a5
leaq 0x198cd9(%rip), %rax    # 0x21b360
movsd (%rax), %xmm0
leaq 0x198cc6(%rip), %rax    # 0x21b358
movsd %xmm0, (%rax)
leaq 0x28ac2f(%rip), %rax    # 0x30d2cc
movl $0x22b, (%rax)          # imm = 0x22B
jmp 0x82714
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
jne 0x82714
leaq 0x28ae21(%rip), %rax    # 0x30d4dc
movl (%rax), %edi
leaq 0x28ae14(%rip), %rax    # 0x30d4d8
movl (%rax), %esi
leaq 0x28ae07(%rip), %rax    # 0x30d4d4
movl (%rax), %edx
callq 0xd485e
movsd %xmm0, -0x18(%rbp)
leaq 0x28adf0(%rip), %rax    # 0x30d4d0
movl (%rax), %edi
leaq 0x28ade3(%rip), %rax    # 0x30d4cc
movl (%rax), %esi
leaq 0x28add6(%rip), %rax    # 0x30d4c8
movl (%rax), %edx
xorpd %xmm0, %xmm0
callq 0xd492e
addsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x2e96a6(%rip)   # 0x36bdb0
movl $0x1, %edi
callq 0x6e25f
cmpl %ebx, 0xe7f1a(%rip)     # 0x16a634
jne 0x82750
leaq 0x1961bd(%rip), %rax    # 0x2188e0
xorl %ebx, %ebx
cmpl $0x0, (%rax)
je 0x82760
leaq 0x28a077(%rip), %rax    # 0x30c7a8
movb (%rax), %al
cmpb $0x60, %al
je 0x82760
cmpb $0x4b, %al
je 0x82760
cmpq $0x400, (%r14)          # imm = 0x400
jne 0x82760
movl $0x64, %edi
callq 0x20b8c
jmp 0x82760
movl %ebx, 0xe7ede(%rip)     # 0x16a634
callq 0x730e8
movl $0x1, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq