// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x9e2ca
leaq 0x17cdc1(%rip), %rax    # 0x21afc8
cmpl $0x0, (%rax)
je 0x9e2ca
leaq 0x17a6b9(%rip), %r15    # 0x2188d0
cmpq $0x10, (%r15)
jne 0x9e2ca
leaq 0x17a6c0(%rip), %r14    # 0x2188e8
cmpl $0x0, (%r14)
jne 0x9e2ca
movq %rdi, %rbx
leaq 0x86cc6(%rip), %rsi     # 0x124f02
callq 0x9090
testq %rax, %rax
je 0x9e26d
movq $0x10, (%r15)
leaq 0x17cd8c(%rip), %rbx    # 0x21afe0
xorl %r15d, %r15d
movl %r15d, (%rbx)
xorl %edi, %edi
callq 0x4b25a
leaq 0x17cdc8(%rip), %rax    # 0x21b030
movl %r15d, (%rax)
jmp 0x9e2c0
leaq 0x86c93(%rip), %rsi     # 0x124f07
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
jne 0x9e295
leaq 0x86c84(%rip), %rsi     # 0x124f0c
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x9e2d3
movq $0x10, (%r15)
leaq 0x17cd3d(%rip), %rbx    # 0x21afe0
movl $0x38, %r15d
movl %r15d, (%rbx)
xorl %edi, %edi
callq 0x4b25a
leaq 0x17cd76(%rip), %rax    # 0x21b030
movl $0x0, (%rax)
movl %r15d, (%rbx)
movl $0x10, (%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x86c37(%rip), %rsi     # 0x124f11
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
jne 0x9e2fb
leaq 0x86c28(%rip), %rsi     # 0x124f16
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x9e311
movq $0x10, (%r15)
leaq 0x17ccd7(%rip), %rbx    # 0x21afe0
movl $0x4b, %r15d
jmp 0x9e2a9
leaq 0x86c03(%rip), %rsi     # 0x124f1b
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
jne 0x9e295
leaq 0x86bf0(%rip), %rsi     # 0x124f20
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
jne 0x9e295
leaq 0x86bdd(%rip), %rsi     # 0x124f25
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
jne 0x9e295
leaq 0x86bca(%rip), %rsi     # 0x124f2a
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x9e3bb
movq $0x20000, (%r15)        # imm = 0x20000
leaq 0x17cc65(%rip), %rbx    # 0x21afe0
xorl %r15d, %r15d
movl %r15d, (%rbx)
movl $0x20000, %r12d         # imm = 0x20000
movl %r12d, (%r14)
xorl %edi, %edi
callq 0x4b25a
leaq 0x17cc98(%rip), %rax    # 0x21b030
movl $0x7da, (%rax)          # imm = 0x7DA
movl %r12d, (%r14)
movl %r15d, (%rbx)
movl $0x29a, %edi            # imm = 0x29A
movl $0x1, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x61765
leaq 0x86b6d(%rip), %rsi     # 0x124f2f
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
jne 0x9e295
leaq 0x86b58(%rip), %rsi     # 0x124f32
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x9e2ca
movq $0x10, (%r15)
leaq 0x17cbe7(%rip), %rbx    # 0x21afe0
movl $0x39, %r15d
jmp 0x9e2a9