// File: jkingan[P]ladyheather/heathgps.cpp
// Function: send_gsa()
void send_gsa()
{
int prn;
int i;
char s[256];

   // send NMEA GPGSA sentence
   // !!!!!! we should handle GLONASS/GALILEO/BEIDOU

   fix_mode = 3;
   if(rcvr_mode == RCVR_MODE_2D) fix_mode = 2;
   sprintf(out, "GPGSA,A,%d", fix_mode);

   i = 0;
   for(prn=1; prn<=MAX_PRN; prn++) {
      if(sat[prn].tracking > 0) {  // tracked sat
         sprintf(s, ",%02d",nmea_prn(prn));
         strcat(out, s);
         ++i;
         if(i > 12) break;
      }
   }

   while(1) {  // fill out null fields
      if(i > 12) break;
      strcat(out, ",");   
      ++i;
   }

   if((have_dops & PDOP) && pdop) {
      sprintf(s, "%.1f,", pdop);
   }
   else strcpy(s, ",");
   strcat(out, s);

   if((have_dops & HDOP) && hdop) {
      sprintf(s, "%.1f,", hdop);
   }
   else strcpy(s, ",");
   strcat(out, s);

   if((have_dops & VDOP) && vdop) {
      sprintf(s, "%.1f", vdop);
   }
   else strcpy(s, "");
   strcat(out, s);

   echo_nmea_string(out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
leaq 0x31df04(%rip), %rax    # 0x39a4b6
movb $0x3, (%rax)
leaq 0x2efcf4(%rip), %rax    # 0x36c2b0
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x7c5ce
leaq 0x31deeb(%rip), %rax    # 0x39a4b6
movb $0x2, (%rax)
leaq 0x31dee1(%rip), %rax    # 0x39a4b6
movzbl (%rax), %edx
leaq 0x31ee21(%rip), %rdi    # 0x39b400
leaq 0x107058(%rip), %rsi    # 0x18363e
movb $0x0, %al
callq 0x9060
movl $0x0, -0x8(%rbp)
movl $0x1, -0x4(%rbp)
cmpl $0x3e7, -0x4(%rbp)      # imm = 0x3E7
jg 0x7c689
movslq -0x4(%rbp), %rcx
leaq 0x221b7d(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
cmpl $0x0, 0x218(%rax)
jle 0x7c679
leaq -0x110(%rbp), %rax
movq %rax, -0x118(%rbp)
movl -0x4(%rbp), %edi
callq 0x7ba80
movq -0x118(%rbp), %rdi
movl %eax, %edx
leaq 0x10700e(%rip), %rsi    # 0x18365a
movb $0x0, %al
callq 0x9060
leaq -0x110(%rbp), %rsi
leaq 0x31ed9f(%rip), %rdi    # 0x39b400
callq 0x96a0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0xc, -0x8(%rbp)
jle 0x7c677
jmp 0x7c689
jmp 0x7c679
jmp 0x7c67b
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x7c5fb
jmp 0x7c68b
cmpl $0xc, -0x8(%rbp)
jle 0x7c693
jmp 0x7c6b1
leaq 0x31ed66(%rip), %rdi    # 0x39b400
leaq 0x106fe8(%rip), %rsi    # 0x183689
callq 0x96a0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x7c68b
leaq 0x20600c(%rip), %rax    # 0x2826c4
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7c6fc
leaq 0x205fff(%rip), %rax    # 0x2826c8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7c6da
jp 0x7c6da
jmp 0x7c6fc
leaq -0x110(%rbp), %rdi
leaq 0x205fe0(%rip), %rax    # 0x2826c8
movsd (%rax), %xmm0
leaq 0x106f56(%rip), %rsi    # 0x183649
movb $0x1, %al
callq 0x9060
jmp 0x7c70f
leaq -0x110(%rbp), %rdi
leaq 0x106f7f(%rip), %rsi    # 0x183689
callq 0x9350
leaq -0x110(%rbp), %rsi
leaq 0x31ece3(%rip), %rdi    # 0x39b400
callq 0x96a0
leaq 0x205f9b(%rip), %rax    # 0x2826c4
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x7c76d
leaq 0x205f96(%rip), %rax    # 0x2826d0
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7c74b
jp 0x7c74b
jmp 0x7c76d
leaq -0x110(%rbp), %rdi
leaq 0x205f77(%rip), %rax    # 0x2826d0
movsd (%rax), %xmm0
leaq 0x106ee5(%rip), %rsi    # 0x183649
movb $0x1, %al
callq 0x9060
jmp 0x7c780
leaq -0x110(%rbp), %rdi
leaq 0x106f0e(%rip), %rsi    # 0x183689
callq 0x9350
leaq -0x110(%rbp), %rsi
leaq 0x31ec72(%rip), %rdi    # 0x39b400
callq 0x96a0
leaq 0x205f2a(%rip), %rax    # 0x2826c4
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x7c7de
leaq 0x205f2d(%rip), %rax    # 0x2826d8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7c7bc
jp 0x7c7bc
jmp 0x7c7de
leaq -0x110(%rbp), %rdi
leaq 0x205f0e(%rip), %rax    # 0x2826d8
movsd (%rax), %xmm0
leaq 0x119d02(%rip), %rsi    # 0x1964d7
movb $0x1, %al
callq 0x9060
jmp 0x7c7f1
leaq -0x110(%rbp), %rdi
leaq 0x117da6(%rip), %rsi    # 0x194592
callq 0x9350
leaq -0x110(%rbp), %rsi
leaq 0x31ec01(%rip), %rdi    # 0x39b400
callq 0x96a0
leaq 0x31ebf5(%rip), %rdi    # 0x39b400
callq 0x7bad0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax)