// File: 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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x0, 0x2518cf(%rip)    # 0x27a4e4
je 0x28c27
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0x28a00
jmp 0x28f68
cmpl $0x147, -0x4(%rbp)      # imm = 0x147
jne 0x28c3e
xorl %eax, %eax
movl %eax, %edi
callq 0x28900
jmp 0x28f66
cmpl $0x14f, -0x4(%rbp)      # imm = 0x14F
jne 0x28caa
jmp 0x28c49
movq 0x2518c8(%rip), %rax    # 0x27a518
movq %rax, -0x10(%rbp)
movslq 0x24ee09(%rip), %rax    # 0x277a64
imulq 0x25191d(%rip), %rax    # 0x27a580
movslq 0x251946(%rip), %rcx    # 0x27a5b0
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
subq %rcx, %rax
addq $0x1, %rax
movq %rax, 0x2732a4(%rip)    # 0x29bf28
cmpq $0x0, 0x27329c(%rip)    # 0x29bf28
jge 0x28c99
movq $0x0, 0x27328f(%rip) # 0x29bf28
movq 0x273288(%rip), %rdi    # 0x29bf28
callq 0x28900
jmp 0x28f64
cmpl $0x14b, -0x4(%rbp)      # imm = 0x14B
jne 0x28cf0
movzbl 0x273266(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28cc1
jmp 0x28c49
movq 0x273260(%rip), %rdi    # 0x29bf28
movslq 0x24ed85(%rip), %rax    # 0x277a54
imulq 0x2518a9(%rip), %rax    # 0x27a580
movslq 0x2518d2(%rip), %rcx    # 0x27a5b0
cqto
idivq %rcx
addq %rax, %rdi
callq 0x28900
jmp 0x28f62
cmpl $0x14d, -0x4(%rbp)      # imm = 0x14D
jne 0x28d39
movzbl 0x273220(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28d0a
jmp 0x28c49
movq 0x273217(%rip), %rdi    # 0x29bf28
movslq 0x24ed3c(%rip), %rax    # 0x277a54
imulq 0x251860(%rip), %rax    # 0x27a580
movslq 0x251889(%rip), %rcx    # 0x27a5b0
cqto
idivq %rcx
subq %rax, %rdi
callq 0x28900
jmp 0x28f60
cmpl $0x149, -0x4(%rbp)      # imm = 0x149
jne 0x28d82
movzbl 0x2731d7(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28d53
jmp 0x28c49
movq 0x2731ce(%rip), %rdi    # 0x29bf28
movslq 0x24ed03(%rip), %rax    # 0x277a64
imulq 0x251817(%rip), %rax    # 0x27a580
movslq 0x251840(%rip), %rcx    # 0x27a5b0
cqto
idivq %rcx
addq %rax, %rdi
callq 0x28900
jmp 0x28f5e
cmpl $0x151, -0x4(%rbp)      # imm = 0x151
jne 0x28dcb
movzbl 0x27318e(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28d9c
jmp 0x28c49
movq 0x273185(%rip), %rdi    # 0x29bf28
movslq 0x24ecba(%rip), %rax    # 0x277a64
imulq 0x2517ce(%rip), %rax    # 0x27a580
movslq 0x2517f7(%rip), %rcx    # 0x27a5b0
cqto
idivq %rcx
subq %rax, %rdi
callq 0x28900
jmp 0x28f5c
cmpl $0x148, -0x4(%rbp)      # imm = 0x148
jne 0x28e11
movzbl 0x273145(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28de5
jmp 0x28c49
cmpq $0x0, 0x25178b(%rip)    # 0x27a578
jle 0x28e0c
movq 0x273132(%rip), %rdi    # 0x29bf28
movl $0xe10, %eax            # imm = 0xE10
cqto
idivq 0x251774(%rip)          # 0x27a578
addq %rax, %rdi
callq 0x28900
jmp 0x28f5a
cmpl $0x150, -0x4(%rbp)      # imm = 0x150
jne 0x28e57
movzbl 0x2730ff(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28e2b
jmp 0x28c49
cmpq $0x0, 0x251745(%rip)    # 0x27a578
jle 0x28e52
movq 0x2730ec(%rip), %rdi    # 0x29bf28
movl $0xe10, %eax            # imm = 0xE10
cqto
idivq 0x25172e(%rip)          # 0x27a578
subq %rax, %rdi
callq 0x28900
jmp 0x28f58
cmpl $0x3c, -0x4(%rbp)
jne 0x28e9a
movzbl 0x2730bc(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28e6e
jmp 0x28c49
cmpq $0x0, 0x251702(%rip)    # 0x27a578
jle 0x28e95
movq 0x2730a9(%rip), %rdi    # 0x29bf28
movl $0x15180, %eax          # imm = 0x15180
cqto
idivq 0x2516eb(%rip)          # 0x27a578
addq %rax, %rdi
callq 0x28900
jmp 0x28f56
cmpl $0x3e, -0x4(%rbp)
jne 0x28eda
movzbl 0x273079(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28eb1
jmp 0x28c49
cmpq $0x0, 0x2516bf(%rip)    # 0x27a578
jle 0x28ed8
movq 0x273066(%rip), %rdi    # 0x29bf28
movl $0x15180, %eax          # imm = 0x15180
cqto
idivq 0x2516a8(%rip)          # 0x27a578
subq %rax, %rdi
callq 0x28900
jmp 0x28f54
cmpl $0x5b, -0x4(%rbp)
jne 0x28f10
movzbl 0x273039(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28ef1
jmp 0x28c49
cmpq $0x0, 0x25167f(%rip)    # 0x27a578
jle 0x28f0e
movq 0x273026(%rip), %rdi    # 0x29bf28
addq 0x251677(%rip), %rdi    # 0x27a580
callq 0x28900
jmp 0x28f52
cmpl $0x5d, -0x4(%rbp)
jne 0x28f46
movzbl 0x273003(%rip), %eax    # 0x29bf20
cmpl $0x0, %eax
jne 0x28f27
jmp 0x28c49
cmpq $0x0, 0x251649(%rip)    # 0x27a578
jle 0x28f44
movq 0x272ff0(%rip), %rdi    # 0x29bf28
subq 0x251641(%rip), %rdi    # 0x27a580
callq 0x28900
jmp 0x28f50
movl $0x1, %edi
callq 0x14e40
jmp 0x28f52
jmp 0x28f54
jmp 0x28f56
jmp 0x28f58
jmp 0x28f5a
jmp 0x28f5c
jmp 0x28f5e
jmp 0x28f60
jmp 0x28f62
jmp 0x28f64
jmp 0x28f66
jmp 0x28f68
addq $0x10, %rsp
popq %rbp
retq
nop