// File: jkingan[P]ladyheather/heathgps.cpp
// Function: extend_com_timeout(double)
void extend_com_timeout(double timeout)
{
   // this routine extends the com timeout for commands that may take
   // a long time to process.  If timeout is 0, uses a default value for the
   // receiver type, 
   // NEW_RCVR

   timeout_extended = 0;
   if(timeout) {  // recalulating overflowed adevs can take a while on slow machines
      timeout_extended = (int) (timeout+0.9999);     // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = timeout;
   }
   else if(rcvr_type == BRANDY_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 10 secs of time messages
      com[RCVR_PORT].com_timeout = 10000.0;
   }
   else if(rcvr_type == LPFRS_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = 15000.0;
   }
   else if(rcvr_type == MOTO_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = 15000.0;
   }
   else if(rcvr_type == PRS_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = 15000.0;
   }
   else if(rcvr_type == RFTG_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = 90000.0;  // reset can take 90 seconds
   }
   else if(rcvr_type == SA35_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = 15000.0;
   }
   else if(rcvr_type == SCPI_RCVR) { 
      timeout_extended = 10;   // resume normal timeout after 25 secs of time messages
      com[RCVR_PORT].com_timeout = 25000.0;
   }
   else if(rcvr_type == SRO_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 20 secs of time messages
      com[RCVR_PORT].com_timeout = 20000.0;
   }
   else if(rcvr_type == TICC_RCVR) { 
      timeout_extended = 10;   // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = 15000.0;
   }
   else if(rcvr_type == UCCM_RCVR) {  // not for UCCM? only UCCMP? uuuuuu
      timeout_extended = 10;   // resume normal timeout after 25 secs of time messages
      com[RCVR_PORT].com_timeout = 25000.0;
   }
   else if(rcvr_type == X72_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = 15000.0;
   }
   else if(rcvr_type == ZODIAC_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = 15000.0;
   }
   else if(rcvr_type == ZYFER_RCVR) {
      timeout_extended = 5;    // resume normal timeout after 15 secs of time messages
      com[RCVR_PORT].com_timeout = 15000.0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd %xmm0, -0x8(%rbp)
leaq 0x30d2c8(%rip), %rax    # 0x3961e8
movl $0x0, (%rax)
movsd -0x8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x88f38
jp 0x88f38
jmp 0x88f6b
movsd 0xf9c80(%rip), %xmm0    # 0x182bc0
addsd -0x8(%rbp), %xmm0
cvttsd2si %xmm0, %ecx
leaq 0x30d298(%rip), %rax    # 0x3961e8
movl %ecx, (%rax)
movsd -0x8(%rbp), %xmm0
leaq 0x2e4562(%rip), %rax    # 0x36d4c0
movsd %xmm0, 0x179f8(%rax)
jmp 0x8925c
leaq 0x1eeb3e(%rip), %rax    # 0x277ab0
cmpq $0x40000, (%rax)        # imm = 0x40000
jne 0x88fa4
leaq 0x30d266(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e4531(%rip), %rax    # 0x36d4c0
movsd 0xe6161(%rip), %xmm0    # 0x16f0f8
movsd %xmm0, 0x179f8(%rax)
jmp 0x8925a
leaq 0x1eeb05(%rip), %rax    # 0x277ab0
cmpq $0x10000000, (%rax)     # imm = 0x10000000
jne 0x88fdd
leaq 0x30d22d(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e44f8(%rip), %rax    # 0x36d4c0
movsd 0xf9bd8(%rip), %xmm0    # 0x182ba8
movsd %xmm0, 0x179f8(%rax)
jmp 0x89258
leaq 0x1eeacc(%rip), %rax    # 0x277ab0
cmpq $0x20, (%rax)
jne 0x89013
leaq 0x30d1f7(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e44c2(%rip), %rax    # 0x36d4c0
movsd 0xf9ba2(%rip), %xmm0    # 0x182ba8
movsd %xmm0, 0x179f8(%rax)
jmp 0x89256
leaq 0x1eea96(%rip), %rax    # 0x277ab0
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jne 0x8904c
leaq 0x30d1be(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e4489(%rip), %rax    # 0x36d4c0
movsd 0xf9b69(%rip), %xmm0    # 0x182ba8
movsd %xmm0, 0x179f8(%rax)
jmp 0x89254
leaq 0x1eea5d(%rip), %rax    # 0x277ab0
cmpq $0x400000, (%rax)       # imm = 0x400000
jne 0x89085
leaq 0x30d185(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e4450(%rip), %rax    # 0x36d4c0
movsd 0xf9b40(%rip), %xmm0    # 0x182bb8
movsd %xmm0, 0x179f8(%rax)
jmp 0x89252
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
leaq 0x1eea1a(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x890c4
leaq 0x30d146(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e4411(%rip), %rax    # 0x36d4c0
movsd 0xf9af1(%rip), %xmm0    # 0x182ba8
movsd %xmm0, 0x179f8(%rax)
jmp 0x89250
leaq 0x1ee9e5(%rip), %rax    # 0x277ab0
cmpq $0x10, (%rax)
jne 0x890fa
leaq 0x30d110(%rip), %rax    # 0x3961e8
movl $0xa, (%rax)
leaq 0x2e43db(%rip), %rax    # 0x36d4c0
movsd 0xf9ac3(%rip), %xmm0    # 0x182bb0
movsd %xmm0, 0x179f8(%rax)
jmp 0x8924e
leaq 0x1ee9af(%rip), %rax    # 0x277ab0
cmpq $0x8000000, (%rax)      # imm = 0x8000000
jne 0x89133
leaq 0x30d0d7(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e43a2(%rip), %rax    # 0x36d4c0
movsd 0xe8572(%rip), %xmm0    # 0x171698
movsd %xmm0, 0x179f8(%rax)
jmp 0x8924c
leaq 0x1ee976(%rip), %rax    # 0x277ab0
cmpq $0x10000, (%rax)        # imm = 0x10000
jne 0x8916c
leaq 0x30d09e(%rip), %rax    # 0x3961e8
movl $0xa, (%rax)
leaq 0x2e4369(%rip), %rax    # 0x36d4c0
movsd 0xf9a49(%rip), %xmm0    # 0x182ba8
movsd %xmm0, 0x179f8(%rax)
jmp 0x8924a
leaq 0x1ee93d(%rip), %rax    # 0x277ab0
cmpq $0x8, (%rax)
jne 0x891a2
leaq 0x30d068(%rip), %rax    # 0x3961e8
movl $0xa, (%rax)
leaq 0x2e4333(%rip), %rax    # 0x36d4c0
movsd 0xf9a1b(%rip), %xmm0    # 0x182bb0
movsd %xmm0, 0x179f8(%rax)
jmp 0x89248
leaq 0x1ee907(%rip), %rax    # 0x277ab0
cmpq $0x2000000, (%rax)      # imm = 0x2000000
jne 0x891d8
leaq 0x30d02f(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e42fa(%rip), %rax    # 0x36d4c0
movsd 0xf99da(%rip), %xmm0    # 0x182ba8
movsd %xmm0, 0x179f8(%rax)
jmp 0x89246
leaq 0x1ee8d1(%rip), %rax    # 0x277ab0
cmpq $0x100, (%rax)          # imm = 0x100
jne 0x8920e
leaq 0x30cff9(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e42c4(%rip), %rax    # 0x36d4c0
movsd 0xf99a4(%rip), %xmm0    # 0x182ba8
movsd %xmm0, 0x179f8(%rax)
jmp 0x89244
leaq 0x1ee89b(%rip), %rax    # 0x277ab0
cmpq $0x100000, (%rax)       # imm = 0x100000
jne 0x89242
leaq 0x30cfc3(%rip), %rax    # 0x3961e8
movl $0x5, (%rax)
leaq 0x2e428e(%rip), %rax    # 0x36d4c0
movsd 0xf996e(%rip), %xmm0    # 0x182ba8
movsd %xmm0, 0x179f8(%rax)
jmp 0x89244
jmp 0x89246
jmp 0x89248
jmp 0x8924a
jmp 0x8924c
jmp 0x8924e
jmp 0x89250
jmp 0x89252
jmp 0x89254
jmp 0x89256
jmp 0x89258
jmp 0x8925a
jmp 0x8925c
popq %rbp
retq
nop