// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_lla(int)
void parse_tm4_lla(int enhanced)
{
double val;
double sign;
int i;

   log_packet_id("position");
   if(enhanced) have_tm4_enhanced = 1; 
   else if(have_tm4_enhanced) return;  // ignore low res stuff

   val = 0.0;
   sign = 1.0;
   if(get_msg_field()) {  // lat
      val = atof(msg_field);
   }
   if(get_msg_field()) {
      if(msg_field[0] == 'S') sign = (-1.0);
      lat = ((double) (int) val) / 100.0;   // degrees
      val = val - (lat * 100.0);            // minutes
      val /= 60.0;
      lat += val;
      lat *= sign;
      lat = lat * PI / 180.0;
   }

   val = 0.0;
   sign = 1.0;
   if(get_msg_field()) {  // lon
      val = atof(msg_field);
   }
   if(get_msg_field()) {
      if(msg_field[0] == 'W') sign = (-1.0);
      lon = ((double) (int) val) / 100.0;   // degrees
      val = val - (lat * 100.0);            // minutes
      val /= 60.0;
      lon += val;
      lon *= sign;
      lon = lon * PI / 180.0;
   }

   if(enhanced) {
      if(get_msg_field()) {
         alt = atof(msg_field);
      }
      get_msg_field(); // 'M' for meters
   }

   if(get_msg_field()) { // 0=no gps   1=gps avail;
      tm4_gps = atoi(msg_field);
   }

   if(get_msg_field()) { // sat count
      if(msg_field[0] == 'C') i = 12;
      else if(msg_field[0] == 'B') i = 11;
      else if(msg_field[0] == 'A') i = 10;
      else i = atoi(msg_field);
      sat_count = i;
      config_sat_count(sat_count);
      have_count = 444;
   }

   if(enhanced) {
      if(get_msg_field()) {
         hdop = (float) atof(msg_field);
         have_dops |= HDOP;
      }

      if(get_msg_field()) {
         speed = atof(msg_field);
         have_speed = 444;
      }

      if(get_msg_field()) {
         heading = atof(msg_field);
         have_heading = 444;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
leaq 0x80442(%rip), %rdi     # 0x124aac
callq 0x58e77
leaq 0x2978ee(%rip), %rax    # 0x33bf64
testl %ebx, %ebx
je 0xa4697
movl $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa46a2
leaq 0x2973b0(%rip), %rdi    # 0x33ba40
callq 0x9470
jmp 0xa46a6
cmpl $0x0, (%rax)
jne 0xa48be
jmp 0xa4680
xorpd %xmm0, %xmm0
movapd %xmm0, -0x20(%rbp)
callq 0x811da
testl %eax, %eax
je 0xa4710
leaq 0x297385(%rip), %rax    # 0x33ba40
cmpb $0x53, (%rax)
movapd -0x20(%rbp), %xmm2
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm0
movsd 0x6498d(%rip), %xmm1    # 0x109060
divsd %xmm1, %xmm0
mulsd %xmm0, %xmm1
subsd %xmm1, %xmm2
divsd 0x64921(%rip), %xmm2    # 0x109008
addsd %xmm0, %xmm2
jne 0xa46f5
xorpd 0x64aab(%rip), %xmm2    # 0x1091a0
mulsd 0x6711b(%rip), %xmm2    # 0x10b818
divsd 0x6711b(%rip), %xmm2    # 0x10b820
leaq 0x2688c4(%rip), %rax    # 0x30cfd0
movsd %xmm2, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa4727
leaq 0x297320(%rip), %rdi    # 0x33ba40
callq 0x9470
jmp 0xa472b
xorpd %xmm0, %xmm0
movapd %xmm0, -0x20(%rbp)
callq 0x811da
testl %eax, %eax
je 0xa479c
leaq 0x297300(%rip), %rax    # 0x33ba40
cmpb $0x57, (%rax)
movapd -0x20(%rbp), %xmm2
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm0
movsd 0x64908(%rip), %xmm1    # 0x109060
divsd %xmm1, %xmm0
leaq 0x268875(%rip), %rax    # 0x30cfd8
leaq 0x268866(%rip), %rcx    # 0x30cfd0
mulsd (%rcx), %xmm1
subsd %xmm1, %xmm2
divsd 0x6488e(%rip), %xmm2    # 0x109008
addsd %xmm0, %xmm2
jne 0xa4788
xorpd 0x64a18(%rip), %xmm2    # 0x1091a0
mulsd 0x67088(%rip), %xmm2    # 0x10b818
divsd 0x67088(%rip), %xmm2    # 0x10b820
movsd %xmm2, (%rax)
testl %ebx, %ebx
je 0xa47c5
callq 0x811da
testl %eax, %eax
je 0xa47c0
leaq 0x297290(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x268824(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0xa47e0
leaq 0x29726b(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, 0x2cd81c(%rip)    # 0x371ffc
callq 0x811da
testl %eax, %eax
je 0xa482a
leaq 0x297250(%rip), %rax    # 0x33ba40
movb (%rax), %al
leal -0x41(%rax), %ecx
cmpb $0x3, %cl
jae 0xa4801
addb $-0x37, %al
movzbl %al, %edi
jmp 0xa480f
leaq 0x297238(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %edi
leaq 0x19a6f6(%rip), %rax    # 0x23ef0c
movl %edi, (%rax)
callq 0x5e411
leaq 0x268af4(%rip), %rax    # 0x30d318
movl $0x1bc, (%rax)          # imm = 0x1BC
testl %ebx, %ebx
je 0xa48be
callq 0x811da
testl %eax, %eax
je 0xa4864
leaq 0x2971fe(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x17ec9a(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
leaq 0x17ec83(%rip), %rax    # 0x2234e4
orb $0x2, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa4891
leaq 0x2971cc(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2687a0(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
leaq 0x268aad(%rip), %rax    # 0x30d338
movl $0x1bc, (%rax)          # imm = 0x1BC
callq 0x811da
testl %eax, %eax
je 0xa48be
leaq 0x29719f(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x26877b(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
leaq 0x268a7c(%rip), %rax    # 0x30d334
movl $0x1bc, (%rax)          # imm = 0x1BC
addq $0x18, %rsp
popq %rbx
popq %rbp
retq