// File: /workspace/github_cpp_makefile_star2_O3/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 0x13136b(%rip), %r12    # 0x2235d4
movl (%r12), %eax
movl %eax, -0x3c(%rbp)
leaq 0x21b599(%rip), %rax    # 0x30d810
cmpl $0x0, (%rax)
je 0xf2284
movl $0xe, (%r12)
leaq 0x14ccb3(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
je 0xf2315
leaq 0x21bc81(%rip), %rax    # 0x30df1c
cmpl $0x0, (%rax)
jne 0xf22b9
leaq 0x21bc85(%rip), %rax    # 0x30df2c
cmpl $0x0, (%rax)
jne 0xf22b9
leaq 0x21bc55(%rip), %rax    # 0x30df08
cmpq $0x0, (%rax)
je 0xf2315
leaq 0x2490b4(%rip), %rax    # 0x33b374
leaq 0x2490a9(%rip), %rcx    # 0x33b370
movl (%rcx), %ecx
movl %ecx, %edi
shrl $0x1f, %edi
addl %ecx, %edi
sarl %edi
leaq 0x126537(%rip), %rcx    # 0x218810
movl (%rcx), %ecx
subl %ecx, %edi
movl (%rax), %eax
addl %edi, %eax
cltd
idivl %ecx
leal -0x2(%rax), %esi
leaq 0x24908a(%rip), %rax    # 0x33b378
movl (%rax), %eax
subl %edi, %eax
leaq 0x12651b(%rip), %rcx    # 0x218814
cltd
idivl (%rcx)
leal 0x2(%rax), %edi
leaq 0x249f1a(%rip), %rcx    # 0x33c220
movw $0xf, (%rcx)
movl $0xf, %edx
callq 0xe787
leaq 0x249054(%rip), %rax    # 0x33b370
movl (%rax), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
leaq 0x1264e2(%rip), %rax    # 0x218810
subl (%rax), %ecx
cvtsi2ss %ecx, %xmm0
cvttss2si %xmm0, %ebx
movsd 0x16d30(%rip), %xmm0    # 0x109070
xorl %r14d, %r14d
movl $0x168, %r13d           # imm = 0x168
movsd %xmm0, -0x38(%rbp)
leaq 0x24901b(%rip), %r15    # 0x33b370
movl (%r15), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
leaq 0x1264a8(%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 0x2bdad(%rip), %xmm1    # 0x11e138
callq 0x94d0
movsd 0x16dc8(%rip), %xmm1    # 0x109160
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 0x12644e(%rip), %rax    # 0x218810
subl (%rax), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss %xmm0, -0x2c(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x2bd5b(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0x16d76(%rip), %xmm0    # 0x109160
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %r15d
leaq 0x248f70(%rip), %rax    # 0x33b374
movl (%rax), %edx
addl %edx, %ebx
leaq 0x248f69(%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 0xe38a
movsd -0x38(%rbp), %xmm0
addsd 0x16c3b(%rip), %xmm0    # 0x109070
movl %r12d, %ebx
movl %r15d, %r14d
leaq 0x131192(%rip), %r12    # 0x2235d4
decl %r13d
jne 0xf2349
leaq 0x248f1e(%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 0x248efd(%rip), %r13    # 0x33b378
movl (%r13), %ecx
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
subl %edx, %ecx
subl %ebx, %ecx
leaq 0x12637d(%rip), %r15    # 0x218810
addl (%r15), %ecx
leaq 0x248ed7(%rip), %r14    # 0x33b374
movl (%r14), %edi
leal (%rbx,%rdi), %edx
subl %ebx, %edi
movzbl (%r12), %r8d
movl %ecx, %esi
callq 0xe38a
movl (%r14), %edi
subl %ebx, %edi
leaq 0x248eb3(%rip), %r13    # 0x33b370
movl (%r13), %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movl (%r15), %ecx
leaq 0x248ea4(%rip), %r15    # 0x33b378
addl (%r15), %ecx
subl %edx, %ecx
movl %ecx, %esi
subl %ebx, %esi
movzbl (%r12), %r8d
movl %edi, %edx
callq 0xe38a
movl (%r14), %edi
addl %ebx, %edi
movl (%r13), %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
leaq 0x12630e(%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 0xe38a
movl -0x3c(%rbp), %eax
movl %eax, (%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq