// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
leaq 0x2b2e91(%rip), %rax    # 0x30d0d0
xorl %edx, %edx
cmpb $0x3, (%rax)
sete %dl
movl %edx, %eax
xorb $0x3, %al
leaq 0x2e1084(%rip), %rcx    # 0x33b2d6
movb %al, (%rcx)
xorl $0x3, %edx
leaq 0x2e1fc2(%rip), %rbx    # 0x33c220
leaq 0xc6159(%rip), %rsi     # 0x1203be
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movl $0xffffff89, %r13d      # imm = 0xFFFFFF89
movl $0x560, %r14d           # imm = 0x560
leaq -0x130(%rbp), %r15
xorl %r12d, %r12d
leaq 0x1e4d24(%rip), %rax    # 0x23efb0
cmpl $0x0, (%rax,%r14)
jle 0x5a2d5
leal 0x78(%r13), %eax
leal 0x21(%r13), %edx
leaq 0x1be62e(%rip), %rcx    # 0x2188d0
cmpq $0x2, (%rcx)
cmovel %eax, %edx
cmpl $0x20, %r13d
cmovael %eax, %edx
movq %r15, %rdi
leaq 0xc6120(%rip), %rsi     # 0x1203da
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movq %r15, %rsi
callq 0x96c0
cmpl $0xb, %r12d
jg 0x5a305
incl %r12d
incl %r13d
addq $0x348, %r14            # imm = 0x348
cmpq $0xcd358, %r14          # imm = 0xCD358
jne 0x5a285
cmpl $0xc, %r12d
jg 0x5a305
addl $-0xd, %r12d
movq %rbx, %rdi
callq 0x9120
movw $0x2c, (%rbx,%rax)
incl %r12d
jne 0x5a2f2
leaq 0x1c91d8(%rip), %rbx    # 0x2234e4
movl (%rbx), %r14d
testb $0x1, %r14b
je 0x5a346
leaq 0x1c91cc(%rip), %rax    # 0x2234e8
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5a32c
jnp 0x5a346
leaq 0xc6096(%rip), %rsi     # 0x1203c9
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x9060
movl (%rbx), %r14d
jmp 0x5a34f
movw $0x2c, -0x130(%rbp)
leaq 0x2e1eca(%rip), %rdi    # 0x33c220
leaq -0x130(%rbp), %rsi
callq 0x96c0
testb $0x2, %r14b
je 0x5a399
leaq 0x1c9181(%rip), %rax    # 0x2234f0
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5a37f
jnp 0x5a399
leaq 0xc6043(%rip), %rsi     # 0x1203c9
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x9060
movl (%rbx), %r14d
jmp 0x5a3a2
movw $0x2c, -0x130(%rbp)
leaq 0x2e1e77(%rip), %rdi    # 0x33c220
leaq -0x130(%rbp), %rsi
callq 0x96c0
testb $0x4, %r14b
je 0x5a3e9
leaq 0x1c9136(%rip), %rax    # 0x2234f8
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5a3d2
jnp 0x5a3e9
leaq 0xd9596(%rip), %rsi     # 0x13396f
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x9060
jmp 0x5a3f0
movb $0x0, -0x130(%rbp)
leaq 0x2e1e29(%rip), %rbx    # 0x33c220
leaq -0x130(%rbp), %rsi
movq %rbx, %rdi
callq 0x96c0
movq %rbx, %rdi
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5962f