// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
leaq 0x2c503e(%rip), %rax    # 0x32101a
leaq 0x2c503d(%rip), %rcx    # 0x321020
movb (%rcx), %cl
orb (%rax), %cl
je 0x5bff0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x29b1f2(%rip), %rax    # 0x2f71e9
movb $0x0, (%rax)
leaq 0x29b1df(%rip), %rax    # 0x2f71e0
andl $0x0, (%rax)
leaq 0x29b1cd(%rip), %rax    # 0x2f71d8
andb $0x7f, (%rax)
xorps %xmm0, %xmm0
callq 0x5bd83
leaq 0x1ccf21(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0x5c04c
movl $0xdc, %edi
callq 0x5707f
pushq $0x10
popq %rdi
callq 0x523f2
callq 0x570f8
pushq $0x64
popq %rdi
callq 0xae83
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5c3ab
leaq 0x1a687d(%rip), %rax    # 0x2028d0
movq (%rax), %rax
cmpq $0x1, %rax
je 0x5c2f7
cmpq $0x4, %rax
je 0x5c2ac
cmpq $0x8, %rax
je 0x5c379
cmpq $0x10, %rax
je 0x5c330
cmpq $0x80, %rax
je 0x5c29e
cmpq $0x100, %rax            # imm = 0x100
je 0x5c162
cmpq $0x800, %rax            # imm = 0x800
je 0x5c224
cmpq $0x1000, %rax           # imm = 0x1000
je 0x5c19a
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
je 0x5c317
cmpq $0x8000, %rax           # imm = 0x8000
je 0x5c1ef
cmpq $0x10000, %rax          # imm = 0x10000
je 0x5c1b6
cmpq $0x20000, %rax          # imm = 0x20000
je 0x5c33b
cmpq $0x40000, %rax          # imm = 0x40000
je 0x5c201
cmpq $0x100000, %rax         # imm = 0x100000
je 0x5c367
cmpq $0x200000, %rax         # imm = 0x200000
je 0x5c28c
cmpq $0x400000, %rax         # imm = 0x400000
je 0x5c325
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x5c2e6
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0x5c1de
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x5c27a
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
je 0x5c212
cmpq $0x4000, %rax           # imm = 0x4000
jne 0x5bfe9
movl $0x68, 0x2faad3(%rip)   # 0x356c30
jmp 0x5bfe9
pushq $0x8
popq %rsi
movl $0x517, %edi            # imm = 0x517
xorl %edx, %edx
callq 0x5c619
callq 0x5c6ed
movl $0x8003, %edi           # imm = 0x8003
callq 0x52599
callq 0x5c6fe
movl $0x1388, %edi           # imm = 0x1388
callq 0xae83
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5998f
leaq 0x1a8e47(%rip), %rax    # 0x204fe8
cmpl $0x4f, (%rax)
jne 0x5c394
leaq 0xae4e5(%rip), %rdi     # 0x10a696
jmp 0x5c39b
leaq 0xa2969(%rip), %rsi     # 0xfeb26
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x5c48b
movl $0x7d0, %edi            # imm = 0x7D0
callq 0xae83
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5c606
leaq 0xae4cf(%rip), %rdi     # 0x10a6b4
movl $0x323, %esi            # imm = 0x323
jmp 0x5c3a0
leaq 0xae4b5(%rip), %rdi     # 0x10a6ab
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5c473
leaq 0xae43c(%rip), %rdi     # 0x10a644
movl $0x1a4, %esi            # imm = 0x1A4
jmp 0x5c3a0
leaq 0xae456(%rip), %rdi     # 0x10a66f
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x57791
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x5707f
xorl %edi, %edi
callq 0x523f2
movl %ebx, %edi
callq 0x523f2
pushq $0x21
popq %rdi
callq 0x523f2
movl %ebx, %edi
callq 0x523f2
xorl %edi, %edi
callq 0x523f2
xorl %edi, %edi
callq 0x523f2
callq 0x57171
movl $0x1388, %edi           # imm = 0x1388
callq 0xae83
movl $0x1545, %edi           # imm = 0x1545
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x59afe
leaq 0xae403(%rip), %rdi     # 0x10a684
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x578d5
leaq 0xae420(%rip), %rdi     # 0x10a6b3
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x57acc
pushq $0x3
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x59e3a
xorl %edi, %edi
xorl %esi, %esi
movl $0x41f, %edx            # imm = 0x41F
callq 0x59dc8
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xae83
callq 0x59901
pushq $0x14
popq %rdi
pushq $0x1
popq %rsi
callq 0x59afe
leaq 0x1a8d4d(%rip), %rax    # 0x205028
movl $0x1, (%rax)
jmp 0x5bfe9
leaq 0xae39f(%rip), %rdi     # 0x10a68c
movl $0x1f5, %esi            # imm = 0x1F5
jmp 0x5c3a0
pushq $0x1e
popq %rdi
callq 0x5707f
pushq $0x4b
popq %rdi
callq 0x523f2
callq 0x570f8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x59901
pushq $0x1
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5bef0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5c446
leaq 0xae359(%rip), %rdi     # 0x10a690
pushq $0x19
jmp 0x5c391
pushq $0x1
popq %rdi
callq 0x5be9f
leaq 0xae305(%rip), %rdi     # 0x10a64f
movl $0x14d, %esi            # imm = 0x14D
callq 0x576d4
callq 0x5be85
leaq 0xae2ff(%rip), %rdi     # 0x10a65f
movl $0x14d, %esi            # imm = 0x14D
jmp 0x5c3a0
leaq 0xae356(%rip), %rdi     # 0x10a6c4
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x579af
leaq 0xae33a(%rip), %rdi     # 0x10a6ba
pushq $0x24
popq %rsi
callq 0x576d4
leaq 0xb1d47(%rip), %rdi     # 0x10e0d6
pushq $0x65
popq %rsi
jmp 0x5c3a0
leaq 0xae304(%rip), %rdi     # 0x10a69f
movl $0xfb, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4