// File: /workspace/github_cpp_makefile_star2_O1/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 0x2e0fe3(%rip), %rax    # 0x33b2d6
leaq 0x2b2dd6(%rip), %rcx    # 0x30d0d0
xorl %edx, %edx
cmpb $0x3, (%rcx)
sete %dl
movl %edx, %ecx
xorb $0x3, %cl
movb %cl, (%rax)
xorl $0x3, %edx
leaq 0x2e1f0d(%rip), %rbx    # 0x33c220
leaq 0xc5fc4(%rip), %rsi     # 0x1202de
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 0x1e4c6f(%rip), %rax    # 0x23efb0
cmpl $0x0, (%rax,%r14)
jle 0x5a38f
leal 0x21(%r13), %edx
leal 0x78(%r13), %eax
leaq 0x1be579(%rip), %rcx    # 0x2188d0
cmpq $0x2, (%rcx)
cmovel %eax, %edx
cmpl $0x20, %r13d
cmovael %eax, %edx
movq %r15, %rdi
leaq 0xc5f8b(%rip), %rsi     # 0x1202fa
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movq %r15, %rsi
callq 0x96c0
leal 0x1(%r12), %eax
cmpl $0xb, %r12d
movl %eax, %r12d
jg 0x5a3a2
incl %r13d
addq $0x348, %r14            # imm = 0x348
cmpq $0xcd358, %r14          # imm = 0xCD358
jne 0x5a33a
cmpl $0xc, %r12d
jg 0x5a3bf
addl $-0xd, %r12d
movq %rbx, %rdi
callq 0x9120
movw $0x2c, (%rbx,%rax)
incl %r12d
jne 0x5a3ac
leaq 0x1c911e(%rip), %rbx    # 0x2234e4
testb $0x1, (%rbx)
je 0x5a3f9
leaq 0x1c9116(%rip), %rax    # 0x2234e8
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5a3e2
jnp 0x5a3f9
leaq 0xc5f00(%rip), %rsi     # 0x1202e9
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x9060
jmp 0x5a402
movw $0x2c, -0x130(%rbp)
leaq 0x2e1e17(%rip), %rdi    # 0x33c220
leaq -0x130(%rbp), %rsi
callq 0x96c0
testb $0x2, (%rbx)
je 0x5a448
leaq 0x1c90cf(%rip), %rax    # 0x2234f0
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5a431
jnp 0x5a448
leaq 0xc5eb1(%rip), %rsi     # 0x1202e9
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x9060
jmp 0x5a451
movw $0x2c, -0x130(%rbp)
leaq 0x2e1dc8(%rip), %rdi    # 0x33c220
leaq -0x130(%rbp), %rsi
callq 0x96c0
testb $0x4, (%rbx)
je 0x5a497
leaq 0x1c9088(%rip), %rax    # 0x2234f8
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5a480
jnp 0x5a497
leaq 0xd93f8(%rip), %rsi     # 0x13387f
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x9060
jmp 0x5a49e
movb $0x0, -0x130(%rbp)
leaq 0x2e1d7b(%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 0x596f9