// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_getpos(int)
void parse_true_getpos(int survey)
{
double msl_adj;
long val, secs;

   log_packet_id("getpos");

   if(get_msg_field()) {
      lat = atof(msg_field) / 1.0E6;
      lat = lat * PI / 180.0;
   }
   else return;

   if(get_msg_field()) {
      lon = atof(msg_field) / 1.0E6;
      lon = lon * PI / 180.0;
   }
   else return;

   if(get_msg_field()) {
      alt = atof(msg_field);
   }
   else return;

   if(get_msg_field()) {  // add to alt to get WGS84?
      msl_adj = atof(msg_field);
   }
   else return;

   if(get_msg_field()) {  // survey progress
      if(survey) {  // process $SURVEY message
         val = secs = (long) atoi(msg_field);  // seconds remaining
         val = (do_survey * 3600L) - val;       // seconds completed
         survey_secs = (int) secs;

         if(secs) {
            minor_alarms |= MINOR_SURVEY;
            rcvr_mode = RCVR_MODE_SURVEY;
            survey_progress = (-1);
            have_progress = 9;
         }
         else {
            minor_alarms &= (~MINOR_SURVEY);
            rcvr_mode = RCVR_MODE_HOLD;
            survey_progress = (100);
            have_progress = 10;
         }
      }
      else {  // process $GETPOS message
         val = atoi(msg_field);  // 0=hold  3=survey?
         if(val == 0) {
            minor_alarms &= (~MINOR_SURVEY);
            rcvr_mode = RCVR_MODE_HOLD;
            survey_progress = (100);
            have_progress = 11;
         }
      }
   }
   else return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x7504d(%rip), %rdi     # 0x11017d
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x9b260
leaq 0x28a8f7(%rip), %rdi    # 0x325a40
callq 0x9470
divsd 0x57efa(%rip), %xmm0    # 0xf3050
mulsd 0x5a742(%rip), %xmm0    # 0xf58a0
divsd 0x5a742(%rip), %xmm0    # 0xf58a8
leaq 0x25be63(%rip), %rax    # 0x2f6fd0
movsd %xmm0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x9b260
leaq 0x28a8bb(%rip), %rdi    # 0x325a40
callq 0x9470
divsd 0x57ebe(%rip), %xmm0    # 0xf3050
mulsd 0x5a706(%rip), %xmm0    # 0xf58a0
divsd 0x5a706(%rip), %xmm0    # 0xf58a8
leaq 0x25be2f(%rip), %rax    # 0x2f6fd8
movsd %xmm0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x9b260
leaq 0x28a87f(%rip), %rdi    # 0x325a40
callq 0x9470
leaq 0x25be13(%rip), %rax    # 0x2f6fe0
movsd %xmm0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x9b260
callq 0x75767
testl %eax, %eax
je 0x9b260
leaq 0x28a852(%rip), %rdi    # 0x325a40
callq 0x95e0
testl %ebx, %ebx
je 0x9b21b
leaq 0x25cc96(%rip), %rcx    # 0x2f7e94
movl %eax, (%rcx)
leaq 0x25bfd1(%rip), %rcx    # 0x2f71d8
movl (%rcx), %ecx
testl %eax, %eax
je 0x9b22f
orl $0x20, %ecx
pushq $0x9
popq %rax
pushq $-0x1
popq %rdx
movb $0xb, %sil
jmp 0x9b23b
testl %eax, %eax
jne 0x9b260
leaq 0x25bfb2(%rip), %rax    # 0x2f71d8
movl (%rax), %ecx
andl $-0x21, %ecx
pushq $0xb
jmp 0x9b234
andl $-0x21, %ecx
pushq $0xa
popq %rax
pushq $0x64
popq %rdx
movb $0x7, %sil
leaq 0x25bf96(%rip), %rdi    # 0x2f71d8
movl %ecx, (%rdi)
leaq 0x25be85(%rip), %rcx    # 0x2f70d0
movb %sil, (%rcx)
leaq 0x25cc37(%rip), %rcx    # 0x2f7e8c
movl %edx, (%rcx)
leaq 0x25cc32(%rip), %rcx    # 0x2f7e90
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq