// File: /workspace/github_cpp_makefile_star2_O1/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 0x22a133(%rip), %rbx    # 0x30d548
movsd (%rbx), %xmm0
xorl %edi, %edi
callq 0xd0c46
leaq 0x137f31(%rip), %rax    # 0x21b358
movsd (%rax), %xmm0
ucomisd 0x25c3d(%rip), %xmm0    # 0x109070
jne 0xe3437
jnp 0xe3452
leaq 0x22a272(%rip), %rax    # 0x30d6b0
movl (%rax), %eax
cmpl 0x876ca(%rip), %eax     # 0x16ab10
je 0xe3d88
movl %eax, 0x876be(%rip)     # 0x16ab10
leaq 0x25be77(%rip), %r14    # 0x33f2d0
cmpb $0x0, (%r14)
jne 0xe3483
leaq 0x22a242(%rip), %rax    # 0x30d6a8
cmpl $0x0, (%rax)
jne 0xe3497
leaq 0x22a23a(%rip), %rax    # 0x30d6ac
cmpl $0x0, (%rax)
jne 0xe3497
leaq 0x22a232(%rip), %rax    # 0x30d6b0
cmpl $0xc, (%rax)
jne 0xe3497
callq 0xe3e17
movb $0x0, (%r14)
movsd (%rbx), %xmm0
xorl %edi, %edi
callq 0xd0c46
leaq 0x22ae27(%rip), %rax    # 0x30e2c5
cmpb $0x0, (%rax)
leaq 0x22a110(%rip), %r14    # 0x30d5b8
leaq 0x137d88(%rip), %rbx    # 0x21b237
je 0xe3562
cmpl $0x0, (%r14)
je 0xe3562
cmpb $0x0, (%rbx)
jne 0xe3562
leaq 0x22a179(%rip), %rax    # 0x30d648
movl (%rax), %eax
testb $0x1, %al
je 0xe3511
leaq 0x22a1cc(%rip), %rcx    # 0x30d6a8
movl (%rcx), %ecx
leaq 0x22a11b(%rip), %rdx    # 0x30d600
cmpl (%rdx), %ecx
jne 0xe3511
leaq 0x22a1bc(%rip), %rcx    # 0x30d6ac
movl (%rcx), %ecx
leaq 0x22a10b(%rip), %rdx    # 0x30d604
cmpl (%rdx), %ecx
jne 0xe3511
leaq 0x22a1ac(%rip), %rcx    # 0x30d6b0
movl (%rcx), %ecx
leaq 0x22a0fb(%rip), %rdx    # 0x30d608
cmpl (%rdx), %ecx
je 0xe3551
testb $0x4, %al
je 0xe3562
leaq 0x22a18c(%rip), %rax    # 0x30d6a8
movl (%rax), %eax
leaq 0x22a10b(%rip), %rcx    # 0x30d630
cmpl (%rcx), %eax
jne 0xe3562
leaq 0x22a17c(%rip), %rax    # 0x30d6ac
movl (%rax), %eax
leaq 0x22a0fb(%rip), %rcx    # 0x30d634
cmpl (%rcx), %eax
jne 0xe3562
leaq 0x22a16c(%rip), %rax    # 0x30d6b0
movl (%rax), %eax
leaq 0x22a0eb(%rip), %rcx    # 0x30d638
cmpl (%rcx), %eax
jne 0xe3562
leaq 0x26117(%rip), %rdi     # 0x10966f
movl $0x1, %esi
callq 0x9cd3
leaq 0x22ad5d(%rip), %rax    # 0x30e2c6
cmpb $0x0, (%rax)
je 0xe35d2
cmpl $0x0, (%r14)
je 0xe35d2
cmpb $0x0, (%rbx)
jne 0xe35d2
leaq 0x22a0c8(%rip), %rax    # 0x30d648
testb $0x2, (%rax)
je 0xe35d2
leaq 0x22a11c(%rip), %rax    # 0x30d6a8
movl (%rax), %eax
leaq 0x22a0d3(%rip), %rcx    # 0x30d668
cmpl (%rcx), %eax
jne 0xe35d2
leaq 0x22a10c(%rip), %rax    # 0x30d6ac
movl (%rax), %eax
leaq 0x22a0c3(%rip), %rcx    # 0x30d66c
cmpl (%rcx), %eax
jne 0xe35d2
leaq 0x22a0fc(%rip), %rax    # 0x30d6b0
movl (%rax), %eax
leaq 0x22a0b3(%rip), %rcx    # 0x30d670
cmpl (%rcx), %eax
jne 0xe35d2
leaq 0x260bb(%rip), %rdi     # 0x109683
movl $0x1, %esi
callq 0x9cd3
leaq 0x22a913(%rip), %r14    # 0x30deec
movb (%r14), %al
testb %al, %al
je 0xe3700
leaq 0x22a905(%rip), %rcx    # 0x30def0
cmpl $0x0, (%rcx)
je 0xe3688
leaq 0x22a8fd(%rip), %r15    # 0x30def8
movsd (%r15), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xe360f
callq 0x1e963
callq 0xaea1
leaq 0x229efd(%rip), %rax    # 0x30d518
movsd 0x25a15(%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 0xe364c
callq 0xaea1
movsd %xmm0, (%r15)
leaq 0x22a8ad(%rip), %rax    # 0x30df00
movl $0x0, (%rax)
leaq 0x22a868(%rip), %rcx    # 0x30dec8
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x229e8d(%rip), %rcx    # 0x30d500
movl (%rcx), %ecx
jae 0xe36ad
cmpl $0x3b, %ecx
jne 0xe3700
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0xe3700
cmpb $0x1, %al
je 0xe36ba
leaq 0x229e6d(%rip), %rcx    # 0x30d500
cmpl $0x0, (%rcx)
jne 0xe36ba
leaq 0x22ac22(%rip), %rax    # 0x30e2c1
cmpb $0x0, (%rax)
je 0xe36d3
leaq 0x2600c(%rip), %rdi     # 0x1096b7
jmp 0xe36f6
cmpl $0x3b, %ecx
jne 0xe3700
movl $0x1, (%rax)
jmp 0xe3700
cmpb $0x2, %al
je 0xe3700
leaq 0x22abfd(%rip), %rax    # 0x30e2c2
cmpb $0x0, (%rax)
je 0xe36df
leaq 0x25ff9(%rip), %rdi     # 0x1096ca
jmp 0xe36f6
movl $0xc9, %edi
callq 0x9d80
jmp 0xe3700
leaq 0x22abe2(%rip), %rax    # 0x30e2c8
cmpb $0x0, (%rax)
je 0xe3de6
leaq 0x25faf(%rip), %rdi     # 0x1096a5
movl $0x1, %esi
callq 0x9cd3
leaq 0x229ad1(%rip), %rax    # 0x30d1d8
movl $0x80, %ecx
andl (%rax), %ecx
leaq 0x229acb(%rip), %rax    # 0x30d1e0
movl %ecx, (%rax)
leaq 0x229acb(%rip), %rax    # 0x30d1e9
cmpb $0x0, (%rax)
leaq 0x229f88(%rip), %r15    # 0x30d6b0
je 0xe374b
cmpl $0x4, (%r15)
jne 0xe374b
movb $0x0, (%rax)
cmpb $0x0, (%rbx)
jne 0xe379e
leaq 0x25f1c(%rip), %rdi     # 0x10965b
movl $0x1, %esi
callq 0x9cd3
jmp 0xe379e
leaq 0x229dc2(%rip), %rbx    # 0x30d514
movl (%rbx), %eax
movl %eax, %ecx
subl 0x873b8(%rip), %ecx     # 0x16ab14
cmpl $0x1, %ecx
jne 0xe3798
leaq 0x229da8(%rip), %rax    # 0x30d510
cmpl $0x1, (%rax)
jne 0xe379e
leaq 0x229d98(%rip), %rax    # 0x30d50c
cmpl $0x1, (%rax)
jne 0xe379e
leaq 0x229d80(%rip), %rax    # 0x30d500
cmpl $0x0, (%rax)
jle 0xe379e
leaq 0x503e1(%rip), %rdi     # 0x133b6d
movl $0x1, %esi
callq 0x9cd3
movl (%rbx), %eax
movl %eax, 0x87376(%rip)     # 0x16ab14
callq 0xe2431
cmpb $0x0, (%r14)
je 0xe3a73
leaq 0x22a754(%rip), %rbx    # 0x30df08
movq (%rbx), %rax
testq %rax, %rax
je 0xe37f6
decq %rax
movq %rax, (%rbx)
jne 0xe37f6
leaq 0x22a77d(%rip), %rax    # 0x30df48
orb $0x4, (%rax)
callq 0xe257a
leaq 0x22a740(%rip), %rax    # 0x30df1a
movb $0x0, (%rax)
leaq 0x22a734(%rip), %rax    # 0x30df18
cmpb $0x0, (%rax)
je 0xe37f6
leaq 0x22a720(%rip), %rax    # 0x30df10
movq (%rax), %rax
movq %rax, (%rbx)
leaq 0x22a783(%rip), %rax    # 0x30df80
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe3830
decq %rcx
movq %rcx, (%rax)
jne 0xe3830
leaq 0x22a786(%rip), %rcx    # 0x30df9a
orb $0x4, (%rcx)
leaq 0x22a77a(%rip), %rcx    # 0x30df98
cmpb $0x0, (%rcx)
je 0xe3830
leaq 0x22a75e(%rip), %rcx    # 0x30df88
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x22a7a1(%rip), %rax    # 0x30dfd8
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe386a
decq %rcx
movq %rcx, (%rax)
jne 0xe386a
leaq 0x22a7a4(%rip), %rcx    # 0x30dff2
orb $0x4, (%rcx)
leaq 0x22a798(%rip), %rcx    # 0x30dff0
cmpb $0x0, (%rcx)
je 0xe386a
leaq 0x22a77c(%rip), %rcx    # 0x30dfe0
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x22a7ef(%rip), %rax    # 0x30e060
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe38a4
decq %rcx
movq %rcx, (%rax)
jne 0xe38a4
leaq 0x22a7ea(%rip), %rcx    # 0x30e072
orb $0x4, (%rcx)
leaq 0x22a7de(%rip), %rcx    # 0x30e070
cmpb $0x0, (%rcx)
je 0xe38a4
leaq 0x22a7ca(%rip), %rcx    # 0x30e068
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x22a7f5(%rip), %rax    # 0x30e0a0
movq (%rax), %rcx
testq %rcx, %rcx
je 0xe38de
decq %rcx
movq %rcx, (%rax)
jne 0xe38de
leaq 0x22a7f0(%rip), %rcx    # 0x30e0b2
orb $0x4, (%rcx)
leaq 0x22a7e4(%rip), %rcx    # 0x30e0b0
cmpb $0x0, (%rcx)
je 0xe38de
leaq 0x22a7d0(%rip), %rcx    # 0x30e0a8
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x22a663(%rip), %r15    # 0x30df48
movb (%r15), %al
testb %al, %al
je 0xe39a2
testb $0x2, %al
je 0xe3918
leaq 0x22a645(%rip), %rcx    # 0x30df40
movsd (%rcx), %xmm0
addsd 0x25769(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rcx)
cmpb $0x2, %al
jne 0xe3914
callq 0xe2532
andb $-0x3, (%r15)
leaq 0x22a5fb(%rip), %rax    # 0x30df1a
movb $0x0, (%rax)
callq 0x9ddd
leaq 0x22a61b(%rip), %rax    # 0x30df49
cmpb $0x0, (%rax)
je 0xe3977
testb $0x1, (%r15)
je 0xe396e
leaq 0x22a5ec(%rip), %rax    # 0x30df2c
xorl %ecx, %ecx
movl %ecx, (%rax)
leaq 0x22a5d1(%rip), %rax    # 0x30df1c
movl %ecx, (%rax)
leaq 0x22a5ec(%rip), %rax    # 0x30df40
movq %rcx, (%rax)
leaq 0x22a5b2(%rip), %rax    # 0x30df10
movq %rcx, (%rax)
movq %rcx, (%rbx)
leaq 0x22a5ad(%rip), %rax    # 0x30df18
movb $0x0, (%rax)
callq 0xe2532
movb $0x0, (%r15)
leaq 0x15b5c0(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
je 0xe39a2
leaq 0x2294fe(%rip), %rax    # 0x30ce88
movb $0x0, (%rax)
leaq 0x229534(%rip), %rax    # 0x30cec8
movq $0x0, (%rax)
xorl %edi, %edi
callq 0x7c3fc
leaq 0x22a6c9(%rip), %rbx    # 0x30e072
movb (%rbx), %al
testb %al, %al
je 0xe39d9
testb $0x2, %al
je 0xe39ca
leaq 0x22a69e(%rip), %rax    # 0x30e058
movsd (%rax), %xmm0
addsd 0x256aa(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rax)
leaq 0x501b1(%rip), %rdi     # 0x133b82
callq 0x1cf23
movb $0x0, (%rbx)
leaq 0x22a6d2(%rip), %rbx    # 0x30e0b2
movb (%rbx), %al
testb %al, %al
je 0xe3a09
testb $0x2, %al
je 0xe3a01
leaq 0x22a6a7(%rip), %rax    # 0x30e098
movsd (%rax), %xmm0
addsd 0x25673(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rax)
callq 0xa196
movb $0x0, (%rbx)
leaq 0x22a58a(%rip), %r15    # 0x30df9a
movb (%r15), %al
testb %al, %al
je 0xe3b78
testb $0x2, %al
je 0xe3a36
leaq 0x22a54a(%rip), %rax    # 0x30df70
movsd (%rax), %xmm0
addsd 0x2563e(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rax)
leaq 0x22a553(%rip), %rbx    # 0x30df90
incq (%rbx)
callq 0xe2431
leaq 0x22a54d(%rip), %rax    # 0x30df99
cmpb $0x0, (%rax)
je 0xe3add
leaq 0x50130(%rip), %rsi     # 0x133b8c
leaq 0x22a75d(%rip), %rdx    # 0x30e1c0
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
jmp 0xe3b1d
leaq 0x22a467(%rip), %rax    # 0x30dee1
cmpb $0x0, (%rax)
setne %cl
movl (%r15), %eax
testl %eax, %eax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xe3c4a
leaq 0x229c12(%rip), %rax    # 0x30d6ac
movl (%rax), %ecx
cmpl $0x1e, %ecx
je 0xe3aa9
testl %ecx, %ecx
jne 0xe37ad
leaq 0x229bf8(%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 0xe3dc3
cmpl $0x1e, %ecx
jne 0xe3dbe
orl $0x1, %eax
jmp 0xe3dc3
leaq 0x229bc0(%rip), %rax    # 0x30d6a4
movl (%rax), %ecx
leaq 0x229baf(%rip), %rax    # 0x30d69c
movl (%rax), %r8d
leaq 0x229ba9(%rip), %rax    # 0x30d6a0
movl (%rax), %r9d
subq $0x8, %rsp
leaq 0x5008e(%rip), %rsi     # 0x133b93
leaq 0x22a6b4(%rip), %rdx    # 0x30e1c0
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
pushq (%rbx)
callq 0x9060
addq $0x10, %rsp
leaq 0x22a59c(%rip), %rdi    # 0x30e0c0
leaq 0x3d7b0(%rip), %rsi     # 0x1212db
callq 0x9a4d
testq %rax, %rax
je 0xe3b4d
movq %rax, %rbx
movl $0x31, %edi
movq %rax, %rsi
callq 0x9480
movq %rbx, %rdi
callq 0x9370
leaq 0x134ce0(%rip), %rax    # 0x218834
movl (%rax), %edi
leaq 0x134ce3(%rip), %rax    # 0x218840
movl (%rax), %esi
leaq -0x40(%rbp), %rdx
callq 0xf82a
leaq 0x22a551(%rip), %rdi    # 0x30e0c0
callq 0xa1f6
movb $0x0, (%r15)
leaq 0x22a473(%rip), %rbx    # 0x30dff2
movb (%rbx), %al
testb %al, %al
je 0xe3d3c
leaq 0x15a878(%rip), %rcx    # 0x23e408
cmpl $0x0, (%rcx)
jne 0xe3d3c
testb $0x2, %al
je 0xe3bb4
leaq 0x22a424(%rip), %rax    # 0x30dfc8
movsd (%rax), %xmm0
addsd 0x254c0(%rip), %xmm0    # 0x109070
movsd %xmm0, (%rax)
leaq 0x22a42d(%rip), %r15    # 0x30dfe8
incq (%r15)
callq 0xe2431
leaq 0x22a3d1(%rip), %rax    # 0x30df9b
leaq 0x22a3cb(%rip), %rcx    # 0x30df9c
cmpb $0x0, (%rcx)
leaq 0x271ab(%rip), %rcx     # 0x10ad86
leaq 0x4986b(%rip), %rdx     # 0x12d44d
cmoveq %rcx, %rdx
cmpb $0x0, (%rax)
leaq 0x3a41f(%rip), %r10     # 0x11e00f
cmoveq %rdx, %r10
leaq 0x22a3f6(%rip), %rax    # 0x30dff1
cmpb $0x0, (%rax)
je 0xe3cd2
leaq 0x22a5b5(%rip), %rax    # 0x30e1c0
movl $0x6274, %ecx           # imm = 0x6274
xorl (%rax), %ecx
movzbl 0x2(%rax), %eax
orw %cx, %ax
leaq 0x8d068(%rip), %rax     # 0x170c88
movq (%rax), %rcx
je 0xe3d13
leaq 0x4ff78(%rip), %rsi     # 0x133ba8
leaq 0x22a589(%rip), %rdx    # 0x30e1c0
leaq -0x40(%rbp), %rdi
movq %r10, %r8
xorl %eax, %eax
callq 0x9060
jmp 0xe3d2b
testl %eax, %eax
sete %al
leaq 0x22a286(%rip), %rcx    # 0x30dedc
movb (%rcx), %dl
testb %dl, %dl
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xe37ad
leaq 0x22a26f(%rip), %rax    # 0x30dede
movb (%rax), %sil
testb %sil, %sil
setne %al
leaq 0x229a2d(%rip), %rcx    # 0x30d6ac
movl (%rcx), %ecx
testl %ecx, %ecx
sete %dil
andb %al, %dil
cmpb $0x1, %dil
jne 0xe3d93
leaq 0x229a0d(%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 0x22a214(%rip), %rax    # 0x30dedf
movb %cl, (%rax)
jmp 0xe37ad
leaq 0x2299cb(%rip), %rax    # 0x30d6a4
movl (%rax), %ecx
leaq 0x2299ba(%rip), %rax    # 0x30d69c
movl (%rax), %r8d
leaq 0x2299b4(%rip), %rax    # 0x30d6a0
movl (%rax), %r9d
leaq 0x4feb9(%rip), %rsi     # 0x133baf
leaq 0x22a4c3(%rip), %rdx    # 0x30e1c0
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
pushq %r10
pushq (%r15)
callq 0x9060
addq $0x10, %rsp
jmp 0xe3d2b
leaq 0x27873(%rip), %rsi     # 0x10b58d
leaq -0x40(%rbp), %rdi
movq %rcx, %rdx
movq %r10, %rcx
xorl %eax, %eax
callq 0x9060
leaq -0x40(%rbp), %rdi
movl $0x71, %esi
callq 0xd1285
movb $0x0, (%rbx)
cmpb $0x0, (%r14)
jne 0xe3d88
leaq 0x22a198(%rip), %rax    # 0x30dee1
cmpb $0x0, (%rax)
je 0xe3d6d
leaq 0x22a18f(%rip), %rax    # 0x30dee4
cmpl $0x0, (%rax)
js 0xe3d6d
leaq 0x22a187(%rip), %rax    # 0x30dee8
cmpl $0xb, (%rax)
ja 0xe3d6d
callq 0x9e2b
jmp 0xe3d88
leaq 0x22a16b(%rip), %rbx    # 0x30dedf
cmpb $0x0, (%rbx)
je 0xe3d88
callq 0x9e2b
movb (%rbx), %al
testb %al, %al
je 0xe3d88
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 0xe37ad
testb %sil, %sil
je 0xe3df0
leaq 0x22a129(%rip), %rax    # 0x30dedf
movb $0x1, (%rax)
jmp 0xe37ad
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x22a11a(%rip), %rcx    # 0x30dee4
movl %eax, (%rcx)
testl %eax, %eax
js 0xe37ad
leaq 0x22a10d(%rip), %rax    # 0x30dee8
movl $0x0, (%rax)
jmp 0xe37ad
movl $0xc8, %edi
jmp 0xe36d8
testl %ecx, %ecx
je 0xe3e08
cmpl $0x1e, %ecx
jne 0xe3daf
leaq 0x22a0df(%rip), %rax    # 0x30dedf
movb $0x2, (%rax)
jmp 0xe37ad
leaq 0x22a0d0(%rip), %rax    # 0x30dedf
movb $0x3, (%rax)
jmp 0xe37ad