// File: /workspace/github_cpp_makefile_star2_O3/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 0x86a25(%rip), %rdi     # 0x125015
callq 0x58dc2
leaq 0x29d648(%rip), %rax    # 0x33bc44
movl $0x0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x9e662
leaq 0x29d42e(%rip), %rdx    # 0x33ba40
leaq 0x1(%rdx), %rbx
cmpb $0x20, (%rdx)
leaq 0x869fd(%rip), %rax     # 0x12501d
leaq 0x86a04(%rip), %rsi     # 0x12502b
cmoveq %rax, %rsi
cmovneq %rdx, %rbx
leaq 0x29e38a(%rip), %r14    # 0x33c9c0
xorl %r12d, %r12d
movq %r14, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x29e016(%rip), %r15    # 0x33c660
movl $0x14, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9170
movb %r12b, 0x14(%r15)
movb %r12b, 0x18(%r14)
callq 0x810b1
testl %eax, %eax
je 0x9e70e
movaps 0x8042a(%rip), %xmm0    # 0x11eaa0
leaq 0x29dfc3(%rip), %rax    # 0x33c640
movaps %xmm0, (%rax)
movw $0x2020, 0x10(%rax)     # imm = 0x2020
movb $0x0, 0x12(%rax)
xorl %ecx, %ecx
leaq 0x29d3ad(%rip), %rdx    # 0x33ba40
leaq 0x29e0f6(%rip), %rsi    # 0x33c790
movb (%rdx,%rcx), %dil
testb %dil, %dil
je 0x9e6b9
movb %dil, (%rax,%rcx)
movb %dil, (%rcx,%rsi)
movb $0x0, 0x1(%rcx,%rsi)
incq %rcx
cmpq $0x12, %rcx
jne 0x9e69a
leaq 0x29df80(%rip), %rdi    # 0x33c640
callq 0x9e3c6
leaq 0x29df94(%rip), %rdi    # 0x33c660
leaq 0x86967(%rip), %rsi     # 0x12503a
callq 0x9090
testq %rax, %rax
je 0x9e70e
leaq 0x29df5c(%rip), %rdi    # 0x33c640
leaq 0x86957(%rip), %rsi     # 0x125042
callq 0x9090
testq %rax, %rax
je 0x9e70e
leaq 0x17a1f0(%rip), %rax    # 0x2188ec
cmpl $0x0, (%rax)
jne 0x9e70e
leaq 0x17c8d8(%rip), %rax    # 0x21afe0
movl $0x53, (%rax)
leaq 0x29e09b(%rip), %rbx    # 0x33c7b0
movb $0x0, (%rbx)
callq 0x810b1
testl %eax, %eax
je 0x9e780
leaq 0x17c8b8(%rip), %rax    # 0x21afe0
leaq 0x17a1a1(%rip), %rcx    # 0x2188d0
leaq 0x29d30a(%rip), %r14    # 0x33ba40
cmpq $0x8, (%rcx)
leaq 0x3(%r14), %rcx
cmovneq %r14, %rcx
leaq 0x5(%r14), %rdx
cmpl $0x50, (%rax)
cmovneq %rcx, %rdx
leaq 0x868f5(%rip), %rsi     # 0x125049
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x29df98(%rip), %r15    # 0x33c700
movl $0x16, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x9170
movb %r12b, 0x16(%r15)
movb %r12b, 0x17(%rbx)
leaq 0x29def9(%rip), %r14    # 0x33c680
movb $0x0, (%r14)
callq 0x810b1
testl %eax, %eax
je 0x9e7cc
leaq 0x29d2a5(%rip), %rsi    # 0x33ba40
movl $0x16, %edx
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 0x17c80d(%rip), %r15    # 0x21afe0
cmpl $0x4e, (%r15)
jne 0x9e8e6
movb $0x0, (%rbx)
callq 0x810b1
testl %eax, %eax
je 0x9e85f
leaq 0x17a0e0(%rip), %rax    # 0x2188d0
leaq 0x29d249(%rip), %r14    # 0x33ba40
cmpq $0x8, (%rax)
leaq 0x3(%r14), %rax
cmovneq %r14, %rax
leaq 0x5(%r14), %rdx
cmpl $0x50, (%r15)
cmovneq %rax, %rdx
leaq 0x86833(%rip), %rsi     # 0x125049
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x29ded6(%rip), %r15    # 0x33c700
movl $0x16, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x9170
movb %r12b, 0x16(%r15)
movq %rbx, %rdi
callq 0x9120
movw $0x20, (%rbx,%rax)
leaq 0x29de2d(%rip), %rsi    # 0x33c680
movq %rbx, %rdi
callq 0x96c0
movb %r12b, 0x17(%rbx)
callq 0x810b1
testl %eax, %eax
je 0x9e8b2
movaps 0x80231(%rip), %xmm0    # 0x11eaa0
leaq 0x29ddca(%rip), %rax    # 0x33c640
movaps %xmm0, (%rax)
movw $0x2020, 0x10(%rax)     # imm = 0x2020
movb $0x0, 0x12(%rax)
xorl %ecx, %ecx
leaq 0x29d1b4(%rip), %rdx    # 0x33ba40
leaq 0x29defd(%rip), %rsi    # 0x33c790
movb (%rdx,%rcx), %dil
testb %dil, %dil
je 0x9e8b2
movb %dil, (%rax,%rcx)
movb %dil, (%rcx,%rsi)
movb $0x0, 0x1(%rcx,%rsi)
incq %rcx
cmpq $0x12, %rcx
jne 0x9e893
callq 0x810b1
testl %eax, %eax
je 0x9e8e6
leaq 0x29d17e(%rip), %r14    # 0x33ba40
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 0x26f087(%rip), %rax    # 0x30d974
movl (%rax), %ecx
orl $0xf, %ecx
movl %ecx, (%rax)
leaq 0x19fa95(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x9e920
leaq 0x86748(%rip), %rsi     # 0x125052
leaq 0x29cf1f(%rip), %rdx    # 0x33b830
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