// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
pushq %rax
leaq 0x20f819(%rip), %rax    # 0x30d49c
cmpl $0x0, (%rax)
jne 0xfde93
leaq 0x20f33d(%rip), %rax    # 0x30cfd0
movsd (%rax), %xmm0
movsd 0x354c21(%rip), %xmm1   # 0x4528c0
addsd %xmm0, %xmm1
movsd %xmm1, 0x354c15(%rip)   # 0x4528c0
leaq 0x20f326(%rip), %rax    # 0x30cfd8
movsd (%rax), %xmm1
movsd 0x354c0a(%rip), %xmm2   # 0x4528c8
addsd %xmm1, %xmm2
movsd %xmm2, 0x354bfe(%rip)   # 0x4528c8
leaq 0x20f30f(%rip), %rax    # 0x30cfe0
movsd (%rax), %xmm2
movsd 0x354bf3(%rip), %xmm3   # 0x4528d0
leaq 0x23d600(%rip), %rax    # 0x33b2e4
incl (%rax)
addsd %xmm2, %xmm3
movsd %xmm3, 0x354bde(%rip)   # 0x4528d0
movslq 0x35552f(%rip), %rdx    # 0x453228
cmpq $0x5f, %rdx
jg 0xfdd38
leaq 0x354bfa(%rip), %rax    # 0x452900
movsd %xmm0, (%rax,%rdx,8)
testl %edx, %edx
jle 0xfdd36
movq %rdx, %rcx
incq %rcx
movsd -0x10(%rax,%rcx,8), %xmm3
ucomisd %xmm0, %xmm3
jbe 0xfdd36
movsd %xmm3, -0x8(%rax,%rcx,8)
movsd %xmm0, -0x10(%rax,%rcx,8)
decq %rcx
cmpq $0x1, %rcx
ja 0xfdd15
incl %edx
movl %edx, 0x3554ea(%rip)    # 0x453228
movslq 0x3554e7(%rip), %rax    # 0x45322c
cmpq $0x5f, %rax
jg 0xfdd84
leaq 0x354ebe(%rip), %rcx    # 0x452c10
movsd %xmm1, (%rcx,%rax,8)
testl %eax, %eax
jle 0xfdd82
movq %rax, %rsi
incq %rsi
movsd -0x10(%rcx,%rsi,8), %xmm3
ucomisd %xmm1, %xmm3
jbe 0xfdd82
movsd %xmm3, -0x8(%rcx,%rsi,8)
movsd %xmm1, -0x10(%rcx,%rsi,8)
decq %rsi
cmpq $0x1, %rsi
ja 0xfdd61
incl %eax
movl %eax, 0x3554a2(%rip)    # 0x45322c
movslq 0x35549f(%rip), %rax    # 0x453230
cmpq $0x5f, %rax
jg 0xfddd0
leaq 0x355182(%rip), %rcx    # 0x452f20
movsd %xmm2, (%rcx,%rax,8)
testl %eax, %eax
jle 0xfddce
movq %rax, %rsi
incq %rsi
movsd -0x10(%rcx,%rsi,8), %xmm3
ucomisd %xmm2, %xmm3
jbe 0xfddce
movsd %xmm3, -0x8(%rcx,%rsi,8)
movsd %xmm2, -0x10(%rcx,%rsi,8)
decq %rsi
cmpq $0x1, %rsi
ja 0xfddad
incl %eax
movl %eax, 0x35545a(%rip)    # 0x453230
leaq 0x20e9cb(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
jne 0xfde29
movsd 0xb376(%rip), %xmm3     # 0x109160
mulsd %xmm3, %xmm0
mulsd %xmm3, %xmm1
leaq 0x23e427(%rip), %rbx    # 0x33c220
leaq 0x37b53(%rip), %rsi     # 0x135953
movq %rbx, %rdi
movb $0x3, %al
callq 0x9060
leaq 0x11a997(%rip), %rax    # 0x2187a8
movl (%rax), %edi
leaq 0x11a992(%rip), %rax    # 0x2187ac
movl (%rax), %esi
movl $0x9, %edx
movq %rbx, %rcx
callq 0xe787
movq 0x354a58(%rip), %rdx    # 0x452888
leaq 0x20f919(%rip), %rsi    # 0x30d750
movq (%rsi), %rcx
cmpq %rdx, %rcx
jge 0xfde8a
leaq 0x93a80(%rcx), %rax
cmpq %rax, %rdx
cmovgq %rdx, %rax
addq $-0x93a80, %rax         # imm = 0xFFF6C580
xorl %edi, %edi
cmpq %rcx, %rax
setne %dil
subq %rcx, %rax
subq %rdi, %rax
movabsq $0x377aef2669de1559, %rdx # imm = 0x377AEF2669DE1559
mulq %rdx
shrq $0x11, %rdx
addq %rdi, %rdx
imulq $0x93a80, %rdx, %rax    # imm = 0x93A80
addq %rax, %rcx
addq $0x93a80, %rcx          # imm = 0x93A80
movq %rcx, (%rsi)
cmpq 0x3549ff(%rip), %rcx    # 0x452890
jge 0xfde9c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x210005(%rip), %rax    # 0x30dea8
incq (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xfd982