LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_sp()
void parse_prs_sp()
{
int i;

   // set parameters
   log_packet_id("set parameters");

   for(i=0; i<3; i++) {
      if(get_msg_field()) {
         prs_sp[i] = atoi(msg_field);
         have_prs_sp |= (1 << i);
      }
      else ++bad_prs_val;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8d4cb(%rip), %rdi     # 0x10db2c
callq 0x520bf
xorl %ebx, %ebx
leaq 0x2a53d1(%rip), %r14    # 0x325a40
leaq 0x1844ca(%rip), %r15    # 0x204b40
pushq $0x1
popq %r12
leaq 0x18442f(%rip), %r13    # 0x204ab0
cmpq $0x3, %rbx
je 0x806b4
callq 0x75767
testl %eax, %eax
je 0x806a9
movq %r14, %rdi
callq 0x95e0
movl %r12d, %edx
movl %ebx, %ecx
shll %cl, %edx
movl %eax, (%r15,%rbx,4)
orl %edx, (%r13)
jmp 0x806af
incl 0x2d6585(%rip)          # 0x356c34
incq %rbx
jmp 0x80681
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_ms()
void parse_prs_ms()
{
   // magnetic switching
   log_packet_id("magnetic switching");

   if(get_msg_field()) {
      prs_ms = atoi(msg_field);
      have_prs_ms = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d46d(%rip), %rdi     # 0x10db3b
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x80700
leaq 0x2a535d(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x18445d(%rip), %rcx    # 0x204b4c
movl %eax, (%rcx)
leaq 0x1843bc(%rip), %rax    # 0x204ab4
movl $0x1, (%rax)
jmp 0x80706
incl 0x2d652e(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_mo()
void parse_prs_mo()
{
   // magnetic offset
   log_packet_id("magnetic offset");

   if(get_msg_field()) {
      prs_mo = atoi(msg_field);
      have_prs_mo = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d43b(%rip), %rdi     # 0x10db4e
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x80745
leaq 0x2a5318(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x18441c(%rip), %rcx    # 0x204b50
movl %eax, (%rcx)
leaq 0x18437b(%rip), %rax    # 0x204ab8
movl $0x1, (%rax)
jmp 0x8074b
incl 0x2d64e9(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_mr()
void parse_prs_mr()
{
   // magnetic read
   log_packet_id("magnetic read");

   if(get_msg_field()) {
      prs_mr = atoi(msg_field);
      have_prs_mr = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d406(%rip), %rdi     # 0x10db5e
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x8078a
leaq 0x2a52d3(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x1843db(%rip), %rcx    # 0x204b54
movl %eax, (%rcx)
leaq 0x18433a(%rip), %rax    # 0x204abc
movl $0x1, (%rax)
jmp 0x80790
incl 0x2d64a4(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_tt()
void parse_prs_tt()
{
   // time tag
   log_packet_id("time tag");

   if(get_msg_field()) {
      prs_tt = atoi(msg_field);
      have_prs_tt = 1;
      if(prs_tt >= 0) {
         if(prs_tt >= 500000000) pps_offset = (OFS_SIZE) (prs_tt - 1000000000);
         else                    pps_offset = (OFS_SIZE) prs_tt;
         have_pps_offset = 1;
      }
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d3cf(%rip), %rdi     # 0x10db6c
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x807fb
leaq 0x2a528e(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x18439a(%rip), %rcx    # 0x204b58
movl %eax, (%rcx)
leaq 0x1842f9(%rip), %rcx    # 0x204ac0
movl $0x1, (%rcx)
testl %eax, %eax
js 0x80801
cmpl $0x1dcd6500, %eax       # imm = 0x1DCD6500
jb 0x807dd
addl $0xc4653600, %eax       # imm = 0xC4653600
cvtsi2sd %eax, %xmm0
leaq 0x275fd0(%rip), %rax    # 0x2f67b8
movsd %xmm0, (%rax)
leaq 0x276a45(%rip), %rax    # 0x2f7238
movl $0x1, (%rax)
jmp 0x80801
incl 0x2d6433(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_ts()
void parse_prs_ts()
{
   // time slope
   log_packet_id("time slope");

   if(get_msg_field()) {
      prs_ts = atoi(msg_field);
      have_prs_ts = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d367(%rip), %rdi     # 0x10db75
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x80840
leaq 0x2a521d(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x18432d(%rip), %rcx    # 0x204b5c
movl %eax, (%rcx)
leaq 0x18428c(%rip), %rax    # 0x204ac4
movl $0x1, (%rax)
jmp 0x80846
incl 0x2d63ee(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_to()
void parse_prs_to()
{
   // time offset
   log_packet_id("time offset");

   if(get_msg_field()) {
      prs_to = atoi(msg_field);
      have_prs_to = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d32d(%rip), %rdi     # 0x10db80
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x80885
leaq 0x2a51d8(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x1842ec(%rip), %rcx    # 0x204b60
movl %eax, (%rcx)
leaq 0x18424b(%rip), %rax    # 0x204ac8
movl $0x1, (%rax)
jmp 0x8088b
incl 0x2d63a9(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_ps()
void parse_prs_ps()
{
   // pulse slope
   log_packet_id("pulse slope");

   if(get_msg_field()) {
      prs_ps = atoi(msg_field);
      have_prs_ps = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d2f4(%rip), %rdi     # 0x10db8c
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x808ca
leaq 0x2a5193(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x1842ab(%rip), %rcx    # 0x204b64
movl %eax, (%rcx)
leaq 0x18420a(%rip), %rax    # 0x204acc
movl $0x1, (%rax)
jmp 0x808d0
incl 0x2d6364(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_pl()
void parse_prs_pl()
{
   // phase lock
   log_packet_id("phase lock");

   if(get_msg_field()) {
      prs_pl = atoi(msg_field);
      have_prs_pl = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d2bb(%rip), %rdi     # 0x10db98
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x8090f
leaq 0x2a514e(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x18426a(%rip), %rcx    # 0x204b68
movl %eax, (%rcx)
leaq 0x1841c9(%rip), %rax    # 0x204ad0
movl $0x1, (%rax)
jmp 0x80915
incl 0x2d631f(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_pt()
void parse_prs_pt()
{
   // phase lock time constant
   log_packet_id("PLL time constant");

   if(get_msg_field()) {
      prs_pt = atoi(msg_field);
      have_prs_pt = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d281(%rip), %rdi     # 0x10dba3
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x80954
leaq 0x2a5109(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x184229(%rip), %rcx    # 0x204b6c
movl %eax, (%rcx)
leaq 0x184188(%rip), %rax    # 0x204ad4
movl $0x1, (%rax)
jmp 0x8095a
incl 0x2d62da(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_pf()
void parse_prs_pf()
{
   // phase lock freq stability
   log_packet_id("PLL freq stability");

   if(get_msg_field()) {
      prs_pf = atoi(msg_field);
      have_prs_pf = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d24e(%rip), %rdi     # 0x10dbb5
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x80999
leaq 0x2a50c4(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x1841e8(%rip), %rcx    # 0x204b70
movl %eax, (%rcx)
leaq 0x184147(%rip), %rax    # 0x204ad8
movl $0x1, (%rax)
jmp 0x8099f
incl 0x2d6295(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_pi()
void parse_prs_pi()
{
   // phase lock integrator
   log_packet_id("PLL integrator");

   if(get_msg_field()) {
      prs_pi = atoi(msg_field);
      have_prs_pi = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d21c(%rip), %rdi     # 0x10dbc8
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x809de
leaq 0x2a507f(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x1841a7(%rip), %rcx    # 0x204b74
movl %eax, (%rcx)
leaq 0x184106(%rip), %rax    # 0x204adc
movl $0x1, (%rax)
jmp 0x809e4
incl 0x2d6250(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_sd(int)
void parse_prs_sd(int i)
{
   // dac data
   log_packet_id("dac data");

   if(i < 0) return;
   if(i > 7) return;

   if(get_msg_field()) {
      prs_sd[i] = atoi(msg_field);
      have_prs_sd |= (1 << i);
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x8d1e2(%rip), %rdi     # 0x10dbd7
callq 0x520bf
cmpl $0x7, %ebx
ja 0x80a38
callq 0x75767
testl %eax, %eax
je 0x80a32
leaq 0x2a5031(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %ebx, %ecx
leaq 0x184163(%rip), %rdx    # 0x204b80
movl %eax, (%rdx,%rcx,4)
pushq $0x1
popq %rax
movl %ebx, %ecx
shll %cl, %eax
leaq 0x1840b6(%rip), %rcx    # 0x204ae4
orl %eax, (%rcx)
jmp 0x80a38
incl 0x2d61fc(%rip)          # 0x356c34
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_ad(int)
void parse_prs_ad(int i)
{
double val;

   // analog data
   log_packet_id("analog data");

   if(i < 0) return;
   if(i > 19) return;

   if(get_msg_field()) {
      if(!strchr(msg_field, '.')) ++bad_prs_val;

      val = atof(msg_field);
      if     (i == 1) val *= 10.0;    // scale readings to actual values
      else if(i == 2) val *= 10.0;
      else if(i == 3) val *= 10.0;
      else if(i == 4) val *= 10.0;
      else if(i == 9) val *= 4.0;
      else if(i == 10) val *= 100.0;
      else if(i == 16) val *= 4.0;
      else if(i == 17) val *= 4.0;
      else if(i == 18) val *= 4.0;

      prs_ad[i] = val;
      have_prs_ad |= (1 << i);

      if((i == 1) || (i == 2)) {  // average of power readings
         prs_ad_pwr = ((prs_ad[1]+prs_ad[2])/2.0);  
      }
      else if(i == 10) {  // case temperature
         temperature = (DATA_SIZE) prs_ad[i];
         have_temperature = 104;
      }
      else if((i == 11) || (i == 12) || (i == 13)) { // average of thermistor readings
         prs_ad_therm = ((prs_ad[11]+prs_ad[12]+prs_ad[13])/3.0);  
      }
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x8d192(%rip), %rdi     # 0x10dbe0
callq 0x520bf
cmpl $0x13, %ebx
ja 0x80b49
callq 0x75767
testl %eax, %eax
je 0x80aad
leaq 0x2a4fd4(%rip), %rdi    # 0x325a40
pushq $0x2e
popq %rsi
callq 0x9100
testq %rax, %rax
jne 0x80a7f
incl 0x2d61b5(%rip)          # 0x356c34
leaq 0x2a4fba(%rip), %rdi    # 0x325a40
callq 0x9470
leal -0x1(%rbx), %eax
cmpl $0x11, %eax
ja 0x80ac0
leaq 0x888ba(%rip), %rcx     # 0x109354
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
mulsd 0x725fd(%rip), %xmm0    # 0xf30a8
jmp 0x80ac0
incl 0x2d6181(%rip)          # 0x356c34
jmp 0x80b49
mulsd 0x74f28(%rip), %xmm0    # 0xf59e8
movl %ebx, %ecx
leaq 0x1840d7(%rip), %rdx    # 0x204ba0
movsd %xmm0, (%rdx,%rcx,8)
pushq $0x1
popq %rsi
movl %ebx, %ecx
shll %cl, %esi
leaq 0x18400c(%rip), %rcx    # 0x204ae8
orl %esi, (%rcx)
cmpl $0x1, %eax
ja 0x80b02
movsd 0x8(%rdx), %xmm0
addsd 0x10(%rdx), %xmm0
mulsd 0x72573(%rip), %xmm0    # 0xf3068
leaq 0x18415c(%rip), %rax    # 0x204c58
movsd %xmm0, (%rax)
jmp 0x80b49
cmpl $0xa, %ebx
jne 0x80b21
leaq 0x275f0a(%rip), %rax    # 0x2f6a18
movsd %xmm0, (%rax)
leaq 0x276733(%rip), %rax    # 0x2f724c
movl $0x68, (%rax)
jmp 0x80b49
addl $-0xb, %ebx
cmpl $0x2, %ebx
ja 0x80b49
movsd 0x58(%rdx), %xmm0
addsd 0x60(%rdx), %xmm0
addsd 0x68(%rdx), %xmm0
divsd 0x74f40(%rip), %xmm0    # 0xf5a80
leaq 0x184119(%rip), %rax    # 0x204c60
jmp 0x80afc
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
mulsd 0x72508(%rip), %xmm0    # 0xf3060
jmp 0x80ac0
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_vb()
void parse_prs_vb()
{
   // verbose mode
   log_packet_id("verbose mode");

   if(get_msg_field()) {
      prs_vb = atoi(msg_field);
      have_prs_vb = 1;
   }
   else ++bad_prs_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d084(%rip), %rdi     # 0x10dbec
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x80b9a
leaq 0x2a4ec3(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x183f63(%rip), %rcx    # 0x204aec
movl %eax, (%rcx)
leaq 0x183ef2(%rip), %rax    # 0x204a84
movl $0x1, (%rax)
jmp 0x80ba0
incl 0x2d6094(%rip)          # 0x356c34
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_ep(int)
void set_prs_ep(int val)
{
   if(read_only) return;

   sprintf(out, "EP%d", val);
   queue_prs_cmd(out, PRS_EP_MSG);
   queue_prs_cmd("EP?", PRS_EP_MSG);
}

// Assembly:
leaq 0x2a0471(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x80baf
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2a5662(%rip), %rbx    # 0x326220
leaq 0x8d034(%rip), %rsi     # 0x10dbf9
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x210, %esi            # imm = 0x210
callq 0x576d4
leaq 0x8ce07(%rip), %rdi     # 0x10d9ea
movl $0x210, %esi            # imm = 0x210
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_mo(int)
void set_prs_mo(int val)
{
   if(read_only) return;

   sprintf(out, "MO%d", val);
   queue_prs_cmd(out, PRS_MO_MSG);
   queue_prs_cmd("MO?", PRS_MO_MSG);
}

// Assembly:
leaq 0x2a0420(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x80c00
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2a5611(%rip), %rbx    # 0x326220
leaq 0x8cfe8(%rip), %rsi     # 0x10dbfe
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x204, %esi            # imm = 0x204
callq 0x576d4
leaq 0x8cdce(%rip), %rdi     # 0x10da02
movl $0x204, %esi            # imm = 0x204
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_ms(int)
void set_prs_ms(int val)
{
   if(read_only) return;

   sprintf(out, "MS%d", val);
   queue_prs_cmd(out, PRS_MS_MSG);
   queue_prs_cmd("MS?", PRS_MS_MSG);
}

// Assembly:
leaq 0x2a03cf(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x80c51
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2a55c0(%rip), %rbx    # 0x326220
leaq 0x8cf9c(%rip), %rsi     # 0x10dc03
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x203, %esi            # imm = 0x203
callq 0x576d4
leaq 0x8cd79(%rip), %rdi     # 0x10d9fe
movl $0x203, %esi            # imm = 0x203
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_sf(int)
void set_prs_sf(int val)
{
   if(read_only) return;

   sprintf(out, "SF%d", val);
   queue_prs_cmd(out, PRS_SF_MSG);
   queue_prs_cmd("SF?", PRS_SF_MSG);
}

// Assembly:
leaq 0x2a033e(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x80ce2
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2a552f(%rip), %rbx    # 0x326220
leaq 0x8cf24(%rip), %rsi     # 0x10dc1c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x1fe, %esi            # imm = 0x1FE
callq 0x576d4
leaq 0x8cce0(%rip), %rdi     # 0x10d9f6
movl $0x1fe, %esi            # imm = 0x1FE
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_sp(int, int, int)
void set_prs_sp(int r, int n, int a)
{
   if(read_only) return;

   sprintf(out, "SP%d,%d,%d", r,n,a);
   queue_prs_cmd(out, PRS_SP_MSG);
   queue_prs_cmd("SP?", PRS_SP_MSG);
}

// Assembly:
leaq 0x2a02ed(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x80d33
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edx, %r8d
movl %esi, %ecx
movl %edi, %edx
leaq 0x2a54d9(%rip), %rbx    # 0x326220
leaq 0x8ced3(%rip), %rsi     # 0x10dc21
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x202, %esi            # imm = 0x202
callq 0x576d4
leaq 0x8ea88(%rip), %rdi     # 0x10f7f4
movl $0x202, %esi            # imm = 0x202
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_to(int)
void set_prs_to(int val)
{
   if(read_only) return;

   sprintf(out, "TO%d", val);
   queue_prs_cmd(out, PRS_TO_MSG);
   queue_prs_cmd("TO?", PRS_TO_MSG);
   queue_prs_cmd("TT?", PRS_TT_MSG);
}

// Assembly:
leaq 0x2a0297(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x80d89
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2a5488(%rip), %rbx    # 0x326220
leaq 0x8ce8d(%rip), %rsi     # 0x10dc2c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x208, %esi            # imm = 0x208
callq 0x576d4
leaq 0x8cc52(%rip), %rdi     # 0x10da0f
movl $0x208, %esi            # imm = 0x208
callq 0x576d4
leaq 0x8cc12(%rip), %rdi     # 0x10d9e0
movl $0x206, %esi            # imm = 0x206
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: update_x72_screen()
void update_x72_screen()
{
int i;

   // update the screen every second.  When the seconds tick, request the
   // high priority messages.

   i = get_norcvr_message();   // returns true if seconds just ticked
   if(i && (prs_poll_tick == 0)) prs_poll_tick = 1;  // trigger high priority message polls

   if(i) {
      if(x72_tic_timer > 0) {  // tic reg changed, wait for it to take effect
         --x72_tic_timer;
         return;
      }
      else x72_tic_timer = 0;

      if(have_x72_pps && x72_state_set && x72_user_dis) {
         x72_sw_discipline();  // do disciplining
      }
      else if(x72_fw_discipline()) {
      }
      else {
         discipline_mode = DIS_MODE_NORMAL;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x76a3e
testl %eax, %eax
je 0x8132f
cmpl $0x0, 0x2d58d7(%rip)    # 0x356bf8
jne 0x8132f
movl $0x1, 0x2d58cb(%rip)    # 0x356bf8
jmp 0x81333
testl %eax, %eax
je 0x81344
leaq 0x183bfe(%rip), %rax    # 0x204f38
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x81346
decl %ecx
movl %ecx, (%rax)
popq %rbp
retq
andl $0x0, (%rax)
leaq 0x183980(%rip), %rax    # 0x204cd0
cmpl $0x0, (%rax)
je 0x81373
leaq 0x1839b4(%rip), %rax    # 0x204d10
cmpl $0x0, (%rax)
je 0x81373
leaq 0x183b88(%rip), %rax    # 0x204ef0
cmpl $0x0, (%rax)
je 0x81373
popq %rbp
jmp 0x81388
callq 0x63a49
testl %eax, %eax
jne 0x81344
leaq 0x276114(%rip), %rax    # 0x2f7497
movb $0x0, (%rax)
jmp 0x81344
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_sw_discipline()
void x72_sw_discipline()
{
   // X72 software discipline algorithm state dispatcher

   if(x72_restore_timeout > 0) {  // message sync lost, pause disciplining
      --x72_restore_timeout;
      return;
   }

   if(x72_user_dis == 0) {
//    x72_user_state = x72_state = X72_STATE_DISCIPLINE;
      return;  // not doing software disciplning
   }


//sprintf(debug_text, "X72 state: %d  disci:%d  rblock:%04X  have_pps:%d  x72_pps:%d  dds:%g", x72_user_state, x72_user_dis, x72_creg & 0x0002, have_x72_pps, x72_pps, last_x72_dds);
   discipline_mode = DIS_MODE_AUTO_HOLD;
   if(x72_creg & 0x0002) {
      return;  // Rb not locked
   }
   if(x72_creg & 0x0008) {
      discipline_mode = DIS_MODE_NORMAL;
      return;  // PPS output not enabled
   }

   x72_state = x72_user_state;  // so firmware diciplining state display code works with software disciplining
   have_x72_state = 1;

   // dispatch to X72 sw discipline state handler
   if     (x72_user_state == X72_STATE_START0)     x72_init_state0();
   else if(x72_user_state == X72_STATE_START1)     x72_init_state1();
   else if(x72_user_state == X72_STATE_START2)     ;  // not used
   else if(x72_user_state == X72_STATE_HOLDOVER)   x72_holdover_state();  // not used
   else if(x72_user_state == X72_STATE_JAM1)       x72_jam1_state();      // not used
   else if(x72_user_state == X72_STATE_JAM2) {
      discipline_mode = DIS_MODE_NORMAL;  // !!! comment out to show TIC updates as holdover marks at the top of the plot
      x72_jam2_state();
   }
   else if(x72_user_state == X72_STATE_DISCIPLINE) {
      discipline_mode = DIS_MODE_NORMAL;
      x72_discipline_state();
   }
   else if(x72_user_state == X72_STATE_PIDCALC)    ;  // not used
   else if(x72_user_state == X72_STATE_PIDUPDATE)  ;  // not used
   else if(x72_user_state == X72_STATE_SLOPECALC)  x72_slopecalc_state();  // not used
   else x72_init_state0();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x2d5842(%rip), %eax    # 0x356bd4
testl %eax, %eax
jle 0x813a0
decl %eax
movl %eax, 0x2d5836(%rip)    # 0x356bd4
popq %rbp
retq
leaq 0x183b49(%rip), %rax    # 0x204ef0
cmpl $0x0, (%rax)
je 0x8139e
leaq 0x2760e4(%rip), %rax    # 0x2f7497
movb $0x2, (%rax)
leaq 0x183a1b(%rip), %rcx    # 0x204dd8
movl (%rcx), %ecx
testb $0x2, %cl
jne 0x8139e
testb $0x8, %cl
jne 0x81401
movl 0x2d5815(%rip), %ecx    # 0x356be4
leaq 0x183a2a(%rip), %rdx    # 0x204e00
movl %ecx, (%rdx)
leaq 0x1838f5(%rip), %rdx    # 0x204cd4
movl $0x1, (%rdx)
cmpq $0x6, %rcx
ja 0x81418
leaq 0x88182(%rip), %rdx     # 0x109574
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
popq %rbp
jmp 0xb0805
movb $0x0, (%rax)
jmp 0x8139e
popq %rbp
jmp 0xb0a6b
popq %rbp
jmp 0xb089a
popq %rbp
jmp 0xb08d7
leal -0x7(%rcx), %eax
cmpl $0x2, %eax
jb 0x8139e
cmpl $0x9, %ecx
jne 0x813fb
popq %rbp
jmp 0xb099b
movb $0x0, (%rax)
popq %rbp
jmp 0xb0abd
movb $0x0, (%rax)
popq %rbp
jmp 0xb0b00
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_x72_response(int)
void parse_x72_response(int id)
{
   // prepare to decode the multi-line query response

   x72_response = id;
// if(debug_file) fprintf(debug_file, "X72 %d start (%s)\n", id, nmea_msg);
   x72_line = 0;
   scpi_col = 0;
   scpi_status_line[0] = 0;

   strcpy(scpi_status_line, nmea_msg);  // record the first line of the response
   parse_x72_val(x72_response);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
andl $0x0, 0x2d5782(%rip)    # 0x356bd0
andl $0x0, 0x2d576f(%rip)    # 0x356bc4
movl %edi, %ebx
movl %edi, 0x2d576f(%rip)    # 0x356bcc
movb $0x0, 0x2d56dc(%rip)    # 0x356b40
leaq 0x2d56d5(%rip), %rdi    # 0x356b40
leaq 0x2a43be(%rip), %rsi    # 0x325830
callq 0x9330
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x81484
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: info_param(char*)
char *info_param(char *param)
{
int len;
char *s;

   if(param == 0) return 0;

   len = strlen(param);
   s = strstr(scpi_status_line, param);
   if(s) {
      return (s+len+1);
   }

   return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x82796
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x2d43cc(%rip), %rdi    # 0x356b40
movq %rbx, %rsi
callq 0x9090
testq %rax, %rax
je 0x82799
movq %rax, %r14
movq %rbx, %rdi
callq 0x9120
cltq
addq %r14, %rax
incq %rax
jmp 0x8279b
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_x72_creg()
void decode_x72_creg()
{
   // set various flags based upon the control reg value

   if(x72_creg & 0x0008) pps_enabled = 0;
   else                  pps_enabled = 1;

   if(x72_creg & 0x0040) x72_sine_level = 0;
   else {
      x72_sine_level = 40;
      if(x72_creg & 0x0080) x72_sine_level += 30;
      if(x72_creg & 0x0100) x72_sine_level += 20;
      if(x72_creg & 0x0200) x72_sine_level += 10;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1822df(%rip), %rax    # 0x204dd8
movl (%rax), %eax
testb $0x8, %al
leaq 0x27521c(%rip), %rcx    # 0x2f7d20
sete (%rcx)
xorl %ecx, %ecx
testb $0x40, %al
jne 0x82b38
testb %al, %al
movl $0x28, %ecx
movl $0x46, %edx
cmovnsl %ecx, %edx
leal 0x14(%rdx), %ecx
btl $0x8, %eax
cmovael %edx, %ecx
leaq 0x1822cb(%rip), %rdx    # 0x204df8
movl %ecx, (%rdx)
btl $0x9, %eax
jae 0x82b41
addl $0xa, %ecx
leaq 0x1822b9(%rip), %rax    # 0x204df8
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_sync_fail(int)
int x72_sync_fail(int id)
{
int flag;
   // return true is message response is not valid for the requested message
   // !!!!! this routines needs to be more robust...  we currently only
   //       check for health response to a non-health request

   flag = 0;
   if(strstr(scpi_status_line, "ADATA") && (id != X72_HEALTH_MSG)) {  // health response
      need_x72_resync = id;
      flag = 1;
   }
   else if(strstr(scpi_status_line, "CONTROL REG") && (id != X72_GET_CREG_MSG)) {  // health response
      need_x72_resync = id;
      flag = 1;
   }
   else if(strstr(scpi_status_line, "DELTA REG") && (id != X72_GET_PPS_MSG)) {  // health response
      need_x72_resync = id;
      flag = 1;
   }

   if(flag) {  // unexpected response to a query was seen
      if(debug_file) fprintf(debug_file, "\n###! x72 msg %d sync fail! (%s)\n\n", id, scpi_status_line);
      return 1;
   }

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x2d3fed(%rip), %rdi    # 0x356b40
leaq 0x8b1c7(%rip), %rsi     # 0x10dd21
callq 0x9090
cmpl $0x2c9, %ebx            # imm = 0x2C9
je 0x82b6c
testq %rax, %rax
jne 0x82baf
leaq 0x2d3fcd(%rip), %rdi    # 0x356b40
leaq 0x8b1ad(%rip), %rsi     # 0x10dd27
callq 0x9090
cmpl $0x2c5, %ebx            # imm = 0x2C5
je 0x82b8c
testq %rax, %rax
jne 0x82baf
leaq 0x2d3fad(%rip), %rdi    # 0x356b40
leaq 0x8b199(%rip), %rsi     # 0x10dd33
callq 0x9090
xorl %r14d, %r14d
cmpl $0x2c1, %ebx            # imm = 0x2C1
je 0x82bdf
testq %rax, %rax
je 0x82bdf
movl %ebx, 0x2d4023(%rip)    # 0x356bd8
leaq 0x1a57d4(%rip), %rax    # 0x228390
movq (%rax), %rdi
pushq $0x1
popq %r14
testq %rdi, %rdi
je 0x82bdf
leaq 0x8b16e(%rip), %rsi     # 0x10dd3d
leaq 0x2d3f6a(%rip), %rcx    # 0x356b40
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_x72_message()
void get_x72_message()
{
u08 c;
static int row=0;

   // This routine buffers up an incoming X72 message.  When the end of the
   // message is seen, the message is parsed and decoded with decode_x72_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(c == 0x0D) return;  // ignore CR,  we end if LF char

   if(x72_response) {     // we are reading multi-line response query results
      get_x72_response(c);
      return;
   }

   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_msg;
   }
   else if(tsip_sync == 1) { // message start has been seen, now build the message
      get_msg:
      if(c == 0x0A) goto x72_end; 
      else if(c == 0x0D) goto x72_end; 

      if(tsip_wptr < (MAX_TSIP-2)) {  // add char to the message buffer
         tsip_buf[tsip_wptr++] = c;
         tsip_buf[tsip_wptr] = 0;
         if((tsip_buf[0] == 'r') && (tsip_buf[1] == '>')) {  // command prompt
            goto x72_end;
         }
      }
      else {  // buffer overlow
         goto rst_msg;
      }
   }
   else {
      x72_end:
      if(tsip_wptr > 0) {
         decode_x72_msg(2);
         packet_end = 1;
      }

      rst_msg:
      tsip_sync = 0;
      tsip_rptr = 0;
      tsip_wptr = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
pushq $0xa
popq %rdi
callq 0xb771
pushq $0xa
popq %rdi
testl %eax, %eax
je 0x82d80
callq 0x1d93f
callq 0x51891
cmpl $0xd, %eax
je 0x82e4f
movl %eax, %ebx
cmpl $0x0, 0x2d3e5a(%rip)    # 0x356bcc
je 0x82d89
movsbl %bl, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x82c0d
popq %rbx
popq %r14
popq %rbp
jmp 0x1d61b
leaq 0x275550(%rip), %rax    # 0x2f82e0
cmpb $0x0, 0x17a12(%rax)
je 0x82da0
movb $0x0, 0x17a12(%rax)
leaq 0x29f4af(%rip), %r14    # 0x322256
movzwl (%r14), %eax
testw %ax, %ax
je 0x82dd2
cmpw $0x1, %ax
setne %al
cmpl $0xa, %ebx
sete %cl
orb %al, %cl
leaq 0x29f48c(%rip), %rax    # 0x322252
movzwl (%rax), %eax
je 0x82df1
testw %ax, %ax
jne 0x82e22
jmp 0x82e34
movw $0x1, (%r14)
callq 0x51a2f
leaq 0x29f470(%rip), %rax    # 0x322254
andw $0x0, (%rax)
cmpl $0xa, %ebx
je 0x82e34
xorl %eax, %eax
jmp 0x82df7
cmpw $0xffd, %ax             # imm = 0xFFD
ja 0x82e34
movzwl %ax, %ecx
leaq 0x1(%rcx), %rax
leaq 0x29f44d(%rip), %rdx    # 0x322252
movw %ax, (%rdx)
leaq 0x29e441(%rip), %rax    # 0x321250
movb %bl, (%rax,%rcx)
movb $0x0, 0x1(%rax,%rcx)
cmpb $0x72, (%rax)
jne 0x82e4f
cmpb $0x3e, 0x1(%rax)
jne 0x82e4f
pushq $0x2
popq %rdi
callq 0x822ff
movl $0x1, 0x2d2e60(%rip)    # 0x355c94
andw $0x0, (%r14)
leaq 0x29f414(%rip), %rax    # 0x322254
andw $0x0, (%rax)
leaq 0x29f407(%rip), %rax    # 0x322252
andw $0x0, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_efc(int)
void set_x72_efc(int val)
{
   // set the X72 EFC input enabled
   if(read_only) return;

   last_x72_efc = val;
   user_set_x72_efc = 1;
   save_x72_state();

   val &= 1;
   sprintf(out, "a%d", val);
   queue_x72_cmd(out, X72_SET_FC_MSG);
///   queue_x72_cmd("i", X72_INFO_MSG);
}

// Assembly:
leaq 0x29e1bf(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x82e61
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x18205f(%rip), %rax    # 0x204ed0
movl %edi, (%rax)
leaq 0x18204a(%rip), %rax    # 0x204ec4
movl $0x1, (%rax)
callq 0x62d03
andl $0x1, %ebx
leaq 0x2a3391(%rip), %r14    # 0x326220
leaq 0x8afd2(%rip), %rsi     # 0x10de68
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x2bc, %esi            # imm = 0x2BC
popq %rbx
popq %r14
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_tic(int)
void set_x72_tic(int val)
{
   // set the X72 PPS TIC offset value
   if(read_only) return;

   if(val < 0) {
      val = IABS(val) % ((int) x72_osc);
      if(val) val = ((int) x72_osc) - val;
   }
   else {
      val = (val % (int) x72_osc);
   }

   last_x72_tic = val;
   user_set_x72_tic = 1;
   save_x72_state();

   sprintf(out, "k%d", val);
   queue_x72_cmd(out, X72_SET_TIC_MSG);
   x72_tic_timer = 6;  // it takes 6 seconds for a TIC change to take effect
   x72_tic_changed = 1;
}

// Assembly:
leaq 0x29e160(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x82ec0
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x181d97(%rip), %rax    # 0x204c68
cvttsd2si (%rax), %ecx
movl %edi, %eax
cltd
idivl %ecx
movl %edx, %ebx
addl %edx, %ecx
testl %edx, %edx
cmovel %edx, %ecx
testl %edi, %edi
cmovsl %ecx, %ebx
leaq 0x181fe9(%rip), %rax    # 0x204ed8
movl %ebx, (%rax)
leaq 0x181fc8(%rip), %rax    # 0x204ec0
pushq $0x1
popq %r15
movl %r15d, (%rax)
callq 0x62d03
leaq 0x2a3315(%rip), %r14    # 0x326220
leaq 0x8af5a(%rip), %rsi     # 0x10de6c
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x2c2, %esi            # imm = 0x2C2
callq 0x576d4
leaq 0x182006(%rip), %rax    # 0x204f38
movl $0x6, (%rax)
movl %r15d, 0x2d3cb5(%rip)   # 0x356bf4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_acmos_freq(int)
void set_x72_acmos_freq(int val)
{
   // set the X72 ACMOS freq
   if(read_only) return;

   last_x72_acmos_freq = val;
   user_set_x72_acmos_freq = 1;
   save_x72_state();

   sprintf(out, "o%d", val);
   queue_x72_cmd(out, X72_SET_FREQ_MSG);
}

// Assembly:
leaq 0x29e0c9(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x82f57
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x181f65(%rip), %rax    # 0x204ecc
movl %edi, (%rax)
leaq 0x181f48(%rip), %rax    # 0x204eb8
movl $0x1, (%rax)
callq 0x62d03
leaq 0x2a329e(%rip), %r14    # 0x326220
leaq 0x8aeed(%rip), %rsi     # 0x10de76
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x2c4, %esi            # imm = 0x2C4
popq %rbx
popq %r14
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_srvc(int)
void set_x72_srvc(int val)
{
   // set the X72 service pin polarity
   if(read_only) return;

   last_x72_srvc = val;
   user_set_x72_srvc = 1;
   save_x72_state();

   val &= 1;
   sprintf(out, "l%d", val);
   queue_x72_cmd(out, X72_SET_SRVC_MSG);
///   queue_x72_cmd("i", X72_INFO_MSG);
}

// Assembly:
leaq 0x29e06d(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x82fb3
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x181f19(%rip), %rax    # 0x204edc
movl %edi, (%rax)
leaq 0x181efc(%rip), %rax    # 0x204ec8
movl $0x1, (%rax)
callq 0x62d03
andl $0x1, %ebx
leaq 0x2a323f(%rip), %r14    # 0x326220
leaq 0x8ae98(%rip), %rsi     # 0x10de80
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x2c3, %esi            # imm = 0x2C3
popq %rbx
popq %r14
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_start_discipline()
void x72_start_discipline()
{
   // enable X72 discipline algorithm... based upon the outline in the
   // X72 manual

   x72_user_dis = 1;  // we are doing software disciplining
   x72_user_state = X72_STATE_START0;
   x72_init_done = 0;
   x72_1pps_present = 0;
   x72_start_timer = 0;

   if(pps_enabled == 0) {  // PPS output must be enabled in order for TIC command to work
      user_pps_enable = 1;
      set_pps(user_pps_enable, pps_polarity,  delay_value, pps1_delay,  pps_threshold, 4);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andl $0x0, 0x2d3bd4(%rip)    # 0x356be4
andl $0x0, 0x2dd601(%rip)    # 0x360618
andl $0x0, 0x2dd5fe(%rip)    # 0x36061c
leaq 0x181ecb(%rip), %rax    # 0x204ef0
andl $0x0, 0x2dd62c(%rip)    # 0x360658
movl $0x1, (%rax)
leaq 0x274ce7(%rip), %rax    # 0x2f7d20
cmpb $0x0, (%rax)
je 0x83040
popq %rbp
retq
leaq 0x274cda(%rip), %rax    # 0x2f7d21
movb $0x1, (%rax)
leaq 0x274cc7(%rip), %rax    # 0x2f7d18
movzbl (%rax), %esi
leaq 0x274d65(%rip), %rax    # 0x2f7dc0
movsd (%rax), %xmm0
leaq 0x274d72(%rip), %rax    # 0x2f7dd8
movsd (%rax), %xmm1
leaq 0x274cab(%rip), %rax    # 0x2f7d1c
movss (%rax), %xmm2
movl $0x1, %edi
movl $0x4, %edx
popq %rbp
jmp 0x61e97
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_reset_filter()
void x72_reset_filter(void)
{
   x72_dds_count = 0;
   x72_dds_list[0] = 0.0;
   x72_dds_in = x72_dds_out = 0;
   x72_dds_sum = 0.0;
   filtered_dds = 0.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x181e98(%rip), %rax    # 0x204f28
andl $0x0, (%rax)
andq $0x0, 0x2dd695(%rip)    # 0x360730
andl $0x0, 0x2e0c8e(%rip)    # 0x363d30
andl $0x0, 0x2e0c8b(%rip)    # 0x363d34
andq $0x0, 0x2e0c77(%rip)    # 0x363d28
andq $0x0, 0x2e0c7f(%rip)    # 0x363d38
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: zpad(char*, int)
void zpad(char *s, int n)
{
int i;
int minus;

   // replace blanks in a string with '0'

   if(s == 0) return;

   minus = 0;
   for(i=0; i<n; i++) {
      if(s[i] == 0) return;
      if(s[i] == ' ') s[i] = '0';
      if(s[i] == '-') {
         s[i] = '0';
         minus = 1;
      }
   }
   if(minus && (s[0] == '0')) s[0] = '-';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x83106
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
movl $0x1, %ecx
xorl %edx, %edx
cmpq %rax, %rsi
je 0x830fa
movzbl (%rdi,%rax), %r8d
cmpl $0x20, %r8d
je 0x830f1
cmpl $0x2d, %r8d
je 0x830ef
testl %r8d, %r8d
jne 0x830f5
jmp 0x83106
movl %ecx, %edx
movb $0x30, (%rdi,%rax)
incq %rax
jmp 0x830d2
testl %edx, %edx
je 0x83106
cmpb $0x30, (%rdi)
jne 0x83106
movb $0x2d, (%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_hbsq()
void parse_star_hbsq()  
{
char *s;

   // output squelch control

   log_packet_id("Star HBSQ");
   user_hbsq = current_hbsq = (-1);

   if(get_msg_field()) { 
      user_hbsq = atoi(msg_field);
      have_star_hbsq |= 0x01;
   }

   if(star_type == OSA_TYPE) {
      s = strchr(nmea_msg, '/');
      if(s) {
         s = s + 1;
         zpad(s,4);
         current_hbsq = atoi(s);
         have_star_hbsq |= 0x02;
      }
   }
   else {
      if(get_msg_field()) { 
         current_hbsq = atoi(msg_field);
         have_star_hbsq |= 0x02;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x8a889(%rip), %rdi     # 0x10e0bd
callq 0x520bf
leaq 0x2a4504(%rip), %r14    # 0x327d44
orl $-0x1, (%r14)
leaq 0x2a44f5(%rip), %rbx    # 0x327d40
orl $-0x1, (%rbx)
callq 0x75767
testl %eax, %eax
je 0x8386f
leaq 0x2a21e2(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, (%rbx)
leaq 0x2a44dc(%rip), %rax    # 0x327d48
orb $0x1, (%rax)
leaq 0x181772(%rip), %rax    # 0x204fe8
cmpl $0x4f, (%rax)
jne 0x838a2
leaq 0x2a1fae(%rip), %rdi    # 0x325830
pushq $0x2f
popq %rsi
callq 0x9100
testq %rax, %rax
je 0x838c7
movq %rax, %rbx
incq %rbx
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x830bb
jmp 0x838b2
callq 0x75767
testl %eax, %eax
je 0x838c7
leaq 0x2a218e(%rip), %rbx    # 0x325a40
movq %rbx, %rdi
callq 0x95e0
movl %eax, (%r14)
leaq 0x2a4484(%rip), %rax    # 0x327d48
orb $0x2, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: fake_second_check(int)
void fake_second_check(int why)
{
double this_msec;

   // This routine checks to see if we need to fake a time message for receivers
   // that only send time every other second or for SCPI type receivers that
   // take a long time to process the SYST:STAT? message

if((why < 10) && (rcvr_type == UCCM_RCVR)) return;

   if(fake_msec) {                     // fake time stamp enabled
      this_msec = GetMsecs();
if(0 && debug_file) fprintf(debug_file, "fsc %d: this:%f fake:%f  count:%d\n", why, this_msec, fake_msec, fake_count);
      if(this_msec >= (fake_msec)) {  // it's time to fake it
         fake_missing_second(-1.000);  // negative value adds a second
         fake_msec += 1000.0;  // !!!! (1000.0 / nav_rate)?
         if(++fake_count > MAX_FAKE_COUNT) {
if(0 && debug_file) fprintf(debug_file, "fsc reset!  count=%d\n", fake_count);
            fake_count = 0;
            fake_msec = 0.0;  // limit number of consecutive faked seconds
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpl $0xa, %edi
setge %al
leaq 0x17eb89(%rip), %rcx    # 0x2028d0
cmpq $0x8, (%rcx)
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x83db3
leaq 0x27399c(%rip), %rbx    # 0x2f76f8
movsd (%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x83d6c
jnp 0x83db3
callq 0xad3f
ucomisd (%rbx), %xmm0
jb 0x83db3
movsd 0x6f379(%rip), %xmm0    # 0xf30f8
callq 0x83b43
movsd (%rbx), %xmm0
addsd 0x6f2a8(%rip), %xmm0    # 0xf3038
movsd %xmm0, (%rbx)
movl 0x2d80be(%rip), %eax    # 0x35be58
leal 0x1(%rax), %ecx
movl %ecx, 0x2d80b5(%rip)    # 0x35be58
cmpl $0xa, %eax
jl 0x83db3
andl $0x0, 0x2d80a9(%rip)    # 0x35be58
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_output()
void parse_star_output()
{
   // !!!! 4531
   log_packet_id("Star output");
   if(get_msg_field()) {
      if(strstr(msg_field, "E1")) {
         osa_output_type = 1;
         have_osa_output = 1;
      }
      else if(strstr(msg_field, "FR")) {
         osa_output_type = 2;
         have_osa_output = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8993f(%rip), %rdi     # 0x10e208
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x84924
leaq 0x2a1162(%rip), %rdi    # 0x325a40
leaq 0x89a44(%rip), %rsi     # 0x10e329
callq 0x9090
testq %rax, %rax
je 0x848f3
pushq $0x1
jmp 0x8490d
leaq 0x2a1146(%rip), %rdi    # 0x325a40
leaq 0x89a37(%rip), %rsi     # 0x10e338
callq 0x9090
testq %rax, %rax
je 0x84924
pushq $0x2
popq %rax
leaq 0x2a3457(%rip), %rcx    # 0x327d6c
movl %eax, (%rcx)
leaq 0x2a344a(%rip), %rax    # 0x327d68
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_prior()
void parse_star_prior()
{
   // !!!! 4531
   log_packet_id("Star priority");
   if(get_msg_field()) {
      osa_gps_prior = msg_field[0] - '0';
      osa_aux_prior = msg_field[1] - '0';
      have_osa_prior = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x898e3(%rip), %rdi     # 0x10e214
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x84972
leaq 0x2a10fa(%rip), %rax    # 0x325a40
movsbl (%rax), %ecx
addl $-0x30, %ecx
leaq 0x2a340d(%rip), %rdx    # 0x327d60
movl %ecx, (%rdx)
movsbl 0x1(%rax), %eax
addl $-0x30, %eax
leaq 0x2a3401(%rip), %rcx    # 0x327d64
movl %eax, (%rcx)
leaq 0x2a33f0(%rip), %rax    # 0x327d5c
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_aux_inp()
void parse_star_aux_inp()
{
   // !!!! 4531
   log_packet_id("Star aux time");
   if(get_msg_field()) {
      osa_aux_c = msg_field[0] - '0';
      osa_aux_t = msg_field[1] - '0';
      have_osa_aux = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x898a3(%rip), %rdi     # 0x10e222
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x849c0
leaq 0x2a10ac(%rip), %rax    # 0x325a40
movsbl (%rax), %ecx
addl $-0x30, %ecx
leaq 0x2a33d3(%rip), %rdx    # 0x327d74
movl %ecx, (%rdx)
movsbl 0x1(%rax), %eax
addl $-0x30, %eax
leaq 0x2a33c7(%rip), %rcx    # 0x327d78
movl %eax, (%rcx)
leaq 0x2a33b6(%rip), %rax    # 0x327d70
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_adm()
void parse_star_adm()
{
   // !!!! 4531
   log_packet_id("Star adm");
   if(get_msg_field()) {
      osa_gps_adm = msg_field[0] - '0';
      osa_aux_adm = msg_field[1] - '0';
      have_osa_adm = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x89863(%rip), %rdi     # 0x10e230
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x84a0e
leaq 0x2a105e(%rip), %rax    # 0x325a40
movsbl (%rax), %ecx
addl $-0x30, %ecx
leaq 0x2a3391(%rip), %rdx    # 0x327d80
movl %ecx, (%rdx)
movsbl 0x1(%rax), %eax
addl $-0x30, %eax
leaq 0x2a3385(%rip), %rcx    # 0x327d84
movl %eax, (%rcx)
leaq 0x2a3374(%rip), %rax    # 0x327d7c
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_perf()
void parse_star_perf()
{
   // holdover performance

   log_packet_id("Star perf");
   if(get_msg_field()) {
      star_hold_perf = atoi(msg_field);  // 0=disable  1=enable
      have_star_perf = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x89041(%rip), %rdi     # 0x10e2fa
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x852e6
leaq 0x2a0772(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, 0x2d1943(%rip)    # 0x356c1c
leaq 0x2720f4(%rip), %rax    # 0x2f73d4
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_wtr()
void parse_star_wtr()
{
char *s;

   // wait to restore
   log_packet_id("Star WTR");

   if(get_msg_field()) {
      star_wtr = atoi(msg_field) * 10;
      have_star_wtr |= 0x01;
   }

   s = strchr(nmea_msg, '/');
   if(s) {
      ++s;
      zpad(s, 4);
      star_wtr_timer = atoi(s);
      have_star_wtr |= 0x02;
   }

   s = strchr(s, '/');
   if(s) { // !!!! 4531 aux timer
      ++s;
      zpad(s, 4);
      star_aux_timer = atoi(s);
      have_star_wtr |= 0x04;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x8900b(%rip), %rdi     # 0x10e304
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x85329
leaq 0x2a0732(%rip), %rdi    # 0x325a40
callq 0x95e0
imull $0xa, %eax, %eax
leaq 0x2a2a13(%rip), %rcx    # 0x327d30
movl %eax, (%rcx)
leaq 0x2720b2(%rip), %rax    # 0x2f73d8
orb $0x1, (%rax)
leaq 0x2a0500(%rip), %rdi    # 0x325830
pushq $0x2f
popq %rbx
movl %ebx, %esi
callq 0x9100
leaq 0x1(%rax), %r14
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x830bb
movq %r14, %rdi
callq 0x95e0
leaq 0x2a29dc(%rip), %rcx    # 0x327d34
movl %eax, (%rcx)
leaq 0x272077(%rip), %r15    # 0x2f73d8
orb $0x2, (%r15)
movq %r14, %rdi
movl %ebx, %esi
callq 0x9100
testq %rax, %rax
je 0x8539a
movq %rax, %rbx
incq %rbx
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x830bb
movq %rbx, %rdi
callq 0x95e0
leaq 0x2a29a4(%rip), %rcx    # 0x327d38
movl %eax, (%rcx)
orb $0x4, (%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_hbsq(int)
void set_star_hbsq(int secs)
{
   if(read_only) return;

   sprintf(out, "HBSQ=%d;", secs);
   queue_star_cmd(out, STAR_HBSQ_MSG);

   sprintf(out, "HBSQ;");
   queue_star_cmd(out, STAR_WTR_MSG);
}

// Assembly:
leaq 0x29bc6e(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x853b2
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2a0e5f(%rip), %rbx    # 0x326220
leaq 0x88f45(%rip), %rsi     # 0x10e30d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xcc, %esi
callq 0x576d4
movw $0x3b, 0x4(%rbx)
movl $0x51534248, (%rbx)     # imm = 0x51534248
movq %rbx, %rdi
movl $0xda, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_wtr(int)
void set_star_wtr(int secs)
{
   if(read_only) return;

   sprintf(out, "WTR=%d", secs/10);
   queue_star_cmd(out, STAR_WTR_MSG);

   sprintf(out, "WTR");
   queue_star_cmd(out, STAR_WTR_MSG);
}

// Assembly:
leaq 0x29bc15(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x8540b
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
pushq $0xa
popq %rcx
movl %edi, %eax
cltd
idivl %ecx
leaq 0x2a0e00(%rip), %rbx    # 0x326220
leaq 0x88eef(%rip), %rsi     # 0x10e316
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xda, %esi
callq 0x576d4
movl $0x525457, (%rbx)       # imm = 0x525457
movq %rbx, %rdi
movl $0xda, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_output(int)
void set_star_output(int mode)
{
   // !!!! 4531
   if(read_only) return;

   if(mode == 1) sprintf(out, "OUTPUT_TYPE=E1");
   else if(mode == 2) sprintf(out, "OUTPUT_TYPE=FR");
   else return;
   queue_star_cmd(out, STAR_OUTPUT_MSG);
   queue_star_cmd("OUTPUT_TYPE", STAR_OUTPUT_MSG);
}

// Assembly:
leaq 0x29bbba(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x85466
retq
cmpl $0x2, %edi
je 0x85483
cmpl $0x1, %edi
jne 0x85465
leaq 0x2a0da9(%rip), %rax    # 0x326220
movabsq $0x31453d45505954, %rcx # imm = 0x31453D45505954
jmp 0x85494
leaq 0x2a0d96(%rip), %rax    # 0x326220
movabsq $0x52463d45505954, %rcx # imm = 0x52463D45505954
movq %rcx, 0x7(%rax)
movabsq $0x545f54555054554f, %rcx # imm = 0x545F54555054554F
movq %rcx, (%rax)
pushq %rbp
movq %rsp, %rbp
leaq 0x2a0d70(%rip), %rdi    # 0x326220
movl $0xe0, %esi
callq 0x576d4
leaq 0x88e7a(%rip), %rdi     # 0x10e33b
movl $0xe0, %esi
popq %rbp
jmp 0x576d4