// File: /workspace/github_cpp_makefile_star2_O1/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 0x2d30ee(%rip), %rax    # 0x33701a
leaq 0x2d30ed(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
je 0x63f3b
popq %rbp
retq
leaq 0x2a92a7(%rip), %rax    # 0x30d1e9
movb $0x0, (%rax)
leaq 0x2a9294(%rip), %rax    # 0x30d1e0
movl $0x0, (%rax)
leaq 0x2a927f(%rip), %rax    # 0x30d1d8
andb $0x7f, (%rax)
xorps %xmm0, %xmm0
callq 0x63c5c
leaq 0x1dafd3(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
je 0x63f99
movl $0xdc, %edi
callq 0x5e740
movl $0x10, %edi
callq 0x591af
callq 0x5e7c0
movl $0x64, %edi
callq 0xaff7
popq %rbp
jmp 0x64349
leaq 0x1b4930(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0xffff, %rax           # imm = 0xFFFF
jle 0x63ff4
cmpq $0x3fffff, %rax         # imm = 0x3FFFFF
jle 0x64031
cmpq $0x1fffffff, %rax       # imm = 0x1FFFFFFF
jg 0x640b5
cmpq $0x400000, %rax         # imm = 0x400000
je 0x64266
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x642c1
cmpq $0x8000000, %rax        # imm = 0x8000000
jne 0x63f39
leaq 0xbc6a2(%rip), %rdi     # 0x12068c
movl $0x323, %esi            # imm = 0x323
jmp 0x64343
cmpq $0xff, %rax
jg 0x6406e
cmpq $0x7, %rax
jle 0x64144
cmpq $0x8, %rax
je 0x64228
cmpq $0x10, %rax
je 0x642a1
cmpq $0x80, %rax
jne 0x63f39
movl $0x3, %edi
popq %rbp
jmp 0x61ab3
cmpq $0x3ffff, %rax          # imm = 0x3FFFF
jle 0x640ed
cmpq $0x40000, %rax          # imm = 0x40000
je 0x6420a
cmpq $0x100000, %rax         # imm = 0x100000
je 0x6421b
cmpq $0x200000, %rax         # imm = 0x200000
jne 0x63f39
leaq 0xbc623(%rip), %rdi     # 0x12068b
popq %rbp
jmp 0x5f2a0
cmpq $0xfff, %rax            # imm = 0xFFF
jle 0x64196
cmpq $0x1000, %rax           # imm = 0x1000
je 0x6424a
cmpq $0x4000, %rax           # imm = 0x4000
je 0x642b2
cmpq $0x8000, %rax           # imm = 0x8000
jne 0x63f39
leaq 0xbc5de(%rip), %rdi     # 0x120683
callq 0xa36fd
movl $0x1, %edi
popq %rbp
jmp 0xa3789
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x6426c
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
je 0x642cf
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
jne 0x63f39
movl $0x1, %edi
popq %rbp
jmp 0x63e06
cmpq $0x10000, %rax          # imm = 0x10000
je 0x64279
cmpq $0x20000, %rax          # imm = 0x20000
jne 0x63f39
movl $0x1, %edi
callq 0x63db5
leaq 0xbc511(%rip), %rdi     # 0x120627
movl $0x14d, %esi            # imm = 0x14D
callq 0x5ee52
leaq 0x1b68c5(%rip), %rax    # 0x21a9ec
cmpl $0x0, (%rax)
jne 0x64133
xorl %edi, %edi
callq 0x63db5
leaq 0xbc4fd(%rip), %rdi     # 0x120637
movl $0x14d, %esi            # imm = 0x14D
jmp 0x64343
cmpq $0x1, %rax
je 0x642dc
cmpq $0x4, %rax
jne 0x63f39
xorl %edi, %edi
xorl %esi, %esi
movl $0x41f, %edx            # imm = 0x41F
callq 0x61a3f
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xaff7
callq 0x61566
movl $0x14, %edi
movl $0x1, %esi
callq 0x61765
leaq 0x1b6e9d(%rip), %rax    # 0x21b028
movl $0x1, (%rax)
jmp 0x63f39
cmpq $0x100, %rax            # imm = 0x100
je 0x642fb
cmpq $0x800, %rax            # imm = 0x800
jne 0x63f39
movl $0x1, %edi
callq 0x5e740
xorl %edi, %edi
callq 0x591af
movl $0x1, %edi
callq 0x591af
movl $0x21, %edi
callq 0x591af
movl $0x1, %edi
callq 0x591af
xorl %edi, %edi
callq 0x591af
xorl %edi, %edi
callq 0x591af
callq 0x5e844
movl $0x1388, %edi           # imm = 0x1388
callq 0xaff7
movl $0x1545, %edi           # imm = 0x1545
movl $0x1, %esi
popq %rbp
jmp 0x61765
leaq 0xbc40b(%rip), %rdi     # 0x12061c
movl $0x1a4, %esi            # imm = 0x1A4
jmp 0x64343
leaq 0xbc47a(%rip), %rdi     # 0x12069c
popq %rbp
jmp 0x5f15d
leaq 0xbc463(%rip), %rdi     # 0x120692
movl $0x24, %esi
callq 0x5ee52
leaq 0xbfe6e(%rip), %rdi     # 0x1240ae
movl $0x65, %esi
jmp 0x64343
leaq 0x1b6d97(%rip), %rax    # 0x21afe8
cmpl $0x4f, (%rax)
jne 0x64337
leaq 0xbc40d(%rip), %rdi     # 0x12066e
jmp 0x6433e
popq %rbp
jmp 0x643fa
leaq 0xbc3e9(%rip), %rdi     # 0x12065c
popq %rbp
jmp 0x5f070
leaq 0xb0792(%rip), %rsi     # 0x114a12
movl $0xa, %edi
callq 0x64456
movl $0x7d0, %edi            # imm = 0x7D0
callq 0xaff7
movl $0xa, %edi
xorl %esi, %esi
popq %rbp
jmp 0x64456
leaq 0xbc3c0(%rip), %rdi     # 0x120668
movl $0x19, %esi
jmp 0x64343
movl $0x68, 0x308974(%rip)   # 0x36cc30
jmp 0x63f39
leaq 0xbc39c(%rip), %rdi     # 0x120664
movl $0x1f5, %esi            # imm = 0x1F5
jmp 0x64343
leaq 0xbc371(%rip), %rdi     # 0x120647
popq %rbp
jmp 0x5ef13
movl $0x1e, %edi
callq 0x5e740
movl $0x4b, %edi
callq 0x591af
callq 0x5e7c0
popq %rbp
jmp 0x61566
movl $0x517, %edi            # imm = 0x517
movl $0x8, %esi
xorl %edx, %edx
callq 0x645ec
movzwl 0x30881d(%rip), %edi    # 0x36cb30
callq 0x5936c
movl $0x8003, %edi           # imm = 0x8003
callq 0x5936c
callq 0x646c7
movl $0x1388, %edi           # imm = 0x1388
callq 0xaff7
popq %rbp
jmp 0x615f4
leaq 0xbc339(%rip), %rdi     # 0x120677
movl $0xfb, %esi
popq %rbp
jmp 0x5ee52