// File: /workspace/github_cpp_makefile_star2_O2/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 0x2a3fda(%rip), %rax    # 0x2f70d0
xorl %edx, %edx
cmpb $0x3, (%rax)
sete %dl
movl %edx, %eax
xorb $0x3, %al
leaq 0x2d21cd(%rip), %rcx    # 0x3252d6
movb %al, (%rcx)
xorl $0x3, %edx
leaq 0x2d310b(%rip), %rbx    # 0x326220
leaq 0xb71ea(%rip), %rsi     # 0x10a306
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $-0x77
popq %r12
movl $0x560, %r13d           # imm = 0x560
xorl %r14d, %r14d
cmpq $0xcd358, %r13          # imm = 0xCD358
je 0x531a5
leaq 0x1d5e6d(%rip), %rax    # 0x228fb0
cmpl $0x0, (%rax,%r13)
jle 0x53199
leal 0x78(%r12), %eax
leal 0x21(%r12), %edx
leaq 0x1af775(%rip), %rcx    # 0x2028d0
cmpq $0x2, (%rcx)
cmovel %eax, %edx
cmpl $0x20, %r12d
cmovael %eax, %edx
leaq -0x130(%rbp), %r15
movq %r15, %rdi
leaq 0xb71a8(%rip), %rsi     # 0x10a322
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movq %r15, %rsi
callq 0x96c0
leal 0x1(%r14), %r15d
cmpl $0xb, %r14d
movl %r15d, %r14d
jg 0x531bb
incl %r12d
addq $0x348, %r13            # imm = 0x348
jmp 0x53133
movl %r14d, %r15d
jmp 0x531bb
movq %rbx, %rdi
callq 0x9120
movw $0x2c, (%rbx,%rax)
incl %r15d
cmpl $0xc, %r15d
jle 0x531aa
leaq 0x1ba31c(%rip), %rbx    # 0x20d4e4
movl (%rbx), %r14d
testb $0x1, %r14b
je 0x53202
leaq 0x1ba310(%rip), %rax    # 0x20d4e8
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x531e8
jnp 0x53202
leaq 0xb7122(%rip), %rsi     # 0x10a311
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x9060
movl (%rbx), %r14d
jmp 0x5320b
movw $0x2c, -0x130(%rbp)
leaq 0x2d300e(%rip), %rdi    # 0x326220
leaq -0x130(%rbp), %rsi
callq 0x96c0
testb $0x2, %r14b
je 0x53255
leaq 0x1ba2c5(%rip), %rax    # 0x20d4f0
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5323b
jnp 0x53255
leaq 0xb70cf(%rip), %rsi     # 0x10a311
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x9060
movl (%rbx), %r14d
jmp 0x5325e
movw $0x2c, -0x130(%rbp)
leaq 0x2d2fbb(%rip), %rdi    # 0x326220
leaq -0x130(%rbp), %rsi
callq 0x96c0
testb $0x4, %r14b
je 0x532a5
leaq 0x1ba27a(%rip), %rax    # 0x20d4f8
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5328e
jnp 0x532a5
leaq 0xca5fa(%rip), %rsi     # 0x11d88f
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x9060
jmp 0x532ac
movb $0x0, -0x130(%rbp)
leaq 0x2d2f6d(%rip), %rbx    # 0x326220
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 0x52935