// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: draw_watch_outline()
void draw_watch_outline()
{
int x, y;
int x0, y0;
int theta;
int alarm_theta;
int alarm_ticks;
int timer_theta;
int timer_ticks;
double jd_timer;
int color;
int stem_size;
#define THETA_STEP 1
int old_time_color;

   // draw the watch outline
   old_time_color = time_color;
   if(eclipsed) time_color = YELLOW;

   alarm_ticks = 0;
   alarm_theta = (999);  // shut up compiler warnings

   if(1) ;  // use edge ticks
   else if(alarm_date || alarm_time) {  // highlight the alarm clock time
      alarm_theta = ((alarm_hh%WATCH_HOURS)*WATCH_STEP*2)+alarm_mm;
      alarm_theta /= 2;
      alarm_theta -= 90;
      alarm_theta -= (ALARM_WIDTH/2);
      while(alarm_theta < 0) alarm_theta += 360;
      alarm_theta %= 360;
      alarm_theta /= THETA_STEP;      // round to clockface drawing increment
      alarm_theta *= THETA_STEP;
      if(alarm_theta < ALARM_WIDTH) { // alarm spans 0/360 degrees
         alarm_ticks = ALARM_WIDTH;
      }
   }    

   timer_ticks = 0;
   timer_theta = (999);  // shut up compiler warnings 

   if(1) ;  // use edge ticks
   else if(egg_timer) {  // highlight the egg time time
      jd_timer = jd_local + jtime(0,0,0, (double) egg_timer);
      jd_timer = jd_timer - (double) (int) jd_timer; 
      jd_timer = (jd_timer * 720.0);
      timer_theta = (int) jd_timer;
      timer_theta -= 90;
      timer_theta -= (ALARM_WIDTH/2);
      while(timer_theta < 0) timer_theta += 360;
      timer_theta %= 360;
      timer_theta /= THETA_STEP;      // round to clockface drawing increment
      timer_theta *= THETA_STEP;
      if(timer_theta < ALARM_WIDTH) { // timer spans 0/360 degrees
         timer_ticks = ALARM_WIDTH;
      }
   }


   if(luxor && (alarm_time || alarm_date || egg_timer)) {
      x = ((aclock_x + ACLOCK_R) / TEXT_WIDTH) - 2;
      y = ((aclock_y - ACLOCK_R) / TEXT_HEIGHT) + 2;
      out[0] = ALARM_CHAR;
      out[1] = 0;
      vidstr(y,x, WHITE, out);
   }

   x0 = (int) (ACLOCK_R * cos360(0));
   y0 = (int) (ACLOCK_R * sin360(0));

   for(theta=THETA_STEP; theta<=360; theta+=THETA_STEP) { 
      if(egg_timer && (theta == timer_theta)) {
         timer_ticks = ALARM_WIDTH*2;
      }
      if((alarm_date || alarm_time) && (theta == alarm_theta)) {
         alarm_ticks = ALARM_WIDTH*2;
      }

      color = time_color;
      if(timer_ticks) {
         color = TIMER_COLOR;
         --timer_ticks;
         if(THETA_STEP > 1) timer_ticks = 0;
      }
      if(alarm_ticks) {
         color = ALARM_COLOR;
         --alarm_ticks;
         if(THETA_STEP > 1) alarm_ticks = 0;
      }
      if(alarm_ticks && timer_ticks) color = BLACK;

      if(alarm_ticks || timer_ticks) {
         x = (int) ((ACLOCK_R+1) * cos360(theta));
         y = (int) ((ACLOCK_R+1) * sin360(theta));
         thick_line(aclock_x+x0,aclock_y+y0, aclock_x+x,aclock_y+y, color, 3);
      }
      else {
         x = (int) (ACLOCK_R * cos360(theta));
         y = (int) (ACLOCK_R * sin360(theta));
         line(aclock_x+x0,aclock_y+y0, aclock_x+x,aclock_y+y, color);
      }

      x0 = x;
      y0 = y;
   }

   stem_size = ACLOCK_SIZE / 50;      // draw watch winding stem
   if(stem_size < 3) stem_size = 3;
   line(aclock_x-stem_size, aclock_y-ACLOCK_R-stem_size, aclock_x+stem_size, aclock_y-ACLOCK_R-stem_size, time_color);
   line(aclock_x-stem_size, aclock_y-ACLOCK_R-stem_size, aclock_x-stem_size, aclock_y-ACLOCK_R, time_color);
   line(aclock_x+stem_size, aclock_y-ACLOCK_R-stem_size, aclock_x+stem_size, aclock_y-ACLOCK_R, time_color);

   time_color = old_time_color;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x131a27(%rip), %r12    # 0x2235d4
movl (%r12), %eax
movl %eax, -0x3c(%rbp)
leaq 0x21bc55(%rip), %rax    # 0x30d810
cmpl $0x0, (%rax)
je 0xf1bc8
movl $0xe, (%r12)
leaq 0x14d36f(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
je 0xf1c59
leaq 0x21c33d(%rip), %rax    # 0x30df1c
cmpl $0x0, (%rax)
jne 0xf1bfd
leaq 0x21c341(%rip), %rax    # 0x30df2c
cmpl $0x0, (%rax)
jne 0xf1bfd
leaq 0x21c311(%rip), %rax    # 0x30df08
cmpq $0x0, (%rax)
je 0xf1c59
leaq 0x249770(%rip), %rax    # 0x33b374
leaq 0x249765(%rip), %rcx    # 0x33b370
movl (%rcx), %ecx
movl %ecx, %edi
shrl $0x1f, %edi
addl %ecx, %edi
sarl %edi
leaq 0x126bf3(%rip), %rcx    # 0x218810
movl (%rcx), %ecx
subl %ecx, %edi
movl (%rax), %eax
addl %edi, %eax
cltd
idivl %ecx
leal -0x2(%rax), %esi
leaq 0x249746(%rip), %rax    # 0x33b378
movl (%rax), %eax
subl %edi, %eax
leaq 0x126bd7(%rip), %rcx    # 0x218814
cltd
idivl (%rcx)
leal 0x2(%rax), %edi
leaq 0x24a5d6(%rip), %rcx    # 0x33c220
movw $0xf, (%rcx)
movl $0xf, %edx
callq 0xe7d0
leaq 0x249710(%rip), %rax    # 0x33b370
movl (%rax), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
leaq 0x126b9e(%rip), %rax    # 0x218810
subl (%rax), %ecx
cvtsi2ss %ecx, %xmm0
cvttss2si %xmm0, %ebx
movsd 0x173ec(%rip), %xmm0    # 0x109070
xorl %r14d, %r14d
movl $0x168, %r13d           # imm = 0x168
movsd %xmm0, -0x38(%rbp)
leaq 0x2496d7(%rip), %r15    # 0x33b370
movl (%r15), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
leaq 0x126b64(%rip), %rax    # 0x218810
subl (%rax), %ecx
movzbl (%r12), %eax
movl %eax, -0x40(%rbp)
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss %xmm0, -0x2c(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x2c3c1(%rip), %xmm1    # 0x11e090
callq 0x94d0
movsd 0x1747c(%rip), %xmm1    # 0x109158
divsd %xmm1, %xmm0
callq 0x9710
cvtsd2ss %xmm0, %xmm0
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %r12d
movl (%r15), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
leaq 0x126b0a(%rip), %rax    # 0x218810
subl (%rax), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss %xmm0, -0x2c(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x2c36f(%rip), %xmm1    # 0x11e090
callq 0x94d0
divsd 0x1742a(%rip), %xmm0    # 0x109158
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %r15d
leaq 0x24962c(%rip), %rax    # 0x33b374
movl (%rax), %edx
addl %edx, %ebx
leaq 0x249625(%rip), %rax    # 0x33b378
movl (%rax), %ecx
addl %ecx, %r14d
addl %r12d, %edx
addl %r15d, %ecx
movl %ebx, %edi
movl %r14d, %esi
movl -0x40(%rbp), %r8d
callq 0xe3c3
movsd -0x38(%rbp), %xmm0
addsd 0x172f7(%rip), %xmm0    # 0x109070
movl %r12d, %ebx
movl %r15d, %r14d
leaq 0x13184e(%rip), %r12    # 0x2235d4
decl %r13d
jne 0xf1c8d
leaq 0x2495da(%rip), %r14    # 0x33b370
movslq (%r14), %rax
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x24, %rcx
addl %edx, %ecx
cmpl $0x4, %ecx
movl $0x3, %ebx
cmovgel %ecx, %ebx
leaq 0x2495b9(%rip), %r13    # 0x33b378
movl (%r13), %ecx
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
subl %edx, %ecx
subl %ebx, %ecx
leaq 0x126a39(%rip), %r15    # 0x218810
addl (%r15), %ecx
leaq 0x249593(%rip), %r14    # 0x33b374
movl (%r14), %edi
leal (%rbx,%rdi), %edx
subl %ebx, %edi
movzbl (%r12), %r8d
movl %ecx, %esi
callq 0xe3c3
movl (%r14), %edi
subl %ebx, %edi
leaq 0x24956f(%rip), %r13    # 0x33b370
movl (%r13), %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movl (%r15), %ecx
leaq 0x249560(%rip), %r15    # 0x33b378
addl (%r15), %ecx
subl %edx, %ecx
movl %ecx, %esi
subl %ebx, %esi
movzbl (%r12), %r8d
movl %edi, %edx
callq 0xe3c3
movl (%r14), %edi
addl %ebx, %edi
movl (%r13), %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
leaq 0x1269ca(%rip), %rax    # 0x218810
movl (%rax), %ecx
addl (%r15), %ecx
subl %edx, %ecx
movl %ecx, %esi
subl %ebx, %esi
movzbl (%r12), %r8d
movl %edi, %edx
callq 0xe3c3
movl -0x3c(%rbp), %eax
movl %eax, (%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq