// File: jkingan[P]ladyheather/heather.cpp
// Function: config_watch()
void config_watch()
{
   // calculate where we can draw the watch and how big to make it
   ACLOCK_SIZE = AZEL_SIZE;
   aclock_x = (AZEL_COL+ACLOCK_SIZE/2);
   aclock_y = (AZEL_ROW+ACLOCK_SIZE/2);

   if(zoom_screen && (zoom_screen != 'K')) {
      if(map_and_watch) {
         aclock_x = AZEL_COL + AZEL_SIZE/2 - 2;
         aclock_y = AZEL_ROW + AZEL_SIZE/2 - 2;
      }
      else {
         aclock_x = SCREEN_WIDTH/2;
         aclock_y = SCREEN_HEIGHT/2;
      }
   }
   else if(all_adevs) {
      if(WIDE_SCREEN) {
         if(plot_lla) {
            goto watch_it;
         }
         else {
            ACLOCK_SIZE = (SCREEN_WIDTH-WATCH_COL);
            if(ACLOCK_SIZE > (PLOT_ROW-TEXT_HEIGHT*4)) {
               ACLOCK_SIZE = PLOT_ROW-TEXT_HEIGHT*4;
            }
            if(ACLOCK_SIZE > MAX_AZEL) ACLOCK_SIZE = MAX_AZEL;
            aclock_x = (SCREEN_WIDTH-ACLOCK_SIZE/2-TEXT_WIDTH*2);   // and azel goes in the plot area
            aclock_y = (0+ACLOCK_SIZE/2+TEXT_HEIGHT*2);
         }
      }
   }
   else if((plot_azel || plot_signals) && plot_lla && WIDE_SCREEN) {
      goto watch_it;
   }
   else if((rcvr_type == NO_RCVR) && (SCREEN_WIDTH < NARROW_SCREEN)) {
      goto watch_it;
   }
   else if((plot_azel || plot_signals) && (plot_lla == 0) && (SCREEN_HEIGHT >= SHORT_SCREEN)) {  // both azel and watch want to be on the sceen
      watch_it:
      ACLOCK_SIZE = WATCH_SIZE;               // watch goes in the adev area
      aclock_x = (WATCH_COL+ACLOCK_SIZE/2);   // and azel goes in the plot area
      aclock_y = (WATCH_ROW+ACLOCK_SIZE/2);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x383672(%rip), %eax    # 0x39a56c
movl %eax, 0x383650(%rip)    # 0x39a550
movl 0x38366e(%rip), %eax    # 0x39a574
movl %eax, -0x8(%rbp)
movl 0x383641(%rip), %eax    # 0x39a550
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x8(%rbp), %eax
addl %ecx, %eax
movl %eax, 0x383630(%rip)    # 0x39a554
movl 0x383646(%rip), %eax    # 0x39a570
movl %eax, -0x4(%rbp)
movl 0x38361d(%rip), %eax    # 0x39a550
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x4(%rbp), %eax
addl %ecx, %eax
movl %eax, 0x383610(%rip)    # 0x39a558
cmpb $0x0, 0x354a39(%rip)    # 0x36b988
je 0x16feb
movzbl 0x354a2c(%rip), %eax    # 0x36b988
cmpl $0x4b, %eax
je 0x16feb
cmpb $0x0, 0x263684(%rip)    # 0x27a5f0
je 0x16fbe
movl 0x383600(%rip), %eax    # 0x39a574
movl %eax, -0x10(%rbp)
movl 0x3835ef(%rip), %eax    # 0x39a56c
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x10(%rbp), %eax
addl %ecx, %eax
subl $0x2, %eax
movl %eax, 0x3835bf(%rip)    # 0x39a554
movl 0x3835d5(%rip), %eax    # 0x39a570
movl %eax, -0xc(%rbp)
movl 0x3835c8(%rip), %eax    # 0x39a56c
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xc(%rbp), %eax
addl %ecx, %eax
subl $0x2, %eax
movl %eax, 0x38359c(%rip)    # 0x39a558
jmp 0x16fe6
movl 0x260a1c(%rip), %eax    # 0x2779e0
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x383582(%rip)    # 0x39a554
movl 0x260a0c(%rip), %eax    # 0x2779e4
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x383572(%rip)    # 0x39a558
jmp 0x171aa
cmpb $0x0, 0x284f2c(%rip)    # 0x29bf1e
je 0x170c6
cmpl $0x690, 0x2609de(%rip)  # imm = 0x690
jl 0x170c1
cmpb $0x0, 0x383481(%rip)    # 0x39a490
je 0x17016
jmp 0x1714e
movl 0x2609c4(%rip), %eax    # 0x2779e0
subl 0x383526(%rip), %eax    # 0x39a548
movl %eax, 0x383528(%rip)    # 0x39a550
movl 0x383522(%rip), %eax    # 0x39a550
movl 0x260a28(%rip), %ecx    # 0x277a5c
movl 0x2609ba(%rip), %edx    # 0x2779f4
shll $0x2, %edx
subl %edx, %ecx
cmpl %ecx, %eax
jle 0x1705a
movl 0x260a13(%rip), %eax    # 0x277a5c
movl 0x2609a5(%rip), %ecx    # 0x2779f4
shll $0x2, %ecx
subl %ecx, %eax
movl %eax, 0x3834f6(%rip)    # 0x39a550
cmpl $0x140, 0x3834ec(%rip)  # imm = 0x140
jle 0x17070
movl $0x140, 0x3834e0(%rip)  # imm = 0x140
movl 0x26096a(%rip), %eax    # 0x2779e0
movl %eax, -0x14(%rbp)
movl 0x3834d1(%rip), %eax    # 0x39a550
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x14(%rbp), %eax
subl %ecx, %eax
movl 0x26095c(%rip), %ecx    # 0x2779f0
shll %ecx
subl %ecx, %eax
movl %eax, 0x3834b6(%rip)    # 0x39a554
movl 0x3834ac(%rip), %eax    # 0x39a550
movl $0x2, %ecx
cltd
idivl %ecx
addl $0x0, %eax
movl 0x26093f(%rip), %ecx    # 0x2779f4
shll %ecx
addl %ecx, %eax
movl %eax, 0x383499(%rip)    # 0x39a558
jmp 0x170c1
jmp 0x171a8
cmpb $0x0, 0x263526(%rip)    # 0x27a5f3
jne 0x170d8
cmpb $0x0, 0x26351f(%rip)    # 0x27a5f5
je 0x170ef
cmpb $0x0, 0x3833b1(%rip)    # 0x39a490
je 0x170ef
cmpl $0x690, 0x2608f5(%rip)  # imm = 0x690
jl 0x170ef
jmp 0x1714e
cmpq $0x400, 0x2609b6(%rip) # imm = 0x400
jne 0x17122
movl 0x2608de(%rip), %eax    # 0x2779e0
movl %eax, -0x18(%rbp)
imull $0x31a, 0x26b615(%rip), %eax # imm = 0x31A
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x18(%rbp), %eax
cmpl %ecx, %eax
jge 0x17122
jmp 0x1714e
cmpb $0x0, 0x2634ca(%rip)    # 0x27a5f3
jne 0x17134
cmpb $0x0, 0x2634c3(%rip)    # 0x27a5f5
je 0x171a2
movzbl 0x383355(%rip), %eax    # 0x39a490
cmpl $0x0, %eax
jne 0x171a2
cmpl $0x258, 0x26089a(%rip)  # imm = 0x258
jl 0x171a2
jmp 0x1714e
movl 0x3833f8(%rip), %eax    # 0x39a54c
movl %eax, 0x3833f6(%rip)    # 0x39a550
movl 0x3833e8(%rip), %eax    # 0x39a548
movl %eax, -0x20(%rbp)
movl 0x3833e7(%rip), %eax    # 0x39a550
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x20(%rbp), %eax
addl %ecx, %eax
movl %eax, 0x3833d6(%rip)    # 0x39a554
movl 0x3833c0(%rip), %eax    # 0x39a544
movl %eax, -0x1c(%rbp)
movl 0x3833c3(%rip), %eax    # 0x39a550
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x1c(%rbp), %eax
addl %ecx, %eax
movl %eax, 0x3833b6(%rip)    # 0x39a558
jmp 0x171a4
jmp 0x171a6
jmp 0x171a8
jmp 0x171aa
popq %rbp
retq
nopl (%rax)