// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: silly_clocks()
void silly_clocks()
{
char s[32];
FILE *lock_file;
static int last_silly_sec = (-99);
static int last_year = (-9999);
char *ext;

   gregorian(0, jd_local);   // for the following functions that always trigger on local time
   if(nav_rate != 1) {
      if(g_seconds == last_silly_sec) return;
      last_silly_sec = g_seconds;
   }

   #ifdef GREET_STUFF
      if(greet_ok || ((g_hours == GREET_HOUR) && (g_minutes == GREET_MINUTE) && (g_seconds == GREET_SECOND))) {
         show_greetings();
         greet_ok = 0;
         gregorian(0, jd_local);
      }
   #endif



   if(sun_file && play_sun_song && !no_easter_eggs) {  // sunrise/sunset file
      if((have_sun_times & 0x01) && (g_hours == rise_hh) && (g_minutes == rise_mm) && (g_seconds == rise_ss)) {
         play_tune(SUNRISE_FILE, 1);
      }
      else if((have_sun_times & 0x04) && (g_hours == set_hh) && (g_minutes == set_mm) && (g_seconds == set_ss)) {
         play_tune(SUNRISE_FILE, 1);
      }
   }

   if(noon_file && play_sun_song && !no_easter_eggs) {  // solar noon file
      if((have_sun_times & 0x02) && (g_hours == noon_hh) && (g_minutes == noon_mm) && (g_seconds == noon_ss)) {
         play_tune(NOON_FILE, 1);
      }
   }

   if(tick_clock) {  // ticking clock in use
      if(fine_tick_clock) {  // try to tick more closely to actual time, not message arival time
         // the fine tick clock extends the tick to the true next second,
         // so we need to trigger the minute sound when the message time is
         // at :59.xxx seconds (!!!!!!! is this true for receivers with negative /tsx values?)
if(fine_tick_msec >= 0.0) { // a pending tick was not played by fine_tick_check()
  sound_tick_clock(); 
}
         fine_tick_msec = GetMsecs() + (1000.0 - (pri_frac*1000.0) - TICK_SOUND_DELAY);  // used for millisecond accurate tick clock
         if(fine_tick_msec < 0.0) fine_tick_msec = GetMsecs();  

         minute_tick = 0;
         if(time_sync_offset >= 0.0) {  // time message arrives after actual time
            if(pri_seconds == 59) minute_tick = 1;
         }
         else {  // time message arrives before actual time
            if(pri_seconds == 59) minute_tick = (-1);
         }
      }
      else {  // tick when message comes in
         if(pri_seconds || (tick_clock == 1)) {  // sound the seconds tick sound
            if(tick_clock != 2) {
               if(seconds_file) play_tune(SECONDS_FILE, 1);
               else if(click_file) play_tune(CLICK_FILE, 1);
               else BEEP(200);
            }
         }
         else if(minute_file) play_tune(MINUTE_FILE, 1); // minute tick sound        
         else BEEP(201);
      }
   }

   // This routine plays a jaunty tune shortly after a leap second

   if(0 && leap_file && leap_pending && ((minor_alarms & MINOR_LEAP_PEND) == 0)) { 
      leaped = 1;   // the leap second flag just cleared
   }

   leap_pending = (minor_alarms & MINOR_LEAP_PEND);
   if(leaped && (g_seconds == LEAP_SECOND)) {
      leaped = 0;
      if(!no_easter_eggs) play_tune(LEAP_FILE, 1);
   }
   else if(1 && ((pri_year - last_year) == 1)) {
      if((pri_month == 1) && (pri_day == 1) && (pri_seconds > 0)) {
         play_tune(NEW_YEAR_NAME, 1);
         last_year = pri_year;
      }
   }
   else last_year = pri_year;


   // gratuitously silly cuckcoo clock mode (this triggers on displayed time)
   get_alarm_time();  // for functions that can trigger on local or displayed (pri_xxxx times)

   if(tick_clock) ;
   else if(ships_clock && (g_seconds == CUCKOO_SECOND)) {
      if((g_minutes == 0) || (g_minutes == 30)) {
         ring_bell = ships_bells();
         if(ring_bell >= 0) bell_number = 0;
      }
   }
   else if(cuckoo && (g_seconds == CUCKOO_SECOND)) { 
      // note that the singing_clock is handled as a special case of the cuckoo clock
      if(cuckoo_hours && (g_minutes == 0)) {  // cuckoo the hour on the hour
         cuckoo_beeps = (g_hours % 12);
         if(cuckoo_beeps == 0) cuckoo_beeps = 12;
      }
      else if((g_minutes%(60/cuckoo)) == 0) {  // cuckoo on the marks
         if     (cuckoo_hours)    cuckoo_beeps = 1;
         else if(g_minutes == 0)  cuckoo_beeps = 3;
         else if(g_minutes == 30) cuckoo_beeps = 2;
         else                     cuckoo_beeps = 1;
      }
   }

   if(egg_timer) {
      if(--egg_timer == 0) {
         sound_alarm |= ALARM_TIMER;
         enable_alarm();
         alarm_wait = 0;
         if(repeat_egg) egg_timer = egg_val;
      }
   }

   if(dump_timer) {
      if(--dump_timer == 0) {
         do_screen_dump |= ALARM_TIMER;
         if(repeat_dump) dump_timer = dump_val;
      }
   }

   if(log_timer) {
      if(--log_timer == 0) {
         do_log_dump |= ALARM_TIMER;
         if(repeat_log) log_timer = log_val;
      }
   }

   if(script_timer) {
      if(--script_timer == 0) {
         do_script_run |= ALARM_TIMER;
         if(repeat_script) script_timer = script_val;
      }
   }

   if(exec_timer) {
      if(--exec_timer == 0) {
         do_exec_run |= ALARM_TIMER;
         if(repeat_exec) exec_timer = exec_val;
      }
   }

   if(sound_alarm) {  // sounding the alarm clock
      if(sound_alarm & ALARM_TIME) {
         alarm_jd += 1.0;  // trigger again tomorrow
         if(sound_alarm == ALARM_TIME) {
            reset_alarm();
         }
         sound_alarm &= (~ALARM_TIME);
      }

      alarm_wait = 0;
      alarm_clock();  
      if(single_alarm) {  // sound alarm once,  useful if playing long sound file
         if(sound_alarm & ALARM_DATE) {
            alarm_time = alarm_date = 0;
            alarm_jd = 0.0;
            egg_timer = egg_val = 0;
            repeat_egg = 0;
         }

         reset_alarm();
         sound_alarm = 0;
      }

      if(luxor) {  // turn off battery when alarm sounds
         cc_mode = 0;
         sweep_stop = 0.0F;
         set_batt_pwm(0x0000);
      }
   }


   if(do_script_run) {  // running a sceduled script
      if(do_script_run & ALARM_TIME) script_jd += 1.0;  // trigger again tomorrow
      open_script("timer.scr");  
      do_script_run = 0;
   }


   if(do_exec_run) {  // running a scheduled program
      if(do_exec_run & ALARM_TIME) exec_jd += 1.0;  // trigger again tomorrow
      exec_program();
      do_exec_run = 0;
   }
   
   if(do_screen_dump) {  // perform a scheduled screen dump
      if(do_screen_dump & ALARM_TIME) dump_jd += 1.0;  // trigger again tomorrow
      ++dump_number;
      get_alarm_time();
      if(single_dump) {
         sprintf(s, "%sdump", dump_prefix);
      }
      else {
        sprintf(s, "%s%04d-%02d-%02d-%ld", dump_prefix, g_year,g_month,g_day,dump_number);
      }

      lock_file = topen(lock_name, "w");  // create file tblock to signify dump file is being written
      if(lock_file) {
         fprintf(lock_file, "1");
         fclose(lock_file);
      }
      dump_screen(invert_dump, top_line, s);
      path_unlink(lock_name);

      do_screen_dump = 0;
   }
   
   if(do_log_dump && (doing_log_dump == 0)) {   // scheduled write log data to a file
      if(do_log_dump & ALARM_TIME) log_jd += 1.0;  // trigger again tomorrow
      ++log_number;
      get_alarm_time();

      if(dump_xml) ext = ".xml";
      else if(dump_gpx) ext = ".gpx";
      else ext = ".log";   // RINEX can't be written from queue data

      if(single_log) {
         if(!strcmp(dump_prefix, "tb")) sprintf(s, "%s%s", unit_file_name, ext);
         else sprintf(s, "%s%s%s", dump_prefix, unit_file_name, ext);
      }
      else {
         sprintf(s, "%s%04d-%02d-%02d-%ld%s", dump_prefix, g_year,g_month,g_day,log_number, ext);
      }

      dump_log(s, 'q');

      do_log_dump = 0;
   }

   if(tick_clock) {  // ticking clock
   }
   else if(ships_clock && (ring_bell >= 0) && (bell_number >= 0) && (bell_number < 12)) {
      cuckoo_clock();
   }
   else if(cuckoo_beeps) { // cuckoo clock
      cuckoo_clock(); 
      if(cuckoo_beeps) --cuckoo_beeps;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
leaq 0x229533(%rip), %rbx    # 0x30d548
movsd (%rbx), %xmm0
xorl %edi, %edi
callq 0xd12da
leaq 0x137331(%rip), %rax    # 0x21b358
movsd (%rax), %xmm0
ucomisd 0x2503d(%rip), %xmm0    # 0x109070
jne 0xe4037
jnp 0xe4052
leaq 0x229672(%rip), %rax    # 0x30d6b0
movl (%rax), %eax
cmpl 0x86aca(%rip), %eax     # 0x16ab10
je 0xe49a6
movl %eax, 0x86abe(%rip)     # 0x16ab10
leaq 0x25b277(%rip), %r14    # 0x33f2d0
cmpb $0x0, (%r14)
jne 0xe4083
leaq 0x229642(%rip), %rax    # 0x30d6a8
cmpl $0x0, (%rax)
jne 0xe4097
leaq 0x22963a(%rip), %rax    # 0x30d6ac
cmpl $0x0, (%rax)
jne 0xe4097
leaq 0x229632(%rip), %rax    # 0x30d6b0
cmpl $0xc, (%rax)
jne 0xe4097
callq 0xe4a1f
movb $0x0, (%r14)
movsd (%rbx), %xmm0
xorl %edi, %edi
callq 0xd12da
leaq 0x22a227(%rip), %rax    # 0x30e2c5
cmpb $0x0, (%rax)
leaq 0x229510(%rip), %r14    # 0x30d5b8
leaq 0x137188(%rip), %rbx    # 0x21b237
je 0xe4162
cmpl $0x0, (%r14)
je 0xe4162
cmpb $0x0, (%rbx)
jne 0xe4162
leaq 0x229579(%rip), %rax    # 0x30d648
movl (%rax), %eax
testb $0x1, %al
je 0xe4111
leaq 0x2295cc(%rip), %rcx    # 0x30d6a8
movl (%rcx), %ecx
leaq 0x22951b(%rip), %rdx    # 0x30d600
cmpl (%rdx), %ecx
jne 0xe4111
leaq 0x2295bc(%rip), %rcx    # 0x30d6ac
movl (%rcx), %ecx
leaq 0x22950b(%rip), %rdx    # 0x30d604
cmpl (%rdx), %ecx
jne 0xe4111
leaq 0x2295ac(%rip), %rcx    # 0x30d6b0
movl (%rcx), %ecx
leaq 0x2294fb(%rip), %rdx    # 0x30d608
cmpl (%rdx), %ecx
je 0xe4151
testb $0x4, %al
je 0xe4162
leaq 0x22958c(%rip), %rax    # 0x30d6a8
movl (%rax), %eax
leaq 0x22950b(%rip), %rcx    # 0x30d630
cmpl (%rcx), %eax
jne 0xe4162
leaq 0x22957c(%rip), %rax    # 0x30d6ac
movl (%rax), %eax
leaq 0x2294fb(%rip), %rcx    # 0x30d634
cmpl (%rcx), %eax
jne 0xe4162
leaq 0x22956c(%rip), %rax    # 0x30d6b0
movl (%rax), %eax
leaq 0x2294eb(%rip), %rcx    # 0x30d638
cmpl (%rcx), %eax
jne 0xe4162
leaq 0x25527(%rip), %rdi     # 0x10967f
movl $0x1, %esi
callq 0x9ccb
leaq 0x22a15d(%rip), %rax    # 0x30e2c6
cmpb $0x0, (%rax)
je 0xe41d2
cmpl $0x0, (%r14)
je 0xe41d2
cmpb $0x0, (%rbx)
jne 0xe41d2
leaq 0x2294c8(%rip), %rax    # 0x30d648
testb $0x2, (%rax)
je 0xe41d2
leaq 0x22951c(%rip), %rax    # 0x30d6a8
movl (%rax), %eax
leaq 0x2294d3(%rip), %rcx    # 0x30d668
cmpl (%rcx), %eax
jne 0xe41d2
leaq 0x22950c(%rip), %rax    # 0x30d6ac
movl (%rax), %eax
leaq 0x2294c3(%rip), %rcx    # 0x30d66c
cmpl (%rcx), %eax
jne 0xe41d2
leaq 0x2294fc(%rip), %rax    # 0x30d6b0
movl (%rax), %eax
leaq 0x2294b3(%rip), %rcx    # 0x30d670
cmpl (%rcx), %eax
jne 0xe41d2
leaq 0x254cb(%rip), %rdi     # 0x109693
movl $0x1, %esi
callq 0x9ccb
leaq 0x229d13(%rip), %r14    # 0x30deec
movb (%r14), %al
testb %al, %al
je 0xe4300
leaq 0x229d05(%rip), %rcx    # 0x30def0
cmpl $0x0, (%rcx)
je 0xe4288
leaq 0x229cfd(%rip), %r15    # 0x30def8
movsd (%r15), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xe420f
callq 0x1e940
callq 0xae92
leaq 0x2292fd(%rip), %rax    # 0x30d518
movsd 0x24e15(%rip), %xmm1    # 0x109038
movsd (%rax), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%r15)
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xe424c
callq 0xae92
movsd %xmm0, (%r15)
leaq 0x229cad(%rip), %rax    # 0x30df00
movl $0x0, (%rax)
leaq 0x229c68(%rip), %rcx    # 0x30dec8
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x22928d(%rip), %rcx    # 0x30d500
movl (%rcx), %ecx
jae 0xe42ad
cmpl $0x3b, %ecx
jne 0xe4300
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0xe4300
cmpb $0x1, %al
je 0xe42ba
leaq 0x22926d(%rip), %rcx    # 0x30d500
cmpl $0x0, (%rcx)
jne 0xe42ba
leaq 0x22a022(%rip), %rax    # 0x30e2c1
cmpb $0x0, (%rax)
je 0xe42d3
leaq 0x2541c(%rip), %rdi     # 0x1096c7
jmp 0xe42f6
cmpl $0x3b, %ecx
jne 0xe4300
movl $0x1, (%rax)
jmp 0xe4300
cmpb $0x2, %al
je 0xe4300
leaq 0x229ffd(%rip), %rax    # 0x30e2c2
cmpb $0x0, (%rax)
je 0xe42df
leaq 0x25409(%rip), %rdi     # 0x1096da
jmp 0xe42f6
movl $0xc9, %edi
callq 0x9d78
jmp 0xe4300
leaq 0x229fe2(%rip), %rax    # 0x30e2c8
cmpb $0x0, (%rax)
je 0xe49ee
leaq 0x253bf(%rip), %rdi     # 0x1096b5
movl $0x1, %esi
callq 0x9ccb
leaq 0x228ed1(%rip), %rax    # 0x30d1d8
movl $0x80, %ecx
andl (%rax), %ecx
leaq 0x228ecb(%rip), %rax    # 0x30d1e0
movl %ecx, (%rax)
leaq 0x228ecb(%rip), %rax    # 0x30d1e9
cmpb $0x0, (%rax)
leaq 0x229388(%rip), %r15    # 0x30d6b0
je 0xe434b
cmpl $0x4, (%r15)
jne 0xe434b
movb $0x0, (%rax)
cmpb $0x0, (%rbx)
jne 0xe439e
leaq 0x2532c(%rip), %rdi     # 0x10966b
movl $0x1, %esi
callq 0x9ccb
jmp 0xe439e
leaq 0x2291c2(%rip), %rbx    # 0x30d514
movl (%rbx), %eax
movl %eax, %ecx
subl 0x867b8(%rip), %ecx     # 0x16ab14
cmpl $0x1, %ecx
jne 0xe4398
leaq 0x2291a8(%rip), %rax    # 0x30d510
cmpl $0x1, (%rax)
jne 0xe439e
leaq 0x229198(%rip), %rax    # 0x30d50c
cmpl $0x1, (%rax)
jne 0xe439e
leaq 0x229180(%rip), %rax    # 0x30d500
cmpl $0x0, (%rax)
jle 0xe439e
leaq 0x4f8d1(%rip), %rdi     # 0x133c5d
movl $0x1, %esi
callq 0x9ccb
movl (%rbx), %eax
movl %eax, 0x86776(%rip)     # 0x16ab14
callq 0xe2f80
cmpb $0x0, (%r14)
je 0xe4677
leaq 0x229b54(%rip), %rbx    # 0x30df08
movq (%rbx), %rax
testq %rax, %rax
je 0xe43f6
decq %rax
movq %rax, (%rbx)
jne 0xe43f6
leaq 0x229b7d(%rip), %rax    # 0x30df48
orb $0x4, (%rax)
callq 0xe30c9
leaq 0x229b40(%rip), %rax    # 0x30df1a
movb $0x0, (%rax)
leaq 0x229b34(%rip), %rax    # 0x30df18
cmpb $0x0, (%rax)
je 0xe43f6
leaq 0x229b20(%rip), %rax    # 0x30df10
movq (%rax), %rax
movq %rax, (%rbx)
leaq 0x229b83(%rip), %rax    # 0x30df80
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe4430
decq %rcx
movq %rcx, (%rax)
jne 0xe4430
leaq 0x229b86(%rip), %rcx    # 0x30df9a
orb $0x4, (%rcx)
leaq 0x229b7a(%rip), %rcx    # 0x30df98
cmpb $0x0, (%rcx)
je 0xe4430
leaq 0x229b5e(%rip), %rcx    # 0x30df88
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x229ba1(%rip), %rax    # 0x30dfd8
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe446a
decq %rcx
movq %rcx, (%rax)
jne 0xe446a
leaq 0x229ba4(%rip), %rcx    # 0x30dff2
orb $0x4, (%rcx)
leaq 0x229b98(%rip), %rcx    # 0x30dff0
cmpb $0x0, (%rcx)
je 0xe446a
leaq 0x229b7c(%rip), %rcx    # 0x30dfe0
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x229bef(%rip), %rax    # 0x30e060
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe44a4
decq %rcx
movq %rcx, (%rax)
jne 0xe44a4
leaq 0x229bea(%rip), %rcx    # 0x30e072
orb $0x4, (%rcx)
leaq 0x229bde(%rip), %rcx    # 0x30e070
cmpb $0x0, (%rcx)
je 0xe44a4
leaq 0x229bca(%rip), %rcx    # 0x30e068
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x229bf5(%rip), %rax    # 0x30e0a0
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe44de
decq %rcx
movq %rcx, (%rax)
jne 0xe44de
leaq 0x229bf0(%rip), %rcx    # 0x30e0b2
orb $0x4, (%rcx)
leaq 0x229be4(%rip), %rcx    # 0x30e0b0
cmpb $0x0, (%rcx)
je 0xe44de
leaq 0x229bd0(%rip), %rcx    # 0x30e0a8
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x229a63(%rip), %r15    # 0x30df48
movb (%r15), %al
testb %al, %al
je 0xe45a6
testb $0x2, %al
je 0xe451c
leaq 0x229a45(%rip), %rcx    # 0x30df40
movsd (%rcx), %xmm0
addsd 0x24b69(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rcx)
cmpb $0x2, %al
jne 0xe4517
callq 0xe3081
movb (%r15), %al
andb $-0x3, %al
movb %al, (%r15)
leaq 0x2299f7(%rip), %rax    # 0x30df1a
movb $0x0, (%rax)
callq 0x9dd5
leaq 0x229a17(%rip), %rax    # 0x30df49
cmpb $0x0, (%rax)
je 0xe457b
testb $0x1, (%r15)
je 0xe4572
leaq 0x2299e8(%rip), %rax    # 0x30df2c
xorl %ecx, %ecx
movl %ecx, (%rax)
leaq 0x2299cd(%rip), %rax    # 0x30df1c
movl %ecx, (%rax)
leaq 0x2299e8(%rip), %rax    # 0x30df40
movq %rcx, (%rax)
leaq 0x2299ae(%rip), %rax    # 0x30df10
movq %rcx, (%rax)
movq %rcx, (%rbx)
leaq 0x2299a9(%rip), %rax    # 0x30df18
movb $0x0, (%rax)
callq 0xe3081
movb $0x0, (%r15)
leaq 0x15a9bc(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
je 0xe45a6
leaq 0x2288fa(%rip), %rax    # 0x30ce88
movb $0x0, (%rax)
leaq 0x228930(%rip), %rax    # 0x30cec8
movq $0x0, (%rax)
xorl %edi, %edi
callq 0x7c189
leaq 0x229ac5(%rip), %rbx    # 0x30e072
movb (%rbx), %al
testb %al, %al
je 0xe45dd
testb $0x2, %al
je 0xe45ce
leaq 0x229a9a(%rip), %rax    # 0x30e058
movsd (%rax), %xmm0
addsd 0x24aa6(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rax)
leaq 0x4f69d(%rip), %rdi     # 0x133c72
callq 0x1cf62
movb $0x0, (%rbx)
leaq 0x229ace(%rip), %rbx    # 0x30e0b2
movb (%rbx), %al
testb %al, %al
je 0xe460d
testb $0x2, %al
je 0xe4605
leaq 0x229aa3(%rip), %rax    # 0x30e098
movsd (%rax), %xmm0
addsd 0x24a6f(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rax)
callq 0xa181
movb $0x0, (%rbx)
leaq 0x229986(%rip), %r15    # 0x30df9a
movb (%r15), %al
testb %al, %al
je 0xe4796
testb $0x2, %al
je 0xe463a
leaq 0x229946(%rip), %rax    # 0x30df70
movsd (%rax), %xmm0
addsd 0x24a3a(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rax)
leaq 0x22994f(%rip), %rbx    # 0x30df90
incq (%rbx)
callq 0xe2f80
leaq 0x229949(%rip), %rax    # 0x30df99
cmpb $0x0, (%rax)
je 0xe46fb
leaq 0x4f61c(%rip), %rsi     # 0x133c7c
leaq 0x229b59(%rip), %rdx    # 0x30e1c0
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
jmp 0xe473b
leaq 0x229863(%rip), %rax    # 0x30dee1
cmpb $0x0, (%rax)
setne %cl
movl (%r15), %eax
testl %eax, %eax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xe4868
leaq 0x22900e(%rip), %rax    # 0x30d6ac
movl (%rax), %ecx
cmpl $0x1e, %ecx
je 0xe46ad
testl %ecx, %ecx
jne 0xe43ad
leaq 0x228ff4(%rip), %rax    # 0x30d6a8
movl (%rax), %eax
leal 0x3(%rax), %edx
testl %eax, %eax
cmovnsl %eax, %edx
andl $0x7ffffffc, %edx       # imm = 0x7FFFFFFC
subl %edx, %eax
addl %eax, %eax
testl %ecx, %ecx
je 0xe46d8
cmpl $0x1e, %ecx
jne 0xe49dc
orl $0x1, %eax
leaq 0x229805(%rip), %rcx    # 0x30dee4
movl %eax, (%rcx)
testl %eax, %eax
js 0xe43ad
leaq 0x2297f8(%rip), %rax    # 0x30dee8
movl $0x0, (%rax)
jmp 0xe43ad
leaq 0x228fa2(%rip), %rax    # 0x30d6a4
movl (%rax), %ecx
leaq 0x228f91(%rip), %rax    # 0x30d69c
movl (%rax), %r8d
leaq 0x228f8b(%rip), %rax    # 0x30d6a0
movl (%rax), %r9d
subq $0x8, %rsp
leaq 0x4f560(%rip), %rsi     # 0x133c83
leaq 0x229a96(%rip), %rdx    # 0x30e1c0
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
pushq (%rbx)
callq 0x9060
addq $0x10, %rsp
leaq 0x22997e(%rip), %rdi    # 0x30e0c0
leaq 0x3cc72(%rip), %rsi     # 0x1213bb
callq 0x9a47
testq %rax, %rax
je 0xe476b
movq %rax, %rbx
movl $0x31, %edi
movq %rax, %rsi
callq 0x9480
movq %rbx, %rdi
callq 0x9370
leaq 0x1340c2(%rip), %rax    # 0x218834
movl (%rax), %edi
leaq 0x1340c5(%rip), %rax    # 0x218840
movl (%rax), %esi
leaq -0x40(%rbp), %rdx
callq 0xf7a8
leaq 0x229933(%rip), %rdi    # 0x30e0c0
callq 0xa1e1
movb $0x0, (%r15)
leaq 0x229855(%rip), %rbx    # 0x30dff2
movb (%rbx), %al
testb %al, %al
je 0xe495a
leaq 0x159c5a(%rip), %rcx    # 0x23e408
cmpl $0x0, (%rcx)
jne 0xe495a
testb $0x2, %al
je 0xe47d2
leaq 0x229806(%rip), %rax    # 0x30dfc8
movsd (%rax), %xmm0
addsd 0x248a2(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rax)
leaq 0x22980f(%rip), %r15    # 0x30dfe8
incq (%r15)
callq 0xe2f80
leaq 0x2297b3(%rip), %rax    # 0x30df9b
leaq 0x2297ad(%rip), %rcx    # 0x30df9c
cmpb $0x0, (%rcx)
leaq 0x2659d(%rip), %rcx     # 0x10ad96
leaq 0x48d3d(%rip), %rdx     # 0x12d53d
cmoveq %rcx, %rdx
cmpb $0x0, (%rax)
leaq 0x3988c(%rip), %r10     # 0x11e09a
cmoveq %rdx, %r10
leaq 0x2297d8(%rip), %rax    # 0x30dff1
cmpb $0x0, (%rax)
je 0xe48f0
leaq 0x229997(%rip), %rax    # 0x30e1c0
movl $0x6274, %ecx           # imm = 0x6274
xorl (%rax), %ecx
movzbl 0x2(%rax), %eax
orw %cx, %ax
leaq 0x8c44a(%rip), %rax     # 0x170c88
movq (%rax), %rcx
je 0xe4931
leaq 0x4f44a(%rip), %rsi     # 0x133c98
leaq 0x22996b(%rip), %rdx    # 0x30e1c0
leaq -0x40(%rbp), %rdi
movq %r10, %r8
xorl %eax, %eax
callq 0x9060
jmp 0xe4949
testl %eax, %eax
sete %al
leaq 0x229668(%rip), %rcx    # 0x30dedc
movb (%rcx), %dl
testb %dl, %dl
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xe43ad
leaq 0x229651(%rip), %rax    # 0x30dede
movb (%rax), %sil
testb %sil, %sil
setne %al
leaq 0x228e0f(%rip), %rcx    # 0x30d6ac
movl (%rcx), %ecx
testl %ecx, %ecx
sete %dil
andb %al, %dil
cmpb $0x1, %dil
jne 0xe49b1
leaq 0x228def(%rip), %rax    # 0x30d6a8
movslq (%rax), %rax
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x21, %rcx
addl %edx, %ecx
shll $0x2, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
testb %al, %al
movl $0xc, %ecx
cmovnel %eax, %ecx
leaq 0x2295f6(%rip), %rax    # 0x30dedf
movb %cl, (%rax)
jmp 0xe43ad
leaq 0x228dad(%rip), %rax    # 0x30d6a4
movl (%rax), %ecx
leaq 0x228d9c(%rip), %rax    # 0x30d69c
movl (%rax), %r8d
leaq 0x228d96(%rip), %rax    # 0x30d6a0
movl (%rax), %r9d
leaq 0x4f38b(%rip), %rsi     # 0x133c9f
leaq 0x2298a5(%rip), %rdx    # 0x30e1c0
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
pushq %r10
pushq (%r15)
callq 0x9060
addq $0x10, %rsp
jmp 0xe4949
leaq 0x26c62(%rip), %rsi     # 0x10b59a
leaq -0x40(%rbp), %rdi
movq %rcx, %rdx
movq %r10, %rcx
xorl %eax, %eax
callq 0x9060
leaq -0x40(%rbp), %rdi
movl $0x71, %esi
callq 0xd191e
movb $0x0, (%rbx)
cmpb $0x0, (%r14)
jne 0xe49a6
leaq 0x22957a(%rip), %rax    # 0x30dee1
cmpb $0x0, (%rax)
je 0xe498b
leaq 0x229571(%rip), %rax    # 0x30dee4
cmpl $0x0, (%rax)
js 0xe498b
leaq 0x229569(%rip), %rax    # 0x30dee8
cmpl $0xb, (%rax)
ja 0xe498b
callq 0x9e23
jmp 0xe49a6
leaq 0x22954d(%rip), %rbx    # 0x30dedf
cmpb $0x0, (%rbx)
je 0xe49a6
callq 0x9e23
movb (%rbx), %al
testb %al, %al
je 0xe49a6
decb %al
movb %al, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x3c, %al
movzbl %al, %eax
divb %dl
movzbl %al, %edi
movl %ecx, %eax
cltd
idivl %edi
testl %edx, %edx
jne 0xe43ad
testb %sil, %sil
je 0xe49f8
leaq 0x22950b(%rip), %rax    # 0x30dedf
movb $0x1, (%rax)
jmp 0xe43ad
leaq 0x229501(%rip), %rax    # 0x30dee4
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0xe43ad
movl $0xc8, %edi
jmp 0xe42d8
testl %ecx, %ecx
je 0xe4a10
cmpl $0x1e, %ecx
jne 0xe49cd
leaq 0x2294d7(%rip), %rax    # 0x30dedf
movb $0x2, (%rax)
jmp 0xe43ad
leaq 0x2294c8(%rip), %rax    # 0x30dedf
movb $0x3, (%rax)
jmp 0xe43ad