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

   if(rcvr_type == CS_RCVR) { 
      extend_com_timeout(0.0);
      set_cs_remote(1);
      queue_cs_cmd(":PTIM:STAN 1", CS_STANDBY_MSG);
      sprintf(out, "DIAG:TEST? %d", test);
      queue_cs_cmd(out, SCPI_TEST_MSG);
      restore_cs_remote();
      show_test_warning();
   }
   else if(rcvr_type == FURUNO_RCVR) {
      send_furuno_cmd("GPtrq,0");
   }
   else if(rcvr_type == MOTO_RCVR) {
      extend_com_timeout(0.0);
      send_moto_start("Ia");
      send_moto_end();

      send_moto_start("Fa");
      send_moto_end();

      send_moto_start("Ca");
      send_moto_end();
      show_test_warning();
   }
   else if(rcvr_type == NVS_RCVR) {
      extend_com_timeout(0.0);
      send_nvs_start(0x11);
      send_byte(0x00);
      send_nvs_end();
   }
   else if(rcvr_type == SCPI_RCVR) { 
      extend_com_timeout(0.0);
      queue_scpi_cmd("*TST?", SCPI_TEST_MSG);  // NORTEL_TYPE?
      show_test_warning();
   }
   else if(rcvr_type == SS_RCVR) {
      send_ss_start(51, 5);
      send_byte(1);
      send_ss_end();
   }
   else if(rcvr_type == TSIP_RCVR) {
      send_tsip_start(0x25);
      send_tsip_end();
      restart_gpsdo();
   }
   else if(rcvr_type == UCCM_RCVR) {  // not for UCCM? only UCCMP? uuuuuu
      extend_com_timeout(0.0);
      queue_uccm_cmd("*TST?", SCPI_TEST_MSG);
   }
   else if(rcvr_type == ZODIAC_RCVR) {
      extend_com_timeout(0.0);
      send_zod_start(ZOD_REQ_DIAGS, 8, 0);
      send_zod_seq();
      send_word(0);
      send_zod_end();
      show_test_warning();

      Sleep(10000);
      restart_zodiac_rcvr();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x1cb459(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
jne 0x5dbd1
leaq 0x2c352b(%rip), %rax    # 0x321020
cmpb $0x0, (%rax)
jne 0x5dbd1
leaq 0x2c3515(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
jne 0x5dbd1
leaq 0x1a4dbb(%rip), %rax    # 0x2028d0
movq (%rax), %rax
cmpq $0x1, %rax
je 0x5dc66
cmpq $0x8, %rax
je 0x5dcd8
cmpq $0x10, %rax
je 0x5dcb8
cmpq $0x20, %rax
je 0x5dbd6
cmpq $0x100, %rax            # imm = 0x100
je 0x5dc26
cmpq $0x800, %rax            # imm = 0x800
je 0x5dc98
movabsq $0x800000000, %rcx      # imm = 0x800000000
cmpq %rcx, %rax
je 0x5dc7c
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x5dc16
cmpq $0x20000, %rax          # imm = 0x20000
jne 0x5dbd1
movl %edi, %ebx
xorps %xmm0, %xmm0
callq 0x5bd83
pushq $0x1
popq %rdi
callq 0x5be9f
leaq 0xacca8(%rip), %rdi     # 0x10a840
movl $0x143, %esi            # imm = 0x143
callq 0x576d4
leaq 0x2c8677(%rip), %r14    # 0x326220
leaq 0xacc9d(%rip), %rsi     # 0x10a84d
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
pushq $0x19
popq %rsi
movq %r14, %rdi
callq 0x576d4
callq 0x5be85
jmp 0x5dccf
popq %rbx
popq %r14
popq %rbp
retq
xorps %xmm0, %xmm0
callq 0x5bd83
leaq 0xacc7e(%rip), %rdi     # 0x10a863
callq 0x59a28
callq 0x59aab
leaq 0xacc70(%rip), %rdi     # 0x10a866
callq 0x59a28
callq 0x59aab
leaq 0xacc62(%rip), %rdi     # 0x10a869
callq 0x59a28
callq 0x59aab
jmp 0x5dccf
leaq 0xacc3e(%rip), %rdi     # 0x10a85b
popq %rbx
popq %r14
popq %rbp
jmp 0x578d5
xorps %xmm0, %xmm0
callq 0x5bd83
pushq $0x8
popq %rsi
movl $0x514, %edi            # imm = 0x514
xorl %edx, %edx
callq 0x5c619
callq 0x5c6ed
xorl %edi, %edi
callq 0x52599
callq 0x5c6fe
callq 0x5dcf3
movl $0x2710, %edi           # imm = 0x2710
callq 0xae83
popq %rbx
popq %r14
popq %rbp
jmp 0x5998f
pushq $0x25
popq %rdi
callq 0x5707f
callq 0x570f8
popq %rbx
popq %r14
popq %rbp
jmp 0x59901
pushq $0x33
popq %rdi
pushq $0x5
popq %rsi
callq 0x5d27d
pushq $0x1
popq %rdi
callq 0x523f2
popq %rbx
popq %r14
popq %rbp
jmp 0x5d2f6
xorps %xmm0, %xmm0
callq 0x5bd83
pushq $0x11
popq %rdi
callq 0x5707f
xorl %edi, %edi
callq 0x523f2
popq %rbx
popq %r14
popq %rbp
jmp 0x57171
xorps %xmm0, %xmm0
callq 0x5bd83
leaq 0xac9c9(%rip), %rdi     # 0x10a690
pushq $0x19
popq %rsi
callq 0x576d4
popq %rbx
popq %r14
popq %rbp
jmp 0x5dcf3
xorps %xmm0, %xmm0
callq 0x5bd83
leaq 0xac9a9(%rip), %rdi     # 0x10a690
pushq $0x19
popq %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x576d4