// File: /workspace/github_cpp_makefile_star2_O1/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 0x1bbe37(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
movabsq $0x100000000, %rbx      # imm = 0x100000000
je 0x82615
leaq 0x196330(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x10000, %rax          # imm = 0x10000
je 0x825b8
cmpq %rbx, %rax
je 0x825b8
cmpq $0x80000, %rax          # imm = 0x80000
jne 0x82615
leaq 0x1ba739(%rip), %r14    # 0x23ccf8
movsd (%r14), %xmm0
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd41e0
leaq 0x28b112(%rip), %rax    # 0x30d6e8
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
callq 0x5c837
leaq 0x28aede(%rip), %rax    # 0x30d4c8
cvtsi2sdl (%rax), %xmm2
leaq 0x28af23(%rip), %rax    # 0x30d518
addsd (%rax), %xmm2
movsd (%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x826f0
divsd %xmm0, %xmm2
jmp 0x826f0
callq 0xa495
leaq 0x28b0a7(%rip), %rax    # 0x30d6c8
movl (%rax), %eax
leaq 0x28aeea(%rip), %rcx    # 0x30d514
movl %eax, (%rcx)
leaq 0x28aea9(%rip), %rcx    # 0x30d4dc
movl %eax, (%rcx)
leaq 0x28b084(%rip), %rax    # 0x30d6c0
movl (%rax), %eax
leaq 0x28aecb(%rip), %rcx    # 0x30d510
movl %eax, (%rcx)
leaq 0x28ae8a(%rip), %rcx    # 0x30d4d8
movl %eax, (%rcx)
leaq 0x28b06d(%rip), %rax    # 0x30d6c4
movl (%rax), %eax
leaq 0x28aeac(%rip), %rcx    # 0x30d50c
movl %eax, (%rcx)
leaq 0x28ae6b(%rip), %rcx    # 0x30d4d4
movl %eax, (%rcx)
leaq 0x28b05a(%rip), %rax    # 0x30d6cc
movl (%rax), %eax
leaq 0x28ae8d(%rip), %rcx    # 0x30d508
movl %eax, (%rcx)
leaq 0x28ae4c(%rip), %rcx    # 0x30d4d0
movl %eax, (%rcx)
leaq 0x28b043(%rip), %rax    # 0x30d6d0
movl (%rax), %eax
leaq 0x28ae6e(%rip), %rcx    # 0x30d504
movl %eax, (%rcx)
leaq 0x28ae2d(%rip), %rcx    # 0x30d4cc
movl %eax, (%rcx)
leaq 0x28b02c(%rip), %rax    # 0x30d6d4
movl (%rax), %eax
leaq 0x28ae4f(%rip), %rcx    # 0x30d500
movl %eax, (%rcx)
leaq 0x28ae0e(%rip), %rcx    # 0x30d4c8
movl %eax, (%rcx)
leaq 0x28b015(%rip), %rcx    # 0x30d6d8
movsd (%rcx), %xmm0
leaq 0x28ae12(%rip), %rcx    # 0x30d4e0
movsd %xmm0, (%rcx)
leaq 0x28ae3f(%rip), %rcx    # 0x30d518
movsd %xmm0, (%rcx)
cvtsi2sd %eax, %xmm2
addsd %xmm0, %xmm2
leaq 0x198c6c(%rip), %rax    # 0x21b358
mulsd (%rax), %xmm2
leaq 0x1988d9(%rip), %rax    # 0x21afd0
cmpl $0x0, (%rax)
je 0x82712
leaq 0x28acc1(%rip), %rax    # 0x30d3c4
cmpl $0x0, (%rax)
jne 0x82712
movl $0x270f, 0xe7f22(%rip)  # imm = 0x270F
movsd %xmm2, -0x20(%rbp)
leaq 0x28ad9f(%rip), %rax    # 0x30d4bd
cmpb $0x0, (%rax)
je 0x8272e
xorpd %xmm0, %xmm0
callq 0x5c907
jmp 0x82758
leaq 0x28aff3(%rip), %rax    # 0x30d728
xorps %xmm0, %xmm0
cvtsi2sdl (%rax), %xmm0
callq 0x5c907
leaq 0x28ad5c(%rip), %rax    # 0x30d4a4
andb $-0x2, (%rax)
leaq 0x28ac7a(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
leaq 0x196171(%rip), %r14    # 0x2188d0
movq (%r14), %rax
cmpq $0x10000, %rax          # imm = 0x10000
movsd -0x20(%rbp), %xmm1
jne 0x8279e
leaq 0x198bfe(%rip), %rcx    # 0x21b374
cmpl $0x0, (%rcx)
je 0x8279e
leaq 0x198bde(%rip), %rcx    # 0x21b360
movsd (%rcx), %xmm0
leaq 0x198bcb(%rip), %rcx    # 0x21b358
movsd %xmm0, (%rcx)
leaq 0x28ab34(%rip), %rcx    # 0x30d2cc
movl $0x22b, (%rcx)          # imm = 0x22B
cvttsd2si %xmm1, %r15d
cmpq %rbx, %rax
jne 0x82808
leaq 0x28ad2d(%rip), %rax    # 0x30d4dc
movl (%rax), %edi
leaq 0x28ad20(%rip), %rax    # 0x30d4d8
movl (%rax), %esi
leaq 0x28ad13(%rip), %rax    # 0x30d4d4
movl (%rax), %edx
callq 0xd4110
movsd %xmm0, -0x20(%rbp)
leaq 0x28acfc(%rip), %rax    # 0x30d4d0
movl (%rax), %edi
leaq 0x28acef(%rip), %rax    # 0x30d4cc
movl (%rax), %esi
leaq 0x28ace2(%rip), %rax    # 0x30d4c8
movl (%rax), %edx
xorpd %xmm0, %xmm0
callq 0xd41e0
addsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x2e95b2(%rip)   # 0x36bdb0
movl $0x1, %edi
callq 0x6e34a
cmpl %r15d, 0xe7e25(%rip)    # 0x16a634
jne 0x82845
leaq 0x1960c8(%rip), %rax    # 0x2188e0
xorl %ebx, %ebx
cmpl $0x0, (%rax)
je 0x82856
leaq 0x289f82(%rip), %rax    # 0x30c7a8
movb (%rax), %al
cmpb $0x60, %al
je 0x82856
cmpb $0x4b, %al
je 0x82856
cmpq $0x400, (%r14)          # imm = 0x400
jne 0x82856
movl $0x64, %edi
callq 0x20bc4
jmp 0x82856
movl %r15d, 0xe7de8(%rip)    # 0x16a634
callq 0x7327e
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq