// File: /workspace/github_cpp_makefile_star2_O1/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 0x1d9159(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0x65f7d
leaq 0x2d122b(%rip), %rax    # 0x337020
cmpb $0x0, (%rax)
jne 0x65f7d
leaq 0x2d1215(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
jne 0x65f7d
leaq 0x1b2abb(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0xff, %rax
jle 0x65ec3
cmpq $0x1ffff, %rax          # imm = 0x1FFFF
jle 0x65f47
movabsq $0x800000000, %rcx      # imm = 0x800000000
cmpq %rcx, %rax
je 0x65fbc
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x6604c
cmpq $0x20000, %rax          # imm = 0x20000
jne 0x65f7d
movl %edi, %ebx
xorps %xmm0, %xmm0
callq 0x63c5c
movl $0x1, %edi
callq 0x63db5
leaq 0xba9a2(%rip), %rdi     # 0x120818
movl $0x143, %esi            # imm = 0x143
callq 0x5ee52
leaq 0x2d6399(%rip), %r14    # 0x33c220
leaq 0xba997(%rip), %rsi     # 0x120825
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x19, %esi
callq 0x5ee52
leaq 0x1b4b3e(%rip), %rax    # 0x21a9ec
cmpl $0x0, (%rax)
jne 0x65fb3
xorl %edi, %edi
callq 0x63db5
jmp 0x65fb3
cmpq $0xf, %rax
jg 0x65efa
cmpq $0x1, %rax
je 0x65f82
cmpq $0x8, %rax
jne 0x65f7d
xorps %xmm0, %xmm0
callq 0x63c5c
leaq 0xba77c(%rip), %rdi     # 0x120668
movl $0x19, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5ee52
cmpq $0x10, %rax
je 0x65f9a
cmpq $0x20, %rax
jne 0x65f7d
xorps %xmm0, %xmm0
callq 0x63c5c
leaq 0xba922(%rip), %rdi     # 0x12083b
callq 0x61694
callq 0x6170f
leaq 0xba914(%rip), %rdi     # 0x12083e
callq 0x61694
callq 0x6170f
leaq 0xba906(%rip), %rdi     # 0x120841
callq 0x61694
callq 0x6170f
jmp 0x65fb3
cmpq $0x100, %rax            # imm = 0x100
je 0x66003
cmpq $0x800, %rax            # imm = 0x800
jne 0x65f7d
xorps %xmm0, %xmm0
callq 0x63c5c
movl $0x11, %edi
callq 0x5e740
xorl %edi, %edi
callq 0x591af
popq %rbx
popq %r14
popq %rbp
jmp 0x5e844
popq %rbx
popq %r14
popq %rbp
retq
movl $0x25, %edi
callq 0x5e740
callq 0x5e7c0
popq %rbx
popq %r14
popq %rbp
jmp 0x61566
xorps %xmm0, %xmm0
callq 0x63c5c
leaq 0xba6bf(%rip), %rdi     # 0x120668
movl $0x19, %esi
callq 0x5ee52
popq %rbx
popq %r14
popq %rbp
jmp 0x6605c
movl $0x33, %edi
movl $0x5, %esi
callq 0x653a5
movl $0x1, %edi
callq 0x591af
movzwl 0x306adf(%rip), %r14d   # 0x36cabc
movl $0xff, %ebx
movl %r14d, %edi
andl %ebx, %edi
callq 0x591af
addl %r14d, %ebx
testw %r14w, %r14w
cmovnsl %r14d, %ebx
movzbl %bh, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x591af
xorps %xmm0, %xmm0
callq 0x63c5c
movl $0x514, %edi            # imm = 0x514
movl $0x8, %esi
xorl %edx, %edx
callq 0x645ec
movzwl 0x306b0d(%rip), %edi    # 0x36cb30
callq 0x5936c
xorl %edi, %edi
callq 0x5936c
callq 0x646c7
callq 0x6605c
movl $0x2710, %edi           # imm = 0x2710
callq 0xaff7
popq %rbx
popq %r14
popq %rbp
jmp 0x615f4
leaq 0xba7e0(%rip), %rdi     # 0x120833
popq %rbx
popq %r14
popq %rbp
jmp 0x5f070