// File: 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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x147, -0x4(%rbp)      # imm = 0x147
jne 0x28a26
movl $0x0, 0x27343f(%rip)    # 0x29be60
jmp 0x28bf4
cmpl $0x14f, -0x4(%rbp)      # imm = 0x14F
jne 0x28a59
movl 0x27343b(%rip), %eax    # 0x29be70
subl 0x24ef65(%rip), %eax    # 0x2779a0
movl %eax, 0x27341f(%rip)    # 0x29be60
cmpl $0x0, 0x273418(%rip)    # 0x29be60
jge 0x28a54
movl $0x0, 0x27340c(%rip)    # 0x29be60
jmp 0x28bf2
cmpl $0x14b, -0x4(%rbp)      # imm = 0x14B
jne 0x28a76
movl 0x2733f8(%rip), %eax    # 0x29be60
addl $0x5, %eax
movl %eax, 0x2733ef(%rip)    # 0x29be60
jmp 0x28b36
cmpl $0x14d, -0x4(%rbp)      # imm = 0x14D
jne 0x28a93
movl 0x2733db(%rip), %eax    # 0x29be60
subl $0x5, %eax
movl %eax, 0x2733d2(%rip)    # 0x29be60
jmp 0x28b36
cmpl $0x149, -0x4(%rbp)      # imm = 0x149
jne 0x28ab6
movl 0x24eefa(%rip), %eax    # 0x27799c
subl $0x2, %eax
addl 0x2733b5(%rip), %eax    # 0x29be60
movl %eax, 0x2733af(%rip)    # 0x29be60
jmp 0x28b36
cmpl $0x151, -0x4(%rbp)      # imm = 0x151
jne 0x28ad8
movl 0x24eed7(%rip), %ecx    # 0x27799c
subl $0x2, %ecx
movl 0x273392(%rip), %eax    # 0x29be60
subl %ecx, %eax
movl %eax, 0x27338a(%rip)    # 0x29be60
jmp 0x28b36
cmpl $0x148, -0x4(%rbp)      # imm = 0x148
jne 0x28af2
movl 0x273379(%rip), %eax    # 0x29be60
addl $0xa, %eax
movl %eax, 0x273370(%rip)    # 0x29be60
jmp 0x28b36
cmpl $0x150, -0x4(%rbp)      # imm = 0x150
jne 0x28b0c
movl 0x27335f(%rip), %eax    # 0x29be60
subl $0xa, %eax
movl %eax, 0x273356(%rip)    # 0x29be60
jmp 0x28b36
cmpl $0x3c, -0x4(%rbp)
jne 0x28b14
jmp 0x28b27
cmpl $0x3e, -0x4(%rbp)
jne 0x28b1f
jmp 0x28ba5
cmpl $0x5b, -0x4(%rbp)
jne 0x28b9d
jmp 0x28b27
movl 0x273333(%rip), %eax    # 0x29be60
addl $0x1, %eax
movl %eax, 0x27332a(%rip)    # 0x29be60
movl 0x273324(%rip), %eax    # 0x29be60
cmpl 0x27332e(%rip), %eax    # 0x29be70
jl 0x28b72
movl 0x273326(%rip), %eax    # 0x29be70
subl $0x1, %eax
movl %eax, 0x27330d(%rip)    # 0x29be60
cmpl $0x0, 0x273306(%rip)    # 0x29be60
jge 0x28b66
movl $0x0, 0x2732fa(%rip)    # 0x29be60
movl $0xc, %edi
callq 0x9ec0
jmp 0x28b91
cmpl $0x0, 0x2732e7(%rip)    # 0x29be60
jge 0x28b8f
movl $0x0, 0x2732db(%rip)    # 0x29be60
movl $0xd, %edi
callq 0x9ec0
jmp 0x28b91
movl $0x3, %edi
callq 0x127cf0
jmp 0x28be0
cmpl $0x5d, -0x4(%rbp)
jne 0x28bb6
jmp 0x28ba5
movl 0x2732b5(%rip), %eax    # 0x29be60
addl $-0x1, %eax
movl %eax, 0x2732ac(%rip)    # 0x29be60
jmp 0x28b36
movl $0x0, 0x251924(%rip)    # 0x27a4e4
movl $0x1, 0x25191e(%rip)    # 0x27a4e8
movl $0x4, %edi
callq 0x127cf0
movl $0x1, %edi
callq 0x14e40
jmp 0x28be0
jmp 0x28be2
jmp 0x28be4
jmp 0x28be6
jmp 0x28be8
jmp 0x28bea
jmp 0x28bec
jmp 0x28bee
jmp 0x28bf0
jmp 0x28bf2
jmp 0x28bf4
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)