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

   // find the next reading that we can poll for

   for(i=0; i<NUM_SENSORS; i++) { 
      if(last_enviro == 0) next_enviro = ENV_TEMP1;
      else if(next_enviro == 0) next_enviro = ENV_TEMP1;
      else next_enviro <<= 1;
      if(next_enviro & (0x0001 << NUM_SENSORS)) next_enviro = ENV_TEMP1;

      if(next_enviro & enviro_sensors) {  // the device supports this reading
         return next_enviro;
      }
   }

   next_enviro = 0;     // device has no known supported readings
   return next_enviro;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x166cca(%rip), %rax    # 0x202924
movl (%rax), %ecx
leaq 0x166cbd(%rip), %rax    # 0x202920
movl (%rax), %esi
leaq 0x166cbc(%rip), %rdx    # 0x202928
movl (%rdx), %eax
movl $0xc, %edi
movl $0x1, %r8d
decl %edi
je 0x9bca3
testl %ecx, %ecx
je 0x9bc94
testl %eax, %eax
je 0x9bc94
btl $0xa, %eax
leal (%rax,%rax), %eax
cmovbl %r8d, %eax
movl %eax, (%rdx)
jmp 0x9bc9d
movl $0x1, (%rdx)
movl %r8d, %eax
testl %eax, %esi
je 0x9bc79
jmp 0x9bca8
andl $0x0, (%rdx)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_lfs_type()
int set_lfs_type()
{
   enviro_field[UNIT_LEN] = 0;
   strcpy(enviro_dev, enviro_field);
   have_info |= (MANUF_PARAMS | PRODN_PARAMS | VERSION_INFO);

   if(strstr(enviro_field, "LFS104A")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_DP | ENV_LUX | ENV_REFALT);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS104B")) {  // LFS104BW
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID | ENV_PRESS | ENV_EMIS);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108A")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_RTEMP);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108B")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_DP);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108C")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108D")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108E")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_COUNT);
      enviro_type = LFS_ENVIRO;
   }
   else return 0;

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movb $0x0, 0x2ba7ab(%rip)    # 0x356462
leaq 0x2ba792(%rip), %rbx    # 0x356450
leaq 0x28b59b(%rip), %rdi    # 0x327260
movq %rbx, %rsi
callq 0x9330
leaq 0x25bca0(%rip), %rax    # 0x2f7974
orb $0x7, (%rax)
leaq 0x74530(%rip), %rsi     # 0x11020e
movq %rbx, %rdi
callq 0x9090
movl $0x1b3, %ebx            # imm = 0x1B3
testq %rax, %rax
jne 0x9bd44
leaq 0x2ba759(%rip), %rdi    # 0x356450
leaq 0x74518(%rip), %rsi     # 0x110216
callq 0x9090
movl $0x41f, %ebx            # imm = 0x41F
testq %rax, %rax
jne 0x9bd44
leaq 0x2ba73c(%rip), %rdi    # 0x356450
leaq 0x74503(%rip), %rsi     # 0x11021e
callq 0x9090
testq %rax, %rax
je 0x9bd29
pushq $0x51
jmp 0x9bd43
leaq 0x2ba720(%rip), %rdi    # 0x356450
leaq 0x744ef(%rip), %rsi     # 0x110226
callq 0x9090
testq %rax, %rax
je 0x9bd64
pushq $0x33
popq %rbx
leaq 0x166bd5(%rip), %rax    # 0x202920
movl %ebx, (%rax)
leaq 0x166bc0(%rip), %rax    # 0x202914
movl $0x3, (%rax)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2ba6e5(%rip), %rdi    # 0x356450
leaq 0x744bc(%rip), %rsi     # 0x11022e
callq 0x9090
pushq $0x17
popq %rbx
testq %rax, %rax
jne 0x9bd44
leaq 0x2ba6ca(%rip), %rdi    # 0x356450
leaq 0x744a9(%rip), %rsi     # 0x110236
callq 0x9090
testq %rax, %rax
jne 0x9bd44
leaq 0x2ba6b2(%rip), %rdi    # 0x356450
leaq 0x74499(%rip), %rsi     # 0x11023e
callq 0x9090
movl $0x211, %ebx            # imm = 0x211
testq %rax, %rax
jne 0x9bd44
xorl %eax, %eax
jmp 0x9bd5d
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: detect_enviro_type()
void detect_enviro_type()
{
   // figure up the sensor type and what readings it can do

   enviro_sensors = ENV_TEMP1;   // assume everybody does temperature
   if(strstr(enviro_field, "$PLHEN")) {  // custom Heather BME280 + two thermistors
      enviro_sensors = (ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID | ENV_PRESS);
      enviro_type = HEATHER_ENVIRO;
   }
   else if(strstr(enviro_field, "USB-")) {   // dogratian.com USB devices
      enviro_field[UNIT_LEN] = 0;
      strcpy(enviro_dev, enviro_field);
      have_info |= (MANUF_PARAMS | PRODN_PARAMS | VERSION_INFO);

      if(strstr(enviro_field, "PA")) {  // see what measurements it does
         enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_HUMID | ENV_PRESS);
         enviro_type = DOG_ENVIRO;
      }
      else if(strstr(enviro_field, "SHT")) {
         enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_HUMID);
         enviro_type = DOG_ENVIRO;
      }
      else if(strstr(enviro_field, "LM75")) {
         enviro_sensors = (ENV_SN | ENV_TEMP1);
         enviro_type = DOG_ENVIRO;
      }
   }
   else if(strstr(enviro_field, "LFS10")) {
      set_lfs_type();
   }

   next_enviro = 0;  // start the polling cycle
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x166b5a(%rip), %r14    # 0x202920
movl $0x1, (%r14)
leaq 0x2ba67c(%rip), %rdi    # 0x356450
leaq 0x7446b(%rip), %rsi     # 0x110246
callq 0x9090
testq %rax, %rax
je 0x9bdfe
movl $0xf, (%r14)
leaq 0x166b21(%rip), %rax    # 0x202914
movl $0x2, (%rax)
jmp 0x9bec6
leaq 0x2ba64b(%rip), %rdi    # 0x356450
leaq 0x74441(%rip), %rsi     # 0x11024d
callq 0x9090
testq %rax, %rax
je 0x9be5a
movb $0x0, 0x2ba645(%rip)    # 0x356462
leaq 0x2ba62c(%rip), %rbx    # 0x356450
leaq 0x28b435(%rip), %rdi    # 0x327260
movq %rbx, %rsi
callq 0x9330
leaq 0x25bb3a(%rip), %rax    # 0x2f7974
orb $0x7, (%rax)
leaq 0x7440e(%rip), %rsi     # 0x110252
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x9be79
movl $0x1d, (%r14)
jmp 0x9beb9
leaq 0x2ba5ef(%rip), %rdi    # 0x356450
leaq 0x743f6(%rip), %rsi     # 0x11025e
callq 0x9090
testq %rax, %rax
je 0x9bec6
callq 0x9bcaa
jmp 0x9bec6
leaq 0x2ba5d0(%rip), %rdi    # 0x356450
leaq 0x743ce(%rip), %rsi     # 0x110255
callq 0x9090
testq %rax, %rax
je 0x9be9a
movl $0x15, (%r14)
jmp 0x9beb9
leaq 0x2ba5af(%rip), %rdi    # 0x356450
leaq 0x743b1(%rip), %rsi     # 0x110259
callq 0x9090
testq %rax, %rax
je 0x9bec6
movl $0x11, (%r14)
leaq 0x166a54(%rip), %rax    # 0x202914
movl $0x1, (%rax)
leaq 0x166a5b(%rip), %rax    # 0x202928
andl $0x0, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_heather_enviro(unsigned int, int)
void decode_heather_enviro(unsigned port, int i)
{
   // decode Heather sensor values.  No need to poll for the next readings

   enviro_type = HEATHER_ENVIRO;
   if(get_enviro_field()) {  // humidity
      parse_humidity();
   }
   if(get_enviro_field()) {  // pressure
      parse_pressure();
   }
   if(get_enviro_field()) {  // BME280 temp sensor (room temp) (not currently used)
      parse_temp0();
   }
   if(get_enviro_field()) {  // thermistor 1
      parse_temp1();
      save_temp1();
   }
   if(get_enviro_field()) {  // thermistor 2
      parse_temp2();
   }
   if(get_enviro_field()) {  // ADC channel 3
//lfs parse_adc3();
   }
   if(get_enviro_field()) {  // ADC channel 4
//lfs parse_adc4();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x166550(%rip), %rax    # 0x202914
movl $0x2, (%rax)
callq 0x9b7a1
testl %eax, %eax
je 0x9c3d8
callq 0x9b823
callq 0x9b7a1
testl %eax, %eax
je 0x9c3e6
callq 0x9b864
callq 0x9b7a1
testl %eax, %eax
je 0x9c3f4
callq 0x9b8a5
callq 0x9b7a1
testl %eax, %eax
je 0x9c407
callq 0x9b8e6
callq 0x9bbf2
callq 0x9b7a1
testl %eax, %eax
je 0x9c415
callq 0x9b927
callq 0x9b7a1
popq %rbp
jmp 0x9b7a1
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_dac_value(double)
int send_dac_value(double val)
{
unsigned i;

   // send a value to the external DAC port
   if(dac_port_open() == 0) return 0;


   sprintf(out, "%.6f", val);
   sendout(DAC_PORT, '$', ADD_CHAR);
   for(i=0; i<strlen(out); i++) {
      sendout(DAC_PORT, out[i], ADD_CHAR);
   }
   sendout(DAC_PORT, 0x0D, ADD_CHAR);
   sendout(DAC_PORT, 0x0A, EOM);

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x25b7bf(%rip), %rax    # 0x2f82e0
xorl %ebx, %ebx
cmpl $0x0, 0x24834(%rax)
je 0x9cba6
cmpl $0x0, 0x24830(%rax)
jle 0x9cba6
leaq 0x2896e4(%rip), %rbx    # 0x326220
leaq 0x622a0(%rip), %rsi     # 0xfede3
movq %rbx, %rdi
movb $0x1, %al
callq 0x9060
pushq $0x10
popq %r14
pushq $0x24
popq %rsi
xorl %r15d, %r15d
movl %r14d, %edi
xorl %edx, %edx
callq 0xba3b
movl %r15d, %r15d
movq %rbx, %rdi
callq 0x9120
cmpq %r15, %rax
jbe 0x9cb85
movzbl (%rbx,%r15), %esi
movl %r14d, %edi
xorl %edx, %edx
callq 0xba3b
incl %r15d
jmp 0x9cb61
pushq $0x10
popq %r14
pushq $0xd
popq %rsi
movl %r14d, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0xa
popq %rsi
pushq $0x1
popq %rbx
movl %r14d, %edi
movl %ebx, %edx
callq 0xba3b
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_dac_field()
int get_dac_field()
{
char c;
int i;

   // extract the next field from a ADC message.  Fields are separated by
   // spaces or tabs.  

   dac_field[0] = 0;
   if(dac_msg[dac_col] == 0) return 0;  // at end-of-message

   i = 0;
   while(dac_col < (int)sizeof(dac_msg)) {   // get next field from the ADC message
      c = dac_msg[dac_col];
      if(c == 0) {  // reached end-of-message
         break;
      }
      else if(c == ' ') {  // skip leading spaces, end field on a space
         ++dac_col;
         if(i) break;
      }
      else if(c == '\t') {  // skip leading spaces, end field on a tab
         ++dac_col;
         if(i) break;
      }
      else {        // add char to extracted field
         dac_field[i++] = c;
         dac_field[i] = 0;
         ++dac_col;
      }
   }

   return dac_field[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x0, 0x2b9cb2(%rip)    # 0x356870
movslq 0x2b9eaf(%rip), %rax    # 0x356a74
leaq 0x2b9a94(%rip), %rcx    # 0x356660
cmpb $0x0, (%rax,%rcx)
je 0x9cc2c
xorl %esi, %esi
leaq 0x2b9c95(%rip), %rdx    # 0x356870
cmpl $0x200, %eax            # imm = 0x200
jg 0x9cc23
movslq %eax, %rdi
movzbl (%rdi,%rcx), %edi
cmpl $0x9, %edi
je 0x9cc12
cmpl $0x20, %edi
je 0x9cc12
testl %edi, %edi
je 0x9cc23
movslq %esi, %r8
leaq 0x1(%r8), %rsi
movb %dil, (%r8,%rdx)
movb $0x0, 0x1(%r8,%rdx)
incl %eax
movl %eax, 0x2b9e64(%rip)    # 0x356a74
jmp 0x9cbdb
incl %eax
movl %eax, 0x2b9e5a(%rip)    # 0x356a74
testl %esi, %esi
movl $0x0, %esi
je 0x9cbdb
movsbl 0x2b9c46(%rip), %eax    # 0x356870
jmp 0x9cc2e
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_ticc_field()
int get_ticc_field()
{
char c;
int i;

   // extract the next field from a TICC message.  Fields are separated by
   // spaces or tabs.  HP counters embed commas in numbers so we don't end
   // fields with commas.

   ticc_field[0] = 0;
   if(ticc_msg[ticc_col] == 0) return 0;  // at end-of-message

   i = 0;
   while(ticc_col < (int)sizeof(ticc_msg)) {   // get next field from the ticc message
      c = ticc_msg[ticc_col];
      if(c == 0) {  // reached end-of-message
         break;
      }
      else if(c == ' ') {  // skip leading spaces, end field on a space
         ++ticc_col;
         if(i) break;
      }
      else if(c == '\t') {  // skip leading spaces, end field on a tab
         ++ticc_col;
         if(i) break;
      }
      else {        // add char to extracted field
         ticc_field[i++] = c;
         ticc_field[i] = 0;
         ++ticc_col;
      }
   }

   return ticc_field[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x0, 0x2b91be(%rip)    # 0x356030
movslq 0x2b93bb(%rip), %rax    # 0x356234
leaq 0x2b8fa0(%rip), %rcx    # 0x355e20
cmpb $0x0, (%rax,%rcx)
je 0x9cee0
xorl %esi, %esi
leaq 0x2b91a1(%rip), %rdx    # 0x356030
cmpl $0x200, %eax            # imm = 0x200
jg 0x9ced7
movslq %eax, %rdi
movzbl (%rdi,%rcx), %edi
cmpl $0x9, %edi
je 0x9cec6
cmpl $0x20, %edi
je 0x9cec6
testl %edi, %edi
je 0x9ced7
movslq %esi, %r8
leaq 0x1(%r8), %rsi
movb %dil, (%r8,%rdx)
movb $0x0, 0x1(%r8,%rdx)
incl %eax
movl %eax, 0x2b9370(%rip)    # 0x356234
jmp 0x9ce8f
incl %eax
movl %eax, 0x2b9366(%rip)    # 0x356234
testl %esi, %esi
movl $0x0, %esi
je 0x9ce8f
movsbl 0x2b9152(%rip), %eax    # 0x356030
jmp 0x9cee2
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_ticc_line(unsigned int)
int get_ticc_line(unsigned port)
{
unsigned i;
char c;
double t0;

   // get a line from the TICC menu.

   if(port >= NUM_COM_PORTS) return 1;

   i = 0;
   cfg_buf[i] = 0;
   t0 = GetMsecs();
   while(GetMsecs() < (t0 + 1000.0)) {   // !!!! we need a timeout here
      if(SERIAL_DATA_AVAILABLE(port)) {
         c = get_ticc_char();
         if(c == 0x0A) continue;
         if(c == 0x0D) return 0;
         if(i > (sizeof(cfg_buf) - 2)) break;
         cfg_buf[i++] = c;
         cfg_buf[i] = 0;
      }
   }
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
pushq $0x1
popq %r14
cmpl $0x12, %edi
jbe 0x9cf0e
movl %r14d, %ecx
movl %ecx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %edi, %ebx
movb $0x0, 0x2bf349(%rip)    # 0x35c260
callq 0xad3f
addsd 0x56114(%rip), %xmm0    # 0xf3038
movsd %xmm0, -0x28(%rbp)
xorl %r12d, %r12d
leaq 0x2bf32d(%rip), %r15    # 0x35c260
callq 0xad3f
movsd -0x28(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x9cefc
movl %ebx, %edi
callq 0xb771
testl %eax, %eax
je 0x9cf33
callq 0x518f0
cmpl $0xa, %eax
je 0x9cf33
xorl %ecx, %ecx
cmpl $0xd, %eax
je 0x9ceff
cmpl $0x3fe, %r12d           # imm = 0x3FE
ja 0x9cefc
movl %r12d, %ecx
leaq 0x1(%rcx), %r12
movb %al, (%rcx,%r15)
movb $0x0, 0x1(%rcx,%r15)
jmp 0x9cf33
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: pet_data(unsigned char*, int, int)
int pet_data(unsigned char *buf, int k, int check_crlf)
{
int p;

   // returns true if data in buf starting at char k is a valid picpet reading

   if(!isdigit(buf[k+0] & 0xFF)) return 0;
   if(!isdigit(buf[k+1] & 0xFF)) return 0;
   if(buf[k+2] != '.') return 0;

   for(p=3; p<=9; p++) {
      if(isdigit(buf[k+p] & 0xFF) == 0) return 0;
   }
   if(buf[k+10] != ' ') return 0;
   if(ishex(buf[k+11]) == 0) return 0;
   if(ishex(buf[k+12]) == 0) return 0;
   if(check_crlf) {
      if(buf[k+13] != 0x0D) return 0;
      if(buf[k+14] != 0x0A) return 0;
   }
   else {
      if(buf[k+13]) return 0;
   }

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq %esi, %r12
movzbl (%rdi,%r12), %eax
addl $-0x30, %eax
xorl %ebx, %ebx
cmpl $0x9, %eax
ja 0x9d043
movq %rdi, %r14
movzbl 0x1(%rdi,%r12), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x9d043
cmpb $0x2e, 0x2(%r14,%r12)
jne 0x9d043
movl %edx, %r15d
leaq (%r12,%r14), %rax
addq $0x3, %rax
xorl %ecx, %ecx
cmpq $0x7, %rcx
je 0x9d002
movzbl (%rax,%rcx), %edx
addl $-0x3a, %edx
incq %rcx
cmpl $-0xa, %edx
jae 0x9cfe9
xorl %ebx, %ebx
jmp 0x9d043
xorl %ebx, %ebx
cmpb $0x20, 0xa(%r14,%r12)
jne 0x9d043
movsbl 0xb(%r14,%r12), %edi
callq 0x9cf7b
testl %eax, %eax
je 0x9d043
movsbl 0xc(%r14,%r12), %edi
callq 0x9cf7b
testl %eax, %eax
je 0x9d043
movb 0xd(%r14,%r12), %al
testl %r15d, %r15d
je 0x9d04e
cmpb $0xd, %al
jne 0x9d043
cmpb $0xa, 0xe(%r14,%r12)
jne 0x9d043
pushq $0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testb %al, %al
jne 0x9d043
jmp 0x9d040
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: lars_data(char*)
int lars_data(char *buf)
{
int i;

   // returns true if data in buf looks like it comes from a Lars GPSDO

   i = 0;
   if(strstr(buf, "LARS")) i = 1;
   if(strstr(buf, "HELP+INFO")) i = 2;
   if(strstr(buf, "NO PPS")) i = 3;
   if(strstr(buf, "WARMUP")) i = 10;
   if(strstr(buf, "NOLOCK")) i = 11;
   if(strstr(buf, "LOCKED"))i = 12;
   if((i >= 10) && !strchr(buf, '\t')) return 0;
   return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x7325d(%rip), %rsi     # 0x1102c6
callq 0x9090
xorl %r14d, %r14d
testq %rax, %rax
setne %r14b
leaq 0x7324c(%rip), %rsi     # 0x1102cb
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
pushq $0x2
popq %r15
cmovel %r14d, %r15d
leaq 0x7323c(%rip), %rsi     # 0x1102d5
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
pushq $0x3
popq %r14
cmovel %r15d, %r14d
leaq 0x725bd(%rip), %rsi     # 0x10f670
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
pushq $0xa
popq %r15
cmovel %r14d, %r15d
leaq 0x7320f(%rip), %rsi     # 0x1102dc
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
pushq $0xb
popq %r12
cmovel %r15d, %r12d
leaq 0x75c1e(%rip), %rsi     # 0x112d05
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
pushq $0xc
popq %r14
cmovel %r12d, %r14d
cmpl $0xa, %r14d
jb 0x9d113
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x9100
testq %rax, %rax
jne 0x9d113
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: hp_time(char*)
double hp_time(char *s)
{
unsigned i, j;

   // convert an HP formatted time string to a normal number by removing
   // embedded commas.  Returns the time as a double.

   j = 0;
   for(i=0; i<strlen(s); i++) {  // remove commas
      if(s[i] != ',') {
         s[j++] = s[i];
      }
   }
   s[j] = 0;

   return atof(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movl %r14d, %r14d
movq %rbx, %rdi
callq 0x9120
movl %r15d, %ecx
cmpq %r14, %rax
jbe 0x9d9eb
movb (%rbx,%r14), %al
cmpb $0x2c, %al
je 0x9d9e6
incl %r15d
movb %al, (%rbx,%rcx)
incl %r14d
jmp 0x9d9c5
movb $0x0, (%rbx,%rcx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9470
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: ticc_phase(char*, int, double, double)
double ticc_phase(char *id, int ticc_mode, double val, double last_val)
{
   // convert TICC/counter readings to phase values

   if((ticc_mode == 'T') || (ticc_mode == 'D') || (ticc_mode == 'L')) { // TICC is in a timestamp mode
      if((TS_WRAP_INTERVAL != 0.0) && (timestamp_wrap == 0.0)) {   // limit time stamps to TS_WRAP_INTERVAL (100.0) seconds
         val = fmod(val, TS_WRAP_INTERVAL);
         last_val = fmod(last_val, TS_WRAP_INTERVAL);
      }

      val -= last_val;     // convert consecutive time stamps to time interval
      if(val <= 0.0) {     // time stamps wrapped, adjust the interval
         if(timestamp_wrap == 0.0) val += TS_WRAP_INTERVAL;  // !!!!! what if still negative? 
         else                      val += timestamp_wrap; //       ... looping could take forever on a bogus value
      }
   }
   else if(ticc_mode == 'P') {  // time interval between samples on same channel
   }
   else if(ticc_mode == 'H') {  // phase
   }
   else if(ticc_mode == 'I') {  // time interval between two channels
      val -= last_val;
   }
   else if(ticc_mode == 'F') {  // frequency counter
      if(nominal_cha_freq <= 0.0) nominal_cha_freq = NOMINAL_FREQ;
      val = ((val - nominal_cha_freq) / nominal_cha_freq) * pps_adev_period;
   }

   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movapd %xmm0, %xmm2
leal -0x44(%rsi), %eax
cmpl $0x8, %eax
ja 0x9da68
leaq 0x6c167(%rip), %rcx     # 0x109b84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x258f3b(%rip), %rax    # 0x2f6968
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0x9da50
movabsq $0x416312d000000000, %rcx # imm = 0x416312D000000000
movq %rcx, (%rax)
movsd 0x57f00(%rip), %xmm0    # 0xf5950
subsd %xmm0, %xmm2
divsd %xmm0, %xmm2
leaq 0x1892a1(%rip), %rax    # 0x226d00
mulsd (%rax), %xmm2
jmp 0x9daf4
cmpl $0x54, %esi
jne 0x9daf4
leaq 0x258f80(%rip), %rbx    # 0x2f69f8
movsd (%rbx), %xmm0
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jne 0x9dac6
jp 0x9dac6
movsd 0x555d0(%rip), %xmm3    # 0xf3060
movapd %xmm2, %xmm0
movsd %xmm1, -0x18(%rbp)
movapd %xmm3, %xmm1
callq 0x94d0
movsd %xmm0, -0x10(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x555ac(%rip), %xmm1    # 0xf3060
callq 0x94d0
xorpd %xmm3, %xmm3
movsd -0x10(%rbp), %xmm2
movapd %xmm0, %xmm1
subsd %xmm1, %xmm2
ucomisd %xmm2, %xmm3
jb 0x9daf4
movsd (%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x9daf0
jp 0x9daf0
addsd 0x55578(%rip), %xmm2    # 0xf3060
jmp 0x9daf4
subsd %xmm1, %xmm2
jmp 0x9daf4
addsd %xmm0, %xmm2
movapd %xmm2, %xmm0
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_track_port()
void send_track_port()
{
int i, j;

   // send message "out" to the TRACK_PORT

   j = strlen(out);
   for(i=0; i<j; i++) {
      sendout(TRACK_PORT, (u08) out[i], ADD_CHAR);
   }
   sendout(TRACK_PORT, 0x0D, ADD_CHAR);
   sendout(TRACK_PORT, 0x0A, ADD_CHAR);
   sendout(TRACK_PORT, 0, FLUSH_COM);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x2882df(%rip), %rbx    # 0x326220
movq %rbx, %rdi
callq 0x9120
movq %rax, %r14
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
pushq $0x12
popq %r15
cmpq %r12, %r14
je 0x9df73
movzbl (%rbx,%r12), %esi
movl %r15d, %edi
xorl %edx, %edx
callq 0xba3b
incq %r12
jmp 0x9df5a
pushq $0x12
popq %rbx
pushq $0xd
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0xa
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0x2
popq %rdx
movl %ebx, %edi
xorl %esi, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xba3b
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_prn_azel(int)
void send_prn_azel(int prn)
{
   // send sat az/el out the TRACK_PORT if it is enabled

   if((prn >= 1) && (prn <= MAX_PRN)) {
      sprintf(out, "PRN %3d: %9.3f %9.3f", prn, sat[prn].azimuth, sat[prn].elevation);
   }
   else {  // invalid satellite
      strcpy(out, "PRN: 000");
   }
   send_track_port();
}

// Assembly:
movl %edi, %edx
leal -0x1(%rdx), %eax
cmpl $0x3e6, %eax            # imm = 0x3E6
ja 0x9dfef
pushq %rbp
movq %rsp, %rbp
movl %edx, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
leaq 0x18afee(%rip), %rcx    # 0x228fb0
cvtss2sd 0x208(%rcx,%rax), %xmm0
cvtss2sd 0x20c(%rcx,%rax), %xmm1
leaq 0x288245(%rip), %rdi    # 0x326220
leaq 0x724e0(%rip), %rsi     # 0x1104c2
movb $0x2, %al
callq 0x9060
popq %rbp
jmp 0x9df2f
leaq 0x28822a(%rip), %rax    # 0x326220
movabsq $0x303030203a4e5250, %rcx # imm = 0x303030203A4E5250
movq %rcx, (%rax)
movb $0x0, 0x8(%rax)
jmp 0x9df2f
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: highest_sat()
int highest_sat()
{
float el;
int prn;
int i;

   // return the PRN of the highest elevation satellite

   prn = 0;
   el = 0.0;
   for(i=1; i<=MAX_PRN; i++) { 
      if(sat[i].tracking > 0) {
         if(sat[i].elevation > el) {
            el = sat[i].elevation;
            prn = i;
         }
      }
   }
   return prn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
xorps %xmm0, %xmm0
movl $0x560, %ecx            # imm = 0x560
movl $0x1, %edx
leaq 0x18af8a(%rip), %rsi    # 0x228fb0
cmpq $0xcd358, %rcx          # imm = 0xCD358
je 0x9e050
cmpl $0x0, (%rsi,%rcx)
jle 0x9e045
movss -0xc(%rsi,%rcx), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x9e045
movaps %xmm1, %xmm0
movl %edx, %eax
addq $0x348, %rcx            # imm = 0x348
incl %edx
jmp 0x9e026
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: show_sun_moon(int, int)
void show_sun_moon(int row, int col)
{
   sun_moon_shown = 0;
   if(all_adevs) return;

//sprintf(plot_title, "zoom: %c   params:%d", zoom_screen, osc_params);
   sun_moon_shown = col;
   if(luxor) {
      sun_el = sun_posn(jd_utc, 0);
      have_sun_el = 1;
      log_sun_posn();

      if(do_moonrise) calc_moonrise();
      else            calc_sunrise(0.0, 21);
      --row;
   }
   else if(rcvr_type == NO_RCVR) ++row;
   else if(1 && (rcvr_type == RFTG_RCVR) && osc_params) {
      if(zoom_screen == 'C') return;
      if(zoom_screen == 'L') return;
   }
// else if(SCREEN_HEIGHT >= SHORT_SCREEN) ; // ++row;
// if(rcvr_type == TSIP_RCVR) col += 42;  // gggg

   show_sun_azel(row+1, col);
   if(text_mode || (SCREEN_HEIGHT >= MEDIUM_HEIGHT)) {
      show_moon_azel(row+4-1, col);
      show_sun_rise_set(row+3+3, col);
   }
   else if(1 || luxor || (SCREEN_HEIGHT >= SHORT_SCREEN) || (rcvr_type == NO_RCVR)) {
      show_moon_azel(row+3, col);
      show_sun_rise_set(row+3+3, col);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xbc3cd(%rip), %rax     # 0x15ac6c
andl $0x0, (%rax)
leaq 0x188495(%rip), %rcx    # 0x226d3e
cmpb $0x0, (%rcx)
je 0x9e8b3
popq %rbx
popq %r14
popq %rbp
retq
movl %esi, %ebx
movl %edi, %r14d
movl %esi, (%rax)
leaq 0x18a67d(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0x9e908
leaq 0x258c63(%rip), %rax    # 0x2f7530
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0xd3da7
leaq 0x258ed9(%rip), %rax    # 0x2f77b8
movsd %xmm0, (%rax)
leaq 0x258ede(%rip), %rax    # 0x2f77c8
movl $0x1, (%rax)
callq 0xdfb15
leaq 0x258d84(%rip), %rax    # 0x2f7680
cmpl $0x0, (%rax)
je 0x9e91f
callq 0xd485d
jmp 0x9e92a
leaq 0x163fc1(%rip), %rax    # 0x2028d0
movq (%rax), %rax
cmpq $0x400, %rax            # imm = 0x400
jne 0x9e955
incl %r14d
jmp 0x9e92d
pushq $0x15
popq %rdi
xorps %xmm0, %xmm0
callq 0xd4cfa
decl %r14d
leal 0x1(%r14), %edi
movl %ebx, %esi
callq 0x9e052
leal 0x3(%r14), %edi
movl %ebx, %esi
callq 0x9e23d
addl $0x6, %r14d
movl %r14d, %edi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x9e4ab
cmpq $0x400000, %rax         # imm = 0x400000
jne 0x9e92d
leaq 0x258788(%rip), %rax    # 0x2f70ec
cmpb $0x0, (%rax)
je 0x9e92d
leaq 0x257e38(%rip), %rax    # 0x2f67a8
movzbl (%rax), %eax
cmpl $0x43, %eax
je 0x9e8ae
cmpl $0x4c, %eax
je 0x9e8ae
jmp 0x9e92d
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: warn_info_needed()
void warn_info_needed()
{
int i;

   // warn the user we need location and/or UTC offset

   i = 0;
   if((lat != 0.0) || (lon != 0.0)) ;
   else {
      vidstr(VAL_ROW+i,VAL_COL, RED, "No location set.  ");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "Use the SL command");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "to set it.        ");
      ++i;
      if(rcvr_type == NO_RCVR) ++i;
   }

   if(have_utc_ofs < 0) {    // using estimated value
      vidstr(VAL_ROW+i,VAL_COL, RED, "UTC leapsecond   ");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "offset guessed.  ");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "Use the /uo=#    ");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "command to set it");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x256480(%rip), %rax    # 0x2f6fd0
movsd (%rax), %xmm1
xorl %ebx, %ebx
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0xa0bcd
jp 0xa0bcd
leaq 0x25646f(%rip), %rax    # 0x2f6fd8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jne 0xa0bcd
jp 0xa0bcd
leaq 0x702ba(%rip), %rcx     # 0x110e36
pushq $0xf
popq %rbx
pushq $0xc
popq %r14
xorl %edi, %edi
movl %ebx, %esi
movl %r14d, %edx
callq 0xe2d2
leaq 0x702b3(%rip), %rcx     # 0x110e49
pushq $0x1
popq %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0xe2d2
leaq 0x702b2(%rip), %rcx     # 0x110e5c
pushq $0x2
popq %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0xe2d2
leaq 0x161d12(%rip), %rax    # 0x2028d0
xorl %ebx, %ebx
cmpq $0x400, (%rax)          # imm = 0x400
sete %bl
addl $0x3, %ebx
leaq 0x256748(%rip), %rax    # 0x2f731c
cmpl $0x0, (%rax)
js 0xa0be4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x70284(%rip), %rcx     # 0x110e6f
pushq $0xf
popq %r14
pushq $0xc
popq %r15
movl %ebx, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0xe2d2
leal 0x1(%rbx), %edi
leaq 0x70277(%rip), %rcx     # 0x110e81
movl %r14d, %esi
movl %r15d, %edx
callq 0xe2d2
leal 0x2(%rbx), %edi
leaq 0x70274(%rip), %rcx     # 0x110e93
movl %r14d, %esi
movl %r15d, %edx
callq 0xe2d2
addl $0x3, %ebx
leaq 0x70271(%rip), %rcx     # 0x110ea5
movl %ebx, %edi
movl %r14d, %esi
movl %r15d, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe2d2
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: utm_lon_zone(double, double)
int utm_lon_zone(double dLat, double dLon)
{
int zone;

   // longitude must be between -180.00 .. 179.9
   if((dLon < -180.0) || (dLon > 180.0)) return (0); // implies failure: 0 is an invalid utm zone

   zone = (int)((180.0 + dLon) / 6.0 + 1.0);

   if((dLat >= 56.0) && (dLat < 64.0)) { // sw Norge (ie, zone 32V)
     if((dLon >= 3.0) && (dLon < 12.0)) zone = 32;
   }
   else if((dLat >= 72.0 && dLat < 84.0)) {  // special zones for Svalbard
     if     ((dLon >= 0.0)  && (dLon < 9.0))  zone = 31;
     else if((dLon >= 9.0)  && (dLon < 21.0)) zone = 33;
     else if((dLon >= 21.0) && (dLon < 33.0)) zone = 35;
     else if((dLon >= 33.0) && (dLon < 42.0)) zone = 37;
   }

   return zone;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movapd 0x4fed5(%rip), %xmm2    # 0xf3190
andpd %xmm1, %xmm2
xorl %eax, %eax
ucomisd 0x525df(%rip), %xmm2    # 0xf58a8
ja 0xa3322
movsd 0x525d5(%rip), %xmm2    # 0xf58a8
addsd %xmm1, %xmm2
divsd 0x65439(%rip), %xmm2    # 0x108718
addsd 0x4fd89(%rip), %xmm2    # 0xf3070
cvttsd2si %xmm2, %eax
ucomisd 0x65535(%rip), %xmm0    # 0x108828
jb 0xa3324
movsd 0x65533(%rip), %xmm2    # 0x108830
ucomisd %xmm0, %xmm2
jbe 0xa3324
movsd 0x654dd(%rip), %xmm0    # 0x1087e8
ucomisd %xmm1, %xmm0
movl $0x20, %ecx
cmovbel %eax, %ecx
ucomisd 0x52761(%rip), %xmm1    # 0xf5a80
cmovael %ecx, %eax
popq %rbp
retq
ucomisd 0x6550c(%rip), %xmm0    # 0x108838
jb 0xa3322
movsd 0x6550a(%rip), %xmm2    # 0x108840
ucomisd %xmm0, %xmm2
jbe 0xa3322
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0xa335b
movsd 0x65432(%rip), %xmm0    # 0x108780
ucomisd %xmm1, %xmm0
jbe 0xa335b
movl $0x1f, %eax
jmp 0xa3322
ucomisd 0x6541d(%rip), %xmm1    # 0x108780
jb 0xa337a
movsd 0x654db(%rip), %xmm0    # 0x108848
ucomisd %xmm1, %xmm0
jbe 0xa337a
movl $0x21, %eax
jmp 0xa3322
ucomisd 0x654c6(%rip), %xmm1    # 0x108848
jb 0xa3399
movsd 0x654c4(%rip), %xmm0    # 0x108850
ucomisd %xmm1, %xmm0
jbe 0xa3399
movl $0x23, %eax
jmp 0xa3322
movsd 0x654b7(%rip), %xmm0    # 0x108858
ucomisd %xmm1, %xmm0
movl $0x25, %ecx
cmovbel %eax, %ecx
ucomisd 0x6549b(%rip), %xmm1    # 0x108850
jmp 0xa331f
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: lla_to_ups(double, double)
void lla_to_ups(double lat, double lon)
{
double c0;
double tz;
double R;
double dlat;

   // convert lat/lon to Universal Polar Stereographic coords

   dlat = lat;

   lat = fabs(lat);  // !!!!!!! is this correct?

   c0 = (1.0-WGS84_E) / (1.0+WGS84_E);
   c0 = pow(c0, WGS84_E/2.0);
   c0 *= ((2.0*WGS84_A) / sqrt(1.0-eccSquared));

   tz = (1.0 + WGS84_E*sin(lat)) / (1.0 - WGS84_E*sin(lat));
   tz = pow(tz, WGS84_E/2.0);
   tz *= tan(PI/4.0 - lat/2.0);

   R = 0.994 * c0 * tz;

   if(dlat >= 0.0) UTMNorthing = 2000000.0 - R*cos(lon);
   else            UTMNorthing = 2000000.0 + R*cos(lon);

   UTMEasting = 2000000.0 + R*sin(lon);
//sprintf(plot_title, "c0:%f tz:%f R:%f N:%f E:%f", c0,tz,R, UTMNorthing,UTMEasting);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movsd %xmm1, -0x28(%rbp)
movapd %xmm0, -0x40(%rbp)
movapd 0x4faad(%rip), %xmm1    # 0xf3190
andpd %xmm0, %xmm1
movapd %xmm1, -0x20(%rbp)
movapd %xmm1, %xmm0
callq 0x9080
mulsd 0x651b3(%rip), %xmm0    # 0x1088b0
addsd 0x4f96b(%rip), %xmm0    # 0xf3070
movsd %xmm0, -0x8(%rbp)
movapd -0x20(%rbp), %xmm0
callq 0x9080
mulsd 0x6519c(%rip), %xmm0    # 0x1088b8
addsd 0x4f94c(%rip), %xmm0    # 0xf3070
movsd -0x8(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x6518b(%rip), %xmm1    # 0x1088c0
movapd %xmm2, %xmm0
callq 0x96b0
movsd %xmm0, -0x8(%rbp)
movapd -0x20(%rbp), %xmm0
mulsd 0x522b0(%rip), %xmm0    # 0xf5a00
addsd 0x65170(%rip), %xmm0    # 0x1088c8
callq 0x91a0
mulsd -0x8(%rbp), %xmm0
mulsd 0x65166(%rip), %xmm0    # 0x1088d0
movapd %xmm0, -0x20(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x9710
movapd 0x4fa2f(%rip), %xmm1    # 0xf31b0
movapd -0x20(%rbp), %xmm4
xorpd %xmm4, %xmm1
xorpd %xmm2, %xmm2
cmpnlesd -0x40(%rbp), %xmm2
movapd %xmm2, %xmm3
andpd %xmm4, %xmm3
andnpd %xmm1, %xmm2
orpd %xmm3, %xmm2
mulsd %xmm0, %xmm2
addsd 0x65128(%rip), %xmm2    # 0x1088d8
movsd %xmm2, 0x2bcd78(%rip)   # 0x360530
movsd -0x28(%rbp), %xmm0
callq 0x9080
mulsd -0x20(%rbp), %xmm0
addsd 0x65109(%rip), %xmm0    # 0x1088d8
movsd %xmm0, 0x2bcd61(%rip)   # 0x360538
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: dms_fmt(double)
char *dms_fmt(double x)
{
int deg, min;
double sec;
static char s[128+1];
char sign;

   if(x < 0.0) {
      x = 0.0-x;
      sign = '-';
   }
   else sign = '+';

   deg = (int) x;
   min = (int) (60.0 * ((double) x - (double) deg));
   sec = ((x - (double) deg) - ((double) min / 60.0)) * 3600.0;
   sprintf(s, "%c%2dd %02dm %9.6fs", sign, deg, min, sec);
   return &s[0];
}

// Assembly:
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %cl
jbe 0xa3cb9
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movb %cl, %al
leal 0x2b(%rax,%rax), %edx
cvttsd2si %xmm0, %ecx
cvttpd2dq %xmm0, %xmm1
cvtdq2pd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd 0x4f32b(%rip), %xmm1    # 0xf3008
movapd %xmm0, %xmm2
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %r8d
cvttpd2dq %xmm2, %xmm2
cvtdq2pd %xmm2, %xmm2
divsd %xmm1, %xmm2
subsd %xmm2, %xmm0
mulsd 0x4f30e(%rip), %xmm0    # 0xf3010
leaq 0x2bc877(%rip), %rbx    # 0x360580
leaq 0x6d4ed(%rip), %rsi     # 0x1111fd
movq %rbx, %rdi
movb $0x1, %al
callq 0x9060
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: show_build_info(int)
void show_build_info(int force)
{
   if(rcvr_type != TSIP_RCVR) return;

   if(build_month > 12) build_month = 0;
   if(build_ok || force) {
      sprintf(out, "Mfg: %02d:00  %02d %s %04d", 
         build_hour, build_day, months[build_month], build_year);
      vidstr(VER_ROW+3, VER_COL, WHITE, out);
   }
}

// Assembly:
leaq 0x159a91(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0xa8ed7
leaq 0x24eb3a(%rip), %rcx    # 0x2f798a
movb (%rcx), %al
cmpb $0xd, %al
jb 0xa8e5b
movb $0x0, (%rcx)
xorl %eax, %eax
leaq 0x24e592(%rip), %rcx    # 0x2f73f4
orl (%rcx), %edi
je 0xa8ed7
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x24eb19(%rip), %rcx    # 0x2f798c
movzbl (%rcx), %edx
leaq 0x24eb0e(%rip), %rcx    # 0x2f798b
movzbl (%rcx), %ecx
movzbl %al, %eax
leaq 0xab8b6(%rip), %rsi     # 0x154740
movq (%rsi,%rax,8), %r8
leaq 0x24eaf3(%rip), %rax    # 0x2f7988
movzwl (%rax), %r9d
leaq 0x27d380(%rip), %rbx    # 0x326220
leaq 0x6907b(%rip), %rsi     # 0x111f22
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x1598dc(%rip), %rax    # 0x202794
movl (%rax), %edi
addl $0x3, %edi
leaq 0x1598d4(%rip), %rax    # 0x202798
movl (%rax), %esi
pushq $0xf
popq %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe2d2
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: show_unit_info()
void show_unit_info()
{
   if(rcvr_type != TSIP_RCVR) return;
   if(ap_month > 12) ap_month = 0;
   if(core_month > 12) core_month = 0;

   if(have_info & VERSION_INFO) {
      if(unit_name[0] == 0) {
         sprintf(out, "App: %2d.%-2d  %02d %s %02d", 
            ap_major, ap_minor,  ap_day, months[ap_month], ap_year);   //!!! docs say 1900
         vidstr(VER_ROW+1, VER_COL, WHITE, out);
      }

      sprintf(out, "GPS: %2d.%-2d  %02d %s %02d", 
         core_major, core_minor,  core_day, months[core_month], core_year);  //!!! docs say 1900
      vidstr(VER_ROW+2, VER_COL, WHITE, out);
   }

   show_build_info(0);
}

// Assembly:
leaq 0x1599f1(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0xa902e
leaq 0x24eab6(%rip), %rcx    # 0x2f79a6
movb (%rcx), %al
cmpb $0xd, %al
jb 0xa8efb
movb $0x0, (%rcx)
xorl %eax, %eax
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x24ea9f(%rip), %r14    # 0x2f79ac
movb (%r14), %sil
cmpb $0xd, %sil
jb 0xa8f1c
movb $0x0, (%r14)
xorl %esi, %esi
leaq 0x24ea51(%rip), %rcx    # 0x2f7974
testb $0x4, (%rcx)
je 0xa901f
leaq 0x27d70d(%rip), %rcx    # 0x326640
cmpb $0x0, (%rcx)
jne 0xa8fac
leaq 0x24ea65(%rip), %rcx    # 0x2f79a4
movzbl (%rcx), %edx
leaq 0x24ea5c(%rip), %rcx    # 0x2f79a5
movzbl (%rcx), %ecx
leaq 0x24ea54(%rip), %rsi    # 0x2f79a7
movzbl (%rsi), %r8d
movzbl %al, %eax
leaq 0xab7df(%rip), %rsi     # 0x154740
movq (%rsi,%rax,8), %r9
leaq 0x24ea3c(%rip), %rax    # 0x2f79a8
movzwl (%rax), %eax
movl %eax, (%rsp)
leaq 0x27d2a7(%rip), %rbx    # 0x326220
leaq 0x68fbd(%rip), %rsi     # 0x111f3d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x159803(%rip), %rax    # 0x202794
movl (%rax), %edi
incl %edi
leaq 0x1597fc(%rip), %rax    # 0x202798
movl (%rax), %esi
pushq $0xf
popq %rdx
movq %rbx, %rcx
callq 0xe2d2
movb (%r14), %sil
leaq 0x24e9f7(%rip), %rax    # 0x2f79aa
movzbl (%rax), %edx
leaq 0x24e9ee(%rip), %rax    # 0x2f79ab
movzbl (%rax), %ecx
leaq 0x24e9e6(%rip), %rax    # 0x2f79ad
movzbl (%rax), %r8d
movzbl %sil, %eax
leaq 0xab76a(%rip), %rsi     # 0x154740
movq (%rsi,%rax,8), %r9
leaq 0x24e9cd(%rip), %rax    # 0x2f79ae
movzwl (%rax), %eax
movl %eax, (%rsp)
leaq 0x27d232(%rip), %rbx    # 0x326220
leaq 0x68f64(%rip), %rsi     # 0x111f59
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x15978e(%rip), %rax    # 0x202794
movl (%rax), %edi
addl $0x2, %edi
leaq 0x159786(%rip), %rax    # 0x202798
movl (%rax), %esi
pushq $0xf
popq %rdx
movq %rbx, %rcx
callq 0xe2d2
xorl %edi, %edi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xa8e38
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: show_ebolt_info()
void show_ebolt_info()
{
   show_build_info(1);

#ifdef WINDOWS
   if(com[RCVR_PORT].com_port >= 10)      sprintf(out, "Ser: %2u.%-8lu COM:%d",  hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].com_port);
   else if (com[RCVR_PORT].com_port)      sprintf(out, "Ser: %2u.%-8lu  COM:%d", hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].com_port);
#else   // __linux__  __MACH__  __FreeBSD__
   if(com[RCVR_PORT].com_port >= 10)      sprintf(out, "Ser: %2u.%-8lu TTY:%d",  hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].com_port-1);
   else if (com[RCVR_PORT].com_port)      sprintf(out, "Ser: %2u.%-8lu  TTY:%d", hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].com_port-1);
#endif
   else if(com[RCVR_PORT].usb_port >= 10) sprintf(out, "Ser: %2u.%-8lu USB:%d",  hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].usb_port-1);
   else if(com[RCVR_PORT].usb_port)       sprintf(out, "Ser: %2u.%-8lu  USB:%d", hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].usb_port-1);
#ifdef TCP_IP 
   else if(com[RCVR_PORT].IP_addr[0]) {
      sprintf(out," IP: %-17.17ss", com[RCVR_PORT].IP_addr); // TCP 
   }
#endif
   else {
      sprintf(out," COM: none");
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq $0x1
popq %rdi
callq 0xa8e38
leaq 0x24f29e(%rip), %rax    # 0x2f82e0
movl 0x157c0(%rax), %r8d
cmpl $0xa, %r8d
jl 0xa9072
leaq 0x24e94c(%rip), %rax    # 0x2f79a2
movzwl (%rax), %edx
movl 0x2acda5(%rip), %ecx    # 0x355e04
decl %r8d
leaq 0x27d1b7(%rip), %rdi    # 0x326220
leaq 0x68f0e(%rip), %rsi     # 0x111f7e
jmp 0xa90f0
testl %r8d, %r8d
je 0xa909a
leaq 0x24e924(%rip), %rax    # 0x2f79a2
movzwl (%rax), %edx
movl 0x2acd7d(%rip), %ecx    # 0x355e04
decl %r8d
leaq 0x27d18f(%rip), %rdi    # 0x326220
leaq 0x68efc(%rip), %rsi     # 0x111f94
jmp 0xa90f0
movl 0x157c4(%rax), %r8d
cmpl $0xa, %r8d
jl 0xa90ca
leaq 0x24e8f4(%rip), %rax    # 0x2f79a2
movzwl (%rax), %edx
movl 0x2acd4d(%rip), %ecx    # 0x355e04
decl %r8d
leaq 0x27d15f(%rip), %rdi    # 0x326220
leaq 0x68ee3(%rip), %rsi     # 0x111fab
jmp 0xa90f0
testl %r8d, %r8d
je 0xa911c
leaq 0x24e8cc(%rip), %rax    # 0x2f79a2
movzwl (%rax), %edx
movl 0x2acd25(%rip), %ecx    # 0x355e04
decl %r8d
leaq 0x27d137(%rip), %rdi    # 0x326220
leaq 0x68ed1(%rip), %rsi     # 0x111fc1
xorl %eax, %eax
callq 0x9060
leaq 0x159696(%rip), %rax    # 0x202794
movl (%rax), %edi
addl $0x4, %edi
leaq 0x15968e(%rip), %rax    # 0x202798
movl (%rax), %esi
leaq 0x27d10d(%rip), %rcx    # 0x326220
pushq $0xf
popq %rdx
popq %rbp
jmp 0xe2d2
cmpb $0x0, 0x158cd(%rax)
je 0xa9148
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x90eaf(%rip), %rdx     # 0x139fe0
leaq 0x27d0e8(%rip), %rdi    # 0x326220
leaq 0x68e99(%rip), %rsi     # 0x111fd8
xorl %eax, %eax
callq 0x9060
jmp 0xa90f7
leaq 0x27d0d1(%rip), %rax    # 0x326220
movabsq $0x6f6e203a4d4f4320, %rcx # imm = 0x6F6E203A4D4F4320
movq %rcx, (%rax)
movl $0x656e6f, 0x7(%rax)    # imm = 0x656E6F
jmp 0xa90f7
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: erase_info_col()
void erase_info_col()
{
int i;
int row;

   // erase the INFO_COL column from the top of the screen to the "VIEW:" line

   row = queue_row;
   if(all_adevs && (SCREEN_WIDTH < WIDE_WIDTH)) return;
   if(rcvr_type == NO_RCVR) return;

   for(i=0; i<=queue_row; i++) {  // erase old info
      if((i < 5) && (SCREEN_WIDTH < MEDIUM_WIDTH)) {  // don't overwrite possible sat prn values  pretty printing
         vidstr(i,INFO_COL, WHITE, "            ");
      }
      else {
         vidstr(i,INFO_COL, WHITE, "              ");
      }
   }

   info_row = 0;
   info_avail = queue_row+1;
}

// Assembly:
leaq 0x176efe(%rip), %rax    # 0x226d3e
cmpb $0x0, (%rax)
setne %al
leaq 0x1529b3(%rip), %rcx    # 0x202800
cmpl $0x4fa, (%rcx)          # imm = 0x4FA
setl %cl
testb %cl, %al
jne 0xafef2
leaq 0x152a6b(%rip), %rax    # 0x2028d0
cmpq $0x400, (%rax)          # imm = 0x400
je 0xafef2
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x152947(%rip), %r12    # 0x2027d0
leaq 0x6dbe7(%rip), %r15     # 0x11da77
leaq 0x152905(%rip), %r13    # 0x20279c
pushq $0xf
popq %r14
movl (%r12), %eax
cmpl %eax, %ebx
jg 0xafed5
leaq 0x152956(%rip), %rax    # 0x202800
cmpl $0x3e2, (%rax)          # imm = 0x3E2
leaq 0x6dbc2(%rip), %rcx     # 0x11da79
jl 0xafebc
movq %r15, %rcx
cmpl $0x5, %ebx
movl (%r13), %esi
cmovaeq %r15, %rcx
movl %ebx, %edi
movl %r14d, %edx
callq 0xe2d2
incl %ebx
jmp 0xafe9b
andl $0x0, 0x2a5ec0(%rip)    # 0x355d9c
incl %eax
movl %eax, 0x2a5ebc(%rip)    # 0x355da0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_rcvr_info(int)
void request_rcvr_info(int why)
{
   // NEW_RCVR
   if(no_poll) return;
//wwwww if(SV6_FAMILY) return;  // prevent rcvr buffer overlow ttttt wwwww
if((rcvr_type == TSIP_RCVR) && (tsip_type == STARLOC_TYPE)) return;  // prevent rcvr buffer overlow ttttt wwwww
if(rcvr_type == BRANDY_RCVR) return;  // prevent receiver buffer overflow and time skips
if(rcvr_type == LPFRS_RCVR) return;   // speed up polling loop
if(rcvr_type == PRS_RCVR) return;     // speed up polling loop
if(rcvr_type == SA35_RCVR) return;    // speed up polling loop
if(rcvr_type == SRO_RCVR) return;     // speed up polling loop
if(rcvr_type == RFTG_RCVR) return;    // prevent receiver buffer overflow and time skips
if(rcvr_type == THERMO_RCVR) return;

   request_version();
   request_luxor_ver();        // no SV6
   if(luxor_time_set == 0) {   // no SV6
      set_luxor_time();
   }

   request_utc_info();

   request_pps_info();         // no SV6
   if(rcvr_type != BRANDY_RCVR) {  // request_pps_info does the same thing
      request_pps_mode();      
   }
   request_timing_mode();      // no SV6

   request_filter_config();
   request_rcvr_config(why);
   request_survey_params();    // no SV6

   if(rcvr_type != STAR_RCVR) {  // request_rcvr_config() did this
      request_all_dis_params();  // no SV6
   }

   request_sat_list();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x27111f(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0xaff28
leaq 0x1529c3(%rip), %r14    # 0x2028d0
movq (%r14), %rax
cmpq $0x1, %rax
sete %cl
leaq 0x1550b6(%rip), %rdx    # 0x204fd4
cmpl $0x53, (%rdx)
sete %dl
testb %dl, %cl
je 0xaff2d
popq %rbx
popq %r14
popq %rbp
retq
cmpq $0x40000, %rax          # imm = 0x40000
je 0xaff28
cmpq $0x80000, %rax          # imm = 0x80000
je 0xaff28
cmpq $0x400000, %rax         # imm = 0x400000
je 0xaff28
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0xaff28
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0xaff28
cmpq $0x10000000, %rax       # imm = 0x10000000
je 0xaff28
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
cmpq %rcx, %rax
je 0xaff28
movl %edi, %ebx
callq 0x5d7c2
callq 0x716db
cmpb $0x0, 0x2a5e9f(%rip)    # 0x355e1e
jne 0xaff86
callq 0x5c3ab
callq 0x5960c
callq 0x61bf1
cmpq $0x40000, (%r14)        # imm = 0x40000
je 0xaff9e
callq 0x63061
callq 0x63fdb
callq 0x60f41
movl %ebx, %edi
callq 0x5e18e
callq 0x67b43
cmpq $0x1000, (%r14)         # imm = 0x1000
je 0xaffc2
callq 0x671af
popq %rbx
popq %r14
popq %rbp
jmp 0x5de9d
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: ts_data(int)
int ts_data(int k)
{
   if(tsip_buf[k+0] != 0x01) return 0;
   if(tsip_buf[k+4] != ':') return 0;
   if(tsip_buf[k+7] != ':') return 0;
   if(tsip_buf[k+10] != ':') return 0;
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %edi, %rcx
leaq 0x270e2b(%rip), %rdx    # 0x321250
xorl %eax, %eax
cmpb $0x1, (%rdx,%rcx)
jne 0xb0445
cmpb $0x3a, 0x4(%rcx,%rdx)
jne 0xb0445
cmpb $0x3a, 0x7(%rcx,%rdx)
jne 0xb0445
xorl %eax, %eax
cmpb $0x3a, 0xa(%rcx,%rdx)
sete %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_xxx_dds(double)
double x72_xxx_dds(double dds)
{
int depth;

   // add the current DDS setting to the dds value averaging queue
#define MIN_DEPTH 20  // was *10

   depth = (x72_tc_val / PID_RATE) + 1;
   if(depth < MIN_DEPTH) depth = MIN_DEPTH;

//if(x72_dds_count > x72_tc_val) {  // queue is full, remove oldest entry
//if(x72_dds_count > 120) {  // queue is full, remove oldest entry
//if(x72_dds_count > (x72_tc_val-2)) {  // queue is full, remove oldest entry
   if(x72_dds_count > depth) {  // queue is full, remove oldest entry
      --x72_dds_count;
      x72_dds_sum -= x72_dds_list[x72_dds_out];
      ++x72_dds_out;
      if(x72_dds_out >= depth) x72_dds_out = 0;
   }

   ++x72_dds_count;    // put new entry into the queue
   x72_dds_sum += dds;
   x72_dds_list[x72_dds_in] = dds;
   ++x72_dds_in;
   if(x72_dds_in >= depth) x72_dds_in = 0;

   if(x72_dds_count) dds = x72_dds_sum / (double) x72_dds_count;
   else dds = last_x72_dds;
   filtered_dds = dds;

   return dds;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x154868(%rip), %rax    # 0x204e04
movl (%rax), %eax
movl $0x3c, %ecx
cltd
idivl %ecx
cmpl $0x14, %eax
movl $0x13, %esi
cmovgel %eax, %esi
leal 0x1(%rsi), %edi
leaq 0x15496d(%rip), %rcx    # 0x204f28
movl (%rcx), %eax
movsd 0x2b3763(%rip), %xmm1   # 0x363d28
leaq 0x2b0164(%rip), %rdx    # 0x360730
cmpl %edi, %eax
jle 0xb05f2
decl %eax
movslq 0x2b3757(%rip), %rdi    # 0x363d30
subsd (%rdx,%rdi,8), %xmm1
leal 0x1(%rdi), %r8d
xorl %r9d, %r9d
cmpl %esi, %edi
cmovll %r8d, %r9d
movl %r9d, 0x2b373e(%rip)    # 0x363d30
movslq 0x2b373b(%rip), %rdi    # 0x363d34
leal 0x1(%rdi), %r8d
xorl %r9d, %r9d
cmpl %esi, %edi
cmovll %r8d, %r9d
addsd %xmm0, %xmm1
movsd %xmm1, 0x2b3716(%rip)   # 0x363d28
movsd %xmm0, (%rdx,%rdi,8)
movl %r9d, 0x2b3716(%rip)    # 0x363d34
addl $0x1, %eax
movl %eax, (%rcx)
je 0xb062f
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
jmp 0xb063a
leaq 0x1548aa(%rip), %rax    # 0x204ee0
movsd (%rax), %xmm1
movsd %xmm1, 0x2b36f6(%rip)   # 0x363d38
movapd %xmm1, %xmm0
popq %rbp
retq