// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: draw_watch_alarms()
void draw_watch_alarms()
{
int x0,y0;
int x1,y1;
int len;
int timer_theta, alarm_theta;
double jd_timer;

   // draw tick marks on the watch for alarm and egg timer

   len = ACLOCK_R / 20;
   if(len < 5) len = 5;
   else if(len > 15) len = 15;

   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;
      while(alarm_theta < 0) alarm_theta += 360;
      alarm_theta %= 360;

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

      x1 = (int) ((ACLOCK_R+len) * cos360(alarm_theta));
      y1 = (int) ((ACLOCK_R+len) * sin360(alarm_theta));
      thick_line(aclock_x+x0,aclock_y+y0, aclock_x+x1,aclock_y+y1, ALARM_COLOR, 3);
   }    


   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;
      while(timer_theta < 0) timer_theta += 360;
      timer_theta %= 360;

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

      x1 = (int) ((ACLOCK_R+len) * cos360(timer_theta));
      y1 = (int) ((ACLOCK_R+len) * sin360(timer_theta));
      thick_line(aclock_x+x0,aclock_y+y0, aclock_x+x1,aclock_y+y1, TIMER_COLOR, 3);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x24b4d1(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
leaq 0x128960(%rip), %rcx    # 0x2779f0
subl (%rcx), %eax
movl $0x14, %ecx
cltd
idivl %ecx
movl %eax, -0x14(%rbp)
cmpl $0x5, -0x14(%rbp)
jge 0x14f0ac
movl $0x5, -0x14(%rbp)
jmp 0x14f0bb
cmpl $0xf, -0x14(%rbp)
jle 0x14f0b9
movl $0xf, -0x14(%rbp)
jmp 0x14f0bb
leaq 0x21e04a(%rip), %rax    # 0x36d10c
cmpl $0x0, (%rax)
jne 0x14f0d7
leaq 0x21e02e(%rip), %rax    # 0x36d0fc
cmpl $0x0, (%rax)
je 0x14f335
leaq 0x21e022(%rip), %rax    # 0x36d100
movl (%rax), %eax
movl %eax, -0x30(%rbp)
leaq 0x12b508(%rip), %rax    # 0x27a5f2
movzbl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x30(%rbp), %eax
addl $0x1, %ecx
imull $0xc, %ecx, %ecx
cltd
idivl %ecx
movl %edx, -0x2c(%rbp)
leaq 0x12b4e5(%rip), %rax    # 0x27a5f2
movzbl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
addl $0x1, %eax
imull $0xc, %eax, %ecx
movl $0x168, %eax            # imm = 0x168
cltd
idivl %ecx
movl %eax, %ecx
movl -0x2c(%rbp), %eax
imull %ecx, %eax
shll %eax
leaq 0x21dfcd(%rip), %rcx    # 0x36d104
addl (%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
subl $0x5a, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x14f166
movl -0x1c(%rbp), %eax
addl $0x168, %eax            # imm = 0x168
movl %eax, -0x1c(%rbp)
jmp 0x14f153
movl -0x1c(%rbp), %eax
movl $0x168, %ecx            # imm = 0x168
cltd
idivl %ecx
movl %edx, -0x1c(%rbp)
leaq 0x24b3d5(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
leaq 0x128864(%rip), %rcx    # 0x2779f0
subl (%rcx), %eax
subl $0x0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x40(%rbp)
cvtsi2sdl -0x1c(%rbp), %xmm0
movsd 0x33989(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x1ffcc(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movss -0x40(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x4(%rbp)
leaq 0x24b375(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
leaq 0x128804(%rip), %rcx    # 0x2779f0
subl (%rcx), %eax
subl $0x0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x3c(%rbp)
cvtsi2sdl -0x1c(%rbp), %xmm0
movsd 0x33929(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x1ff6c(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x9080
movaps %xmm0, %xmm1
movss -0x3c(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x8(%rbp)
leaq 0x24b315(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
leaq 0x1287a4(%rip), %rcx    # 0x2779f0
subl (%rcx), %eax
addl -0x14(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x38(%rbp)
cvtsi2sdl -0x1c(%rbp), %xmm0
movsd 0x338c9(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x1ff0c(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movss -0x38(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0xc(%rbp)
leaq 0x24b2b5(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
leaq 0x128744(%rip), %rcx    # 0x2779f0
subl (%rcx), %eax
addl -0x14(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x34(%rbp)
cvtsi2sdl -0x1c(%rbp), %xmm0
movsd 0x33869(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x1feac(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x9080
movaps %xmm0, %xmm1
movss -0x34(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x10(%rbp)
leaq 0x24b259(%rip), %rax    # 0x39a554
movl (%rax), %edi
addl -0x4(%rbp), %edi
leaq 0x24b251(%rip), %rax    # 0x39a558
movl (%rax), %esi
addl -0x8(%rbp), %esi
leaq 0x24b241(%rip), %rax    # 0x39a554
movl (%rax), %edx
addl -0xc(%rbp), %edx
leaq 0x24b239(%rip), %rax    # 0x39a558
movl (%rax), %ecx
addl -0x10(%rbp), %ecx
movl $0xc, %r8d
movl $0x3, %r9d
callq 0x11710
leaq 0x21ddac(%rip), %rax    # 0x36d0e8
cmpq $0x0, (%rax)
je 0x14f59a
leaq 0x21d3db(%rip), %rax    # 0x36c728
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
leaq 0x21dd8b(%rip), %rax    # 0x36d0e8
cvtsi2sdq (%rax), %xmm0
xorl %edx, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
cvttsd2si -0x28(%rbp), %eax
cvtsi2sd %eax, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x33ebb(%rip), %xmm0    # 0x183258
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
cvttsd2si -0x28(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
subl $0x5a, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x14f3cb
movl -0x18(%rbp), %eax
addl $0x168, %eax            # imm = 0x168
movl %eax, -0x18(%rbp)
jmp 0x14f3b8
movl -0x18(%rbp), %eax
movl $0x168, %ecx            # imm = 0x168
cltd
idivl %ecx
movl %edx, -0x18(%rbp)
leaq 0x24b170(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
leaq 0x1285ff(%rip), %rcx    # 0x2779f0
subl (%rcx), %eax
subl $0x0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x58(%rbp)
cvtsi2sdl -0x18(%rbp), %xmm0
movsd 0x33724(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x1fd67(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movss -0x58(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x4(%rbp)
leaq 0x24b110(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
leaq 0x12859f(%rip), %rcx    # 0x2779f0
subl (%rcx), %eax
subl $0x0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x54(%rbp)
cvtsi2sdl -0x18(%rbp), %xmm0
movsd 0x336c4(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x1fd07(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x9080
movaps %xmm0, %xmm1
movss -0x54(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x8(%rbp)
leaq 0x24b0b0(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
leaq 0x12853f(%rip), %rcx    # 0x2779f0
subl (%rcx), %eax
addl -0x14(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x50(%rbp)
cvtsi2sdl -0x18(%rbp), %xmm0
movsd 0x33664(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x1fca7(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movss -0x50(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0xc(%rbp)
leaq 0x24b050(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
leaq 0x1284df(%rip), %rcx    # 0x2779f0
subl (%rcx), %eax
addl -0x14(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x4c(%rbp)
cvtsi2sdl -0x18(%rbp), %xmm0
movsd 0x33604(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x1fc47(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x9080
movaps %xmm0, %xmm1
movss -0x4c(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x10(%rbp)
leaq 0x24aff4(%rip), %rax    # 0x39a554
movl (%rax), %edi
addl -0x4(%rbp), %edi
leaq 0x24afec(%rip), %rax    # 0x39a558
movl (%rax), %esi
addl -0x8(%rbp), %esi
leaq 0x24afdc(%rip), %rax    # 0x39a554
movl (%rax), %edx
addl -0xc(%rbp), %edx
leaq 0x24afd4(%rip), %rax    # 0x39a558
movl (%rax), %ecx
addl -0x10(%rbp), %ecx
movl $0xe, %r8d
movl $0x3, %r9d
callq 0x11710
addq $0x60, %rsp
popq %rbp
retq