// File: jkingan[P]ladyheather/heathui.cpp
// Function: rpn_show()
void rpn_show()
{
unsigned max_len;
int i;
int x,y;
int scale;
int row, col;
char buf[SLEN+1];
int old_vc_scale;
int old_vc_fonts;
int oldh, oldw;

   // show current stack values
   max_len = 0;
   for(i=0; i<RPN_SIZE; i++) {  // find longest formatted string
      if(strlen(rpn_fmt(i)) > max_len) max_len = strlen(out);
   }

   // format and show the rpn stack (pretty printed)
   if(zoom_screen == '`') {
      fill_rectangle(0,0, SCREEN_WIDTH-1,PLOT_ROW-1, BLACK);
      if(show_rpn_help == 2) {
         show_rpn_defines(0, 1);
         return;
      }
      else if(show_rpn_help) {
         rpn_help();
         return;
      }

      x = (SCREEN_WIDTH*100/8) / (max_len+8);
      y = (((EDIT_ROW*TEXT_HEIGHT)*100)/16) / RPN_SIZE;
      scale = x;
      if(y < scale) scale = y;
      if(scale > 500) scale = 500;

      old_vc_fonts = use_vc_fonts;
      old_vc_scale = vc_font_scale;
      oldh = TEXT_HEIGHT;
      oldw = TEXT_WIDTH;
      use_vc_fonts = 1;
      vidstr(0,0, WHITE, " ");

      if(hex_mode == 16)       sprintf(out, "HEX%d", IABS(rpn_format));
      else if(hex_mode == 8)   sprintf(out, "OCT%d", IABS(rpn_format));
      else if(hex_mode == 2)   sprintf(out, "BIN%d", IABS(rpn_format));
      else if(eng_mode)        sprintf(out, "ENG%d", IABS(rpn_format));
      else if(rpn_format < 0)  sprintf(out, "SCI%d", IABS(rpn_format));
      else                     sprintf(out, "FIX%d", IABS(rpn_format));
      if(deg_mode == 1.0)      strcat(out,  "  RADIANS");
      else                     strcat(out,  "  DEGREES");
      vidstr(-1,0, WHITE, out);

      vc_font_scale = scale;

      col = 1;
      row = 0;
      vidstr(row,col, WHITE, " ");  // inits font scale factor

      for(i=RPN_SIZE-1; i>=0; i--) {
         rpn_space(buf, max_len, rpn_fmt(i));
         vidstr(row++,col, WHITE, buf);
      }

      vc_font_scale = old_vc_scale;
      use_vc_fonts = old_vc_fonts;
      TEXT_WIDTH = oldw;
      TEXT_HEIGHT = oldh;
   }
// else {
      rpn_space(debug_text,  max_len, rpn_fmt(0));
      rpn_space(debug_text2, max_len, rpn_fmt(1));
      rpn_space(debug_text3, max_len, rpn_fmt(2));
      rpn_space(debug_text4, max_len, rpn_fmt(3));
      if(RPN_SIZE > 4) rpn_space(debug_text5, max_len, rpn_fmt(4));
      if(RPN_SIZE > 5) rpn_space(debug_text6, max_len, rpn_fmt(5));
// }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movl $0x0, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x1963be(%rip), %eax    # 0x1c9040
jge 0x32cb8
movl -0x8(%rbp), %edi
callq 0x31d60
movq %rax, %rdi
callq 0x9120
movl -0x4(%rbp), %ecx
cmpq %rcx, %rax
jbe 0x32cab
leaq 0x36875d(%rip), %rdi    # 0x39b400
callq 0x9120
movl %eax, -0x4(%rbp)
jmp 0x32cad
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x32c79
leaq 0x338cc9(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x60, %eax
jne 0x330ef
leaq 0x244d0e(%rip), %rax    # 0x2779e0
movl (%rax), %edx
subl $0x1, %edx
leaq 0x244d7e(%rip), %rax    # 0x277a5c
movl (%rax), %ecx
subl $0x1, %ecx
xorl %r8d, %r8d
movl %r8d, %edi
movl %r8d, %esi
callq 0x120d0
leaq 0x367d14(%rip), %rax    # 0x39aa0c
cmpl $0x2, (%rax)
jne 0x32d0e
xorl %edi, %edi
movl $0x1, %esi
callq 0x2e2b0
jmp 0x331ee
leaq 0x367cf7(%rip), %rax    # 0x39aa0c
cmpl $0x0, (%rax)
je 0x32d24
callq 0x2e3a0
jmp 0x331ee
jmp 0x32d26
leaq 0x244cb3(%rip), %rax    # 0x2779e0
imull $0x64, (%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl -0x4(%rbp), %ecx
addl $0x8, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0xc(%rbp)
leaq 0x36baa0(%rip), %rax    # 0x39e7ec
movl (%rax), %eax
leaq 0x244c9f(%rip), %rcx    # 0x2779f4
imull (%rcx), %eax
imull $0x64, %eax, %eax
movl $0x10, %ecx
cltd
idivl %ecx
cltd
idivl 0x1962d6(%rip)          # 0x1c9040
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x32d81
movl -0x10(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x1f4, -0x14(%rbp)     # imm = 0x1F4
jle 0x32d91
movl $0x1f4, -0x14(%rbp)     # imm = 0x1F4
leaq 0x24f988(%rip), %rax    # 0x282720
movl (%rax), %eax
movl %eax, -0x128(%rbp)
leaq 0x24f97d(%rip), %rax    # 0x282724
movl (%rax), %eax
movl %eax, -0x124(%rbp)
leaq 0x244c3e(%rip), %rax    # 0x2779f4
movl (%rax), %eax
movl %eax, -0x12c(%rbp)
leaq 0x244c2b(%rip), %rax    # 0x2779f0
movl (%rax), %eax
movl %eax, -0x130(%rbp)
leaq 0x24f94c(%rip), %rax    # 0x282720
movl $0x1, (%rax)
xorl %esi, %esi
movl $0xf, %edx
leaq 0x152ffc(%rip), %rcx    # 0x185de4
movl %esi, %edi
callq 0x10ee0
cmpl $0x10, 0x36f12a(%rip)   # 0x3a1f20
jne 0x32e3d
cmpl $0x0, 0x196251(%rip)    # 0x1c9050
jge 0x32e11
xorl %eax, %eax
subl 0x196247(%rip), %eax    # 0x1c9050
movl %eax, -0x134(%rbp)
jmp 0x32e1d
movl 0x196239(%rip), %eax    # 0x1c9050
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %edx
leaq 0x3685d6(%rip), %rdi    # 0x39b400
leaq 0x13f2f6(%rip), %rsi    # 0x172127
movb $0x0, %al
callq 0x9060
jmp 0x32fba
cmpl $0x8, 0x36f0dc(%rip)    # 0x3a1f20
jne 0x32e8b
cmpl $0x0, 0x196203(%rip)    # 0x1c9050
jge 0x32e5f
xorl %eax, %eax
subl 0x1961f9(%rip), %eax    # 0x1c9050
movl %eax, -0x138(%rbp)
jmp 0x32e6b
movl 0x1961eb(%rip), %eax    # 0x1c9050
movl %eax, -0x138(%rbp)
movl -0x138(%rbp), %edx
leaq 0x368588(%rip), %rdi    # 0x39b400
leaq 0x13f2ae(%rip), %rsi    # 0x17212d
movb $0x0, %al
callq 0x9060
jmp 0x32fb8
cmpl $0x2, 0x36f08e(%rip)    # 0x3a1f20
jne 0x32ed9
cmpl $0x0, 0x1961b5(%rip)    # 0x1c9050
jge 0x32ead
xorl %eax, %eax
subl 0x1961ab(%rip), %eax    # 0x1c9050
movl %eax, -0x13c(%rbp)
jmp 0x32eb9
movl 0x19619d(%rip), %eax    # 0x1c9050
movl %eax, -0x13c(%rbp)
movl -0x13c(%rbp), %edx
leaq 0x36853a(%rip), %rdi    # 0x39b400
leaq 0x13f266(%rip), %rsi    # 0x172133
movb $0x0, %al
callq 0x9060
jmp 0x32fb6
cmpl $0x0, 0x36f048(%rip)    # 0x3a1f28
je 0x32f27
cmpl $0x0, 0x196167(%rip)    # 0x1c9050
jge 0x32efb
xorl %eax, %eax
subl 0x19615d(%rip), %eax    # 0x1c9050
movl %eax, -0x140(%rbp)
jmp 0x32f07
movl 0x19614f(%rip), %eax    # 0x1c9050
movl %eax, -0x140(%rbp)
movl -0x140(%rbp), %edx
leaq 0x3684ec(%rip), %rdi    # 0x39b400
leaq 0x13f21e(%rip), %rsi    # 0x172139
movb $0x0, %al
callq 0x9060
jmp 0x32fb4
cmpl $0x0, 0x196122(%rip)    # 0x1c9050
jge 0x32f72
cmpl $0x0, 0x196119(%rip)    # 0x1c9050
jge 0x32f49
xorl %eax, %eax
subl 0x19610f(%rip), %eax    # 0x1c9050
movl %eax, -0x144(%rbp)
jmp 0x32f55
movl 0x196101(%rip), %eax    # 0x1c9050
movl %eax, -0x144(%rbp)
movl -0x144(%rbp), %edx
leaq 0x36849e(%rip), %rdi    # 0x39b400
leaq 0x13f1d6(%rip), %rsi    # 0x17213f
movb $0x0, %al
callq 0x9060
jmp 0x32fb2
cmpl $0x0, 0x1960d7(%rip)    # 0x1c9050
jge 0x32f8b
xorl %eax, %eax
subl 0x1960cd(%rip), %eax    # 0x1c9050
movl %eax, -0x148(%rbp)
jmp 0x32f97
movl 0x1960bf(%rip), %eax    # 0x1c9050
movl %eax, -0x148(%rbp)
movl -0x148(%rbp), %edx
leaq 0x36845c(%rip), %rdi    # 0x39b400
leaq 0x13f19a(%rip), %rsi    # 0x172145
movb $0x0, %al
callq 0x9060
jmp 0x32fb4
jmp 0x32fb6
jmp 0x32fb8
jmp 0x32fba
movsd 0x196086(%rip), %xmm0   # 0x1c9048
movsd 0x13c09e(%rip), %xmm1   # 0x16f068
ucomisd %xmm1, %xmm0
jne 0x32fe7
jp 0x32fe7
leaq 0x368427(%rip), %rdi    # 0x39b400
leaq 0x13f16b(%rip), %rsi    # 0x17214b
callq 0x96a0
jmp 0x32ffa
leaq 0x368412(%rip), %rdi    # 0x39b400
leaq 0x13f160(%rip), %rsi    # 0x172155
callq 0x96a0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0xf, %edx
leaq 0x3683f3(%rip), %rcx    # 0x39b400
callq 0x10ee0
movl -0x14(%rbp), %ecx
leaq 0x24f708(%rip), %rax    # 0x282724
movl %ecx, (%rax)
movl $0x1, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %edi
movl -0x1c(%rbp), %esi
movl $0xf, %edx
leaq 0x152da6(%rip), %rcx    # 0x185de4
callq 0x10ee0
movl 0x195ff7(%rip), %eax    # 0x1c9040
subl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jl 0x330b3
leaq -0x120(%rbp), %rax
movq %rax, -0x158(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x14c(%rbp)
movl -0x8(%rbp), %edi
callq 0x31d60
movq -0x158(%rbp), %rdi
movl -0x14c(%rbp), %esi
movq %rax, %rdx
callq 0x32bc0
movl -0x18(%rbp), %edi
movl %edi, %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %esi
leaq -0x120(%rbp), %rcx
movl $0xf, %edx
callq 0x10ee0
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x3304f
movl -0x124(%rbp), %ecx
leaq 0x24f664(%rip), %rax    # 0x282724
movl %ecx, (%rax)
movl -0x128(%rbp), %ecx
leaq 0x24f651(%rip), %rax    # 0x282720
movl %ecx, (%rax)
movl -0x130(%rbp), %ecx
leaq 0x244912(%rip), %rax    # 0x2779f0
movl %ecx, (%rax)
movl -0x12c(%rbp), %ecx
leaq 0x244907(%rip), %rax    # 0x2779f4
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
movl %eax, -0x168(%rbp)
xorl %edi, %edi
callq 0x31d60
movl -0x168(%rbp), %esi
movq %rax, %rdx
leaq 0x36aa71(%rip), %rdi    # 0x39db80
callq 0x32bc0
movl -0x4(%rbp), %eax
movl %eax, -0x164(%rbp)
movl $0x1, %edi
callq 0x31d60
movl -0x164(%rbp), %esi
movq %rax, %rdx
leaq 0x36ab99(%rip), %rdi    # 0x39dcd0
callq 0x32bc0
movl -0x4(%rbp), %eax
movl %eax, -0x160(%rbp)
movl $0x2, %edi
callq 0x31d60
movl -0x160(%rbp), %esi
movq %rax, %rdx
leaq 0x36acc1(%rip), %rdi    # 0x39de20
callq 0x32bc0
movl -0x4(%rbp), %eax
movl %eax, -0x15c(%rbp)
movl $0x3, %edi
callq 0x31d60
movl -0x15c(%rbp), %esi
movq %rax, %rdx
leaq 0x36ade9(%rip), %rdi    # 0x39df70
callq 0x32bc0
cmpl $0x4, 0x195ead(%rip)    # 0x1c9040
jle 0x331bd
movl -0x4(%rbp), %eax
movl %eax, -0x16c(%rbp)
movl $0x4, %edi
callq 0x31d60
movl -0x16c(%rbp), %esi
movq %rax, %rdx
leaq 0x36af08(%rip), %rdi    # 0x39e0c0
callq 0x32bc0
cmpl $0x5, 0x195e7c(%rip)    # 0x1c9040
jle 0x331ee
movl -0x4(%rbp), %eax
movl %eax, -0x170(%rbp)
movl $0x5, %edi
callq 0x31d60
movl -0x170(%rbp), %esi
movq %rax, %rdx
leaq 0x36b027(%rip), %rdi    # 0x39e210
callq 0x32bc0
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw (%rax,%rax)