// File: /workspace/github_cpp_makefile_star2_O1/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 0x76555
leaq 0xabbd8(%rip), %rdi     # 0x122128
callq 0x58e77
movl $0x0, 0x2f5875(%rip)    # 0x36bdd4
movl 0x2f5887(%rip), %eax    # 0x36bdec
leaq 0x296ed0(%rip), %rcx    # 0x30d43c
incl (%rcx)
leaq 0x296ecb(%rip), %rcx    # 0x30d440
incl (%rcx)
movl %eax, 0x2f585f(%rip)    # 0x36bddc
leaq 0x2c0a84(%rip), %rax    # 0x337008
movl (%rax), %ecx
testl %ecx, %ecx
je 0x765ab
leal -0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x1, %ecx
jg 0x765ab
leaq 0x297d45(%rip), %rax    # 0x30e2e0
movsd 0x17a00(%rax), %xmm0
movsd %xmm0, 0x179f8(%rax)
testl %ebx, %ebx
je 0x7689b
leaq 0x1c891e(%rip), %rax    # 0x23eed8
movl $0x1, (%rax)
callq 0x589b0
movl %eax, 0x2f5821(%rip)    # 0x36bdec
movl %eax, 0x2f5807(%rip)    # 0x36bdd8
leaq 0x29716c(%rip), %rcx    # 0x30d744
movl %eax, (%rcx)
callq 0x588f0
leaq 0x297152(%rip), %rcx    # 0x30d738
movw %ax, (%rcx)
leaq 0x297158(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
callq 0x588f0
cmpw $0x3f, %ax
ja 0x76656
leaq 0x29712c(%rip), %rcx    # 0x30d734
cmpl $0x0, (%rcx)
jne 0x76656
movswl %ax, %edx
leaq 0x297111(%rip), %rcx    # 0x30d728
movl %edx, (%rcx)
testw %ax, %ax
je 0x76627
leaq 0x29710b(%rip), %rsi    # 0x30d730
movl %edx, (%rsi)
leaq 0x1a49a6(%rip), %rdx    # 0x21afd4
cmpl $0x53, (%rdx)
jne 0x7668c
leaq 0x2970f6(%rip), %rdx    # 0x30d730
movl (%rdx), %edx
testl %edx, %edx
sete %sil
testw %ax, %ax
setne %al
orb %sil, %al
jne 0x7664f
movl %edx, (%rcx)
callq 0x587d1
jmp 0x76679
leaq 0x1a2273(%rip), %rax    # 0x2188d0
movq (%rax), %r14
leaq 0x1a496d(%rip), %rax    # 0x21afd4
movl (%rax), %ebx
callq 0x587d1
cmpq $0x1, %r14
jne 0x76691
cmpl $0x53, %ebx
jne 0x76691
cmpl $0x100, %eax            # imm = 0x100
jb 0x766ae
leaq 0x1c88e9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
jmp 0x766ae
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x766a2
leaq 0x1c88d1(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x296df8(%rip), %rcx    # 0x30d4a4
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x766c4
leaq 0x1c88af(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movl %eax, 0x2f571b(%rip)    # 0x36bde8
leaq 0x296e2c(%rip), %rcx    # 0x30d500
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x766ec
leaq 0x1c8887(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movl %eax, 0x2f56ef(%rip)    # 0x36bde4
leaq 0x296e08(%rip), %r15    # 0x30d504
movl %eax, (%r15)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x76715
leaq 0x1c885e(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
movl %eax, 0x2f56c2(%rip)    # 0x36bde0
leaq 0x296de3(%rip), %r12    # 0x30d508
movl %eax, (%r12)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x7673f
leaq 0x1c8834(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x296dc3(%rip), %r13    # 0x30d50c
movl %eax, (%r13)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x76763
leaq 0x1c8810(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x296da3(%rip), %rbx    # 0x30d510
movl %eax, (%rbx)
callq 0x588f0
movzwl %ax, %edx
leaq 0x296d96(%rip), %r14    # 0x30d514
movl %edx, (%r14)
leaq 0x296d90(%rip), %rax    # 0x30d518
movq $0x0, (%rax)
leaq 0x1a213a(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x7680f
leaq 0x1a4831(%rip), %rax    # 0x21afd4
cmpl $0x53, (%rax)
jne 0x7680f
leaq 0x1a2115(%rip), %rax    # 0x2188c4
cmpb $0x0, (%rax)
setne %al
leaq 0x1c7bd4(%rip), %rcx    # 0x23e390
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x767f9
movl (%rbx), %ecx
movl (%r13), %r8d
movl (%r12), %r9d
movl (%r15), %r10d
leaq 0x296d20(%rip), %rax    # 0x30d500
movl (%rax), %r11d
leaq 0xab95e(%rip), %rsi     # 0x122148
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x9560
addq $0x10, %rsp
movl $0xfffff7cb, %eax       # imm = 0xFFFFF7CB
addl (%r14), %eax
cmpl $-0x79, %eax
jb 0x76a14
callq 0x762d2
xorl %edi, %edi
callq 0x58f50
leaq 0x296b0f(%rip), %rax    # 0x30d32c
cmpl $0x0, (%rax)
jne 0x7682f
leaq 0x1a201b(%rip), %rcx    # 0x218844
movl $0x7d7, (%rcx)          # imm = 0x7D7
movl $0x1, (%rax)
leaq 0x296aec(%rip), %rax    # 0x30d328
cmpl $0x0, (%rax)
jne 0x7684e
leaq 0x1a1ffc(%rip), %rcx    # 0x218844
movl $0x7d8, (%rcx)          # imm = 0x7D8
movl $0x1, (%rax)
leaq 0x296ac1(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0x7689b
cmpl $0x7e1, (%r14)          # imm = 0x7E1
setge %cl
leaq 0x296eb7(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0x7689b
leaq 0x1a1fb5(%rip), %rcx    # 0x218844
movl $0x7d2, (%rcx)          # imm = 0x7D2
movl $0x2, (%rax)
leaq 0x296c6e(%rip), %rbx    # 0x30d510
movl (%rbx), %eax
xorl %ecx, %ecx
cmpl $0xd, %eax
cmovbl %eax, %ecx
movl %ecx, (%rbx)
leaq 0x296a67(%rip), %rax    # 0x30d31c
xorl %ecx, %ecx
cmpl $0x0, (%rax)
sete %cl
leaq 0x296be0(%rip), %r14    # 0x30d4a4
movl (%r14), %eax
andl $-0x9, %eax
leal (%rax,%rcx,8), %eax
movl %eax, (%r14)
leaq 0x296e39(%rip), %r15    # 0x30d710
movsd (%r15), %xmm0
leaq 0x296e35(%rip), %rax    # 0x30d718
movsd %xmm0, (%rax)
callq 0xaea1
movsd %xmm0, (%r15)
leaq 0x1a46dc(%rip), %rax    # 0x21afd4
cmpl $0x53, (%rax)
jne 0x7692c
testb $0x1, (%r14)
je 0x7692c
leaq 0x296e1e(%rip), %rax    # 0x30d728
cvtsi2sdl (%rax), %xmm1
xorpd %xmm0, %xmm0
subsd %xmm1, %xmm0
callq 0x5c907
orb $0x1, (%r14)
leaq 0x296aa6(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
callq 0x75f0b
leaq 0x296e38(%rip), %rax    # 0x30d770
movl (%rax), %eax
testl %eax, %eax
je 0x76964
leaq 0x296bc7(%rip), %rcx    # 0x30d50c
movl %eax, (%rcx)
leaq 0x296e26(%rip), %rax    # 0x30d774
movl (%rax), %eax
movl %eax, (%rbx)
leaq 0x296e1f(%rip), %rax    # 0x30d778
movl (%rax), %eax
leaq 0x296bb2(%rip), %rcx    # 0x30d514
movl %eax, (%rcx)
callq 0x760eb
leaq 0x1c7aa5(%rip), %rax    # 0x23e415
cmpb $0x0, (%rax)
je 0x7697a
callq 0x66423
leaq 0x1a1f4f(%rip), %rbx    # 0x2188d0
cmpq $0x1, (%rbx)
jne 0x769d1
leaq 0x2c08b6(%rip), %r14    # 0x337244
cmpl $0x0, (%r14)
je 0x769d1
cmpl $0x0, (%r14)
jle 0x769c0
xorl %r15d, %r15d
leaq 0x2c079c(%rip), %r12    # 0x337140
movzbl (%r12,%r15), %esi
movl $0xa, %edi
xorl %edx, %edx
callq 0xbcc0
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x769a4
movl $0xa, %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0xbcc0
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 0x1c857a(%rip), %rcx    # 0x23ef70
cmpl $0x0, (%rcx)
setne %cl
testb %cl, %al
jne 0x76d1f
leaq 0x2c060d(%rip), %rax    # 0x337018
cmpb $0x0, (%rax)
jne 0x76d1f
leaq 0x296ae5(%rip), %r14    # 0x30d500
movl (%r14), %esi
xorl %ebx, %ebx
cmpl $0x3e, %esi
jl 0x76a36
leaq 0xab749(%rip), %rdi     # 0x122175
callq 0xd3248
movl $0x1, %ebx
movl (%r14), %esi
testl %esi, %esi
jns 0x76a4b
leaq 0xab73c(%rip), %rdi     # 0x122180
callq 0xd3248
incl %ebx
leaq 0x296ab2(%rip), %r13    # 0x30d504
movl (%r13), %esi
cmpl $0x3d, %esi
jl 0x76a69
leaq 0xab728(%rip), %rdi     # 0x12218a
callq 0xd3248
incl %ebx
movl (%r13), %esi
testl %esi, %esi
jns 0x76a7f
leaq 0xab71d(%rip), %rdi     # 0x122195
callq 0xd3248
incl %ebx
leaq 0x296a82(%rip), %r12    # 0x30d508
movl (%r12), %esi
cmpl $0x19, %esi
jl 0x76a9d
leaq 0xab709(%rip), %rdi     # 0x12219f
callq 0xd3248
incl %ebx
movl (%r12), %esi
testl %esi, %esi
jns 0x76ab3
leaq 0xab6fc(%rip), %rdi     # 0x1221a8
callq 0xd3248
incl %ebx
leaq 0x296a52(%rip), %r12    # 0x30d50c
movl (%r12), %esi
cmpl $0x20, %esi
jl 0x76ad1
leaq 0xab6e6(%rip), %rdi     # 0x1221b0
callq 0xd3248
incl %ebx
movl (%r12), %esi
movq %r14, %r12
testl %esi, %esi
jg 0x76aea
leaq 0xab6d4(%rip), %rdi     # 0x1221b7
callq 0xd3248
incl %ebx
leaq 0x296a1f(%rip), %r14    # 0x30d510
movl (%r14), %esi
cmpl $0xd, %esi
jl 0x76b07
leaq 0xab6be(%rip), %rdi     # 0x1221be
callq 0xd3248
incl %ebx
movl (%r14), %esi
testl %esi, %esi
jg 0x76b1c
leaq 0xab6b2(%rip), %rdi     # 0x1221c7
callq 0xd3248
incl %ebx
leaq 0x2969f1(%rip), %r15    # 0x30d514
movl (%r15), %esi
cmpl $0x7bb, %esi            # imm = 0x7BB
jg 0x76b3c
leaq 0xab69b(%rip), %rdi     # 0x1221d0
callq 0xd3248
incl %ebx
movl (%r15), %esi
cmpl $0x835, %esi            # imm = 0x835
jl 0x76b55
leaq 0xab68c(%rip), %rdi     # 0x1221da
callq 0xd3248
incl %ebx
testl %ebx, %ebx
je 0x76b88
leaq 0x1a1d70(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x76d1f
leaq 0x1a4463(%rip), %rax    # 0x21afd4
cmpl $0x53, (%rax)
jne 0x76d1f
leaq 0x1aca6f(%rip), %rax    # 0x2235f0
movl %ebx, (%rax)
jmp 0x76d1f
movl (%r12), %eax
leaq 0x296935(%rip), %rcx    # 0x30d4c8
movl %eax, (%rcx)
movl (%r13), %eax
leaq 0x29692c(%rip), %rbx    # 0x30d4cc
movl %eax, (%rbx)
leaq 0x29695f(%rip), %rax    # 0x30d508
movl (%rax), %eax
leaq 0x29691e(%rip), %r12    # 0x30d4d0
movl %eax, (%r12)
leaq 0x29694f(%rip), %rax    # 0x30d50c
movl (%rax), %edx
leaq 0x29690e(%rip), %rax    # 0x30d4d4
movl %edx, (%rax)
movl (%r14), %esi
leaq 0x296906(%rip), %rax    # 0x30d4d8
movl %esi, (%rax)
movl (%r15), %edi
leaq 0x2968fe(%rip), %rax    # 0x30d4dc
movl %edi, (%rax)
leaq 0x296931(%rip), %rax    # 0x30d518
movsd (%rax), %xmm0
leaq 0x2968ee(%rip), %r14    # 0x30d4e0
movsd %xmm0, (%r14)
leaq 0x296b46(%rip), %rax    # 0x30d744
movl (%rax), %eax
leaq 0x296b35(%rip), %rcx    # 0x30d73c
movl %eax, (%rcx)
leaq 0x296b30(%rip), %rcx    # 0x30d740
movl %eax, (%rcx)
leaq 0x296b37(%rip), %rcx    # 0x30d750
movq %rax, (%rcx)
callq 0xd4110
movsd %xmm0, -0x30(%rbp)
movl (%r12), %edi
movl (%rbx), %esi
leaq 0x296895(%rip), %rax    # 0x30d4c8
movl (%rax), %edx
movsd (%r14), %xmm0
callq 0xd41e0
addsd -0x30(%rbp), %xmm0
leaq 0x2968ed(%rip), %rax    # 0x30d538
movsd %xmm0, (%rax)
leaq 0x2968da(%rip), %rax    # 0x30d530
movsd %xmm0, (%rax)
leaq 0x1a4793(%rip), %rax    # 0x21b3f4
cmpl $0x0, (%rax)
jne 0x76c77
leaq 0x1a478b(%rip), %rcx    # 0x21b3f8
movsd %xmm0, (%rcx)
movl $0x1, (%rax)
leaq 0x29690a(%rip), %rax    # 0x30d588
leaq 0x2968ff(%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 0x2968ee(%rip), %rax    # 0x30d590
movsd (%rax), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x76cb6
jp 0x76cb6
movsd %xmm0, (%rax)
callq 0x5e66d
leaq 0x2c035e(%rip), %rax    # 0x337020
cmpb $0x0, (%rax)
je 0x76ccc
callq 0x727c3
callq 0x5a797
cmpl $0x5, (%rbx)
jg 0x76d1f
leaq 0x296773(%rip), %rax    # 0x30d450
cmpb $0x0, (%rax)
je 0x76d1f
leaq 0x296768(%rip), %rax    # 0x30d451
cmpb $0x0, (%rax)
je 0x76d1f
callq 0xab5f
leaq 0x296758(%rip), %rax    # 0x30d452
movb $0x1, (%rax)
leaq 0x296594(%rip), %rax    # 0x30d298
cmpl $0x0, (%rax)
jne 0x76d0f
movl $0x63, (%rax)
leaq 0xab4ce(%rip), %rdx     # 0x1221e4
xorl %edi, %edi
xorl %esi, %esi
callq 0xf82a
callq 0x76dbd
leaq 0x1a1ba5(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x1, %rax
sete %dl
leaq 0x1a4298(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
cmpl $0x50, %ecx
sete %sil
testb %sil, %dl
je 0x76d5f
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x77054
cmpq $0x1, %rax
sete %dl
cmpl $0x41, %ecx
sete %al
andb %dl, %al
leaq 0x1a1b83(%rip), %rcx    # 0x2188f8
movl (%rcx), %ecx
cmpl $0x47, %ecx
sete %dl
testb %dl, %al
je 0x76d8f
leaq 0x296518(%rip), %rax    # 0x30d2a0
cmpl $0x0, (%rax)
jne 0x76dae
jmp 0x76d4a
testb %al, %al
je 0x76d9d
cmpl $0x33, %ecx
je 0x76d81
cmpl $0x47, %ecx
je 0x76d81
leaq 0x2964fc(%rip), %rcx    # 0x30d2a0
cmpl $0x0, (%rcx)
sete %cl
testb %cl, %al
jne 0x76d4a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq