// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_perdsys()
void parse_perdsys()
{
   get_msg_field();
   if(strstr(msg_field, "VERSION")) {  
      if(get_msg_field()) {
         msg_field[32] = 0;
         strcpy(esip_device, msg_field);
      }
      if(get_msg_field()) {
         msg_field[32] = 0;
         strcpy(esip_version, msg_field);
      }
      if(get_msg_field()) {
         msg_field[32] = 0;
         strcpy(esip_query, msg_field);
      }
      if(get_msg_field()) {
         msg_field[32] = 0;
         strcpy(esip_model, msg_field);
         if(strstr(esip_model, "GT8736")) furuno_type = 8736;
         else if(strstr(esip_model, "GT87")) furuno_type = 87;
         else furuno_type = 0;
      }
      have_info |= ALL_ID_INFO;
   }
   else if(strstr(msg_field, "GPIO")) {  // gpio0 .. gpio8
      if(get_msg_field()) { 
         minor_alarms &= (~MINOR_ANT_NO_PWR);
         // !!!!!! this decode does NOT match the G87 docs !!!!!
         if(furuno_type == 8736) {  // GT8736
            if     ((msg_field[0] == 'H') && (msg_field[2] == 'L')) minor_alarms |= MINOR_ANT_SHORT;  // short
            else if((msg_field[0] == 'H') && (msg_field[2] == 'H')) minor_alarms |= MINOR_ANT_OPEN;   // open
            else if((msg_field[0] == 'L') && (msg_field[2] == 'H')) ;  // normal
            else if((msg_field[0] == 'L') && (msg_field[2] == 'L')) minor_alarms |= MINOR_ANT_NO_PWR; // unkn
         }
         else {  // GT87
            if     ((msg_field[0] == 'L') && (msg_field[2] == 'H')) minor_alarms |= MINOR_ANT_SHORT;  // short
            else if((msg_field[0] == 'H') && (msg_field[2] == 'H')) minor_alarms |= MINOR_ANT_OPEN;   // open
            else if((msg_field[0] == 'H') && (msg_field[2] == 'L')) ;  // normal
            else if((msg_field[0] == 'L') && (msg_field[2] == 'L')) minor_alarms |= MINOR_ANT_NO_PWR; // unkn
         }
         have_antenna = 87;
//sprintf(debug_text, "GPIO:%s", msg_field);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x810b1
leaq 0x2b72ce(%rip), %rbx    # 0x33ba40
leaq 0x9f605(%rip), %rsi     # 0x123d7e
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x8484e
callq 0x810b1
testl %eax, %eax
je 0x847a6
movb $0x0, 0x20(%rbx)
leaq 0x2b8b12(%rip), %rdi    # 0x33d2b0
movq %rbx, %rsi
callq 0x9340
callq 0x810b1
testl %eax, %eax
je 0x847c2
movb $0x0, 0x20(%rbx)
leaq 0x2b8b26(%rip), %rdi    # 0x33d2e0
movq %rbx, %rsi
callq 0x9340
callq 0x810b1
testl %eax, %eax
je 0x847de
movb $0x0, 0x20(%rbx)
leaq 0x2b8b3a(%rip), %rdi    # 0x33d310
movq %rbx, %rsi
callq 0x9340
callq 0x810b1
testl %eax, %eax
je 0x8483f
movb $0x0, 0x20(%rbx)
leaq 0x2b8b4e(%rip), %r14    # 0x33d340
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9340
leaq 0x9e701(%rip), %rsi     # 0x122f05
movq %r14, %rdi
callq 0x9090
movl $0x2220, %ecx           # imm = 0x2220
testq %rax, %rax
jne 0x84836
leaq 0x2b8b23(%rip), %rdi    # 0x33d340
leaq 0x9e6e8(%rip), %rsi     # 0x122f0c
callq 0x9090
xorl %edx, %edx
testq %rax, %rax
movl $0x57, %ecx
cmovel %edx, %ecx
leaq 0x289563(%rip), %rax    # 0x30dda0
movl %ecx, (%rax)
leaq 0x28912e(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2b71eb(%rip), %rbx    # 0x33ba40
leaq 0x9c04a(%rip), %rsi     # 0x1208a6
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x84849
callq 0x810b1
testl %eax, %eax
je 0x84849
leaq 0x28895f(%rip), %rax    # 0x30d1d8
movl (%rax), %ecx
movl %ecx, %edx
andl $-0x7, %edx
movl %edx, (%rax)
leaq 0x289517(%rip), %rsi    # 0x30dda0
cmpl $0x2220, (%rsi)         # imm = 0x2220
movb (%rbx), %dil
movb 0x2(%rbx), %sil
movl %edi, %r8d
jne 0x848de
xorb $0x48, %r8b
movl %esi, %r9d
xorb $0x4c, %r9b
orb %r8b, %r9b
je 0x848f1
movl %esi, %r9d
xorb $0x48, %r9b
orb %r9b, %r8b
je 0x848ff
cmpb $0x48, %sil
sete %dl
cmpb $0x4c, %sil
sete %sil
cmpb $0x4c, %dil
sete %dil
andb %dil, %dl
xorb %dil, %dl
andb %sil, %dl
cmpb $0x1, %dl
je 0x8490d
jmp 0x84914
xorb $0x4c, %r8b
movl %esi, %r9d
xorb $0x48, %r9b
movl %r8d, %r10d
orb %r9b, %r10b
jne 0x848f6
orl $0x4, %edx
jmp 0x84912
xorb $0x48, %dil
orb %r9b, %dil
jne 0x84904
orl $0x2, %edx
jmp 0x84912
xorb $0x4c, %sil
orb %sil, %r8b
jne 0x84914
orl $0x6, %ecx
movl %ecx, %edx
movl %edx, (%rax)
leaq 0x288911(%rip), %rax    # 0x30d22c
movl $0x57, (%rax)
jmp 0x84849