LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_time_format()
void parse_tm4_time_format()
{
   log_packet_id("time output format");

   if(get_msg_field()) {  // time output type
      ett_time_format = atoi(msg_field);
      have_ett_time_format = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x809f6(%rip), %rdi     # 0x125b6b
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xa51a5
leaq 0x2968b6(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296cea(%rip), %rcx    # 0x33be80
movl %eax, (%rcx)
leaq 0x296ce5(%rip), %rax    # 0x33be84
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_code_format()
void parse_tm4_code_format()
{
   log_packet_id("time code format");

   if(get_msg_field()) {  // code format
      ett_code_format = atoi(msg_field);
      have_ett_code_format = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x809cc(%rip), %rdi     # 0x125b7e
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xa51e2
leaq 0x296879(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296cb5(%rip), %rcx    # 0x33be88
movl %eax, (%rcx)
leaq 0x296cb0(%rip), %rax    # 0x33be8c
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_ett_enable()
void parse_tm4_ett_enable()
{
   log_packet_id("ETT enabled state");

   if(get_msg_field()) {  // ETT enabled state
      ett_enable = atoi(msg_field);
      have_tm4_ett_enable = 1;
   }

   if(get_msg_field()) {  // polarity
      ett_polarity = msg_field[0];
      have_ett_polarity = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x809a0(%rip), %rdi     # 0x125b8f
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xa521f
leaq 0x29683c(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296c68(%rip), %rcx    # 0x33be78
movl %eax, (%rcx)
leaq 0x296c63(%rip), %rax    # 0x33be7c
movl $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xa5248
leaq 0x296811(%rip), %rax    # 0x33ba40
movsbl (%rax), %eax
leaq 0x296d23(%rip), %rcx    # 0x33bf5c
movl %eax, (%rcx)
leaq 0x296d1e(%rip), %rax    # 0x33bf60
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_speed()
void parse_tm4_speed()
{
   log_packet_id("speed/heading");
   if(have_tm4_enhanced) return;

    if(get_msg_field()) {
       speed = atof(msg_field);
       have_speed = 444;
    }

    if(get_msg_field()) {
       heading = atof(msg_field);
       have_heading = 444;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8094c(%rip), %rdi     # 0x125ba1
callq 0x58dc2
leaq 0x296d03(%rip), %rax    # 0x33bf64
cmpl $0x0, (%rax)
jne 0xa52c0
callq 0x810b1
testl %eax, %eax
je 0xa5293
leaq 0x2967ca(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x267d9e(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
leaq 0x2680ab(%rip), %rax    # 0x30d338
movl $0x1bc, (%rax)          # imm = 0x1BC
callq 0x810b1
testl %eax, %eax
je 0xa52c0
leaq 0x29679d(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x267d79(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
leaq 0x26807a(%rip), %rax    # 0x30d334
movl $0x1bc, (%rax)          # imm = 0x1BC
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_pop(int)
void parse_tm4_pop(int type)
{
int pop_month,pop_day,pop_year;
int pop_hours,pop_minutes,pop_seconds;
double pop_frac;

   log_packet_id("POP/ETT");

   pop_jd = 0.0;

   if(get_msg_field()) {
      tm4_pop_mode = atoi(msg_field);
      have_tm4_pop_mode = 1;
   }

   if(get_msg_field()) {
      tm4_pop_polarity = msg_field[0];
      have_tm4_pop_polarity = 1;
   }

   if(get_msg_field()) {
      sscanf(msg_field, "%02d%02d%04d", &pop_month,&pop_day,&pop_year);
      pop_jd = jdate(pop_year,pop_month,pop_day);
   }
   if(get_msg_field()) {
      sscanf(msg_field, "%02d%02d%02d%lf", &pop_hours,&pop_minutes,&pop_seconds, &pop_frac);
      pop_jd += jtime(pop_hours,pop_minutes,pop_seconds,pop_frac);
      ++have_tm4_pop_jd;
   }


   if(get_msg_field()) {
      tm4_repeat = atoi(msg_field);
      have_tm4_repeat = 1;
   }

   if(type == 74) {  // simultaneous POP/ETT device
      if(get_msg_field()) {
         tm4_width = atoi(msg_field);
         have_tm4_width = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %r13d
leaq 0x808d2(%rip), %rdi     # 0x125baf
callq 0x58dc2
leaq 0x296caf(%rip), %rbx    # 0x33bf98
movq $0x0, (%rbx)
callq 0x810b1
testl %eax, %eax
je 0xa531b
leaq 0x296740(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296c6c(%rip), %rcx    # 0x33bf78
movl %eax, (%rcx)
leaq 0x296c67(%rip), %rax    # 0x33bf7c
movl $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xa5344
leaq 0x296715(%rip), %rax    # 0x33ba40
movsbl (%rax), %eax
leaq 0x296c4b(%rip), %rcx    # 0x33bf80
movl %eax, (%rcx)
leaq 0x296c46(%rip), %rax    # 0x33bf84
movl $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xa538a
leaq 0x2966ec(%rip), %rdi    # 0x33ba40
leaq 0x8078a(%rip), %rsi     # 0x125ae5
leaq -0x40(%rbp), %r14
leaq -0x3c(%rbp), %r15
leaq -0x38(%rbp), %r12
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x9360
movl (%r12), %edi
movl (%r14), %esi
movl (%r15), %edx
callq 0xd485e
movsd %xmm0, (%rbx)
callq 0x810b1
testl %eax, %eax
je 0xa53ef
leaq 0x2966a6(%rip), %rdi    # 0x33ba40
leaq 0x80791(%rip), %rsi     # 0x125b32
leaq -0x34(%rbp), %r14
leaq -0x30(%rbp), %r15
leaq -0x2c(%rbp), %r12
leaq -0x48(%rbp), %rbx
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x9360
movl (%r14), %edi
movl (%r15), %esi
movl (%r12), %edx
movsd (%rbx), %xmm0
callq 0xd492e
leaq 0x296bba(%rip), %rax    # 0x33bf98
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
leaq 0x296bb3(%rip), %rax    # 0x33bfa0
incl (%rax)
callq 0x810b1
testl %eax, %eax
je 0xa541a
leaq 0x296641(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296b65(%rip), %rcx    # 0x33bf70
movl %eax, (%rcx)
leaq 0x296b60(%rip), %rax    # 0x33bf74
movl $0x1, (%rax)
cmpl $0x4a, %r13d
jne 0xa544b
callq 0x810b1
testl %eax, %eax
je 0xa544b
leaq 0x296610(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296b2c(%rip), %rcx    # 0x33bf68
movl %eax, (%rcx)
leaq 0x296b27(%rip), %rax    # 0x33bf6c
movl $0x1, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_utc()
void parse_tm4_utc()
{
int i;

   log_packet_id("UTC offset");

   if(get_msg_field()) {  // 0=GPS time  1=UTC time
      i = atoi(msg_field);
   }
   if(get_msg_field()) {  // 0=no utc_offset  1=utc_offset valid
      i = atoi(msg_field);
   }

   if(get_msg_field()) { 
      i = atoi(msg_field);
      if(i) {
         if(!user_set_utc_ofs) {
            utc_offset = i;
            have_utc_ofs = (444);
         }
         check_utc_ofs(444);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x80752(%rip), %rdi     # 0x125bb7
callq 0x58dc2
callq 0x810b1
callq 0x810b1
callq 0x810b1
testl %eax, %eax
je 0xa54f5
leaq 0x2965bc(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
je 0xa54f5
leaq 0x2682a0(%rip), %rcx    # 0x30d734
cmpl $0x0, (%rcx)
je 0xa54df
leaq 0x267e7c(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0xa54f5
leaq 0x268068(%rip), %rax    # 0x30d514
cmpl $0x7e1, (%rax)          # imm = 0x7E1
setge %al
leaq 0x26826c(%rip), %rcx    # 0x30d728
movl (%rcx), %ecx
cmpl $0x12, %ecx
setl %dl
andb %al, %dl
cmpl $0x11, %ecx
setl %al
orb %dl, %al
jne 0xa54f5
leaq 0x17336d(%rip), %rax    # 0x218844
movl $0x98c, (%rax)          # imm = 0x98C
jmp 0xa54e8
leaq 0x268242(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
leaq 0x267e2d(%rip), %rax    # 0x30d31c
movl $0x1bc, (%rax)          # imm = 0x1BC
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_coast()
void parse_tm4_coast()
{
int hh,mm,ss;

   log_packet_id("coast time");

   hh = mm = ss = 0;
   if(get_msg_field()) {  // hhhhmmss
      sscanf(msg_field, "%04d%02d%02d", &hh,&mm,&ss);
      holdover = (hh*3600 + mm*60 + ss);
   }

   if(get_msg_field()) {  // undocumented 8 chars
   }
   if(get_msg_field()) {  // undocumented 8 chars 
   }
   if(get_msg_field()) {  // undocumented 8 chars 
   }
   if(get_msg_field()) {  // undocumented value (2)
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x806b7(%rip), %rdi     # 0x125bc2
callq 0x58dc2
xorl %eax, %eax
movl %eax, -0x1c(%rbp)
movl %eax, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x810b1
testl %eax, %eax
je 0xa5566
leaq 0x296515(%rip), %rdi    # 0x33ba40
leaq 0x8069b(%rip), %rsi     # 0x125bcd
leaq -0x24(%rbp), %rbx
leaq -0x20(%rbp), %r14
leaq -0x1c(%rbp), %r15
movq %rbx, %rdx
movq %r14, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x9360
imull $0xe10, (%rbx), %eax    # imm = 0xE10
imull $0x3c, (%r14), %ecx
addl %eax, %ecx
addl (%r15), %ecx
leaq 0x267ef4(%rip), %rax    # 0x30d458
movl %ecx, (%rax)
callq 0x810b1
callq 0x810b1
callq 0x810b1
callq 0x810b1
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_lock(int)
void parse_tm4_lock(int id)
{
   sprintf(out, "lock status: #%d", id);
   log_packet_id(out);

   if(get_msg_field()) {
      tm4_lock = (-1);
      if(isdigit(msg_field[0])) tm4_lock = atoi(msg_field);
      have_tm4_lock = id;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x296c8b(%rip), %r14    # 0x33c220
leaq 0x8063e(%rip), %rsi     # 0x125bda
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xa55f1
leaq 0x296984(%rip), %r14    # 0x33bf44
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
leaq 0x296472(%rip), %rax    # 0x33ba40
movsbl (%rax), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0xa55e8
leaq 0x296460(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%r14)
leaq 0x296959(%rip), %rax    # 0x33bf48
movl %ebx, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_options()
void parse_tm4_options()
{
   log_packet_id("option settings");

   if(get_msg_field()) {  // antenna alarm enable
      tm4_antenna = atoi(msg_field);
      have_tm4_antenna = 1;
   }

   if(get_msg_field()) {  // PPS source
      tm4_pps_source = atoi(msg_field);
      have_tm4_pps_source = 1;
   }

   if(get_msg_field()) {  // reserved
   }

   if(get_msg_field()) {  // reserved 
   }

   if(get_msg_field()) {  // reserved 
   }

   if(get_msg_field()) {  // reserved
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x805ea(%rip), %rdi     # 0x125beb
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xa5631
leaq 0x29642a(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x29692a(%rip), %rcx    # 0x33bf4c
movl %eax, (%rcx)
leaq 0x296925(%rip), %rax    # 0x33bf50
movl $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xa565c
leaq 0x2963ff(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296907(%rip), %rcx    # 0x33bf54
movl %eax, (%rcx)
leaq 0x296902(%rip), %rax    # 0x33bf58
movl $0x1, (%rax)
callq 0x810b1
callq 0x810b1
callq 0x810b1
popq %rbp
jmp 0x810b1
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_tm4_message()
void get_tm4_message()
{
u08 c;

   // This routine buffers up an incoming Spectrum TM4 message.  When the end of the
   // message is seen, the message is parsed and decoded with decode_nmea_msg()

   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;
//!!!!!qqqq    goto rst_msg;
   }

   if(tsip_sync == 0) {    // syncing to start of message, search for a '#'
      if(c == '#') {
         tsip_sync = 1;
         get_sync_time();
      }
      tsip_wptr = 0;
      tsip_rptr = 0;
      return;
   }
   else if(tsip_sync == 1) { // '#' has been seen, now build the message
      if(c == 0x0D) {
         tsip_sync = 2;
         return;
      }

      if(tsip_wptr < MAX_TSIP) {   // add char to the message buffer
         tsip_buf[tsip_wptr++] = c;
         tsip_buf[tsip_wptr] = 0;
      }
      else {
         tsip_error |= OVFL_ERROR;
         goto rst_msg;
      }
   }
   else if(tsip_sync == 2) {  // 0x0A end of message
      decode_tm4_msg(); 
      packet_end = 1;
      tsip_wptr = 0;     // prepare for next message
      tsip_rptr = 0;
      tsip_sync = 0;
   }
   else {     // should never happen, prepare for next message
      rst_msg:
      tsip_wptr = 0;
      tsip_rptr = 0;
      tsip_sync = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0xa, %edi
callq 0xb9ad
movl $0xa, %edi
testl %eax, %eax
je 0xa5ba9
callq 0x1ea0b
callq 0x584bd
leaq 0x268786(%rip), %rcx    # 0x30e2e0
cmpb $0x0, 0x17a12(%rcx)
je 0xa5b6a
movb $0x0, 0x17a12(%rcx)
leaq 0x2926e5(%rip), %rbx    # 0x338256
movzwl (%rbx), %ecx
cmpl $0x2, %ecx
je 0xa5bc0
cmpl $0x1, %ecx
je 0xa5bb4
testl %ecx, %ecx
jne 0xa5bcf
cmpl $0x23, %eax
jne 0xa5b91
movw $0x1, (%rbx)
callq 0x58672
leaq 0x2926ba(%rip), %rax    # 0x338252
xorl %ecx, %ecx
movw %cx, (%rax)
leaq 0x2926b0(%rip), %rax    # 0x338254
movw %cx, (%rax)
jmp 0xa5be8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1e66a
cmpl $0xd, %eax
jne 0xa5bef
movw $0x2, (%rbx)
jmp 0xa5be8
callq 0xa56b6
movl $0x1, 0x2c60c5(%rip)    # 0x36bc94
leaq 0x29267c(%rip), %rax    # 0x338252
xorl %ecx, %ecx
movw %cx, (%rax)
leaq 0x292672(%rip), %rax    # 0x338254
movw %cx, (%rax)
movw %cx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x29265c(%rip), %rdx    # 0x338252
movzwl (%rdx), %ecx
cmpq $0xfff, %rcx            # imm = 0xFFF
ja 0xa5c1a
leaq 0x1(%rcx), %rsi
movw %si, (%rdx)
leaq 0x291640(%rip), %rdx    # 0x337250
movb %al, (%rdx,%rcx)
movb $0x0, 0x1(%rdx,%rcx)
jmp 0xa5be8
leaq 0x19934f(%rip), %rax    # 0x23ef70
orb $-0x80, 0x1(%rax)
jmp 0xa5bcf
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: send_acron_byte(unsigned char)
void send_acron_byte(u08 c)
{
   // send string to the serial port...  send each char to the serial port
   // wait for ACRON_RCVR to echo input char, eat it, then wait 
   // at least 10 msecs
//if(debug_file) fprintf(debug_file, "send:%02X\n", c);

   sendout(RCVR_PORT, c, EOM);

   while(SERIAL_DATA_AVAILABLE(RCVR_PORT) == 0) {  // wait for char to echo
      check_com_timer(RCVR_PORT);
      if(com[RCVR_PORT].com_data_lost) return;
   }

   c = get_com_char();  // eat that pesky echoed character
//if(debug_file) fprintf(debug_file, "eat:%02X\n", c);
   if(sim_file == 0) Sleep(20);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %esi
movl $0xa, %edi
movl $0x1, %edx
callq 0xbcaa
leaq 0x26869b(%rip), %rbx    # 0x30e2e0
movl $0xa, %edi
callq 0xb9ad
testl %eax, %eax
jne 0xa5c68
movl $0xa, %edi
callq 0x1e66a
cmpb $0x0, 0x17a10(%rbx)
je 0xa5c45
jmp 0xa5c7a
callq 0x584bd
leaq 0x19874c(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
je 0xa5c81
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x14, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xafe8
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_acron_atime()
void parse_acron_atime()
{
int doy;
int tz;
double jd;
int last_tick = 999;
   // asynchronous time request (12 byte response)
if(debug_file) fprintf(debug_file, "acron atime:%s\n", nmea_msg);

   msg_col = 0;

   get_fixed_field(2);
   hours = pri_hours = atoi(msg_field);
   get_fixed_field(2);
   minutes = pri_minutes = atoi(msg_field);
   get_fixed_field(2);
   seconds = pri_seconds = atoi(msg_field);

   get_fixed_field(3);       // day of year  (does this start a 1?)
   doy = atoi(msg_field);

   get_fixed_field(2);
   year = pri_year = atoi(msg_field) + 2000;

   get_fixed_field(1);
   tz = atoi(msg_field);

return;

   jd = jdate(year, 1, 1) + (double) (doy) - 1.0;
   jd += jtime(hours,minutes,seconds, 0.0);

   set_gregorian_time(jd);  // convert julian date to gregorian

   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(last_tick != seconds) {
      last_tick = seconds;
      update_gps_screen(1555);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x198444(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa5f69
leaq 0x7fd57(%rip), %rsi     # 0x125cb2
leaq 0x2958ce(%rip), %rdx    # 0x33b830
xorl %eax, %eax
callq 0x9560
leaq 0x295cd4(%rip), %rax    # 0x33bc44
movl $0x0, (%rax)
movl $0x2, %edi
callq 0x83d8c
leaq 0x295ab9(%rip), %rbx    # 0x33ba40
movq %rbx, %rdi
callq 0x95e0
leaq 0x267572(%rip), %rcx    # 0x30d508
movl %eax, (%rcx)
leaq 0x267531(%rip), %rcx    # 0x30d4d0
movl %eax, (%rcx)
movl $0x2, %edi
callq 0x83d8c
movq %rbx, %rdi
callq 0x95e0
leaq 0x26754a(%rip), %rcx    # 0x30d504
movl %eax, (%rcx)
leaq 0x267509(%rip), %rcx    # 0x30d4cc
movl %eax, (%rcx)
movl $0x2, %edi
callq 0x83d8c
movq %rbx, %rdi
callq 0x95e0
leaq 0x267522(%rip), %rcx    # 0x30d500
movl %eax, (%rcx)
leaq 0x2674e1(%rip), %rcx    # 0x30d4c8
movl %eax, (%rcx)
movl $0x3, %edi
callq 0x83d8c
movl $0x2, %edi
callq 0x83d8c
movq %rbx, %rdi
callq 0x95e0
addl $0x7d0, %eax            # imm = 0x7D0
leaq 0x267503(%rip), %rcx    # 0x30d514
movl %eax, (%rcx)
leaq 0x2674c2(%rip), %rcx    # 0x30d4dc
movl %eax, (%rcx)
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x83d8c
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: bearing(double, double, double, double)
double bearing(double lat2,double lon2, double lat1,double lon1)
{
double dLon;
double x,y;
double brng;

   lat1 *= (PI/180.0);  // convert to radians
   lat2 *= (PI/180.0);
   lon1 *= (PI/180.0);  // convert to radians
   lon2 *= (PI/180.0);
   dLon = (lon2 - lon1);

   y = sin(dLon) * cos(lat2);
   x = cos(lat1) * sin(lat2) - sin(lat1) * cos(lat2) * cos(dLon);

   brng = atan2(y, x) * 180.0/PI;
   if(brng < 0.0) brng += 360.0;
// brng = fmod(brng+360.0, 360.0);
// brng = 360.0 - brng; // count degrees counter-clockwise - remove to make clockwise

   return brng;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movapd %xmm0, %xmm4
movsd 0x658d0(%rip), %xmm0    # 0x10b910
mulsd %xmm0, %xmm2
movsd %xmm2, -0x10(%rbp)
mulsd %xmm0, %xmm4
movsd %xmm4, -0x8(%rbp)
mulsd %xmm0, %xmm3
mulsd %xmm1, %xmm0
subsd %xmm3, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x9080
movsd %xmm0, -0x18(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x9710
mulsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x9710
movsd %xmm0, -0x28(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x9710
movsd %xmm0, -0x8(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x9710
movsd -0x8(%rbp), %xmm1
mulsd -0x10(%rbp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, %xmm0
movsd -0x20(%rbp), %xmm1
mulsd -0x28(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd -0x18(%rbp), %xmm0
callq 0x9050
mulsd 0x65737(%rip), %xmm0    # 0x10b830
divsd 0x65727(%rip), %xmm0    # 0x10b828
movsd 0x7802f(%rip), %xmm2    # 0x11e138
addsd %xmm0, %xmm2
xorpd %xmm3, %xmm3
movapd %xmm0, %xmm1
cmpltsd %xmm3, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm2, %xmm1
movapd %xmm1, %xmm0
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: poll_next_acron()
void poll_next_acron()
{
   if(1 && (pri_seconds == SCPI_STATUS_SECOND)) { // request status
      if(need_acron_sync) {
         need_acron_sync = 0;
         send_acron_cmd("h");  // user wants a reception attempt
         if(sim_file == 0) Sleep(500);
      }

      send_acron_cmd("g");   // get receiver status
      ++pri_seconds;
      ++seconds;
   }
   else if(0 && (this_acron_cmd == 'G')) {
      send_acron_cmd("i");  // async world time / time zone info
   }
   else send_acron_cmd("o");  // time
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x267205(%rip), %rbx    # 0x30d500
cmpl $0x20, (%rbx)
jne 0xa6354
cmpl $0x0, 0x2c6929(%rip)    # 0x36cc30
je 0xa6336
movl $0x0, 0x2c691d(%rip)    # 0x36cc30
leaq 0x71275(%rip), %rdi     # 0x11758f
callq 0x5ed67
leaq 0x19809a(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
jne 0xa6336
movl $0x1f4, %edi            # imm = 0x1F4
callq 0xafe8
leaq 0x8919b(%rip), %rdi     # 0x12f4d8
callq 0x5ed67
incl (%rbx)
leaq 0x26717d(%rip), %rax    # 0x30d4c8
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x739dd(%rip), %rdi     # 0x119d38
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5ed67
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_acron_msg()
void decode_acron_msg()
{
char c;
int i;

   start_msg_decode(0);

   nmea_msg[0] = 0;
   for(i=0; i<tsip_wptr; i++) {  // copy message from tsip buffer to nmea buffer
      c = tsip_byte();
      nmea_msg[i] = c;
      nmea_msg[i+1] = 0;
      if(i >= ((int)sizeof(nmea_msg)-12)) break;
   }

   tsip_wptr = tsip_rptr = 0;
   tsip_sync = 0;


  // get the response from the reciver and pass it to (HOPEFULLY) the routine
  // that expects it...

  strupr(nmea_msg);

if(debug_file) fprintf(debug_file, "Decode msg %c:[%s]\n", this_acron_cmd, nmea_msg);

   if     (this_acron_cmd == 'O') parse_acron_time();   // parse answer to last command we sent
   else if(this_acron_cmd == 'G') parse_acron_status(); // status
   else if(this_acron_cmd == 'I') parse_acron_atime();  // asynchronous time request (has time zone setting)

   poll_next_acron();

   if(sim_file && sim_delay) {  // throttle sim file messages
      Sleep(sim_delay);
   }
   saw_rcvr_msg = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x7f2b8
leaq 0x2954af(%rip), %r15    # 0x33b830
movb $0x0, (%r15)
leaq 0x291ec6(%rip), %r14    # 0x338252
leaq 0x198bdd(%rip), %r12    # 0x23ef70
movzwl (%r14), %eax
cmpq %rax, %rbx
jae 0xa63c3
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa63ad
orb $0x8, (%r12)
movb %al, (%rbx,%r15)
movb $0x0, 0x1(%rbx,%r15)
incq %rbx
cmpq $0x1f6, %rbx            # imm = 0x1F6
jne 0xa6393
leaq 0x291e8a(%rip), %rax    # 0x338254
xorl %ecx, %ecx
movw %cx, (%rax)
movw %cx, (%r14)
leaq 0x291e7c(%rip), %rax    # 0x338256
movw %cx, (%rax)
leaq 0x29544c(%rip), %rdi    # 0x33b830
callq 0x9899
leaq 0x197fa0(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa6414
movsbl 0x2c682d(%rip), %edx    # 0x36cc2c
leaq 0x7f8e3(%rip), %rsi     # 0x125ce9
leaq 0x295423(%rip), %rcx    # 0x33b830
xorl %eax, %eax
callq 0x9560
movzbl 0x2c6811(%rip), %eax    # 0x36cc2c
cmpl $0x47, %eax
je 0xa6438
cmpl $0x49, %eax
je 0xa6431
cmpl $0x4f, %eax
jne 0xa643d
callq 0xa5cc2
jmp 0xa643d
callq 0xa5f3f
jmp 0xa643d
callq 0xa6130
callq 0xa62ee
leaq 0x197f77(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x17d1a9(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa646c
callq 0xafe8
leaq 0x198b2d(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_acron_message()
void get_acron_message()
{
u08 c;

   // This routine buffers up an incoming ACRON ZEIT message.  When the end of the
   // message is seen, the message is parsed and decoded with decode_acron_msg()

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

   c = get_com_char();
   c &= 0x7F;           // remove parity bit

   if(com[RCVR_PORT].rcv_error) {      // parity/framing/overrun errors
      com[RCVR_PORT].rcv_error = 0;
//!!!!!qqqq    goto rst_msg;
   }

   if(tsip_sync == 0) {    // syncing to start of message
      tsip_sync = 1;
      get_sync_time();
      tsip_wptr = 0;
      tsip_rptr = 0;
      goto get_acron;
   }
   else if(tsip_sync == 1) { // '$' has been seen, now build the message
      get_acron:
      if(c == 0x0D) goto acron_end;  // message has no checksum

      if(tsip_wptr < MAX_TSIP) {   // add char to the message buffer
         tsip_buf[tsip_wptr++] = c;
      }
      else {
         tsip_error |= OVFL_ERROR;
         goto rst_msg;
      }
   }
   else if(tsip_sync == 3) {  // end of message
      acron_end:
      decode_acron_msg(); // process the message
      packet_end = 1;
      tsip_wptr = 0;      // prepare for next message
      tsip_sync = 0;
   }
   else {     // should never happen, prepare for next message
      rst_msg:
      tsip_wptr = 0;
      tsip_sync = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0xa, %edi
callq 0xb9ad
movl $0xa, %edi
testl %eax, %eax
je 0xa652b
callq 0x1ea0b
callq 0x584bd
movl %eax, %ebx
leaq 0x267e2d(%rip), %rax    # 0x30e2e0
cmpb $0x0, 0x17a12(%rax)
je 0xa64c3
movb $0x0, 0x17a12(%rax)
leaq 0x291d8c(%rip), %r14    # 0x338256
movzwl (%r14), %eax
cmpl $0x3, %eax
je 0xa6507
cmpl $0x1, %eax
je 0xa64fd
testl %eax, %eax
jne 0xa6516
movw $0x1, (%r14)
callq 0x58672
leaq 0x291d64(%rip), %rax    # 0x338252
xorl %ecx, %ecx
movw %cx, (%rax)
leaq 0x291d5a(%rip), %rax    # 0x338254
movw %cx, (%rax)
movl %ebx, %eax
andl $0x7f, %eax
cmpl $0xd, %eax
jne 0xa6534
callq 0xa6366
movl $0x1, 0x2c577e(%rip)    # 0x36bc94
leaq 0x291d35(%rip), %rax    # 0x338252
xorl %ecx, %ecx
movw %cx, (%rax)
movw %cx, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
popq %rbx
popq %r14
popq %rbp
jmp 0x1e66a
leaq 0x291d17(%rip), %rcx    # 0x338252
movzwl (%rcx), %eax
cmpq $0xfff, %rax            # imm = 0xFFF
ja 0xa655b
andb $0x7f, %bl
leal 0x1(%rax), %edx
movw %dx, (%rcx)
leaq 0x290cfa(%rip), %rcx    # 0x337250
movb %bl, (%rcx,%rax)
jmp 0xa6526
leaq 0x198a0e(%rip), %rax    # 0x23ef70
orb $-0x80, 0x1(%rax)
jmp 0xa6516
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_time_field(int)
void get_time_field(int n)
{
int i;

   // get a fixed length sub-field from a sting - used to decode the date/time
   // string.

   i = 0;
   while(n--) {
      time_field[i++] = msg_field[time_ptr++];
      time_field[i] = 0;
   }
}

// Assembly:
testl %edi, %edi
je 0xa66f2
pushq %rbp
movq %rsp, %rbp
movslq 0x2cbb7f(%rip), %rcx    # 0x372240
movl %ecx, %eax
addq 0xa97c6(%rip), %rcx     # 0x14fe90
movl %edi, %edx
xorl %esi, %esi
leaq 0x2cbb4b(%rip), %rdi    # 0x372220
movb (%rcx,%rsi), %r8b
movb %r8b, (%rsi,%rdi)
movb $0x0, 0x1(%rsi,%rdi)
incq %rsi
cmpl %esi, %edx
jne 0xa66d5
addl %esi, %eax
movl %eax, 0x2cbb4f(%rip)    # 0x372240
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: show_gpsd_msg(char*)
void show_gpsd_msg(char *s)
{
   // used for debug logging
   while(s) {
      s = get_json_field(s);
      strcpy(gpsd_cmd, msg_field);
      if(gpsd_cmd[0] == 0) continue; 

      s = get_json_field(s);
log_gpsd_cmd();
   }
}

// Assembly:
testq %rdi, %rdi
je 0xa7283
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x2cadd2(%rip), %rbx    # 0x372010
leaq 0x2947fb(%rip), %r14    # 0x33ba40
movq %r15, %rdi
callq 0xa6568
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
cmpb $0x0, 0x2cadae(%rip)    # 0x372010
je 0xa7274
movq %r15, %rdi
callq 0xa6568
movq %rax, %r15
callq 0xa6663
testq %r15, %r15
jne 0xa7245
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpsd_version(char*)
void parse_gpsd_version(char *s)
{
int i;

   // decode the VERSION message - used to display the version info

   saw_version |= 0x0200;
   while(s) {
      s = get_json_field(s);
      strcpy(gpsd_cmd, msg_field);
      if(gpsd_cmd[0] == 0) continue; 

      s = get_json_field(s);
log_gpsd_cmd();

      if(!strcmp(gpsd_cmd, "\"PROTO_MAJOR\"")) {
         gpsd_major = atoi(msg_field);
      }
      else if(!strcmp(gpsd_cmd, "\"PROTO_MINOR\"")) {
         gpsd_minor = atoi(msg_field);
      }
      else if(!strcmp(gpsd_cmd, "\"RELEASE\"")) {
         msg_field[17] = 0;
         gpsd_release[0] = 0;
         i = strlen(msg_field);
         if(i) {
            strcpy(gpsd_release, &msg_field[1]);
            i = strlen(gpsd_release);
            if(i) gpsd_release[i-1] = 0;
         }
         have_info |= (PRODN_PARAMS | MANUF_PARAMS);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x265ce8(%rip), %rax    # 0x30d408
orb $0x2, 0x1(%rax)
testq %rdi, %rdi
je 0xa788a
movq %rdi, %rbx
movabsq $0x4d5f4f544f525022, %r13 # imm = 0x4D5F4F544F525022
movabsq $0x22524f4a414d5f, %rax # imm = 0x22524F4A414D5F
leaq 0x2ca8c5(%rip), %r14    # 0x372010
leaq 0x2942ee(%rip), %r15    # 0x33ba40
addq $0x4080000, %rax        # imm = 0x4080000
movq %rax, -0x38(%rbp)
leaq 0x17391d(%rip), %rcx    # 0x21b080
leaq 0x1(%r15), %rax
movq %rax, -0x30(%rbp)
movq %rcx, %r12
movq %rbx, %rdi
callq 0xa6568
movq %rax, %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x9340
cmpb $0x0, 0x2ca885(%rip)    # 0x372010
je 0xa787e
movq %rbx, %rdi
callq 0xa6568
movq %rax, %rbx
callq 0xa6663
movq 0x2ca868(%rip), %rax    # 0x372010
xorq %r13, %rax
movq 0x2ca864(%rip), %rcx    # 0x372016
movabsq $0x22524f4a414d5f, %rdx # imm = 0x22524F4A414D5F
xorq %rdx, %rcx
orq %rax, %rcx
je 0xa785c
movq 0x2ca841(%rip), %rax    # 0x372010
xorq %r13, %rax
movq 0x2ca83d(%rip), %rcx    # 0x372016
xorq -0x38(%rbp), %rcx
orq %rax, %rcx
je 0xa786d
movq 0x2ca823(%rip), %rax    # 0x372010
movabsq $0x455341454c455222, %rcx # imm = 0x455341454C455222
xorq %rcx, %rax
movzwl 0x2ca817(%rip), %ecx    # 0x372018
xorq $0x22, %rcx
orq %rax, %rcx
jne 0xa787e
xorl %eax, %eax
movb %al, 0x11(%r15)
movb %al, (%r12)
movq %r15, %rdi
callq 0x9120
movq %r12, %rcx
testl %eax, %eax
je 0xa7846
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0x9340
movq %r12, %rdi
callq 0x9120
movq %r12, %rcx
testl %eax, %eax
je 0xa7846
decl %eax
cltq
movb $0x0, (%rcx,%rax)
leaq 0x266127(%rip), %rax    # 0x30d974
orb $0x3, (%rax)
movabsq $0x4d5f4f544f525022, %r13 # imm = 0x4D5F4F544F525022
jmp 0xa7881
movq %r15, %rdi
callq 0x95e0
leaq 0x173839(%rip), %rcx    # 0x21b0a4
jmp 0xa787c
movq %r15, %rdi
callq 0x95e0
leaq 0x17382c(%rip), %rcx    # 0x21b0a8
movl %eax, (%rcx)
movq %r12, %rcx
testq %rbx, %rbx
jne 0xa776b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpsd_devices(char*)
void parse_gpsd_devices(char *s)
{
int i;

   // decode the DEVICES message - we just use the driver name field

   saw_version |= 0x0400;
   while(s) {
      s = get_json_field(s);
      strcpy(gpsd_cmd, msg_field);
      if(gpsd_cmd[0] == 0) continue; 

      s = get_json_field(s);
log_gpsd_cmd();

      if(!strcmp(gpsd_cmd, "\"DRIVER\"")) {
         i = strlen(msg_field);
if(debug_file) fprintf(debug_file, "driver:%s -> ", msg_field);
         if(i) msg_field[i-1] = 0;
if(debug_file) fprintf(debug_file, "%s\n", msg_field);
         show_gpsd_driver();
         have_info |= VERSION_INFO;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x265b5a(%rip), %rax    # 0x30d408
orb $0x4, 0x1(%rax)
testq %rdi, %rdi
je 0xa7992
movq %rdi, %rbx
leaq 0x2ca74b(%rip), %r14    # 0x372010
leaq 0x294174(%rip), %r15    # 0x33ba40
movabsq $0x2252455649524422, %r13 # imm = 0x2252455649524422
movq %rbx, %rdi
callq 0xa6568
movq %rax, %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x9340
cmpb $0x0, 0x2ca71d(%rip)    # 0x372010
je 0xa7989
movq %rbx, %rdi
callq 0xa6568
movq %rax, %rbx
callq 0xa6663
movq 0x2ca700(%rip), %rax    # 0x372010
xorq %r13, %rax
movzbl 0x2ca6fe(%rip), %ecx    # 0x372018
orq %rax, %rcx
jne 0xa7989
movq %r15, %rdi
callq 0x9120
movq %rax, %r12
leaq 0x196a5f(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa794a
leaq 0x7e58f(%rip), %rsi     # 0x125ecf
movq %r15, %rdx
xorl %eax, %eax
callq 0x9560
testl %r12d, %r12d
je 0xa795a
decl %r12d
movslq %r12d, %rax
movb $0x0, (%r15,%rax)
leaq 0x196a2f(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa797a
leaq 0x7e167(%rip), %rsi     # 0x125ad7
movq %r15, %rdx
xorl %eax, %eax
callq 0x9560
callq 0xa79a1
leaq 0x265fee(%rip), %rax    # 0x30d974
orb $0x4, (%rax)
testq %rbx, %rbx
jne 0xa78d6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: show_gpsd_driver()
void show_gpsd_driver()
{
   if(zoom_screen) return;

   msg_field[17] = 0;
   sprintf(gpsd_driver, "Drv:  %s", &msg_field[1]);
   vidstr(VER_ROW+2, VER_COL, WHITE, gpsd_driver);
}

// Assembly:
leaq 0x264e00(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
je 0xa79ae
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x294085(%rip), %rdx    # 0x33ba40
movb $0x0, 0x11(%rdx)
incq %rdx
leaq 0x173687(%rip), %rbx    # 0x21b050
leaq 0x80660(%rip), %rsi     # 0x128030
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x170db3(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x2, %edi
leaq 0x170dab(%rip), %rax    # 0x218798
movl (%rax), %esi
movl $0xf, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe787
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpsd_att(char*)
void parse_gpsd_att(char *s)
{
   // decode the ATT message - we just use the temperature field

   while(s) {
      s = get_json_field(s);
      strcpy(gpsd_cmd, msg_field);
      if(gpsd_cmd[0] == 0) continue; 

      s = get_json_field(s);
log_gpsd_cmd();

      if(!strcmp(gpsd_cmd, "\"TEMPERATURE\"")) {
         temperature = (float) atof(msg_field);
         have_temperature = 114;
      }
   }
}

// Assembly:
testq %rdi, %rdi
je 0xa7ac1
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x2ca5ed(%rip), %rbx    # 0x372010
leaq 0x294016(%rip), %r14    # 0x33ba40
movabsq $0x415245504d455422, %r12 # imm = 0x415245504D455422
movabsq $0x22455255544152, %r13 # imm = 0x22455255544152
movq %r15, %rdi
callq 0xa6568
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
cmpb $0x0, 0x2ca5b5(%rip)    # 0x372010
je 0xa7aae
movq %r15, %rdi
callq 0xa6568
movq %rax, %r15
callq 0xa6663
movq 0x2ca59c(%rip), %rax    # 0x372010
xorq %r12, %rax
movq 0x2ca598(%rip), %rcx    # 0x372016
xorq %r13, %rcx
orq %rax, %rcx
jne 0xa7aae
movq %r14, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x264f7b(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
leaq 0x2657a4(%rip), %rax    # 0x30d24c
movl $0x72, (%rax)
testq %r15, %r15
jne 0xa7a3e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpsd_rtcm2(char*)
void parse_gpsd_rtcm2(char *s)
{
   // decode the RTCM2 message - we just use the leapsecs field

   while(s) {
      s = get_json_field(s);
      strcpy(gpsd_cmd, msg_field);
      if(gpsd_cmd[0] == 0) continue; 

      s = get_json_field(s);
log_gpsd_cmd();

      if(!user_set_utc_ofs && !strcmp(gpsd_cmd, "\"LEAPSECS\"")) {
         utc_offset = atoi(msg_field);
         check_utc_ofs(11);
      }
      else if(!strcmp(gpsd_cmd, "\"WEEK\"")) {
         gps_week = atoi(msg_field); 
         faked_tow = 0;
         if(have_week == 0) need_redraw = 2056;
         have_week = 10;
      }
   }
}

// Assembly:
testq %rdi, %rdi
je 0xa7c2e
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x2ca52d(%rip), %rbx    # 0x372010
leaq 0x293f56(%rip), %r14    # 0x33ba40
leaq 0x265c43(%rip), %r12    # 0x30d734
leaq 0x265834(%rip), %r13    # 0x30d32c
movq %r15, %rdi
callq 0xa6568
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
cmpb $0x0, 0x2ca4fb(%rip)    # 0x372010
je 0xa7c17
movq %r15, %rdi
callq 0xa6568
movq %rax, %r15
callq 0xa6663
cmpl $0x0, (%r12)
jne 0xa7b5f
movq 0x2ca4d7(%rip), %rax    # 0x372010
movabsq $0x4345535041454c22, %rcx # imm = 0x4345535041454C22
xorq %rcx, %rax
movq 0x2ca4c6(%rip), %rcx    # 0x372013
movabsq $0x22534345535041, %rdx # imm = 0x22534345535041
xorq %rdx, %rcx
orq %rax, %rcx
je 0xa7bbe
movl 0x2ca4ab(%rip), %eax    # 0x372010
movl $0x45455722, %ecx       # imm = 0x45455722
xorl %ecx, %eax
movl 0x2ca4a1(%rip), %ecx    # 0x372013
movl $0x224b45, %edx         # imm = 0x224B45
xorl %edx, %ecx
orl %eax, %ecx
jne 0xa7c17
movq %r14, %rdi
callq 0x95e0
leaq 0x265ba8(%rip), %rcx    # 0x30d738
movw %ax, (%rcx)
leaq 0x265bae(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
cmpl $0x0, (%r13)
jne 0xa7bb4
leaq 0x170c96(%rip), %rax    # 0x218844
movl $0x808, (%rax)          # imm = 0x808
movl $0xa, (%r13)
jmp 0xa7c17
movq %r14, %rdi
callq 0x95e0
leaq 0x265b5b(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
leaq 0x265746(%rip), %rcx    # 0x30d31c
cmpl $0x0, (%rcx)
jne 0xa7c17
leaq 0x265932(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
cmpl $0x12, %eax
setl %dl
andb %cl, %dl
cmpl $0x11, %eax
setl %al
orb %dl, %al
jne 0xa7c17
leaq 0x170c40(%rip), %rax    # 0x218844
movl $0x7db, (%rax)          # imm = 0x7DB
leaq 0x26570b(%rip), %rax    # 0x30d31c
movl $0xb, (%rax)
testq %r15, %r15
jne 0xa7af8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpsd_watch(char*)
void parse_gpsd_watch(char *s)
{
   // decode the WATCH message - we just thow it away
   while(s) {
      s = get_json_field(s);
      strcpy(gpsd_cmd, msg_field);
      if(gpsd_cmd[0] == 0) continue; 

      s = get_json_field(s);
log_gpsd_cmd();
   }
}

// Assembly:
testq %rdi, %rdi
je 0xa7c8d
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x2ca3c8(%rip), %rbx    # 0x372010
leaq 0x293df1(%rip), %r14    # 0x33ba40
movq %r15, %rdi
callq 0xa6568
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
cmpb $0x0, 0x2ca3a4(%rip)    # 0x372010
je 0xa7c7e
movq %r15, %rdi
callq 0xa6568
movq %rax, %r15
callq 0xa6663
testq %r15, %r15
jne 0xa7c4f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_speed()
void parse_nvs_speed()
{
   log_packet_id("nvs_speed");

   heading = tsip_single();
   speed = tsip_single() * 0.2777778; // km/hr -> m/sec
   tsip_dword();  // time stamp

   have_heading = 12;
   have_speed = 12;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7decc(%rip), %rdi     # 0x125f5d
callq 0x58dc2
callq 0x58a30
cvtss2sd %xmm0, %xmm0
leaq 0x264f82(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
callq 0x58a30
cvtss2sd %xmm0, %xmm0
mulsd 0x76725(%rip), %xmm0    # 0x11e7e0
leaq 0x264f5e(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
callq 0x58964
leaq 0x265262(%rip), %rax    # 0x30d334
movl $0xc, %ecx
movl %ecx, (%rax)
leaq 0x265258(%rip), %rax    # 0x30d338
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_test()
void parse_nvs_test()
{
u08 subcode;
   // 0x43 packet

   log_packet_id("nvs_test");
   subcode = tsip_byte();
   if(subcode == 2) {
      nvs_test = tsip_byte();
      tsip_dword();

      minor_alarms &= (~MINOR_ANT_NO_PWR);
      if((nvs_test & 0xC0) == 0xC0) minor_alarms |= MINOR_ANT_SHORT; // short
      else if((nvs_test & 0xC0) == 0x80) minor_alarms |= MINOR_ANT_OPEN; // open
      else if((nvs_test & 0xC0) == 0x00) ; // OK
      else minor_alarms |= MINOR_ANT_NO_PWR; // unknown
      have_antenna = 1;

      if(!have_critical_alarms) need_redraw = 7709;
      have_critical_alarms = 9;

      if(nvs_test & 0x30) {  // gps(0x10) / glonass(0x20) failure
         critical_alarms |= CRIT_GPS;
      }
      else {
         critical_alarms &= (~CRIT_GPS);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7de78(%rip), %rdi     # 0x125f67
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa810a
leaq 0x196e69(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
cmpb $0x2, %al
jne 0xa81b9
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8128
leaq 0x196e4b(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movl %eax, 0x2c49d7(%rip)    # 0x36cb08
callq 0x58964
leaq 0x26509b(%rip), %rcx    # 0x30d1d8
movl (%rcx), %esi
movl %esi, %edx
andl $-0x7, %edx
movl %edx, (%rcx)
movl 0x2c49bc(%rip), %eax    # 0x36cb08
movl %eax, %edi
shrl $0x6, %edi
andl $0x3, %edi
leaq 0x779e5(%rip), %r8      # 0x11fb40
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
orl $0x6, %esi
movl %esi, %edx
jmp 0xa8173
orl $0x2, %edx
jmp 0xa8173
orl $0x4, %edx
movl %edx, (%rcx)
leaq 0x2650b0(%rip), %rcx    # 0x30d22c
movl $0x1, (%rcx)
leaq 0x26511f(%rip), %rcx    # 0x30d2a8
cmpl $0x0, (%rcx)
jne 0xa819b
leaq 0x1706af(%rip), %rdx    # 0x218844
movl $0x1e1d, (%rdx)         # imm = 0x1E1D
movl $0x9, (%rcx)
xorl %ecx, %ecx
testb $0x30, %al
setne %cl
leaq 0x265021(%rip), %rax    # 0x30d1d0
movl (%rax), %edx
andl $-0x9, %edx
leal (%rdx,%rcx,8), %ecx
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_date()
void parse_nvs_date()
{
u32 tow;
u08 dd,mm;
u16 yy;
u08 tz_hh,tz_mm;
double delta;

   // 0x46 packet
   log_packet_id("nvs_date");

   tow = tsip_dword();
   dd = tsip_byte();
   mm = tsip_byte();
   yy = tsip_word();
   tz_hh = tsip_byte();
   tz_mm = tsip_byte();

   delta = nvs_msecs - ((double)tow*1000.0);

//sprintf(debug_text2, "%04d/%02d/%02d  tz:%02d:%02d  tow:%d  msecs:%f  delta:%f", 
//yy,mm,dd, tz_hh,tz_mm, tow,nvs_msecs, delta);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7ddaa(%rip), %rdi     # 0x125f70
callq 0x58dc2
callq 0x58964
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa81e6
leaq 0x196d8d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa81fc
leaq 0x196d77(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588d2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8217
leaq 0x196d5c(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa822d
leaq 0x196d46(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_disable()
void parse_nvs_disable()
{
int i;
u08 sys;
int prn;
u08 flag;

   // 0x47 packet
   log_packet_id("nvs_disable");

   for(i=0; i<32+24; i++) {
      sys = tsip_byte();
      prn = tsip_byte();
      flag = tsip_byte();

      if(sys == 1) ;
      else if(sys == 2) prn += NVS_GLONASS_PRN;
      else continue;

      if(flag == 1) ;     // enabled
      else if(flag == 2); // disabled
      else continue;

      if((prn >= 1) && (prn <= MAX_PRN)) {
         flag -= 1;
         sat[prn].disabled = flag;
         if(prn <= 32) {  // gps sats
            if(flag) sats_enabled &= (~(1 << (prn-1)));
            else     sats_enabled |= (1 << (prn-1));
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7dd35(%rip), %rdi     # 0x125f79
callq 0x58dc2
movl $0x38, %r15d
leaq 0x264e8e(%rip), %r13    # 0x30d0e4
leaq 0x196d13(%rip), %r12    # 0x23ef70
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8270
orb $0x8, (%r12)
callq 0x587be
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8284
orb $0x8, (%r12)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8295
orb $0x8, (%r12)
movzbl %r14b, %ecx
cmpb $0x1, %bl
je 0xa82a9
movzbl %bl, %edx
cmpl $0x2, %edx
jne 0xa82f5
addl $0x40, %ecx
decb %al
cmpb $0x2, %al
setb %dl
testl %ecx, %ecx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xa82f5
movl %ecx, %edx
imulq $0x348, %rdx, %rdx      # imm = 0x348
leaq 0x196ce1(%rip), %rsi    # 0x23efb0
movb %al, 0x1(%rsi,%rdx)
cmpl $0x20, %ecx
ja 0xa82f5
decb %cl
movl $0x1, %edx
shll %cl, %edx
testb %al, %al
je 0xa82ed
notl %edx
andl (%r13), %edx
jmp 0xa82f1
orl (%r13), %edx
movl %edx, (%r13)
decl %r15d
jne 0xa825d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_iono()
void parse_nvs_iono()
{
float a0,a1,a2,a3;
float b0,b1,b2,b3;
u08 reliability;

   log_packet_id("nvs_iono");

   // 0x4A packet - ionosphere data
   a0 = tsip_single();
   a1 = tsip_single();
   a2 = tsip_single();
   a3 = tsip_single();
   b0 = tsip_single();
   b1 = tsip_single();
   b2 = tsip_single();
   b3 = tsip_single();
   reliability = tsip_byte();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7dc6d(%rip), %rdi     # 0x125f85
callq 0x58dc2
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa835b
leaq 0x196c18(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_gnss_timescale()
void parse_nvs_gnss_timescale()
{
double a0, a1;
int tow;
int wnt;
int ls;
int wnf;
int dn;
int lsf;
int this_dn;
int wraps;

   log_packet_id("nvs_timescale");

   // 0x4B packet - calculate pending leapsecond info
   a1 = tsip_double();
   a0 = tsip_double();
   tow = tsip_dword();

   wnt = tsip_word();
   ls = (int) (s16) tsip_word();
   wnf = tsip_word();  // gps week
   dn = tsip_word();
   lsf = (int) (s16) tsip_word();

   this_dn = tow / (24*60*60);
   wraps = gps_week / 1024;
///sprintf(debug_text, "gps_week:%d wraps:%d wnt:%d ls:%d wnf:%d dn:%d lsf:%d this_dn:%d", 
///gps_week, wraps, wnt, ls, wnf, dn, lsf, this_dn);
// wnf += (wraps * 1024);

   // we ignore the rest of this message

   minor_alarms &= (~MINOR_LEAP_PEND);
   leap_days = (-1);
   have_leap_days = 0;
   if(ls != lsf) {
      minor_alarms |= MINOR_LEAP_PEND;
      calc_leap_days(wnf+(gps_week/256)*256, dn, 555);
      have_leap_info = 22;
   }
   have_leap_info = 22;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x7dc20(%rip), %rdi     # 0x125f8e
callq 0x58dc2
callq 0x58b08
callq 0x58b08
callq 0x58964
callq 0x588d2
callq 0x588d2
movl %eax, %r15d
callq 0x588d2
movl %eax, %r14d
callq 0x588d2
movl %eax, %ebx
callq 0x588d2
leaq 0x264e2e(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
movl %edx, %esi
andl $0xffffff7f, %esi       # imm = 0xFFFFFF7F
movl %esi, (%rcx)
leaq 0x264e2f(%rip), %rsi    # 0x30d1ec
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
leaq 0x264e26(%rip), %rsi    # 0x30d1f0
movl $0x0, (%rsi)
cmpw %ax, %r15w
je 0xa8401
movzwl %r14w, %eax
orl $0x80, %edx
movl %edx, (%rcx)
leaq 0x26534f(%rip), %rcx    # 0x30d738
movzbl 0x1(%rcx), %ecx
shll $0x8, %ecx
addl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movzwl %bx, %edi
callq 0x5cbb3
leaq 0x264e90(%rip), %rax    # 0x30d298
movl $0x16, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq