// File: /workspace/github_cpp_makefile_star2_O3/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 0x1c6c9
leal -0x147(%rdi), %eax
cmpl $0xa, %eax
ja 0x1c6e5
leaq 0xece4b(%rip), %rcx     # 0x1094fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, 0x2205bc(%rip)    # 0x23cc80
jmp 0x1c773
cmpl $0x3c, %edi
je 0x1c6d8
cmpl $0x3e, %edi
je 0x1c6ea
cmpl $0x5b, %edi
jne 0x1c6f7
movl 0x2205a2(%rip), %eax    # 0x23cc80
incl %eax
jmp 0x1c789
cmpl $0x5d, %edi
jne 0x1c6f7
movl 0x220590(%rip), %eax    # 0x23cc80
decl %eax
jmp 0x1c789
movl $0x0, 0x1fec03(%rip)    # 0x21b304
movl $0x1, 0x1febfd(%rip)    # 0x21b308
movl $0x4, %edi
callq 0xd8ba5
movl $0x1, %edi
popq %rbp
jmp 0x111be
movl 0x22055a(%rip), %eax    # 0x23cc80
subl 0x1fc090(%rip), %eax    # 0x2187bc
addl $0x2, %eax
jmp 0x1c789
movl 0x220549(%rip), %eax    # 0x23cc80
addl $-0x5, %eax
jmp 0x1c789
movl 0x22053e(%rip), %eax    # 0x23cc80
addl $0x5, %eax
jmp 0x1c789
movl 0x1fc06f(%rip), %eax    # 0x2187bc
movl 0x22052d(%rip), %ecx    # 0x23cc80
addl %ecx, %eax
addl $-0x2, %eax
jmp 0x1c789
movl 0x220530(%rip), %eax    # 0x23cc90
subl 0x1fc05a(%rip), %eax    # 0x2187c0
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
movl %ecx, 0x22050d(%rip)    # 0x23cc80
popq %rbp
retq
movl 0x220505(%rip), %eax    # 0x23cc80
addl $0xa, %eax
jmp 0x1c789
movl 0x2204fa(%rip), %eax    # 0x23cc80
addl $-0xa, %eax
movl %eax, 0x2204f1(%rip)    # 0x23cc80
movl 0x2204fb(%rip), %ecx    # 0x23cc90
cmpl %ecx, %eax
jge 0x1c7a6
testl %eax, %eax
jns 0x1c7c3
movl $0xd, %edi
xorl %eax, %eax
jmp 0x1c7b8
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
decl %eax
movl $0xc, %edi
movl %eax, 0x2204c2(%rip)    # 0x23cc80
callq 0x9d78
movl $0x3, %edi
popq %rbp
jmp 0xd8ba5