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

   if(s == 0) return;

   if(s[0] != '$') {
      sendout(RCVR_PORT, '$', ADD_CHAR);
   }

   j = strlen(s);
   for(i=0; i<j; i++) send_byte((u08) s[i]);

   sendout(RCVR_PORT, 0x0D, ADD_CHAR);
   sendout(RCVR_PORT, 0x0A, EOM);

   if(sim_file == 0) Sleep(50);
}

// Assembly:
testq %rdi, %rdi
je 0x57b4c
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x24, (%rdi)
je 0x57af0
pushq $0xa
popq %rdi
pushq $0x24
popq %rsi
xorl %edx, %edx
callq 0xba3b
movq %rbx, %rdi
callq 0x9120
movq %rax, %r14
xorl %r15d, %r15d
testl %r14d, %r14d
cmovlel %r15d, %r14d
cmpq %r15, %r14
je 0x57b19
movzbl (%rbx,%r15), %edi
callq 0x523f2
incq %r15
jmp 0x57b05
pushq $0xa
popq %rbx
pushq $0xd
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0x1
popq %rdx
movl %ebx, %edi
movl %ebx, %esi
callq 0xba3b
leaq 0x1d0885(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
leaq 0x8(%rsp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
je 0x57b4d
retq
pushq $0x32
popq %rdi
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_z12_cmd(char*)
void send_z12_cmd(char *s)
{
   // Ashtech Z12

   if(s == 0) return;

   if(log_file && (log_stream & LOG_PACKET_START)) {
      fprintf(log_file, "\nSend Z12 cmd: %s\n", s);
   }
if(debug_file) fprintf(debug_file, "\nSend Z12 cmd: %s\n", s);

   send_nmea_start();
   if(s[0] == '$')    send_nmea_string(&s[1], 0);
   else               send_nmea_string(&s[0], 0);
   if(strchr(s, '*')) send_nmea_end(0);
   else               send_nmea_end(1);

   if(Z12_SLEEP) Sleep(Z12_SLEEP);
}

// Assembly:
testq %rdi, %rdi
je 0x57bf2
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1d07f2(%rip), %rax    # 0x228360
movq (%rax), %rdi
testq %rdi, %rdi
je 0x57b93
leaq 0x1d0893(%rip), %rax    # 0x228410
testb $0x4, (%rax)
je 0x57b93
leaq 0xb28ba(%rip), %rsi     # 0x10a443
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
leaq 0x1d07f6(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x57bb3
leaq 0xb289a(%rip), %rsi     # 0x10a443
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
callq 0x57d18
xorl %edi, %edi
cmpb $0x24, (%rbx)
sete %dil
addq %rbx, %rdi
xorl %esi, %esi
callq 0x5724b
pushq $0x2a
popq %rsi
movq %rbx, %rdi
callq 0x9100
xorl %edi, %edi
testq %rax, %rax
sete %dil
callq 0x57d32
pushq $0x32
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xae83
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_ubx_start(unsigned short, int)
void send_ubx_start(u16 ubx_cmd, int len)
{
   if(log_file && (log_stream & LOG_PACKET_START)) {
      fprintf(log_file, "\nSend UBX start %04X  len:%d+6\n", ubx_cmd, len);
   }
   if(1 && debug_file) {  //plugh
      fprintf(debug_file, "Sent UBX start %04X  len:%d+6\n", ubx_cmd, len);
   }

   // start sending a ublox message
   sendout(RCVR_PORT, 0xB5, ADD_CHAR);  // send message start code
   sendout(RCVR_PORT, 0x62, ADD_CHAR);
   ubx_txa = ubx_txb = 0; // init transmit checksum bytes

   send_byte((ubx_cmd >> 8) & 0xFF);  // send message class
   send_byte(ubx_cmd & 0xFF);         // send message identifier

   send_byte((len % 256) & 0xFF);     // send message length
   send_byte((len/256) & 0xFF);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movl %edi, %eax
leaq 0x1d0757(%rip), %rcx    # 0x228360
movq (%rcx), %rdi
movzwl %ax, %r14d
testq %rdi, %rdi
je 0x57c34
leaq 0x1d07f4(%rip), %rax    # 0x228410
testb $0x4, (%rax)
je 0x57c34
leaq 0xb27c8(%rip), %rsi     # 0x10a3f0
movl %r14d, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x9560
leaq 0x1d0755(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x57c56
leaq 0xb27c6(%rip), %rsi     # 0x10a410
movl %r14d, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x9560
pushq $0xa
popq %r15
xorl %r12d, %r12d
movl %r15d, %edi
movl $0xb5, %esi
xorl %edx, %edx
callq 0xba3b
pushq $0x62
popq %rsi
movl %r15d, %edi
xorl %edx, %edx
callq 0xba3b
movb %r12b, 0x2fedf9(%rip)   # 0x356a79
movb %r12b, 0x2fedf1(%rip)   # 0x356a78
movl %r14d, %edi
shrl $0x8, %edi
callq 0x523f2
movl $0xff, %r15d
andl %r15d, %r14d
movl %r14d, %edi
callq 0x523f2
movl %ebx, %edi
andl %r15d, %edi
callq 0x523f2
movl $0x100, %ecx            # imm = 0x100
movl %ebx, %eax
cltd
idivl %ecx
andl %eax, %r15d
movl %r15d, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x523f2
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_ubx_end()
void send_ubx_end()
{
u08 a,b;

   // end the ublox message
   a = ubx_txa;  // transmitted message checksum
   b = ubx_txb;
   sendout(RCVR_PORT, a, ADD_CHAR);  // send checksum
   sendout(RCVR_PORT, b, EOM);

   if(sim_file == 0) Sleep(50);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movzbl 0x2feda0(%rip), %esi    # 0x356a78
movzbl 0x2fed9a(%rip), %ebx    # 0x356a79
pushq $0xa
popq %r14
movl %r14d, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0x1
popq %rdx
movl %r14d, %edi
movl %ebx, %esi
callq 0xba3b
leaq 0x1d06bf(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
je 0x57d0c
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x32
popq %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_nmea_end(int)
void send_nmea_end(int do_cksum)
{
char cksum[10];

   sprintf(cksum, "%02X", (nmea_tx_cksum & 0xFF));

   if(rcvr_type == ZYFER_RCVR) {
      sendout(RCVR_PORT, '*', ADD_CHAR);
   }
   else if(do_cksum) {
      sendout(RCVR_PORT, '*', ADD_CHAR);
      sendout(RCVR_PORT, cksum[0], ADD_CHAR);
      sendout(RCVR_PORT, cksum[1], ADD_CHAR);
   }
   sendout(RCVR_PORT, 0x0D, ADD_CHAR);
   sendout(RCVR_PORT, 0x0A, EOM);

   if(sim_file == 0) Sleep(50);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
movzbl 0x2fed72(%rip), %edx    # 0x356ab6
leaq 0xbcc75(%rip), %rsi     # 0x1149c0
leaq -0x12(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x1aab73(%rip), %rcx    # 0x2028d0
movb $0x2a, %al
cmpq $0x100000, (%rcx)       # imm = 0x100000
je 0x57d8b
testl %ebx, %ebx
je 0x57d98
pushq $0xa
popq %rbx
pushq $0x2a
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
movzbl -0x12(%rbp), %esi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
movb -0x11(%rbp), %al
movzbl %al, %esi
pushq $0xa
popq %rdi
xorl %edx, %edx
callq 0xba3b
pushq $0xa
popq %rbx
pushq $0xd
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0x1
popq %rdx
movl %ebx, %edi
movl %ebx, %esi
callq 0xba3b
leaq 0x1d0606(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
je 0x57dc7
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
pushq $0x32
popq %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_fan_cmd(char*)
void send_fan_cmd(char *s)
{
int i, j;
unsigned port;

   // send a command to the temperature control device

   if(s == 0) return;
   port = fan_port;

   if((com[port].process_com == 0) || (com[port].com_running <= 0)) {  // fan port not open
      if(enviro_mode() && (enviro_type == HEATHER_ENVIRO)) {  // Heather environmental sensor in use
         if(rcvr_type == THERMO_RCVR) port = RCVR_PORT;
         else                         port = THERMO_PORT;
         if((com[port].process_com == 0) || (com[port].com_running <= 0)) return;  // sensor not running
      }
      else return;
   }

   j = strlen(s);
   for(i=0; i<j; i++) sendout(port,(u08) s[i], ADD_CHAR);
   sendout(port, 0x0D, ADD_CHAR);
   sendout(port, 0x0A, EOM);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x57e9e
movq %rdi, %rbx
leaq 0x2a04d3(%rip), %rax    # 0x2f82cc
movl (%rax), %r14d
imulq $0x2260, %r14, %rax     # imm = 0x2260
leaq 0x2a04d6(%rip), %r15    # 0x2f82e0
cmpl $0x0, 0x2234(%r15,%rax)
je 0x57e21
addq %r15, %rax
cmpl $0x0, 0x2230(%rax)
jg 0x57e70
callq 0x57eca
testl %eax, %eax
je 0x57e9e
leaq 0x1aaae3(%rip), %rax    # 0x202914
cmpl $0x2, (%rax)
jne 0x57e9e
leaq 0x1aaa93(%rip), %rax    # 0x2028d0
xorl %ecx, %ecx
cmpq $0x80000, (%rax)        # imm = 0x80000
setne %cl
leal (%rcx,%rcx,4), %r14d
addl $0xa, %r14d
imulq $0x2260, %r14, %rax     # imm = 0x2260
cmpl $0x0, 0x2234(%r15,%rax)
je 0x57e9e
addq %rax, %r15
cmpl $0x0, 0x2230(%r15)
jle 0x57e9e
movq %rbx, %rdi
callq 0x9120
movq %rax, %r15
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
cmpq %r12, %r15
je 0x57ea7
movzbl (%rbx,%r12), %esi
movl %r14d, %edi
xorl %edx, %edx
callq 0xba3b
incq %r12
jmp 0x57e85
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0xd
popq %rsi
movl %r14d, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0xa
popq %rsi
pushq $0x1
popq %rdx
movl %r14d, %edi
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: enviro_mode()
int enviro_mode()
{
int i;

   // returns true if external envidonmental sensor in use
   
   i = 0x00;
   if(rcvr_type == THERMO_RCVR) i |= 0x01;
   if(enviro_port_open()) i |= 0x02;
// if(com[THERMO_PORT].port_used > 0) i |= 0x04;  //lfs
   if(sim_file_read && (com[THERMO_PORT].port_used)) i |= 0x80;
   return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1aa9fb(%rip), %rax    # 0x2028d0
xorl %ecx, %ecx
cmpq $0x80000, (%rax)        # imm = 0x80000
sete %cl
leaq 0x2a03f8(%rip), %rdx    # 0x2f82e0
leal 0x2(%rcx), %esi
cmpl $0x0, 0x225d0(%rdx)
cmovlel %ecx, %esi
cmpl $0x0, 0x225d4(%rdx)
cmovel %ecx, %esi
leaq 0x1b5706(%rip), %rcx    # 0x20d60c
leal 0x80(%rsi), %eax
cmpl $0x0, 0x225cc(%rdx)
cmovel %esi, %eax
cmpl $0x0, (%rcx)
cmovel %esi, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_sirf_start(unsigned short, int)
void send_sirf_start(u16 sirf_cmd, int len)
{
   // start sending a Sirf message
   if(log_file && (log_stream & LOG_PACKET_START)) {
      fprintf(log_file, "\nSend sirf start %04X  len:%d\n", sirf_cmd, len);
   }

   sendout(RCVR_PORT, 0xA0, ADD_CHAR); // send message start code
   sendout(RCVR_PORT, 0xA2, ADD_CHAR);

   send_byte((len / 256) & 0xFF);  // send message length
   send_byte((len % 256) & 0xFF); 

   sirf_tx_cksum = 0; // init transmit checksum bytes

   send_byte(sirf_cmd & 0xFF);  // send message id
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movl %edi, %ebx
leaq 0x1d01a2(%rip), %rax    # 0x228360
movq (%rax), %rdi
testq %rdi, %rdi
je 0x581e6
leaq 0x1d0243(%rip), %rax    # 0x228410
testb $0x4, (%rax)
je 0x581e6
movzwl %bx, %edx
leaq 0xb65b5(%rip), %rsi     # 0x10e791
movl %r14d, %ecx
xorl %eax, %eax
callq 0x9560
pushq $0xa
popq %r15
movl %r15d, %edi
movl $0xa0, %esi
xorl %edx, %edx
callq 0xba3b
movl %r15d, %edi
movl $0xa2, %esi
xorl %edx, %edx
callq 0xba3b
movl $0x100, %ecx            # imm = 0x100
movl %r14d, %eax
cltd
idivl %ecx
movl $0xff, %r15d
andl %r15d, %eax
movl %eax, %edi
callq 0x523f2
andl %r15d, %r14d
movl %r14d, %edi
callq 0x523f2
andw $0x0, 0x2fe8be(%rip)    # 0x356af4
andl %r15d, %ebx
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x523f2
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_sirf_end()
void send_sirf_end()
{
u16 cksum;

   // end the sirf message
   cksum = sirf_tx_cksum;
   cksum &= 0x7FFF;
   sendout(RCVR_PORT, cksum / 256, ADD_CHAR);   // send checksum
   sendout(RCVR_PORT, (cksum % 256) & 0xFF, ADD_CHAR);

   sendout(RCVR_PORT, 0xB0, ADD_CHAR);
   sendout(RCVR_PORT, 0xB3, EOM);

   if(sim_file == 0) Sleep(100); // rate limit send messages gggg
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movzwl 0x2fe89b(%rip), %r14d   # 0x356af4
movl %r14d, %esi
shrl $0x8, %esi
andl $0x7f, %esi
pushq $0xa
popq %rbx
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
movzbl %r14b, %esi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
movl %ebx, %edi
movl $0xb0, %esi
xorl %edx, %edx
callq 0xba3b
pushq $0x1
popq %rdx
movl %ebx, %edi
movl $0xb3, %esi
callq 0xba3b
leaq 0x1d0121(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
je 0x582aa
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x64
popq %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_venus_start(int, int)
void send_venus_start(int id, int len)
{
   // send a Venus binary message start header
   if(log_file && (log_stream & LOG_PACKET_START)) {
      fprintf(log_file, "\nSend venus start %02X  len=%d\n", id, len);
   }

   if(id == 0x08) return;  // protect against possible brickage (firmware download)
   venus_start = id;
   venus_len = len;

   sendout(RCVR_PORT, 0xA0, ADD_CHAR);
   sendout(RCVR_PORT, 0xA1, ADD_CHAR);
   send_word(len);
   venus_tx_cksum = 0;
   send_byte(id);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movl %edi, %ebx
leaq 0x1d0094(%rip), %rax    # 0x228360
movq (%rax), %rdi
testq %rdi, %rdi
je 0x582f3
leaq 0x1d0135(%rip), %rax    # 0x228410
testb $0x4, (%rax)
je 0x582f3
leaq 0xb6567(%rip), %rsi     # 0x10e84e
movl %ebx, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x9560
cmpl $0x8, %ebx
jne 0x58303
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, 0x2fe7df(%rip)    # 0x356ae8
movl %r14d, 0x2fe7dc(%rip)   # 0x356aec
pushq $0xa
popq %r15
movl %r15d, %edi
movl $0xa0, %esi
xorl %edx, %edx
callq 0xba3b
movl %r15d, %edi
movl $0xa1, %esi
xorl %edx, %edx
callq 0xba3b
movzwl %r14w, %edi
callq 0x52599
movb $0x0, 0x2fe791(%rip)    # 0x356ad3
movzbl %bl, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x523f2
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_venus_save(int)
void send_venus_save(int allow_eeprom)
{
   if(VENUS_SAVE && allow_eeprom && (no_eeprom_writes == 0)) {
      send_byte(1);  // update SRAM and EEPROM
BEEP(507);  // gggg
      ++ee_write_count;
   }
   else {
      send_byte(0);           // update SRAM
   }
   send_venus_end();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %edi, %edi
je 0x58391
leaq 0x29ed71(%rip), %rax    # 0x2f70d4
cmpl $0x0, (%rax)
je 0x58391
leaq 0x1acec7(%rip), %rax    # 0x205236
cmpb $0x0, (%rax)
jne 0x58391
pushq $0x1
popq %rdi
callq 0x523f2
movl $0x1fb, %edi            # imm = 0x1FB
callq 0x9d23
leaq 0x1aceab(%rip), %rax    # 0x205238
incl (%rax)
jmp 0x58398
xorl %edi, %edi
callq 0x523f2
popq %rbp
jmp 0x59f48
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_enviro_cmd(char*, unsigned int)
void send_enviro_cmd(char *s, unsigned port)
{
unsigned i,j;

   // send a command to the environmental sensor
   if(s == 0) return;
   if(port >= NUM_COM_PORTS) return;

   j = strlen(s);
   for(i=0; i<j; i++) {
      sendout(port, (u08) s[i], ADD_CHAR);
   }
   sendout(port, 0, FLUSH_COM);
if(ENVIRO_SLEEP) Sleep(ENVIRO_SLEEP);
if(0 && debug_file) fprintf(debug_file, "send thermo port %d[%d]:%s\n", port,com[port].com_port, s);
}

// Assembly:
testq %rdi, %rdi
sete %al
cmpl $0x13, %esi
setae %cl
orb %al, %cl
je 0x593dd
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
callq 0x9120
movl %eax, %r15d
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x59410
movzbl (%r14,%r12), %esi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
incq %r12
jmp 0x593f8
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: request_fw_ver()
void request_fw_ver()
{
   if(luxor) return;
   if(no_poll) return;

   if(rcvr_type == TSIP_RCVR) {
      if(ACU_GG) ;
      else if(ACU_360) ;
      else if(ACUTIME) ;
      else if(PALISADE) ;
      else if(SV6_FAMILY) return;
      send_tsip_start(0x1C);   //!!! ThunderBolt-E, Resolution only
      send_byte(0x01);
      send_tsip_end();
   }
}

// Assembly:
leaq 0x1cfb13(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0x59431
retq
leaq 0x2c7be8(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0x59430
leaq 0x1a948c(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0x59430
leaq 0x1abb83(%rip), %rax    # 0x204fd4
movl (%rax), %eax
cmpl $0x33, %eax
je 0x59430
cmpl $0x36, %eax
je 0x59430
pushq %rbp
movq %rsp, %rbp
pushq $0x1c
popq %rdi
callq 0x5707f
pushq $0x1
popq %rdi
callq 0x523f2
popq %rbp
jmp 0x570f8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_unk_ver()
void request_unk_ver()
{
   if(luxor) return;
   if(no_poll) return;
   if(rcvr_type != TSIP_RCVR) return;
   if(SV6_FAMILY) return;

   send_tsip_start(0x1C);   //!!! ??? receiver only
   send_byte(0x02);
   send_tsip_end();
}

// Assembly:
leaq 0x1cfac0(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
jne 0x594b7
leaq 0x2c7b96(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0x594b7
leaq 0x1a943a(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0x594b7
leaq 0x1abb31(%rip), %rax    # 0x204fd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x594b8
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x594b8
retq
pushq %rbp
movq %rsp, %rbp
pushq $0x1c
popq %rdi
callq 0x5707f
pushq $0x2
popq %rdi
callq 0x523f2
popq %rbp
jmp 0x570f8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_hw_ver()
void request_hw_ver()
{
   if(luxor) return;
   if(no_poll) return;

   if(rcvr_type == TSIP_RCVR) {
      if(ACU_GG) ;
      else if(ACU_360) ;
      else if(ACUTIME) ;
      else if(PALISADE) ;
      else if(SV6_FAMILY) return;
      send_tsip_start(0x1C);   //!!! ThunderBolt-E, Resolution only
      send_byte(0x03);
      send_tsip_end();
   }
}

// Assembly:
leaq 0x1cfa65(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0x594df
retq
leaq 0x2c7b3a(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0x594de
leaq 0x1a93de(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0x594de
leaq 0x1abad5(%rip), %rax    # 0x204fd4
movl (%rax), %eax
cmpl $0x33, %eax
je 0x594de
cmpl $0x36, %eax
je 0x594de
pushq %rbp
movq %rsp, %rbp
pushq $0x1c
popq %rdi
callq 0x5707f
pushq $0x3
popq %rdi
callq 0x523f2
popq %rbp
jmp 0x570f8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_c2()
void request_c2()
{
   if(luxor) return;
   if(no_poll) return;
   if(rcvr_type != TSIP_RCVR) return;
   if(SV6_FAMILY) return;

   send_tsip_start(0xC2);   //!!! ??? receiver
   send_tsip_end();
}

// Assembly:
leaq 0x1cfa12(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
jne 0x59565
leaq 0x2c7ae8(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0x59565
leaq 0x1a938c(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0x59565
leaq 0x1aba83(%rip), %rax    # 0x204fd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x59566
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x59566
retq
pushq %rbp
movq %rsp, %rbp
movl $0xc2, %edi
callq 0x5707f
popq %rbp
jmp 0x570f8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_7A_00()
void request_7A_00()
{
   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;
   // config NMEA output

   send_tsip_start(0x7A);   //!!! ??? receiver
   send_byte(0x00);
   send_tsip_end();
}

// Assembly:
leaq 0x1cf9bd(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
jne 0x595ba
leaq 0x2c7a93(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0x595ba
leaq 0x1a9337(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0x595ba
leaq 0x1aba2e(%rip), %rax    # 0x204fd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x595bb
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x595bb
retq
pushq %rbp
movq %rsp, %rbp
pushq $0x7a
popq %rdi
callq 0x5707f
xorl %edi, %edi
callq 0x523f2
popq %rbp
jmp 0x570f8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_rcvr_health()
void request_rcvr_health()
{
   if(luxor) return;
   if(no_poll) return;
   if(rcvr_type != TSIP_RCVR) return;

   send_tsip_start(0x26);   //!!! ThunderBolt-E only
   send_tsip_end();
}

// Assembly:
leaq 0x1cf963(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
jne 0x5960b
leaq 0x2c7a39(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0x5960b
leaq 0x1a92dd(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0x5960b
pushq %rbp
movq %rsp, %rbp
pushq $0x26
popq %rdi
callq 0x5707f
popq %rbp
jmp 0x570f8
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_utc_info()
void request_utc_info()
{
   if(luxor) return;
   if(no_poll) return;

   if(rcvr_type == BRANDY_RCVR) {
      queue_brandy_cmd("j", BRANDY_LEAP_MSG);
   }
   else if(rcvr_type == FURUNO_RCVR) {
//    send_furuno_cmp("GPint,tlp00");  // we get this from GPtps message
   }
   else if(rcvr_type == TSIP_RCVR) {
      if(saw_version == 0) return;
      if(res_t == RES_T) return;   // this message can hose up this receiver for 3 seconds
      if(SV6_FAMILY) {
         send_tsip_start(0x2F);       // get UTC (leapsecond) info from sat data
         send_tsip_end();
      }
      else {
         send_tsip_start(0x38);       // get UTC (leapsecond) info from sat data
         send_byte(0x01);
         send_byte(0x05);
         send_byte(0x00);
         send_tsip_end();
      }
   }
   else if(rcvr_type == MOTO_RCVR) {
      request_moto_leap(0);
   }
   else if(rcvr_type == NVS_RCVR) {
      send_nvs_start(0x2B);
      send_nvs_end();
   }
   else if(rcvr_type == SS_RCVR) {  // get leapsecond info
//    request_ss_msg(75);           // ... now set in conig_rcvr
   }
   else if(rcvr_type == UBX_RCVR) {  // get leapsecond info
      request_ubx_msg(UBX_LEAP);
   }
   else if(rcvr_type == ZYFER_RCVR) {  // get leapsecond info
      send_zyfer_cmd("$LEAP");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1cf927(%rip), %rax    # 0x228f3e
leaq 0x2c7a02(%rip), %rcx    # 0x321020
movb (%rcx), %cl
orb (%rax), %cl
je 0x59626
popq %rbp
retq
leaq 0x1a92a3(%rip), %rax    # 0x2028d0
movq (%rax), %rax
cmpq $0x1, %rax
je 0x5969a
cmpq $0x4, %rax
je 0x5968f
cmpq $0x20, %rax
je 0x5966c
cmpq $0x800, %rax            # imm = 0x800
je 0x59681
cmpq $0x100000, %rax         # imm = 0x100000
je 0x59674
cmpq $0x40000, %rax          # imm = 0x40000
jne 0x59624
leaq 0xb54c6(%rip), %rdi     # 0x10eb27
movl $0x195, %esi            # imm = 0x195
popq %rbp
jmp 0x576d4
xorl %edi, %edi
popq %rbp
jmp 0x59704
leaq 0xb0ea1(%rip), %rdi     # 0x10a51c
popq %rbp
jmp 0x579af
pushq $0x2b
popq %rdi
callq 0x5707f
popq %rbp
jmp 0x57171
movl $0xb02, %edi            # imm = 0xB02
popq %rbp
jmp 0x59749
leaq 0x29dd67(%rip), %rax    # 0x2f7408
cmpl $0x0, (%rax)
je 0x59624
leaq 0x1a9253(%rip), %rax    # 0x202904
cmpb $0x1, (%rax)
je 0x59624
leaq 0x1ab913(%rip), %rax    # 0x204fd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x596e3
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0x596e3
pushq $0x2f
popq %rdi
callq 0x5707f
popq %rbp
jmp 0x570f8
pushq $0x38
popq %rdi
callq 0x5707f
pushq $0x1
popq %rdi
callq 0x523f2
pushq $0x5
popq %rdi
callq 0x523f2
xorl %edi, %edi
callq 0x523f2
jmp 0x596dd
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_moto_leap(int)
void request_moto_leap(int rate)
{
   if(no_poll) return;

   send_moto_start("Gj");
   send_moto_end();

   send_moto_start("Bj");
   send_byte(rate);
   send_moto_end();
}

// Assembly:
leaq 0x2c7915(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
je 0x59711
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0xb5403(%rip), %rdi     # 0x10eb23
callq 0x59a28
callq 0x59aab
leaq 0xb53f5(%rip), %rdi     # 0x10eb26
callq 0x59a28
movzbl %bl, %edi
callq 0x523f2
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x59aab
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_sv6_config(int)
void request_sv6_config(int force)
{
   if(luxor) return;
   if(no_poll) return;

   if(rcvr_type == TSIP_RCVR) {
      if(SV6_FAMILY && (force == 0)) return;  //ttttt qqqqq  doing this screws up the decice!
      if(ACU_GG) return;
      if(ACU_360) return;

      send_tsip_start(0x2C);       // get SV6 config
      send_byte(0);
      send_single(-1.0);
      send_single(-1.0);
      send_single(-1.0);
      send_single(-1.0);
      send_tsip_end();
      if(sim_file == 0) Sleep(200);
   }
}

// Assembly:
leaq 0x1cf7c6(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0x5977e
retq
leaq 0x2c789b(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0x5977d
leaq 0x1a913f(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0x5977d
leaq 0x1ab836(%rip), %rax    # 0x204fd4
movl (%rax), %eax
cmpl $0x36, %eax
sete %cl
cmpl $0x33, %eax
sete %sil
cmpl $0x50, %eax
sete %r8b
cmpl $0x41, %eax
sete %dl
testl %edi, %edi
jne 0x597c8
orb %sil, %cl
orb %r8b, %dl
orb %cl, %dl
jne 0x5977d
movl %eax, %edx
xorl $0x41, %edx
leaq 0x1a9124(%rip), %rcx    # 0x2028f8
movl (%rcx), %ecx
movl %ecx, %esi
xorl $0x47, %esi
orl %edx, %esi
je 0x5977d
cmpl $0x41, %eax
jne 0x597ee
cmpl $0x33, %ecx
je 0x5977d
cmpl $0x47, %ecx
je 0x5977d
pushq %rbp
movq %rsp, %rbp
pushq $0x2c
popq %rdi
callq 0x5707f
xorl %edi, %edi
callq 0x523f2
movss 0x9d8df(%rip), %xmm0    # 0xf70e8
callq 0x52673
movss 0x9d8d2(%rip), %xmm0    # 0xf70e8
callq 0x52673
movss 0x9d8c5(%rip), %xmm0    # 0xf70e8
callq 0x52673
movss 0x9d8b8(%rip), %xmm0    # 0xf70e8
callq 0x52673
callq 0x570f8
leaq 0x1ceb7f(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
popq %rbp
jne 0x5977d
movl $0xc8, %edi
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_osc_offset()
void request_osc_offset()
{
   if(luxor) return;
   if(no_poll) return;

   if(rcvr_type == TSIP_RCVR) {
      send_tsip_start(0x2D);       // get SV6 osc offset in Hz
      send_tsip_end();
   }
}

// Assembly:
leaq 0x1cf6e1(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0x59863
retq
leaq 0x2c77b6(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0x59862
leaq 0x1a905a(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0x59862
pushq %rbp
movq %rsp, %rbp
pushq $0x2d
popq %rdi
callq 0x5707f
popq %rbp
jmp 0x570f8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: write_all_nvs()
void write_all_nvs()
{
   if(read_only) return;
   if(luxor) return;
   if(no_eeprom_writes) return;

   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);   //!!! ThunderBolt-E only
      send_byte(0x26);
      send_tsip_end();
   }

   BEEP(500);   // !!! if you hear lots of beeps,  you may be wearing out the EEPROM
}

// Assembly:
leaq 0x2c7785(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
jne 0x598da
leaq 0x1cf69d(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
jne 0x598da
leaq 0x1ab989(%rip), %rax    # 0x205236
cmpb $0x0, (%rax)
jne 0x598da
leaq 0x1a9017(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
jne 0x598f7
leaq 0x1ab70e(%rip), %rax    # 0x204fd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x598db
movl $0x20000009, %ecx       # imm = 0x20000009
btl %eax, %ecx
jae 0x598db
retq
pushq %rbp
movq %rsp, %rbp
movl $0x8e, %edi
callq 0x5707f
pushq $0x26
popq %rdi
callq 0x523f2
callq 0x570f8
popq %rbp
movl $0x1f4, %edi            # imm = 0x1F4
jmp 0x9d23
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: restart_gpsdo()
void restart_gpsdo()
{
   // re-awaken a GPSDO after a reset
   if(saw_nortel || saw_ntpx || (rcvr_type == MOTO_RCVR) || (rcvr_type == NVS_RCVR)) {
      vidstr(EDIT_ROW+4, EDIT_COL, PROMPT_COLOR, "There is a 20 second reset delay...");
      refresh_page();
      Sleep(20000);
      SetDtrLine(RCVR_PORT, 1);
      if(NO_SCPI_BREAK && (rcvr_type == SCPI_RCVR)) ; 
      else SendBreak(RCVR_PORT);
      Sleep(2000);
   }
}

// Assembly:
leaq 0x1cf632(%rip), %rax    # 0x228f3a
cmpb $0x0, (%rax)
jne 0x59932
leaq 0x1cf628(%rip), %rax    # 0x228f3c
cmpb $0x0, (%rax)
jne 0x59932
leaq 0x1a8fb0(%rip), %rax    # 0x2028d0
movq (%rax), %rax
cmpq $0x20, %rax
je 0x59932
cmpq $0x800, %rax            # imm = 0x800
je 0x59932
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2cfccd(%rip), %rax    # 0x32960c
movl (%rax), %edi
addl $0x4, %edi
leaq 0x2cfcc5(%rip), %rax    # 0x329610
movl (%rax), %esi
leaq 0xb0bcd(%rip), %rcx     # 0x10a521
pushq $0xb
popq %rdx
callq 0xe2d2
callq 0xaa05
movl $0x4e20, %edi           # imm = 0x4E20
callq 0xae83
pushq $0xa
popq %rbx
pushq $0x1
popq %rsi
movl %ebx, %edi
callq 0xad58
movl %ebx, %edi
callq 0xae2d
movl $0x7d0, %edi            # imm = 0x7D0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: restart_zodiac_rcvr()
void restart_zodiac_rcvr()
{
   // re-init ZODIAC receiver message format after a restart
   if(force_mode_change) {     // leave the receiver in Motorola mode
      rcvr_type = MOTO_RCVR;
      config_rcvr_type(0);
      need_msg_init = 2000;
      force_mode_change = 0;
   }
   else {
      send_moto_start("Wb");  // set Jupiter-T receiver protocol to Zodiac mode
      send_byte(1);
      send_moto_end();
      Sleep(1000);

      tsip_sync = 0;
      tsip_wptr = 0;
      tsip_rptr = 0;
      init_messages(70, 1);
   }

   Sleep(250);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1ab684(%rip), %rbx    # 0x205020
cmpl $0x0, (%rbx)
je 0x599c8
leaq 0x1a8f28(%rip), %rax    # 0x2028d0
movq $0x20, (%rax)
xorl %edi, %edi
callq 0x473fa
leaq 0x1ab673(%rip), %rax    # 0x205030
movl $0x7d0, (%rax)          # imm = 0x7D0
andl $0x0, (%rbx)
jmp 0x59a18
leaq 0xb0b76(%rip), %rdi     # 0x10a545
callq 0x59a28
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x523f2
callq 0x59aab
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xae83
leaq 0x2c8862(%rip), %rax    # 0x322256
andw $0x0, (%rax)
leaq 0x2c8853(%rip), %rax    # 0x322252
andw $0x0, (%rax)
leaq 0x2c884a(%rip), %rax    # 0x322254
andw $0x0, (%rax)
pushq $0x46
popq %rdi
movl %ebx, %esi
callq 0x59afe
movl $0xfa, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_moto_start(char*)
void send_moto_start(char *s)
{
   // send a Motorola binary message start header
   if(s == 0) return;
   if(log_file && (log_stream & LOG_PACKET_START)) {
      fprintf(log_file, "\nSend moto start %s\n", s);
   }

   sendout(RCVR_PORT, '@', ADD_CHAR);
   sendout(RCVR_PORT, '@', ADD_CHAR);
   moto_tx_cksum = 0;
   send_byte(s[0]);
   send_byte(s[1]);
}

// Assembly:
testq %rdi, %rdi
je 0x59aaa
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1ce91f(%rip), %rax    # 0x228360
movq (%rax), %rdi
testq %rdi, %rdi
je 0x59a66
leaq 0x1ce9c0(%rip), %rax    # 0x228410
testb $0x4, (%rax)
je 0x59a66
leaq 0xb50b2(%rip), %rsi     # 0x10eb0e
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
pushq $0xa
popq %r14
pushq $0x40
popq %r15
movl %r14d, %edi
movl %r15d, %esi
xorl %edx, %edx
callq 0xba3b
movl %r14d, %edi
movl %r15d, %esi
xorl %edx, %edx
callq 0xba3b
movb $0x0, 0x2fd034(%rip)    # 0x356ac3
movzbl (%rbx), %edi
callq 0x523f2
movzbl 0x1(%rbx), %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x523f2
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_moto_end()
void send_moto_end()
{
   // send Motorola binary message checksum and end-of-packet
   sendout(RCVR_PORT, moto_tx_cksum, ADD_CHAR);
   sendout(RCVR_PORT, 0x0D, ADD_CHAR);
   sendout(RCVR_PORT, 0x0A, EOM);
   if(sim_file == 0) Sleep(50);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movzbl 0x2fd00b(%rip), %esi    # 0x356ac3
pushq $0xa
popq %rbx
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0xd
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0x1
popq %rdx
movl %ebx, %edi
movl %ebx, %esi
callq 0xba3b
leaq 0x1ce8dd(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
je 0x59af0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x32
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: update_ubx_config(unsigned int, unsigned int, unsigned int)
void update_ubx_config(u32 clear, u32 save, u32 load)
{
#define EE_MSG_SIZE 12

   send_ubx_start(UBX_EEPROM, EE_MSG_SIZE);
   send_dword(clear);   // reset params from permanent config
   send_dword(save);    // save params to EEPROM
   send_dword(load);    // load config from EEPROM

   if(EE_MSG_SIZE == 13) {  // storage device select
      send_byte(0x17);      // all devices
   }
   send_ubx_end();

   if(save) {
      BEEP(501);
      ++ee_write_count;
      Sleep(1000);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movl %edi, %r15d
pushq $0xc
popq %rsi
movl $0x609, %edi            # imm = 0x609
callq 0x57bf3
movl %r15d, %edi
callq 0x525e2
movl %r14d, %edi
callq 0x525e2
movl %ebx, %edi
callq 0x525e2
callq 0x57cca
testl %r14d, %r14d
je 0x59e2f
movl $0x1f5, %edi            # imm = 0x1F5
callq 0x9d23
leaq 0x1ab41f(%rip), %rax    # 0x205238
incl (%rax)
movl $0x3e8, %edi            # imm = 0x3E8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xae83
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: venus_restart(int)
void venus_restart(int mode)
{
s16 val;

   send_venus_start(SET_VENUS_RESTART);
   send_byte(mode);
   send_word(pri_year);
   send_byte(pri_month);
   send_byte(pri_day);
   send_byte(pri_hours);
   send_byte(pri_minutes);
   send_byte(pri_seconds);

   val = (s16) (lat * 180.0 / PI * 100.0);
   send_word(val);

   val = (s16) (lon * 180.0 / PI * 100.0);
   send_word(val);

   val = (s16) alt;
   send_word(val);

   send_venus_end();

   Sleep(5000);
   init_messages(50, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %r14d
pushq $0x1
popq %rbx
pushq $0xf
popq %rsi
movl %ebx, %edi
callq 0x582b6
movzbl %r14b, %edi
callq 0x523f2
leaq 0x29d6b3(%rip), %rax    # 0x2f7514
movzwl (%rax), %edi
callq 0x52599
leaq 0x29d6a0(%rip), %rax    # 0x2f7510
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29d68d(%rip), %rax    # 0x2f750c
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29d67a(%rip), %rax    # 0x2f7508
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29d667(%rip), %rax    # 0x2f7504
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29d654(%rip), %rax    # 0x2f7500
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29d115(%rip), %rax    # 0x2f6fd0
movsd (%rax), %xmm0
mulsd 0x9b9e1(%rip), %xmm0    # 0xf58a8
divsd 0x9b9d1(%rip), %xmm0    # 0xf58a0
mulsd 0x99189(%rip), %xmm0    # 0xf3060
cvttsd2si %xmm0, %edi
movl $0xffff, %r14d          # imm = 0xFFFF
andl %r14d, %edi
callq 0x52599
leaq 0x29d0e8(%rip), %rax    # 0x2f6fd8
movsd 0x9b9b0(%rip), %xmm0    # 0xf58a8
mulsd (%rax), %xmm0
divsd 0x9b99c(%rip), %xmm0    # 0xf58a0
mulsd 0x99154(%rip), %xmm0    # 0xf3060
cvttsd2si %xmm0, %edi
andl %r14d, %edi
callq 0x52599
leaq 0x29d0c1(%rip), %rax    # 0x2f6fe0
cvttsd2si (%rax), %edi
andl %r14d, %edi
callq 0x52599
callq 0x59f48
movl $0x1388, %edi           # imm = 0x1388
callq 0xae83
pushq $0x32
popq %rdi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x59afe
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_venus_end()
void send_venus_end()
{
   venus_tx_cksum &= 0xFF;
   sendout(RCVR_PORT, venus_tx_cksum, ADD_CHAR);
   sendout(RCVR_PORT, 0x0D, ADD_CHAR);
   sendout(RCVR_PORT, 0x0A, EOM);
   venus_start = venus_len = 0;
   if(sim_file == 0) Sleep(20);   // slightly rate limit sent messages
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movzbl 0x2fcb7e(%rip), %esi    # 0x356ad3
pushq $0xa
popq %rbx
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0xd
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0xba3b
pushq $0x1
popq %rdx
movl %ebx, %edi
movl %ebx, %esi
callq 0xba3b
andl $0x0, 0x2fcb6c(%rip)    # 0x356aec
andl $0x0, 0x2fcb61(%rip)    # 0x356ae8
leaq 0x1ce432(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
je 0x59f9b
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x14
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: enable_moto_binary()
void enable_moto_binary()
{
   // switch motorola receiver to binary mode

   rcvr_type = NMEA_RCVR;
   send_nmea_cmd("PMOTG,GGA,0000");
   send_nmea_cmd("PMOTG,GLL,0000");
   send_nmea_cmd("PMOTG,GSA,0000");
   send_nmea_cmd("PMOTG,GSV,0000");
   send_nmea_cmd("PMOTG,RMC,0000");
   send_nmea_cmd("PMOTG,VTG,0000");
   send_nmea_cmd("PMOTG,ZDA,0000");

   send_nmea_cmd("PMOTG,FOR,0");
   Sleep(500);

   com[RCVR_PORT].baud_rate = 9600;
   com[RCVR_PORT].data_bits = 8;
   com[RCVR_PORT].parity = NO_PAR;
   com[RCVR_PORT].stop_bits = 1;
   init_com(RCVR_PORT, 103);
   Sleep(100);
   drain_port(RCVR_PORT);

   tsip_sync = 0;
   tsip_wptr = 0;
   tsip_rptr = 0;
   auto_detect(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1a891a(%rip), %rax    # 0x2028d0
movq $0x2, (%rax)
leaq 0xb0584(%rip), %rdi     # 0x10a548
callq 0x579af
leaq 0xb0587(%rip), %rdi     # 0x10a557
callq 0x579af
leaq 0xb058a(%rip), %rdi     # 0x10a566
callq 0x579af
leaq 0xb058d(%rip), %rdi     # 0x10a575
callq 0x579af
leaq 0xb0590(%rip), %rdi     # 0x10a584
callq 0x579af
leaq 0xb0593(%rip), %rdi     # 0x10a593
callq 0x579af
leaq 0xb0596(%rip), %rdi     # 0x10a5a2
callq 0x579af
leaq 0xb0599(%rip), %rdi     # 0x10a5b1
callq 0x579af
movl $0x1f4, %edi            # imm = 0x1F4
callq 0xae83
movaps 0x99192(%rip), %xmm0    # 0xf31c0
leaq 0x29e2ab(%rip), %rax    # 0x2f82e0
movaps %xmm0, 0x159d0(%rax)
pushq $0xa
popq %rbx
pushq $0x67
popq %rsi
movl %ebx, %edi
callq 0xb30a
pushq $0x64
popq %rdi
callq 0xae83
movl %ebx, %edi
callq 0x5142f
leaq 0x2c81f7(%rip), %rax    # 0x322256
andw $0x0, (%rax)
leaq 0x2c81e8(%rip), %rax    # 0x322252
andw $0x0, (%rax)
leaq 0x2c81df(%rip), %rax    # 0x322254
andw $0x0, (%rax)
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5a086
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: xxx_enable_moto_binary()
void xxx_enable_moto_binary()
{
   // put Motorola receiver into BINARY mode

   rcvr_type = NMEA_RCVR;
   send_nmea_cmd("PMOTG,FOR,0");
   Sleep(500);

   com[RCVR_PORT].baud_rate = 9600;
   com[RCVR_PORT].data_bits = 8;
   com[RCVR_PORT].parity = NO_PAR;
   com[RCVR_PORT].stop_bits = 1;
   init_com(RCVR_PORT, 103);
   Sleep(100);

   rcvr_type = MOTO_RCVR;
   auto_detect(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1a6ccb(%rip), %rbx    # 0x2028d0
movq $0x2, (%rbx)
leaq 0xae99e(%rip), %rdi     # 0x10a5b1
callq 0x579af
movl $0x1f4, %edi            # imm = 0x1F4
callq 0xae83
movaps 0x97597(%rip), %xmm0    # 0xf31c0
leaq 0x29c6b0(%rip), %rax    # 0x2f82e0
movaps %xmm0, 0x159d0(%rax)
pushq $0xa
popq %rdi
pushq $0x67
popq %rsi
callq 0xb30a
pushq $0x64
popq %rdi
callq 0xae83
movq $0x20, (%rbx)
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5a086
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: enable_moto_nmea()
void enable_moto_nmea()
{
//send_moto_start("Eq"); // testing ASCII position message
//send_byte(0);
//send_moto_end();
//return;

   // put Motorola receiver into NMEA mode

   send_moto_start("Ci");
   if(furuno_moto == 0) send_byte(1);       // !!!!!! ESIP_RCVR motorola mode  !!!!!!!!!!
   send_moto_end();
   Sleep(500);

   if(furuno_moto) {  // switch to ESIP_RCVR mode
      force_mode_change = 0;
      com[RCVR_PORT].baud_rate = 38400;
      com[RCVR_PORT].data_bits = 8;
      com[RCVR_PORT].parity = NO_PAR;
      com[RCVR_PORT].stop_bits = 1;
      init_com(RCVR_PORT, 101);
      Sleep(100);
      rcvr_type = ESIP_RCVR;
   }
   else {
      com[RCVR_PORT].baud_rate = 4800;
      com[RCVR_PORT].data_bits = 8;
      com[RCVR_PORT].parity = NO_PAR;
      com[RCVR_PORT].stop_bits = 1;
      init_com(RCVR_PORT, 102);
      Sleep(100);

      rcvr_type = NMEA_RCVR;
      send_nmea_cmd("PMOTG,GGA,0001");
      send_nmea_cmd("PMOTG,GLL,0001");
      send_nmea_cmd("PMOTG,GSA,0001");
      send_nmea_cmd("PMOTG,GSV,0001");
      send_nmea_cmd("PMOTG,RMC,0001");
      send_nmea_cmd("PMOTG,VTG,0001");
      send_nmea_cmd("PMOTG,ZDA,0001");
   }

// auto_detect(0);
   config_rcvr_type(0);
   need_msg_init = 2001;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0xae952(%rip), %rdi     # 0x10a5bd
callq 0x59a28
leaq 0x1a72c9(%rip), %rbx    # 0x202f40
cmpl $0x0, (%rbx)
jne 0x5bc84
pushq $0x1
popq %rdi
callq 0x523f2
callq 0x59aab
movl $0x1f4, %edi            # imm = 0x1F4
callq 0xae83
cmpl $0x0, (%rbx)
je 0x5bcde
leaq 0x1a9381(%rip), %rax    # 0x205020
andl $0x0, (%rax)
movaps 0x9b3f7(%rip), %xmm0    # 0xf70a0
leaq 0x29c630(%rip), %rax    # 0x2f82e0
movaps %xmm0, 0x159d0(%rax)
pushq $0xa
popq %rdi
pushq $0x65
popq %rsi
callq 0xb30a
pushq $0x64
popq %rdi
callq 0xae83
leaq 0x1a6bff(%rip), %rax    # 0x2028d0
movl $0x80000000, %ecx       # imm = 0x80000000
movq %rcx, (%rax)
jmp 0x5bd68
movaps 0x9b34b(%rip), %xmm0    # 0xf7030
leaq 0x29c5f4(%rip), %rax    # 0x2f82e0
movaps %xmm0, 0x159d0(%rax)
pushq $0xa
popq %rdi
pushq $0x66
popq %rsi
callq 0xb30a
pushq $0x64
popq %rdi
callq 0xae83
leaq 0x1a6bc3(%rip), %rax    # 0x2028d0
movq $0x2, (%rax)
leaq 0xae8a5(%rip), %rdi     # 0x10a5c0
callq 0x579af
leaq 0xae8a8(%rip), %rdi     # 0x10a5cf
callq 0x579af
leaq 0xae8ab(%rip), %rdi     # 0x10a5de
callq 0x579af
leaq 0xae8ae(%rip), %rdi     # 0x10a5ed
callq 0x579af
leaq 0xae8b1(%rip), %rdi     # 0x10a5fc
callq 0x579af
leaq 0xae8b4(%rip), %rdi     # 0x10a60b
callq 0x579af
leaq 0xae8b7(%rip), %rdi     # 0x10a61a
callq 0x579af
xorl %edi, %edi
callq 0x473fa
leaq 0x1a92ba(%rip), %rax    # 0x205030
movl $0x7d1, (%rax)          # imm = 0x7D1
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_cs_remote(int)
void set_cs_remote(int mode)
{
   if(read_only) return;

   if(rcvr_type == CS_RCVR) {
      if(mode) queue_cs_cmd("SYST:REM ON", CS_REM_MSG);
      else     queue_cs_cmd("SYST:REM OFF", CS_REM_MSG);
      queue_cs_cmd("SYST:REM?", CS_REM_MSG);
   }
}

// Assembly:
leaq 0x2c5174(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
jne 0x5beef
leaq 0x1a6a1e(%rip), %rax    # 0x2028d0
cmpq $0x20000, (%rax)        # imm = 0x20000
jne 0x5beef
pushq %rbp
movq %rsp, %rbp
testl %edi, %edi
leaq 0xb3aaa(%rip), %rax     # 0x10f972
leaq 0xb3a97(%rip), %rdi     # 0x10f966
cmoveq %rax, %rdi
movl $0x146, %esi            # imm = 0x146
callq 0x576d4
leaq 0xae84d(%rip), %rdi     # 0x10a731
movl $0x146, %esi            # imm = 0x146
popq %rbp
jmp 0x576d4
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: init_z12(int)
void init_z12(int mode)
{
int baud;
int i;

   // mode 0 -> no mem reset
   // mode 1 -> reset internal memory
   // mode 2 -> reset external memory
   // mode 3 -> reset all memory

   i = (-1);
   baud = com[RCVR_PORT].baud_rate;
   if     (baud == 150) ;   // don't allow non-standard values
   else if(baud == 300) i = 0;   
   else if(baud == 600) i = 1;   
   else if(baud == 1200) i = 2;  
   else if(baud == 2400) i = 3;  
   else if(baud == 4800) i = 4;  
   else if(baud == 9600) i = 5;  
   else if(baud == 19200) i = 6; 
   else if(baud == 38400) i = 7; 
   else if(baud == 57600) i = 8; 
   else if(baud == 115200) i = 9; 
   else if(baud == 230400) i = (-1);
   sprintf(out, "PASHS,INI,%d,%d,%d,%d,%d,0", i,i,i,i,mode);
//lfs sprintf(debug_text, "baud:%d  i:%d  msg:%s", baud,i,out);
   if(i < 0) return;

   send_z12_cmd(out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x29c3e3(%rip), %rax    # 0x2f82e0
movl 0x159d0(%rax), %eax
cmpl $0x12c, %eax            # imm = 0x12C
je 0x5bf97
cmpl $0x1c200, %eax          # imm = 0x1C200
je 0x5bf55
cmpl $0x4b0, %eax            # imm = 0x4B0
je 0x5bf9b
cmpl $0x960, %eax            # imm = 0x960
je 0x5bf61
cmpl $0x12c0, %eax           # imm = 0x12C0
je 0x5bf93
cmpl $0x2580, %eax           # imm = 0x2580
je 0x5bf8f
cmpl $0x4b00, %eax           # imm = 0x4B00
je 0x5bf51
cmpl $0x9600, %eax           # imm = 0x9600
je 0x5bf5d
cmpl $0xe100, %eax           # imm = 0xE100
je 0x5bf59
cmpl $0x258, %eax            # imm = 0x258
jne 0x5bf65
pushq $0x1
jmp 0x5bf9d
pushq $0x6
jmp 0x5bf9d
pushq $0x9
jmp 0x5bf9d
pushq $0x8
jmp 0x5bf9d
pushq $0x7
jmp 0x5bf9d
pushq $0x3
jmp 0x5bf9d
movl %edi, (%rsp)
leaq 0x2ca2b1(%rip), %rdi    # 0x326220
leaq 0xae6b3(%rip), %rsi     # 0x10a629
pushq $-0x1
popq %rcx
movl %ecx, %edx
movl %ecx, %r8d
movl %ecx, %r9d
xorl %eax, %eax
callq 0x9060
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x5
jmp 0x5bf9d
pushq $0x4
jmp 0x5bf9d
xorl %ecx, %ecx
jmp 0x5bf9e
pushq $0x2
popq %rcx
movl %edi, (%rsp)
leaq 0x2ca278(%rip), %rbx    # 0x326220
leaq 0xae67a(%rip), %rsi     # 0x10a629
movq %rbx, %rdi
movl %ecx, %edx
movl %ecx, %r8d
movl %ecx, %r9d
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x57b55
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_luxor_time()
void set_luxor_time()
{
   if(luxor == 0) return;

   get_clock_time();   // in UTC

   send_tsip_start(LUXOR_ID); 
   send_byte(0x02);
   send_byte((u08) clk_seconds);
   send_byte((u08) clk_minutes);
   send_byte((u08) clk_hours);
   send_byte((u08) clk_day);
   send_byte((u08) clk_month);
   send_byte((u08) (clk_year%100));
   send_tsip_end();

   luxor_time_set = 1;
}

// Assembly:
leaq 0x1ccb8c(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0x5c445
pushq %rbp
movq %rsp, %rbp
callq 0xa386
movl $0xdc, %edi
callq 0x5707f
pushq $0x2
popq %rdi
callq 0x523f2
leaq 0x29b2f7(%rip), %rax    # 0x2f76d4
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29b2e4(%rip), %rax    # 0x2f76d0
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29b2d1(%rip), %rax    # 0x2f76cc
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29b2ba(%rip), %rax    # 0x2f76c4
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29b2a7(%rip), %rax    # 0x2f76c0
movzbl (%rax), %edi
callq 0x523f2
leaq 0x29b2a0(%rip), %rax    # 0x2f76c8
movl (%rax), %eax
pushq $0x64
popq %rcx
cltd
idivl %ecx
movzbl %dl, %edi
callq 0x523f2
callq 0x570f8
movb $0x1, 0x2f99da(%rip)    # 0x355e1e
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_rftg_reset(int)
void request_rftg_reset(int mode)
{
   start_rftg_request(0);

   send_rftg_start(0x30);
   send_byte(0x06);
   send_dword(0);
   send_rftg_end();

   set_rftg_normal();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0x5d3d8
pushq $0x30
popq %rdi
callq 0x5707f
pushq $0x6
popq %rdi
callq 0x523f2
xorl %edi, %edi
callq 0x525e2
callq 0x570f8
popq %rbp
jmp 0x5d4f6