// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: check_end_times()
void check_end_times()
{
double this_jd;
static double last_jd = 1E100;

   // check to see if it is time to do a scheduled screen or log dump or to exit
   if(time_flags & TFLAGS_BAD_TIME) return;

   this_jd = get_alarm_time();

   // if time only specified, add in the current date...
   // plus 1 day if less than the current date/time
   if(alarm_jd < 1.0) {
      alarm_jd += jdate(pri_year,pri_month,pri_day);
      if(alarm_jd < this_jd) alarm_jd += 1.0;
   }
   if(dump_jd < 1.0) {
      dump_jd += jdate(pri_year,pri_month,pri_day);
      if(dump_jd < this_jd) dump_jd += 1.0;
   }
   if(exec_jd < 1.0) {
      exec_jd += jdate(pri_year,pri_month,pri_day);
      if(exec_jd < this_jd) exec_jd += 1.0;
   }
   if(exit_jd < 1.0) {
      exit_jd += jdate(pri_year,pri_month,pri_day);
      if(exit_jd < this_jd) exit_jd += 1.0;
   }
   if(log_jd < 1.0) {
      log_jd += jdate(pri_year,pri_month,pri_day);
      if(log_jd < this_jd) log_jd += 1.0;
   }
   if(script_jd < 1.0) {
      script_jd += jdate(pri_year,pri_month,pri_day);
      if(script_jd < this_jd) script_jd += 1.0;
   }


   if(exit_timer) {  // countdown timer set
      if(--exit_timer == 0) goto time_exit;
   }

   // see if user wants us to exit at this time every day
   if(end_time || end_date) {    
      if((last_jd < exit_jd) && (this_jd >= exit_jd)) {
         if(end_date) {
            goto time_exit;
         }
         else {
            time_exit:
            printf("\nUser set exit time has been reached\n");
            shut_down(100);
         }
      }
   }


   if(alarm_time || alarm_date) {  // alarm clock has been set
      if((last_jd < alarm_jd) && (this_jd >= alarm_jd)) {
         if(alarm_date) {  // sound alarm at a given date and time
            sound_alarm |= ALARM_DATE;
            enable_alarm();
            alarm_wait = 0;
         }
         else {  // sound alarm at a given time
            sound_alarm |= (ALARM_TIME | ALARM_SET);
            enable_alarm();
            alarm_wait = 0;
         }
      }
   }

   if(dump_time || dump_date) {  // screen dump clock has been set
      if((last_jd < dump_jd) && (this_jd >= dump_jd)) {
         if(dump_date) {  // do screen dump at a given date and time
            do_screen_dump |= ALARM_DATE;
         }
         else {  // dump screen at a given time
            do_screen_dump |= ALARM_TIME;
         }
      }
   }

   if(log_time || log_date) {  // log dump clock has been set
      if((last_jd < log_jd) && (this_jd >= log_jd)) {
         if(log_date) {
            do_log_dump |= ALARM_DATE;
         }
         else {
            do_log_dump |= ALARM_TIME;
         }
      }
   }

   if(script_time || script_date) {  // script run clock has been set
      if((last_jd < script_jd) && (this_jd >= script_jd)) {
         if(script_date) {
            do_script_run |= ALARM_DATE;
         }
         else {
            do_script_run |= ALARM_TIME;
         }
      }
   }

   if(exec_time || exec_date) {  // program run clock has been set
      if((last_jd < exec_jd) && (this_jd >= exec_jd)) {
         if(exec_date) {
            do_exec_run |= ALARM_DATE;
         }
         else {
            do_exec_run |= ALARM_TIME;
         }
      }
   }

   last_jd = this_jd;
}

// Assembly:
leaq 0x22a397(%rip), %rax    # 0x30d4a4
testb $0xc, (%rax)
je 0xe3113
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
callq 0xe2f80
movsd %xmm0, -0x30(%rbp)
leaq 0x22ae0b(%rip), %r15    # 0x30df40
movsd (%r15), %xmm1
movsd 0x25f2e(%rip), %xmm0    # 0x109070
ucomisd %xmm1, %xmm0
jbe 0xe319b
leaq 0x22a3c5(%rip), %rax    # 0x30d514
movl (%rax), %edi
leaq 0x22a3b8(%rip), %rax    # 0x30d510
movl (%rax), %esi
leaq 0x22a3ab(%rip), %rax    # 0x30d50c
movl (%rax), %edx
movsd %xmm1, -0x38(%rbp)
callq 0xd485e
movsd -0x38(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%r15)
movsd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
movsd 0x25ee4(%rip), %xmm0    # 0x109070
jbe 0xe319b
addsd 0x25eda(%rip), %xmm1    # 0x109070
movsd %xmm1, (%r15)
leaq 0x22adce(%rip), %r14    # 0x30df70
movsd (%r14), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xe3200
leaq 0x22a360(%rip), %rax    # 0x30d514
movl (%rax), %edi
leaq 0x22a353(%rip), %rax    # 0x30d510
movl (%rax), %esi
leaq 0x22a346(%rip), %rax    # 0x30d50c
movl (%rax), %edx
movsd %xmm1, -0x38(%rbp)
callq 0xd485e
movsd -0x38(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%r14)
movsd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
movsd 0x25e7f(%rip), %xmm0    # 0x109070
jbe 0xe3200
addsd 0x25e75(%rip), %xmm1    # 0x109070
movsd %xmm1, (%r14)
leaq 0x22ae91(%rip), %rbx    # 0x30e098
movsd (%rbx), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xe3262
leaq 0x22a2fc(%rip), %rax    # 0x30d514
movl (%rax), %edi
leaq 0x22a2ef(%rip), %rax    # 0x30d510
movl (%rax), %esi
leaq 0x22a2e2(%rip), %rax    # 0x30d50c
movl (%rax), %edx
movsd %xmm1, -0x38(%rbp)
callq 0xd485e
movsd -0x38(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
movsd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
movsd 0x25e1c(%rip), %xmm0    # 0x109070
jbe 0xe3262
addsd 0x25e12(%rip), %xmm1    # 0x109070
movsd %xmm1, (%rbx)
leaq 0x22adaf(%rip), %r12    # 0x30e018
movsd (%r12), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xe32ca
leaq 0x22a298(%rip), %rax    # 0x30d514
movl (%rax), %edi
leaq 0x22a28b(%rip), %rax    # 0x30d510
movl (%rax), %esi
leaq 0x22a27e(%rip), %rax    # 0x30d50c
movl (%rax), %edx
movsd %xmm1, -0x38(%rbp)
callq 0xd485e
movsd -0x38(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%r12)
movsd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xe32c2
addsd 0x25db4(%rip), %xmm1    # 0x109070
movsd %xmm1, (%r12)
movsd 0x25da6(%rip), %xmm0    # 0x109070
leaq 0x22acf7(%rip), %r12    # 0x30dfc8
movsd (%r12), %xmm2
ucomisd %xmm2, %xmm0
movsd %xmm1, -0x38(%rbp)
jbe 0xe333c
leaq 0x22a22b(%rip), %rax    # 0x30d514
movl (%rax), %edi
leaq 0x22a21e(%rip), %rax    # 0x30d510
movl (%rax), %esi
leaq 0x22a211(%rip), %rax    # 0x30d50c
movl (%rax), %edx
movsd %xmm2, -0x40(%rbp)
callq 0xd485e
movsd -0x40(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
addsd %xmm0, %xmm2
movsd %xmm2, (%r12)
movsd -0x30(%rbp), %xmm0
ucomisd %xmm2, %xmm0
movsd 0x25d44(%rip), %xmm0    # 0x109070
jbe 0xe333c
addsd 0x25d3a(%rip), %xmm2    # 0x109070
movsd %xmm2, (%r12)
leaq 0x22ad15(%rip), %r13    # 0x30e058
movsd (%r13), %xmm2
ucomisd %xmm2, %xmm0
jbe 0xe33a1
leaq 0x22a1be(%rip), %rax    # 0x30d514
movl (%rax), %edi
leaq 0x22a1b1(%rip), %rax    # 0x30d510
movl (%rax), %esi
leaq 0x22a1a4(%rip), %rax    # 0x30d50c
movl (%rax), %edx
movsd %xmm2, -0x40(%rbp)
callq 0xd485e
movsd -0x40(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
addsd %xmm0, %xmm2
movsd %xmm2, (%r13)
movsd -0x30(%rbp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0xe33a1
addsd 0x25cd5(%rip), %xmm2    # 0x109070
movsd %xmm2, (%r13)
leaq 0x22ac78(%rip), %rax    # 0x30e020
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe33b8
decq %rcx
movq %rcx, (%rax)
je 0xe33e1
leaq 0x22ac35(%rip), %rax    # 0x30dff4
leaq 0x22ac3e(%rip), %rcx    # 0x30e004
movl (%rcx), %ecx
orl (%rax), %ecx
je 0xe33f7
ucomisd 0x87734(%rip), %xmm1    # 0x16ab08
jbe 0xe33f7
movsd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xe33f7
leaq 0x52f7e(%rip), %rdi     # 0x136366
callq 0x95d0
movl $0x64, %edi
callq 0xdcff
leaq 0x22ab1e(%rip), %rcx    # 0x30df1c
leaq 0x22ab27(%rip), %rax    # 0x30df2c
movl (%rax), %eax
movl (%rcx), %ecx
orl %eax, %ecx
je 0xe344e
movsd (%r15), %xmm0
ucomisd 0x876ee(%rip), %xmm0    # 0x16ab08
jbe 0xe344e
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jb 0xe344e
testl %eax, %eax
movl $0x1, %eax
movl $0x82, %ecx
cmovnel %eax, %ecx
leaq 0x22ab0b(%rip), %rax    # 0x30df48
orb %cl, (%rax)
callq 0xe30c9
leaq 0x22aacf(%rip), %rax    # 0x30df1a
movb $0x0, (%rax)
leaq 0x22aafb(%rip), %rcx    # 0x30df50
leaq 0x22ab04(%rip), %rax    # 0x30df60
movl (%rax), %eax
movl (%rcx), %ecx
orl %eax, %ecx
je 0xe348f
movsd (%r14), %xmm0
ucomisd 0x87697(%rip), %xmm0    # 0x16ab08
jbe 0xe348f
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jb 0xe348f
xorl %ecx, %ecx
cmpl $0x1, %eax
adcb $0x1, %cl
leaq 0x22ab0d(%rip), %rax    # 0x30df9a
orb %cl, (%rax)
leaq 0x22ab0e(%rip), %rcx    # 0x30dfa4
leaq 0x22ab17(%rip), %rax    # 0x30dfb4
movl (%rax), %eax
movl (%rcx), %ecx
orl %eax, %ecx
je 0xe34d1
movsd (%r12), %xmm0
ucomisd 0x87655(%rip), %xmm0    # 0x16ab08
jbe 0xe34d1
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jb 0xe34d1
xorl %ecx, %ecx
cmpl $0x1, %eax
adcb $0x1, %cl
leaq 0x22ab23(%rip), %rax    # 0x30dff2
orb %cl, (%rax)
leaq 0x22ab5c(%rip), %rcx    # 0x30e034
leaq 0x22ab65(%rip), %rax    # 0x30e044
movl (%rax), %eax
movl (%rcx), %ecx
orl %eax, %ecx
je 0xe3513
movsd (%r13), %xmm0
ucomisd 0x87613(%rip), %xmm0    # 0x16ab08
jbe 0xe3513
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jb 0xe3513
xorl %ecx, %ecx
cmpl $0x1, %eax
adcb $0x1, %cl
leaq 0x22ab61(%rip), %rax    # 0x30e072
orb %cl, (%rax)
leaq 0x22ab5a(%rip), %rcx    # 0x30e074
leaq 0x22ab63(%rip), %rax    # 0x30e084
movl (%rax), %eax
movl (%rcx), %ecx
orl %eax, %ecx
je 0xe3553
movsd (%rbx), %xmm0
ucomisd 0x875d3(%rip), %xmm0    # 0x16ab08
jbe 0xe3553
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jb 0xe3553
xorl %ecx, %ecx
cmpl $0x1, %eax
adcb $0x1, %cl
leaq 0x22ab61(%rip), %rax    # 0x30e0b2
orb %cl, (%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x875a8(%rip)    # 0x16ab08
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq