// File: jkingan[P]ladyheather/heathgps.cpp
// Function: request_cold_reset()
void request_cold_reset()
{
   if(read_only) return;
   if(no_poll) return;

   reset_leap_flags();

   extend_com_timeout(0.0);

   if(luxor) {
      send_tsip_start(LUXOR_ID);
      send_byte(0x10);
      send_tsip_end();
      Sleep(100);

      set_luxor_time();
   }
   else if(rcvr_type == ACRON_RCVR) {
      need_acron_sync = 'h';
   }
   else if(rcvr_type == BRANDY_RCVR) {
      queue_brandy_cmd("$PRCCG,Z,0", BRANDY_RESET_MSG);
   }
   else if(rcvr_type == CS_RCVR) {
      set_cs_remote(1);
      queue_cs_cmd("DIAG:CONT:RESET", CS_LAMP_MSG);
      restore_cs_remote();
      queue_cs_cmd("DIAG:CONT:STAT?", CS_LAMP_MSG);
   }
   else if(rcvr_type == ESIP_RCVR) {
      send_esip_cmd("PERDAPI,RESTART,COLD");
   }
   else if(rcvr_type == FURUNO_RCVR) {
      send_furuno_cmd("GPclr,3");
   }
   else if(rcvr_type == NVS_RCVR) {
      send_nvs_start(0x01);
      send_byte(0x00); 
      send_byte(0x01); 
      send_byte(0x21); 
      send_byte(0x01); 
      send_byte(0x00); 
      send_byte(0x00); 
      send_nvs_end();

      Sleep(5000);
      init_messages(5445, 1);
   }
   else if(rcvr_type == PRS_RCVR) {
      queue_prs_cmd("RS1", PRS_RS_MSG);
   }
   else if(rcvr_type == RFTG_RCVR) {
      request_rftg_reset('C');
   }
   else if(rcvr_type == SCPI_RCVR) {
//    queue_scpi_cmd(":SYST:PON", SCPI_POWER_MSG);   // no NORTEL_TYPE
      queue_scpi_cmd("*TST?", SCPI_TEST_MSG);  // causes a system reset
   }
   else if(rcvr_type == SRO_RCVR) {
      queue_sro_cmd("RESET", SRO_RESET_MSG);
   }
   else if(rcvr_type == STAR_RCVR) {
      if(star_type == OSA_TYPE) queue_star_cmd("RESTART;", STAR_RESTART_MSG);
      else                      queue_star_cmd("RESTART(C);", STAR_RESTART_MSG);
   }
   else if(rcvr_type == TAIP_RCVR) {
      send_taip_cmd("SRTCOLD");
   }
   else if(rcvr_type == TICC_RCVR) {
      set_ticc_config(RCVR_PORT, " R");   // reset config to standard defaults
Sleep(2000);
      get_ticc_config(RCVR_PORT);
   }
   else if(rcvr_type == TSIP_RCVR) {
      send_tsip_start(0x1E);
      send_byte('K');
      send_tsip_end();
      restart_gpsdo();
   }
   else if(rcvr_type == TRUE_RCVR) {
      send_true_cmd("$RESET");   // warm reset unit
   }
   else if(rcvr_type == UBX_RCVR) {
      update_ubx_config(0x0000, 0x0000, UBX_EE_ALL);
      Sleep(1000);
      restart_gpsdo();
      init_messages(20, 1);
      rcvr_reset = 1;
   }
   else if(rcvr_type == UCCM_RCVR) {
      queue_uccm_cmd("SYST:PON", SCPI_POWER_MSG);
      queue_uccm_cmd("SYST:STAT?", UCCM_STATUS_MSG);
   }
   else if(rcvr_type == VENUS_RCVR) {
      venus_restart(3);
   }
   else if(rcvr_type == Z12_RCVR) {
      init_z12(1);
   }
   else if(rcvr_type == ZODIAC_RCVR) {
      send_zod_start(ZOD_REQ_RESTART, 8, 0);
      send_zod_seq();
      send_word(0x8003);
      send_zod_end();

      Sleep(5000);
      restart_zodiac_rcvr();
   }
   else if(rcvr_type == ZYFER_RCVR) {
      send_zyfer_cmd("$RSTG,C");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x30cd9f(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0x89465
jmp 0x898c5
leaq 0x30cd94(%rip), %rax    # 0x396200
cmpb $0x0, (%rax)
je 0x89476
jmp 0x898c5
callq 0x80300
xorps %xmm0, %xmm0
callq 0x88f10
leaq 0x214c94(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x894bc
movl $0xdc, %edi
callq 0x824f0
movl $0x10, %edi
callq 0x7b210
callq 0x82590
movl $0x64, %edi
callq 0xb8b0
callq 0x898d0
jmp 0x898c5
leaq 0x1ee5ed(%rip), %rax    # 0x277ab0
cmpq $0x4000, (%rax)         # imm = 0x4000
jne 0x894db
movl $0x68, 0x34292a(%rip)   # 0x3cbe00
jmp 0x898c3
leaq 0x1ee5ce(%rip), %rax    # 0x277ab0
cmpq $0x40000, (%rax)        # imm = 0x40000
jne 0x89501
leaq 0xfa48a(%rip), %rdi     # 0x18397c
movl $0x1a4, %esi            # imm = 0x1A4
callq 0x82fd0
jmp 0x898c1
leaq 0x1ee5a8(%rip), %rax    # 0x277ab0
cmpq $0x20000, (%rax)        # imm = 0x20000
jne 0x89547
movl $0x1, %edi
callq 0x89280
leaq 0xfa465(%rip), %rdi     # 0x183987
movl $0x14d, %esi            # imm = 0x14D
callq 0x82fd0
callq 0x89260
leaq 0xfa45f(%rip), %rdi     # 0x183997
movl $0x14d, %esi            # imm = 0x14D
callq 0x82fd0
jmp 0x898bf
movl $0x80000000, %ecx       # imm = 0x80000000
leaq 0x1ee55d(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x89569
leaq 0xfa448(%rip), %rdi     # 0x1839a7
callq 0x830d0
jmp 0x898bd
leaq 0x1ee540(%rip), %rax    # 0x277ab0
cmpq $0x20000000, (%rax)     # imm = 0x20000000
jne 0x8958a
leaq 0xfa43c(%rip), %rdi     # 0x1839bc
callq 0x83270
jmp 0x898bb
leaq 0x1ee51f(%rip), %rax    # 0x277ab0
cmpq $0x800, (%rax)          # imm = 0x800
jne 0x895fa
movl $0x1, %edi
callq 0x824f0
xorl %edi, %edi
callq 0x7b210
movl $0x1, %edi
callq 0x7b210
movl $0x21, %edi
callq 0x7b210
movl $0x1, %edi
callq 0x7b210
xorl %edi, %edi
callq 0x7b210
xorl %edi, %edi
callq 0x7b210
callq 0x82630
movl $0x1388, %edi           # imm = 0x1388
callq 0xb8b0
movl $0x1545, %edi           # imm = 0x1545
movl $0x1, %esi
callq 0x86290
jmp 0x898b9
leaq 0x1ee4af(%rip), %rax    # 0x277ab0
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jne 0x89620
leaq 0xfa3b3(%rip), %rdi     # 0x1839c4
movl $0x1f5, %esi            # imm = 0x1F5
callq 0x82fd0
jmp 0x898b7
leaq 0x1ee489(%rip), %rax    # 0x277ab0
cmpq $0x400000, (%rax)       # imm = 0x400000
jne 0x8963f
movl $0x43, %edi
callq 0x89980
jmp 0x898b5
leaq 0x1ee46a(%rip), %rax    # 0x277ab0
cmpq $0x10, (%rax)
jne 0x89662
leaq 0xfa375(%rip), %rdi     # 0x1839c8
movl $0x19, %esi
callq 0x82fd0
jmp 0x898b3
leaq 0x1ee447(%rip), %rax    # 0x277ab0
cmpq $0x8000000, (%rax)      # imm = 0x8000000
jne 0x89688
leaq 0xfa373(%rip), %rdi     # 0x1839ec
movl $0x323, %esi            # imm = 0x323
callq 0x82fd0
jmp 0x898b1
leaq 0x1ee421(%rip), %rax    # 0x277ab0
cmpq $0x1000, (%rax)         # imm = 0x1000
jne 0x896cd
leaq 0x1f0b29(%rip), %rax    # 0x27a1c8
cmpl $0x4f, (%rax)
jne 0x896b7
leaq 0xfa323(%rip), %rdi     # 0x1839ce
movl $0xfb, %esi
callq 0x82fd0
jmp 0x896c8
leaq 0xfa319(%rip), %rdi     # 0x1839d7
movl $0xfb, %esi
callq 0x82fd0
jmp 0x898af
leaq 0x1ee3dc(%rip), %rax    # 0x277ab0
cmpq $0x8000, (%rax)         # imm = 0x8000
jne 0x896ee
leaq 0xfa2ff(%rip), %rdi     # 0x1839e3
callq 0x899c0
jmp 0x898ad
leaq 0x1ee3bb(%rip), %rax    # 0x277ab0
cmpq $0x10000, (%rax)        # imm = 0x10000
jne 0x89728
movl $0xa, %edi
leaq 0xefd2e(%rip), %rsi     # 0x179438
callq 0x899f0
movl $0x7d0, %edi            # imm = 0x7D0
callq 0xb8b0
movl $0xa, %edi
callq 0x89bc0
jmp 0x898ab
leaq 0x1ee381(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x89758
movl $0x1e, %edi
callq 0x824f0
movl $0x4b, %edi
callq 0x7b210
callq 0x82590
callq 0x86040
jmp 0x898a9
leaq 0x1ee351(%rip), %rax    # 0x277ab0
cmpq $0x200000, (%rax)       # imm = 0x200000
jne 0x89779
leaq 0xfa27c(%rip), %rdi     # 0x1839eb
callq 0x83580
jmp 0x898a7
leaq 0x1ee330(%rip), %rax    # 0x277ab0
cmpq $0x4, (%rax)
jne 0x897c4
xorl %esi, %esi
movl $0x41f, %edx            # imm = 0x41F
movl %esi, %edi
callq 0x86600
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xb8b0
callq 0x86040
movl $0x14, %edi
movl $0x1, %esi
callq 0x86290
leaq 0x1f0a4f(%rip), %rax    # 0x27a208
movl $0x1, (%rax)
jmp 0x898a5
leaq 0x1ee2e5(%rip), %rax    # 0x277ab0
cmpq $0x8, (%rax)
jne 0x897f8
leaq 0xfa21a(%rip), %rdi     # 0x1839f2
movl $0x24, %esi
callq 0x82fd0
leaq 0xfdc92(%rip), %rdi     # 0x18747b
movl $0x65, %esi
callq 0x82fd0
jmp 0x898a3
leaq 0x1ee2b1(%rip), %rax    # 0x277ab0
cmpq $0x80, (%rax)
jne 0x89817
movl $0x3, %edi
callq 0x86680
jmp 0x898a1
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq 0x1ee288(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x89839
movl $0x1, %edi
callq 0x892f0
jmp 0x8989f
leaq 0x1ee270(%rip), %rax    # 0x277ab0
cmpq $0x100, (%rax)          # imm = 0x100
jne 0x8987f
movl $0x517, %edi            # imm = 0x517
movl $0x8, %esi
xorl %edx, %edx
callq 0x89bf0
callq 0x89d10
movl $0x8003, %edi           # imm = 0x8003
callq 0x7b4b0
callq 0x89d30
movl $0x1388, %edi           # imm = 0x1388
callq 0xb8b0
callq 0x860e0
jmp 0x8989d
leaq 0x1ee22a(%rip), %rax    # 0x277ab0
cmpq $0x100000, (%rax)       # imm = 0x100000
jne 0x8989b
leaq 0xfa165(%rip), %rdi     # 0x1839fb
callq 0x85d30
jmp 0x8989d
jmp 0x8989f
jmp 0x898a1
jmp 0x898a3
jmp 0x898a5
jmp 0x898a7
jmp 0x898a9
jmp 0x898ab
jmp 0x898ad
jmp 0x898af
jmp 0x898b1
jmp 0x898b3
jmp 0x898b5
jmp 0x898b7
jmp 0x898b9
jmp 0x898bb
jmp 0x898bd
jmp 0x898bf
jmp 0x898c1
jmp 0x898c3
jmp 0x898c5
popq %rbp
retq
nopw (%rax,%rax)