// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x20, %rsp
leaq 0x226ba5(%rip), %rbx    # 0x2f7548
movsd (%rbx), %xmm0
xorl %edi, %edi
callq 0xbfac2
leaq 0x1349a3(%rip), %rax    # 0x205358
movsd (%rax), %xmm0
ucomisd 0x226af(%rip), %xmm0    # 0xf3070
jne 0xd09c5
jnp 0xd09e0
leaq 0x226ce4(%rip), %rax    # 0x2f76b0
movl (%rax), %eax
cmpl 0x8413c(%rip), %eax     # 0x154b10
je 0xd12d5
movl %eax, 0x84130(%rip)     # 0x154b10
leaq 0x2588e9(%rip), %r14    # 0x3292d0
cmpb $0x0, (%r14)
jne 0xd0a11
leaq 0x226cb4(%rip), %rax    # 0x2f76a8
cmpl $0x0, (%rax)
jne 0xd0a25
leaq 0x226cac(%rip), %rax    # 0x2f76ac
cmpl $0x0, (%rax)
jne 0xd0a25
leaq 0x226ca4(%rip), %rax    # 0x2f76b0
cmpl $0xc, (%rax)
jne 0xd0a25
callq 0xd133e
movb $0x0, (%r14)
movsd (%rbx), %xmm0
xorl %edi, %edi
callq 0xbfac2
leaq 0x227899(%rip), %rax    # 0x2f82c5
cmpb $0x0, (%rax)
leaq 0x226b82(%rip), %r14    # 0x2f75b8
leaq 0x1347fa(%rip), %rbx    # 0x205237
je 0xd0aee
cmpl $0x0, (%r14)
je 0xd0aee
cmpb $0x0, (%rbx)
jne 0xd0aee
leaq 0x226beb(%rip), %rax    # 0x2f7648
movl (%rax), %eax
testb $0x1, %al
je 0xd0a9f
leaq 0x226c3e(%rip), %rcx    # 0x2f76a8
movl (%rcx), %ecx
leaq 0x226b8d(%rip), %rdx    # 0x2f7600
cmpl (%rdx), %ecx
jne 0xd0a9f
leaq 0x226c2e(%rip), %rcx    # 0x2f76ac
movl (%rcx), %ecx
leaq 0x226b7d(%rip), %rdx    # 0x2f7604
cmpl (%rdx), %ecx
jne 0xd0a9f
leaq 0x226c1e(%rip), %rcx    # 0x2f76b0
movl (%rcx), %ecx
leaq 0x226b6d(%rip), %rdx    # 0x2f7608
cmpl (%rdx), %ecx
je 0xd0adf
testb $0x4, %al
je 0xd0aee
leaq 0x226bfe(%rip), %rax    # 0x2f76a8
movl (%rax), %eax
leaq 0x226b7d(%rip), %rcx    # 0x2f7630
cmpl (%rcx), %eax
jne 0xd0aee
leaq 0x226bee(%rip), %rax    # 0x2f76ac
movl (%rax), %eax
leaq 0x226b6d(%rip), %rcx    # 0x2f7634
cmpl (%rcx), %eax
jne 0xd0aee
leaq 0x226bde(%rip), %rax    # 0x2f76b0
movl (%rax), %eax
leaq 0x226b5d(%rip), %rcx    # 0x2f7638
cmpl (%rcx), %eax
jne 0xd0aee
leaq 0x22be9(%rip), %rdi     # 0xf36cf
pushq $0x1
popq %rsi
callq 0x9c78
leaq 0x2277d1(%rip), %rax    # 0x2f82c6
cmpb $0x0, (%rax)
je 0xd0b5c
cmpl $0x0, (%r14)
je 0xd0b5c
cmpb $0x0, (%rbx)
jne 0xd0b5c
leaq 0x226b3c(%rip), %rax    # 0x2f7648
testb $0x2, (%rax)
je 0xd0b5c
leaq 0x226b90(%rip), %rax    # 0x2f76a8
movl (%rax), %eax
leaq 0x226b47(%rip), %rcx    # 0x2f7668
cmpl (%rcx), %eax
jne 0xd0b5c
leaq 0x226b80(%rip), %rax    # 0x2f76ac
movl (%rax), %eax
leaq 0x226b37(%rip), %rcx    # 0x2f766c
cmpl (%rcx), %eax
jne 0xd0b5c
leaq 0x226b70(%rip), %rax    # 0x2f76b0
movl (%rax), %eax
leaq 0x226b27(%rip), %rcx    # 0x2f7670
cmpl (%rcx), %eax
jne 0xd0b5c
leaq 0x22b8f(%rip), %rdi     # 0xf36e3
pushq $0x1
popq %rsi
callq 0x9c78
leaq 0x227389(%rip), %r14    # 0x2f7eec
movb (%r14), %al
testb %al, %al
je 0xd0c7e
leaq 0x22737b(%rip), %rcx    # 0x2f7ef0
cmpl $0x0, (%rcx)
je 0xd0c08
leaq 0x227373(%rip), %r15    # 0x2f7ef8
movsd (%r15), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xd0b99
callq 0x1d87c
callq 0xad3f
leaq 0x226973(%rip), %rax    # 0x2f7518
movsd 0x2248b(%rip), %xmm1    # 0xf3038
movsd (%rax), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%r15)
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xd0bd6
callq 0xad3f
movsd %xmm0, (%r15)
leaq 0x227323(%rip), %rax    # 0x2f7f00
andl $0x0, (%rax)
leaq 0x2272e1(%rip), %rcx    # 0x2f7ec8
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x226906(%rip), %rcx    # 0x2f7500
movl (%rcx), %ecx
jae 0xd0c2d
cmpl $0x3b, %ecx
jne 0xd0c7e
orl $-0x1, (%rax)
jmp 0xd0c7e
cmpb $0x1, %al
je 0xd0c3a
leaq 0x2268ed(%rip), %rcx    # 0x2f7500
cmpl $0x0, (%rcx)
jne 0xd0c3a
leaq 0x2276a2(%rip), %rax    # 0x2f82c1
cmpb $0x0, (%rax)
je 0xd0c53
leaq 0x22aec(%rip), %rdi     # 0xf3717
jmp 0xd0c76
cmpl $0x3b, %ecx
jne 0xd0c7e
movl $0x1, (%rax)
jmp 0xd0c7e
cmpb $0x2, %al
je 0xd0c7e
leaq 0x22767d(%rip), %rax    # 0x2f82c2
cmpb $0x0, (%rax)
je 0xd0c5f
leaq 0x22ad9(%rip), %rdi     # 0xf372a
jmp 0xd0c76
movl $0xc9, %edi
callq 0x9d23
jmp 0xd0c7e
leaq 0x227662(%rip), %rax    # 0x2f82c8
cmpb $0x0, (%rax)
je 0xd130d
leaq 0x22a8f(%rip), %rdi     # 0xf3705
pushq $0x1
popq %rsi
callq 0x9c78
leaq 0x226553(%rip), %rax    # 0x2f71d8
movl $0x80, %ecx
andl (%rax), %ecx
leaq 0x22654d(%rip), %rax    # 0x2f71e0
movl %ecx, (%rax)
leaq 0x22654d(%rip), %rax    # 0x2f71e9
cmpb $0x0, (%rax)
leaq 0x226a0a(%rip), %r15    # 0x2f76b0
je 0xd0cc7
cmpl $0x4, (%r15)
jne 0xd0cc7
movb $0x0, (%rax)
cmpb $0x0, (%rbx)
jne 0xd0d18
leaq 0x229fe(%rip), %rdi     # 0xf36bb
pushq $0x1
popq %rsi
callq 0x9c78
jmp 0xd0d18
leaq 0x226846(%rip), %rbx    # 0x2f7514
movl (%rbx), %eax
movl %eax, %ecx
subl 0x83e3c(%rip), %ecx     # 0x154b14
cmpl $0x1, %ecx
jne 0xd0d12
leaq 0x22682c(%rip), %rax    # 0x2f7510
cmpl $0x1, (%rax)
jne 0xd0d18
leaq 0x22681c(%rip), %rax    # 0x2f750c
cmpl $0x1, (%rax)
jne 0xd0d18
leaq 0x226804(%rip), %rax    # 0x2f7500
cmpl $0x0, (%rax)
jle 0xd0d18
leaq 0x4ce75(%rip), %rdi     # 0x11db7d
pushq $0x1
popq %rsi
callq 0x9c78
movl (%rbx), %eax
movl %eax, 0x83dfc(%rip)     # 0x154b14
callq 0xcf9e6
cmpb $0x0, (%r14)
je 0xd0fed
leaq 0x2271da(%rip), %rbx    # 0x2f7f08
movq (%rbx), %rax
testq %rax, %rax
je 0xd0d70
decq %rax
movq %rax, (%rbx)
jne 0xd0d70
leaq 0x227203(%rip), %rax    # 0x2f7f48
orb $0x4, (%rax)
callq 0xcfb33
leaq 0x2271c6(%rip), %rax    # 0x2f7f1a
movb $0x0, (%rax)
leaq 0x2271ba(%rip), %rax    # 0x2f7f18
cmpb $0x0, (%rax)
je 0xd0d70
leaq 0x2271a6(%rip), %rax    # 0x2f7f10
movq (%rax), %rax
movq %rax, (%rbx)
leaq 0x227209(%rip), %rax    # 0x2f7f80
movq (%rax), %rcx
testq %rcx, %rcx
je 0xd0daa
decq %rcx
movq %rcx, (%rax)
jne 0xd0daa
leaq 0x22720c(%rip), %rcx    # 0x2f7f9a
orb $0x4, (%rcx)
leaq 0x227200(%rip), %rcx    # 0x2f7f98
cmpb $0x0, (%rcx)
je 0xd0daa
leaq 0x2271e4(%rip), %rcx    # 0x2f7f88
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x227227(%rip), %rax    # 0x2f7fd8
movq (%rax), %rcx
testq %rcx, %rcx
je 0xd0de4
decq %rcx
movq %rcx, (%rax)
jne 0xd0de4
leaq 0x22722a(%rip), %rcx    # 0x2f7ff2
orb $0x4, (%rcx)
leaq 0x22721e(%rip), %rcx    # 0x2f7ff0
cmpb $0x0, (%rcx)
je 0xd0de4
leaq 0x227202(%rip), %rcx    # 0x2f7fe0
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x227275(%rip), %rax    # 0x2f8060
movq (%rax), %rcx
testq %rcx, %rcx
je 0xd0e1e
decq %rcx
movq %rcx, (%rax)
jne 0xd0e1e
leaq 0x227270(%rip), %rcx    # 0x2f8072
orb $0x4, (%rcx)
leaq 0x227264(%rip), %rcx    # 0x2f8070
cmpb $0x0, (%rcx)
je 0xd0e1e
leaq 0x227250(%rip), %rcx    # 0x2f8068
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x22727b(%rip), %rax    # 0x2f80a0
movq (%rax), %rcx
testq %rcx, %rcx
je 0xd0e58
decq %rcx
movq %rcx, (%rax)
jne 0xd0e58
leaq 0x227276(%rip), %rcx    # 0x2f80b2
orb $0x4, (%rcx)
leaq 0x22726a(%rip), %rcx    # 0x2f80b0
cmpb $0x0, (%rcx)
je 0xd0e58
leaq 0x227256(%rip), %rcx    # 0x2f80a8
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x2270e9(%rip), %r15    # 0x2f7f48
movb (%r15), %al
testb %al, %al
je 0xd0f20
testb $0x2, %al
je 0xd0e96
leaq 0x2270cb(%rip), %rcx    # 0x2f7f40
movsd (%rcx), %xmm0
addsd 0x221ef(%rip), %xmm0    # 0xf3070
movsd %xmm0, (%rcx)
cmpb $0x2, %al
jne 0xd0e91
callq 0xcfae4
movb (%r15), %al
andb $-0x3, %al
movb %al, (%r15)
leaq 0x22707d(%rip), %rax    # 0x2f7f1a
movb $0x0, (%rax)
callq 0x9d7e
leaq 0x22709d(%rip), %rax    # 0x2f7f49
cmpb $0x0, (%rax)
je 0xd0ef8
testb $0x1, (%r15)
je 0xd0eef
leaq 0x22706e(%rip), %rax    # 0x2f7f2c
andl $0x0, (%rax)
leaq 0x227054(%rip), %rax    # 0x2f7f1c
andl $0x0, (%rax)
leaq 0x22706e(%rip), %rax    # 0x2f7f40
andq $0x0, (%rax)
leaq 0x227033(%rip), %rax    # 0x2f7f10
andq $0x0, (%rax)
andq $0x0, (%rbx)
leaq 0x22702c(%rip), %rax    # 0x2f7f18
movb $0x0, (%rax)
callq 0xcfae4
movb $0x0, (%r15)
leaq 0x15803f(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0xd0f20
leaq 0x225f7d(%rip), %rax    # 0x2f6e88
movb $0x0, (%rax)
leaq 0x225fb3(%rip), %rax    # 0x2f6ec8
andq $0x0, (%rax)
xorl %edi, %edi
callq 0x71025
leaq 0x22714b(%rip), %rbx    # 0x2f8072
movb (%rbx), %al
testb %al, %al
je 0xd0f57
testb $0x2, %al
je 0xd0f48
leaq 0x227120(%rip), %rax    # 0x2f8058
movsd (%rax), %xmm0
addsd 0x2212c(%rip), %xmm0    # 0xf3070
movsd %xmm0, (%rax)
leaq 0x4cc43(%rip), %rdi     # 0x11db92
callq 0x1bfce
movb $0x0, (%rbx)
leaq 0x227154(%rip), %rbx    # 0x2f80b2
movb (%rbx), %al
testb %al, %al
je 0xd0f87
testb $0x2, %al
je 0xd0f7f
leaq 0x227129(%rip), %rax    # 0x2f8098
movsd (%rax), %xmm0
addsd 0x220f5(%rip), %xmm0    # 0xf3070
movsd %xmm0, (%rax)
callq 0xa0fd
movb $0x0, (%rbx)
leaq 0x22700c(%rip), %r15    # 0x2f7f9a
movb (%r15), %al
testb %al, %al
je 0xd10df
testb $0x2, %al
je 0xd0fb4
leaq 0x226fcc(%rip), %rax    # 0x2f7f70
movsd (%rax), %xmm0
addsd 0x220c0(%rip), %xmm0    # 0xf3070
movsd %xmm0, (%rax)
leaq 0x226fd5(%rip), %rbx    # 0x2f7f90
incq (%rbx)
callq 0xcf9e6
leaq 0x226fcf(%rip), %rax    # 0x2f7f99
cmpb $0x0, (%rax)
je 0xd1048
leaq 0x4cbc6(%rip), %rsi     # 0x11db9c
leaq 0x2271e3(%rip), %rdx    # 0x2f81c0
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
jmp 0xd1086
leaq 0x226eed(%rip), %rax    # 0x2f7ee1
cmpb $0x0, (%rax)
setne %cl
movl (%r15), %eax
testl %eax, %eax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xd11b6
leaq 0x226698(%rip), %rax    # 0x2f76ac
movl (%rax), %eax
cmpl $0x1e, %eax
je 0xd1023
testl %eax, %eax
jne 0xd0d27
callq 0xd0956
leaq 0x226eb5(%rip), %rcx    # 0x2f7ee4
movl %eax, (%rcx)
testl %eax, %eax
js 0xd0d27
leaq 0x226ea8(%rip), %rax    # 0x2f7ee8
andl $0x0, (%rax)
jmp 0xd0d27
leaq 0x226655(%rip), %rax    # 0x2f76a4
movl (%rax), %ecx
leaq 0x226644(%rip), %rax    # 0x2f769c
movl (%rax), %r8d
leaq 0x22663e(%rip), %rax    # 0x2f76a0
movl (%rax), %r9d
subq $0x8, %rsp
leaq 0x4cb33(%rip), %rsi     # 0x11dba3
leaq 0x227149(%rip), %rdx    # 0x2f81c0
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
pushq (%rbx)
callq 0x9060
popq %rcx
popq %rdx
leaq 0x227033(%rip), %rdi    # 0x2f80c0
leaq 0x3a26f(%rip), %rsi     # 0x10b303
callq 0x9a22
testq %rax, %rax
je 0xd10b4
movq %rax, %rbx
pushq $0x31
popq %rdi
movq %rax, %rsi
callq 0x9480
movq %rbx, %rdi
callq 0x9360
leaq 0x131779(%rip), %rax    # 0x202834
movl (%rax), %edi
leaq 0x13177c(%rip), %rax    # 0x202840
movl (%rax), %esi
leaq -0x40(%rbp), %rdx
callq 0xf1b3
leaq 0x226fea(%rip), %rdi    # 0x2f80c0
callq 0xa15d
movb $0x0, (%r15)
leaq 0x226f0c(%rip), %r15    # 0x2f7ff2
movb (%r15), %al
testb %al, %al
je 0xd1289
leaq 0x157310(%rip), %rcx    # 0x228408
cmpl $0x0, (%rcx)
jne 0xd1289
testb $0x2, %al
je 0xd111c
leaq 0x226ebc(%rip), %rax    # 0x2f7fc8
movsd (%rax), %xmm0
addsd 0x21f58(%rip), %xmm0    # 0xf3070
movsd %xmm0, (%rax)
leaq 0x226ec5(%rip), %r12    # 0x2f7fe8
incq (%r12)
callq 0xcf9e6
leaq 0x226e68(%rip), %rax    # 0x2f7f9b
leaq 0x226e62(%rip), %rcx    # 0x2f7f9c
cmpb $0x0, (%rcx)
leaq 0x23ccd(%rip), %rcx     # 0xf4e11
leaq 0x46312(%rip), %rdx     # 0x11745d
cmoveq %rcx, %rdx
cmpb $0x0, (%rax)
leaq 0x36fbc(%rip), %rbx     # 0x108115
cmoveq %rdx, %rbx
leaq 0x226e8d(%rip), %rax    # 0x2f7ff1
cmpb $0x0, (%rax)
je 0xd1222
leaq 0x22704c(%rip), %rdi    # 0x2f81c0
leaq 0x23c74(%rip), %rsi     # 0xf4def
pushq $0x3
popq %rdx
callq 0x9380
leaq 0x89afe(%rip), %rcx     # 0x15ac88
movq (%rcx), %rcx
testl %eax, %eax
je 0xd1261
leaq 0x4ca1c(%rip), %rsi     # 0x11dbb8
leaq 0x22701d(%rip), %rdx    # 0x2f81c0
leaq -0x40(%rbp), %rdi
movq %rbx, %r8
xorl %eax, %eax
callq 0x9060
jmp 0xd1279
testl %eax, %eax
sete %al
leaq 0x226d1a(%rip), %rcx    # 0x2f7edc
movb (%rcx), %dl
testb %dl, %dl
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xd0d27
leaq 0x226d03(%rip), %rax    # 0x2f7ede
movb (%rax), %sil
testb %sil, %sil
setne %al
leaq 0x2264c1(%rip), %rcx    # 0x2f76ac
movl (%rcx), %ecx
testl %ecx, %ecx
sete %dil
andb %al, %dil
cmpb $0x1, %dil
jne 0xd12e2
leaq 0x2264a1(%rip), %rax    # 0x2f76a8
movl (%rax), %eax
pushq $0xc
popq %rcx
cltd
idivl %ecx
testb %dl, %dl
cmovel %ecx, %edx
leaq 0x226cc4(%rip), %rax    # 0x2f7edf
movb %dl, (%rax)
jmp 0xd0d27
leaq 0x22647b(%rip), %rax    # 0x2f76a4
movl (%rax), %ecx
leaq 0x22646a(%rip), %rax    # 0x2f769c
movl (%rax), %r8d
leaq 0x226464(%rip), %rax    # 0x2f76a0
movl (%rax), %r9d
leaq 0x4c979(%rip), %rsi     # 0x11dbbf
leaq 0x226f73(%rip), %rdx    # 0x2f81c0
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
pushq %rbx
pushq (%r12)
callq 0x9060
popq %rcx
popq %rdx
jmp 0xd1279
leaq 0x243ad(%rip), %rsi     # 0xf5615
leaq -0x40(%rbp), %rdi
movq %rcx, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x9060
leaq -0x40(%rbp), %rdi
pushq $0x71
popq %rsi
callq 0xc00e0
movb $0x0, (%r15)
cmpb $0x0, (%r14)
jne 0xd12d5
leaq 0x226c4b(%rip), %rax    # 0x2f7ee1
cmpb $0x0, (%rax)
je 0xd12ba
leaq 0x226c42(%rip), %rax    # 0x2f7ee4
cmpl $0x0, (%rax)
js 0xd12ba
leaq 0x226c3a(%rip), %rax    # 0x2f7ee8
cmpl $0xb, (%rax)
ja 0xd12ba
callq 0x9dcc
jmp 0xd12d5
leaq 0x226c1e(%rip), %rbx    # 0x2f7edf
cmpb $0x0, (%rbx)
je 0xd12d5
callq 0x9dcc
movb (%rbx), %al
testb %al, %al
je 0xd12d5
decb %al
movb %al, (%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
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 0xd0d27
testb %sil, %sil
je 0xd1317
leaq 0x226bda(%rip), %rax    # 0x2f7edf
movb $0x1, (%rax)
jmp 0xd0d27
movl $0xc8, %edi
jmp 0xd0c58
testl %ecx, %ecx
je 0xd132f
cmpl $0x1e, %ecx
jne 0xd12fe
leaq 0x226bb8(%rip), %rax    # 0x2f7edf
movb $0x2, (%rax)
jmp 0xd0d27
leaq 0x226ba9(%rip), %rax    # 0x2f7edf
movb $0x3, (%rax)
jmp 0xd0d27