// File: /workspace/github_cpp_makefile_star2_O2/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, 0x1e99c5(%rip)    # 0x205304
je 0x1b947
popq %rbp
jmp 0x1b816
leal -0x147(%rdi), %eax
cmpl $0xa, %eax
ja 0x1b969
leaq 0xd7bcf(%rip), %rcx     # 0xf3528
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
jmp 0x1bb5e
cmpl $0x3c, %edi
je 0x1baa1
cmpl $0x3e, %edi
je 0x1bad3
cmpl $0x5b, %edi
je 0x1bafe
cmpl $0x5d, %edi
jne 0x1b9b7
cmpb $0x0, 0x20b3b0(%rip)    # 0x226d40
je 0x1bb21
cmpq $0x0, 0x1e99fa(%rip)    # 0x205398
jle 0x1bb64
movq 0x20b39d(%rip), %rdi    # 0x226d48
subq 0x1e99ee(%rip), %rdi    # 0x2053a0
jmp 0x1bb5e
movl $0x1, %edi
popq %rbp
jmp 0x10ac9
cmpb $0x0, 0x20b377(%rip)    # 0x226d40
je 0x1bb21
movslq 0x1e6e9e(%rip), %rax    # 0x202874
jmp 0x1ba84
cmpb $0x0, 0x20b35e(%rip)    # 0x226d40
je 0x1bb21
movslq 0x1e6e85(%rip), %rax    # 0x202874
jmp 0x1ba05
cmpb $0x0, 0x20b348(%rip)    # 0x226d40
je 0x1bb21
movslq 0x1e6e7f(%rip), %rax    # 0x202884
imulq 0x1e9993(%rip), %rax    # 0x2053a0
movslq 0x1e99bc(%rip), %rcx    # 0x2053d0
cqto
idivq %rcx
jmp 0x1bac4
cmpb $0x0, 0x20b31b(%rip)    # 0x226d40
je 0x1bb21
movq 0x1e9966(%rip), %rcx    # 0x205398
testq %rcx, %rcx
jle 0x1bb64
movq 0x20b306(%rip), %rdi    # 0x226d48
movl $0xe10, %eax            # imm = 0xE10
jmp 0x1baf4
cmpb $0x0, 0x20b2ed(%rip)    # 0x226d40
je 0x1bb21
movq 0x1e9938(%rip), %rcx    # 0x205398
testq %rcx, %rcx
jle 0x1bb64
movl $0xe10, %eax            # imm = 0xE10
jmp 0x1babf
cmpb $0x0, 0x20b2c9(%rip)    # 0x226d40
je 0x1bb21
movslq 0x1e6e00(%rip), %rax    # 0x202884
imulq 0x1e9914(%rip), %rax    # 0x2053a0
movq 0x20b2b5(%rip), %rdi    # 0x226d48
movslq 0x1e9936(%rip), %rcx    # 0x2053d0
cqto
idivq %rcx
jmp 0x1baf9
cmpb $0x0, 0x20b298(%rip)    # 0x226d40
je 0x1bb21
movq 0x1e98e7(%rip), %rcx    # 0x205398
testq %rcx, %rcx
jle 0x1bb64
movl $0x15180, %eax          # imm = 0x15180
xorl %edx, %edx
divq %rcx
addq 0x20b27d(%rip), %rax    # 0x226d48
movq %rax, %rdi
jmp 0x1bb5e
cmpb $0x0, 0x20b266(%rip)    # 0x226d40
je 0x1bb21
movq 0x1e98b5(%rip), %rcx    # 0x205398
testq %rcx, %rcx
jle 0x1bb64
movq 0x20b259(%rip), %rdi    # 0x226d48
movl $0x15180, %eax          # imm = 0x15180
xorl %edx, %edx
divq %rcx
subq %rax, %rdi
jmp 0x1bb5e
cmpb $0x0, 0x20b23b(%rip)    # 0x226d40
je 0x1bb21
cmpq $0x0, 0x1e9889(%rip)    # 0x205398
jle 0x1bb64
movq 0x1e9888(%rip), %rdi    # 0x2053a0
addq 0x20b229(%rip), %rdi    # 0x226d48
jmp 0x1bb5e
movq 0x1e9810(%rip), %rcx    # 0x205338
movslq 0x1e6d55(%rip), %rax    # 0x202884
imulq 0x1e9869(%rip), %rax    # 0x2053a0
movslq 0x1e9892(%rip), %rsi    # 0x2053d0
cqto
idivq %rsi
subq %rax, %rcx
movabsq $-0x1, %rdi
cmovnsq %rcx, %rdi
incq %rdi
movq %rdi, 0x20b1ea(%rip)    # 0x226d48
popq %rbp
jmp 0x1b787
popq %rbp
retq