LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_ett()
void parse_tm4_ett()
{
int ett_month,ett_day,ett_year;
int ett_hours,ett_minutes,ett_seconds;
double ett_frac;

   log_packet_id("time tag");

   ett_jd = 0.0;
   if(get_msg_field()) {
      sscanf(msg_field, "%02d%02d%04d", &ett_month,&ett_day,&ett_year);
      ett_jd = jdate(ett_year,ett_month,ett_day);
   }
   if(get_msg_field()) {
      sscanf(msg_field, "%02d%02d%02d%lf", &ett_hours,&ett_minutes,&ett_seconds, &ett_frac);
      ett_jd += jtime(ett_hours,ett_minutes,ett_seconds,ett_frac);
      ++have_tm4_ett_jd;
   }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x7ef72(%rip), %rdi     # 0x123b44
callq 0x58e77
leaq 0x2973aa(%rip), %r13    # 0x33bf88
movq $0x0, (%r13)
callq 0x811da
testl %eax, %eax
je 0xa4c2c
leaq 0x296e4a(%rip), %rdi    # 0x33ba40
leaq 0x80e08(%rip), %rsi     # 0x125a05
leaq -0x40(%rbp), %rbx
leaq -0x3c(%rbp), %r14
leaq -0x38(%rbp), %r15
movq %rbx, %rdx
movq %r14, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x9360
movl (%r15), %edi
movl (%rbx), %esi
movl (%r14), %edx
callq 0xd4110
movsd %xmm0, (%r13)
callq 0x811da
testl %eax, %eax
je 0xa4c8e
leaq 0x296e04(%rip), %rdi    # 0x33ba40
leaq 0x80e0f(%rip), %rsi     # 0x125a52
leaq -0x34(%rbp), %rbx
leaq -0x30(%rbp), %r14
leaq -0x2c(%rbp), %r15
leaq -0x48(%rbp), %r12
movq %rbx, %rdx
movq %r14, %rcx
movq %r15, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x9360
movl (%rbx), %edi
movl (%r14), %esi
movl (%r15), %edx
movsd (%r12), %xmm0
callq 0xd41e0
addsd (%r13), %xmm0
movsd %xmm0, (%r13)
leaq 0x297304(%rip), %rax    # 0x33bf90
incl (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_dmode()
void parse_tm4_dmode()
{
int i;

   log_packet_id("discipline mode");

   if(get_msg_field()) {
      i = atoi(msg_field);
      if     (i == 1) discipline_mode = DIS_MODE_WARMUP;
      else if(i == 2) discipline_mode = DIS_MODE_RECOVERY;
      else if(i == 3) discipline_mode = DIS_MODE_AUTO_HOLD;
      else if(i == 4) discipline_mode = DIS_MODE_NORMAL;
      else if(i == 5) discipline_mode = DIS_MODE_AUTO_HOLD;
      else            discipline_mode = DIS_MODE_UNKNOWN;
   }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x80dba(%rip), %rdi     # 0x125a62
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa4cea
leaq 0x296d83(%rip), %rdi    # 0x33ba40
callq 0x95e0
leal (,%rax,8), %ecx
movabsq $0x20002040aff, %rdx    # imm = 0x20002040AFF
shrq %cl, %rdx
cmpl $0x6, %eax
movl $0xff, %eax
cmovbl %edx, %eax
leaq 0x2687af(%rip), %rcx    # 0x30d497
movb %al, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_alarm()
void parse_tm4_alarm()
{
int i;

   log_packet_id("alarm status");

   if(get_msg_field()) {      // coast (holdover)
      i = atoi(msg_field);
   }


   if(get_msg_field()) {      // antenna
      i = atoi(msg_field);
      if(i) minor_alarms |= MINOR_ANT_NO_PWR;
      else  minor_alarms &= (~MINOR_ANT_NO_PWR);
      have_antenna = 444;
   }


   if(get_msg_field()) {      // OSC output
      i = atoi(msg_field);
      if(i == 0) critical_alarms &= (~CRIT_OCXO);
      else       critical_alarms |= (CRIT_OCXO);
      have_critical_alarms = 444;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x80d7b(%rip), %rdi     # 0x125a72
callq 0x58e77
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0xa4d3d
leaq 0x296d2f(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x2684bb(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
andl $-0x7, %edx
testl %eax, %eax
movl $0x6, %esi
cmovel %eax, %esi
orl %edx, %esi
movl %esi, (%rcx)
leaq 0x2684f5(%rip), %rax    # 0x30d22c
movl $0x1bc, (%rax)          # imm = 0x1BC
callq 0x811da
testl %eax, %eax
je 0xa4d79
leaq 0x296cf3(%rip), %rdi    # 0x33ba40
callq 0x95e0
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leaq 0x268470(%rip), %rax    # 0x30d1d0
movl (%rax), %edx
andl $-0x11, %edx
shll $0x4, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
leaq 0x268535(%rip), %rax    # 0x30d2a8
movl $0x1bc, (%rax)          # imm = 0x1BC
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_id()
void parse_tm4_id()
{
   log_packet_id("id info");

   if(get_msg_field()) { // .obj
      msg_field[32] = 0;
      strcpy(tm4_obj, msg_field);
   }

   if(get_msg_field()) { // .hex
      msg_field[32] = 0;
      strcpy(tm4_hex, msg_field);
   }

   if(get_msg_field()) { // hex string
      msg_field[32] = 0;
      strcpy(tm4_string, msg_field);
   }

   if(get_msg_field()) { // version?
      msg_field[32] = 0;
      strcpy(tm4_id, msg_field);
   }

   have_info |= ALL_ID_INFO;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7ea00(%rip), %rdi     # 0x123786
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa4dab
leaq 0x296ca5(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2970ea(%rip), %rdi    # 0x33be90
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xa4dcb
leaq 0x296c85(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2970fa(%rip), %rdi    # 0x33bec0
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xa4deb
leaq 0x296c65(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x29710a(%rip), %rdi    # 0x33bef0
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xa4e0b
leaq 0x296c45(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x29711a(%rip), %rdi    # 0x33bf20
callq 0x9340
leaq 0x268b62(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_mux2()
void parse_tm4_mux2()
{
   log_packet_id("mux2 status");

   if(get_msg_field()) {  // output type
      tm4_code2 = atoi(msg_field);
      have_tm4_code |= 0x02;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x80c5d(%rip), %rdi     # 0x125a7f
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa4e4f
leaq 0x296c09(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x297026(%rip), %rcx    # 0x33be69
movb %al, (%rcx)
leaq 0x297028(%rip), %rax    # 0x33be74
orb $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x80b07(%rip), %rdi     # 0x125a8b
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa4fb4
leaq 0x296aa7(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296edb(%rip), %rcx    # 0x33be80
movl %eax, (%rcx)
leaq 0x296ed6(%rip), %rax    # 0x33be84
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x80add(%rip), %rdi     # 0x125a9e
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa4ff1
leaq 0x296a6a(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296ea6(%rip), %rcx    # 0x33be88
movl %eax, (%rcx)
leaq 0x296ea1(%rip), %rax    # 0x33be8c
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x80ab1(%rip), %rdi     # 0x125aaf
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa502e
leaq 0x296a2d(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296e59(%rip), %rcx    # 0x33be78
movl %eax, (%rcx)
leaq 0x296e54(%rip), %rax    # 0x33be7c
movl $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa5057
leaq 0x296a02(%rip), %rax    # 0x33ba40
movsbl (%rax), %eax
leaq 0x296f14(%rip), %rcx    # 0x33bf5c
movl %eax, (%rcx)
leaq 0x296f0f(%rip), %rax    # 0x33bf60
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x80a5d(%rip), %rdi     # 0x125ac1
callq 0x58e77
leaq 0x296ef4(%rip), %rax    # 0x33bf64
cmpl $0x0, (%rax)
jne 0xa50cf
callq 0x811da
testl %eax, %eax
je 0xa50a2
leaq 0x2969bb(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x267f8f(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
leaq 0x26829c(%rip), %rax    # 0x30d338
movl $0x1bc, (%rax)          # imm = 0x1BC
callq 0x811da
testl %eax, %eax
je 0xa50cf
leaq 0x29698e(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x267f6a(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
leaq 0x26826b(%rip), %rax    # 0x30d334
movl $0x1bc, (%rax)          # imm = 0x1BC
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x809e3(%rip), %rdi     # 0x125acf
callq 0x58e77
leaq 0x296ea0(%rip), %rbx    # 0x33bf98
movq $0x0, (%rbx)
callq 0x811da
testl %eax, %eax
je 0xa512a
leaq 0x296931(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296e5d(%rip), %rcx    # 0x33bf78
movl %eax, (%rcx)
leaq 0x296e58(%rip), %rax    # 0x33bf7c
movl $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa5153
leaq 0x296906(%rip), %rax    # 0x33ba40
movsbl (%rax), %eax
leaq 0x296e3c(%rip), %rcx    # 0x33bf80
movl %eax, (%rcx)
leaq 0x296e37(%rip), %rax    # 0x33bf84
movl $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa5199
leaq 0x2968dd(%rip), %rdi    # 0x33ba40
leaq 0x8089b(%rip), %rsi     # 0x125a05
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 0xd4110
movsd %xmm0, (%rbx)
callq 0x811da
testl %eax, %eax
je 0xa51fe
leaq 0x296897(%rip), %rdi    # 0x33ba40
leaq 0x808a2(%rip), %rsi     # 0x125a52
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 0xd41e0
leaq 0x296dab(%rip), %rax    # 0x33bf98
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
leaq 0x296da4(%rip), %rax    # 0x33bfa0
incl (%rax)
callq 0x811da
testl %eax, %eax
je 0xa5229
leaq 0x296832(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296d56(%rip), %rcx    # 0x33bf70
movl %eax, (%rcx)
leaq 0x296d51(%rip), %rax    # 0x33bf74
movl $0x1, (%rax)
cmpl $0x4a, %r13d
jne 0xa525a
callq 0x811da
testl %eax, %eax
je 0xa525a
leaq 0x296801(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296d1d(%rip), %rcx    # 0x33bf68
movl %eax, (%rcx)
leaq 0x296d18(%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_O1/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 0x80863(%rip), %rdi     # 0x125ad7
callq 0x58e77
callq 0x811da
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0xa530b
leaq 0x2967ad(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
je 0xa530b
leaq 0x268491(%rip), %rcx    # 0x30d734
cmpl $0x0, (%rcx)
jne 0xa52be
leaq 0x268479(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
leaq 0x268064(%rip), %rax    # 0x30d31c
movl $0x1bc, (%rax)          # imm = 0x1BC
leaq 0x268057(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0xa530b
leaq 0x268243(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
leaq 0x268447(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0xa530b
leaq 0x173545(%rip), %rcx    # 0x218844
movl $0x98c, (%rcx)          # imm = 0x98C
movl $0x1bc, (%rax)          # imm = 0x1BC
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x807c1(%rip), %rdi     # 0x125ae2
callq 0x58e77
xorl %eax, %eax
movl %eax, -0x1c(%rbp)
movl %eax, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x811da
testl %eax, %eax
je 0xa537c
leaq 0x2966ff(%rip), %rdi    # 0x33ba40
leaq 0x807a5(%rip), %rsi     # 0x125aed
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 0x2680de(%rip), %rax    # 0x30d458
movl %ecx, (%rax)
callq 0x811da
callq 0x811da
callq 0x811da
callq 0x811da
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x296e75(%rip), %r14    # 0x33c220
leaq 0x80748(%rip), %rsi     # 0x125afa
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa5407
leaq 0x296b6e(%rip), %r14    # 0x33bf44
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
leaq 0x29665c(%rip), %rax    # 0x33ba40
movsbl (%rax), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0xa53fe
leaq 0x29664a(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%r14)
leaq 0x296b43(%rip), %rax    # 0x33bf48
movl %ebx, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x806f4(%rip), %rdi     # 0x125b0b
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa5447
leaq 0x296614(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296b14(%rip), %rcx    # 0x33bf4c
movl %eax, (%rcx)
leaq 0x296b0f(%rip), %rax    # 0x33bf50
movl $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa5472
leaq 0x2965e9(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x296af1(%rip), %rcx    # 0x33bf54
movl %eax, (%rcx)
leaq 0x296aec(%rip), %rax    # 0x33bf58
movl $0x1, (%rax)
callq 0x811da
callq 0x811da
callq 0x811da
popq %rbp
jmp 0x811da
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb9c3
movl $0xa, %edi
testl %eax, %eax
je 0xa59bf
callq 0x1ea2c
callq 0x584d5
leaq 0x268970(%rip), %rcx    # 0x30e2e0
cmpb $0x0, 0x17a12(%rcx)
je 0xa5980
movb $0x0, 0x17a12(%rcx)
leaq 0x2928cf(%rip), %rbx    # 0x338256
movzwl (%rbx), %ecx
cmpl $0x2, %ecx
je 0xa59d6
cmpl $0x1, %ecx
je 0xa59ca
testl %ecx, %ecx
jne 0xa59e5
cmpl $0x23, %eax
jne 0xa59a7
movw $0x1, (%rbx)
callq 0x58682
leaq 0x2928a4(%rip), %rax    # 0x338252
xorl %ecx, %ecx
movw %cx, (%rax)
leaq 0x29289a(%rip), %rax    # 0x338254
movw %cx, (%rax)
jmp 0xa59fe
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1e6a0
cmpl $0xd, %eax
jne 0xa5a05
movw $0x2, (%rbx)
jmp 0xa59fe
callq 0xa54cc
movl $0x1, 0x2c62af(%rip)    # 0x36bc94
leaq 0x292866(%rip), %rax    # 0x338252
xorl %ecx, %ecx
movw %cx, (%rax)
leaq 0x29285c(%rip), %rax    # 0x338254
movw %cx, (%rax)
movw %cx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x292846(%rip), %rdx    # 0x338252
movzwl (%rdx), %ecx
cmpq $0xfff, %rcx            # imm = 0xFFF
ja 0xa5a30
leaq 0x1(%rcx), %rsi
movw %si, (%rdx)
leaq 0x29182a(%rip), %rdx    # 0x337250
movb %al, (%rdx,%rcx)
movb $0x0, 0x1(%rdx,%rcx)
jmp 0xa59fe
leaq 0x199539(%rip), %rax    # 0x23ef70
orb $-0x80, 0x1(%rax)
jmp 0xa59e5
// File: /workspace/github_cpp_makefile_star2_O1/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 0xbcc0
leaq 0x268885(%rip), %rbx    # 0x30e2e0
movl $0xa, %edi
callq 0xb9c3
testl %eax, %eax
jne 0xa5a7e
movl $0xa, %edi
callq 0x1e6a0
cmpb $0x0, 0x17a10(%rbx)
je 0xa5a5b
jmp 0xa5a90
callq 0x584d5
leaq 0x198936(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
je 0xa5a97
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x14, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xaff7
// File: /workspace/github_cpp_makefile_star2_O1/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 0x19862e(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa5d7f
leaq 0x7fe61(%rip), %rsi     # 0x125bd2
leaq 0x295ab8(%rip), %rdx    # 0x33b830
xorl %eax, %eax
callq 0x9560
leaq 0x295ebe(%rip), %rax    # 0x33bc44
movl $0x0, (%rax)
movl $0x2, %edi
callq 0x83e83
leaq 0x295ca3(%rip), %rbx    # 0x33ba40
movq %rbx, %rdi
callq 0x95e0
leaq 0x26775c(%rip), %rcx    # 0x30d508
movl %eax, (%rcx)
leaq 0x26771b(%rip), %rcx    # 0x30d4d0
movl %eax, (%rcx)
movl $0x2, %edi
callq 0x83e83
movq %rbx, %rdi
callq 0x95e0
leaq 0x267734(%rip), %rcx    # 0x30d504
movl %eax, (%rcx)
leaq 0x2676f3(%rip), %rcx    # 0x30d4cc
movl %eax, (%rcx)
movl $0x2, %edi
callq 0x83e83
movq %rbx, %rdi
callq 0x95e0
leaq 0x26770c(%rip), %rcx    # 0x30d500
movl %eax, (%rcx)
leaq 0x2676cb(%rip), %rcx    # 0x30d4c8
movl %eax, (%rcx)
movl $0x3, %edi
callq 0x83e83
movl $0x2, %edi
callq 0x83e83
movq %rbx, %rdi
callq 0x95e0
addl $0x7d0, %eax            # imm = 0x7D0
leaq 0x2676ed(%rip), %rcx    # 0x30d514
movl %eax, (%rcx)
leaq 0x2676ac(%rip), %rcx    # 0x30d4dc
movl %eax, (%rcx)
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x83e83
// File: /workspace/github_cpp_makefile_star2_O1/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 0x65ab2(%rip), %xmm0    # 0x10b908
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 0x65911(%rip), %xmm0    # 0x10b820
divsd 0x65901(%rip), %xmm0    # 0x10b818
movsd 0x78171(%rip), %xmm2    # 0x11e090
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_O1/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 0x2673ef(%rip), %rbx    # 0x30d500
cmpl $0x20, (%rbx)
jne 0xa616a
cmpl $0x0, 0x2c6b13(%rip)    # 0x36cc30
je 0xa614c
movl $0x0, 0x2c6b07(%rip)    # 0x36cc30
leaq 0x713cb(%rip), %rdi     # 0x1174fb
callq 0x5ede4
leaq 0x198284(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
jne 0xa614c
movl $0x1f4, %edi            # imm = 0x1F4
callq 0xaff7
leaq 0x89295(%rip), %rdi     # 0x12f3e8
callq 0x5ede4
incl (%rbx)
leaq 0x267367(%rip), %rax    # 0x30d4c8
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x73b33(%rip), %rdi     # 0x119ca4
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5ede4
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7f47d
leaq 0x295699(%rip), %r15    # 0x33b830
movb $0x0, (%r15)
leaq 0x2920b0(%rip), %r14    # 0x338252
leaq 0x198dc7(%rip), %r12    # 0x23ef70
movzwl (%r14), %eax
cmpq %rax, %rbx
jae 0xa61d9
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa61c3
orb $0x8, (%r12)
movb %al, (%rbx,%r15)
movb $0x0, 0x1(%rbx,%r15)
incq %rbx
cmpq $0x1f6, %rbx            # imm = 0x1F6
jne 0xa61a9
leaq 0x292074(%rip), %rax    # 0x338254
xorl %ecx, %ecx
movw %cx, (%rax)
movw %cx, (%r14)
leaq 0x292066(%rip), %rax    # 0x338256
movw %cx, (%rax)
leaq 0x295636(%rip), %rdi    # 0x33b830
callq 0x9899
leaq 0x19818a(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa622a
movsbl 0x2c6a17(%rip), %edx    # 0x36cc2c
leaq 0x7f9ed(%rip), %rsi     # 0x125c09
leaq 0x29560d(%rip), %rcx    # 0x33b830
xorl %eax, %eax
callq 0x9560
movzbl 0x2c69fb(%rip), %eax    # 0x36cc2c
cmpl $0x47, %eax
je 0xa624e
cmpl $0x49, %eax
je 0xa6247
cmpl $0x4f, %eax
jne 0xa6253
callq 0xa5ad8
jmp 0xa6253
callq 0xa5d55
jmp 0xa6253
callq 0xa5f46
callq 0xa6104
leaq 0x198161(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x17d393(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa6282
callq 0xaff7
leaq 0x198d17(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb9c3
movl $0xa, %edi
testl %eax, %eax
je 0xa6341
callq 0x1ea2c
callq 0x584d5
movl %eax, %ebx
leaq 0x268017(%rip), %rax    # 0x30e2e0
cmpb $0x0, 0x17a12(%rax)
je 0xa62d9
movb $0x0, 0x17a12(%rax)
leaq 0x291f76(%rip), %r14    # 0x338256
movzwl (%r14), %eax
cmpl $0x3, %eax
je 0xa631d
cmpl $0x1, %eax
je 0xa6313
testl %eax, %eax
jne 0xa632c
movw $0x1, (%r14)
callq 0x58682
leaq 0x291f4e(%rip), %rax    # 0x338252
xorl %ecx, %ecx
movw %cx, (%rax)
leaq 0x291f44(%rip), %rax    # 0x338254
movw %cx, (%rax)
movl %ebx, %eax
andl $0x7f, %eax
cmpl $0xd, %eax
jne 0xa634a
callq 0xa617c
movl $0x1, 0x2c5968(%rip)    # 0x36bc94
leaq 0x291f1f(%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 0x1e6a0
leaq 0x291f01(%rip), %rcx    # 0x338252
movzwl (%rcx), %eax
cmpq $0xfff, %rax            # imm = 0xFFF
ja 0xa6371
andb $0x7f, %bl
leal 0x1(%rax), %edx
movw %dx, (%rcx)
leaq 0x290ee4(%rip), %rcx    # 0x337250
movb %bl, (%rcx,%rax)
jmp 0xa633c
leaq 0x198bf8(%rip), %rax    # 0x23ef70
orb $-0x80, 0x1(%rax)
jmp 0xa632c
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa64f9
pushq %rbp
movq %rsp, %rbp
movslq 0x2cbd78(%rip), %rcx    # 0x372240
movl %ecx, %eax
addq 0xa99bf(%rip), %rcx     # 0x14fe90
movl %edi, %edx
xorl %esi, %esi
leaq 0x2cbd44(%rip), %rdi    # 0x372220
movb (%rcx,%rsi), %r8b
movb %r8b, (%rsi,%rdi)
movb $0x0, 0x1(%rsi,%rdi)
incq %rsi
cmpl %esi, %edx
jne 0xa64dc
addl %esi, %eax
movl %eax, 0x2cbd48(%rip)    # 0x372240
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa7072
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x2cafe3(%rip), %rbx    # 0x372010
leaq 0x294a0c(%rip), %r14    # 0x33ba40
movq %r15, %rdi
callq 0xa637e
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
cmpb $0x0, 0x2cafbf(%rip)    # 0x372010
je 0xa7063
movq %r15, %rdi
callq 0xa637e
movq %rax, %r15
callq 0xa646a
testq %r15, %r15
jne 0xa7034
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x265f16(%rip), %rax    # 0x30d408
orb $0x2, 0x1(%rax)
testq %rdi, %rdi
je 0xa765c
movq %rdi, %rbx
movabsq $0x4d5f4f544f525022, %r13 # imm = 0x4D5F4F544F525022
movabsq $0x22524f4a414d5f, %rax # imm = 0x22524F4A414D5F
leaq 0x2caaf3(%rip), %r14    # 0x372010
leaq 0x29451c(%rip), %r15    # 0x33ba40
addq $0x4080000, %rax        # imm = 0x4080000
movq %rax, -0x38(%rbp)
leaq 0x173b4b(%rip), %rcx    # 0x21b080
leaq 0x1(%r15), %rax
movq %rax, -0x30(%rbp)
movq %rcx, %r12
movq %rbx, %rdi
callq 0xa637e
movq %rax, %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x9340
cmpb $0x0, 0x2caab3(%rip)    # 0x372010
je 0xa7650
movq %rbx, %rdi
callq 0xa637e
movq %rax, %rbx
callq 0xa646a
movq 0x2caa96(%rip), %rax    # 0x372010
xorq %r13, %rax
movq 0x2caa92(%rip), %rcx    # 0x372016
movabsq $0x22524f4a414d5f, %rdx # imm = 0x22524F4A414D5F
xorq %rdx, %rcx
orq %rax, %rcx
je 0xa762e
movq 0x2caa6f(%rip), %rax    # 0x372010
xorq %r13, %rax
movq 0x2caa6b(%rip), %rcx    # 0x372016
xorq -0x38(%rbp), %rcx
orq %rax, %rcx
je 0xa763f
movq 0x2caa51(%rip), %rax    # 0x372010
movabsq $0x455341454c455222, %rcx # imm = 0x455341454C455222
xorq %rcx, %rax
movzwl 0x2caa45(%rip), %ecx    # 0x372018
xorq $0x22, %rcx
orq %rax, %rcx
jne 0xa7650
xorl %eax, %eax
movb %al, 0x11(%r15)
movb %al, (%r12)
movq %r15, %rdi
callq 0x9120
movq %r12, %rcx
testl %eax, %eax
je 0xa7618
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0x9340
movq %r12, %rdi
callq 0x9120
movq %r12, %rcx
testl %eax, %eax
je 0xa7618
decl %eax
cltq
movb $0x0, (%rcx,%rax)
leaq 0x266355(%rip), %rax    # 0x30d974
orb $0x3, (%rax)
movabsq $0x4d5f4f544f525022, %r13 # imm = 0x4D5F4F544F525022
jmp 0xa7653
movq %r15, %rdi
callq 0x95e0
leaq 0x173a67(%rip), %rcx    # 0x21b0a4
jmp 0xa764e
movq %r15, %rdi
callq 0x95e0
leaq 0x173a5a(%rip), %rcx    # 0x21b0a8
movl %eax, (%rcx)
movq %r12, %rcx
testq %rbx, %rbx
jne 0xa753d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x265d88(%rip), %rax    # 0x30d408
orb $0x4, 0x1(%rax)
testq %rdi, %rdi
je 0xa7764
movq %rdi, %rbx
leaq 0x2ca979(%rip), %r14    # 0x372010
leaq 0x2943a2(%rip), %r15    # 0x33ba40
movabsq $0x2252455649524422, %r13 # imm = 0x2252455649524422
movq %rbx, %rdi
callq 0xa637e
movq %rax, %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x9340
cmpb $0x0, 0x2ca94b(%rip)    # 0x372010
je 0xa775b
movq %rbx, %rdi
callq 0xa637e
movq %rax, %rbx
callq 0xa646a
movq 0x2ca92e(%rip), %rax    # 0x372010
xorq %r13, %rax
movzbl 0x2ca92c(%rip), %ecx    # 0x372018
orq %rax, %rcx
jne 0xa775b
movq %r15, %rdi
callq 0x9120
movq %rax, %r12
leaq 0x196c8d(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa771c
leaq 0x7e6dd(%rip), %rsi     # 0x125def
movq %r15, %rdx
xorl %eax, %eax
callq 0x9560
testl %r12d, %r12d
je 0xa772c
decl %r12d
movslq %r12d, %rax
movb $0x0, (%r15,%rax)
leaq 0x196c5d(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa774c
leaq 0x7e2b5(%rip), %rsi     # 0x1259f7
movq %r15, %rdx
xorl %eax, %eax
callq 0x9560
callq 0xa7773
leaq 0x26621c(%rip), %rax    # 0x30d974
orb $0x4, (%rax)
testq %rbx, %rbx
jne 0xa76a8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x26502e(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
je 0xa7780
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2942b3(%rip), %rdx    # 0x33ba40
movb $0x0, 0x11(%rdx)
incq %rdx
leaq 0x1738b5(%rip), %rbx    # 0x21b050
leaq 0x807c3(%rip), %rsi     # 0x127f65
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x170fe1(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x2, %edi
leaq 0x170fd9(%rip), %rax    # 0x218798
movl (%rax), %esi
movl $0xf, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe7d0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa7893
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x2ca81b(%rip), %rbx    # 0x372010
leaq 0x294244(%rip), %r14    # 0x33ba40
movabsq $0x415245504d455422, %r12 # imm = 0x415245504D455422
movabsq $0x22455255544152, %r13 # imm = 0x22455255544152
movq %r15, %rdi
callq 0xa637e
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
cmpb $0x0, 0x2ca7e3(%rip)    # 0x372010
je 0xa7880
movq %r15, %rdi
callq 0xa637e
movq %rax, %r15
callq 0xa646a
movq 0x2ca7ca(%rip), %rax    # 0x372010
xorq %r12, %rax
movq 0x2ca7c6(%rip), %rcx    # 0x372016
xorq %r13, %rcx
orq %rax, %rcx
jne 0xa7880
movq %r14, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2651a9(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
leaq 0x2659d2(%rip), %rax    # 0x30d24c
movl $0x72, (%rax)
testq %r15, %r15
jne 0xa7810
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa7a00
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x2ca75b(%rip), %rbx    # 0x372010
leaq 0x294184(%rip), %r14    # 0x33ba40
leaq 0x265e71(%rip), %r12    # 0x30d734
leaq 0x265a62(%rip), %r13    # 0x30d32c
movq %r15, %rdi
callq 0xa637e
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
cmpb $0x0, 0x2ca729(%rip)    # 0x372010
je 0xa79e9
movq %r15, %rdi
callq 0xa637e
movq %rax, %r15
callq 0xa646a
cmpl $0x0, (%r12)
jne 0xa7931
movq 0x2ca705(%rip), %rax    # 0x372010
movabsq $0x4345535041454c22, %rcx # imm = 0x4345535041454C22
xorq %rcx, %rax
movq 0x2ca6f4(%rip), %rcx    # 0x372013
movabsq $0x22534345535041, %rdx # imm = 0x22534345535041
xorq %rdx, %rcx
orq %rax, %rcx
je 0xa7990
movl 0x2ca6d9(%rip), %eax    # 0x372010
movl $0x45455722, %ecx       # imm = 0x45455722
xorl %ecx, %eax
movl 0x2ca6cf(%rip), %ecx    # 0x372013
movl $0x224b45, %edx         # imm = 0x224B45
xorl %edx, %ecx
orl %eax, %ecx
jne 0xa79e9
movq %r14, %rdi
callq 0x95e0
leaq 0x265dd6(%rip), %rcx    # 0x30d738
movw %ax, (%rcx)
leaq 0x265ddc(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
cmpl $0x0, (%r13)
jne 0xa7986
leaq 0x170ec4(%rip), %rax    # 0x218844
movl $0x808, (%rax)          # imm = 0x808
movl $0xa, (%r13)
jmp 0xa79e9
movq %r14, %rdi
callq 0x95e0
leaq 0x265d89(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
leaq 0x265974(%rip), %rcx    # 0x30d31c
cmpl $0x0, (%rcx)
jne 0xa79e9
leaq 0x265b60(%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 0xa79e9
leaq 0x170e6e(%rip), %rax    # 0x218844
movl $0x7db, (%rax)          # imm = 0x7DB
leaq 0x265939(%rip), %rax    # 0x30d31c
movl $0xb, (%rax)
testq %r15, %r15
jne 0xa78ca
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa7a5f
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x2ca5f6(%rip), %rbx    # 0x372010
leaq 0x29401f(%rip), %r14    # 0x33ba40
movq %r15, %rdi
callq 0xa637e
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9340
cmpb $0x0, 0x2ca5d2(%rip)    # 0x372010
je 0xa7a50
movq %r15, %rdi
callq 0xa637e
movq %rax, %r15
callq 0xa646a
testq %r15, %r15
jne 0xa7a21
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7e02d(%rip), %rdi     # 0x125e7d
callq 0x58e77
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x2651c3(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
mulsd 0x768b6(%rip), %xmm0    # 0x11e730
leaq 0x26519f(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
callq 0x589b0
leaq 0x2654a3(%rip), %rax    # 0x30d334
movl $0xc, %ecx
movl %ecx, (%rax)
leaq 0x265499(%rip), %rax    # 0x30d338
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7dfd9(%rip), %rdi     # 0x125e87
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa7ec9
leaq 0x1970aa(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
cmpb $0x2, %al
jne 0xa7f78
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa7ee7
leaq 0x19708c(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movl %eax, 0x2c4c18(%rip)    # 0x36cb08
callq 0x589b0
leaq 0x2652dc(%rip), %rcx    # 0x30d1d8
movl (%rcx), %esi
movl %esi, %edx
andl $-0x7, %edx
movl %edx, (%rcx)
movl 0x2c4bfd(%rip), %eax    # 0x36cb08
movl %eax, %edi
shrl $0x6, %edi
andl $0x3, %edi
leaq 0x77b4e(%rip), %r8      # 0x11fa68
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
orl $0x6, %esi
movl %esi, %edx
jmp 0xa7f32
orl $0x2, %edx
jmp 0xa7f32
orl $0x4, %edx
movl %edx, (%rcx)
leaq 0x2652f1(%rip), %rcx    # 0x30d22c
movl $0x1, (%rcx)
leaq 0x265360(%rip), %rcx    # 0x30d2a8
cmpl $0x0, (%rcx)
jne 0xa7f5a
leaq 0x1708f0(%rip), %rdx    # 0x218844
movl $0x1e1d, (%rdx)         # imm = 0x1E1D
movl $0x9, (%rcx)
xorl %ecx, %ecx
testb $0x30, %al
setne %cl
leaq 0x265262(%rip), %rax    # 0x30d1d0
movl (%rax), %edx
andl $-0x9, %edx
leal (%rdx,%rcx,8), %ecx
movl %ecx, (%rax)
popq %rbp
retq