LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: request_discipline_params(unsigned char)
void request_discipline_params(u08 type)
{
   if(luxor) return;
   if(no_poll) return;
   if(res_t) return;

   if(rcvr_type == PRS_RCVR) {
      if     (type == 0x00) {   // time constant
         queue_prs_cmd("PT?", PRS_PT_MSG);
      }
      else if(type == 0x01) {  // gain
         queue_prs_cmd("GA?", PRS_GA_MSG);
      }
      else if(type == 0x02) {  // stability
         queue_prs_cmd("PF?", PRS_PF_MSG);
      }
      else if(type == 0x03) {  // integrator
         queue_prs_cmd("PI?", PRS_PI_MSG);
      }
   }
   else if(rcvr_type == STAR_RCVR) {
      if(type == 0x00) {
         request_rcvr_config(5577);
      }
   }
   else if(rcvr_type == TSIP_RCVR) {
      if(ACU_GG) return;
      if(ACU_360) return;
      if(ACUTIME) return;
      if(PALISADE) return;
      if(SV6_FAMILY) return;
      send_tsip_start(0x8E);
      send_byte(0xA8);
      send_byte(type);
      send_tsip_end();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1ce6c0(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0x7091a
leaq 0x2c6792(%rip), %rax    # 0x337020
cmpb $0x0, (%rax)
jne 0x7091a
leaq 0x1a8066(%rip), %rax    # 0x218904
cmpb $0x0, (%rax)
jne 0x7091a
movl %edi, %ebx
leaq 0x1a8024(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x1, %rax
je 0x708ff
cmpq $0x1000, %rax           # imm = 0x1000
je 0x708eb
cmpq $0x1000000, %rax        # imm = 0x1000000
jne 0x7091a
cmpb $0x3, %bl
ja 0x7091a
movzbl %bl, %eax
leaq 0xae600(%rip), %rcx     # 0x11eed4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xb1052(%rip), %rdi     # 0x121936
movl $0x20b, %esi            # imm = 0x20B
jmp 0x70949
testb %bl, %bl
jne 0x7091a
movl $0x15c9, %edi           # imm = 0x15C9
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x667f2
leaq 0x1aa6ce(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x70954
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x70954
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xb1016(%rip), %rdi     # 0x12193e
movl $0x20c, %esi            # imm = 0x20C
jmp 0x70949
leaq 0xb100c(%rip), %rdi     # 0x121942
movl $0x20d, %esi            # imm = 0x20D
jmp 0x70949
leaq 0xb0ff6(%rip), %rdi     # 0x12193a
movl $0x200, %esi            # imm = 0x200
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
movl $0x8e, %edi
callq 0x5e6be
movl $0xa8, %edi
callq 0x590f7
movzbl %bl, %edi
callq 0x590f7
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5e73c
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: request_all_dis_params()
void request_all_dis_params()
{
   if(luxor) return;
   if(no_poll) return;

   request_discipline_params(0x00); // time constant
   request_discipline_params(0x01); // gain / DAC range
   request_discipline_params(0x02); // sync / freq thresholds
   request_discipline_params(0x03); // initial DAC voltage
   request_discipline_params(0x04); // undocumented - allowable DAC range?
}

// Assembly:
leaq 0x1ce5bc(%rip), %rax    # 0x23ef3e
leaq 0x2c6697(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
je 0x70990
retq
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0x70871
movl $0x1, %edi
callq 0x70871
movl $0x2, %edi
callq 0x70871
movl $0x3, %edi
callq 0x70871
movl $0x4, %edi
popq %rbp
jmp 0x70871
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_pullin_range(int)
void set_pullin_range(int i)
{
   if(read_only) return;

   if(rcvr_type == UCCM_RCVR) {
      sprintf(out, "PULLINRANGE %d", i/10);
      queue_uccm_cmd(out, UCCM_SET_PULLIN_MSG);
      queue_uccm_cmd("PULLINRANGE?", UCCM_GET_PULLIN_MSG);
   }
}

// Assembly:
leaq 0x2c664f(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
jne 0x70a36
leaq 0x1a7ef9(%rip), %rax    # 0x2188d0
cmpq $0x8, (%rax)
jne 0x70a36
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movslq %edi, %rax
imulq $0x66666667, %rax, %rdx # imm = 0x66666667
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x22, %rdx
addl %eax, %edx
leaq 0x2cb81f(%rip), %rbx    # 0x33c220
leaq 0xb0f3e(%rip), %rsi     # 0x121946
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x6c, %esi
callq 0x5edda
leaq 0xb03f9(%rip), %rdi     # 0x120e1f
movl $0x6d, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_pt(int)
void set_prs_pt(int val)
{
   if(read_only) return;

   sprintf(out, "PT%d", val);
   queue_prs_cmd(out, PRS_PT_MSG);
   queue_prs_cmd("PT?", PRS_PT_MSG);
}

// Assembly:
leaq 0x2c6202(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x70e1e
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2cb3f3(%rip), %rbx    # 0x33c220
leaq 0xb2e9b(%rip), %rsi     # 0x123ccf
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x20b, %esi            # imm = 0x20B
callq 0x5edda
leaq 0xb0ae4(%rip), %rdi     # 0x121936
movl $0x20b, %esi            # imm = 0x20B
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_pf(int)
void set_prs_pf(int val)
{
   if(read_only) return;

   sprintf(out, "PF%d", val);
   queue_prs_cmd(out, PRS_PF_MSG);
   queue_prs_cmd("PF?", PRS_PF_MSG);
}

// Assembly:
leaq 0x2c61b1(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x70e6f
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2cb3a2(%rip), %rbx    # 0x33c220
leaq 0xb2e3b(%rip), %rsi     # 0x123cc0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x20c, %esi            # imm = 0x20C
callq 0x5edda
leaq 0xb0a9b(%rip), %rdi     # 0x12193e
movl $0x20c, %esi            # imm = 0x20C
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_ga(int)
void set_prs_ga(int val)
{
   if(read_only) return;

   sprintf(out, "GA%d", val);
   queue_prs_cmd(out, PRS_GA_MSG);
   queue_prs_cmd("GA?", PRS_GA_MSG);
}

// Assembly:
leaq 0x2c6160(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x70ec0
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2cb351(%rip), %rbx    # 0x33c220
leaq 0xa4bee(%rip), %rsi     # 0x115ac4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x5edda
leaq 0xb0a46(%rip), %rdi     # 0x12193a
movl $0x200, %esi            # imm = 0x200
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_pi(int)
void set_prs_pi(int val)
{
   if(read_only) return;

   sprintf(out, "PI%d", val);
   queue_prs_cmd(out, PRS_PI_MSG);
   queue_prs_cmd("PI?", PRS_PI_MSG);
}

// Assembly:
leaq 0x2c610f(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x70f11
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2cb300(%rip), %rbx    # 0x33c220
leaq 0xb2d9e(%rip), %rsi     # 0x123cc5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x20d, %esi            # imm = 0x20D
callq 0x5edda
leaq 0xb09fd(%rip), %rdi     # 0x121942
movl $0x20d, %esi            # imm = 0x20D
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_sro_tc(int)
void set_sro_tc(int secs)
{
   if(read_only) return;

   if(secs < 0) secs = 0;
   if(secs > 999999) secs = 999999;
   sprintf(out, "TC%06d", secs);
   queue_sro_cmd(out, SRO_TC_MSG);
   sro_eeprom();
}

// Assembly:
leaq 0x2c60be(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x70f62
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
xorl %eax, %eax
testl %edi, %edi
cmovlel %eax, %edx
movl $0xf423f, %eax          # imm = 0xF423F
cmpl %eax, %edx
cmovgel %eax, %edx
leaq 0x2cb29e(%rip), %rbx    # 0x33c220
leaq 0xb29f5(%rip), %rsi     # 0x12397e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x32d, %esi            # imm = 0x32D
callq 0x5edda
movl $0x1f8, %edi            # imm = 0x1F8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9d78
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_dds(double)
void set_x72_dds(double val)
{
#define MAX_DDS_STEP  4.0E-8
#define MAX_DDS_RANGE 1.0E-6
double dval;
double set_val;
double sign;
int i, j;

   // set the X72 DDS freq tune value
   if(read_only) return;

   if(fabs(val) > 1.0E-6) return;

   if(val < 0.0) sign = (-1.0);
   else          sign = 1.0;

   last_x72_dds = val;
   user_set_x72_dds = 1;
   save_x72_state();

   dval = fabs(val);
   if(dval > MAX_DDS_RANGE) return;  // freq change is too large
   j = (int) (MAX_DDS_RANGE / MAX_DDS_STEP) + 1;

   set_val = 0.0;
   for(i=0; i<j; i++) {  // max DDS change allowed in one step is 4.0E-8
      if(dval > MAX_DDS_STEP) set_val += MAX_DDS_STEP;
      else                    set_val += dval;

      osc_offset = set_val*sign;

      val = set_val / 1.0E-12;  // we get E-12 steps
      have_osc_offset = 333;
      val = val / 10.0;     // scale E-12 input to E-11 
      sprintf(out, "f%.2f", val*sign);
      queue_x72_cmd(out, X72_SET_DDS_MSG);

      dval -= MAX_DDS_STEP;
      if(dval <= 0.0) break;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x2c6052(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
jne 0x710e4
movapd 0x981b7(%rip), %xmm1    # 0x109190
andpd %xmm0, %xmm1
movapd %xmm1, -0x40(%rbp)
ucomisd 0x9aa16(%rip), %xmm1    # 0x10ba00
ja 0x710e4
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x9beec(%rip), %rcx     # 0x10cef0
movsd (%rcx,%rax,8), %xmm1
movsd %xmm1, -0x48(%rbp)
leaq 0x1a9ecb(%rip), %rax    # 0x21aee0
movsd %xmm0, (%rax)
leaq 0x1a9e90(%rip), %rax    # 0x21aeb0
movl $0x1, (%rax)
callq 0x6be07
movl $0x19, %r15d
leaq 0x29b788(%rip), %r12    # 0x30c7c0
leaq 0x29c1f5(%rip), %r13    # 0x30d234
leaq 0x2cb1da(%rip), %rbx    # 0x33c220
leaq 0xb2edb(%rip), %r14     # 0x123f28
xorpd %xmm0, %xmm0
movsd 0xad197(%rip), %xmm2    # 0x11e1f0
minsd -0x40(%rbp), %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, -0x50(%rbp)
movsd -0x48(%rbp), %xmm1
movapd %xmm1, %xmm0
mulsd %xmm2, %xmm0
movsd %xmm0, (%r12)
movapd %xmm2, %xmm0
divsd 0xad172(%rip), %xmm0    # 0x11e1f8
movl $0x14d, (%r13)          # imm = 0x14D
divsd 0x98012(%rip), %xmm0    # 0x1090a8
mulsd %xmm1, %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movb $0x1, %al
callq 0x9060
movq %rbx, %rdi
movl $0x2bd, %esi            # imm = 0x2BD
callq 0x5edda
movapd -0x40(%rbp), %xmm1
addsd 0xad13f(%rip), %xmm1    # 0x11e200
subl $0x1, %r15d
setb %al
movapd %xmm1, -0x40(%rbp)
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
movsd -0x50(%rbp), %xmm0
jae 0x710e4
testb %al, %al
je 0x71051
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_jamthresh(double)
void set_x72_jamthresh(double val)
{
   // set the X72 sw discipline forced jamsync threshold
   if(read_only) return;

//// if(x72_fw_discipline()) return;
// !!!!!!!!!!!!!! we need to change the X72_PPS_BINS code to implement this !!!!!!!!!!!!!!
   if(val <= 0.0) val = X72_JAMSYNC_THRESH;
   if(val >= X72_JAMSYNC_THRESH) val = X72_JAMSYNC_THRESH;

   have_x72_jamthresh = 1;
   x72_jamthresh_val = val;
   user_jam_sync = (DATA_SIZE) val;
   jam_sync = (DATA_SIZE) val;
   have_osc_params |= PARAM_JAMSYNC;

   last_x72_jamthresh = val;
   user_set_x72_jamthresh = 1;

   save_x72_state();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2c5f1c(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x71105
popq %rbp
retq
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpnlesd %xmm1, %xmm2
andpd %xmm2, %xmm0
movsd 0x9a80a(%rip), %xmm1    # 0x10b928
andnpd %xmm1, %xmm2
orpd %xmm0, %xmm2
minsd %xmm2, %xmm1
leaq 0x1a9bf7(%rip), %rax    # 0x21ad28
movl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x1a9ce1(%rip), %rax    # 0x21ae20
movsd %xmm1, (%rax)
leaq 0x29c066(%rip), %rax    # 0x30d1b0
movsd %xmm1, (%rax)
leaq 0x29bfeb(%rip), %rax    # 0x30d140
movsd %xmm1, (%rax)
leaq 0x29cc9c(%rip), %rax    # 0x30ddfc
orb $0x2, 0x1(%rax)
leaq 0x1a9da5(%rip), %rax    # 0x21af10
movsd %xmm1, (%rax)
leaq 0x1a9d86(%rip), %rax    # 0x21aefc
movl %ecx, (%rax)
popq %rbp
jmp 0x6be07
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_tc(int)
void set_x72_tc(int val)
{
   // set the X72 disciplining time constant factor
   if(read_only) return;

   if(val < MIN_X72_TC) val = MIN_X72_TC;
   if(val > MAX_X72_TC) val = MAX_X72_TC;

   have_x72_tc = 1;
   x72_tc_val = val;
   user_time_constant = (DATA_SIZE) val;
   time_constant = (DATA_SIZE) val;
   have_osc_params |= PARAM_TC;
   x72_reset_filter();

   last_x72_tc = val;
   user_set_x72_tc = 1;
   save_x72_state();

   if(x72_fw_discipline()) {
      sprintf(out, "y2\r%d", val);
      queue_x72_cmd(out, X72_TC_MSG);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x2c5e8e(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x71196
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x6, %edi
movl $0x5, %ebx
cmovgel %edi, %ebx
movl $0x186a0, %eax          # imm = 0x186A0
cmpl %eax, %ebx
cmovgel %eax, %ebx
leaq 0x1a9b6e(%rip), %rax    # 0x21ad20
movl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x1a9c44(%rip), %rax    # 0x21ae04
movl %ebx, (%rax)
cvtsi2sd %ebx, %xmm0
leaq 0x29bfab(%rip), %rax    # 0x30d178
movsd %xmm0, (%rax)
leaq 0x29bf18(%rip), %rax    # 0x30d0f0
movsd %xmm0, (%rax)
leaq 0x29cc19(%rip), %rax    # 0x30ddfc
orb $0x1, (%rax)
leaq 0x1a9d3b(%rip), %rax    # 0x21af28
xorl %edx, %edx
movl %edx, (%rax)
movq %rdx, 0x305538(%rip)    # 0x376730
movl %edx, 0x308b32(%rip)    # 0x379d30
movl %edx, 0x308b30(%rip)    # 0x379d34
movq %rdx, 0x308b1d(%rip)    # 0x379d28
movq %rdx, 0x308b26(%rip)    # 0x379d38
leaq 0x1a9d03(%rip), %rax    # 0x21af1c
movl %ebx, (%rax)
leaq 0x1a9cd2(%rip), %rax    # 0x21aef4
movl %ecx, (%rax)
callq 0x6be07
callq 0x6cbe4
testl %eax, %eax
je 0x71191
leaq 0x2cafe3(%rip), %r14    # 0x33c220
leaq 0xb2d0d(%rip), %rsi     # 0x123f51
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x2cb, %esi            # imm = 0x2CB
popq %rbx
popq %r14
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_damping(double)
void set_x72_damping(double val)
{
   // set the X72 disciplining damping factor
   if(read_only) return;

   have_x72_damping = 1;
   x72_damping_val = val;
   user_damping_factor = (DATA_SIZE) val;
   have_osc_params |= PARAM_DAMP;

   last_x72_damping = val;
   user_set_x72_damping = 1;
   save_x72_state();

   if(x72_fw_discipline()) {
      sprintf(out, "y1\r%.2f", val);
      queue_x72_cmd(out, X72_DAMPING_MSG);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2c5dac(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x7127a
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x1a9aa3(%rip), %rax    # 0x21ad24
movl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x1a9b89(%rip), %rax    # 0x21ae18
movsd %xmm0, (%rax)
leaq 0x29bee6(%rip), %rax    # 0x30d180
movsd %xmm0, (%rax)
leaq 0x29cb57(%rip), %rax    # 0x30ddfc
orb $0x2, (%rax)
leaq 0x1a9c59(%rip), %rax    # 0x21af08
movsd %xmm0, (%rax)
leaq 0x1a9c3e(%rip), %rax    # 0x21aef8
movl %ecx, (%rax)
movsd %xmm0, -0x10(%rbp)
callq 0x6be07
callq 0x6cbe4
movsd -0x10(%rbp), %xmm0
testl %eax, %eax
je 0x71273
leaq 0x2caf45(%rip), %rbx    # 0x33c220
leaq 0xb2c67(%rip), %rsi     # 0x123f49
movq %rbx, %rdi
movb $0x1, %al
callq 0x9060
movq %rbx, %rdi
movl $0x2cc, %esi            # imm = 0x2CC
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_holdover(int)
void set_x72_holdover(int val)
{
   // set the X72 sw discipline holdover analysis time
   if(read_only) return;

//// if(x72_fw_discipline()) return;
   if(val <= 0) val = X72_HOLDOVER_SIZE;

   have_x72_holdover = 1;
   x72_holdover_val = val;
   user_holdover_time = val;
   have_osc_params |= PARAM_HOLDOVER;

   last_x72_holdover = val;
   user_set_x72_holdover = 1;

   save_x72_state();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2c5d10(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x71311
popq %rbp
retq
testl %edi, %edi
movl $0x78, %eax
cmovgl %edi, %eax
leaq 0x1a9a0a(%rip), %rcx    # 0x21ad2c
movl $0x1, %edx
movl %edx, (%rcx)
leaq 0x1a9ad8(%rip), %rcx    # 0x21ae08
movl %eax, (%rcx)
leaq 0x29be8f(%rip), %rcx    # 0x30d1c8
movl %eax, (%rcx)
leaq 0x29caba(%rip), %rcx    # 0x30ddfc
orb $0x20, 0x1(%rcx)
leaq 0x1a9bcb(%rip), %rcx    # 0x21af18
movl %eax, (%rcx)
leaq 0x1a9baa(%rip), %rax    # 0x21af00
movl %edx, (%rax)
popq %rbp
jmp 0x6be07
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: request_survey_params()
void request_survey_params()
{
   if(luxor) return;
   if(no_poll) return;

   if(rcvr_type == FURUNO_RCVR) {
      send_furuno_cmd("GPtmq");
   }
   else if(rcvr_type == MOTO_RCVR) {
      send_moto_start("Gd");
      send_byte(0xFF);
      send_moto_end();
   }
   else if(rcvr_type == TM4_RCVR) {
      request_tm4_msg("57");
   }
   else if(rcvr_type == TSIP_RCVR) {
      if(ACU_GG) return;
      else if(ACU_360) return;
      else if(ACUTIME) ;
      else if(PALISADE) return;
      else if(SV6_FAMILY) return;
      send_tsip_start(0x8E);
      send_byte(0xA9);
      send_tsip_end();
   }
   else if(rcvr_type == UBX_RCVR) { 
      if     (have_ubx_tmode == 2) request_ubx_msg(UBX_CFG_TMODE2);  // M8T
      else if(have_ubx_tmode == 1) request_ubx_msg(UBX_CFG_TMODE);
      else {
         request_ubx_msg(UBX_CFG_TMODE2);  // M8T
         request_ubx_msg(UBX_CFG_TMODE);
      }
      request_ubx_msg(UBX_SVIN);
   }
   else if(rcvr_type == VENUS_RCVR) {
      if(saw_venus_raw) query_venus_msg(QUERY_VENUS_BASE);
      else              query_venus_msg(QUERY_VENUS_SURVEY);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1cdbd5(%rip), %rax    # 0x23ef3e
leaq 0x2c5cb0(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
je 0x71378
popq %rbp
retq
leaq 0x1a7551(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x1f, %rax
jle 0x713ab
cmpq $0x20, %rax
je 0x713e8
cmpq $0x80, %rax
je 0x71404
cmpq $0x20000000, %rax       # imm = 0x20000000
jne 0x71376
leaq 0xb05b8(%rip), %rdi     # 0x12195d
popq %rbp
jmp 0x5eff8
cmpq $0x1, %rax
je 0x71417
cmpq $0x4, %rax
jne 0x71376
leaq 0x29bff6(%rip), %rax    # 0x30d3b4
movl (%rax), %eax
cmpl $0x2, %eax
je 0x71469
cmpl $0x1, %eax
je 0x713df
movl $0x63d, %edi            # imm = 0x63D
xorl %esi, %esi
callq 0x5f37d
callq 0x5f456
movw $0x61d, %ax             # imm = 0x61D
jmp 0x7146d
leaq 0xafae3(%rip), %rdi     # 0x120ed2
callq 0x6160d
movl $0xff, %edi
callq 0x590f7
popq %rbp
jmp 0x61688
leaq 0x2cc9e9(%rip), %rax    # 0x33ddf4
cmpl $0x0, (%rax)
je 0x71454
movl $0x23, %edi
jmp 0x71459
leaq 0x1a9bb6(%rip), %rax    # 0x21afd4
movl (%rax), %eax
movl %eax, %edx
xorl $0x41, %edx
leaq 0x1a74cc(%rip), %rcx    # 0x2188f8
movl (%rcx), %ecx
movl %ecx, %esi
xorl $0x47, %esi
orl %edx, %esi
je 0x71376
cmpl $0x41, %eax
jne 0x7148e
cmpl $0x33, %ecx
je 0x71376
cmpl $0x47, %ecx
je 0x71376
jmp 0x714a4
movl $0x44, %edi
movl $0x1, %esi
callq 0x5fb3c
popq %rbp
jmp 0x61bc1
movw $0x63d, %ax             # imm = 0x63D
movzwl %ax, %edi
xorl %esi, %esi
callq 0x5f37d
callq 0x5f456
movl $0xd04, %edi            # imm = 0xD04
xorl %esi, %esi
callq 0x5f37d
popq %rbp
jmp 0x5f456
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x714a4
movl $0x20000009, %ecx       # imm = 0x20000009
btl %eax, %ecx
jb 0x71376
movl $0x8e, %edi
callq 0x5e6be
movl $0xa9, %edi
callq 0x590f7
popq %rbp
jmp 0x5e73c
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_survey_params(unsigned char, unsigned char, unsigned int)
void set_survey_params(u08 enable_survey,  u08 save_survey, u32 survey_len)
{
   if(read_only) return;
   if(luxor) return;

   if(rcvr_type == FURUNO_RCVR) {  //!!! zorky
   }
   else if(rcvr_type == MOTO_RCVR) {  //!!! moto_chans
      send_moto_start("Gd");
      if(enable_survey) send_byte(0x03);
      else              send_byte(0x00);
      send_moto_end();
   }
   else if(rcvr_type == NVS_RCVR) {
      if(survey_len > 1440) survey_len = 1440;
      else if(survey_len < 20) survey_len = 20;
      send_nvs_start(0x1D);
      send_byte(0x06);
      send_word(survey_len);
      send_nvs_end();
   }
   else if(rcvr_type == TSIP_RCVR) {
      if(ACU_GG) ;
      else if(ACU_360) ;
      else if(ACUTIME) ;
      else if(PALISADE) return;
      else if(SV6_FAMILY) return;
      send_tsip_start(0x8E);
      send_byte(0xA9);
      send_byte(enable_survey);
      send_byte(save_survey);
      send_dword(survey_len);
      send_dword(0x0000);
      send_tsip_end();
   }
   else if(rcvr_type == TRUE_RCVR) {  // zorky
   }
   else if(rcvr_type == UBX_RCVR) {  // zorky
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
leaq 0x2c5b49(%rip), %rax    # 0x33701a
leaq 0x1cda66(%rip), %rcx    # 0x23ef3e
movb (%rcx), %cl
orb (%rax), %cl
setne %cl
leaq 0x1a73ea(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x20000000, %rax       # imm = 0x20000000
sete %dl
orb %cl, %dl
je 0x71501
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %edi, %r14d
cmpq $0x1, %rax
je 0x715b3
cmpq $0x800, %rax            # imm = 0x800
je 0x71547
cmpq $0x20, %rax
jne 0x714f6
leaq 0xaf9af(%rip), %rdi     # 0x120ed2
callq 0x6160d
xorl %eax, %eax
testb %r14b, %r14b
setne %al
leal (%rax,%rax,2), %edi
callq 0x590f7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x61688
cmpl $0x15, %ebx
movl $0x14, %r14d
cmovael %ebx, %r14d
movl $0x5a0, %eax            # imm = 0x5A0
cmpl %eax, %r14d
cmovael %eax, %r14d
movl $0x1d, %edi
callq 0x5e6be
movl $0x6, %edi
callq 0x590f7
movw %r14w, -0x1a(%rbp)
leaq 0x1a7254(%rip), %rbx    # 0x2187d4
xorl %eax, %eax
cmpb $0x0, (%rbx)
sete %al
movzbl -0x1a(%rbp,%rax), %edi
callq 0x590f7
xorl %eax, %eax
cmpb $0x0, (%rbx)
setne %al
movzbl -0x1a(%rbp,%rax), %edi
callq 0x590f7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5e7c0
movl %esi, %r15d
leaq 0x1a9a17(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x715d5
movl $0x20000009, %ecx       # imm = 0x20000009
btl %eax, %ecx
jb 0x714f6
movl $0x8e, %edi
callq 0x5e6be
movl $0xa9, %edi
callq 0x590f7
movzbl %r14b, %edi
callq 0x590f7
movzbl %r15b, %edi
callq 0x590f7
movl %ebx, %edi
callq 0x592eb
xorl %edi, %edi
callq 0x592eb
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5e73c
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: request_primary_timing()
void request_primary_timing()
{
   if(luxor) return;
   if(no_poll) return;
   if(rcvr_type != TSIP_RCVR) return;
   if(ACU_GG) ;
   else if(ACU_360) ;
   else if(ACUTIME) ;
   else if(PALISADE) return;
   else if(SV6_FAMILY) return;

   send_tsip_start(0x8E);
   send_byte(0xAB);
   send_byte(0x02);
   send_tsip_end();
}

// Assembly:
leaq 0x1cd5e0(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0x71997
leaq 0x2c56b6(%rip), %rax    # 0x337020
cmpb $0x0, (%rax)
jne 0x71997
leaq 0x1a6f5a(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x71997
leaq 0x1a9651(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x71998
movl $0x20000009, %ecx       # imm = 0x20000009
btl %eax, %ecx
jae 0x71998
retq
pushq %rbp
movq %rsp, %rbp
movl $0x8e, %edi
callq 0x5e6be
movl $0xab, %edi
callq 0x590f7
movl $0x2, %edi
callq 0x590f7
popq %rbp
jmp 0x5e73c
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: request_secondary_timing()
void request_secondary_timing()
{
   if(luxor) return;
   if(no_poll) return;
   if(rcvr_type != TSIP_RCVR) return;
   if(ACU_GG) ;
   else if(ACU_360) ;
   else if(ACUTIME) ;
   else if(PALISADE) return;
   else if(SV6_FAMILY) return;

   send_tsip_start(0x8E);
   send_byte(0xAC);
   send_byte(0x02);
   send_tsip_end();
}

// Assembly:
leaq 0x1cd577(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0x71a00
leaq 0x2c564d(%rip), %rax    # 0x337020
cmpb $0x0, (%rax)
jne 0x71a00
leaq 0x1a6ef1(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x71a00
leaq 0x1a95e8(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x71a01
movl $0x20000009, %ecx       # imm = 0x20000009
btl %eax, %ecx
jae 0x71a01
retq
pushq %rbp
movq %rsp, %rbp
movl $0x8e, %edi
callq 0x5e6be
movl $0xac, %edi
callq 0x590f7
movl $0x2, %edi
callq 0x590f7
popq %rbp
jmp 0x5e73c
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: request_ae_packet(unsigned char)
void request_ae_packet(u08 subcode)
{
   if(luxor) return;
   if(no_poll) return;
   if(rcvr_type != TSIP_RCVR) return;
   if(ACU_GG) return;
   if(ACU_360) return;
   if(ACUTIME) return;
   if(PALISADE) return;
   if(SV6_FAMILY) return;

   send_tsip_start(0x8E);
   send_byte(0xAE);
   send_byte(subcode);
   send_tsip_end();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1cd508(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0x71a71
leaq 0x2c55de(%rip), %rax    # 0x337020
cmpb $0x0, (%rax)
jne 0x71a71
leaq 0x1a6e82(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x71a71
movl %edi, %ebx
leaq 0x1a9577(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x71a78
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x71a78
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x8e, %edi
callq 0x5e6be
movl $0xae, %edi
callq 0x590f7
movzbl %bl, %edi
callq 0x590f7
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5e73c
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_almanac_data()
void get_almanac_data()
{
int prn;

   log_packet_id("Packet 0x40 - Almanac data");

   prn = tsip_byte();
   tsip_single();   // seconds
   tsip_word();     // week
   tsip_single();   // eccentricity
   tsip_single();   // T_oa
   tsip_single();   // I_o
   tsip_single();   // OMEGA_dot
   tsip_single();   // sqrt(A)
   tsip_single();   // OMEGAo
   tsip_single();   // omega
   tsip_single();   // Mo
   check_tsip_end(1);
   if(tsip_error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xafb05(%rip), %rdi     # 0x121a8b
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x71fa1
leaq 0x1ccfd2(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58a30
callq 0x588d2
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
xorl %edi, %edi
popq %rbp
jmp 0x58e9b
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_ebolt_health1()
void get_ebolt_health1()
{
u08 sv_fix;
u08 antenna_fault;

   log_packet_id("Packet 0x46 (Tbolt-E health)");

   sv_fix = tsip_byte();
   antenna_fault = tsip_byte();
   check_tsip_end(1);
   if(tsip_error) return;

   saw_version |= 0x04;
   saw_ebolt();
   tbolt_e |= 0x01;

   if(SV6_FAMILY) {
      have_critical_alarms = 33;
//    if(antenna_fault & 0x01) critical_alarms |= CRIT_RAM;      // alarm could be no backup battery
//    else                     critical_alarms &= (~CRIT_RAM);
      if(antenna_fault & 0x02) critical_alarms |= CRIT_FPGA;
      else                     critical_alarms &= (~CRIT_FPGA);
      if(antenna_fault & 0x0C) critical_alarms |= CRIT_GPS;
      else                     critical_alarms &= (~CRIT_GPS);
      if(antenna_fault & 0x20) critical_alarms |= CRIT_OCXO;
      else                     critical_alarms &= (~CRIT_OCXO);

      if(antenna_fault & 0x10) minor_alarms |= MINOR_ANT_NO_PWR;
      else                     minor_alarms &= (~MINOR_ANT_NO_PWR);
      have_antenna = 33;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0xaf213(%rip), %rdi     # 0x121b45
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7294d
leaq 0x1cc626(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x72965
leaq 0x1cc60e(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
xorl %edi, %edi
callq 0x58e9b
leaq 0x1cc5fd(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x72a10
leaq 0x29aa85(%rip), %rax    # 0x30d408
orb $0x4, (%rax)
callq 0x5e140
leaq 0x1a5f6e(%rip), %rax    # 0x218900
orb $0x1, (%rax)
leaq 0x1a5f34(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x72a10
leaq 0x1a862b(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x72a10
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x72a10
leaq 0x29a8e4(%rip), %rcx    # 0x30d2a8
movl $0x21, %eax
movl %eax, (%rcx)
leaq 0x29a7fe(%rip), %rcx    # 0x30d1d0
movl (%rcx), %edx
andl $-0x19, %edx
xorl %esi, %esi
testb $0xc, %bl
setne %sil
movl %ebx, %edi
shrl %edi
andl $0x10, %edi
leal (%rdi,%rsi,8), %esi
orl %edx, %esi
movl %esi, (%rcx)
shll $0x1b, %ebx
sarl $0x1f, %ebx
leaq 0x29a7dd(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
andl $-0x7, %edx
andl $0x6, %ebx
orl %edx, %ebx
movl %ebx, (%rcx)
leaq 0x29a81e(%rip), %rcx    # 0x30d22c
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_system_msg()
void get_system_msg()
{
int i;

// response to 0x28 GPS system message request
   log_packet_id("Packet 0x48 (GPS system message)");

   for(i=0; i<22; i++) msg_field[i] = tsip_byte();
   msg_field[22] = 0;
//strcpy(debug_text, msg_field);
if(debug_file) fprintf(debug_file, "# GPS system message:%s\n", msg_field);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xaef52(%rip), %rdi     # 0x121b7e
callq 0x58dc2
xorl %ebx, %ebx
leaq 0x2c8e06(%rip), %r14    # 0x33ba40
leaq 0x1cc32f(%rip), %r15    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72c51
orb $0x8, (%r15)
movb %al, (%r14,%rbx)
incq %rbx
cmpq $0x16, %rbx
jne 0x72c41
movb $0x0, 0x16(%r14)
leaq 0x1cb726(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x72c91
leaq 0xaef26(%rip), %rsi     # 0x121b9f
leaq 0x2c8dc0(%rip), %rdx    # 0x33ba40
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9560
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_alm_health()
void get_alm_health()
{
int i;

   log_packet_id("Packet 0x49 (Almanac health page)");
   for(i=1; i<=32; i++) {
//    sat[i].health_flag = tsip_byte();
      if(tsip_byte()) sat[i].health_flag = 1;  // unhealthy
      else            sat[i].health_flag = 0;  // healthy
   }
   check_tsip_end(1);
   if(tsip_error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xaef0b(%rip), %rdi     # 0x121bb8
callq 0x58dc2
movl $0x348, %ebx            # imm = 0x348
leaq 0x1cc2f2(%rip), %r14    # 0x23efb0
leaq 0x1cc2ab(%rip), %r15    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72cd5
orb $0x8, (%r15)
testb %al, %al
setne (%r14,%rbx)
addq $0x348, %rbx            # imm = 0x348
cmpq $0x6c48, %rbx           # imm = 0x6C48
jne 0x72cc5
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x58e9b
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_ebolt_health2()
void get_ebolt_health2()
{
u08 id;
u08 rtc;
u08 superpackets;

   log_packet_id("Packet 0x4B (Tbolt-E health)");

   id = tsip_byte();           // sv6=1B
   rtc = tsip_byte();
   superpackets = tsip_byte();
   check_tsip_end(1);
   if(tsip_error) return;

   saw_version |= 0x08;
   saw_ebolt();
   tbolt_e |= 0x02;

   if(SV6_FAMILY) {
      if(rtc & 0x08) minor_alarms |= MINOR_ALMANAC;
      else           minor_alarms &= (~MINOR_ALMANAC);

//    if(rtc & 0x02) minor_alarms |= MINOR_ALMANAC;      // no time at power-up
//    else           minor_alarms &= (~MINOR_ALMANAC);

      if(rtc & 0x05) critical_alarms |= CRIT_FPGA;
      else           critical_alarms &= (~CRIT_FPGA);
      have_critical_alarms = 34;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0xaeeb5(%rip), %rdi     # 0x121bf0
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72d56
leaq 0x1cc21d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x72d6e
leaq 0x1cc205(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72d84
leaq 0x1cc1ef(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
xorl %edi, %edi
callq 0x58e9b
leaq 0x1cc1de(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x72e1c
leaq 0x29a666(%rip), %rax    # 0x30d408
orb $0x8, (%rax)
callq 0x5e140
leaq 0x1a5b4f(%rip), %rax    # 0x218900
orb $0x2, (%rax)
leaq 0x1a5b15(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x72e1c
leaq 0x1a820c(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x72e1c
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x72e1c
leaq 0x29a3f5(%rip), %rax    # 0x30d1d8
movl $0xfffff7ff, %ecx       # imm = 0xFFFFF7FF
andl (%rax), %ecx
movl %ebx, %edx
andl $0x8, %edx
shll $0x8, %edx
orl %ecx, %edx
movl %edx, (%rax)
xorl %eax, %eax
testb $0x5, %bl
setne %al
leaq 0x29a3cb(%rip), %rcx    # 0x30d1d0
movl (%rcx), %edx
andl $-0x9, %edx
leal (%rdx,%rax,8), %eax
movl %eax, (%rcx)
leaq 0x29a492(%rip), %rax    # 0x30d2a8
movl $0x22, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_sv6_config()
void get_sv6_config()
{
float el_val;
float amu_val;

   log_packet_id("Packet 0x4C (SV6_FAMILY receiver config)");

   dynamics_code = tsip_byte();
   el_val = tsip_single();
   amu_val = tsip_single();
   pdop_mask = tsip_single();
   have_pdop_mask |= 0x01;
   pdop_switch = tsip_single();
   have_pdop_mask |= 0x02;
   check_tsip_end(1);
   if(tsip_error) return;
//sprintf(debug_text, "got dyn:%d el:%f amu:%f pmask:%f sw:%f  aflag:%d  amode:%d", dynamics_code,el_val,amu_val,pdop_mask,pdop_switch, amu_flag, amu_mode);

   // stupid filtering required for STARLOC II devices
   el_val = (float) (int) ((el_val*RAD_TO_DEG) + 0.50F);
   if((el_val >= 0.0) && (el_val <= 90.0)) {
      el_mask = el_val;
      have_el_mask = 1;
   }

   if((amu_val >= 0.0) && (amu_val < 60.0)) {
      amu_mask = amu_val;
      have_amu = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0xaeddd(%rip), %rdi     # 0x121c0d
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72e4b
leaq 0x1cc128(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29a273(%rip), %rcx    # 0x30d0c5
movb %al, (%rcx)
callq 0x58a30
movss %xmm0, -0xc(%rbp)
callq 0x58a30
movss %xmm0, -0x10(%rbp)
callq 0x58a30
leaq 0x29a248(%rip), %rax    # 0x30d0bc
movss %xmm0, (%rax)
leaq 0x29a24d(%rip), %rbx    # 0x30d0cc
orb $0x1, (%rbx)
callq 0x58a30
leaq 0x29a232(%rip), %rax    # 0x30d0c0
movss %xmm0, (%rax)
orb $0x2, (%rbx)
xorl %edi, %edi
callq 0x58e9b
movss -0x10(%rbp), %xmm1
leaq 0x1cc0c8(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x72f1b
xorps %xmm0, %xmm0
cvtss2sd -0xc(%rbp), %xmm0
mulsd 0x962a3(%rip), %xmm0    # 0x109160
addsd 0x961a3(%rip), %xmm0    # 0x109068
cvttsd2si %xmm0, %eax
cmpl $0x5a, %eax
ja 0x72eed
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
leaq 0x29a1d8(%rip), %rax    # 0x30d0b4
movss %xmm0, (%rax)
leaq 0x29a515(%rip), %rax    # 0x30d3fc
movl $0x1, (%rax)
xorpd %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jb 0x72f1b
movss 0x9a17e(%rip), %xmm0    # 0x10d07c
ucomiss %xmm1, %xmm0
jbe 0x72f1b
leaq 0x29a1ae(%rip), %rax    # 0x30d0b8
movss %xmm1, (%rax)
leaq 0x29a4e3(%rip), %rax    # 0x30d3f8
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_sv6_osc_offset()
void get_sv6_osc_offset()
{
float ofs;

   log_packet_id("Packet 0x4D (SV6_FAMILY osc offset)");
   ofs = tsip_single();
   check_tsip_end(1);

   osc_offset = (double)ofs/1000.0;
   have_osc_offset = 666;
   have_rcvr_osc = 666;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xaed05(%rip), %rdi     # 0x121c36
callq 0x58dc2
callq 0x58a30
movss %xmm0, -0x4(%rbp)
xorl %edi, %edi
callq 0x58e9b
xorps %xmm0, %xmm0
cvtss2sd -0x4(%rbp), %xmm0
divsd 0x960e1(%rip), %xmm0    # 0x109038
leaq 0x299862(%rip), %rax    # 0x30c7c0
movsd %xmm0, (%rax)
leaq 0x29a2cb(%rip), %rax    # 0x30d234
movl $0x29a, %ecx            # imm = 0x29A
movl %ecx, (%rax)
leaq 0x29a2d1(%rip), %rax    # 0x30d248
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_set_time_response()
void get_set_time_response()
{
u08 ack;

   log_packet_id("Packet 0x4E (Set time response)");
   ack = tsip_byte();
   check_tsip_end(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xaecd0(%rip), %rdi     # 0x121c5a
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72fa5
leaq 0x1cbfce(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
xorl %edi, %edi
popq %rbp
jmp 0x58e9b
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_sv6_utc_info()
void get_sv6_utc_info()
{
double a0;
float a1;
short delta_ls;
float tot;
double wn_lsf;
unsigned short wnt;
unsigned short dn;
short delta_lsf;
int wraps;

   log_packet_id("Packet 0x4F (UTC leapsecond info)");

   a0 = tsip_double();
   a1 = tsip_single();
   delta_ls = tsip_word();
   tot = tsip_single();
   wnt = tsip_word();
   wn_lsf = (double) (short) tsip_word();
   wraps = gps_week / 1024;
   wn_lsf += (wraps * 1024);
// while(wn_lsf < (double) gps_week) {  // adjust for week rollovers
//    wn_lsf += 1024.0;
// }
   dn = tsip_word();
   delta_lsf = tsip_word();

   minor_alarms &= (~MINOR_LEAP_PEND);
   if(delta_ls != delta_lsf) {
      minor_alarms |= MINOR_LEAP_PEND;
   }
   calc_leap_days(wn_lsf, dn, 10);
   have_leap_info = 33;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0xaecbb(%rip), %rdi     # 0x121c7a
callq 0x58dc2
callq 0x58b08
callq 0x58a30
callq 0x588d2
movl %eax, %ebx
callq 0x58a30
callq 0x588d2
callq 0x588d2
movl %eax, %r14d
leaq 0x29a74a(%rip), %rax    # 0x30d738
movzwl (%rax), %r12d
callq 0x588d2
movl %eax, %r15d
callq 0x588d2
xorl %ecx, %ecx
cmpw %ax, %bx
setne %cl
leaq 0x29a1ca(%rip), %rax    # 0x30d1d8
movl $0xffffff7f, %edx       # imm = 0xFFFFFF7F
andl (%rax), %edx
shll $0x7, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
movswl %r14w, %eax
cvtsi2sd %eax, %xmm1
andl $0xfc00, %r12d          # imm = 0xFC00
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
addsd %xmm1, %xmm0
movzwl %r15w, %edi
callq 0x5cbb3
leaq 0x29a251(%rip), %rax    # 0x30d298
movl $0x21, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_clock_bias()
void get_clock_bias()
{
float bias;
float bias_rate;
float time_of_fix;
static int last_tof = (-1);

   log_packet_id("Packet 0x54 (single sat clock bias)");

   bias = tsip_single();
   bias_rate = tsip_single();
   time_of_fix = tsip_single();
   check_tsip_end(1);
   if(tsip_error) return;

   if(last_tof != (int) time_of_fix) {
      if(SV6_FAMILY || PALISADE || (have_pri_time == 0)) {
         sv6_time_code(time_of_fix);
         sat_count = 1;
      }
      last_tof = (int) time_of_fix;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0xaea0b(%rip), %rdi     # 0x121c9c
callq 0x58dc2
callq 0x58a30
callq 0x58a30
callq 0x58a30
movss %xmm0, -0xc(%rbp)
xorl %edi, %edi
callq 0x58e9b
leaq 0x1cbcb8(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x7332f
cvttss2si -0xc(%rbp), %ebx
cmpl %ebx, 0xf72bc(%rip)     # 0x16a584
je 0x7332f
movss -0xc(%rbp), %xmm0
leaq 0x1a55fa(%rip), %rax    # 0x2188d0
movq (%rax), %rax
leaq 0x1a7cf4(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
cmpq $0x1, %rax
jne 0x732fa
leal -0x33(%rcx), %edx
cmpl $0x1d, %edx
ja 0x732fa
movl $0x20004009, %esi       # imm = 0x20004009
btl %edx, %esi
jb 0x73317
cmpq $0x1, %rax
sete %al
cmpl $0x50, %ecx
sete %cl
testb %cl, %al
jne 0x73317
leaq 0x1cbbc6(%rip), %rax    # 0x23eed8
cmpl $0x0, (%rax)
jne 0x73329
callq 0x73056
leaq 0x1cbbe9(%rip), %rax    # 0x23ef0c
movl $0x1, (%rax)
movl %ebx, 0xf7255(%rip)     # 0x16a584
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_last_fix_info()
void get_last_fix_info()
{
u08 source_of_fix;
u08 tracking_mode;
float time_of_fix;
u16 week_of_fix;

   log_packet_id("Packet 0x57 (last fix info)");

   source_of_fix = tsip_byte();
   tracking_mode = tsip_byte();
   time_of_fix = tsip_single();
   week_of_fix = tsip_word();
   check_tsip_end(1);
   if(tsip_error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xae81b(%rip), %rdi     # 0x121cfd
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x734fd
leaq 0x1cba76(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x73513
leaq 0x1cba60(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58a30
callq 0x588d2
xorl %edi, %edi
popq %rbp
jmp 0x58e9b
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tsip_utc(int, int)
void parse_tsip_utc(int prn, int len)
{
int i;
double a0;
float a1;
short delta_ls;
float tot;
double wn_lsf;
unsigned short wnt;
unsigned short dn;
short delta_lsf;
int wraps;

   for(i=4; i<=16; i++) {
      tsip_byte();
   }                      
   a0 = tsip_double();
   a1 = tsip_single();
   delta_ls = tsip_word();
   tot = tsip_single();
   wnt = tsip_word();
   wn_lsf = (double) (short) tsip_word();
   wraps = gps_week / 1024;
   wn_lsf += (wraps * 1024);
//      while(wn_lsf < (double) gps_week) {  // adjust for week rollovers
//         wn_lsf += 1024.0;
//      }
   dn = tsip_word();
   delta_lsf = tsip_word();

   calc_leap_days(wn_lsf, dn, 10);

//sprintf(plot_title, "dls:%d  wnlsf:%g  dn:%d  dlsf:%d   wks:%d  days:%d  %d/%d/%d", 
//delta_ls, wn_lsf, dn, delta_lsf, (int) wn_lsf-gps_week, leap_days, g_year,g_month,g_day);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl $0xd, %ebx
leaq 0x1cafc7(%rip), %r14    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x73fb9
orb $0x8, (%r14)
decl %ebx
jne 0x73fa9
callq 0x58b08
callq 0x58a30
callq 0x588d2
callq 0x58a30
callq 0x588d2
callq 0x588d2
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leaq 0x29974e(%rip), %rax    # 0x30d738
movzwl (%rax), %eax
andl $0xfc00, %eax           # imm = 0xFC00
cvtsi2sd %eax, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x18(%rbp)
callq 0x588d2
movl %eax, %ebx
callq 0x588d2
movzwl %bx, %edi
movsd -0x18(%rbp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x5cbb3
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_packet_58()
void get_packet_58()
{
int i;
u08 op;
u08 mode;
int prn;
u08 len;

   log_packet_id("Packet 0x58 (GPS system data)");
   op = tsip_byte();
   mode = tsip_byte();
   prn = tsip_byte();
   len = tsip_byte();

   // mode 2: almanac
   // mode 3: health page
   // mode 4: ionosphere
   // mode 5: UTC params
   // mode 6: ephemeris

   if(mode == 0x05) {  // UTC data
      parse_tsip_utc(prn, len);
   }
   else if(mode == 0x06) { // ephemeris
// if(debug_file) fprintf(debug_file, "get pkt 0x58: op:%d  mode:%d  prn:%d  len:%d\n", op,mode,prn,len);
      parse_tsip_ephem(prn, len);  // prn gotten from message contents
   }
   else {  // unsupported RAW data
      for(i=0; i<len; i++) {   //!!! we should probably process this data
         tsip_byte();
      }
   }

   check_tsip_end(1);
   if(tsip_error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xadceb(%rip), %rdi     # 0x121d19
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x74049
leaq 0x1caf2a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x74061
leaq 0x1caf12(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x74077
leaq 0x1caefc(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7408d
leaq 0x1caee6(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
cmpb $0x5, %bl
je 0x740a1
movzbl %bl, %ecx
cmpl $0x6, %ecx
jne 0x740a8
callq 0x7352b
jmp 0x740ca
callq 0x73f92
jmp 0x740ca
movzbl %al, %ebx
testl %ebx, %ebx
je 0x740ca
leaq 0x1caeba(%rip), %r14    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x740c6
orb $0x8, (%r14)
decl %ebx
jne 0x740b6
xorl %edi, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x58e9b
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_sat_health()
void get_sat_health()
{
u08 op;
u08 vals[1+32];
u08 i;
u32 val;

   log_packet_id("Packet 0x59 (Sat disable/health)");

   op = tsip_byte();
   if(op == 3) {  // sat selection enabled / disabled
      val = 0;
      for(i=1; i<=32; i++) {
         sat[i].disabled = tsip_byte();
         if(!sat[i].disabled) val |= 1 << (i-1);
      }
      sats_enabled = val;
   }
   else if(op == 6) {  // sat health enabled / disabled
      for(i=1; i<=32; i++) sat[i].forced_healthy = tsip_byte();
   }
   else if((op == 0) && (tsip_type == STARLOC_TYPE)) { // bogus packet!
      for(i=1; i<=31; i++) vals[i] = tsip_byte();  // note: 00 op plus 31 bytes of zeroes
   }
   else {  // unknown type field
      for(i=1; i<=32; i++) vals[i] = tsip_byte();
   }
   check_tsip_end(1);
   if(tsip_error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xadc4d(%rip), %rdi     # 0x121d37
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x74105
leaq 0x1cae6e(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
cmpb $0x3, %al
je 0x74151
movzbl %al, %ecx
cmpl $0x6, %ecx
jne 0x741af
movl $0x34a, %ebx            # imm = 0x34A
leaq 0x1cae8f(%rip), %r14    # 0x23efb0
leaq 0x1cae48(%rip), %r15    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x74138
orb $0x8, (%r15)
movb %al, (%r14,%rbx)
addq $0x348, %rbx            # imm = 0x348
cmpq $0x6c4a, %rbx           # imm = 0x6C4A
jne 0x74128
jmp 0x741fb
movl $0x349, %r14d           # imm = 0x349
addq 0xdbde2(%rip), %r14     # 0x14ff40
xorl %r15d, %r15d
leaq 0x1cae08(%rip), %r12    # 0x23ef70
xorl %ebx, %ebx
xorl %r13d, %r13d
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7417e
orb $0x8, (%r12)
movl $0x1, %edx
movl %ebx, %ecx
shll %cl, %edx
movb %al, (%r14)
testb %al, %al
cmovnel %r15d, %edx
orl %edx, %r13d
addq $0x348, %r14            # imm = 0x348
incq %rbx
cmpq $0x20, %rbx
jne 0x7416d
leaq 0x298f3a(%rip), %rax    # 0x30d0e4
movl %r13d, (%rax)
jmp 0x741fb
testb %al, %al
jne 0x741de
leaq 0x1a6e1a(%rip), %rax    # 0x21afd4
cmpl $0x53, (%rax)
jne 0x741de
movb $0x1f, %bl
leaq 0x1cada8(%rip), %r14    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x741d8
orb $0x8, (%r14)
decb %bl
jne 0x741c8
jmp 0x741fb
movb $0x20, %bl
leaq 0x1cad89(%rip), %r14    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x741f7
orb $0x8, (%r14)
decb %bl
jne 0x741e7
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x58e9b