// File: /workspace/github_cpp_makefile_star2_O1/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 0x7b530(%rip), %rdi     # 0x126158
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xaad67
leaq 0x290dff(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x5e402(%rip), %xmm0    # 0x109050
mulsd 0x60bc2(%rip), %xmm0    # 0x10b818
divsd 0x60bc2(%rip), %xmm0    # 0x10b820
leaq 0x26236b(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0xaad67
leaq 0x290dc3(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x5e3c6(%rip), %xmm0    # 0x109050
mulsd 0x60b86(%rip), %xmm0    # 0x10b818
divsd 0x60b86(%rip), %xmm0    # 0x10b820
leaq 0x262337(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0xaad67
leaq 0x290d87(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x26231b(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0xaad67
callq 0x811da
testl %eax, %eax
je 0xaad67
leaq 0x290d56(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %ebx, %ebx
je 0xaad1b
leaq 0x26319a(%rip), %rcx    # 0x30de94
movl %eax, (%rcx)
leaq 0x2624d5(%rip), %rcx    # 0x30d1d8
movl (%rcx), %ecx
testl %eax, %eax
je 0xaad32
orl $0x20, %ecx
movl $0x9, %eax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movb $0xb, %sil
jmp 0xaad42
testl %eax, %eax
jne 0xaad67
leaq 0x2624b2(%rip), %rax    # 0x30d1d8
movl (%rax), %ecx
andl $-0x21, %ecx
movl $0xb, %eax
jmp 0xaad3a
andl $-0x21, %ecx
movl $0xa, %eax
movl $0x64, %edx
movb $0x7, %sil
leaq 0x26248f(%rip), %rdi    # 0x30d1d8
movl %ecx, (%rdi)
leaq 0x26237e(%rip), %rcx    # 0x30d0d0
movb %sil, (%rcx)
leaq 0x263130(%rip), %rcx    # 0x30de8c
movl %edx, (%rcx)
leaq 0x26312b(%rip), %rcx    # 0x30de90
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq