// File: /workspace/github_cpp_makefile_star2_O1/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 0x1d9551(%rip), %rax    # 0x23ef3e
leaq 0x2d162c(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
je 0x659fc
popq %rbp
retq
leaq 0x1b2ecd(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x3ffff, %rax          # imm = 0x3FFFF
jle 0x65a57
cmpq $0x7ffffff, %rax        # imm = 0x7FFFFFF
jg 0x65abe
cmpq $0x1fffff, %rax         # imm = 0x1FFFFF
jle 0x65bc0
cmpq $0x200000, %rax         # imm = 0x200000
je 0x65ce3
cmpq $0x400000, %rax         # imm = 0x400000
je 0x65ca1
cmpq $0x1000000, %rax        # imm = 0x1000000
jne 0x659fa
leaq 0xbad95(%rip), %rdi     # 0x1207e2
movl $0x1f6, %esi            # imm = 0x1F6
jmp 0x65d23
cmpq $0x7f, %rax
jle 0x65b09
cmpq $0x1ff, %rax            # imm = 0x1FF
jle 0x65b75
cmpq $0x200, %rax            # imm = 0x200
je 0x65c88
cmpq $0x800, %rax            # imm = 0x800
je 0x65c78
cmpq $0x8000, %rax           # imm = 0x8000
jne 0x659fa
leaq 0xbad4e(%rip), %rdi     # 0x1207e6
callq 0xa36fd
movl $0x1, %edi
callq 0xa3789
leaq 0xbad3c(%rip), %rdi     # 0x1207ea
callq 0xa36fd
movl $0x1, %edi
popq %rbp
jmp 0xa3789
cmpq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
jle 0x65c09
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
je 0x65cf0
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
je 0x65ca7
movabsq $0x800000000, %rcx      # imm = 0x800000000
cmpq %rcx, %rax
jne 0x659fa
movl $0x2d, %edi
popq %rbp
jmp 0x65d47
cmpq $0x1f, %rax
jg 0x65b45
cmpq $0x1, %rax
je 0x65c32
cmpq $0x4, %rax
jne 0x659fa
leaq 0x2a78de(%rip), %rax    # 0x30d408
cmpl $0x0, (%rax)
jne 0x659fa
movl $0xa04, %edi            # imm = 0xA04
xorl %esi, %esi
callq 0x5f3f5
popq %rbp
jmp 0x5f4ce
cmpq $0x20, %rax
je 0x65c56
cmpq $0x40, %rax
jne 0x659fa
movl $0x84, %edi
movl $0x2, %esi
callq 0x5fa97
xorl %edi, %edi
callq 0x591af
popq %rbp
jmp 0x5fb3b
cmpq $0x80, %rax
je 0x65cc4
cmpq $0x100, %rax            # imm = 0x100
jne 0x659fa
movl $0x3f3, %edi            # imm = 0x3F3
movl $0x6, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x645ec
callq 0x646c7
movl $0x44c, %edi            # imm = 0x44C
movl $0x6, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x645ec
popq %rbp
jmp 0x646c7
cmpq $0x40000, %rax          # imm = 0x40000
je 0x65d09
cmpq $0x100000, %rax         # imm = 0x100000
jne 0x659fa
leaq 0xbac22(%rip), %rdi     # 0x120801
callq 0x5f15d
leaq 0xbac1c(%rip), %rdi     # 0x120807
callq 0x5f15d
leaq 0xbac16(%rip), %rdi     # 0x12080d
callq 0x5f15d
leaq 0xbac10(%rip), %rdi     # 0x120813
popq %rbp
jmp 0x5f15d
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0x65d17
cmpq $0x10000000, %rax       # imm = 0x10000000
jne 0x659fa
leaq 0xc9a5c(%rip), %rdi     # 0x12f684
movl $0x385, %esi            # imm = 0x385
jmp 0x65d23
movl $0x1f, %edi
callq 0x5e740
callq 0x5e7c0
callq 0x65468
callq 0x6550c
callq 0x60f52
popq %rbp
jmp 0x61050
leaq 0x2a77ab(%rip), %rax    # 0x30d408
cmpl $0x0, (%rax)
jne 0x659fa
leaq 0xbab72(%rip), %rdi     # 0x1207df
callq 0x61694
popq %rbp
jmp 0x6170f
movl $0x1b, %edi
callq 0x5e740
popq %rbp
jmp 0x5e844
leaq 0xbab3c(%rip), %rdi     # 0x1207cb
callq 0x5e97f
leaq 0xbab3a(%rip), %rdi     # 0x1207d5
popq %rbp
jmp 0x5e97f
popq %rbp
jmp 0x6595d
leaq 0x2a7cc6(%rip), %rax    # 0x30d974
cmpl $0x0, (%rax)
jne 0x659fa
leaq 0xbab38(%rip), %rdi     # 0x1207f6
popq %rbp
jmp 0x5f340
movl $0x2, %edi
movl $0x2, %esi
callq 0x5fbb4
movl $0x1, %edi
callq 0x591af
popq %rbp
jmp 0x61bc3
leaq 0xbab04(%rip), %rdi     # 0x1207ee
popq %rbp
jmp 0x5f2a0
leaq 0xbaab7(%rip), %rdi     # 0x1207ae
callq 0x5ef13
leaq 0xbaabb(%rip), %rdi     # 0x1207be
popq %rbp
jmp 0x5ef13
leaq 0xa7d36(%rip), %rdi     # 0x10da46
movl $0x190, %esi            # imm = 0x190
jmp 0x65d23
leaq 0xbe734(%rip), %rdi     # 0x124452
movl $0x321, %esi            # imm = 0x321
popq %rbp
jmp 0x5ee52