// File: /workspace/github_cpp_makefile_star2_O3/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 0x2d3066(%rip), %rax    # 0x33701a
leaq 0x2d3065(%rip), %rcx    # 0x337020
movb (%rcx), %cl
orb (%rax), %cl
je 0x63fc8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2a921a(%rip), %rax    # 0x30d1e9
movb $0x0, (%rax)
leaq 0x2a9207(%rip), %rax    # 0x30d1e0
movl $0x0, (%rax)
leaq 0x2a91f2(%rip), %rax    # 0x30d1d8
andb $0x7f, (%rax)
xorps %xmm0, %xmm0
callq 0x63ce2
leaq 0x1daf46(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
je 0x6402b
movl $0xdc, %edi
callq 0x5e6be
movl $0x10, %edi
callq 0x590f7
callq 0x5e73c
movl $0x64, %edi
callq 0xafe8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x64443
leaq 0x1b489e(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0xffff, %rax           # imm = 0xFFFF
jle 0x6408a
cmpq $0x3fffff, %rax         # imm = 0x3FFFFF
jle 0x640cc
cmpq $0x1fffffff, %rax       # imm = 0x1FFFFFFF
jg 0x6415a
cmpq $0x400000, %rax         # imm = 0x400000
je 0x6431a
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x64384
cmpq $0x8000000, %rax        # imm = 0x8000000
jne 0x63fc1
leaq 0xbc6ec(%rip), %rdi     # 0x12076c
movl $0x323, %esi            # imm = 0x323
jmp 0x64438
cmpq $0xff, %rax
jg 0x6410e
cmpq $0x7, %rax
jle 0x641ee
cmpq $0x8, %rax
je 0x642dc
cmpq $0x10, %rax
je 0x64364
cmpq $0x80, %rax
jne 0x63fc1
movl $0x3, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x61a29
cmpq $0x3ffff, %rax          # imm = 0x3FFFF
jle 0x64197
cmpq $0x40000, %rax          # imm = 0x40000
je 0x642b9
cmpq $0x100000, %rax         # imm = 0x100000
je 0x642ca
cmpq $0x200000, %rax         # imm = 0x200000
jne 0x63fc1
leaq 0xbc668(%rip), %rdi     # 0x12076b
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5f228
cmpq $0xfff, %rax            # imm = 0xFFF
jle 0x64240
cmpq $0x1000, %rax           # imm = 0x1000
je 0x642fe
cmpq $0x4000, %rax           # imm = 0x4000
je 0x64375
cmpq $0x8000, %rax           # imm = 0x8000
jne 0x63fc1
leaq 0xbc61e(%rip), %rdi     # 0x120763
callq 0xa3914
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xa39a0
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x64325
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
je 0x64395
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
jne 0x63fc1
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x63e8c
cmpq $0x10000, %rax          # imm = 0x10000
je 0x64337
cmpq $0x20000, %rax          # imm = 0x20000
jne 0x63fc1
movl $0x1, %edi
callq 0x63e3b
leaq 0xbc547(%rip), %rdi     # 0x120707
movl $0x14d, %esi            # imm = 0x14D
callq 0x5edda
leaq 0x1b681b(%rip), %rax    # 0x21a9ec
cmpl $0x0, (%rax)
jne 0x641dd
xorl %edi, %edi
callq 0x63e3b
leaq 0xbc533(%rip), %rdi     # 0x120717
movl $0x14d, %esi            # imm = 0x14D
jmp 0x64438
cmpq $0x1, %rax
je 0x643a7
cmpq $0x4, %rax
jne 0x63fc1
xorl %edi, %edi
xorl %esi, %esi
movl $0x41f, %edx            # imm = 0x41F
callq 0x619b5
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xafe8
callq 0x614df
movl $0x14, %edi
movl $0x1, %esi
callq 0x616de
leaq 0x1b6df3(%rip), %rax    # 0x21b028
movl $0x1, (%rax)
jmp 0x63fc1
cmpq $0x100, %rax            # imm = 0x100
je 0x643cb
cmpq $0x800, %rax            # imm = 0x800
jne 0x63fc1
movl $0x1, %edi
callq 0x5e6be
xorl %edi, %edi
callq 0x590f7
movl $0x1, %edi
callq 0x590f7
movl $0x21, %edi
callq 0x590f7
movl $0x1, %edi
callq 0x590f7
xorl %edi, %edi
callq 0x590f7
xorl %edi, %edi
callq 0x590f7
callq 0x5e7c0
movl $0x1388, %edi           # imm = 0x1388
callq 0xafe8
movl $0x1545, %edi           # imm = 0x1545
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x616de
leaq 0xbc43c(%rip), %rdi     # 0x1206fc
movl $0x1a4, %esi            # imm = 0x1A4
jmp 0x64438
leaq 0xbc4ab(%rip), %rdi     # 0x12077c
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5f0e5
leaq 0xbc48f(%rip), %rdi     # 0x120772
movl $0x24, %esi
callq 0x5edda
leaq 0xbfe9a(%rip), %rdi     # 0x12418e
movl $0x65, %esi
jmp 0x64438
leaq 0x1b6ce3(%rip), %rax    # 0x21afe8
cmpl $0x4f, (%rax)
jne 0x6442c
leaq 0xbc439(%rip), %rdi     # 0x12074e
jmp 0x64433
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x644f4
leaq 0xbc410(%rip), %rdi     # 0x12073c
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5eff8
leaq 0xb0768(%rip), %rsi     # 0x114aa6
movl $0xa, %edi
callq 0x64550
movl $0x7d0, %edi            # imm = 0x7D0
callq 0xafe8
movl $0xa, %edi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x64550
leaq 0xbc3dd(%rip), %rdi     # 0x120748
movl $0x19, %esi
jmp 0x64438
movl $0x68, 0x3088b1(%rip)   # 0x36cc30
jmp 0x63fc1
leaq 0xbc3b9(%rip), %rdi     # 0x120744
movl $0x1f5, %esi            # imm = 0x1F5
jmp 0x64438
leaq 0xbc38b(%rip), %rdi     # 0x120727
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5ee9b
movl $0x1e, %edi
callq 0x5e6be
movl $0x4b, %edi
callq 0x590f7
callq 0x5e73c
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x614df
movl $0x517, %edi            # imm = 0x517
movl $0x8, %esi
xorl %edx, %edx
callq 0x646e6
callq 0x64869
movw $0x8003, -0xa(%rbp)     # imm = 0x8003
leaq 0x1b43e6(%rip), %rbx    # 0x2187d4
xorl %eax, %eax
cmpb $0x0, (%rbx)
sete %al
movzbl -0xa(%rbp,%rax), %edi
callq 0x590f7
xorl %eax, %eax
cmpb $0x0, (%rbx)
setne %al
movzbl -0xa(%rbp,%rax), %edi
callq 0x590f7
callq 0x648ab
movl $0x1388, %edi           # imm = 0x1388
callq 0xafe8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6156d
leaq 0xbc324(%rip), %rdi     # 0x120757
movl $0xfb, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda