// File: 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
subq $0x10, %rsp
leaq 0x20ef0d(%rip), %rax    # 0x36c67c
cmpl $0x0, (%rax)
je 0x15d780
movl $0x0, -0x4(%rbp)
jmp 0x15d941
leaq 0x20ea29(%rip), %rax    # 0x36c1b0
movsd (%rax), %xmm0
addsd 0x35471d(%rip), %xmm0   # 0x4b1eb0
movsd %xmm0, 0x354715(%rip)   # 0x4b1eb0
leaq 0x20ea16(%rip), %rax    # 0x36c1b8
movsd (%rax), %xmm0
addsd 0x35470a(%rip), %xmm0   # 0x4b1eb8
movsd %xmm0, 0x354702(%rip)   # 0x4b1eb8
leaq 0x20ea03(%rip), %rax    # 0x36c1c0
movsd (%rax), %xmm0
addsd 0x3546f7(%rip), %xmm0   # 0x4b1ec0
movsd %xmm0, 0x3546ef(%rip)   # 0x4b1ec0
leaq 0x23ccec(%rip), %rax    # 0x39a4c4
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x23cce0(%rip), %rax    # 0x39a4c4
movl %ecx, (%rax)
leaq 0x20e9c3(%rip), %rax    # 0x36c1b0
movsd (%rax), %xmm0
movl 0x355021(%rip), %esi    # 0x4b2818
leaq 0x3546f2(%rip), %rdi    # 0x4b1ef0
callq 0x15c580
movl %eax, 0x35500f(%rip)    # 0x4b2818
leaq 0x20e9a8(%rip), %rax    # 0x36c1b8
movsd (%rax), %xmm0
movl 0x355002(%rip), %esi    # 0x4b281c
leaq 0x3549df(%rip), %rdi    # 0x4b2200
callq 0x15c580
movl %eax, 0x354ff0(%rip)    # 0x4b281c
leaq 0x20e98d(%rip), %rax    # 0x36c1c0
movsd (%rax), %xmm0
movl 0x354fe3(%rip), %esi    # 0x4b2820
leaq 0x354ccc(%rip), %rdi    # 0x4b2510
callq 0x15c580
movl %eax, 0x354fd1(%rip)    # 0x4b2820
leaq 0x20e132(%rip), %rax    # 0x36b988
cmpb $0x0, (%rax)
jne 0x15d8cd
movl 0x354fb7(%rip), %edx    # 0x4b2818
movsd 0x11917(%rip), %xmm0    # 0x16f180
leaq 0x20e940(%rip), %rax    # 0x36c1b0
mulsd (%rax), %xmm0
movsd 0x11904(%rip), %xmm1    # 0x16f180
leaq 0x20e935(%rip), %rax    # 0x36c1b8
mulsd (%rax), %xmm1
leaq 0x20e932(%rip), %rax    # 0x36c1c0
movsd (%rax), %xmm2
leaq 0x23db67(%rip), %rdi    # 0x39b400
leaq 0x3ac45(%rip), %rsi     # 0x1984e5
movb $0x3, %al
callq 0x9060
leaq 0x11a0da(%rip), %rax    # 0x277988
movl (%rax), %edi
addl $0x0, %edi
leaq 0x11a0d2(%rip), %rax    # 0x27798c
movl (%rax), %esi
movl $0x9, %edx
leaq 0x23db38(%rip), %rcx    # 0x39b400
callq 0x10ee0
jmp 0x15d8cf
leaq 0x20f05a(%rip), %rax    # 0x36c930
movq (%rax), %rax
cmpq 0x354598(%rip), %rax    # 0x4b1e78
jge 0x15d8ff
leaq 0x20f047(%rip), %rax    # 0x36c930
movq (%rax), %rcx
addq $0x93a80, %rcx          # imm = 0x93A80
leaq 0x20f036(%rip), %rax    # 0x36c930
movq %rcx, (%rax)
jmp 0x15d8cf
leaq 0x20f02a(%rip), %rax    # 0x36c930
movq (%rax), %rax
cmpq 0x354570(%rip), %rax    # 0x4b1e80
jl 0x15d93a
leaq 0x20f76f(%rip), %rax    # 0x36d088
movq (%rax), %rcx
addq $0x1, %rcx
leaq 0x20f761(%rip), %rax    # 0x36d088
movq %rcx, (%rax)
callq 0x15d400
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15d941
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)