// File: 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
subq $0x50, %rsp
leaq 0x234f99(%rip), %rax    # 0x36c728
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x142d97(%rip), %rax    # 0x27a538
movsd (%rax), %xmm0
movsd 0x378bb(%rip), %xmm1    # 0x16f068
ucomisd %xmm1, %xmm0
jne 0x1377b7
jp 0x1377b7
jmp 0x1377dc
leaq 0x2350d2(%rip), %rax    # 0x36c890
movl (%rax), %eax
cmpl 0x9235a(%rip), %eax     # 0x1c9b20
jne 0x1377cd
jmp 0x138484
leaq 0x2350bc(%rip), %rax    # 0x36c890
movl (%rax), %eax
movl %eax, 0x92344(%rip)     # 0x1c9b20
leaq 0x266ccd(%rip), %rax    # 0x39e4b0
cmpb $0x0, (%rax)
jne 0x13780c
leaq 0x235099(%rip), %rax    # 0x36c888
cmpl $0x0, (%rax)
jne 0x13782d
leaq 0x235091(%rip), %rax    # 0x36c88c
cmpl $0x0, (%rax)
jne 0x13782d
leaq 0x235089(%rip), %rax    # 0x36c890
cmpl $0xc, (%rax)
jne 0x13782d
callq 0x138490
leaq 0x266c98(%rip), %rax    # 0x39e4b0
movb $0x0, (%rax)
leaq 0x234f06(%rip), %rax    # 0x36c728
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x235c71(%rip), %rax    # 0x36d4a5
cmpb $0x0, (%rax)
je 0x13791f
leaq 0x234f54(%rip), %rax    # 0x36c798
cmpl $0x0, (%rax)
je 0x13791f
leaq 0x142bc3(%rip), %rax    # 0x27a417
cmpb $0x0, (%rax)
jne 0x13791f
leaq 0x234fc4(%rip), %rax    # 0x36c828
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1378bd
leaq 0x235013(%rip), %rax    # 0x36c888
movl (%rax), %eax
leaq 0x234f62(%rip), %rcx    # 0x36c7e0
cmpl (%rcx), %eax
jne 0x1378bd
leaq 0x235003(%rip), %rax    # 0x36c88c
movl (%rax), %eax
leaq 0x234f52(%rip), %rcx    # 0x36c7e4
cmpl (%rcx), %eax
jne 0x1378bd
leaq 0x234ff3(%rip), %rax    # 0x36c890
movl (%rax), %eax
leaq 0x234f42(%rip), %rcx    # 0x36c7e8
cmpl (%rcx), %eax
jne 0x1378bd
leaq 0x37b1a(%rip), %rdi     # 0x16f3cb
movl $0x1, %esi
callq 0x9de0
jmp 0x13791d
leaq 0x234f64(%rip), %rax    # 0x36c828
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x13791b
leaq 0x234fb3(%rip), %rax    # 0x36c888
movl (%rax), %eax
leaq 0x234f32(%rip), %rcx    # 0x36c810
cmpl (%rcx), %eax
jne 0x13791b
leaq 0x234fa3(%rip), %rax    # 0x36c88c
movl (%rax), %eax
leaq 0x234f22(%rip), %rcx    # 0x36c814
cmpl (%rcx), %eax
jne 0x13791b
leaq 0x234f93(%rip), %rax    # 0x36c890
movl (%rax), %eax
leaq 0x234f12(%rip), %rcx    # 0x36c818
cmpl (%rcx), %eax
jne 0x13791b
leaq 0x37aba(%rip), %rdi     # 0x16f3cb
movl $0x1, %esi
callq 0x9de0
jmp 0x13791d
jmp 0x13791f
leaq 0x235b80(%rip), %rax    # 0x36d4a6
cmpb $0x0, (%rax)
je 0x1379a3
leaq 0x234e66(%rip), %rax    # 0x36c798
cmpl $0x0, (%rax)
je 0x1379a3
leaq 0x142ad9(%rip), %rax    # 0x27a417
cmpb $0x0, (%rax)
jne 0x1379a3
leaq 0x234ede(%rip), %rax    # 0x36c828
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1379a1
leaq 0x234f2d(%rip), %rax    # 0x36c888
movl (%rax), %eax
leaq 0x234ee4(%rip), %rcx    # 0x36c848
cmpl (%rcx), %eax
jne 0x1379a1
leaq 0x234f1d(%rip), %rax    # 0x36c88c
movl (%rax), %eax
leaq 0x234ed4(%rip), %rcx    # 0x36c84c
cmpl (%rcx), %eax
jne 0x1379a1
leaq 0x234f0d(%rip), %rax    # 0x36c890
movl (%rax), %eax
leaq 0x234ec4(%rip), %rcx    # 0x36c850
cmpl (%rcx), %eax
jne 0x1379a1
leaq 0x37a48(%rip), %rdi     # 0x16f3df
movl $0x1, %esi
callq 0x9de0
jmp 0x1379a3
leaq 0x235722(%rip), %rax    # 0x36d0cc
cmpb $0x0, (%rax)
je 0x137b4c
leaq 0x235716(%rip), %rax    # 0x36d0d0
cmpl $0x0, (%rax)
je 0x137aa5
leaq 0x23570e(%rip), %rax    # 0x36d0d8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1379dc
callq 0x2bc30
callq 0xb630
leaq 0x234d10(%rip), %rax    # 0x36c6f8
movsd (%rax), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x37625(%rip), %xmm2    # 0x16f030
mulsd %xmm2, %xmm1
addsd %xmm2, %xmm1
xorps %xmm2, %xmm2
subsd %xmm2, %xmm1
addsd %xmm1, %xmm0
leaq 0x2356b3(%rip), %rax    # 0x36d0d8
movsd %xmm0, (%rax)
xorps %xmm0, %xmm0
leaq 0x2356a5(%rip), %rax    # 0x36d0d8
ucomisd (%rax), %xmm0
jbe 0x137a49
callq 0xb630
leaq 0x235693(%rip), %rax    # 0x36d0d8
movsd %xmm0, (%rax)
leaq 0x235690(%rip), %rax    # 0x36d0e0
movl $0x0, (%rax)
leaq 0x23564b(%rip), %rax    # 0x36d0a8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x137a85
leaq 0x234c6f(%rip), %rax    # 0x36c6e0
cmpl $0x3b, (%rax)
jne 0x137a83
leaq 0x235663(%rip), %rax    # 0x36d0e0
movl $0x1, (%rax)
jmp 0x137aa0
leaq 0x234c54(%rip), %rax    # 0x36c6e0
cmpl $0x3b, (%rax)
jne 0x137a9e
leaq 0x235648(%rip), %rax    # 0x36d0e0
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0x137aa0
jmp 0x137b4a
leaq 0x234c34(%rip), %rax    # 0x36c6e0
cmpl $0x0, (%rax)
jne 0x137ac0
leaq 0x235614(%rip), %rax    # 0x36d0cc
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x137b1d
leaq 0x235605(%rip), %rax    # 0x36d0cc
movzbl (%rax), %eax
cmpl $0x2, %eax
je 0x137b1b
leaq 0x2359cc(%rip), %rax    # 0x36d4a2
cmpb $0x0, (%rax)
je 0x137aee
leaq 0x37944(%rip), %rdi     # 0x16f426
movl $0x1, %esi
callq 0x9de0
jmp 0x137b19
leaq 0x2359b3(%rip), %rax    # 0x36d4a8
cmpb $0x0, (%rax)
je 0x137b0d
leaq 0x37900(%rip), %rdi     # 0x16f401
movl $0x1, %esi
callq 0x9de0
jmp 0x137b17
movl $0xc8, %edi
callq 0x9ec0
jmp 0x137b19
jmp 0x137b1b
jmp 0x137b48
leaq 0x23597d(%rip), %rax    # 0x36d4a1
cmpb $0x0, (%rax)
je 0x137b3c
leaq 0x378e3(%rip), %rdi     # 0x16f413
movl $0x1, %esi
callq 0x9de0
jmp 0x137b46
movl $0xc9, %edi
callq 0x9ec0
jmp 0x137b48
jmp 0x137b4a
jmp 0x137b4c
leaq 0x234865(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $0x80, %ecx
leaq 0x23485e(%rip), %rax    # 0x36c3c0
movl %ecx, (%rax)
leaq 0x23485e(%rip), %rax    # 0x36c3c9
cmpb $0x0, (%rax)
je 0x137ba5
leaq 0x234d19(%rip), %rax    # 0x36c890
cmpl $0x4, (%rax)
jne 0x137ba5
leaq 0x234846(%rip), %rax    # 0x36c3c9
movb $0x0, (%rax)
leaq 0x14288a(%rip), %rax    # 0x27a417
cmpb $0x0, (%rax)
jne 0x137ba3
leaq 0x3781e(%rip), %rdi     # 0x16f3b7
movl $0x1, %esi
callq 0x9de0
jmp 0x137c10
leaq 0x234b48(%rip), %rax    # 0x36c6f4
movl (%rax), %eax
subl 0x91f70(%rip), %eax     # 0x1c9b24
cmpl $0x1, %eax
jne 0x137bff
leaq 0x234b30(%rip), %rax    # 0x36c6f0
cmpl $0x1, (%rax)
jne 0x137bfd
leaq 0x234b20(%rip), %rax    # 0x36c6ec
cmpl $0x1, (%rax)
jne 0x137bfd
leaq 0x234b08(%rip), %rax    # 0x36c6e0
cmpl $0x0, (%rax)
jle 0x137bfd
leaq 0x5ec0b(%rip), %rdi     # 0x1967ef
movl $0x1, %esi
callq 0x9de0
leaq 0x234aff(%rip), %rax    # 0x36c6f4
movl (%rax), %eax
movl %eax, 0x91f27(%rip)     # 0x1c9b24
jmp 0x137c0e
leaq 0x234aee(%rip), %rax    # 0x36c6f4
movl (%rax), %eax
movl %eax, 0x91f16(%rip)     # 0x1c9b24
jmp 0x137c10
callq 0x135fa0
leaq 0x2354b0(%rip), %rax    # 0x36d0cc
cmpb $0x0, (%rax)
je 0x137c26
jmp 0x137d83
leaq 0x235494(%rip), %rax    # 0x36d0c1
cmpb $0x0, (%rax)
je 0x137c86
leaq 0x234c57(%rip), %rax    # 0x36c890
cmpl $0x0, (%rax)
jne 0x137c86
leaq 0x234c47(%rip), %rax    # 0x36c88c
cmpl $0x0, (%rax)
je 0x137c56
leaq 0x234c3b(%rip), %rax    # 0x36c88c
cmpl $0x1e, (%rax)
jne 0x137c81
callq 0x137720
movl %eax, %ecx
leaq 0x235460(%rip), %rax    # 0x36d0c4
movl %ecx, (%rax)
leaq 0x235457(%rip), %rax    # 0x36d0c4
cmpl $0x0, (%rax)
jl 0x137c7f
leaq 0x23544f(%rip), %rax    # 0x36d0c8
movl $0x0, (%rax)
jmp 0x137c81
jmp 0x137d81
leaq 0x23542f(%rip), %rax    # 0x36d0bc
cmpb $0x0, (%rax)
je 0x137d7f
leaq 0x234bf3(%rip), %rax    # 0x36c890
cmpl $0x0, (%rax)
jne 0x137d7f
leaq 0x235411(%rip), %rax    # 0x36d0be
cmpb $0x0, (%rax)
je 0x137cf8
leaq 0x234bd3(%rip), %rax    # 0x36c88c
cmpl $0x0, (%rax)
jne 0x137cf8
leaq 0x234bc3(%rip), %rax    # 0x36c888
movl (%rax), %eax
movl $0xc, %ecx
cltd
idivl %ecx
movb %dl, %cl
leaq 0x2353e7(%rip), %rax    # 0x36d0bf
movb %cl, (%rax)
leaq 0x2353de(%rip), %rax    # 0x36d0bf
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x137cf3
leaq 0x2353cf(%rip), %rax    # 0x36d0bf
movb $0xc, (%rax)
jmp 0x137d7d
leaq 0x234b8d(%rip), %rax    # 0x36c88c
movl (%rax), %eax
movl %eax, -0x34(%rbp)
leaq 0x2353b1(%rip), %rax    # 0x36d0bc
movzbl (%rax), %ecx
movl $0x3c, %eax
cltd
idivl %ecx
movl %eax, %ecx
movl -0x34(%rbp), %eax
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x137d7b
leaq 0x235394(%rip), %rax    # 0x36d0be
cmpb $0x0, (%rax)
je 0x137d3b
leaq 0x235389(%rip), %rax    # 0x36d0bf
movb $0x1, (%rax)
jmp 0x137d79
leaq 0x234b4a(%rip), %rax    # 0x36c88c
cmpl $0x0, (%rax)
jne 0x137d53
leaq 0x235371(%rip), %rax    # 0x36d0bf
movb $0x3, (%rax)
jmp 0x137d77
leaq 0x234b32(%rip), %rax    # 0x36c88c
cmpl $0x1e, (%rax)
jne 0x137d6b
leaq 0x235359(%rip), %rax    # 0x36d0bf
movb $0x2, (%rax)
jmp 0x137d75
leaq 0x23534d(%rip), %rax    # 0x36d0bf
movb $0x1, (%rax)
jmp 0x137d77
jmp 0x137d79
jmp 0x137d7b
jmp 0x137d7d
jmp 0x137d7f
jmp 0x137d81
jmp 0x137d83
leaq 0x23535e(%rip), %rax    # 0x36d0e8
cmpq $0x0, (%rax)
je 0x137df9
leaq 0x235351(%rip), %rax    # 0x36d0e8
movq (%rax), %rax
addq $-0x1, %rax
leaq 0x235343(%rip), %rcx    # 0x36d0e8
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x137df7
leaq 0x235373(%rip), %rax    # 0x36d128
movzbl (%rax), %eax
orl $0x4, %eax
movb %al, %cl
leaq 0x235364(%rip), %rax    # 0x36d128
movb %cl, (%rax)
callq 0x136120
leaq 0x235328(%rip), %rax    # 0x36d0fa
movb $0x0, (%rax)
leaq 0x23531c(%rip), %rax    # 0x36d0f8
cmpb $0x0, (%rax)
je 0x137df5
leaq 0x235308(%rip), %rax    # 0x36d0f0
movq (%rax), %rcx
leaq 0x2352f6(%rip), %rax    # 0x36d0e8
movq %rcx, (%rax)
jmp 0x137df7
jmp 0x137df9
leaq 0x235360(%rip), %rax    # 0x36d160
cmpq $0x0, (%rax)
je 0x137e60
leaq 0x235353(%rip), %rax    # 0x36d160
movq (%rax), %rax
addq $-0x1, %rax
leaq 0x235345(%rip), %rcx    # 0x36d160
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x137e5e
leaq 0x23534f(%rip), %rax    # 0x36d17a
movzbl (%rax), %eax
orl $0x4, %eax
movb %al, %cl
leaq 0x235340(%rip), %rax    # 0x36d17a
movb %cl, (%rax)
leaq 0x235335(%rip), %rax    # 0x36d178
cmpb $0x0, (%rax)
je 0x137e5c
leaq 0x235319(%rip), %rax    # 0x36d168
movq (%rax), %rcx
leaq 0x235307(%rip), %rax    # 0x36d160
movq %rcx, (%rax)
jmp 0x137e5e
jmp 0x137e60
leaq 0x235351(%rip), %rax    # 0x36d1b8
cmpq $0x0, (%rax)
je 0x137ec7
leaq 0x235344(%rip), %rax    # 0x36d1b8
movq (%rax), %rax
addq $-0x1, %rax
leaq 0x235336(%rip), %rcx    # 0x36d1b8
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x137ec5
leaq 0x235340(%rip), %rax    # 0x36d1d2
movzbl (%rax), %eax
orl $0x4, %eax
movb %al, %cl
leaq 0x235331(%rip), %rax    # 0x36d1d2
movb %cl, (%rax)
leaq 0x235326(%rip), %rax    # 0x36d1d0
cmpb $0x0, (%rax)
je 0x137ec3
leaq 0x23530a(%rip), %rax    # 0x36d1c0
movq (%rax), %rcx
leaq 0x2352f8(%rip), %rax    # 0x36d1b8
movq %rcx, (%rax)
jmp 0x137ec5
jmp 0x137ec7
leaq 0x235372(%rip), %rax    # 0x36d240
cmpq $0x0, (%rax)
je 0x137f2e
leaq 0x235365(%rip), %rax    # 0x36d240
movq (%rax), %rax
addq $-0x1, %rax
leaq 0x235357(%rip), %rcx    # 0x36d240
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x137f2c
leaq 0x235359(%rip), %rax    # 0x36d252
movzbl (%rax), %eax
orl $0x4, %eax
movb %al, %cl
leaq 0x23534a(%rip), %rax    # 0x36d252
movb %cl, (%rax)
leaq 0x23533f(%rip), %rax    # 0x36d250
cmpb $0x0, (%rax)
je 0x137f2a
leaq 0x23532b(%rip), %rax    # 0x36d248
movq (%rax), %rcx
leaq 0x235319(%rip), %rax    # 0x36d240
movq %rcx, (%rax)
jmp 0x137f2c
jmp 0x137f2e
leaq 0x23534b(%rip), %rax    # 0x36d280
cmpq $0x0, (%rax)
je 0x137f95
leaq 0x23533e(%rip), %rax    # 0x36d280
movq (%rax), %rax
addq $-0x1, %rax
leaq 0x235330(%rip), %rcx    # 0x36d280
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x137f93
leaq 0x235332(%rip), %rax    # 0x36d292
movzbl (%rax), %eax
orl $0x4, %eax
movb %al, %cl
leaq 0x235323(%rip), %rax    # 0x36d292
movb %cl, (%rax)
leaq 0x235318(%rip), %rax    # 0x36d290
cmpb $0x0, (%rax)
je 0x137f91
leaq 0x235304(%rip), %rax    # 0x36d288
movq (%rax), %rcx
leaq 0x2352f2(%rip), %rax    # 0x36d280
movq %rcx, (%rax)
jmp 0x137f93
jmp 0x137f95
leaq 0x23518c(%rip), %rax    # 0x36d128
cmpb $0x0, (%rax)
je 0x1380b8
leaq 0x23517c(%rip), %rax    # 0x36d128
movzbl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x138001
movsd 0x370a9(%rip), %xmm0    # 0x16f068
leaq 0x23515a(%rip), %rax    # 0x36d120
addsd (%rax), %xmm0
leaq 0x23514f(%rip), %rax    # 0x36d120
movsd %xmm0, (%rax)
leaq 0x23514c(%rip), %rax    # 0x36d128
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x137fe9
callq 0x1360d0
leaq 0x235138(%rip), %rax    # 0x36d128
movzbl (%rax), %eax
andl $-0x3, %eax
movb %al, %cl
leaq 0x235129(%rip), %rax    # 0x36d128
movb %cl, (%rax)
leaq 0x2350f2(%rip), %rax    # 0x36d0fa
movb $0x0, (%rax)
callq 0x9f20
leaq 0x235112(%rip), %rax    # 0x36d129
cmpb $0x0, (%rax)
je 0x13808b
leaq 0x235105(%rip), %rax    # 0x36d128
movzbl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13807c
leaq 0x2350d7(%rip), %rax    # 0x36d10c
movl $0x0, (%rax)
leaq 0x2350ba(%rip), %rax    # 0x36d0fc
movl $0x0, (%rax)
leaq 0x2350d1(%rip), %rax    # 0x36d120
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x235093(%rip), %rax    # 0x36d0f0
movq $0x0, (%rax)
leaq 0x23507d(%rip), %rax    # 0x36d0e8
movq $0x0, (%rax)
leaq 0x23507f(%rip), %rax    # 0x36d0f8
movb $0x0, (%rax)
callq 0x1360d0
leaq 0x2350a0(%rip), %rax    # 0x36d128
movb $0x0, (%rax)
leaq 0x16608c(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x1380b6
leaq 0x233fca(%rip), %rax    # 0x36c068
movb $0x0, (%rax)
leaq 0x234000(%rip), %rax    # 0x36c0a8
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
xorl %edi, %edi
callq 0xaa160
jmp 0x1380b8
leaq 0x235193(%rip), %rax    # 0x36d252
cmpb $0x0, (%rax)
je 0x13810a
leaq 0x235187(%rip), %rax    # 0x36d252
movzbl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1380f4
movsd 0x36f8a(%rip), %xmm0    # 0x16f068
leaq 0x235153(%rip), %rax    # 0x36d238
addsd (%rax), %xmm0
leaq 0x235148(%rip), %rax    # 0x36d238
movsd %xmm0, (%rax)
leaq 0x5e709(%rip), %rdi     # 0x196804
callq 0x29570
leaq 0x23514b(%rip), %rax    # 0x36d252
movb $0x0, (%rax)
leaq 0x235181(%rip), %rax    # 0x36d292
cmpb $0x0, (%rax)
je 0x138155
leaq 0x235175(%rip), %rax    # 0x36d292
movzbl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x138146
movsd 0x36f38(%rip), %xmm0    # 0x16f068
leaq 0x235141(%rip), %rax    # 0x36d278
addsd (%rax), %xmm0
leaq 0x235136(%rip), %rax    # 0x36d278
movsd %xmm0, (%rax)
callq 0xa3b0
leaq 0x235140(%rip), %rax    # 0x36d292
movb $0x0, (%rax)
leaq 0x23501e(%rip), %rax    # 0x36d17a
cmpb $0x0, (%rax)
je 0x138287
leaq 0x23500e(%rip), %rax    # 0x36d17a
movzbl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x138195
movsd 0x36ee9(%rip), %xmm0    # 0x16f068
leaq 0x234fca(%rip), %rax    # 0x36d150
addsd (%rax), %xmm0
leaq 0x234fbf(%rip), %rax    # 0x36d150
movsd %xmm0, (%rax)
leaq 0x234fd4(%rip), %rax    # 0x36d170
movq (%rax), %rcx
addq $0x1, %rcx
leaq 0x234fc6(%rip), %rax    # 0x36d170
movq %rcx, (%rax)
callq 0x135fa0
leaq 0x234fc0(%rip), %rax    # 0x36d179
cmpb $0x0, (%rax)
je 0x1381d9
leaq -0x20(%rbp), %rdi
leaq 0x5e645(%rip), %rsi     # 0x19680e
leaq 0x2351d0(%rip), %rdx    # 0x36d3a0
movb $0x0, %al
callq 0x9060
jmp 0x13821d
leaq -0x20(%rbp), %rdi
leaq 0x2346a0(%rip), %rax    # 0x36c884
movl (%rax), %ecx
leaq 0x23468f(%rip), %rax    # 0x36c87c
movl (%rax), %r8d
leaq 0x234689(%rip), %rax    # 0x36c880
movl (%rax), %r9d
leaq 0x234f6f(%rip), %rax    # 0x36d170
movq (%rax), %rax
leaq 0x5e60a(%rip), %rsi     # 0x196815
leaq 0x23518e(%rip), %rdx    # 0x36d3a0
movq %rax, (%rsp)
movb $0x0, %al
callq 0x9060
leaq 0x23507c(%rip), %rdi    # 0x36d2a0
leaq 0x4c420(%rip), %rsi     # 0x18464b
callq 0x9b20
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x138256
movq -0x28(%rbp), %rdi
leaq 0x5e1df(%rip), %rsi     # 0x196425
movb $0x0, %al
callq 0x9550
movq -0x28(%rbp), %rdi
callq 0x9380
leaq 0x13f7b7(%rip), %rax    # 0x277a14
movl (%rax), %edi
leaq 0x13f7ba(%rip), %rax    # 0x277a20
movl (%rax), %esi
leaq -0x20(%rbp), %rdx
callq 0x12810
leaq 0x235028(%rip), %rdi    # 0x36d2a0
callq 0xa430
leaq 0x234ef6(%rip), %rax    # 0x36d17a
movb $0x0, (%rax)
leaq 0x234f44(%rip), %rax    # 0x36d1d2
cmpb $0x0, (%rax)
je 0x138407
leaq 0x16534a(%rip), %rax    # 0x29d5e8
cmpl $0x0, (%rax)
jne 0x138407
leaq 0x234f24(%rip), %rax    # 0x36d1d2
movzbl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1382d7
movsd 0x36da7(%rip), %xmm0    # 0x16f068
leaq 0x234ee0(%rip), %rax    # 0x36d1a8
addsd (%rax), %xmm0
leaq 0x234ed5(%rip), %rax    # 0x36d1a8
movsd %xmm0, (%rax)
leaq 0x234eea(%rip), %rax    # 0x36d1c8
movq (%rax), %rcx
addq $0x1, %rcx
leaq 0x234edc(%rip), %rax    # 0x36d1c8
movq %rcx, (%rax)
callq 0x135fa0
leaq 0x234e80(%rip), %rax    # 0x36d17b
cmpb $0x0, (%rax)
je 0x13830d
leaq 0x4a7ae(%rip), %rax     # 0x182ab5
movq %rax, -0x30(%rbp)
jmp 0x138333
leaq 0x234e68(%rip), %rax    # 0x36d17c
cmpb $0x0, (%rax)
je 0x138326
leaq 0x57d19(%rip), %rax     # 0x190039
movq %rax, -0x30(%rbp)
jmp 0x138331
leaq 0x38a56(%rip), %rax     # 0x170d83
movq %rax, -0x30(%rbp)
jmp 0x138333
leaq 0x234e97(%rip), %rax    # 0x36d1d1
cmpb $0x0, (%rax)
je 0x1383a2
leaq 0x23505a(%rip), %rdi    # 0x36d3a0
leaq 0x38a14(%rip), %rsi     # 0x170d61
callq 0x9510
cmpl $0x0, %eax
jne 0x138379
leaq -0x20(%rbp), %rdi
leaq 0x97b06(%rip), %rax     # 0x1cfe68
movq (%rax), %rdx
movq -0x30(%rbp), %rcx
leaq 0x3921a(%rip), %rsi     # 0x17158a
movb $0x0, %al
callq 0x9060
jmp 0x1383a0
leaq -0x20(%rbp), %rdi
leaq 0x97ae4(%rip), %rax     # 0x1cfe68
movq (%rax), %rcx
movq -0x30(%rbp), %r8
leaq 0x5e498(%rip), %rsi     # 0x19682a
leaq 0x235007(%rip), %rdx    # 0x36d3a0
movb $0x0, %al
callq 0x9060
jmp 0x1383ef
leaq -0x20(%rbp), %rdi
leaq 0x2344d7(%rip), %rax    # 0x36c884
movl (%rax), %ecx
leaq 0x2344c6(%rip), %rax    # 0x36c87c
movl (%rax), %r8d
leaq 0x2344c0(%rip), %rax    # 0x36c880
movl (%rax), %r9d
leaq 0x234dfe(%rip), %rax    # 0x36d1c8
movq (%rax), %r10
movq -0x30(%rbp), %rax
leaq 0x5e459(%rip), %rsi     # 0x196831
leaq 0x234fc1(%rip), %rdx    # 0x36d3a0
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x9060
leaq -0x20(%rbp), %rdi
movl $0x71, %esi
callq 0x11e6e0
leaq 0x234dce(%rip), %rax    # 0x36d1d2
movb $0x0, (%rax)
leaq 0x234cbe(%rip), %rax    # 0x36d0cc
cmpb $0x0, (%rax)
je 0x138415
jmp 0x138484
leaq 0x234ca5(%rip), %rax    # 0x36d0c1
cmpb $0x0, (%rax)
je 0x13844c
leaq 0x234c9c(%rip), %rax    # 0x36d0c4
cmpl $0x0, (%rax)
jl 0x13844c
leaq 0x234c94(%rip), %rax    # 0x36d0c8
cmpl $0x0, (%rax)
jl 0x13844c
leaq 0x234c88(%rip), %rax    # 0x36d0c8
cmpl $0xc, (%rax)
jge 0x13844c
callq 0x9f90
jmp 0x138482
leaq 0x234c6c(%rip), %rax    # 0x36d0bf
cmpb $0x0, (%rax)
je 0x138480
callq 0x9f90
leaq 0x234c5b(%rip), %rax    # 0x36d0bf
cmpb $0x0, (%rax)
je 0x13847e
leaq 0x234c4f(%rip), %rax    # 0x36d0bf
movb (%rax), %cl
addb $-0x1, %cl
leaq 0x234c43(%rip), %rax    # 0x36d0bf
movb %cl, (%rax)
jmp 0x138480
jmp 0x138482
jmp 0x138484
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)