// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: primary_timing(int)
void primary_timing(int get_tsip)
{
int i;

   // process the receiver primary timing message.  For TSIP receivers, gets
   // the timing message.

   if(get_tsip) log_packet_id("Packet 0x8F.AB (Primary timing)");

   skip_starloc_time = 0;
   last_pri_tow = pt_tow;
   ++got_timing_msg;    // prevents keyboard lockup with high nav rate receivers
   ++roll_timing_msg;   // used to reset queues during startup rollover detection

   if(timeout_extended) {  // com timeout has been increased due to special commands
      --timeout_extended;
      if(timeout_extended <= 0) { // it's safe to restore the com timeout to its normal value
         com[RCVR_PORT].com_timeout = com[RCVR_PORT].user_timeout;
      }
   }

   if(get_tsip) {
      have_pri_time = 1;
      pri_tow = this_pri_tow = pt_tow = tsip_dword();
      gps_week = tsip_word();
      faked_tow = 0;

      i = (int) (s16) tsip_word();
      if(!user_set_utc_ofs && (i >= 0) && (i < 64)) {    // filter bogus values
         utc_offset = i;
         if(utc_offset != 0) utc_offset_flag = utc_offset;
         if(tsip_type == STARLOC_TYPE) {
            if(utc_offset_flag && (utc_offset == 0)) {
               utc_offset = utc_offset_flag;  // sometimes sends random 0 utc_offset value
            }
            tsip_byte();  // STARLOC_TYPE always sends bogus 0 time_flags value
         }
         else time_flags = tsip_byte();
      }
      else if(STARLOC) tsip_byte(); // STARLOC_TYPE always sends bogus 0 time_flags value 
      else time_flags = tsip_byte();
//sprintf(debug_text4, "time flag byte: %02X", time_flags);

      pri_seconds = pt_sec = tsip_byte();
      pri_minutes = pt_min = tsip_byte();
      pri_hours = pt_hh = tsip_byte();
      pri_day = tsip_byte();
      pri_month = tsip_byte();
      pri_year = tsip_word();
      pri_frac = 0.0;

      if(STARLOC) {
         if(show_debug_info && debug_file) fprintf(debug_file, "starloc time: %04d/%02d/%02d %02d:%02d:%02d\n", pri_year,pri_month,pri_day, pri_hours,pri_minutes,pri_seconds);
         if((pri_year < 1980) || (pri_year > 2100)) {  // totally bogus time/date
            goto pt_err;
         }
         fix_starloc_time();  // try to fixup time stamp skips
      }

      check_tsip_end(1);

      if(have_week == 0) need_redraw = 2007;
      have_week = 1;

      if(have_tow == 0) need_redraw = 2008;
      have_tow = 1;

      check_utc_ofs(2);
   }

   pri_month = fix_month(pri_month);

   if(have_utc_ofs) time_flags &= (~TFLAGS_NO_UTC_OFS);
   else             time_flags |= TFLAGS_NO_UTC_OFS;

   last_time_msec = this_time_msec;  // used to measure timing message jitter
   this_time_msec = GetMsecs();

   if(tsip_type == STARLOC_TYPE) {
      if(time_flags & TFLAGS_UTC) {  // stupid DATUM receiver can output UTC time
         gps_to_utc();               // but always says it is GPS time.  We always run
      }                              // those turds in GPS mode and convert to UTC
   }

   check_for_leapsecond();  // see if the time represents a leapsecond

   if(force_day) {
      pri_day = force_day;
      pri_month = force_month;
      pri_year = force_year;
   }

   fix_rollover();

   if(log_db) request_sig_levels();

   if(rcvr_type != TSIP_RCVR) ;  // ggggg
   else if(user_pps_len) {  // send string of user specified bytes each time a timing message is received
      for(i=0; i<user_pps_len; i++) {
         sendout(RCVR_PORT, user_pps_cmd[i], ADD_CHAR);
      } 
      sendout(RCVR_PORT, 0, FLUSH_COM);
   }

   if     (rcvr_type == SCPI_RCVR) ;
   else if(rcvr_type == STAR_RCVR) ;
   else if(rcvr_type == UCCM_RCVR) ;
   else if(tsip_error) {
      goto pt_exit; 
   }

   if(just_read) goto pt_exit; 

   if(1) {   // filter bogus time values
      pt_err:
      i = 0;

//    if(pri_tow >= (60L*60L*24L*7L))   { write_log_error("tow", pri_tow);            ++i; }
      if(pri_seconds > 61)              { write_log_error("seconds>61", pri_seconds); ++i; } 
      if(pri_seconds < 0)               { write_log_error("seconds<0", pri_seconds);  ++i; } 

      if(pri_minutes > 60)              { write_log_error("minutes>60", pri_minutes); ++i; } 
      if(pri_minutes < 0)               { write_log_error("minutes<0", pri_minutes);  ++i; } 

      if(pri_hours > 24)                { write_log_error("hours>24", pri_hours);     ++i; } // accomodate weird leap seconds
      if(pri_hours < 0)                 { write_log_error("hours<0", pri_hours);      ++i; } // accomodate weird leap seconds

      if(pri_day > 31)                  { write_log_error("day>31", pri_day);         ++i; } 
      if(pri_day <= 0)                  { write_log_error("day<=0", pri_day);         ++i; } 

      if(pri_month > 12)                { write_log_error("month>12", pri_month);     ++i; } 
      if(pri_month <= 0)                { write_log_error("month<=0", pri_month);     ++i; } 

      if(pri_year < 1980)               { write_log_error("year<1980", pri_year);     ++i; } 
      if(pri_year > 2100)               { write_log_error("year>2100", pri_year);     ++i; } 


      if(i) {
         if(STARLOC) bad_starloc_time = i;  // inhibt duplicated time stamp errs when bogus time seen
         goto pt_exit;
      }
   }

   // the time message seems to have valid time
   seconds = pri_seconds;     // save GPS/UTC time and date in global variables
   minutes = pri_minutes;
   hours = pri_hours;
   day = pri_day;
   month = pri_month;
   year = pri_year;
   raw_frac = pri_frac;

   tow = pri_tow;  
   this_tow = tow;
   survey_tow = tow;


   jd_utc = jd_gps = jdate(year,month,day) + jtime(hours,minutes,seconds,raw_frac);
   if(elapsed_time_set == 0) {
      jd_elapsed = jd_utc;
      elapsed_time_set = 1;
   }

   if(jd_utc == last_jd_utc) ++stuck_clock;
   else stuck_clock = 0;
   last_jd_utc = jd_utc;

   if(last_kbd_jd == 0.0) last_kbd_jd = jd_utc;

   calc_msg_ofs();

   if(no_poll) show_version_header();

   primary_misc();

   if(stuck_clock > 5) ;  // clock has stopped, avoid continuous screen dumps
   else if(leap_time && leap_dump) {  // do screen dump if leap-second seen
      refresh_page();
      leap_dumped = 1;
      if(!have_leap_info) have_leap_info = 99; // show the "Leap: captured" status
      dump_screen(0, 0, "leap_sec");
   }

   pt_exit:
   // every time we see the 8F.AB (or a time code) message, 
   // ... we request a different minor status message from the receiver
   request_misc_msg();  
   if(PALISADE) {  // these don't output secondary timing message (or primary timing for that matter)
      secondary_timing(0);
   }
   else if((ACU_GG || ACU_360 || ACUTIME) && (have_sec_timing == 0)) {
      secondary_timing(0);
   }
   return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
testl %edi, %edi
je 0x763c8
leaq 0xabe45(%rip), %rdi     # 0x122208
callq 0x58dc2
movl $0x0, 0x2f5a02(%rip)    # 0x36bdd4
movl 0x2f5a14(%rip), %eax    # 0x36bdec
leaq 0x29705d(%rip), %rcx    # 0x30d43c
incl (%rcx)
leaq 0x297058(%rip), %rcx    # 0x30d440
incl (%rcx)
movl %eax, 0x2f59ec(%rip)    # 0x36bddc
leaq 0x2c0c11(%rip), %rax    # 0x337008
movl (%rax), %ecx
testl %ecx, %ecx
je 0x7641e
leal -0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x1, %ecx
jg 0x7641e
leaq 0x297ed2(%rip), %rax    # 0x30e2e0
movsd 0x17a00(%rax), %xmm0
movsd %xmm0, 0x179f8(%rax)
testl %ebx, %ebx
je 0x764c9
leaq 0x1c8aab(%rip), %rax    # 0x23eed8
movl $0x1, (%rax)
callq 0x58964
movl %eax, 0x2f59ae(%rip)    # 0x36bdec
movl %eax, 0x2f5994(%rip)    # 0x36bdd8
leaq 0x2972f9(%rip), %rcx    # 0x30d744
movl %eax, (%rcx)
callq 0x588d2
leaq 0x2972df(%rip), %rcx    # 0x30d738
movw %ax, (%rcx)
leaq 0x2972e5(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
callq 0x588d2
cmpw $0x3f, %ax
ja 0x764e0
leaq 0x2972b9(%rip), %rcx    # 0x30d734
cmpl $0x0, (%rcx)
jne 0x764e0
movswl %ax, %edx
leaq 0x29729e(%rip), %rcx    # 0x30d728
movl %edx, (%rcx)
testw %ax, %ax
je 0x7649a
leaq 0x297298(%rip), %rsi    # 0x30d730
movl %edx, (%rsi)
leaq 0x1a4b33(%rip), %rdx    # 0x21afd4
cmpl $0x53, (%rdx)
jne 0x76516
testw %ax, %ax
setne %dl
leaq 0x29727d(%rip), %rax    # 0x30d730
movl (%rax), %eax
testl %eax, %eax
sete %sil
orb %dl, %sil
jne 0x764c2
movl %eax, (%rcx)
callq 0x587be
jmp 0x76503
leaq 0x296e4c(%rip), %rcx    # 0x30d31c
xorl %eax, %eax
cmpl $0x0, (%rcx)
sete %al
shll $0x3, %eax
jmp 0x7672f
leaq 0x1a23e9(%rip), %rax    # 0x2188d0
movq (%rax), %r14
leaq 0x1a4ae3(%rip), %rax    # 0x21afd4
movl (%rax), %ebx
callq 0x587be
cmpq $0x1, %r14
jne 0x7651b
cmpl $0x53, %ebx
jne 0x7651b
cmpl $0x100, %eax            # imm = 0x100
jb 0x76538
leaq 0x1c8a5f(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
jmp 0x76538
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7652c
leaq 0x1c8a47(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x296f6e(%rip), %rcx    # 0x30d4a4
movl %eax, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7654e
leaq 0x1c8a25(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movl %eax, 0x2f5891(%rip)    # 0x36bde8
leaq 0x296fa2(%rip), %rcx    # 0x30d500
movl %eax, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x76576
leaq 0x1c89fd(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movl %eax, 0x2f5865(%rip)    # 0x36bde4
leaq 0x296f7e(%rip), %r15    # 0x30d504
movl %eax, (%r15)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7659f
leaq 0x1c89d4(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movl %eax, 0x2f5838(%rip)    # 0x36bde0
leaq 0x296f59(%rip), %r12    # 0x30d508
movl %eax, (%r12)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x765c9
leaq 0x1c89aa(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x296f39(%rip), %r13    # 0x30d50c
movl %eax, (%r13)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x765ed
leaq 0x1c8986(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x296f19(%rip), %rbx    # 0x30d510
movl %eax, (%rbx)
callq 0x588d2
movzwl %ax, %edx
leaq 0x296f0c(%rip), %r14    # 0x30d514
movl %edx, (%r14)
leaq 0x296f06(%rip), %rax    # 0x30d518
movq $0x0, (%rax)
leaq 0x1a22b0(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x7669a
leaq 0x1a49a7(%rip), %rax    # 0x21afd4
cmpl $0x53, (%rax)
jne 0x7669a
leaq 0x1a228b(%rip), %rax    # 0x2188c4
cmpb $0x0, (%rax)
setne %al
leaq 0x1c7d4a(%rip), %rcx    # 0x23e390
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x76686
movl (%rbx), %ecx
movl (%r13), %r8d
movl (%r12), %r9d
movl (%r15), %r10d
leaq 0x296e96(%rip), %rax    # 0x30d500
movl (%rax), %r11d
leaq 0xabbb4(%rip), %rsi     # 0x122228
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x9560
addq $0x10, %rsp
movl (%r14), %edx
addl $0xfffff7cb, %edx       # imm = 0xFFFFF7CB
cmpl $-0x79, %edx
jb 0x768a6
callq 0x76145
xorl %edi, %edi
callq 0x58e9b
leaq 0x296c84(%rip), %rax    # 0x30d32c
cmpl $0x0, (%rax)
jne 0x766ba
leaq 0x1a2190(%rip), %rcx    # 0x218844
movl $0x7d7, (%rcx)          # imm = 0x7D7
movl $0x1, (%rax)
leaq 0x296c61(%rip), %rax    # 0x30d328
cmpl $0x0, (%rax)
jne 0x766d9
leaq 0x1a2171(%rip), %rcx    # 0x218844
movl $0x7d8, (%rcx)          # imm = 0x7D8
movl $0x1, (%rax)
leaq 0x296c36(%rip), %rcx    # 0x30d31c
xorl %eax, %eax
cmpl $0x0, (%rcx)
jne 0x7672f
cmpl $0x7e1, (%r14)          # imm = 0x7E1
setge %al
leaq 0x29702a(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %al, %sil
cmpl $0x11, %edx
setl %al
orb %sil, %al
movl $0x8, %eax
jne 0x7672f
leaq 0x1a2123(%rip), %rax    # 0x218844
movl $0x7d2, (%rax)          # imm = 0x7D2
movl $0x2, (%rcx)
xorl %eax, %eax
leaq 0x296dda(%rip), %rbx    # 0x30d510
movl (%rbx), %ecx
xorl %edx, %edx
cmpl $0xd, %ecx
cmovbl %ecx, %edx
movl %edx, (%rbx)
leaq 0x296d5b(%rip), %r14    # 0x30d4a4
movl (%r14), %ecx
andl $-0x9, %ecx
orl %eax, %ecx
movl %ecx, (%r14)
leaq 0x296fb5(%rip), %r15    # 0x30d710
movsd (%r15), %xmm0
leaq 0x296fb1(%rip), %rax    # 0x30d718
movsd %xmm0, (%rax)
callq 0xae92
movsd %xmm0, (%r15)
leaq 0x1a4858(%rip), %rax    # 0x21afd4
cmpl $0x53, (%rax)
jne 0x767b0
testb $0x1, (%r14)
je 0x767b0
leaq 0x296f9a(%rip), %rax    # 0x30d728
cvtsi2sdl (%rax), %xmm1
xorpd %xmm0, %xmm0
subsd %xmm1, %xmm0
callq 0x5c7ed
orb $0x1, (%r14)
leaq 0x296c22(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
callq 0x75d6d
leaq 0x296fb4(%rip), %rax    # 0x30d770
movl (%rax), %eax
testl %eax, %eax
je 0x767e8
leaq 0x296d43(%rip), %rcx    # 0x30d50c
movl %eax, (%rcx)
leaq 0x296fa2(%rip), %rax    # 0x30d774
movl (%rax), %eax
movl %eax, (%rbx)
leaq 0x296f9b(%rip), %rax    # 0x30d778
movl (%rax), %eax
leaq 0x296d2e(%rip), %rcx    # 0x30d514
movl %eax, (%rcx)
callq 0x75f5e
leaq 0x1c7c21(%rip), %rax    # 0x23e415
cmpb $0x0, (%rax)
je 0x767fe
callq 0x66646
leaq 0x1a20cb(%rip), %rbx    # 0x2188d0
movq (%rbx), %rax
cmpq $0x1, %rax
sete %dl
leaq 0x2c0a2e(%rip), %r14    # 0x337244
movl (%r14), %ecx
testl %ecx, %ecx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x76866
testl %ecx, %ecx
jle 0x76852
xorl %r15d, %r15d
leaq 0x2c090a(%rip), %r12    # 0x337140
movzbl (%r12,%r15), %esi
movl $0xa, %edi
xorl %edx, %edx
callq 0xbcaa
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x76836
movl $0xa, %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0xbcaa
movq (%rbx), %rax
cmpq $0x10, %rax
setne %cl
cmpq $0x1000, %rax           # imm = 0x1000
setne %dl
andb %cl, %dl
cmpq $0x8, %rax
setne %al
andb %dl, %al
leaq 0x1c86e8(%rip), %rcx    # 0x23ef70
cmpl $0x0, (%rcx)
setne %cl
testb %cl, %al
jne 0x76a11
leaq 0x2c077b(%rip), %rax    # 0x337018
cmpb $0x0, (%rax)
jne 0x76a11
leaq 0x296c53(%rip), %r14    # 0x30d500
movl (%r14), %esi
xorl %ebx, %ebx
cmpl $0x3e, %esi
jl 0x768cb
leaq 0xab997(%rip), %rdi     # 0x122255
callq 0xd397d
movl (%r14), %esi
movl $0x1, %ebx
testl %esi, %esi
jns 0x768dd
leaq 0xab98a(%rip), %rdi     # 0x122260
callq 0xd397d
incl %ebx
leaq 0x296c20(%rip), %r15    # 0x30d504
movl (%r15), %esi
cmpl $0x3d, %esi
jl 0x768fd
leaq 0xab977(%rip), %rdi     # 0x12226a
callq 0xd397d
incl %ebx
movl (%r15), %esi
testl %esi, %esi
jns 0x7690f
leaq 0xab96d(%rip), %rdi     # 0x122275
callq 0xd397d
incl %ebx
leaq 0x296bf2(%rip), %r13    # 0x30d508
movl (%r13), %esi
cmpl $0x19, %esi
jl 0x76931
leaq 0xab959(%rip), %rdi     # 0x12227f
callq 0xd397d
incl %ebx
movl (%r13), %esi
testl %esi, %esi
jns 0x76943
leaq 0xab94c(%rip), %rdi     # 0x122288
callq 0xd397d
incl %ebx
leaq 0x296bc2(%rip), %r12    # 0x30d50c
movl (%r12), %esi
cmpl $0x20, %esi
jl 0x76965
leaq 0xab936(%rip), %rdi     # 0x122290
callq 0xd397d
incl %ebx
movl (%r12), %esi
movq %r14, %r12
testl %esi, %esi
jg 0x7697a
leaq 0xab924(%rip), %rdi     # 0x122297
callq 0xd397d
incl %ebx
leaq 0x296b8f(%rip), %r14    # 0x30d510
movl (%r14), %esi
cmpl $0xd, %esi
jl 0x7699a
leaq 0xab90e(%rip), %rdi     # 0x12229e
callq 0xd397d
incl %ebx
movl (%r14), %esi
testl %esi, %esi
jg 0x769ac
leaq 0xab902(%rip), %rdi     # 0x1222a7
callq 0xd397d
incl %ebx
leaq 0x296b61(%rip), %r15    # 0x30d514
movl (%r15), %esi
cmpl $0x7bb, %esi            # imm = 0x7BB
jg 0x769cf
leaq 0xab8eb(%rip), %rdi     # 0x1222b0
callq 0xd397d
incl %ebx
movl (%r15), %esi
cmpl $0x835, %esi            # imm = 0x835
jl 0x769e7
leaq 0xab8dc(%rip), %rdi     # 0x1222ba
callq 0xd397d
incl %ebx
jmp 0x769ef
testl %ebx, %ebx
je 0x76a9a
leaq 0x1a1eda(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x76a11
leaq 0x1a45d1(%rip), %rax    # 0x21afd4
cmpl $0x53, (%rax)
jne 0x76a11
leaq 0x1acbe1(%rip), %rax    # 0x2235f0
movl %ebx, (%rax)
callq 0x76c3e
leaq 0x1a1eb3(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x1, %rax
sete %dl
leaq 0x1a45a6(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
cmpl $0x50, %ecx
sete %sil
testb %sil, %dl
jne 0x76a85
cmpq $0x1, %rax
sete %al
cmpl $0x41, %ecx
sete %cl
andb %al, %cl
leaq 0x1a1ea6(%rip), %rax    # 0x2188f8
movl (%rax), %eax
cmpl $0x47, %eax
sete %dl
testb %dl, %cl
jne 0x76a6a
testb %cl, %cl
je 0x76a76
cmpl $0x33, %eax
je 0x76a6a
cmpl $0x47, %eax
leaq 0x29682f(%rip), %rax    # 0x30d2a0
cmpl $0x0, (%rax)
je 0x76a85
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x76e69
movl (%r12), %eax
leaq 0x296a23(%rip), %rbx    # 0x30d4c8
movl %eax, (%rbx)
leaq 0x296a56(%rip), %rax    # 0x30d504
movl (%rax), %eax
leaq 0x296a15(%rip), %r15    # 0x30d4cc
movl %eax, (%r15)
movl (%r13), %eax
leaq 0x296a0b(%rip), %r12    # 0x30d4d0
movl %eax, (%r12)
leaq 0x296a3c(%rip), %rax    # 0x30d50c
movl (%rax), %edx
leaq 0x2969fb(%rip), %rax    # 0x30d4d4
movl %edx, (%rax)
movl (%r14), %eax
leaq 0x2969f3(%rip), %rcx    # 0x30d4d8
movl %eax, (%rcx)
leaq 0x2969ee(%rip), %rcx    # 0x30d4dc
movl %esi, (%rcx)
leaq 0x296a21(%rip), %rcx    # 0x30d518
movsd (%rcx), %xmm0
leaq 0x2969de(%rip), %r14    # 0x30d4e0
movsd %xmm0, (%r14)
leaq 0x296c36(%rip), %rcx    # 0x30d744
movl (%rcx), %ecx
leaq 0x296c25(%rip), %rdi    # 0x30d73c
movl %ecx, (%rdi)
leaq 0x296c20(%rip), %rdi    # 0x30d740
movl %ecx, (%rdi)
leaq 0x296c27(%rip), %rdi    # 0x30d750
movq %rcx, (%rdi)
movl %esi, %edi
movl %eax, %esi
callq 0xd485e
movsd %xmm0, -0x30(%rbp)
movl (%r12), %edi
movl (%r15), %esi
movl (%rbx), %edx
movsd (%r14), %xmm0
callq 0xd492e
addsd -0x30(%rbp), %xmm0
leaq 0x2969df(%rip), %rax    # 0x30d538
movsd %xmm0, (%rax)
leaq 0x2969cc(%rip), %rax    # 0x30d530
movsd %xmm0, (%rax)
leaq 0x1a4885(%rip), %rax    # 0x21b3f4
cmpl $0x0, (%rax)
jne 0x76b85
leaq 0x1a487d(%rip), %rcx    # 0x21b3f8
movsd %xmm0, (%rcx)
movl $0x1, (%rax)
leaq 0x2969fc(%rip), %rax    # 0x30d588
leaq 0x2969f1(%rip), %rbx    # 0x30d584
movl (%rbx), %ecx
incl %ecx
xorl %edx, %edx
ucomisd (%rax), %xmm0
cmovnel %edx, %ecx
cmovpl %edx, %ecx
movl %ecx, (%rbx)
movsd %xmm0, (%rax)
leaq 0x2969e0(%rip), %rax    # 0x30d590
movsd (%rax), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x76bc4
jp 0x76bc4
movsd %xmm0, (%rax)
callq 0x5e5eb
leaq 0x2c0450(%rip), %rax    # 0x337020
cmpb $0x0, (%rax)
je 0x76bda
callq 0x72683
callq 0x5a701
cmpl $0x5, (%rbx)
jg 0x76a11
leaq 0x296861(%rip), %rax    # 0x30d450
cmpb $0x0, (%rax)
je 0x76a11
leaq 0x296852(%rip), %rax    # 0x30d451
cmpb $0x0, (%rax)
je 0x76a11
callq 0xab54
leaq 0x29683e(%rip), %rax    # 0x30d452
movb $0x1, (%rax)
leaq 0x29667a(%rip), %rax    # 0x30d298
cmpl $0x0, (%rax)
jne 0x76c29
movl $0x63, (%rax)
leaq 0xab694(%rip), %rdx     # 0x1222c4
xorl %edi, %edi
xorl %esi, %esi
callq 0xf7a8
jmp 0x76a11