// File: /workspace/github_cpp_makefile_star2_O3/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 0x7b38f(%rip), %rdi     # 0x126238
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xaafe8
leaq 0x290b7e(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x5e181(%rip), %xmm0    # 0x109050
mulsd 0x60951(%rip), %xmm0    # 0x10b828
divsd 0x60951(%rip), %xmm0    # 0x10b830
leaq 0x2620ea(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xaafe8
leaq 0x290b42(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x5e145(%rip), %xmm0    # 0x109050
mulsd 0x60915(%rip), %xmm0    # 0x10b828
divsd 0x60915(%rip), %xmm0    # 0x10b830
leaq 0x2620b6(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xaafe8
leaq 0x290b06(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x26209a(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xaafe8
callq 0x810b1
testl %eax, %eax
je 0xaafe8
leaq 0x290ad5(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %ebx, %ebx
je 0xaaf9c
leaq 0x262f19(%rip), %rcx    # 0x30de94
movl %eax, (%rcx)
leaq 0x262254(%rip), %rcx    # 0x30d1d8
movl (%rcx), %ecx
testl %eax, %eax
je 0xaafb3
orl $0x20, %ecx
movl $0x9, %eax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movb $0xb, %sil
jmp 0xaafc3
testl %eax, %eax
jne 0xaafe8
leaq 0x262231(%rip), %rax    # 0x30d1d8
movl (%rax), %ecx
andl $-0x21, %ecx
movl $0xb, %eax
jmp 0xaafbb
andl $-0x21, %ecx
movl $0xa, %eax
movl $0x64, %edx
movb $0x7, %sil
leaq 0x26220e(%rip), %rdi    # 0x30d1d8
movl %ecx, (%rdi)
leaq 0x2620fd(%rip), %rcx    # 0x30d0d0
movb %sil, (%rcx)
leaq 0x262eaf(%rip), %rcx    # 0x30de8c
movl %edx, (%rcx)
leaq 0x262eaa(%rip), %rcx    # 0x30de90
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq