// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: adev_review(int, int)
void adev_review(int c, int why)
{
   // this routine lets you scroll around the adev tables and plots

   if(c == HOME_CHAR)  {  // go to start of adev data
      first_show_bin = 0;
   }
   else if(c == END_CHAR) { // go to end of adev data
      first_show_bin = max_bins_shown - adev_table_rows;
      if(first_show_bin < 0) first_show_bin = 0;
   }
   else if(c == LEFT_CHAR) {  // scroll adevs by 5 bins
      first_show_bin += 5;
      goto scroll_adevs;
   }
   else if(c == RIGHT_CHAR) {
      first_show_bin -= 5;
      goto scroll_adevs;
   }
   else if(c == PAGE_UP) {  // scroll adevs by one screen
      first_show_bin += (adev_page_size - 2);
      goto scroll_adevs;
   }
   else if(c == PAGE_DOWN)  {
      first_show_bin -= (adev_page_size - 2);
      goto scroll_adevs;
   }
   else if(c == UP_CHAR) {  // scroll adevs by 10 bins
first_show_bin += 10;
goto scroll_adevs;
   }
   else if(c == DOWN_CHAR) {
first_show_bin -= 10;
goto scroll_adevs;
   }
   else if(c == '<') {      // scroll adves one bin
goto scroll_left;
   }
   else if(c == '>') {
goto scroll_right;
   }
   else if(c == '[') {      // scroll adevs one bin
      scroll_left:
      ++first_show_bin;

      scroll_adevs:
      if(first_show_bin >= max_bins_shown) {
         first_show_bin = max_bins_shown-1;
         if(first_show_bin < 0) first_show_bin = 0;
         BEEP(12);
      }
      else if(first_show_bin < 0) {
         first_show_bin = 0;
         BEEP(13);
      }
      force_adev_redraw(3);
   }
   else if(c == ']') {
      scroll_right:
      --first_show_bin;
      goto scroll_adevs;
   }
   else {  // terminate adev scroll mode
      last_was_adev = 0;
      lwa = 1;
      force_adev_redraw(4);
      end_review(1);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x5c, %edi
jle 0x1c68c
leal -0x147(%rdi), %eax
cmpl $0xa, %eax
ja 0x1c6a8
leaq 0xece78(%rip), %rcx     # 0x1094ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, 0x2205f9(%rip)    # 0x23cc80
jmp 0x1c736
cmpl $0x3c, %edi
je 0x1c69b
cmpl $0x3e, %edi
je 0x1c6ad
cmpl $0x5b, %edi
jne 0x1c6ba
movl 0x2205df(%rip), %eax    # 0x23cc80
incl %eax
jmp 0x1c74c
cmpl $0x5d, %edi
jne 0x1c6ba
movl 0x2205cd(%rip), %eax    # 0x23cc80
decl %eax
jmp 0x1c74c
movl $0x0, 0x1fec40(%rip)    # 0x21b304
movl $0x1, 0x1fec3a(%rip)    # 0x21b308
movl $0x4, %edi
callq 0xd846f
movl $0x1, %edi
popq %rbp
jmp 0x11241
movl 0x220597(%rip), %eax    # 0x23cc80
subl 0x1fc0cd(%rip), %eax    # 0x2187bc
addl $0x2, %eax
jmp 0x1c74c
movl 0x220586(%rip), %eax    # 0x23cc80
addl $-0x5, %eax
jmp 0x1c74c
movl 0x22057b(%rip), %eax    # 0x23cc80
addl $0x5, %eax
jmp 0x1c74c
movl 0x1fc0ac(%rip), %eax    # 0x2187bc
movl 0x22056a(%rip), %ecx    # 0x23cc80
addl %ecx, %eax
addl $-0x2, %eax
jmp 0x1c74c
movl 0x22056d(%rip), %eax    # 0x23cc90
subl 0x1fc097(%rip), %eax    # 0x2187c0
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
movl %ecx, 0x22054a(%rip)    # 0x23cc80
popq %rbp
retq
movl 0x220542(%rip), %eax    # 0x23cc80
addl $0xa, %eax
jmp 0x1c74c
movl 0x220537(%rip), %eax    # 0x23cc80
addl $-0xa, %eax
movl %eax, 0x22052e(%rip)    # 0x23cc80
movl 0x220538(%rip), %ecx    # 0x23cc90
cmpl %ecx, %eax
jge 0x1c769
testl %eax, %eax
jns 0x1c786
movl $0xd, %edi
xorl %eax, %eax
jmp 0x1c77b
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
decl %eax
movl $0xc, %edi
movl %eax, 0x2204ff(%rip)    # 0x23cc80
callq 0x9d80
movl $0x3, %edi
popq %rbp
jmp 0xd846f