LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c61e9(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x70e37
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2cb3da(%rip), %rbx    # 0x33c220
leaq 0xa4be3(%rip), %rsi     # 0x115a30
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x5ee52
leaq 0xb09ef(%rip), %rdi     # 0x12185a
movl $0x200, %esi            # imm = 0x200
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5ee52
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c6198(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x70e88
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2cb389(%rip), %rbx    # 0x33c220
leaq 0xb2d47(%rip), %rsi     # 0x123be5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x20d, %esi            # imm = 0x20D
callq 0x5ee52
leaq 0xb09a6(%rip), %rdi     # 0x121862
movl $0x20d, %esi            # imm = 0x20D
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5ee52
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c6147(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x70ed9
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 0x2cb327(%rip), %rbx    # 0x33c220
leaq 0xb299e(%rip), %rsi     # 0x12389e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0x32d, %esi            # imm = 0x32D
callq 0x5ee52
movl $0x1f8, %edi            # imm = 0x1F8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9d80
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c60db(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
jne 0x7105b
movapd 0x98230(%rip), %xmm1    # 0x109180
andpd %xmm0, %xmm1
movapd %xmm1, -0x40(%rbp)
ucomisd 0x9aa9f(%rip), %xmm1    # 0x10ba00
ja 0x7105b
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x9bf15(%rip), %rcx     # 0x10ce90
movsd (%rcx,%rax,8), %xmm1
movsd %xmm1, -0x48(%rbp)
leaq 0x1a9f54(%rip), %rax    # 0x21aee0
movsd %xmm0, (%rax)
leaq 0x1a9f19(%rip), %rax    # 0x21aeb0
movl $0x1, (%rax)
callq 0x6bcbc
movl $0x19, %r15d
leaq 0x29b811(%rip), %r12    # 0x30c7c0
leaq 0x29c27e(%rip), %r13    # 0x30d234
leaq 0x2cb263(%rip), %rbx    # 0x33c220
leaq 0xb2e84(%rip), %r14     # 0x123e48
xorpd %xmm0, %xmm0
movsd 0xad178(%rip), %xmm2    # 0x11e148
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 0xad153(%rip), %xmm0    # 0x11e150
movl $0x14d, (%r13)          # imm = 0x14D
divsd 0x9809b(%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 0x5ee52
movapd -0x40(%rbp), %xmm1
addsd 0xad120(%rip), %xmm1    # 0x11e158
subl $0x1, %r15d
setb %al
movapd %xmm1, -0x40(%rbp)
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
movsd -0x50(%rbp), %xmm0
jae 0x7105b
testb %al, %al
je 0x70fc8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: 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 0x2c5fa5(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x7107c
popq %rbp
retq
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpnlesd %xmm1, %xmm2
andpd %xmm2, %xmm0
movsd 0x9a88b(%rip), %xmm1    # 0x10b920
andnpd %xmm1, %xmm2
orpd %xmm0, %xmm2
minsd %xmm2, %xmm1
leaq 0x1a9c80(%rip), %rax    # 0x21ad28
movl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x1a9d6a(%rip), %rax    # 0x21ae20
movsd %xmm1, (%rax)
leaq 0x29c0ef(%rip), %rax    # 0x30d1b0
movsd %xmm1, (%rax)
leaq 0x29c074(%rip), %rax    # 0x30d140
movsd %xmm1, (%rax)
leaq 0x29cd25(%rip), %rax    # 0x30ddfc
orb $0x2, 0x1(%rax)
leaq 0x1a9e2e(%rip), %rax    # 0x21af10
movsd %xmm1, (%rax)
leaq 0x1a9e0f(%rip), %rax    # 0x21aefc
movl %ecx, (%rax)
popq %rbp
jmp 0x6bcbc
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c5f17(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x7110d
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 0x1a9bf7(%rip), %rax    # 0x21ad20
movl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x1a9ccd(%rip), %rax    # 0x21ae04
movl %ebx, (%rax)
cvtsi2sd %ebx, %xmm0
leaq 0x29c034(%rip), %rax    # 0x30d178
movsd %xmm0, (%rax)
leaq 0x29bfa1(%rip), %rax    # 0x30d0f0
movsd %xmm0, (%rax)
leaq 0x29cca2(%rip), %rax    # 0x30ddfc
orb $0x1, (%rax)
leaq 0x1a9dc4(%rip), %rax    # 0x21af28
xorl %edx, %edx
movl %edx, (%rax)
movq %rdx, 0x3055c1(%rip)    # 0x376730
movl %edx, 0x308bbb(%rip)    # 0x379d30
movl %edx, 0x308bb9(%rip)    # 0x379d34
movq %rdx, 0x308ba6(%rip)    # 0x379d28
movq %rdx, 0x308baf(%rip)    # 0x379d38
leaq 0x1a9d8c(%rip), %rax    # 0x21af1c
movl %ebx, (%rax)
leaq 0x1a9d5b(%rip), %rax    # 0x21aef4
movl %ecx, (%rax)
callq 0x6bcbc
callq 0x6cc14
testl %eax, %eax
je 0x71108
leaq 0x2cb06c(%rip), %r14    # 0x33c220
leaq 0xb2cb6(%rip), %rsi     # 0x123e71
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 0x5ee52
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c5e35(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x711f1
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x1a9b2c(%rip), %rax    # 0x21ad24
movl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x1a9c12(%rip), %rax    # 0x21ae18
movsd %xmm0, (%rax)
leaq 0x29bf6f(%rip), %rax    # 0x30d180
movsd %xmm0, (%rax)
leaq 0x29cbe0(%rip), %rax    # 0x30ddfc
orb $0x2, (%rax)
leaq 0x1a9ce2(%rip), %rax    # 0x21af08
movsd %xmm0, (%rax)
leaq 0x1a9cc7(%rip), %rax    # 0x21aef8
movl %ecx, (%rax)
movsd %xmm0, -0x10(%rbp)
callq 0x6bcbc
callq 0x6cc14
movsd -0x10(%rbp), %xmm0
testl %eax, %eax
je 0x711ea
leaq 0x2cafce(%rip), %rbx    # 0x33c220
leaq 0xb2c10(%rip), %rsi     # 0x123e69
movq %rbx, %rdi
movb $0x1, %al
callq 0x9060
movq %rbx, %rdi
movl $0x2cc, %esi            # imm = 0x2CC
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5ee52
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c5d99(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x71288
popq %rbp
retq
testl %edi, %edi
movl $0x78, %eax
cmovgl %edi, %eax
leaq 0x1a9a93(%rip), %rcx    # 0x21ad2c
movl $0x1, %edx
movl %edx, (%rcx)
leaq 0x1a9b61(%rip), %rcx    # 0x21ae08
movl %eax, (%rcx)
leaq 0x29bf18(%rip), %rcx    # 0x30d1c8
movl %eax, (%rcx)
leaq 0x29cb43(%rip), %rcx    # 0x30ddfc
orb $0x20, 0x1(%rcx)
leaq 0x1a9c54(%rip), %rcx    # 0x21af18
movl %eax, (%rcx)
leaq 0x1a9c33(%rip), %rax    # 0x21af00
movl %edx, (%rax)
popq %rbp
jmp 0x6bcbc
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1cdc5e(%rip), %rax    # 0x23ef3e
leaq 0x2c5d39(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
je 0x712ef
popq %rbp
retq
leaq 0x1a75da(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x1f, %rax
jle 0x71322
cmpq $0x20, %rax
je 0x7135f
cmpq $0x80, %rax
je 0x7137b
cmpq $0x20000000, %rax       # imm = 0x20000000
jne 0x712ed
leaq 0xb0561(%rip), %rdi     # 0x12187d
popq %rbp
jmp 0x5f070
cmpq $0x1, %rax
je 0x7138e
cmpq $0x4, %rax
jne 0x712ed
leaq 0x29c07f(%rip), %rax    # 0x30d3b4
movl (%rax), %eax
cmpl $0x2, %eax
je 0x7140b
cmpl $0x1, %eax
je 0x71356
movl $0x63d, %edi            # imm = 0x63D
xorl %esi, %esi
callq 0x5f3f5
callq 0x5f4ce
movw $0x61d, %ax             # imm = 0x61D
jmp 0x7140f
leaq 0xafa8c(%rip), %rdi     # 0x120df2
callq 0x61694
movl $0xff, %edi
callq 0x591af
popq %rbp
jmp 0x6170f
leaq 0x2cca72(%rip), %rax    # 0x33ddf4
cmpl $0x0, (%rax)
je 0x713f6
movl $0x23, %edi
jmp 0x713fb
leaq 0x1a9c3f(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
movl %ecx, %esi
xorl $0x41, %esi
leaq 0x1a7555(%rip), %rdx    # 0x2188f8
movl (%rdx), %edx
movl %edx, %edi
xorl $0x47, %edi
orl %esi, %edi
je 0x712ed
cmpl $0x41, %ecx
jne 0x713c9
cmpl $0x33, %edx
je 0x712ed
cmpl $0x47, %edx
je 0x712ed
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
testb %dl, %sil
je 0x71430
movl $0x8e, %edi
callq 0x5e740
movl $0xa9, %edi
callq 0x591af
popq %rbp
jmp 0x5e7c0
movl $0x44, %edi
movl $0x1, %esi
callq 0x5fbb4
popq %rbp
jmp 0x61bc3
movw $0x63d, %ax             # imm = 0x63D
movzwl %ax, %edi
xorl %esi, %esi
callq 0x5f3f5
callq 0x5f4ce
movl $0xd04, %edi            # imm = 0xD04
xorl %esi, %esi
callq 0x5f3f5
popq %rbp
jmp 0x5f4ce
cmpq $0x1, %rax
sete %dl
cmpl $0x50, %ecx
sete %sil
testb %sil, %dl
jne 0x712ed
cmpq $0x1, %rax
jne 0x713dc
addl $-0x33, %ecx
cmpl $0x1d, %ecx
ja 0x713dc
movl $0x20004009, %eax       # imm = 0x20004009
btl %ecx, %eax
jb 0x712ed
jmp 0x713dc
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c5b9f(%rip), %rax    # 0x33701a
leaq 0x1cdabc(%rip), %rcx    # 0x23ef3e
movb (%rcx), %cl
orb (%rax), %cl
setne %cl
leaq 0x1a7440(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x20000000, %rax       # imm = 0x20000000
sete %dl
orb %cl, %dl
je 0x714ab
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %edi, %r14d
cmpq $0x1, %rax
je 0x71531
cmpq $0x800, %rax            # imm = 0x800
je 0x714ed
cmpq $0x20, %rax
jne 0x714a0
leaq 0xaf929(%rip), %rdi     # 0x120df2
callq 0x61694
xorl %eax, %eax
testb %r14b, %r14b
setne %al
leal (%rax,%rax,2), %edi
callq 0x591af
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6170f
cmpl $0x15, %ebx
movl $0x14, %r14d
cmovael %ebx, %r14d
movl $0x5a0, %eax            # imm = 0x5A0
cmpl %eax, %r14d
cmovael %eax, %r14d
movl $0x1d, %edi
callq 0x5e740
movl $0x6, %edi
callq 0x591af
movl %r14d, %edi
callq 0x5936c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5e844
movl %esi, %r15d
leaq 0x1a9a99(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
movl %ecx, %esi
xorl $0x41, %esi
leaq 0x1a73af(%rip), %rdx    # 0x2188f8
movl (%rdx), %edx
movl %edx, %edi
xorl $0x47, %edi
orl %esi, %edi
je 0x71576
cmpl $0x41, %ecx
jne 0x71563
cmpl $0x33, %edx
je 0x71576
cmpl $0x47, %edx
je 0x71576
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
testb %dl, %sil
je 0x715b9
movl $0x8e, %edi
callq 0x5e740
movl $0xa9, %edi
callq 0x591af
movzbl %r14b, %edi
callq 0x591af
movzbl %r15b, %edi
callq 0x591af
movl %ebx, %edi
callq 0x593b5
xorl %edi, %edi
callq 0x593b5
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5e7c0
cmpq $0x1, %rax
sete %dl
cmpl $0x50, %ecx
sete %sil
testb %sil, %dl
jne 0x714a0
cmpq $0x1, %rax
jne 0x71576
addl $-0x33, %ecx
cmpl $0x1d, %ecx
ja 0x71576
movl $0x20004009, %eax       # imm = 0x20004009
btl %ecx, %eax
jb 0x714a0
jmp 0x71576
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1cd5f4(%rip), %rax    # 0x23ef3e
leaq 0x2c56cf(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
setne %al
leaq 0x1a6f71(%rip), %rcx    # 0x2188d0
movq (%rcx), %rcx
cmpq $0x1, %rcx
setne %dl
orb %al, %dl
je 0x7196e
retq
leaq 0x1a965f(%rip), %rax    # 0x21afd4
movl (%rax), %eax
movl %eax, %esi
xorl $0x41, %esi
leaq 0x1a6f75(%rip), %rdx    # 0x2188f8
movl (%rdx), %edx
movl %edx, %edi
xorl $0x47, %edi
orl %esi, %edi
je 0x719b0
cmpl $0x41, %eax
jne 0x7199d
cmpl $0x33, %edx
je 0x719b0
cmpl $0x47, %edx
je 0x719b0
cmpl $0x41, %eax
sete %dl
cmpq $0x1, %rcx
sete %sil
testb %dl, %sil
je 0x719d8
pushq %rbp
movq %rsp, %rbp
movl $0x8e, %edi
callq 0x5e740
movl $0xab, %edi
callq 0x591af
movl $0x2, %edi
callq 0x591af
popq %rbp
jmp 0x5e7c0
cmpq $0x1, %rcx
sete %dl
cmpl $0x50, %eax
sete %sil
testb %sil, %dl
jne 0x7196d
cmpq $0x1, %rcx
jne 0x719b0
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x719b0
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jb 0x7196d
jmp 0x719b0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1cd52e(%rip), %rax    # 0x23ef3e
leaq 0x2c5609(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
setne %al
leaq 0x1a6eab(%rip), %rcx    # 0x2188d0
movq (%rcx), %rcx
cmpq $0x1, %rcx
setne %dl
orb %al, %dl
je 0x71a34
retq
leaq 0x1a9599(%rip), %rax    # 0x21afd4
movl (%rax), %eax
movl %eax, %esi
xorl $0x41, %esi
leaq 0x1a6eaf(%rip), %rdx    # 0x2188f8
movl (%rdx), %edx
movl %edx, %edi
xorl $0x47, %edi
orl %esi, %edi
je 0x71a76
cmpl $0x41, %eax
jne 0x71a63
cmpl $0x33, %edx
je 0x71a76
cmpl $0x47, %edx
je 0x71a76
cmpl $0x41, %eax
sete %dl
cmpq $0x1, %rcx
sete %sil
testb %dl, %sil
je 0x71a9e
pushq %rbp
movq %rsp, %rbp
movl $0x8e, %edi
callq 0x5e740
movl $0xac, %edi
callq 0x591af
movl $0x2, %edi
callq 0x591af
popq %rbp
jmp 0x5e7c0
cmpq $0x1, %rcx
sete %dl
cmpl $0x50, %eax
sete %sil
testb %sil, %dl
jne 0x71a33
cmpq $0x1, %rcx
jne 0x71a76
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x71a76
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jb 0x71a33
jmp 0x71a76
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1cd462(%rip), %rax    # 0x23ef3e
leaq 0x2c553d(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
setne %al
leaq 0x1a6ddf(%rip), %rcx    # 0x2188d0
movq (%rcx), %rcx
cmpq $0x1, %rcx
setne %dl
orb %al, %dl
jne 0x71b60
movl %edi, %ebx
leaq 0x1a94cc(%rip), %rax    # 0x21afd4
movl (%rax), %eax
movl %eax, %esi
xorl $0x41, %esi
leaq 0x1a6de2(%rip), %rdx    # 0x2188f8
movl (%rdx), %edx
movl %edx, %edi
xorl $0x47, %edi
orl %esi, %edi
je 0x71b60
cmpl $0x41, %eax
jne 0x71b30
cmpl $0x33, %edx
je 0x71b60
cmpl $0x47, %edx
je 0x71b60
cmpl $0x41, %eax
sete %dl
cmpl $0x50, %eax
sete %sil
cmpq $0x1, %rcx
jne 0x71b48
orb %sil, %dl
jne 0x71b60
cmpq $0x1, %rcx
jne 0x71b67
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x71b67
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x71b67
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x8e, %edi
callq 0x5e740
movl $0xae, %edi
callq 0x591af
movzbl %bl, %edi
callq 0x591af
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5e7c0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaf908(%rip), %rdi     # 0x1219ab
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x720be
leaq 0x1cceb5(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58aae
callq 0x588f0
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
xorl %edi, %edi
popq %rbp
jmp 0x58f50
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaeff3(%rip), %rdi     # 0x121a65
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72a8d
leaq 0x1cc4e6(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x72aa5
leaq 0x1cc4ce(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
xorl %edi, %edi
callq 0x58f50
leaq 0x1cc4bd(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x72b50
leaq 0x29a945(%rip), %rax    # 0x30d408
orb $0x4, (%rax)
callq 0x5e1a6
leaq 0x1a5e2e(%rip), %rax    # 0x218900
orb $0x1, (%rax)
leaq 0x1a5df4(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x72b50
leaq 0x1a84eb(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x72b50
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x72b50
leaq 0x29a7a4(%rip), %rcx    # 0x30d2a8
movl $0x21, %eax
movl %eax, (%rcx)
leaq 0x29a6be(%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 0x29a69d(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
andl $-0x7, %edx
andl $0x6, %ebx
orl %edx, %ebx
movl %ebx, (%rcx)
leaq 0x29a6de(%rip), %rcx    # 0x30d22c
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaed34(%rip), %rdi     # 0x121a9e
callq 0x58e77
xorl %ebx, %ebx
leaq 0x2c8cc8(%rip), %r14    # 0x33ba40
leaq 0x1cc1f1(%rip), %r15    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72d8f
orb $0x8, (%r15)
movb %al, (%r14,%rbx)
incq %rbx
cmpq $0x16, %rbx
jne 0x72d7f
movb $0x0, 0x16(%r14)
leaq 0x1cb5e8(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x72dcf
leaq 0xaed08(%rip), %rsi     # 0x121abf
leaq 0x2c8c82(%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_O1/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 0xaeced(%rip), %rdi     # 0x121ad8
callq 0x58e77
movl $0x348, %ebx            # imm = 0x348
leaq 0x1cc1b4(%rip), %r14    # 0x23efb0
leaq 0x1cc16d(%rip), %r15    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72e13
orb $0x8, (%r15)
testb %al, %al
setne (%r14,%rbx)
addq $0x348, %rbx            # imm = 0x348
cmpq $0x6c48, %rbx           # imm = 0x6C48
jne 0x72e03
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x58f50
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaec97(%rip), %rdi     # 0x121b10
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72e94
leaq 0x1cc0df(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x72eac
leaq 0x1cc0c7(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72ec2
leaq 0x1cc0b1(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
xorl %edi, %edi
callq 0x58f50
leaq 0x1cc0a0(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x72f5a
leaq 0x29a528(%rip), %rax    # 0x30d408
orb $0x8, (%rax)
callq 0x5e1a6
leaq 0x1a5a11(%rip), %rax    # 0x218900
orb $0x2, (%rax)
leaq 0x1a59d7(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x72f5a
leaq 0x1a80ce(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x72f5a
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x72f5a
leaq 0x29a2b7(%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 0x29a28d(%rip), %rcx    # 0x30d1d0
movl (%rcx), %edx
andl $-0x9, %edx
leal (%rdx,%rax,8), %eax
movl %eax, (%rcx)
leaq 0x29a354(%rip), %rax    # 0x30d2a8
movl $0x22, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaebbf(%rip), %rdi     # 0x121b2d
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72f89
leaq 0x1cbfea(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29a135(%rip), %rcx    # 0x30d0c5
movb %al, (%rcx)
callq 0x58aae
movss %xmm0, -0xc(%rbp)
callq 0x58aae
movss %xmm0, -0x10(%rbp)
callq 0x58aae
leaq 0x29a10a(%rip), %rax    # 0x30d0bc
movss %xmm0, (%rax)
leaq 0x29a10f(%rip), %rbx    # 0x30d0cc
orb $0x1, (%rbx)
callq 0x58aae
leaq 0x29a0f4(%rip), %rax    # 0x30d0c0
movss %xmm0, (%rax)
orb $0x2, (%rbx)
xorl %edi, %edi
callq 0x58f50
movss -0x10(%rbp), %xmm1
leaq 0x1cbf8a(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x73059
xorps %xmm0, %xmm0
cvtss2sd -0xc(%rbp), %xmm0
mulsd 0x9615d(%rip), %xmm0    # 0x109158
addsd 0x96065(%rip), %xmm0    # 0x109068
cvttsd2si %xmm0, %eax
cmpl $0x5a, %eax
ja 0x7302b
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
leaq 0x29a09a(%rip), %rax    # 0x30d0b4
movss %xmm0, (%rax)
leaq 0x29a3d7(%rip), %rax    # 0x30d3fc
movl $0x1, (%rax)
xorpd %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jb 0x73059
movss 0x99fac(%rip), %xmm0    # 0x10cfe8
ucomiss %xmm1, %xmm0
jbe 0x73059
leaq 0x29a070(%rip), %rax    # 0x30d0b8
movss %xmm1, (%rax)
leaq 0x29a3a5(%rip), %rax    # 0x30d3f8
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaeae7(%rip), %rdi     # 0x121b56
callq 0x58e77
callq 0x58aae
movss %xmm0, -0x4(%rbp)
xorl %edi, %edi
callq 0x58f50
xorps %xmm0, %xmm0
cvtss2sd -0x4(%rbp), %xmm0
divsd 0x95fa3(%rip), %xmm0    # 0x109038
leaq 0x299724(%rip), %rax    # 0x30c7c0
movsd %xmm0, (%rax)
leaq 0x29a18d(%rip), %rax    # 0x30d234
movl $0x29a, %ecx            # imm = 0x29A
movl %ecx, (%rax)
leaq 0x29a193(%rip), %rax    # 0x30d248
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaeab2(%rip), %rdi     # 0x121b7a
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x730e3
leaq 0x1cbe90(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
xorl %edi, %edi
popq %rbp
jmp 0x58f50
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaea9d(%rip), %rdi     # 0x121b9a
callq 0x58e77
callq 0x58b86
callq 0x58aae
callq 0x588f0
movl %eax, %ebx
callq 0x58aae
callq 0x588f0
callq 0x588f0
movl %eax, %r14d
leaq 0x29a60c(%rip), %rax    # 0x30d738
movzwl (%rax), %r12d
callq 0x588f0
movl %eax, %r15d
callq 0x588f0
xorl %ecx, %ecx
cmpw %ax, %bx
setne %cl
leaq 0x29a08c(%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 0x5ccdb
leaq 0x29a113(%rip), %rax    # 0x30d298
movl $0x21, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: sv6_time_code(float)
void sv6_time_code(float time_of_fix)
{
double jd;

   if(time_of_fix < 0.0F) {
      time_flags |= TFLAGS_INVALID;
   }
   else if(ACU_GG || ACU_360 || ACUTIME) {
      time_flags &= (~TFLAGS_INVALID);
      if(ACU_GG) return;
      if(ACU_360) return;
      if(ACUTIME) return;
      request_gps_time();
      request_osc_offset();
   }
   else {
      time_flags &= (~TFLAGS_INVALID);

      jd = GPS_EPOCH + ((double) sv6_week * 7.0) + jtime(0,0,0,(double)time_of_fix);
//    jd = GPS_EPOCH + ((double) sv6_week * 7.0) + jtime(0,0,1,(double)sv6_tow);
      
      set_gregorian_time(jd);

if(0 && log_file) {
   fprintf(log_file, "!@ tof:%f  %02d:%02d:%02d %f  ", time_of_fix, g_hours,g_minutes,g_seconds, g_frac);
   if(log_flush_mode) fflush(log_file);
}

      if(timing_mode == TMODE_GPS) {    // convert utc time to gps time
//mmmmm         utc_to_gps();
      }
      else {
//mmmmm         adjust_rcvr_time(0.0);  // incorporarte possibly negative fractional second into time variables
      }

      update_gps_screen(666);

      request_gps_time();
      request_osc_offset();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x731b0
leaq 0x29a2f9(%rip), %rax    # 0x30d4a4
orb $0x4, (%rax)
jmp 0x731ea
leaq 0x1a5719(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
sete %cl
leaq 0x1a7e0f(%rip), %rax    # 0x21afd4
cmpl $0x41, (%rax)
sete %al
andb %cl, %al
leaq 0x1a5724(%rip), %rcx    # 0x2188f8
movl (%rcx), %ecx
cmpl $0x47, %ecx
sete %dl
andb %al, %dl
je 0x731f0
leaq 0x29a2bd(%rip), %rax    # 0x30d4a4
andb $-0x5, (%rax)
addq $0x10, %rsp
popq %rbp
retq
testb %al, %al
je 0x73224
cmpl $0x33, %ecx
je 0x73202
cmpl $0x47, %ecx
je 0x73202
testb %al, %al
je 0x73224
leaq 0x29a29b(%rip), %rsi    # 0x30d4a4
andb $-0x5, (%rsi)
testb %dl, %dl
jne 0x731ea
testb %al, %al
je 0x7326f
cmpl $0x33, %ecx
je 0x731ea
cmpl $0x47, %ecx
je 0x731ea
testb %al, %al
jne 0x731ea
jmp 0x7326f
leaq 0x29a279(%rip), %rax    # 0x30d4a4
andb $-0x5, (%rax)
movzwl 0x2f8bd3(%rip), %eax    # 0x36be08
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd 0x986bc(%rip), %xmm1    # 0x10b900
addsd 0x9863c(%rip), %xmm1    # 0x10b888
movsd %xmm1, -0x8(%rbp)
cvtss2sd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd41e0
addsd -0x8(%rbp), %xmm0
callq 0x5c837
callq 0x7327e
callq 0x663e9
addq $0x10, %rsp
popq %rbp
jmp 0x61484
// File: /workspace/github_cpp_makefile_star2_O1/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 0xae78c(%rip), %rdi     # 0x121bbc
callq 0x58e77
callq 0x58aae
callq 0x58aae
callq 0x58aae
movss %xmm0, -0xc(%rbp)
xorl %edi, %edi
callq 0x58f50
leaq 0x1cbb19(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x734d5
cvttss2si -0xc(%rbp), %ebx
cmpl %ebx, 0xf711d(%rip)     # 0x16a584
je 0x734d5
movss -0xc(%rbp), %xmm0
leaq 0x1a545b(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x1, %rax
jne 0x73499
leaq 0x1a7b4f(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
addl $-0x33, %ecx
cmpl $0x1d, %ecx
ja 0x73499
movl $0x20004009, %edx       # imm = 0x20004009
btl %ecx, %edx
jb 0x734bd
cmpq $0x1, %rax
sete %al
leaq 0x1a7b2d(%rip), %rcx    # 0x21afd4
cmpl $0x50, (%rcx)
sete %cl
testb %cl, %al
jne 0x734bd
leaq 0x1cba20(%rip), %rax    # 0x23eed8
cmpl $0x0, (%rax)
jne 0x734cf
callq 0x73194
leaq 0x1cba43(%rip), %rax    # 0x23ef0c
movl $0x1, (%rax)
movl %ebx, 0xf70af(%rip)     # 0x16a584
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xae57c(%rip), %rdi     # 0x121c1d
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x736bc
leaq 0x1cb8b7(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x736d2
leaq 0x1cb8a1(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58aae
callq 0x588f0
xorl %edi, %edi
popq %rbp
jmp 0x58f50
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1cadf4(%rip), %r14    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x7418c
orb $0x8, (%r14)
decl %ebx
jne 0x7417c
callq 0x58b86
callq 0x58aae
callq 0x588f0
callq 0x58aae
callq 0x588f0
callq 0x588f0
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leaq 0x29957b(%rip), %rax    # 0x30d738
movzwl (%rax), %eax
andl $0xfc00, %eax           # imm = 0xFC00
cvtsi2sd %eax, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x18(%rbp)
callq 0x588f0
movl %eax, %ebx
callq 0x588f0
movzwl %bx, %edi
movsd -0x18(%rbp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x5ccdb
// File: /workspace/github_cpp_makefile_star2_O1/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 0xada38(%rip), %rdi     # 0x121c39
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x7421c
leaq 0x1cad57(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x74235
leaq 0x1cad3e(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x7424b
leaq 0x1cad28(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x74263
leaq 0x1cad10(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
cmpb $0x5, %r14b
je 0x74279
movzbl %r14b, %eax
cmpl $0x6, %eax
jne 0x74280
callq 0x736ea
jmp 0x742a3
callq 0x74165
jmp 0x742a3
andl $0xff, %ebx
je 0x742a3
leaq 0x1cace1(%rip), %r14    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x7429f
orb $0x8, (%r14)
decl %ebx
jne 0x7428f
xorl %edi, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x58f50
// File: /workspace/github_cpp_makefile_star2_O1/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 0xad994(%rip), %rdi     # 0x121c57
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x742de
leaq 0x1cac95(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
cmpb $0x3, %al
je 0x7432a
movzbl %al, %ecx
cmpl $0x6, %ecx
jne 0x74388
movl $0x34a, %ebx            # imm = 0x34A
leaq 0x1cacb6(%rip), %r14    # 0x23efb0
leaq 0x1cac6f(%rip), %r15    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x74311
orb $0x8, (%r15)
movb %al, (%r14,%rbx)
addq $0x348, %rbx            # imm = 0x348
cmpq $0x6c4a, %rbx           # imm = 0x6C4A
jne 0x74301
jmp 0x743d4
movl $0x349, %r14d           # imm = 0x349
addq 0xdbc09(%rip), %r14     # 0x14ff40
xorl %r15d, %r15d
leaq 0x1cac2f(%rip), %r12    # 0x23ef70
xorl %ebx, %ebx
xorl %r13d, %r13d
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x74357
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 0x74346
leaq 0x298d61(%rip), %rax    # 0x30d0e4
movl %r13d, (%rax)
jmp 0x743d4
testb %al, %al
jne 0x743b7
leaq 0x1a6c41(%rip), %rax    # 0x21afd4
cmpl $0x53, (%rax)
jne 0x743b7
movb $0x1f, %bl
leaq 0x1cabcf(%rip), %r14    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x743b1
orb $0x8, (%r14)
decb %bl
jne 0x743a1
jmp 0x743d4
movb $0x20, %bl
leaq 0x1cabb0(%rip), %r14    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x743d0
orb $0x8, (%r14)
decb %bl
jne 0x743c0
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x58f50
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: get_eph_status()
void get_eph_status()
{
int prn;

   log_packet_id("Packet 0x5B (Sat ephemeris status)");

   prn = tsip_byte();
if(0 && debug_file) fprintf(debug_file, "\neph status %02d\n", prn);  //rnx3
   if((prn == 0) && (tsip_type == STARLOC_TYPE)) {  // bogus message
      for(prn=1; prn<=15; prn++) tsip_byte();
   }
   else {
      if(prn > MAX_PRN) prn = 0;  // !!!! max_sat_check - put any bogus data in unused entry in array
      if(prn < 1) prn = 0;  // !!!! max_sat_check - put any bogus data in unused entry in array

      sat[prn].eph_time = tsip_single();
      sat[prn].eph_health = tsip_byte();
      sat[prn].iode = (u08) tsip_byte();
      sat[prn].toe = tsip_single();
      sat[prn].fit_flag = tsip_byte();
      sat[prn].sv_accuracy = tsip_single();
      check_tsip_end(1);

      if(have_accu == 0) need_redraw = 2004;
      have_accu = 1;
if(0 && debug_file) {
   gregorian(0, jd_utc);
   fprintf(debug_file, "got eph status %d: %02d/%02d/%02d\n", prn, g_hours,g_minutes,g_seconds);
}
   }
   if(tsip_error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xad6ee(%rip), %rdi     # 0x121c9b
callq 0x58e77
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x745ca
leaq 0x1ca9a9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
testb %bl, %bl
jne 0x745ff
leaq 0x1a69ff(%rip), %rax    # 0x21afd4
cmpl $0x53, (%rax)
jne 0x745ff
movl $0xf, %ebx
leaq 0x1ca98a(%rip), %r14    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x745f6
orb $0x8, (%r14)
decl %ebx
jne 0x745e6
jmp 0x746b6
callq 0x58aae
movzbl %bl, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
leaq 0x1ca99b(%rip), %rcx    # 0x23efb0
leaq (%rcx,%rax), %rbx
movss %xmm0, 0x1ec(%rcx,%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x74638
leaq 0x1ca93b(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x1f0(%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x74654
leaq 0x1ca91f(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x1f1(%rbx)
callq 0x58aae
movss %xmm0, 0x1f4(%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x7467d
leaq 0x1ca8f6(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x1f8(%rbx)
callq 0x58aae
movss %xmm0, 0x1fc(%rbx)
xorl %edi, %edi
callq 0x58f50
leaq 0x298d22(%rip), %rax    # 0x30d3c0
cmpl $0x0, (%rax)
jne 0x746b0
leaq 0x1a419a(%rip), %rcx    # 0x218844
movl $0x7d4, (%rcx)          # imm = 0x7D4
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
retq