LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: clear_all_data()
void clear_all_data()
{
   dont_reset_queues = 0;
   new_queue(RESET_ALL_QUEUES, 13);

   #ifdef BUFFER_LLA
      clear_lla_points(1);
   #endif
   #ifdef SIG_LEVELS
      clear_signals();
   #endif
   #ifdef SAT_TRAILS
      clear_sat_trails();
   #endif

   if(view_all_data == 1) edit_user_view("A");
   else if(view_all_data == 2) edit_user_view("T");
   need_redraw = 5566;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x122b29(%rip), %rax    # 0x15ac60
andl $0x0, (%rax)
pushq $0x7
popq %rdi
pushq $0xd
popq %rsi
callq 0x10a99
pushq $0x1
popq %rdi
callq 0xe53f2
callq 0xe3ba8
callq 0xdf56b
leaq 0x1cd267(%rip), %rax    # 0x2053c5
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x38174
cmpl $0x2, %eax
jne 0x38180
leaq 0xbf698(%rip), %rdi     # 0xf780a
jmp 0x3817b
leaq 0xd4182(%rip), %rdi     # 0x10c2fd
callq 0x2ca84
leaq 0x1ca6bd(%rip), %rax    # 0x202844
movl $0x15be, (%rax)         # imm = 0x15BE
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: config_fix_display()
void config_fix_display()
{
   change_fix_config(show_fixes);
   if(show_fixes && (precision_survey == 0) && (trimble_save == 0)) {  // set reference position for fix map
      precise_lat = lat;
      precise_lon = lon;
      precise_alt = alt;
      have_precise_lla = (-7);
      if(user_set_ref_lla == 0) {
         ref_lat = lat;
         ref_lon = lon;
         ref_alt = alt;
      }
      cos_factor = cos(ref_lat);
      if(cos_factor == 0.0) cos_factor = 0.001;
   }
   if(show_fixes) start_3d_fixes(-1, 2);
   if(1 || (GRAPH_LLA && (graph_lla == 0))) {
      config_lla_plots(KEEP_LLA_ON_HOLD, KEEP_LLA_SHOW);
   }

   config_screen(112);
   user_fix_set = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2ed138(%rip), %rbx    # 0x3252d4
movzbl (%rbx), %edi
callq 0x377c9
cmpb $0x0, (%rbx)
je 0x3827f
leaq 0x2bfce4(%rip), %rax    # 0x2f7e98
cmpb $0x0, (%rax)
jne 0x3827f
leaq 0x2bfcd8(%rip), %rax    # 0x2f7e9c
cmpl $0x0, (%rax)
jne 0x3827f
leaq 0x2bedfc(%rip), %rax    # 0x2f6fd0
movsd (%rax), %xmm0
leaq 0x2ed111(%rip), %rax    # 0x3252f0
movsd %xmm0, (%rax)
leaq 0x2bedee(%rip), %rax    # 0x2f6fd8
movsd (%rax), %xmm1
leaq 0x2ed103(%rip), %rax    # 0x3252f8
movsd %xmm1, (%rax)
leaq 0x2bede0(%rip), %rax    # 0x2f6fe0
movsd (%rax), %xmm2
leaq 0x2ed0f5(%rip), %rax    # 0x325300
movsd %xmm2, (%rax)
leaq 0x2ed0f2(%rip), %rax    # 0x325308
movl $0xfffffff9, (%rax)     # imm = 0xFFFFFFF9
leaq 0x2ed11d(%rip), %rax    # 0x325340
cmpl $0x0, (%rax)
je 0x38235
leaq 0x2ed0e1(%rip), %rax    # 0x325310
movsd (%rax), %xmm0
jmp 0x38256
leaq 0x2ed0d4(%rip), %rax    # 0x325310
movsd %xmm0, (%rax)
leaq 0x2ed0d1(%rip), %rax    # 0x325318
movsd %xmm1, (%rax)
leaq 0x2ed0ce(%rip), %rax    # 0x325320
movsd %xmm2, (%rax)
callq 0x9710
leaq 0x2bed66(%rip), %rax    # 0x2f6fc8
movsd %xmm0, (%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3827f
jp 0x3827f
movabsq $0x3f50624dd2f1a9fc, %rcx # imm = 0x3F50624DD2F1A9FC
movq %rcx, (%rax)
cmpb $0x0, (%rbx)
je 0x3828f
pushq $-0x1
popq %rdi
pushq $0x2
popq %rsi
callq 0xe534c
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x37a4d
pushq $0x70
popq %rdi
callq 0xcc4f
leaq 0x2ed02d(%rip), %rax    # 0x3252d5
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: reset_parser()
void reset_parser()
{
   // reset serial port and message parser
   tsip_sync = 0;
   tsip_wptr = 0;
   tsip_rptr = 0;
   init_messages(110, 0);
   redraw_screen();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2e456b(%rip), %rax    # 0x322256
andw $0x0, (%rax)
leaq 0x2e455c(%rip), %rax    # 0x322252
andw $0x0, (%rax)
leaq 0x2e4553(%rip), %rax    # 0x322254
andw $0x0, (%rax)
pushq $0x6e
popq %rdi
xorl %esi, %esi
callq 0x59afe
popq %rbp
jmp 0xf426
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: save_cmd_bytes(char*)
void save_cmd_bytes(char *arg)
{
u16 val;
char c;
int i;
u08 saw_digit;

   // save byte string to send to the receiver

   val = 0x00;
   saw_digit = 0;
   for(i=1; i<=(int)strlen(arg); i++) {  // get and save the string of bytes
      c = toupper(arg[i]);
      if((c >= '0') && (c <= '9')) {  // build hex value
         val = (val * 16) + (c-'0');
         saw_digit = 1;
         continue;
      }
      else if((c >= 'A') && (c <= 'F')) {  // build hex value
         val = (val * 16) + (c-'A'+10);
         saw_digit = 1;
         continue;
      }
      else if(saw_digit) {  // end of hex value
         if(arg[0] == '=') {  // add byte to list of bytes to send during receiver init
            if(user_init_len < USER_CMD_LEN) {
               user_init_cmd[user_init_len++] = (u08) val;
            }
         }
         else if(arg[0] == '$') {  // add byte to list of bytes to send every second
            if(user_pps_len < USER_CMD_LEN) {
               user_pps_cmd[user_pps_len++] = (u08) val;
            }
         }

         val = 0x00;     // setup for next hex value
         saw_digit = 0;
      }

      if(c == ',') continue;   // values can be separated by spaces or commas
      else if(c == ' ') continue;
      else break;  // anything else ends the list of hex values
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %r14
xorl %r12d, %r12d
leaq 0x2ddc76(%rip), %r13    # 0x321244
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x9120
cltq
cmpq %rax, %r14
jg 0x436a1
movsbl (%rbx,%r14), %edi
callq 0x9700
movsbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x43611
shll $0x4, %r12d
addl $0xffd0, %ecx           # imm = 0xFFD0
orl %r12d, %ecx
movb $0x1, %r15b
movl %ecx, %r12d
jmp 0x43699
leal -0x41(%rcx), %edx
cmpl $0x5, %edx
ja 0x43629
shll $0x4, %r12d
addl %ecx, %r12d
addl $-0x37, %r12d
movb $0x1, %r15b
jmp 0x43699
testb %r15b, %r15b
je 0x43685
movb (%rbx), %cl
cmpb $0x3d, %cl
jne 0x4364f
leaq 0x2ddaf8(%rip), %rdx    # 0x321134
movl (%rdx), %ecx
leaq 0x2dd9eb(%rip), %rsi    # 0x321030
cmpl $0x101, %ecx            # imm = 0x101
jl 0x43676
jmp 0x43682
cmpb $0x24, %cl
sete %dl
movl (%r13), %ecx
cmpl $0x101, %ecx            # imm = 0x101
setl %dil
andb %dl, %dil
movq %r13, %rdx
leaq 0x2ddad0(%rip), %rsi    # 0x321140
cmpb $0x1, %dil
jne 0x43682
leal 0x1(%rcx), %edi
movl %edi, (%rdx)
movslq %ecx, %rcx
movb %r12b, (%rsi,%rcx)
xorl %r12d, %r12d
shll $0x18, %eax
xorl %r15d, %r15d
cmpl $0x2c000000, %eax       # imm = 0x2C000000
je 0x43699
cmpl $0x20000000, %eax       # imm = 0x20000000
jne 0x436a1
incq %r14
jmp 0x435d1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: set_watch_name(char*)
void set_watch_name(char *s)
{
unsigned i, j;
int n;
char c;

   // set the analog watch face name info

   plot_watch = 1;
   config_screen(129);
   n = 0;
   j = 0;
   watch_name[j] = watch_name2[j] = 0;
   for(i=0; i<strlen(s); i++) {
      c = s[i];
      if(c == 0) break;
      if(c == '/') {
         ++n;
         j = 0;
         continue;
      }

      if(c == '_') c = ' ';
      if(n == 0) {
         watch_name[j++] = c;
         watch_name[j] = 0;
         if(j >= (sizeof(watch_name)-1)) break;
      }
      else if(n == 1) {
         watch_name2[j++] = c;
         watch_name2[j] = 0;
         if(j >= (sizeof(watch_name2)-1)) break;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1c1d17(%rip), %rax    # 0x205408
movb $0x1, (%rax)
movl $0x81, %edi
callq 0xcc4f
leaq 0x2e500b(%rip), %rax    # 0x328710
xorl %r15d, %r15d
movb %r15b, (%rax)
leaq 0x2e4fde(%rip), %rax    # 0x3286f0
movb %r15b, (%rax)
pushq $0x20
popq %r13
xorl %r14d, %r14d
xorl %r12d, %r12d
movl %r15d, %r15d
movq %rbx, %rdi
callq 0x9120
cmpq %r15, %rax
jbe 0x43794
movzbl (%rbx,%r15), %eax
cmpl $0x2f, %eax
je 0x4376b
testl %eax, %eax
je 0x43794
cmpb $0x5f, %al
movzbl %al, %eax
cmovel %r13d, %eax
movl %r14d, %ecx
cmpl $0x1, %r12d
je 0x43773
testl %r12d, %r12d
jne 0x4378f
incl %r14d
leaq 0x2e4f92(%rip), %rdx    # 0x3286f0
movb %al, (%rdx,%rcx)
movb $0x0, (%rdx,%r14)
xorl %r12d, %r12d
jmp 0x43789
incl %r12d
xorl %r14d, %r14d
jmp 0x4378f
incl %r14d
leaq 0x2e4f93(%rip), %rdx    # 0x328710
movb %al, (%rdx,%rcx)
movb $0x0, (%rdx,%r14)
pushq $0x1
popq %r12
cmpl $0x1d, %r14d
ja 0x43794
incl %r15d
jmp 0x4371f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: config_utc_mode(int)
void config_utc_mode(int set_utc_ofs)
{
   // this routine configures the time mode for receivers that do not support
   // operating in GPS time mode.

   if(set_gps_mode) {
      set_utc_mode = 0;
      time_flags |= TFLAGS_UTC;
      if(luxor) have_timing_mode = 1;
   }
   else if(set_utc_mode) {
      set_gps_mode = 0;
      time_flags &= (~TFLAGS_UTC);
      if(luxor) have_timing_mode = 1;
   }
   else {
      time_flags = TFLAGS_NULL;
      if(luxor) time_flags = TFLAGS_NULL;
      set_utc_mode = 1;
      set_gps_mode = 0;
   }

   // here we attempt to estimate the leapsecond count if it is needed and
   // the user or GPS receiver did not specify one.

   if(!user_set_utc_ofs && set_utc_ofs) {
      get_clock_time();
      if(clk_jd < jdate(2019,7,1)) utc_offset = 18;
      else utc_offset = (int) (43.216 + (double)(clk_year-2061)*0.567);
      have_utc_ofs = (-1);
   }
}

// Assembly:
leaq 0x2b3d0a(%rip), %rax    # 0x2f74b4
cmpl $0x0, (%rax)
je 0x437c5
leaq 0x2b3cfa(%rip), %rax    # 0x2f74b0
andl $0x0, (%rax)
leaq 0x2b3ce4(%rip), %rax    # 0x2f74a4
orb $0x1, (%rax)
jmp 0x437de
leaq 0x2b3ce4(%rip), %rcx    # 0x2f74b0
cmpl $0x0, (%rcx)
je 0x437f9
andl $0x0, (%rax)
leaq 0x2b3cc9(%rip), %rax    # 0x2f74a4
andb $-0x2, (%rax)
leaq 0x1e5759(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0x4380c
leaq 0x2b3bdb(%rip), %rax    # 0x2f73cc
movl $0x1, (%rax)
jmp 0x4380c
leaq 0x2b3ca4(%rip), %rdx    # 0x2f74a4
andl $0x0, (%rdx)
movl $0x1, (%rcx)
andl $0x0, (%rax)
testl %edi, %edi
je 0x43897
leaq 0x2b3f19(%rip), %rax    # 0x2f7734
cmpl $0x0, (%rax)
jne 0x43897
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0xa386
leaq 0x2b3eac(%rip), %rax    # 0x2f76e0
movsd (%rax), %xmm0
movsd %xmm0, -0x8(%rbp)
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
movl $0x7e3, %edi            # imm = 0x7E3
callq 0xc2f07
ucomisd -0x8(%rbp), %xmm0
jbe 0x43859
pushq $0x12
popq %rax
jmp 0x4387f
leaq 0x2b3e68(%rip), %rax    # 0x2f76c8
movl $0xfffff7f3, %ecx       # imm = 0xFFFFF7F3
addl (%rax), %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0xb2235(%rip), %xmm0    # 0xf5aa8
addsd 0xb2235(%rip), %xmm0    # 0xf5ab0
cvttsd2si %xmm0, %eax
leaq 0x2b3ea2(%rip), %rcx    # 0x2f7728
movl %eax, (%rcx)
leaq 0x2b3a8d(%rip), %rax    # 0x2f731c
orl $-0x1, (%rax)
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: save_adev_period()
void save_adev_period()
{
   old_adev_period     = adev_period;
   old_pps_adev_period = pps_adev_period;
   old_osc_adev_period = osc_adev_period;
   old_chc_adev_period = chc_adev_period;
   old_chd_adev_period = chd_adev_period;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1e088f(%rip), %rax    # 0x226cf8
movsd (%rax), %xmm0
leaq 0x2def8c(%rip), %rax    # 0x325400
movsd %xmm0, (%rax)
leaq 0x1e0881(%rip), %rax    # 0x226d00
movsd (%rax), %xmm0
leaq 0x2def7e(%rip), %rax    # 0x325408
movsd %xmm0, (%rax)
leaq 0x1e0873(%rip), %rax    # 0x226d08
movsd (%rax), %xmm0
leaq 0x2def70(%rip), %rax    # 0x325410
movsd %xmm0, (%rax)
leaq 0x1e0865(%rip), %rax    # 0x226d10
movsd (%rax), %xmm0
leaq 0x2def62(%rip), %rax    # 0x325418
movsd %xmm0, (%rax)
leaq 0x1e0857(%rip), %rax    # 0x226d18
movsd (%rax), %xmm0
leaq 0x2def54(%rip), %rax    # 0x325420
movsd %xmm0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: set_gpsd_mode()
void set_gpsd_mode()
{
   // set the receiver type to GPSD and config the ports

   rcvr_type = GPSD_RCVR;
   com[RCVR_PORT].com_port = com[RCVR_PORT].usb_port = 0;
   if(com[RCVR_PORT].user_set_ip == 0) {
      strcpy(com[RCVR_PORT].IP_addr, "localhost:2947");
   }
   com[RCVR_PORT].user_disabled_com = 0;
   com[RCVR_PORT].process_com = 1;
   init_com(RCVR_PORT, 17);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2aeaff(%rip), %rax    # 0x2f82e0
andq $0x0, 0x157c0(%rax)
leaq 0x1b90e0(%rip), %rcx    # 0x2028d0
movq $0x200, (%rcx)          # imm = 0x200
cmpl $0x0, 0x17a1c(%rax)
jne 0x49822
movabsq $0x373439323a7473, %rcx # imm = 0x373439323A7473
movq %rcx, 0x158d4(%rax)
movabsq $0x736f686c61636f6c, %rcx # imm = 0x736F686C61636F6C
movq %rcx, 0x158cd(%rax)
andl $0x0, 0x179e8(%rax)
movl $0x1, 0x179f4(%rax)
movl $0xa, %edi
movl $0x11, %esi
popq %rbp
jmp 0xb30a
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: parse_option(char*)
int parse_option(char *arg)
{
unsigned i;
char c;

   // break up a command line option into the command and argument fields.
   // connvert command to lower case.  Returns the char that separated the
   // command from the value, returns 0 if no value.

   for(i=0; i<sizeof(opt_cmd); i++) opt_cmd[i] = 0;
   for(i=0; i<sizeof(opt_arg); i++) opt_arg[i] = 0;
   if(arg == 0) return 0;

   for(i=0; i<sizeof(opt_cmd)-1; i++) {
      c = arg[i+1];
      if(c == 0) break;
      else if((c == '=') || (c == ':')) {  // : or = separates option from arg value
         strcpy(opt_arg, &arg[i+1+1]);
         strlwr(opt_cmd);
         return c;
      }
      else opt_cmd[i] = c;
   }

   strlwr(opt_cmd);
   return 0;
sprintf(plot_title, "cmd:(%s)  arg:(%s)", opt_cmd, opt_arg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rsi
xorl %ecx, %ecx
leaq 0x30c01b(%rip), %rax    # 0x355870
cmpq $0x201, %rcx            # imm = 0x201
je 0x49867
movb $0x0, (%rcx,%rax)
incq %rcx
jmp 0x49855
xorl %ecx, %ecx
leaq 0x30c210(%rip), %rdx    # 0x355a80
cmpq $0x201, %rcx            # imm = 0x201
je 0x49882
movb $0x0, (%rcx,%rdx)
incq %rcx
jmp 0x49870
testq %rsi, %rsi
je 0x498b3
addq $0x2, %rsi
xorl %ecx, %ecx
cmpq $0x200, %rcx            # imm = 0x200
je 0x498c5
movzbl -0x1(%rsi), %ebx
testl %ebx, %ebx
je 0x498c7
cmpl $0x3d, %ebx
je 0x498b7
cmpl $0x3a, %ebx
je 0x498b7
movb %bl, (%rcx,%rax)
incq %rsi
incq %rcx
jmp 0x4988d
xorl %ebx, %ebx
jmp 0x498d3
leaq 0x30c1c2(%rip), %rdi    # 0x355a80
callq 0x9330
jmp 0x498c7
xorl %ebx, %ebx
leaq 0x30bfa2(%rip), %rdi    # 0x355870
callq 0x986c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: restore_adev_period()
void restore_adev_period()
{
   adev_period     = old_adev_period;
   pps_adev_period = old_pps_adev_period;
   osc_adev_period = old_osc_adev_period;
   chc_adev_period = old_chc_adev_period;
   chd_adev_period = old_chd_adev_period;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2dbb19(%rip), %rax    # 0x325400
movsd (%rax), %xmm0
leaq 0x1dd406(%rip), %rax    # 0x226cf8
movsd %xmm0, (%rax)
leaq 0x2dbb0b(%rip), %rax    # 0x325408
movsd (%rax), %xmm0
leaq 0x1dd3f8(%rip), %rax    # 0x226d00
movsd %xmm0, (%rax)
leaq 0x2dbafd(%rip), %rax    # 0x325410
movsd (%rax), %xmm0
leaq 0x1dd3ea(%rip), %rax    # 0x226d08
movsd %xmm0, (%rax)
leaq 0x2dbaef(%rip), %rax    # 0x325418
movsd (%rax), %xmm0
leaq 0x1dd3dc(%rip), %rax    # 0x226d10
movsd %xmm0, (%rax)
leaq 0x2dbae1(%rip), %rax    # 0x325420
movsd (%rax), %xmm0
leaq 0x1dd3ce(%rip), %rax    # 0x226d18
movsd %xmm0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: drain_port(unsigned int)
void drain_port(unsigned port)
{
   // drain all received data from port buffers
   if(port >= NUM_COM_PORTS) return;
   if(com[port].process_com == 0) return;
   if(com[port].com_running <= 0) return;

   while(SERIAL_DATA_AVAILABLE(port)) {  // drain any input data from the ECHO_PORT
      get_serial_char(port);  // !!!! we should have a timeout on this loop
   }
}

// Assembly:
cmpl $0x12, %edi
ja 0x5147c
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %eax
imulq $0x2260, %rax, %rcx     # imm = 0x2260
leaq 0x2a6e94(%rip), %rax    # 0x2f82e0
cmpl $0x0, 0x2234(%rax,%rcx)
je 0x51476
addq %rcx, %rax
cmpl $0x0, 0x2230(%rax)
jg 0x5146b
jmp 0x51476
movl %ebx, %edi
callq 0xb87f
movl %ebx, %edi
callq 0xb771
testl %eax, %eax
jne 0x51464
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: echo_log(char*)
void echo_log(char *s)
{
unsigned i;
int c;

   if(s == 0) return;

   if(zoom_screen == 'H') {
      for(i=0; i<strlen(s); i++) {
         c = s[i];
         echo_term(monitor_port, c, monitor_hex, 0);
      }
   }

   if(log_file == 0) return;
   fprintf(log_file, "%s", s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x514f4
movq %rdi, %rbx
leaq 0x2a5311(%rip), %rax    # 0x2f67a8
cmpb $0x48, (%rax)
jne 0x514d5
xorl %eax, %eax
leaq 0x2a6e2b(%rip), %r14    # 0x2f82d0
leaq 0x1d6f98(%rip), %r15    # 0x228444
movl %eax, %r12d
movq %rbx, %rdi
callq 0x9120
cmpq %r12, %rax
jbe 0x514d5
movsbl (%rbx,%r12), %esi
movl (%r14), %edi
movl (%r15), %edx
xorl %ecx, %ecx
callq 0xaad9
leal 0x1(%r12), %eax
jmp 0x514ac
leaq 0x1d6e84(%rip), %rax    # 0x228360
movq (%rax), %rsi
testq %rsi, %rsi
je 0x514f4
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_com_char()
int get_com_char()
{
u08 c;

   // Get the next byte from the receiver (or simulation file)

   c = get_serial_char(RCVR_PORT);
   if(rcvr_type == ACRON_RCVR) c &= 0x7F;

   if((rcvr_type == TICC_RCVR) && ticc_file) {
      echo_ticc(c);
   }
   else {
      echo_stream(c); // echo receiver char to a file or com device
   }
   return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
pushq $0xa
popq %rdi
callq 0xb87f
leaq 0x1b102a(%rip), %rcx    # 0x2028d0
movq (%rcx), %rcx
cmpq $0x10000, %rcx          # imm = 0x10000
jne 0x518cb
leaq 0x1d6acf(%rip), %rdx    # 0x228388
cmpq $0x0, (%rdx)
je 0x518cb
movzbl %al, %ebx
movl %ebx, %edi
callq 0x5185b
jmp 0x518e7
movzbl %al, %edx
andb $0x7f, %al
cmpq $0x4000, %rcx           # imm = 0x4000
movzbl %al, %eax
cmovnel %edx, %eax
movzbl %al, %ebx
movl %ebx, %edi
callq 0x514fd
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_ticc_char()
int get_ticc_char() 
{
u08 c;

   // Get the next byte from the TICC port (or simulation file)

   if(rcvr_type == TICC_RCVR) c = get_serial_char(RCVR_PORT);
   else                       c = get_serial_char(TICC_PORT);

   if((rcvr_type == TICC_RCVR) && (ticc_file == 0)) {  // aaattt
      echo_stream(c); // echo ticc char to a file or com device
   }
   else if(ticc_file) {  // echo ticc data to TICC capture file
      echo_ticc(c);
   }
   return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x1b0fd2(%rip), %rbx    # 0x2028d0
movl $0x10000, %r14d         # imm = 0x10000
xorl %eax, %eax
cmpq %r14, (%rbx)
setne %al
leal (%rax,%rax,2), %edi
addl $0xa, %edi
callq 0xb87f
xorq (%rbx), %r14
leaq 0x1d6a67(%rip), %rcx    # 0x228388
movq (%rcx), %rcx
movzbl %al, %ebx
orq %rcx, %r14
jne 0x51935
movl %ebx, %edi
callq 0x514fd
jmp 0x51941
testq %rcx, %rcx
je 0x51941
movl %ebx, %edi
callq 0x5185b
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_enviro_char()
int get_enviro_char() 
{
u08 c;

   // Get the next byte from the environmental sensor port (or simulation file)

   if(rcvr_type == THERMO_RCVR) {
      c = get_serial_char(RCVR_PORT);
   }
   else {
      c = get_serial_char(THERMO_PORT);
   }

   if((rcvr_type == THERMO_RCVR) && (enviro_file == 0)) {  // aaattt
      echo_stream(c); // echo enviro char to a file or com device
   }
   else if(enviro_file) {  // echo enviro data to capture file
      echo_enviro(c);
   }
   return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x1b0f7a(%rip), %rbx    # 0x2028d0
movl $0x80000, %r14d         # imm = 0x80000
xorl %eax, %eax
cmpq %r14, (%rbx)
setne %al
leal (%rax,%rax,4), %edi
addl $0xa, %edi
callq 0xb87f
xorq (%rbx), %r14
leaq 0x1d6a07(%rip), %rcx    # 0x228380
movq (%rcx), %rcx
movzbl %al, %ebx
orq %rcx, %r14
jne 0x5198d
movl %ebx, %edi
callq 0x514fd
jmp 0x51999
testq %rcx, %rcx
je 0x51999
movl %ebx, %edi
callq 0x51876
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: drain_com_data()
void drain_com_data()
{
   // drain any data from the serial input buffer

   if(sim_file) return;
   if(rcvr_type == NO_RCVR) return;

   Sleep(250);
   while(SERIAL_DATA_AVAILABLE(RCVR_PORT)) {
      update_pwm();
      if((this_msec-com[RCVR_PORT].last_com_time) > 1000.0) { 
         break;
      }
      get_serial_char(RCVR_PORT);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1d69fe(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
jne 0x51a24
leaq 0x1b0f01(%rip), %rax    # 0x2028d0
cmpq $0x400, (%rax)          # imm = 0x400
je 0x51a24
movl $0xfa, %edi
callq 0xae83
pushq $0xa
popq %rbx
leaq 0x2a5d7c(%rip), %r14    # 0x2f7768
leaq 0x2a68ed(%rip), %r15    # 0x2f82e0
movl %ebx, %edi
callq 0xb771
testl %eax, %eax
je 0x51a24
callq 0xc067d
movsd (%r14), %xmm0
subsd 0x17a08(%r15), %xmm0
ucomisd 0xa161f(%rip), %xmm0    # 0xf3038
ja 0x51a24
movl %ebx, %edi
callq 0xb87f
jmp 0x519f3
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_sync_time()
void get_sync_time()
{
int bits;

   // get the approximate time the receiver sent the start bit of the message
   // (this assumes no delay through the operating system buffers)

   if(com[RCVR_PORT].baud_rate == 0) return;

   bits = 1 + com[RCVR_PORT].data_bits + com[RCVR_PORT].stop_bits;
   if(com[RCVR_PORT].parity) ++bits;
   msg_sync_msec = 0.0 - ((double) bits / (double) com[RCVR_PORT].baud_rate);

   msg_sync_msec += GetMsecs();
}

// Assembly:
leaq 0x2a68aa(%rip), %rcx    # 0x2f82e0
movl 0x159d0(%rcx), %eax
testl %eax, %eax
je 0x51a90
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x159d4(%rcx), %edx
addl 0x159d8(%rcx), %edx
cmpl $0x1, 0x159dc(%rcx)
sbbl $-0x1, %edx
incl %edx
cvtsi2sd %edx, %xmm0
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
subsd %xmm0, %xmm1
leaq 0x2a5ca7(%rip), %rbx    # 0x2f7720
movsd %xmm1, (%rbx)
callq 0xad3f
addsd (%rbx), %xmm0
movsd %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: check_utc_ofs(int)
void check_utc_ofs(int redraw)
{
   if(have_utc_ofs) return;
   else if((pri_year > 2016) && (utc_offset < 18)) return;
   else if(utc_offset < MIN_UTC_OFFSET) return;

   if((redraw > 0) && (have_utc_ofs == 0)) need_redraw = 2000+redraw;
   if(redraw < 0) have_utc_ofs = (0 - redraw);
   else           have_utc_ofs = redraw;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2a5880(%rip), %rax    # 0x2f731c
cmpl $0x0, (%rax)
jne 0x51ae8
leaq 0x2a5a6c(%rip), %rcx    # 0x2f7514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
leaq 0x2a5c70(%rip), %rdx    # 0x2f7728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0x51ae8
testl %edi, %edi
jle 0x51ae4
leal 0x7d0(%rdi), %ecx
leaq 0x1b0d64(%rip), %rdx    # 0x202844
movl %ecx, (%rdx)
jmp 0x51ae6
negl %edi
movl %edi, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_unkn_message()
void get_unkn_message()
{
u08 c;

   // This routine reads and throws away messages from unknown receiver types.

   if(SERIAL_DATA_AVAILABLE(RCVR_PORT) == 0) {
      check_com_timer(RCVR_PORT);
      return;
   }
   else {
      reset_com_timer(RCVR_PORT);
   }

   c = get_com_char();
   if(com[RCVR_PORT].rcv_error) {      // parity/framing/overrun errors
      com[RCVR_PORT].rcv_error = 0;
   }

   tsip_wptr = 0;
   tsip_sync = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq $0xa
popq %rdi
callq 0xb771
pushq $0xa
popq %rdi
testl %eax, %eax
je 0x51b36
callq 0x1d93f
callq 0x51891
leaq 0x2a67d2(%rip), %rax    # 0x2f82e0
cmpb $0x0, 0x17a12(%rax)
je 0x51b1e
movb $0x0, 0x17a12(%rax)
leaq 0x2d072d(%rip), %rax    # 0x322252
andw $0x0, (%rax)
leaq 0x2d0726(%rip), %rax    # 0x322256
andw $0x0, (%rax)
popq %rbp
retq
popq %rbp
jmp 0x1d61b
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_next_tsip_byte()
unsigned get_next_tsip_byte()
{
u16 c;

   if(1 && early_end) {  // we are skipping message data
      if(log_comments && (log_stream & LOG_HEX_STREAM) && log_file) {
         fprintf(log_file, "[%04X]", early_end);
         if(log_flush_mode) fflush(log_file);
      }
      return early_end;
   }

   c = get_next_tsip();  // get next data stream element
   if(c & 0xFF00) {      // we saw something that was not expected
      if(log_comments && (log_stream & LOG_HEX_STREAM) && log_file) {
         fprintf(log_file, "<%04X>", c);
         if(log_flush_mode) fflush(log_file);
      }
      early_end = c;
   }
   return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movzwl 0x30423c(%rip), %edx    # 0x355dc0
testl %edx, %edx
je 0x51bdd
leaq 0x1d6885(%rip), %rax    # 0x228414
cmpb $0x0, (%rax)
je 0x51bd4
leaq 0x1d6875(%rip), %rax    # 0x228410
leaq 0x1d67be(%rip), %rbx    # 0x228360
movq (%rbx), %rdi
testq %rdi, %rdi
setne %cl
andb (%rax), %cl
cmpb $0x1, %cl
jne 0x51bd4
leaq 0xb8546(%rip), %rsi     # 0x10a0ff
xorl %eax, %eax
callq 0x9560
leaq 0x1d6859(%rip), %rax    # 0x228420
cmpl $0x0, (%rax)
je 0x51bd4
movq (%rbx), %rdi
callq 0x9420
movzwl 0x3041e5(%rip), %ebx    # 0x355dc0
jmp 0x51c40
callq 0x51b3c
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x51c40
leaq 0x1d6822(%rip), %rax    # 0x228414
cmpb $0x0, (%rax)
je 0x51c39
leaq 0x1d6812(%rip), %rax    # 0x228410
leaq 0x1d675b(%rip), %r14    # 0x228360
movq (%r14), %rdi
testq %rdi, %rdi
setne %cl
andb (%rax), %cl
cmpb $0x1, %cl
jne 0x51c39
leaq 0xb84ea(%rip), %rsi     # 0x10a106
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
leaq 0x1d67f4(%rip), %rax    # 0x228420
cmpl $0x0, (%rax)
je 0x51c39
movq (%r14), %rdi
callq 0x9420
movw %bx, 0x304180(%rip)     # 0x355dc0
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: tsip_word()
u16 tsip_word()   /* get next two byte (word) field from binary message */
{
u08 i;
u08 word[2];
u16 c;

   for(i=0; i<2; i++) {
      c = get_next_tsip_byte();
      if(c & 0xFF00) tsip_error |= WORD_ERROR; 
      if(ENDIAN) word[i] = (u08) c;
      else       word[1-i] = (u08) c;
   }
   return * ((u16 *) (void *) &word[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
pushq $0x1
popq %rbx
xorl %r14d, %r14d
leaq 0x1b0b55(%rip), %r15    # 0x2027d4
leaq 0x1d72ea(%rip), %r12    # 0x228f70
cmpq $0x2, %r14
je 0x51cb4
callq 0x51b76
cmpl $0x100, %eax            # imm = 0x100
jb 0x51c9d
orb $0x10, (%r12)
cmpb $0x0, (%r15)
movq %r14, %rcx
cmoveq %rbx, %rcx
movb %al, -0x22(%rbp,%rcx)
incq %r14
decq %rbx
jmp 0x51c86
movzwl -0x22(%rbp), %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: tsip_tbyte()
u32 tsip_tbyte()   /* get next 3 byte field from binary message */
{
u08 i;
u08 word[3];
u16 c;

   for(i=0; i<3; i++) {
      c = get_next_tsip_byte();
      if(c & 0xFF00) tsip_error |= DWORD_ERROR;
      if(ENDIAN) word[i] = (u08) c;
      else       word[2-i] = (u08) c;
   }
   return * ((u32 *) (void *) &word[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
pushq $0x3
popq %rbx
leaq 0x1d729a(%rip), %r14    # 0x228f70
subq $0x1, %rbx
jb 0x51cee
callq 0x51b76
cmpl $0x100, %eax            # imm = 0x100
jb 0x51cd6
orb $0x20, (%r14)
jmp 0x51cd6
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: tsip_dword()
u32 tsip_dword()   /* get next dword field from binary message */
{
u08 i;
u08 word[4];
u16 c;

   for(i=0; i<4; i++) {
      c = get_next_tsip_byte();
      if(c & 0xFF00) tsip_error |= DWORD_ERROR;
      if(ENDIAN) word[i] = (u08) c;
      else       word[3-i] = (u08) c;
   }
   return * ((u32 *) (void *) &word[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
pushq $0x3
popq %rbx
xorl %r14d, %r14d
leaq 0x1b0ac5(%rip), %r15    # 0x2027d4
leaq 0x1d725a(%rip), %r12    # 0x228f70
cmpq $0x4, %r14
je 0x51d44
callq 0x51b76
cmpl $0x100, %eax            # imm = 0x100
jb 0x51d2d
orb $0x20, (%r12)
cmpb $0x0, (%r15)
movq %r14, %rcx
cmoveq %rbx, %rcx
movb %al, -0x24(%rbp,%rcx)
incq %r14
decq %rbx
jmp 0x51d16
movl -0x24(%rbp), %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: tsip_tword()
u48 tsip_tword()   /* get next tword field (48 bit) from binary message */
{
u08 i;
u08 word[3];
u16 c;

   for(i=0; i<3; i++) {
      c = get_next_tsip_byte();
      if(c & 0xFF00) tsip_error |= TWORD_ERROR;
      if(ENDIAN) word[i] = (u08) c;
      else       word[2-i] = (u08) c;
   }
   return * ((u48 *) (void *) &word[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
pushq $0x3
popq %rbx
leaq 0x1d720b(%rip), %r14    # 0x228f70
subq $0x1, %rbx
jb 0x51d7e
callq 0x51b76
cmpl $0x100, %eax            # imm = 0x100
jb 0x51d65
orb $0x1, 0x1(%r14)
jmp 0x51d65
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: check_float(float)
float check_float(float val) 
{
   // validate a float as being resonable

   if(val != val) {
      tsip_error |= NAN_ERROR;
      return 0.0F;  // kludgy NAN check
   }
   if(val > 1.0E30F) {
      tsip_error |= RANGE_ERROR;
      return 1.0E30F;        // prevent run-away printf's
   }
   if(val < (-1.0E30F)) {
      tsip_error |= RANGE_ERROR;
      return (-1.0E30F);
   }
   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
ucomiss %xmm0, %xmm0
jp 0x51db9
movss 0xb6c04(%rip), %xmm1    # 0x108998
movl $0x800, %eax            # imm = 0x800
ucomiss %xmm1, %xmm0
ja 0x51dab
movss 0xb6bf6(%rip), %xmm1    # 0x10899c
ucomiss %xmm0, %xmm1
jbe 0x51db7
leaq 0x1d71be(%rip), %rcx    # 0x228f70
orl %eax, (%rcx)
movaps %xmm1, %xmm0
popq %rbp
retq
xorps %xmm1, %xmm1
movl $0x400, %eax            # imm = 0x400
jmp 0x51dab
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: tsip_single()
float tsip_single()   /* get next four byte floating number from binary message */
{
u08 i;
u08 word[4];
u16 c;
float val;

   for(i=0; i<4; i++) {
      c = get_next_tsip_byte();
      if(c & 0xFF00) tsip_error |= FLOAT_ERROR;
      if(ENDIAN) word[i] = (u08) c;
      else       word[3-i] = (u08) c;
   }

   val = (* ((float *) (void *) &word[0]));
   val = check_float(val);   // checks for NAN's
   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
pushq $0x3
popq %rbx
xorl %r14d, %r14d
leaq 0x1b09f5(%rip), %r15    # 0x2027d4
leaq 0x1d718a(%rip), %r12    # 0x228f70
cmpq $0x4, %r14
je 0x51e14
callq 0x51b76
cmpl $0x100, %eax            # imm = 0x100
jb 0x51dfd
orb $0x40, (%r12)
cmpb $0x0, (%r15)
movq %r14, %rcx
cmoveq %rbx, %rcx
movb %al, -0x24(%rbp,%rcx)
incq %r14
decq %rbx
jmp 0x51de6
movss -0x24(%rbp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x51d83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: check_double(double)
double check_double(double val) 
{
   // validate a double as being resonable

   if(val != val) {
      tsip_error |= NAN_ERROR;
      return 0.0;  // kludgy NAN check
   }
   if(val > 1.0E30) {
      tsip_error |= RANGE_ERROR;
      return 1.0E30;        // prevent runaway printf's
   }
   if(val < (-1.0E30)) {
      tsip_error |= RANGE_ERROR;
      return (-1.0E30);
   }
   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
ucomisd %xmm0, %xmm0
jp 0x51e64
movsd 0xb635c(%rip), %xmm1    # 0x108198
movl $0x800, %eax            # imm = 0x800
ucomisd %xmm1, %xmm0
ja 0x51e55
movsd 0xb6351(%rip), %xmm1    # 0x1081a0
ucomisd %xmm0, %xmm1
jbe 0x51e62
leaq 0x1d7114(%rip), %rcx    # 0x228f70
orl %eax, (%rcx)
movapd %xmm1, %xmm0
popq %rbp
retq
xorpd %xmm1, %xmm1
movl $0x400, %eax            # imm = 0x400
jmp 0x51e55
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: tsip_double()
double tsip_double()   /* get next eight byte floating number from binary message */
{
u08 i;
u08 word[8];
u16 c;
double val;

   for(i=0; i<8; i++) {
      c = get_next_tsip_byte();
      if(c & 0xFF00) tsip_error |= DOUBLE_ERROR;
      if(ENDIAN) word[i] = (u08) c;
      else       word[7-i] = (u08) c;
   }

   val = (* ((double *) (void *) &word[0]));
   val = check_double(val);   // checks for NAN's, etc
   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
pushq $0x7
popq %rbx
xorl %r14d, %r14d
leaq 0x1b0949(%rip), %r15    # 0x2027d4
leaq 0x1d70de(%rip), %r12    # 0x228f70
cmpq $0x8, %r14
je 0x51ec0
callq 0x51b76
cmpl $0x100, %eax            # imm = 0x100
jb 0x51ea9
orb $-0x80, (%r12)
cmpb $0x0, (%r15)
movq %r14, %rcx
cmoveq %rbx, %rcx
movb %al, -0x28(%rbp,%rcx)
incq %r14
decq %rbx
jmp 0x51e92
movsd -0x28(%rbp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x51e2a
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: tsip_string(char*, int)
void tsip_string(char *s, int len)
{
int i;

   // get a 'len" byte string into 's'.  Terminate string with a 0 byte

   if(s == 0) return;

   i = 0;
   s[i] = 0;
   if(len < 0) return;

   while(len--) {
      s[i++] = tsip_byte();
      s[i] = 0;
   }
}

// Assembly:
testq %rdi, %rdi
je 0x520be
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x0, (%rdi)
testl %esi, %esi
js 0x520b4
movl %esi, %r14d
xorl %r15d, %r15d
cmpl %r15d, %r14d
je 0x520b4
callq 0x51c47
movb %al, (%rbx,%r15)
movb $0x0, 0x1(%rbx,%r15)
incq %r15
jmp 0x5209b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: log_packet_id(char*)
void log_packet_id(char *s)
{
   if((log_stream & LOG_PACKET_ID) || (zoom_screen == 'H')) {
      if(HEX_PACKET_IDS) {
         if(s) strcpy(packet_id, s);
         else  strcpy(packet_id, "{null packet id string}\n");
      }
      else if(s) {
         if(log_file) fprintf(log_file, "   {%s}\n", s);
      }
      else {
         if(log_file) fprintf(log_file, "   {null packet id string}\n");
      }
      if(log_flush_mode && log_file) fflush(log_file);
   }
}

// Assembly:
movq %rdi, %rdx
leaq 0x1d6347(%rip), %rax    # 0x228410
testb $0x2, (%rax)
jne 0x520de
leaq 0x2a46d3(%rip), %rax    # 0x2f67a8
cmpb $0x48, (%rax)
jne 0x52193
pushq %rbp
movq %rsp, %rbp
leaq 0x1b07e7(%rip), %rax    # 0x2028d0
movabsq $0x1b197411ff, %rcx     # imm = 0x1B197411FF
testq %rcx, (%rax)
je 0x5210e
testq %rdx, %rdx
je 0x52135
leaq 0x303b9c(%rip), %rdi    # 0x355ca0
movq %rdx, %rsi
callq 0x9330
jmp 0x5216a
leaq 0x1d624b(%rip), %rax    # 0x228360
movq (%rax), %rcx
testq %rdx, %rdx
je 0x52153
testq %rcx, %rcx
je 0x5216a
leaq 0xb7fc7(%rip), %rsi     # 0x10a0f0
movq %rcx, %rdi
xorl %eax, %eax
callq 0x9560
jmp 0x5216a
movups 0xb7fdd(%rip), %xmm0    # 0x10a119
movups %xmm0, 0x303b66(%rip)   # 0x355ca9
movups 0xb7fc6(%rip), %xmm0    # 0x10a110
movaps %xmm0, 0x303b4f(%rip)   # 0x355ca0
jmp 0x5216a
testq %rcx, %rcx
je 0x5216a
leaq 0xb7fae(%rip), %rdi     # 0x10a10d
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x9750
leaq 0x1d62af(%rip), %rax    # 0x228420
cmpl $0x0, (%rax)
setne %al
leaq 0x1d61e2(%rip), %rcx    # 0x228360
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
popq %rbp
je 0x9420
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: average_dop()
DATA_SIZE average_dop()
{
DATA_SIZE dop, div;

   // returns the average of all dop values
   // (this should probably be a geometric average or maybe an AGM average !!!!!)

   dop = 0.0;
   div = 0.0;

   if((have_dops & TDOP) && tdop) { dop += tdop; ++div; }
   if((have_dops & HDOP) && hdop) { dop += hdop; ++div; }
   if((have_dops & VDOP) && vdop) { dop += vdop; ++div; }
   if((have_dops & PDOP) && pdop) { dop += pdop; ++div; }
   if((have_dops & GDOP) && gdop) { dop += gdop; ++div; }
   if((have_dops & EDOP) && edop) { dop += edop; ++div; }
   if((have_dops & NDOP) && ndop) { dop += ndop; ++div; }
   if((have_dops & XDOP) && xdop) { dop += xdop; ++div; }
   if((have_dops & YDOP) && ydop) { dop += ydop; ++div; }
   if(div) dop /= div;

   avg_dop = dop;
   return dop;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1bad84(%rip), %rax    # 0x20d4e4
movl (%rax), %eax
movl %eax, %ecx
shrb $0x4, %cl
leaq 0x1bad9a(%rip), %rdx    # 0x20d508
movsd (%rdx), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
setp %dl
setne %sil
orb %dl, %sil
testb %sil, %cl
jne 0x5278f
xorpd %xmm1, %xmm1
jmp 0x52793
addsd %xmm0, %xmm1
movsd 0xa08d5(%rip), %xmm3    # 0xf3070
movapd %xmm3, %xmm2
jne 0x527a5
xorpd %xmm2, %xmm2
movl %eax, %ecx
shrb %cl
leaq 0x1bad40(%rip), %rdx    # 0x20d4f0
movsd (%rdx), %xmm4
ucomisd %xmm0, %xmm4
setp %dl
setne %sil
orb %dl, %sil
testb %sil, %cl
je 0x527cf
addsd %xmm4, %xmm1
addsd %xmm3, %xmm2
movl %eax, %ecx
shrb $0x2, %cl
leaq 0x1bad1d(%rip), %rdx    # 0x20d4f8
movsd (%rdx), %xmm4
ucomisd %xmm0, %xmm4
setp %dl
setne %sil
orb %dl, %sil
testb %sil, %cl
je 0x527fa
addsd %xmm4, %xmm1
addsd %xmm3, %xmm2
leaq 0x1bace7(%rip), %rcx    # 0x20d4e8
movsd (%rcx), %xmm4
ucomisd %xmm0, %xmm4
setp %cl
setne %dl
orb %cl, %dl
testb %dl, %al
je 0x5281d
addsd %xmm4, %xmm1
addsd %xmm3, %xmm2
movl %eax, %ecx
shrb $0x3, %cl
leaq 0x1bacd7(%rip), %rdx    # 0x20d500
movsd (%rdx), %xmm4
ucomisd %xmm0, %xmm4
setp %dl
setne %sil
orb %dl, %sil
testb %sil, %cl
je 0x52848
addsd %xmm4, %xmm1
addsd %xmm3, %xmm2
movl %eax, %ecx
shrb $0x6, %cl
leaq 0x1bacc4(%rip), %rdx    # 0x20d518
movsd (%rdx), %xmm4
ucomisd %xmm0, %xmm4
setp %dl
setne %sil
orb %dl, %sil
testb %sil, %cl
je 0x52873
addsd %xmm4, %xmm1
addsd %xmm3, %xmm2
movl %eax, %ecx
shrb $0x5, %cl
leaq 0x1bac91(%rip), %rdx    # 0x20d510
movsd (%rdx), %xmm4
ucomisd %xmm0, %xmm4
setp %dl
setne %sil
orb %dl, %sil
testb %sil, %cl
je 0x5289e
addsd %xmm4, %xmm1
addsd %xmm3, %xmm2
testb %al, %al
sets %cl
leaq 0x1bac76(%rip), %rdx    # 0x20d520
movsd (%rdx), %xmm4
ucomisd %xmm0, %xmm4
setp %dl
setne %sil
orb %dl, %sil
testb %sil, %cl
je 0x528c9
addsd %xmm4, %xmm1
addsd %xmm3, %xmm2
shrl $0x8, %eax
leaq 0x1bac55(%rip), %rcx    # 0x20d528
movsd (%rcx), %xmm4
ucomisd %xmm0, %xmm4
setp %cl
setne %dl
orb %cl, %dl
testb %dl, %al
je 0x528ef
addsd %xmm4, %xmm1
addsd %xmm3, %xmm2
movapd %xmm1, %xmm3
divsd %xmm2, %xmm3
cmpneqsd %xmm2, %xmm0
andpd %xmm0, %xmm3
andnpd %xmm1, %xmm0
orpd %xmm3, %xmm0
leaq 0x1bac21(%rip), %rax    # 0x20d530
movlpd %xmm0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: echo_nmea_string(char*)
void echo_nmea_string(char *ss)
{
u08 cksum;
char buf[2048+1];
unsigned i;

   // send a NMEA command out the NMEA_PORT.  Leading '$' and checksum are added.

   if(ss == 0) return;
   strcpy(buf,ss);

   sendout(NMEA_PORT, '$', ADD_CHAR);
   cksum = 0;

   for(i=0; i<strlen(buf); i++) {
      sendout(NMEA_PORT, buf[i], ADD_CHAR);
      cksum ^= buf[i];
   }

   sendout(NMEA_PORT, '*', ADD_CHAR);  
   i = (cksum >> 4) & 0x0F;
   if(i > 9) i += ('A'-10);
   else      i += '0';
   sendout(NMEA_PORT, (u08) i, ADD_CHAR);  
   i = cksum & 0x0F;
   if(i > 9) i += ('A'-10);
   else      i += '0';
   sendout(NMEA_PORT, (u08) i, ADD_CHAR);  

   sendout(NMEA_PORT, 0x0D, ADD_CHAR);
   sendout(NMEA_PORT, 0x0A, EOM);

   drain_port(NMEA_PORT);   // we ignore any data comming in the NMEA echo port

// if(debug_file) fprintf(debug_file, "echo nmea:%s\n", s);
}

// Assembly:
testq %rdi, %rdi
je 0x52a37
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x810, %rsp            # imm = 0x810
movq %rdi, %rsi
leaq -0x830(%rbp), %rbx
movq %rbx, %rdi
callq 0x9330
pushq $0xc
popq %r14
pushq $0x24
popq %rsi
xorl %r15d, %r15d
movl %r14d, %edi
xorl %edx, %edx
callq 0xba3b
xorl %eax, %eax
movl %eax, %r12d
movq %rbx, %rdi
callq 0x9120
cmpq %r12, %rax
jbe 0x529aa
movzbl -0x830(%rbp,%r12), %esi
movl %r14d, %edi
xorl %edx, %edx
callq 0xba3b
xorb -0x830(%rbp,%r12), %r15b
leal 0x1(%r12), %eax
jmp 0x52978
pushq $0xc
popq %rbx
pushq $0x2a
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
movl %r15d, %eax
shrb $0x4, %al
leal 0x37(%rax), %ecx
orb $0x30, %al
cmpb $-0x60, %r15b
movzbl %cl, %ecx
movzbl %al, %esi
cmovael %ecx, %esi
movl $0xff, %r14d
andl %r14d, %esi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
andb $0xf, %r15b
leal 0x37(%r15), %eax
leal 0x30(%r15), %ecx
cmpb $0xa, %r15b
movzbl %al, %eax
movzbl %cl, %esi
cmovael %eax, %esi
andl %r14d, %esi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0xd
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0xa
popq %rsi
pushq $0x1
popq %rdx
movl %ebx, %edi
callq 0xba3b
movl %ebx, %edi
callq 0x5142f
addq $0x810, %rsp            # imm = 0x810
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: nmea_time()
double nmea_time()
{
double time;

   // return UTC time as a floating point number

//   gregorian(0, jd_utc);
   time = ((double) g_hours) * 100 * 100.0;
   time += ((double) g_minutes) * 100.0;
   time += ((double) g_seconds);
   time += g_frac;

   return time;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2a4c65(%rip), %rax    # 0x2f76a8
cvtsi2sdl (%rax), %xmm0
movsd 0xa0611(%rip), %xmm1    # 0xf3060
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
leaq 0x2a4c4e(%rip), %rax    # 0x2f76ac
cvtsi2sdl (%rax), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
leaq 0x2a4c3f(%rip), %rax    # 0x2f76b0
cvtsi2sdl (%rax), %xmm0
addsd %xmm2, %xmm0
leaq 0x2a4c38(%rip), %rax    # 0x2f76b8
addsd (%rax), %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: nmea_date()
int nmea_date()
{
int date;

   // return date as an integer (year modulo 100)

   date = g_day * 100 * 100;
   date += g_month * 100;
   date += (g_year % 100);

   return date;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2a4c0f(%rip), %rax    # 0x2f76a0
imull $0x2710, (%rax), %eax   # imm = 0x2710
leaq 0x2a4bfe(%rip), %rcx    # 0x2f769c
imull $0x64, (%rcx), %ecx
addl %eax, %ecx
leaq 0x2a4bfa(%rip), %rax    # 0x2f76a4
movl (%rax), %eax
movl $0x64, %esi
cltd
idivl %esi
addl %edx, %ecx
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: nmea_lat()
char *nmea_lat()
{
static char s[256];
double val;
int deg;
char c;

   // return latitude as a NMEA format string

   if(lat < 0.0) c = 'S';
   else          c = 'N';

   val = fabs(lat) * 180.0 / PI;
   deg = (int) val;
   val -= (double) deg;        // fractional degrees
   val *= 60.0;                // fractional minutes
   val += (double) (deg*100);  // NMEA location

   s[0] = 0;
   if(echo_fmt & ECHO_LLA) sprintf(s, "%.4f,%c", val,c);
   else                    sprintf(s, "%.3f,%c", val,c);
   return &s[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2a4509(%rip), %rax    # 0x2f6fd0
movsd (%rax), %xmm1
xorpd %xmm0, %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
seta %al
andpd 0xa06b0(%rip), %xmm1    # 0xf3190
mulsd 0xa2dc0(%rip), %xmm1    # 0xf58a8
divsd 0xa2db0(%rip), %xmm1    # 0xf58a0
cvttsd2si %xmm1, %ecx
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
leal (%rax,%rax,4), %edx
addl $0x4e, %edx
subsd %xmm0, %xmm1
mulsd 0xa04fa(%rip), %xmm1    # 0xf3008
imull $0x64, %ecx, %eax
cvtsi2sd %eax, %xmm0
addsd %xmm1, %xmm0
movb $0x0, 0x307500(%rip)    # 0x35a020
leaq 0x3074f9(%rip), %rbx    # 0x35a020
cmpb $0x0, 0x101a52(%rip)    # 0x154580
leaq 0xb767d(%rip), %rax     # 0x10a1b2
leaq 0xb766e(%rip), %rsi     # 0x10a1aa
cmovnsq %rax, %rsi
movq %rbx, %rdi
movb $0x1, %al
callq 0x9060
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: nmea_lon()
char *nmea_lon()
{
static char s[256];
double val;
int deg;
char c;

   // return longitude as a NMEA format string

   s[0] = 0;
   if(lon < 0.0) c = 'W';
   else          c = 'E';

   val = fabs(lon) * 180.0 / PI;
   deg = (int) val;
   val -= (double) deg;        // fractional degrees
   val *= 60.0;                // fractional minutes
   val += (double) (deg*100);  // NMEA location
   

   if(echo_fmt & ECHO_LLA) sprintf(s, "%.4f,%c", val,c);
   else                    sprintf(s, "%.3f,%c", val,c);
   return &s[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2a4477(%rip), %rax    # 0x2f6fd8
movsd (%rax), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
pushq $0x57
popq %rax
pushq $0x45
popq %rdx
cmoval %eax, %edx
andpd 0xa0612(%rip), %xmm1    # 0xf3190
mulsd 0xa2d22(%rip), %xmm1    # 0xf58a8
divsd 0xa2d12(%rip), %xmm1    # 0xf58a0
cvttsd2si %xmm1, %eax
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
subsd %xmm0, %xmm1
mulsd 0xa0462(%rip), %xmm1    # 0xf3008
movb $0x0, 0x307573(%rip)    # 0x35a120
imull $0x64, %eax, %eax
cvtsi2sd %eax, %xmm0
leaq 0x307565(%rip), %rbx    # 0x35a120
addsd %xmm1, %xmm0
cmpb $0x0, 0x1019ba(%rip)    # 0x154580
leaq 0xb75e5(%rip), %rax     # 0x10a1b2
leaq 0xb75d6(%rip), %rsi     # 0x10a1aa
cmovnsq %rax, %rsi
movq %rbx, %rdi
movb $0x1, %al
callq 0x9060
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: nmea_speed()
char *nmea_speed()
{
static char s[256];

   // return speed as a NMEA format string

   s[0] = 0;
   if(have_speed) {
      sprintf(s, "%.2f", speed / 0.514444);
   }
   return &s[0];
}

// Assembly:
movb $0x0, 0x3076f0(%rip)    # 0x35a320
leaq 0x2a4701(%rip), %rax    # 0x2f7338
cmpl $0x0, (%rax)
je 0x52c69
pushq %rbp
movq %rsp, %rbp
leaq 0x2a43d9(%rip), %rax    # 0x2f7020
movsd (%rax), %xmm0
divsd 0xb5555(%rip), %xmm0    # 0x1081a8
leaq 0x3076c6(%rip), %rdi    # 0x35a320
leaq 0xbb233(%rip), %rsi     # 0x10de94
movb $0x1, %al
callq 0x9060
popq %rbp
leaq 0x3076b0(%rip), %rax    # 0x35a320
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: nmea_heading()
char *nmea_heading()
{
static char s[256];

   // return heading as a NMEA format string

   s[0] = 0;
   if(have_heading) {
      sprintf(s, "%.2f", heading);
   }
   return &s[0];
}

// Assembly:
movb $0x0, 0x3077a8(%rip)    # 0x35a420
leaq 0x2a46b5(%rip), %rax    # 0x2f7334
cmpl $0x0, (%rax)
je 0x52ca9
pushq %rbp
movq %rsp, %rbp
leaq 0x2a4399(%rip), %rax    # 0x2f7028
movsd (%rax), %xmm0
leaq 0x307786(%rip), %rdi    # 0x35a420
leaq 0xbb1f3(%rip), %rsi     # 0x10de94
movb $0x1, %al
callq 0x9060
popq %rbp
leaq 0x307770(%rip), %rax    # 0x35a420
retq