// File: /workspace/github_cpp_makefile_star2_O1/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 0x811da
leaq 0x2b71d2(%rip), %rbx    # 0x33ba40
leaq 0x9f429(%rip), %rsi     # 0x123c9e
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x8494a
callq 0x811da
testl %eax, %eax
je 0x848a2
movb $0x0, 0x20(%rbx)
leaq 0x2b8a16(%rip), %rdi    # 0x33d2b0
movq %rbx, %rsi
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0x848be
movb $0x0, 0x20(%rbx)
leaq 0x2b8a2a(%rip), %rdi    # 0x33d2e0
movq %rbx, %rsi
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0x848da
movb $0x0, 0x20(%rbx)
leaq 0x2b8a3e(%rip), %rdi    # 0x33d310
movq %rbx, %rsi
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0x8493b
movb $0x0, 0x20(%rbx)
leaq 0x2b8a52(%rip), %r14    # 0x33d340
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9340
leaq 0x9e525(%rip), %rsi     # 0x122e25
movq %r14, %rdi
callq 0x9090
movl $0x2220, %ecx           # imm = 0x2220
testq %rax, %rax
jne 0x84932
leaq 0x2b8a27(%rip), %rdi    # 0x33d340
leaq 0x9e50c(%rip), %rsi     # 0x122e2c
callq 0x9090
xorl %edx, %edx
testq %rax, %rax
movl $0x57, %ecx
cmovel %edx, %ecx
leaq 0x289467(%rip), %rax    # 0x30dda0
movl %ecx, (%rax)
leaq 0x289032(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2b70ef(%rip), %rbx    # 0x33ba40
leaq 0x9be6e(%rip), %rsi     # 0x1207c6
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x84945
callq 0x811da
testl %eax, %eax
je 0x84945
leaq 0x288863(%rip), %rax    # 0x30d1d8
movl (%rax), %ecx
movl %ecx, %edx
andl $-0x7, %edx
movl %edx, (%rax)
leaq 0x28941b(%rip), %rsi    # 0x30dda0
cmpl $0x2220, (%rsi)         # imm = 0x2220
movb (%rbx), %dil
movb 0x2(%rbx), %sil
movl %edi, %r8d
jne 0x849da
xorb $0x48, %r8b
movl %esi, %r9d
xorb $0x4c, %r9b
orb %r8b, %r9b
je 0x849ed
movl %esi, %r9d
xorb $0x48, %r9b
orb %r9b, %r8b
je 0x849fb
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 0x84a09
jmp 0x84a10
xorb $0x4c, %r8b
movl %esi, %r9d
xorb $0x48, %r9b
movl %r8d, %r10d
orb %r9b, %r10b
jne 0x849f2
orl $0x4, %edx
jmp 0x84a0e
xorb $0x48, %dil
orb %r9b, %dil
jne 0x84a00
orl $0x2, %edx
jmp 0x84a0e
xorb $0x4c, %sil
orb %sil, %r8b
jne 0x84a10
orl $0x6, %ecx
movl %ecx, %edx
movl %edx, (%rax)
leaq 0x288815(%rip), %rax    # 0x30d22c
movl $0x57, (%rax)
jmp 0x84945