// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: add_survey_point()
int add_survey_point()
{
int i;

   if(gps_status != GPS_FIXES) return 0;

   lat_sum += lat;
   lon_sum += lon;
   alt_sum += alt;
   ++precision_samples;
//++survey_tow; //"###
//if(precision_samples > do_median_survey) return 1;  //!!! debug statement

   second_lats = add_to_bin(lat, lat_bins, second_lats);
   second_lons = add_to_bin(lon, lon_bins, second_lons);
   second_alts = add_to_bin(alt, alt_bins, second_alts);
   if(!zoom_screen) {
      sprintf(out, "sec %2d: %.8f %.8f %.3f     ", second_lats, lat*RAD_TO_DEG, lon*RAD_TO_DEG, alt);
      vidstr(MOUSE_ROW+0, MOUSE_COL, SURVEY_COLOR, out);
   }

   while(survey_tow < start_tow) {
      survey_tow += (7L*24L*60L*60L);
   }
//if(debug_file) fprintf(debug_file, "asp surv_tow:%d  start_tow:%d  min_tow:%d  psh:%d\n", survey_tow,start_tow,minute_tow, PRECISE_SURVEY_HOURS);  //plugh

   if(survey_tow >= minute_tow) {  // we have 60 seconds of data
      ++survey_minutes;
      i = analyze_seconds();
//if(debug_file) fprintf(debug_file, "analyze_seconds: %d  surv_mins:%d  psh:%d\n", i, survey_minutes, PRECISE_SURVEY_HOURS); //plugh
      return i;
   }

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0x20f5cc(%rip), %rax    # 0x2f749c
cmpl $0x0, (%rax)
jne 0xe802f
leaq 0x20f0f0(%rip), %rax    # 0x2f6fd0
movsd (%rax), %xmm0
movsd 0x3549d4(%rip), %xmm1   # 0x43c8c0
addsd %xmm0, %xmm1
movsd %xmm1, 0x3549c8(%rip)   # 0x43c8c0
leaq 0x20f0d9(%rip), %rax    # 0x2f6fd8
movsd (%rax), %xmm2
movsd %xmm2, -0x20(%rbp)
movsd 0x3549b8(%rip), %xmm1   # 0x43c8c8
addsd %xmm2, %xmm1
movsd %xmm1, 0x3549ac(%rip)   # 0x43c8c8
leaq 0x20f0bd(%rip), %rax    # 0x2f6fe0
movsd (%rax), %xmm2
movsd %xmm2, -0x18(%rbp)
movsd 0x35499c(%rip), %xmm1   # 0x43c8d0
addsd %xmm2, %xmm1
movsd %xmm1, 0x354990(%rip)   # 0x43c8d0
leaq 0x23d39d(%rip), %rax    # 0x3252e4
incl (%rax)
movl 0x3552d9(%rip), %esi    # 0x43d228
leaq 0x3549aa(%rip), %rdi    # 0x43c900
movsd %xmm0, -0x28(%rbp)
callq 0xe7291
movl %eax, %ebx
movl %eax, 0x3552c0(%rip)    # 0x43d228
movl 0x3552be(%rip), %esi    # 0x43d22c
leaq 0x354c9b(%rip), %rdi    # 0x43cc10
movsd -0x20(%rbp), %xmm0
callq 0xe7291
movl %eax, 0x3552a7(%rip)    # 0x43d22c
movl 0x3552a5(%rip), %esi    # 0x43d230
leaq 0x354f8e(%rip), %rdi    # 0x43cf20
movsd -0x18(%rbp), %xmm0
callq 0xe7291
movl %eax, 0x35528e(%rip)    # 0x43d230
leaq 0x20e7ff(%rip), %rax    # 0x2f67a8
cmpb $0x0, (%rax)
jne 0xe8004
movsd 0xb1aa(%rip), %xmm2     # 0xf3160
movsd -0x28(%rbp), %xmm0
mulsd %xmm2, %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm2, %xmm1
leaq 0x23e251(%rip), %r14    # 0x326220
leaq 0x3789d(%rip), %rsi     # 0x11f873
movq %r14, %rdi
movl %ebx, %edx
movsd -0x18(%rbp), %xmm2
movb $0x3, %al
callq 0x9060
leaq 0x11a7ba(%rip), %rax    # 0x2027a8
movl (%rax), %edi
leaq 0x11a7b5(%rip), %rax    # 0x2027ac
movl (%rax), %esi
pushq $0x9
popq %rdx
movq %r14, %rcx
callq 0xe2d2
movq 0x35487d(%rip), %rax    # 0x43c888
leaq 0x20f73e(%rip), %rdx    # 0x2f7750
movq (%rdx), %rcx
cmpq %rax, %rcx
jge 0xe8026
addq $0x93a80, %rcx          # imm = 0x93A80
movq %rcx, (%rdx)
jmp 0xe8015
cmpq 0x354863(%rip), %rcx    # 0x43c890
jge 0xe803a
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x20fe67(%rip), %rax    # 0x2f7ea8
incq (%rax)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xe7c81