// File: jkingan[P]ladyheather/heathgps.cpp
// Function: verify_scpi_type(char*)
void verify_scpi_type(char *unit_name)
{
   if(unit_name == 0) return;

   if(detect_rcvr_type && (rcvr_type == SCPI_RCVR) && (scpi_type_changed == 0)) {
      if(strstr(unit_name, "3801")) {
         rcvr_type = SCPI_RCVR;
         scpi_type = SCPI_TYPE;
         config_rcvr_type(0);
         need_msg_init = 2007;
         need_msg_init = 0;
         scpi_type = SCPI_TYPE;
         scpi_type_changed = SCPI_RCVR;
      }
      else if(strstr(unit_name, "3805")) {
         goto hp_rcvr;
      }
      else if(strstr(unit_name, "3810")) {
         goto hp_rcvr;
      }
      else if(strstr(unit_name, "3811")) {
         rcvr_type = SCPI_RCVR;
         scpi_type = LUCENT_TYPE;
         config_rcvr_type(0);
         need_msg_init = 2008;
         need_msg_init = 0;
         scpi_type = LUCENT_TYPE;
         scpi_type_changed = SCPI_RCVR;
      }
      else if(strstr(unit_name, "3812")) {
         rcvr_type = SCPI_RCVR;
         scpi_type = LUCENT_TYPE;
         config_rcvr_type(0);
         need_msg_init = 2009;
         need_msg_init = 0;
         scpi_type = LUCENT_TYPE;
         scpi_type_changed = SCPI_RCVR;
      }
      else if(strstr(unit_name, "3815")) {
         goto hp_rcvr;
      }
      else if(strstr(unit_name, "3816")) {
         goto hp_rcvr;
      }
      else if(strstr(unit_name, "3817")) {
         goto hp_rcvr;
      }
      else if(strstr(unit_name, "5071")) {  // this should never happen - handled in decode_scpi_msg()
         rcvr_type = CS_RCVR;
         scpi_type = 0;
         scpi_type_changed = CS_RCVR;
         config_rcvr_type(0);
         need_msg_init = 2010;
         scpi_type_changed = CS_RCVR;
         scpi_type = 0;
         init_messages(666, 1);
      }
      else if(strstr(unit_name, "58")) {  // HP58xxx
         hp_rcvr:
         rcvr_type = SCPI_RCVR;
         scpi_type = HP_TYPE;
         config_rcvr_type(0);
         need_msg_init = 2011;
         need_msg_init = 0;
         scpi_type = HP_TYPE;
         scpi_type_changed = SCPI_RCVR;
      }
      else if(strstr(unit_name, "59")) {  // HP59xxx has pulse edge control
         rcvr_type = SCPI_RCVR;
         scpi_type = HP_TYPE2;
         config_rcvr_type(0);
         need_msg_init = 2012;
         need_msg_init = 0;
         scpi_type = HP_TYPE2;
         scpi_type_changed = SCPI_RCVR;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xd6d08
jmp 0xd7085
leaq 0x1a3499(%rip), %rax    # 0x27a1a8
cmpl $0x0, (%rax)
je 0xd7085
leaq 0x1a0d91(%rip), %rax    # 0x277ab0
cmpq $0x10, (%rax)
jne 0xd7085
leaq 0x1a0d98(%rip), %rax    # 0x277ac8
cmpl $0x0, (%rax)
jne 0xd7085
movq -0x8(%rbp), %rdi
leaq 0xb1592(%rip), %rsi     # 0x1882d6
callq 0x9090
cmpq $0x0, %rax
je 0xd6daa
leaq 0x1a0d5a(%rip), %rax    # 0x277ab0
movq $0x10, (%rax)
leaq 0x1a345c(%rip), %rax    # 0x27a1c0
movl $0x0, (%rax)
xorl %edi, %edi
callq 0x6a330
leaq 0x1a3498(%rip), %rax    # 0x27a210
movl $0x7d7, (%rax)          # imm = 0x7D7
leaq 0x1a348b(%rip), %rax    # 0x27a210
movl $0x0, (%rax)
leaq 0x1a342e(%rip), %rax    # 0x27a1c0
movl $0x0, (%rax)
leaq 0x1a0d29(%rip), %rax    # 0x277ac8
movl $0x10, (%rax)
jmp 0xd7083
movq -0x8(%rbp), %rdi
leaq 0xb1526(%rip), %rsi     # 0x1882db
callq 0x9090
cmpq $0x0, %rax
je 0xd6dc5
jmp 0xd6fab
movq -0x8(%rbp), %rdi
leaq 0xb1510(%rip), %rsi     # 0x1882e0
callq 0x9090
cmpq $0x0, %rax
je 0xd6de0
jmp 0xd6fab
movq -0x8(%rbp), %rdi
leaq 0xb14fa(%rip), %rsi     # 0x1882e5
callq 0x9090
cmpq $0x0, %rax
je 0xd6e51
leaq 0x1a0cb3(%rip), %rax    # 0x277ab0
movq $0x10, (%rax)
leaq 0x1a33b5(%rip), %rax    # 0x27a1c0
movl $0x4b, (%rax)
xorl %edi, %edi
callq 0x6a330
leaq 0x1a33f1(%rip), %rax    # 0x27a210
movl $0x7d8, (%rax)          # imm = 0x7D8
leaq 0x1a33e4(%rip), %rax    # 0x27a210
movl $0x0, (%rax)
leaq 0x1a3387(%rip), %rax    # 0x27a1c0
movl $0x4b, (%rax)
leaq 0x1a0c82(%rip), %rax    # 0x277ac8
movl $0x10, (%rax)
jmp 0xd707d
movq -0x8(%rbp), %rdi
leaq 0xb148e(%rip), %rsi     # 0x1882ea
callq 0x9090
cmpq $0x0, %rax
je 0xd6ec2
leaq 0x1a0c42(%rip), %rax    # 0x277ab0
movq $0x10, (%rax)
leaq 0x1a3344(%rip), %rax    # 0x27a1c0
movl $0x4b, (%rax)
xorl %edi, %edi
callq 0x6a330
leaq 0x1a3380(%rip), %rax    # 0x27a210
movl $0x7d9, (%rax)          # imm = 0x7D9
leaq 0x1a3373(%rip), %rax    # 0x27a210
movl $0x0, (%rax)
leaq 0x1a3316(%rip), %rax    # 0x27a1c0
movl $0x4b, (%rax)
leaq 0x1a0c11(%rip), %rax    # 0x277ac8
movl $0x10, (%rax)
jmp 0xd707b
movq -0x8(%rbp), %rdi
leaq 0xb1422(%rip), %rsi     # 0x1882ef
callq 0x9090
cmpq $0x0, %rax
je 0xd6edd
jmp 0xd6fab
movq -0x8(%rbp), %rdi
leaq 0xb140c(%rip), %rsi     # 0x1882f4
callq 0x9090
cmpq $0x0, %rax
je 0xd6ef8
jmp 0xd6fab
movq -0x8(%rbp), %rdi
leaq 0xb13f6(%rip), %rsi     # 0x1882f9
callq 0x9090
cmpq $0x0, %rax
je 0xd6f13
jmp 0xd6fab
movq -0x8(%rbp), %rdi
leaq 0xb13e0(%rip), %rsi     # 0x1882fe
callq 0x9090
cmpq $0x0, %rax
je 0xd6f93
leaq 0x1a0b80(%rip), %rax    # 0x277ab0
movq $0x20000, (%rax)        # imm = 0x20000
leaq 0x1a3282(%rip), %rax    # 0x27a1c0
movl $0x0, (%rax)
leaq 0x1a0b7d(%rip), %rax    # 0x277ac8
movl $0x20000, (%rax)        # imm = 0x20000
xorl %edi, %edi
callq 0x6a330
leaq 0x1a32b1(%rip), %rax    # 0x27a210
movl $0x7da, (%rax)          # imm = 0x7DA
leaq 0x1a0b5c(%rip), %rax    # 0x277ac8
movl $0x20000, (%rax)        # imm = 0x20000
leaq 0x1a3247(%rip), %rax    # 0x27a1c0
movl $0x0, (%rax)
movl $0x29a, %edi            # imm = 0x29A
movl $0x1, %esi
callq 0x86290
jmp 0xd7073
movq -0x8(%rbp), %rdi
leaq 0xb1365(%rip), %rsi     # 0x188303
callq 0x9090
cmpq $0x0, %rax
je 0xd7003
jmp 0xd6fab
leaq 0x1a0afe(%rip), %rax    # 0x277ab0
movq $0x10, (%rax)
leaq 0x1a3200(%rip), %rax    # 0x27a1c0
movl $0x38, (%rax)
xorl %edi, %edi
callq 0x6a330
leaq 0x1a323c(%rip), %rax    # 0x27a210
movl $0x7db, (%rax)          # imm = 0x7DB
leaq 0x1a322f(%rip), %rax    # 0x27a210
movl $0x0, (%rax)
leaq 0x1a31d2(%rip), %rax    # 0x27a1c0
movl $0x38, (%rax)
leaq 0x1a0acd(%rip), %rax    # 0x277ac8
movl $0x10, (%rax)
jmp 0xd7071
movq -0x8(%rbp), %rdi
leaq 0xb12f8(%rip), %rsi     # 0x188306
callq 0x9090
cmpq $0x0, %rax
je 0xd706f
leaq 0x1a0a90(%rip), %rax    # 0x277ab0
movq $0x10, (%rax)
leaq 0x1a3192(%rip), %rax    # 0x27a1c0
movl $0x39, (%rax)
xorl %edi, %edi
callq 0x6a330
leaq 0x1a31ce(%rip), %rax    # 0x27a210
movl $0x7dc, (%rax)          # imm = 0x7DC
leaq 0x1a31c1(%rip), %rax    # 0x27a210
movl $0x0, (%rax)
leaq 0x1a3164(%rip), %rax    # 0x27a1c0
movl $0x39, (%rax)
leaq 0x1a0a5f(%rip), %rax    # 0x277ac8
movl $0x10, (%rax)
jmp 0xd7071
jmp 0xd7073
jmp 0xd7075
jmp 0xd7077
jmp 0xd7079
jmp 0xd707b
jmp 0xd707d
jmp 0xd707f
jmp 0xd7081
jmp 0xd7083
jmp 0xd7085
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)