// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: check_for_leapsecond()
void check_for_leapsecond()
{
   // see if the receiver time code could be a leapsecond

   leap_time = 0;   // see if the time could be a leap second, if so do a screen grab and a log entry
   leap_sixty = 0;
   if(time_flags & TFLAGS_NO_UTC_OFS) return;  // time is not valid
   if(time_flags & TFLAGS_INVALID) return;
   if(rcvr_type == THERMO_RCVR) return;
   if(rcvr_type == TICC_RCVR) return;
   if((rcvr_type == TSIP_RCVR) && (tsip_type == STARLOC_TYPE)) return;  // STARLOC has too many bogus time stamps

if(0 && (pri_minutes == 00) && (pri_seconds == 0)) {  // simulate leap second time code
   pri_seconds = 60;
   pri_minutes = 59;
   if(--pri_hours < 0) pri_hours = 23;
}

   if((pri_minutes == 59) && (pri_seconds == 60)) {  // xx:59:60 leapsecond
      leap_sixty = 1;  // used to restore xx:59:60 leapsecond value from jd value
   }

   if((nav_rate != 1.0) && (raw_frac != 0.0)) ;
   else if((pri_minutes == 59) && (pri_seconds == 60)) {
      leap_time = 1;  // xx:59:60
   }
   else if((pri_minutes == 0) && (pri_seconds == 0) && (last_second == 0)) {
      leap_time = 2;  // repeated xx:00:00 second
   }
   else if((pri_minutes == 59) && (pri_seconds == 59) && (last_second == 59)) {
      leap_time = 3;  // repeated xx:59:59 second
   }

   if(leap_file && leap_time) {
      leaped = leap_time;
   }

   last_second = pri_seconds;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2976d8(%rip), %rax    # 0x30d450
movb $0x0, (%rax)
leaq 0x2974a6(%rip), %rdx    # 0x30d228
movl $0x0, (%rdx)
leaq 0x297715(%rip), %rcx    # 0x30d4a4
movl (%rcx), %ecx
testb $0x8, %cl
jne 0x75eab
testb $0x4, %cl
jne 0x75eab
leaq 0x1a2b26(%rip), %rcx    # 0x2188d0
movq (%rcx), %rcx
cmpq $0x10000, %rcx          # imm = 0x10000
je 0x75eab
cmpq $0x80000, %rcx          # imm = 0x80000
je 0x75eab
cmpq $0x1, %rcx
jne 0x75ddd
leaq 0x1a5200(%rip), %rcx    # 0x21afd4
cmpl $0x53, (%rcx)
je 0x75eab
leaq 0x297720(%rip), %rcx    # 0x30d504
movl (%rcx), %edi
movl %edi, %esi
xorl $0x3b, %esi
leaq 0x29770e(%rip), %rcx    # 0x30d500
movl (%rcx), %ecx
movl %ecx, %r8d
xorl $0x3c, %r8d
orl %esi, %r8d
jne 0x75e38
movl $0x1, (%rdx)
leaq 0x1a554b(%rip), %rdx    # 0x21b358
movsd (%rdx), %xmm0
ucomisd 0x93257(%rip), %xmm0    # 0x109070
movb $0x1, %dl
jne 0x75e1f
jnp 0x75e8b
leaq 0x2976ba(%rip), %rsi    # 0x30d4e0
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x75ea2
jp 0x75ea2
jmp 0x75e8b
leaq 0x1a5519(%rip), %rdx    # 0x21b358
movsd (%rdx), %xmm0
ucomisd 0x93225(%rip), %xmm0    # 0x109070
jne 0x75e4f
jnp 0x75e66
leaq 0x29768a(%rip), %rdx    # 0x30d4e0
movsd (%rdx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x75ea2
jp 0x75ea2
orl %ecx, %edi
leaq 0x297899(%rip), %rdx    # 0x30d708
movl (%rdx), %r8d
movb $0x2, %dl
orl %r8d, %edi
je 0x75e8b
movl %ecx, %edx
xorl $0x3b, %edx
orl %edx, %esi
xorl $0x3b, %r8d
movb $0x3, %dl
orl %esi, %r8d
jne 0x75ea2
movb %dl, (%rax)
leaq 0x298430(%rip), %rax    # 0x30e2c4
cmpb $0x0, (%rax)
je 0x75ea2
leaq 0x297349(%rip), %rax    # 0x30d1e9
movb %dl, (%rax)
leaq 0x29785f(%rip), %rax    # 0x30d708
movl %ecx, (%rax)
popq %rbp
retq