// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_version()
void request_version()
{
   if(luxor) return;
   if(no_poll) return;

   if(rcvr_type == BRANDY_RCVR) {
      queue_brandy_cmd("n", BRANDY_VERSION_MSG);
   }
   else if(rcvr_type == ESIP_RCVR) {
      send_esip_cmd("PERDSYS,VERSION");
      send_esip_cmd("PERDSYS,GPIO");
   }
   else if(rcvr_type == GPSD_RCVR) {
      send_user_cmd("?DEVICES;");
      send_user_cmd("?VERSION;");
   }
   else if(rcvr_type == LPFRS_RCVR) {
      queue_lpfrs_cmd("V", LPFRS_ID_MSG);
   }
   else if(rcvr_type == MOTO_RCVR) {
      if(!saw_version) {  // this message is rather long, only get the info once
         send_moto_start("Cj");  // request receiver ID string
         send_moto_end();
      }
   }
   else if(rcvr_type == NVS_RCVR) {
      send_nvs_start(0x1B);
      send_nvs_end();
   }
   else if(rcvr_type == PRS_RCVR) {
      queue_prs_cmd("ID?", PRS_ID_MSG);
   }
   else if(rcvr_type == RFTG_RCVR) {
      request_rftg_hw_ver();
   }
   else if(rcvr_type == SA35_RCVR) {
//      queue_sa35_cmd("V", LPFRS_ID_MSG);
   }
   else if(rcvr_type == SIRF_RCVR) {
      query_sirf_msg(GET_SIRF_SW_VER);
   }
   else if(rcvr_type == SS_RCVR) {
      request_ss_msg(45);  // hardware/software version
   }
   else if(rcvr_type == SRO_RCVR) {
      queue_prs_cmd("ID", SRO_ID_MSG);
   }
   else if(rcvr_type == TAIP_RCVR) {
      send_taip_cmd("QVR");  // query version
      send_taip_cmd("QID");  // query unit id
   }
   else if(rcvr_type == TRUE_RCVR) {
      send_true_cmd("$GETVER");   // get receiver version
   }
   else if(rcvr_type == TSIP_RCVR) {
      send_tsip_start(0x1F);
      if(0) {  // requests (undocumented) extended receiver configuration info
         send_byte(0x01);
         send_byte(0x00);
      }
      send_tsip_end();

      request_manuf_params();
      request_prodn_params();
      request_fw_ver();      // !!! testing ThunderBolt-E, Resolution messages
      request_hw_ver();
   }
   else if(rcvr_type == UBX_RCVR) {  // this is a rather wordy message
       if(saw_version == 0) request_ubx_msg(UBX_VER);  // don't request if we already have it
   }
   else if(rcvr_type == VENUS_RCVR) {
      query_venus_msg(QUERY_VENUS_VERSION);
   }
   else if(rcvr_type == Z12_RCVR) {
      if(have_info == 0) send_z12_cmd("PASHQ,RID");
   }
   else if(rcvr_type == ZODIAC_RCVR) {
      query_zod_msg(ZOD_ID_MSG);
      query_zod_msg(ZOD_DIAG_MSG);
   }
   else if(rcvr_type == ZYFER_RCVR) {
      send_zyfer_cmd("$VERS");
      send_zyfer_cmd("$UNID");
      send_zyfer_cmd("$MANI");
      send_zyfer_cmd("$PRID");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1cb771(%rip), %rax    # 0x228f3e
leaq 0x2c384c(%rip), %rcx    # 0x321020
movb (%rcx), %cl
orb (%rax), %cl
je 0x5d7dc
popq %rbp
retq
leaq 0x1a50ed(%rip), %rax    # 0x2028d0
movq (%rax), %rax
cmpq $0x1, %rax
je 0x5da3c
cmpq $0x4, %rax
je 0x5da0b
cmpq $0x20, %rax
je 0x5d9b0
cmpq $0x40, %rax
je 0x5d8df
cmpq $0x80, %rax
je 0x5d985
cmpq $0x100, %rax            # imm = 0x100
je 0x5d8ea
cmpq $0x200, %rax            # imm = 0x200
je 0x5d9e0
cmpq $0x800, %rax            # imm = 0x800
je 0x5d929
cmpq $0x8000, %rax           # imm = 0x8000
je 0x5d8ff
movabsq $0x800000000, %rcx      # imm = 0x800000000
cmpq %rcx, %rax
je 0x5da26
cmpq $0x100000, %rax         # imm = 0x100000
je 0x5d937
cmpq $0x200000, %rax         # imm = 0x200000
je 0x5da2f
cmpq $0x400000, %rax         # imm = 0x400000
je 0x5d9aa
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x5d9f9
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0x5d9d2
cmpq $0x10000000, %rax       # imm = 0x10000000
je 0x5d918
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
je 0x5d991
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
je 0x5d968
cmpq $0x40000, %rax          # imm = 0x40000
jne 0x5d7da
leaq 0x9a285(%rip), %rdi     # 0xf7b5a
movl $0x190, %esi            # imm = 0x190
jmp 0x5da05
movl $0x84, %edi
popq %rbp
jmp 0x5da5e
movl $0x3f3, %edi            # imm = 0x3F3
callq 0x5dabd
movl $0x44c, %edi            # imm = 0x44C
popq %rbp
jmp 0x5dabd
leaq 0xacf08(%rip), %rdi     # 0x10a80e
callq 0x5c473
leaq 0xacf00(%rip), %rdi     # 0x10a812
popq %rbp
jmp 0x5c473
leaq 0xbbd75(%rip), %rdi     # 0x119694
movl $0x385, %esi            # imm = 0x385
jmp 0x5da05
pushq $0x1b
popq %rdi
callq 0x5707f
popq %rbp
jmp 0x57171
leaq 0xaceeb(%rip), %rdi     # 0x10a829
callq 0x579af
leaq 0xacee5(%rip), %rdi     # 0x10a82f
callq 0x579af
leaq 0xacedf(%rip), %rdi     # 0x10a835
callq 0x579af
leaq 0xaced9(%rip), %rdi     # 0x10a83b
popq %rbp
jmp 0x579af
leaq 0x29a005(%rip), %rax    # 0x2f7974
cmpl $0x0, (%rax)
jne 0x5d7da
leaq 0xace9f(%rip), %rdi     # 0x10a81e
popq %rbp
jmp 0x57b55
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
popq %rbp
jmp 0x5da8c
leaq 0xace3e(%rip), %rdi     # 0x10a7d6
callq 0x57791
leaq 0xace42(%rip), %rdi     # 0x10a7e6
popq %rbp
jmp 0x57791
popq %rbp
jmp 0x5d745
leaq 0x299a51(%rip), %rax    # 0x2f7408
cmpl $0x0, (%rax)
jne 0x5d7da
leaq 0xace40(%rip), %rdi     # 0x10a807
callq 0x59a28
popq %rbp
jmp 0x59aab
leaq 0xb0aa1(%rip), %rdi     # 0x10e47a
movl $0x321, %esi            # imm = 0x321
jmp 0x5da05
leaq 0xace0c(%rip), %rdi     # 0x10a7f3
callq 0x5729b
leaq 0xace0a(%rip), %rdi     # 0x10a7fd
popq %rbp
jmp 0x5729b
leaq 0xace0a(%rip), %rdi     # 0x10a80a
movl $0x1f6, %esi            # imm = 0x1F6
popq %rbp
jmp 0x576d4
leaq 0x2999f6(%rip), %rax    # 0x2f7408
cmpl $0x0, (%rax)
jne 0x5d7da
movl $0xa04, %edi            # imm = 0xA04
popq %rbp
jmp 0x59749
pushq $0x2d
popq %rdi
popq %rbp
jmp 0x5da7a
leaq 0xacde0(%rip), %rdi     # 0x10a816
popq %rbp
jmp 0x57acc
pushq $0x1f
popq %rdi
callq 0x5707f
callq 0x570f8
callq 0x5d32e
callq 0x5d383
callq 0x59424
popq %rbp
jmp 0x594d2