// File: /workspace/github_cpp_makefile_star2_O3/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 0x1d9326(%rip), %rax    # 0x23ef3e
leaq 0x2d1401(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
je 0x65c27
popq %rbp
retq
leaq 0x1b2ca2(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x3ffff, %rax          # imm = 0x3FFFF
jle 0x65c82
cmpq $0x7ffffff, %rax        # imm = 0x7FFFFFF
jg 0x65ce9
cmpq $0x1fffff, %rax         # imm = 0x1FFFFF
jle 0x65deb
cmpq $0x200000, %rax         # imm = 0x200000
je 0x65f0e
cmpq $0x400000, %rax         # imm = 0x400000
je 0x65ecc
cmpq $0x1000000, %rax        # imm = 0x1000000
jne 0x65c25
leaq 0xbac4a(%rip), %rdi     # 0x1208c2
movl $0x1f6, %esi            # imm = 0x1F6
jmp 0x65f4e
cmpq $0x7f, %rax
jle 0x65d34
cmpq $0x1ff, %rax            # imm = 0x1FF
jle 0x65da0
cmpq $0x200, %rax            # imm = 0x200
je 0x65eb3
cmpq $0x800, %rax            # imm = 0x800
je 0x65ea3
cmpq $0x8000, %rax           # imm = 0x8000
jne 0x65c25
leaq 0xbac03(%rip), %rdi     # 0x1208c6
callq 0xa3914
movl $0x1, %edi
callq 0xa39a0
leaq 0xbabf1(%rip), %rdi     # 0x1208ca
callq 0xa3914
movl $0x1, %edi
popq %rbp
jmp 0xa39a0
cmpq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
jle 0x65e34
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
je 0x65f1b
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
je 0x65ed2
movabsq $0x800000000, %rcx      # imm = 0x800000000
cmpq %rcx, %rax
jne 0x65c25
movl $0x2d, %edi
popq %rbp
jmp 0x65f72
cmpq $0x1f, %rax
jg 0x65d70
cmpq $0x1, %rax
je 0x65e5d
cmpq $0x4, %rax
jne 0x65c25
leaq 0x2a76b3(%rip), %rax    # 0x30d408
cmpl $0x0, (%rax)
jne 0x65c25
movl $0xa04, %edi            # imm = 0xA04
xorl %esi, %esi
callq 0x5f37d
popq %rbp
jmp 0x5f456
cmpq $0x20, %rax
je 0x65e81
cmpq $0x40, %rax
jne 0x65c25
movl $0x84, %edi
movl $0x2, %esi
callq 0x5fa1f
xorl %edi, %edi
callq 0x590f7
popq %rbp
jmp 0x5fac3
cmpq $0x80, %rax
je 0x65eef
cmpq $0x100, %rax            # imm = 0x100
jne 0x65c25
movl $0x3f3, %edi            # imm = 0x3F3
movl $0x6, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x646e6
callq 0x648ab
movl $0x44c, %edi            # imm = 0x44C
movl $0x6, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x646e6
popq %rbp
jmp 0x648ab
cmpq $0x40000, %rax          # imm = 0x40000
je 0x65f34
cmpq $0x100000, %rax         # imm = 0x100000
jne 0x65c25
leaq 0xbaad7(%rip), %rdi     # 0x1208e1
callq 0x5f0e5
leaq 0xbaad1(%rip), %rdi     # 0x1208e7
callq 0x5f0e5
leaq 0xbaacb(%rip), %rdi     # 0x1208ed
callq 0x5f0e5
leaq 0xbaac5(%rip), %rdi     # 0x1208f3
popq %rbp
jmp 0x5f0e5
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0x65f42
cmpq $0x10000000, %rax       # imm = 0x10000000
jne 0x65c25
leaq 0xc9921(%rip), %rdi     # 0x12f774
movl $0x385, %esi            # imm = 0x385
jmp 0x65f4e
movl $0x1f, %edi
callq 0x5e6be
callq 0x5e73c
callq 0x656cb
callq 0x65722
callq 0x60fd7
popq %rbp
jmp 0x6108d
leaq 0x2a7580(%rip), %rax    # 0x30d408
cmpl $0x0, (%rax)
jne 0x65c25
leaq 0xbaa27(%rip), %rdi     # 0x1208bf
callq 0x6160d
popq %rbp
jmp 0x61688
movl $0x1b, %edi
callq 0x5e6be
popq %rbp
jmp 0x5e7c0
leaq 0xba9f1(%rip), %rdi     # 0x1208ab
callq 0x5e8fb
leaq 0xba9ef(%rip), %rdi     # 0x1208b5
popq %rbp
jmp 0x5e8fb
popq %rbp
jmp 0x65b88
leaq 0x2a7a9b(%rip), %rax    # 0x30d974
cmpl $0x0, (%rax)
jne 0x65c25
leaq 0xba9ed(%rip), %rdi     # 0x1208d6
popq %rbp
jmp 0x5f2c8
movl $0x2, %edi
movl $0x2, %esi
callq 0x5fb3c
movl $0x1, %edi
callq 0x590f7
popq %rbp
jmp 0x61bc1
leaq 0xba9b9(%rip), %rdi     # 0x1208ce
popq %rbp
jmp 0x5f228
leaq 0xba96c(%rip), %rdi     # 0x12088e
callq 0x5ee9b
leaq 0xba970(%rip), %rdi     # 0x12089e
popq %rbp
jmp 0x5ee9b
leaq 0xa7b9f(%rip), %rdi     # 0x10dada
movl $0x190, %esi            # imm = 0x190
jmp 0x65f4e
leaq 0xbe5e9(%rip), %rdi     # 0x124532
movl $0x321, %esi            # imm = 0x321
popq %rbp
jmp 0x5edda