// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: send_gga()
void send_gga()
{
char valid;
double dop;

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

   valid = '0';
   if     (rcvr_type == NO_RCVR)   valid = '1';
   else if(rcvr_type == TIDE_RCVR) valid = '1';
   else if(lat || lon)             valid = '1';

   if((have_dops & HDOP) && hdop) dop = (double) hdop;
   else dop = (double) average_dop();  // calculate a composite DOP value

// gregorian(0, jd_utc);
   if(echo_fmt & ECHO_MSECS) {
      sprintf(out, "GPGGA,%010.3f,%s,%s,%c,%d,%.1f,%s,%s,,",
         nmea_time(),nmea_lat(),nmea_lon(),valid,sat_count,dop,nmea_alt(),"0.0,M");
   }
   else if(echo_fmt & ECHO_HSECS) {
      sprintf(out, "GPGGA,%09.2f,%s,%s,%c,%d,%.1f,%s,%s,,",
         nmea_time(),nmea_lat(),nmea_lon(),valid,sat_count,dop,nmea_alt(),"0.0,M");
   }
   else {
      sprintf(out, "GPGGA,%06d,%s,%s,%c,%d,%.1f,%s,%s,,",
         (int) nmea_time(),nmea_lat(),nmea_lon(),valid,sat_count,dop,nmea_alt(),"0.0,M");
   }

   echo_nmea_string(out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x1be8b9(%rip), %rax    # 0x2188d0
movq (%rax), %rax
movl $0x31, %ebx
cmpq $0x400, %rax            # imm = 0x400
je 0x5a062
cmpq $0x800000, %rax         # imm = 0x800000
je 0x5a062
leaq 0x2b2f9a(%rip), %rax    # 0x30cfd0
leaq 0x2b2f9b(%rip), %rcx    # 0x30cfd8
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
movsd (%rax), %xmm2
cmpneqpd %xmm1, %xmm2
cmpneqpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movd %xmm0, %eax
movl $0x30, %ebx
subl %eax, %ebx
leaq 0x1c947b(%rip), %rax    # 0x2234e4
testb $0x2, (%rax)
je 0x5a085
leaq 0x1c947b(%rip), %rax    # 0x2234f0
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5a08a
jp 0x5a08a
callq 0x59519
movsd %xmm0, -0x30(%rbp)
movl 0x1104eb(%rip), %eax    # 0x16a580
testb $0x4, %al
jne 0x5a186
leaq 0x2b3604(%rip), %rcx    # 0x30d6a8
xorps %xmm0, %xmm0
cvtsi2sdl (%rcx), %xmm0
movsd 0xaefad(%rip), %xmm1    # 0x109060
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
leaq 0x2b35ea(%rip), %rcx    # 0x30d6ac
xorps %xmm2, %xmm2
cvtsi2sdl (%rcx), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
leaq 0x2b35d8(%rip), %rcx    # 0x30d6b0
xorps %xmm0, %xmm0
cvtsi2sdl (%rcx), %xmm0
addsd %xmm2, %xmm0
leaq 0x2b35ce(%rip), %rcx    # 0x30d6b8
addsd (%rcx), %xmm0
testb $0x2, %al
jne 0x5a236
cvttsd2si %xmm0, %r14d
callq 0x5989c
callq 0x59939
leaq 0x1e4e00(%rip), %rax    # 0x23ef0c
movl (%rax), %r12d
movb $0x0, 0x31610a(%rip)    # 0x370220
leaq 0x316103(%rip), %r15    # 0x370220
leaq 0x2b2ebc(%rip), %rax    # 0x30cfe0
movsd (%rax), %xmm0
leaq 0xc6063(%rip), %rsi     # 0x120192
movq %r15, %rdi
movl $0x4d, %edx
movb $0x1, %al
callq 0x9060
subq $0x8, %rsp
leaq 0xc6145(%rip), %r10     # 0x12028e
leaq 0x2e20d0(%rip), %rdi    # 0x33c220
leaq 0xc6163(%rip), %rsi     # 0x1202ba
leaq 0x315ec2(%rip), %rcx    # 0x370020
leaq 0x315fbb(%rip), %r8     # 0x370120
movl %r14d, %edx
movl %ebx, %r9d
movsd -0x30(%rbp), %xmm0
movb $0x1, %al
pushq %r10
pushq %r15
pushq %r12
callq 0x9060
addq $0x20, %rsp
jmp 0x5a2c0
leaq 0x2b351b(%rip), %rax    # 0x30d6a8
xorps %xmm0, %xmm0
cvtsi2sdl (%rax), %xmm0
movsd 0xaeec4(%rip), %xmm1    # 0x109060
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
leaq 0x2b3501(%rip), %rax    # 0x30d6ac
xorps %xmm2, %xmm2
cvtsi2sdl (%rax), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
leaq 0x2b34ef(%rip), %rax    # 0x30d6b0
xorps %xmm0, %xmm0
cvtsi2sdl (%rax), %xmm0
addsd %xmm2, %xmm0
leaq 0x2b34e5(%rip), %rax    # 0x30d6b8
addsd (%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x5989c
callq 0x59939
leaq 0x1e4d1f(%rip), %rax    # 0x23ef0c
movl (%rax), %r14d
movb $0x0, 0x316029(%rip)    # 0x370220
leaq 0x316022(%rip), %r15    # 0x370220
leaq 0x2b2ddb(%rip), %rax    # 0x30cfe0
movsd (%rax), %xmm0
leaq 0xc5f82(%rip), %rsi     # 0x120192
movq %r15, %rdi
movl $0x4d, %edx
movb $0x1, %al
callq 0x9060
leaq 0xc6068(%rip), %r10     # 0x12028e
leaq 0x2e1ff3(%rip), %rdi    # 0x33c220
leaq 0xc6033(%rip), %rsi     # 0x120267
jmp 0x5a293
movsd %xmm0, -0x28(%rbp)
callq 0x5989c
callq 0x59939
leaq 0x1e4cc0(%rip), %rax    # 0x23ef0c
movl (%rax), %r14d
movb $0x0, 0x315fca(%rip)    # 0x370220
leaq 0x315fc3(%rip), %r15    # 0x370220
leaq 0x2b2d7c(%rip), %rax    # 0x30cfe0
movsd (%rax), %xmm0
leaq 0xc5f23(%rip), %rsi     # 0x120192
movq %r15, %rdi
movl $0x4d, %edx
movb $0x1, %al
callq 0x9060
leaq 0xc6009(%rip), %r10     # 0x12028e
leaq 0x2e1f94(%rip), %rdi    # 0x33c220
leaq 0xc6001(%rip), %rsi     # 0x120294
leaq 0x315d86(%rip), %rdx    # 0x370020
leaq 0x315e7f(%rip), %rcx    # 0x370120
movsd -0x28(%rbp), %xmm0
movl %ebx, %r8d
movl %r14d, %r9d
movsd -0x30(%rbp), %xmm1
movb $0x2, %al
pushq %r10
pushq %r15
callq 0x9060
addq $0x10, %rsp
leaq 0x2e1f59(%rip), %rdi    # 0x33c220
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x596f9