// File: /workspace/github_cpp_makefile_star2_O2/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 0x79712(%rip), %rdi     # 0x10ead4
callq 0x520bf
leaq 0x290b96(%rip), %rax    # 0x325f64
testl %ebx, %ebx
je 0x953ef
movl $0x1, (%rax)
callq 0x75767
testl %eax, %eax
je 0x953fa
leaq 0x290658(%rip), %rdi    # 0x325a40
callq 0x9470
jmp 0x953fe
cmpl $0x0, (%rax)
jne 0x95616
jmp 0x953d8
xorpd %xmm0, %xmm0
movapd %xmm0, -0x20(%rbp)
callq 0x75767
testl %eax, %eax
je 0x95468
leaq 0x29062d(%rip), %rax    # 0x325a40
cmpb $0x53, (%rax)
movapd -0x20(%rbp), %xmm2
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm0
movsd 0x5dc35(%rip), %xmm1    # 0xf3060
divsd %xmm1, %xmm0
mulsd %xmm0, %xmm1
subsd %xmm1, %xmm2
divsd 0x5dbc9(%rip), %xmm2    # 0xf3008
addsd %xmm0, %xmm2
jne 0x9544d
xorpd 0x5dd63(%rip), %xmm2    # 0xf31b0
mulsd 0x6044b(%rip), %xmm2    # 0xf58a0
divsd 0x6044b(%rip), %xmm2    # 0xf58a8
leaq 0x261b6c(%rip), %rax    # 0x2f6fd0
movsd %xmm2, (%rax)
callq 0x75767
testl %eax, %eax
je 0x9547f
leaq 0x2905c8(%rip), %rdi    # 0x325a40
callq 0x9470
jmp 0x95483
xorpd %xmm0, %xmm0
movapd %xmm0, -0x20(%rbp)
callq 0x75767
testl %eax, %eax
je 0x954f4
leaq 0x2905a8(%rip), %rax    # 0x325a40
cmpb $0x57, (%rax)
movapd -0x20(%rbp), %xmm2
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm0
movsd 0x5dbb0(%rip), %xmm1    # 0xf3060
divsd %xmm1, %xmm0
leaq 0x261b15(%rip), %rax    # 0x2f6fd0
mulsd (%rax), %xmm1
subsd %xmm1, %xmm2
divsd 0x5db3d(%rip), %xmm2    # 0xf3008
addsd %xmm0, %xmm2
jne 0x954d9
xorpd 0x5dcd7(%rip), %xmm2    # 0xf31b0
mulsd 0x603bf(%rip), %xmm2    # 0xf58a0
divsd 0x603bf(%rip), %xmm2    # 0xf58a8
leaq 0x261ae8(%rip), %rax    # 0x2f6fd8
movsd %xmm2, (%rax)
testl %ebx, %ebx
je 0x9551d
callq 0x75767
testl %eax, %eax
je 0x95518
leaq 0x290538(%rip), %rdi    # 0x325a40
callq 0x9470
leaq 0x261acc(%rip), %rax    # 0x2f6fe0
movsd %xmm0, (%rax)
callq 0x75767
callq 0x75767
testl %eax, %eax
je 0x95538
leaq 0x290513(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, 0x2c6ac4(%rip)    # 0x35bffc
callq 0x75767
testl %eax, %eax
je 0x95582
leaq 0x2904f8(%rip), %rax    # 0x325a40
movb (%rax), %al
leal -0x41(%rax), %ecx
cmpb $0x3, %cl
jae 0x95559
addb $-0x37, %al
movzbl %al, %edi
jmp 0x95567
leaq 0x2904e0(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %edi
leaq 0x19399e(%rip), %rax    # 0x228f0c
movl %edi, (%rax)
callq 0x56d93
leaq 0x261d9c(%rip), %rax    # 0x2f7318
movl $0x1bc, (%rax)          # imm = 0x1BC
testl %ebx, %ebx
je 0x95616
callq 0x75767
testl %eax, %eax
je 0x955bc
leaq 0x2904a6(%rip), %rdi    # 0x325a40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x177f42(%rip), %rax    # 0x20d4f0
movsd %xmm0, (%rax)
leaq 0x177f2b(%rip), %rax    # 0x20d4e4
orb $0x2, (%rax)
callq 0x75767
testl %eax, %eax
je 0x955e9
leaq 0x290474(%rip), %rdi    # 0x325a40
callq 0x9470
leaq 0x261a48(%rip), %rax    # 0x2f7020
movsd %xmm0, (%rax)
leaq 0x261d55(%rip), %rax    # 0x2f7338
movl $0x1bc, (%rax)          # imm = 0x1BC
callq 0x75767
testl %eax, %eax
je 0x95616
leaq 0x290447(%rip), %rdi    # 0x325a40
callq 0x9470
leaq 0x261a23(%rip), %rax    # 0x2f7028
movsd %xmm0, (%rax)
leaq 0x261d24(%rip), %rax    # 0x2f7334
movl $0x1bc, (%rax)          # imm = 0x1BC
addq $0x18, %rsp
popq %rbx
popq %rbp
retq