// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: draw_watch(int)
int draw_watch(int why)
{
   if(text_mode) return 1;
   if(measure_jitter) return 1;
//sprintf(plot_title, "draw watch:%d", why);

   if((zoom_screen == 'W') || (zoom_screen == 'B') || (zoom_screen == 'X')) ;
   else if(zoom_screen == 'Y') ;
   else if(zoom_screen == 'V') ;
   else if(plot_watch == 0) return 2;
   else if(first_key && shared_plot && (shared_item & SHARE_WATCH)) return 66;
   else if(all_adevs && plot_lla && (WIDE_SCREEN == 0)) return 3;
   else if(plot_lla && lla_showing) {
//.     if(SMALL_SCREEN) return 15;
////  if((shared_item & SHARE_WATCH) == 0) return 15;
if(SMALL_SCREEN && ((shared_item & SHARE_WATCH) == 0)) {
////return 15;
}
   }

if(zoom_screen == 'B') {
   ACLOCK_SIZE = AZEL_SIZE;
   aclock_x = AZEL_X;        //SCREEN_WIDTH/2 - TEXT_WIDTH*2;
   aclock_y = AZEL_Y;        //TEXT_HEIGHT*2 + ACLOCK_SIZE/2;
}

   if((zoom_screen == 'W') || (zoom_screen == 'B') || (zoom_screen == 'X')) ;
   else if(zoom_screen == 'Y') ;
   else if(zoom_screen == 'V') ;
   else if(map_and_watch) ;
   else if(shared_plot) {
      if(plot_signals && zoom_screen) return 4; 
      if(plot_lla && (SCREEN_WIDTH < NARROW_SCREEN)) return 5;
   }
   else {  // see if no room for both watch and lla
      if(plot_signals) return 6;
      if(plot_lla && (WIDE_SCREEN == 0)) return 7;
      if(SCREEN_WIDTH < NARROW_SCREEN) return 8; 
   }

   if(first_key && (aclock_y > PLOT_ROW)) return 9;  // watch would be in active help screen
   if(aclock_y > PLOT_ROW) shared_item = SHARE_WATCH;


   if(MESS && map_and_watch && map_and_sigs && (plot_areas == 1)) ;
   else if(zoom_screen == 'X') ;
   else if(zoom_screen == 'Y') ;
   else erase_watch();

   draw_watch_face();
   draw_watch_outline();
   draw_watch_alarms();

   if(zoom_screen == 'X') ;
   else if((lat != 0.0) || (lon != 0.0)) {
      moon_color = YELLOW;
      #ifdef TRUE_MOON
         calc_moon_posn(1);
      #endif

      // don't draw moon twice in the watch/map areas because
      // they have slighly different sizes and locations.
      if(zoom_screen) goto watch_moon;
      if(map_and_watch && map_and_sigs && (plot_areas == 1)) ;
      else if(map_and_watch && (map_and_sigs == 0) && (plot_areas == 2)) ;
      else if(map_and_watch && (map_and_sigs == 0) && (plot_areas == 1)) ;
      else {  // watch and map do not overlap, ok to draw watch's moon
         watch_moon:
         draw_moon(jd_utc, aclock_x,aclock_y, ACLOCK_SIZE/2, 1);
         draw_watch_sun();
      }

      if(0 && ((zoom_screen == 'W') || ((zoom_screen == 'B') && (SCREEN_WIDTH >= MEDIUM_WIDTH)))) {
         show_sun_moon(TIME_ROW-1, TIME_COL);
      }
   }

   draw_watch_hands();
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
leaq 0x128406(%rip), %rax    # 0x2779b8
cmpl $0x0, (%rax)
je 0x14f5c3
movl $0x1, -0x4(%rbp)
jmp 0x14faa2
leaq 0x14c8de(%rip), %rax    # 0x29bea8
cmpl $0x0, (%rax)
je 0x14f5db
movl $0x1, -0x4(%rbp)
jmp 0x14faa2
leaq 0x21c3a6(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x57, %eax
je 0x14f608
leaq 0x21c397(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x42, %eax
je 0x14f608
leaq 0x21c388(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x58, %eax
jne 0x14f60d
jmp 0x14f735
leaq 0x21c374(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x59, %eax
jne 0x14f621
jmp 0x14f733
leaq 0x21c360(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x56, %eax
jne 0x14f635
jmp 0x14f731
leaq 0x12afac(%rip), %rax    # 0x27a5e8
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x14f650
movl $0x2, -0x4(%rbp)
jmp 0x14faa2
leaq 0x14eae1(%rip), %rax    # 0x29e138
cmpl $0x0, (%rax)
je 0x14f685
leaq 0x24af65(%rip), %rax    # 0x39a5c8
cmpb $0x0, (%rax)
je 0x14f685
leaq 0x24af5d(%rip), %rax    # 0x39a5cc
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x14f685
movl $0x42, -0x4(%rbp)
jmp 0x14faa2
leaq 0x14c892(%rip), %rax    # 0x29bf1e
cmpb $0x0, (%rax)
je 0x14f6c3
leaq 0x24adf8(%rip), %rax    # 0x39a490
cmpb $0x0, (%rax)
je 0x14f6c3
leaq 0x12833c(%rip), %rax    # 0x2779e0
cmpl $0x690, (%rax)          # imm = 0x690
setge %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x14f6c3
movl $0x3, -0x4(%rbp)
jmp 0x14faa2
leaq 0x24adc6(%rip), %rax    # 0x39a490
cmpb $0x0, (%rax)
je 0x14f729
leaq 0x24adca(%rip), %rax    # 0x39a4a0
cmpl $0x0, (%rax)
je 0x14f729
leaq 0x1282fe(%rip), %rax    # 0x2779e0
movl (%rax), %eax
movl %eax, -0xc(%rbp)
leaq 0x133036(%rip), %rax    # 0x282724
imull $0x31a, (%rax), %eax    # imm = 0x31A
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xc(%rbp), %eax
cmpl %ecx, %eax
jl 0x14f714
leaq 0x1282d8(%rip), %rax    # 0x2779e4
cmpl $0x258, (%rax)          # imm = 0x258
jge 0x14f727
leaq 0x24aeb1(%rip), %rax    # 0x39a5cc
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x14f727
jmp 0x14f727
jmp 0x14f729
jmp 0x14f72b
jmp 0x14f72d
jmp 0x14f72f
jmp 0x14f731
jmp 0x14f733
jmp 0x14f735
leaq 0x21c24c(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x42, %eax
jne 0x14f77a
leaq 0x24ae21(%rip), %rax    # 0x39a56c
movl (%rax), %ecx
leaq 0x24adfc(%rip), %rax    # 0x39a550
movl %ecx, (%rax)
leaq 0x24ae23(%rip), %rax    # 0x39a580
movl (%rax), %ecx
leaq 0x24adee(%rip), %rax    # 0x39a554
movl %ecx, (%rax)
leaq 0x24ae15(%rip), %rax    # 0x39a584
movl (%rax), %ecx
leaq 0x24ade0(%rip), %rax    # 0x39a558
movl %ecx, (%rax)
leaq 0x21c207(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x57, %eax
je 0x14f7a7
leaq 0x21c1f8(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x42, %eax
je 0x14f7a7
leaq 0x21c1e9(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x58, %eax
jne 0x14f7ac
jmp 0x14f8e6
leaq 0x21c1d5(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x59, %eax
jne 0x14f7c0
jmp 0x14f8e4
leaq 0x21c1c1(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x56, %eax
jne 0x14f7d4
jmp 0x14f8e2
leaq 0x12ae15(%rip), %rax    # 0x27a5f0
cmpb $0x0, (%rax)
je 0x14f7e5
jmp 0x14f8e0
leaq 0x24addc(%rip), %rax    # 0x39a5c8
cmpb $0x0, (%rax)
je 0x14f85c
leaq 0x12adfd(%rip), %rax    # 0x27a5f5
cmpb $0x0, (%rax)
je 0x14f815
leaq 0x21c184(%rip), %rax    # 0x36b988
cmpb $0x0, (%rax)
je 0x14f815
movl $0x4, -0x4(%rbp)
jmp 0x14faa2
leaq 0x24ac74(%rip), %rax    # 0x39a490
cmpb $0x0, (%rax)
je 0x14f857
leaq 0x1281b8(%rip), %rax    # 0x2779e0
movl (%rax), %eax
movl %eax, -0x10(%rbp)
leaq 0x132ef0(%rip), %rax    # 0x282724
imull $0x31a, (%rax), %eax    # imm = 0x31A
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x10(%rbp), %eax
cmpl %ecx, %eax
jge 0x14f857
movl $0x5, -0x4(%rbp)
jmp 0x14faa2
jmp 0x14f8de
leaq 0x12ad92(%rip), %rax    # 0x27a5f5
cmpb $0x0, (%rax)
je 0x14f874
movl $0x6, -0x4(%rbp)
jmp 0x14faa2
leaq 0x24ac15(%rip), %rax    # 0x39a490
cmpb $0x0, (%rax)
je 0x14f8a6
leaq 0x128159(%rip), %rax    # 0x2779e0
cmpl $0x690, (%rax)          # imm = 0x690
setge %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x14f8a6
movl $0x7, -0x4(%rbp)
jmp 0x14faa2
leaq 0x128133(%rip), %rax    # 0x2779e0
movl (%rax), %eax
movl %eax, -0x14(%rbp)
leaq 0x132e6b(%rip), %rax    # 0x282724
imull $0x31a, (%rax), %eax    # imm = 0x31A
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x14(%rbp), %eax
cmpl %ecx, %eax
jge 0x14f8dc
movl $0x8, -0x4(%rbp)
jmp 0x14faa2
jmp 0x14f8de
jmp 0x14f8e0
jmp 0x14f8e2
jmp 0x14f8e4
jmp 0x14f8e6
leaq 0x14e84b(%rip), %rax    # 0x29e138
cmpl $0x0, (%rax)
je 0x14f912
leaq 0x24ac5f(%rip), %rax    # 0x39a558
movl (%rax), %eax
leaq 0x12815a(%rip), %rcx    # 0x277a5c
cmpl (%rcx), %eax
jle 0x14f912
movl $0x9, -0x4(%rbp)
jmp 0x14faa2
leaq 0x24ac3f(%rip), %rax    # 0x39a558
movl (%rax), %eax
leaq 0x12813a(%rip), %rcx    # 0x277a5c
cmpl (%rcx), %eax
jle 0x14f933
leaq 0x24ac9f(%rip), %rax    # 0x39a5cc
movl $0x1, (%rax)
leaq 0x21c04e(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x58, %eax
jne 0x14f944
jmp 0x14f95c
leaq 0x21c03d(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x59, %eax
jne 0x14f955
jmp 0x14f95a
callq 0x11880
jmp 0x14f95c
callq 0x14bad0
callq 0x14cca0
callq 0x14f070
leaq 0x21c016(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x58, %eax
jne 0x14f97f
jmp 0x14fa96
leaq 0x21c82a(%rip), %rax    # 0x36c1b0
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x14f9b0
jp 0x14f9b0
leaq 0x21c81c(%rip), %rax    # 0x36c1b8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x14f9b0
jp 0x14f9b0
jmp 0x14fa94
movl $0xe, 0x79c86(%rip)     # 0x1c9640
movl $0x1, %edi
callq 0x14b8b0
leaq 0x21bfbd(%rip), %rax    # 0x36b988
cmpb $0x0, (%rax)
je 0x14f9d2
jmp 0x14fa4f
leaq 0x12ac17(%rip), %rax    # 0x27a5f0
cmpb $0x0, (%rax)
je 0x14f9fb
leaq 0x12ac0c(%rip), %rax    # 0x27a5f1
cmpb $0x0, (%rax)
je 0x14f9fb
leaq 0x12abf3(%rip), %rax    # 0x27a5e4
cmpl $0x1, (%rax)
jne 0x14f9fb
jmp 0x14fa92
leaq 0x12abee(%rip), %rax    # 0x27a5f0
cmpb $0x0, (%rax)
je 0x14fa24
leaq 0x12abe3(%rip), %rax    # 0x27a5f1
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x14fa24
leaq 0x12abc7(%rip), %rax    # 0x27a5e4
cmpl $0x2, (%rax)
jne 0x14fa24
jmp 0x14fa90
leaq 0x12abc5(%rip), %rax    # 0x27a5f0
cmpb $0x0, (%rax)
je 0x14fa4d
leaq 0x12abba(%rip), %rax    # 0x27a5f1
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x14fa4d
leaq 0x12ab9e(%rip), %rax    # 0x27a5e4
cmpl $0x1, (%rax)
jne 0x14fa4d
jmp 0x14fa8e
jmp 0x14fa4f
leaq 0x21ccba(%rip), %rax    # 0x36c710
movsd (%rax), %xmm0
leaq 0x24aaf3(%rip), %rax    # 0x39a554
movl (%rax), %edi
leaq 0x24aaee(%rip), %rax    # 0x39a558
movl (%rax), %esi
leaq 0x24aadd(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movl $0x1, %ecx
callq 0x14e200
callq 0x14ed90
jmp 0x14fa90
jmp 0x14fa92
jmp 0x14fa94
jmp 0x14fa96
callq 0x14d300
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)