// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: do_review(int, int)
void do_review(int c, int why)
{
   // move the view around in the plot queue
   if(last_was_adev) {
      adev_review(c, why);
   }
   else if(c == HOME_CHAR)  {  // start of plot data
      plot_review(0L);
   }
   else if(c == END_CHAR) { // end of plot data
      review_end:
      review = plot_q_count - ((PLOT_WIDTH*view_interval)/(long)plot_mag) + 1;
      if(review < 0) review = 0;
      plot_review(review);
   }
   else if(c == LEFT_CHAR) {  // scroll one major division
      if(review_mode == 0) goto review_end;
      plot_review(review + ((HORIZ_MAJOR*view_interval)/(long)plot_mag));
   }
   else if(c == RIGHT_CHAR) {
      if(review_mode == 0) goto review_end;
      plot_review(review - ((HORIZ_MAJOR*view_interval)/(long)plot_mag));
   }
   else if(c == PAGE_UP) {  // scroll one screen
      if(review_mode == 0) goto review_end;
      plot_review(review + ((PLOT_WIDTH*view_interval)/(long)plot_mag));
   }
   else if(c == PAGE_DOWN)  {
      if(review_mode == 0) goto review_end;
      plot_review(review - ((PLOT_WIDTH*view_interval)/(long)plot_mag));
   }
   else if(c == UP_CHAR) {  // scroll one hour
      if(review_mode == 0) goto review_end;
      if(queue_interval > 0) plot_review(review + (3600L/queue_interval));
   }
   else if(c == DOWN_CHAR) {
      if(review_mode == 0) goto review_end;
      if(queue_interval > 0) plot_review(review - (3600L/queue_interval));
   }
   else if(c == '<') {      // scroll one day
      if(review_mode == 0) goto review_end;
      if(queue_interval > 0) plot_review(review+(long) ((24L*3600L)/queue_interval));
   }
   else if(c == '>') {
      if(review_mode == 0) goto review_end;
      if(queue_interval > 0) plot_review(review-(long) ((24L*3600L)/queue_interval));
   }
   else if(c == '[') {      // scroll one pixel
      if(review_mode == 0) goto review_end;
      if(queue_interval > 0) plot_review(review+view_interval);
   }
   else if(c == ']') {
      if(review_mode == 0) goto review_end;
      if(queue_interval > 0) plot_review(review-view_interval);
   }
   else {  // terminate scroll mode
      end_review(1);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x1feb2b(%rip)    # 0x21b304
je 0x1c7e1
popq %rbp
jmp 0x1c696
cmpl $0x5c, %edi
jle 0x1c80c
leal -0x147(%rdi), %eax
cmpl $0xa, %eax
ja 0x1c8a2
leaq 0xecd2c(%rip), %rcx     # 0x109528
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
jmp 0x1ca01
cmpl $0x3c, %edi
je 0x1c84d
cmpl $0x3e, %edi
je 0x1c874
cmpl $0x5b, %edi
jne 0x1c8d5
cmpb $0x0, 0x22051a(%rip)    # 0x23cd40
je 0x1c9c7
cmpq $0x0, 0x1feb64(%rip)    # 0x21b398
jle 0x1ca07
movq 0x1feb5f(%rip), %rdi    # 0x21b3a0
addq 0x220500(%rip), %rdi    # 0x23cd48
jmp 0x1ca01
cmpb $0x0, 0x2204ec(%rip)    # 0x23cd40
je 0x1c9c7
movq 0x1feb37(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1ca07
movl $0x15180, %eax          # imm = 0x15180
jmp 0x1c95b
cmpb $0x0, 0x2204c5(%rip)    # 0x23cd40
je 0x1c9c7
movq 0x1feb10(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1ca07
movq 0x2204b0(%rip), %rdi    # 0x23cd48
movl $0x15180, %eax          # imm = 0x15180
jmp 0x1c9bd
cmpl $0x5d, %edi
jne 0x1c8d5
cmpb $0x0, 0x220492(%rip)    # 0x23cd40
je 0x1c9c7
cmpq $0x0, 0x1feadc(%rip)    # 0x21b398
jle 0x1ca07
movq 0x22047f(%rip), %rdi    # 0x23cd48
subq 0x1fead0(%rip), %rdi    # 0x21b3a0
jmp 0x1ca01
movl $0x1, %edi
popq %rbp
jmp 0x111be
cmpb $0x0, 0x220459(%rip)    # 0x23cd40
je 0x1c9c7
movslq 0x1fbf90(%rip), %rax    # 0x218884
jmp 0x1c97f
cmpb $0x0, 0x220440(%rip)    # 0x23cd40
je 0x1c9c7
movslq 0x1fbf67(%rip), %rax    # 0x218874
jmp 0x1c923
cmpb $0x0, 0x22042a(%rip)    # 0x23cd40
je 0x1c9c7
movslq 0x1fbf61(%rip), %rax    # 0x218884
imulq 0x1fea75(%rip), %rax    # 0x21b3a0
movslq 0x1fea9e(%rip), %rcx    # 0x21b3d0
cqto
idivq %rcx
jmp 0x1c960
cmpb $0x0, 0x220400(%rip)    # 0x23cd40
je 0x1c9c7
movq 0x1fea4b(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1ca07
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
divq %rcx
addq 0x2203e1(%rip), %rax    # 0x23cd48
movq %rax, %rdi
jmp 0x1ca01
cmpb $0x0, 0x2203ca(%rip)    # 0x23cd40
je 0x1c9c7
movslq 0x1fbef5(%rip), %rax    # 0x218874
imulq 0x1fea19(%rip), %rax    # 0x21b3a0
movq 0x2203ba(%rip), %rdi    # 0x23cd48
movslq 0x1fea3b(%rip), %rcx    # 0x21b3d0
cqto
idivq %rcx
jmp 0x1c9c2
cmpb $0x0, 0x22039d(%rip)    # 0x23cd40
je 0x1c9c7
movq 0x1fe9ec(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1ca07
movq 0x220390(%rip), %rdi    # 0x23cd48
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
divq %rcx
subq %rax, %rdi
jmp 0x1ca01
movq 0x1fe96a(%rip), %rcx    # 0x21b338
movslq 0x1fbeaf(%rip), %rax    # 0x218884
imulq 0x1fe9c3(%rip), %rax    # 0x21b3a0
movslq 0x1fe9ec(%rip), %rsi    # 0x21b3d0
cqto
idivq %rsi
subq %rax, %rcx
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
incq %rdi
movq %rdi, 0x220347(%rip)    # 0x23cd48
popq %rbp
jmp 0x1c60b
popq %rbp
retq