// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_id()
void parse_scpi_id()
{
int i;

   log_packet_id("scpi id");

   msg_col = 0;
   if(get_msg_field()) {  // manufacturer
      if(msg_field[0] == ' ') {
         sprintf(scpi_mfg_id, "Mfg: %-18.18s", &msg_field[0]);
         strncpy(scpi_mfg, &msg_field[1], 20);
      }
      else {
         sprintf(scpi_mfg_id, "Mfg:  %-17.17s", msg_field);
         strncpy(scpi_mfg, msg_field, 20);
      }
      scpi_mfg[20] = 0;
      scpi_mfg_id[24] = 0;
   }

   if(get_msg_field()) {  // model
      for(i=0; i<UNIT_LEN; i++) unit_name[i] = ' ';
      unit_name[UNIT_LEN] = 0;
      for(i=0; i<UNIT_LEN; i++) {
         if(msg_field[i] == 0) break;
         unit_name[i] = msg_field[i];
         scpi_model[i] = msg_field[i];
         scpi_model[i+1] = 0;
      }

      verify_scpi_type(unit_name);

      if(strstr(scpi_mfg, "SAMSUNG")) {
         if(strstr(unit_name, "UCCM-L")) {  // samsung (-LPK, -L8)
            if(user_set_scpi_type == 0) scpi_type = SAMSUNG_TYPE;
         }
      }
   }

   scpi_serno[0] = 0;
   if(get_msg_field()) {  // serial number
      if     (scpi_type == UCCMP_TYPE) sprintf(scpi_serno, "Ser:  %s", &msg_field[5]);
      else if(rcvr_type == UCCM_RCVR)  sprintf(scpi_serno, "Ser:  %s", &msg_field[3]);
      else                             sprintf(scpi_serno, "Ser:  %s", msg_field);
      strncpy(scpi_sn, msg_field, 22);
      scpi_sn[22] = 0;
      scpi_serno[23] = 0;
   }

   scpi_fw[0] = 0;
   if(get_msg_field()) {  // fw rev
      strncpy(scpi_fw, msg_field, 22);
      scpi_fw[22] = 0;
      strcat(scpi_serno, " ");
      strcat(scpi_serno, scpi_fw);
      scpi_serno[23] = 0;
   }

   if(scpi_type == NORTEL_TYPE) {
      scpi_serno[0] = 0;
      if(get_msg_field()) {  // CPC - serial number
         if     (scpi_type == UCCMP_TYPE) sprintf(scpi_serno, "Ser:  %s", &msg_field[5]);
         else if(rcvr_type == UCCM_RCVR)  sprintf(scpi_serno, "Ser:  %s", &msg_field[3]);
         else                             sprintf(scpi_serno, "Ser:  %s", msg_field);
         strncpy(scpi_sn, msg_field, 22);
         scpi_sn[22] = 0;

         strcat(scpi_serno, " ");
         strcat(scpi_serno, scpi_fw);
         scpi_serno[23] = 0;
      }

      if(get_msg_field()) {  // PEC - model
         for(i=0; i<UNIT_LEN; i++) unit_name[i] = ' ';
         unit_name[UNIT_LEN] = 0;
         for(i=0; i<UNIT_LEN; i++) {
            if(msg_field[i] == 0) break;
            unit_name[i] = msg_field[i];
            scpi_model[i] = msg_field[i];
            scpi_model[i+1] = 0;
         }
      }

      if(get_msg_field()) {  // hardware version
         msg_field[2] = 0;
         strcat(scpi_serno, "-");
         strcat(scpi_serno, msg_field);
         scpi_serno[23] = 0;
      }
   }

   have_info |= ALL_ID_INFO;

if(debug_file) fprintf(debug_file, "### id:%s  have_info:%02X\n", nmea_msg, have_info);

//show_version_info();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x7f82c(%rip), %rdi     # 0x10ef5d
callq 0x520bf
leaq 0x296507(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8f79e
leaq 0x2962f0(%rip), %rdx    # 0x325a40
leaq 0x1(%rdx), %rbx
cmpb $0x20, (%rdx)
leaq 0x7f807(%rip), %rax     # 0x10ef65
leaq 0x7f80e(%rip), %rsi     # 0x10ef73
cmoveq %rax, %rsi
cmovneq %rdx, %rbx
leaq 0x29724c(%rip), %r14    # 0x3269c0
xorl %r12d, %r12d
movq %r14, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x296ed8(%rip), %r15    # 0x326660
pushq $0x14
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9170
movb %r12b, 0x14(%r15)
movb %r12b, 0x18(%r14)
callq 0x75767
testl %eax, %eax
je 0x8f84d
xorl %ecx, %ecx
leaq 0x296e8c(%rip), %rax    # 0x326640
cmpq $0x12, %rcx
je 0x8f7c3
movb $0x20, (%rax,%rcx)
incq %rcx
jmp 0x8f7b4
movb $0x0, 0x12(%rax)
xorl %ecx, %ecx
leaq 0x296270(%rip), %rdx    # 0x325a40
leaq 0x296fb9(%rip), %rsi    # 0x326790
cmpq $0x12, %rcx
je 0x8f7f8
movb (%rdx,%rcx), %dil
testb %dil, %dil
je 0x8f7f8
movb %dil, (%rax,%rcx)
movb %dil, (%rcx,%rsi)
movb $0x0, 0x1(%rcx,%rsi)
incq %rcx
jmp 0x8f7d7
leaq 0x296e41(%rip), %rdi    # 0x326640
callq 0x8f516
leaq 0x296e55(%rip), %rdi    # 0x326660
leaq 0x7f770(%rip), %rsi     # 0x10ef82
callq 0x9090
testq %rax, %rax
je 0x8f84d
leaq 0x296e1d(%rip), %rdi    # 0x326640
leaq 0x7f760(%rip), %rsi     # 0x10ef8a
callq 0x9090
testq %rax, %rax
je 0x8f84d
leaq 0x1730b1(%rip), %rax    # 0x2028ec
cmpl $0x0, (%rax)
jne 0x8f84d
leaq 0x175799(%rip), %rax    # 0x204fe0
movl $0x53, (%rax)
leaq 0x296f5c(%rip), %rbx    # 0x3267b0
movb $0x0, (%rbx)
callq 0x75767
testl %eax, %eax
je 0x8f8bd
leaq 0x175779(%rip), %rax    # 0x204fe0
leaq 0x173062(%rip), %rcx    # 0x2028d0
leaq 0x2961cb(%rip), %r14    # 0x325a40
cmpq $0x8, (%rcx)
leaq 0x3(%r14), %rcx
cmovneq %r14, %rcx
leaq 0x5(%r14), %rdx
cmpl $0x50, (%rax)
cmovneq %rcx, %rdx
leaq 0x7f6fe(%rip), %rsi     # 0x10ef91
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x296e59(%rip), %r15    # 0x326700
pushq $0x16
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x9170
movb %r12b, 0x16(%r15)
movb %r12b, 0x17(%rbx)
leaq 0x296dbc(%rip), %r14    # 0x326680
movb $0x0, (%r14)
callq 0x75767
testl %eax, %eax
je 0x8f907
leaq 0x296168(%rip), %rsi    # 0x325a40
pushq $0x16
popq %rdx
movq %r14, %rdi
callq 0x9170
xorl %r15d, %r15d
movb %r15b, 0x16(%r14)
movq %rbx, %rdi
callq 0x9120
movw $0x20, (%rbx,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x96c0
movb %r15b, 0x17(%rbx)
leaq 0x1756d2(%rip), %r15    # 0x204fe0
cmpl $0x4e, (%r15)
jne 0x8fa22
movb $0x0, (%rbx)
callq 0x75767
testl %eax, %eax
je 0x8f998
leaq 0x172fa5(%rip), %rax    # 0x2028d0
leaq 0x29610e(%rip), %r14    # 0x325a40
cmpq $0x8, (%rax)
leaq 0x3(%r14), %rax
cmovneq %r14, %rax
leaq 0x5(%r14), %rdx
cmpl $0x50, (%r15)
cmovneq %rax, %rdx
leaq 0x7f640(%rip), %rsi     # 0x10ef91
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x296d9b(%rip), %r15    # 0x326700
pushq $0x16
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x9170
movb %r12b, 0x16(%r15)
movq %rbx, %rdi
callq 0x9120
movw $0x20, (%rbx,%rax)
leaq 0x296cf4(%rip), %rsi    # 0x326680
movq %rbx, %rdi
callq 0x96c0
movb %r12b, 0x17(%rbx)
callq 0x75767
testl %eax, %eax
je 0x8f9ee
xorl %ecx, %ecx
leaq 0x296c96(%rip), %rax    # 0x326640
cmpq $0x12, %rcx
je 0x8f9b9
movb $0x20, (%rax,%rcx)
incq %rcx
jmp 0x8f9aa
movb $0x0, 0x12(%rax)
xorl %ecx, %ecx
leaq 0x29607a(%rip), %rdx    # 0x325a40
leaq 0x296dc3(%rip), %rsi    # 0x326790
cmpq $0x12, %rcx
je 0x8f9ee
movb (%rdx,%rcx), %dil
testb %dil, %dil
je 0x8f9ee
movb %dil, (%rax,%rcx)
movb %dil, (%rcx,%rsi)
movb $0x0, 0x1(%rcx,%rsi)
incq %rcx
jmp 0x8f9cd
callq 0x75767
testl %eax, %eax
je 0x8fa22
leaq 0x296042(%rip), %r14    # 0x325a40
xorl %r15d, %r15d
movb %r15b, 0x2(%r14)
movq %rbx, %rdi
callq 0x9120
movw $0x2d, (%rbx,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x96c0
movb %r15b, 0x17(%rbx)
leaq 0x267f4b(%rip), %rax    # 0x2f7974
movl (%rax), %ecx
orl $0xf, %ecx
movl %ecx, (%rax)
leaq 0x198959(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x8fa5c
leaq 0x7f554(%rip), %rsi     # 0x10ef9a
leaq 0x295de3(%rip), %rdx    # 0x325830
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9560
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq