// File: /workspace/github_cpp_makefile_star2_O1/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, 0x1feb68(%rip)    # 0x21b304
je 0x1c7a4
popq %rbp
jmp 0x1c659
cmpl $0x5c, %edi
jle 0x1c7cf
leal -0x147(%rdi), %eax
cmpl $0xa, %eax
ja 0x1c865
leaq 0xecd59(%rip), %rcx     # 0x109518
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
jmp 0x1c9c4
cmpl $0x3c, %edi
je 0x1c810
cmpl $0x3e, %edi
je 0x1c837
cmpl $0x5b, %edi
jne 0x1c898
cmpb $0x0, 0x220557(%rip)    # 0x23cd40
je 0x1c98a
cmpq $0x0, 0x1feba1(%rip)    # 0x21b398
jle 0x1c9ca
movq 0x1feb9c(%rip), %rdi    # 0x21b3a0
addq 0x22053d(%rip), %rdi    # 0x23cd48
jmp 0x1c9c4
cmpb $0x0, 0x220529(%rip)    # 0x23cd40
je 0x1c98a
movq 0x1feb74(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1c9ca
movl $0x15180, %eax          # imm = 0x15180
jmp 0x1c91e
cmpb $0x0, 0x220502(%rip)    # 0x23cd40
je 0x1c98a
movq 0x1feb4d(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1c9ca
movq 0x2204ed(%rip), %rdi    # 0x23cd48
movl $0x15180, %eax          # imm = 0x15180
jmp 0x1c980
cmpl $0x5d, %edi
jne 0x1c898
cmpb $0x0, 0x2204cf(%rip)    # 0x23cd40
je 0x1c98a
cmpq $0x0, 0x1feb19(%rip)    # 0x21b398
jle 0x1c9ca
movq 0x2204bc(%rip), %rdi    # 0x23cd48
subq 0x1feb0d(%rip), %rdi    # 0x21b3a0
jmp 0x1c9c4
movl $0x1, %edi
popq %rbp
jmp 0x11241
cmpb $0x0, 0x220496(%rip)    # 0x23cd40
je 0x1c98a
movslq 0x1fbfcd(%rip), %rax    # 0x218884
jmp 0x1c942
cmpb $0x0, 0x22047d(%rip)    # 0x23cd40
je 0x1c98a
movslq 0x1fbfa4(%rip), %rax    # 0x218874
jmp 0x1c8e6
cmpb $0x0, 0x220467(%rip)    # 0x23cd40
je 0x1c98a
movslq 0x1fbf9e(%rip), %rax    # 0x218884
imulq 0x1feab2(%rip), %rax    # 0x21b3a0
movslq 0x1feadb(%rip), %rcx    # 0x21b3d0
cqto
idivq %rcx
jmp 0x1c923
cmpb $0x0, 0x22043d(%rip)    # 0x23cd40
je 0x1c98a
movq 0x1fea88(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1c9ca
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
divq %rcx
addq 0x22041e(%rip), %rax    # 0x23cd48
movq %rax, %rdi
jmp 0x1c9c4
cmpb $0x0, 0x220407(%rip)    # 0x23cd40
je 0x1c98a
movslq 0x1fbf32(%rip), %rax    # 0x218874
imulq 0x1fea56(%rip), %rax    # 0x21b3a0
movq 0x2203f7(%rip), %rdi    # 0x23cd48
movslq 0x1fea78(%rip), %rcx    # 0x21b3d0
cqto
idivq %rcx
jmp 0x1c985
cmpb $0x0, 0x2203da(%rip)    # 0x23cd40
je 0x1c98a
movq 0x1fea29(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1c9ca
movq 0x2203cd(%rip), %rdi    # 0x23cd48
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
divq %rcx
subq %rax, %rdi
jmp 0x1c9c4
movq 0x1fe9a7(%rip), %rcx    # 0x21b338
movslq 0x1fbeec(%rip), %rax    # 0x218884
imulq 0x1fea00(%rip), %rax    # 0x21b3a0
movslq 0x1fea29(%rip), %rsi    # 0x21b3d0
cqto
idivq %rsi
subq %rax, %rcx
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
incq %rdi
movq %rdi, 0x220384(%rip)    # 0x23cd48
popq %rbp
jmp 0x1c5ce
popq %rbp
retq