// File: /workspace/github_cpp_makefile_star2_O1/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 0x86b1f(%rip), %rdi     # 0x124f35
callq 0x58e77
leaq 0x29d822(%rip), %rax    # 0x33bc44
movl $0x0, (%rax)
callq 0x811da
testl %eax, %eax
je 0x9e488
leaq 0x29d608(%rip), %rdx    # 0x33ba40
leaq 0x1(%rdx), %rbx
cmpb $0x20, (%rdx)
leaq 0x86af7(%rip), %rax     # 0x124f3d
leaq 0x86afe(%rip), %rsi     # 0x124f4b
cmoveq %rax, %rsi
cmovneq %rdx, %rbx
leaq 0x29e564(%rip), %r14    # 0x33c9c0
xorl %r12d, %r12d
movq %r14, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x29e1f0(%rip), %r15    # 0x33c660
movl $0x14, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9170
movb %r12b, 0x14(%r15)
movb %r12b, 0x18(%r14)
callq 0x811da
testl %eax, %eax
je 0x9e534
movaps 0x80554(%rip), %xmm0    # 0x11e9f0
leaq 0x29e19d(%rip), %rax    # 0x33c640
movaps %xmm0, (%rax)
movw $0x2020, 0x10(%rax)     # imm = 0x2020
movb $0x0, 0x12(%rax)
xorl %ecx, %ecx
leaq 0x29d587(%rip), %rdx    # 0x33ba40
leaq 0x29e2d0(%rip), %rsi    # 0x33c790
movb (%rdx,%rcx), %dil
testb %dil, %dil
je 0x9e4df
movb %dil, (%rax,%rcx)
movb %dil, (%rcx,%rsi)
movb $0x0, 0x1(%rcx,%rsi)
incq %rcx
cmpq $0x12, %rcx
jne 0x9e4c0
leaq 0x29e15a(%rip), %rdi    # 0x33c640
callq 0x9e1ec
leaq 0x29e16e(%rip), %rdi    # 0x33c660
leaq 0x86a61(%rip), %rsi     # 0x124f5a
callq 0x9090
testq %rax, %rax
je 0x9e534
leaq 0x29e136(%rip), %rdi    # 0x33c640
leaq 0x86a51(%rip), %rsi     # 0x124f62
callq 0x9090
testq %rax, %rax
je 0x9e534
leaq 0x17a3ca(%rip), %rax    # 0x2188ec
cmpl $0x0, (%rax)
jne 0x9e534
leaq 0x17cab2(%rip), %rax    # 0x21afe0
movl $0x53, (%rax)
leaq 0x29e275(%rip), %rbx    # 0x33c7b0
movb $0x0, (%rbx)
callq 0x811da
testl %eax, %eax
je 0x9e5a6
leaq 0x17ca92(%rip), %rax    # 0x21afe0
leaq 0x17a37b(%rip), %rcx    # 0x2188d0
leaq 0x29d4e4(%rip), %r14    # 0x33ba40
cmpq $0x8, (%rcx)
leaq 0x3(%r14), %rcx
cmovneq %r14, %rcx
leaq 0x5(%r14), %rdx
cmpl $0x50, (%rax)
cmovneq %rcx, %rdx
leaq 0x869ef(%rip), %rsi     # 0x124f69
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x29e172(%rip), %r15    # 0x33c700
movl $0x16, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x9170
movb %r12b, 0x16(%r15)
movb %r12b, 0x17(%rbx)
leaq 0x29e0d3(%rip), %r14    # 0x33c680
movb $0x0, (%r14)
callq 0x811da
testl %eax, %eax
je 0x9e5f2
leaq 0x29d47f(%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 0x17c9e7(%rip), %r15    # 0x21afe0
cmpl $0x4e, (%r15)
jne 0x9e70c
movb $0x0, (%rbx)
callq 0x811da
testl %eax, %eax
je 0x9e685
leaq 0x17a2ba(%rip), %rax    # 0x2188d0
leaq 0x29d423(%rip), %r14    # 0x33ba40
cmpq $0x8, (%rax)
leaq 0x3(%r14), %rax
cmovneq %r14, %rax
leaq 0x5(%r14), %rdx
cmpl $0x50, (%r15)
cmovneq %rax, %rdx
leaq 0x8692d(%rip), %rsi     # 0x124f69
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x29e0b0(%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 0x29e007(%rip), %rsi    # 0x33c680
movq %rbx, %rdi
callq 0x96c0
movb %r12b, 0x17(%rbx)
callq 0x811da
testl %eax, %eax
je 0x9e6d8
movaps 0x8035b(%rip), %xmm0    # 0x11e9f0
leaq 0x29dfa4(%rip), %rax    # 0x33c640
movaps %xmm0, (%rax)
movw $0x2020, 0x10(%rax)     # imm = 0x2020
movb $0x0, 0x12(%rax)
xorl %ecx, %ecx
leaq 0x29d38e(%rip), %rdx    # 0x33ba40
leaq 0x29e0d7(%rip), %rsi    # 0x33c790
movb (%rdx,%rcx), %dil
testb %dil, %dil
je 0x9e6d8
movb %dil, (%rax,%rcx)
movb %dil, (%rcx,%rsi)
movb $0x0, 0x1(%rcx,%rsi)
incq %rcx
cmpq $0x12, %rcx
jne 0x9e6b9
callq 0x811da
testl %eax, %eax
je 0x9e70c
leaq 0x29d358(%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 0x26f261(%rip), %rax    # 0x30d974
movl (%rax), %ecx
orl $0xf, %ecx
movl %ecx, (%rax)
leaq 0x19fc6f(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x9e746
leaq 0x86842(%rip), %rsi     # 0x124f72
leaq 0x29d0f9(%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