// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
xorl %r15d, %r15d
leaq 0x303c3c(%rip), %r14    # 0x326220
xorl %ebx, %ebx
cmpl 0x131a63(%rip), %r15d   # 0x154050
jge 0x2260e
movl %r15d, %edi
callq 0x21fd1
movq %r14, %rdi
callq 0x9120
movl %ebx, %ecx
cmpq %rcx, %rax
cmovbel %ebx, %eax
incl %r15d
movl %eax, %ebx
jmp 0x225e6
leaq 0x2d4193(%rip), %rax    # 0x2f67a8
cmpb $0x60, (%rax)
jne 0x228cc
leaq 0x1e01db(%rip), %r15    # 0x202800
movl (%r15), %edx
decl %edx
leaq 0x1e024b(%rip), %rax    # 0x20287c
movl (%rax), %ecx
decl %ecx
xorl %edi, %edi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0xed4b
leaq 0x3031e4(%rip), %rax    # 0x32582c
movl (%rax), %eax
testl %eax, %eax
je 0x22672
cmpl $0x2, %eax
jne 0x22735
pushq $0x1
popq %rsi
xorl %edi, %edi
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f705
imull $0x64, (%r15), %eax
pushq $0x8
popq %rcx
cltd
idivl %ecx
leal 0x8(%rbx), %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %r15d
leaq 0x306f7f(%rip), %rax    # 0x32960c
leaq 0x1e0180(%rip), %rcx    # 0x202814
movl (%rcx), %ecx
movl (%rax), %eax
movl %ecx, -0x38(%rbp)
imull %ecx, %eax
imull $0x64, %eax, %eax
pushq $0x10
popq %rcx
cltd
idivl %ecx
cltd
idivl 0x1319a2(%rip)          # 0x154050
cmpl %r15d, %eax
cmovll %eax, %r15d
movl $0x1f4, %eax            # imm = 0x1F4
cmpl %eax, %r15d
cmovgel %eax, %r15d
leaq 0x1eae78(%rip), %rax    # 0x20d540
movl (%rax), %ecx
movl %ecx, -0x34(%rbp)
leaq 0x1eae70(%rip), %r12    # 0x20d544
movl (%r12), %ecx
movl %ecx, -0x30(%rbp)
leaq 0x1e012e(%rip), %rcx    # 0x202810
movl (%rcx), %ecx
movl %ecx, -0x2c(%rbp)
movl $0x1, (%rax)
leaq 0xea3a8(%rip), %rcx     # 0x10ca9c
pushq $0xf
popq %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0xe2d2
movl 0x30a63a(%rip), %eax    # 0x32cd40
cmpl $0x2, %eax
je 0x22768
cmpl $0x8, %eax
je 0x2274b
cmpl $0x10, %eax
jne 0x22785
movl 0x131945(%rip), %eax    # 0x154060
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x303af7(%rip), %rdi    # 0x326220
leaq 0xd51b3(%rip), %rsi     # 0xf78e3
jmp 0x227d1
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f7cc
movl 0x13190f(%rip), %eax    # 0x154060
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x303ac1(%rip), %rdi    # 0x326220
leaq 0xd5183(%rip), %rsi     # 0xf78e9
jmp 0x227d1
movl 0x1318f2(%rip), %eax    # 0x154060
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x303aa4(%rip), %rdi    # 0x326220
leaq 0xd516c(%rip), %rsi     # 0xf78ef
jmp 0x227d1
cmpl $0x0, 0x30a5bc(%rip)    # 0x32cd48
movl 0x1318ce(%rip), %edx    # 0x154060
je 0x227ad
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
leaq 0x303a7e(%rip), %rdi    # 0x326220
leaq 0xd514c(%rip), %rsi     # 0xf78f5
movl %eax, %edx
jmp 0x227d1
testl %edx, %edx
js 0x227c1
leaq 0x303a68(%rip), %rdi    # 0x326220
leaq 0xd5142(%rip), %rsi     # 0xf7901
jmp 0x227d1
negl %edx
leaq 0x303a56(%rip), %rdi    # 0x326220
leaq 0xd512a(%rip), %rsi     # 0xf78fb
xorl %eax, %eax
callq 0x9060
movsd 0x131878(%rip), %xmm0   # 0x154058
movsd %xmm0, -0x40(%rbp)
movq %r14, %rdi
callq 0x9120
addq %r14, %rax
movsd -0x40(%rbp), %xmm0
ucomisd 0xd0873(%rip), %xmm0    # 0xf3070
jne 0x2280d
jp 0x2280d
movabsq $0x4e41494441522020, %rcx # imm = 0x4E41494441522020
jmp 0x22817
movabsq $0x4545524745442020, %rcx # imm = 0x4545524745442020
movq %rcx, (%rax)
movw $0x53, 0x8(%rax)
leaq 0x3039f9(%rip), %rcx    # 0x326220
pushq $-0x1
popq %rdi
xorl %r13d, %r13d
pushq $0xf
popq %r14
xorl %esi, %esi
movl %r14d, %edx
callq 0xe2d2
movl %r15d, (%r12)
leaq 0xea256(%rip), %rcx     # 0x10ca9c
pushq $0x1
popq %rsi
xorl %edi, %edi
movl %r14d, %edx
callq 0xe2d2
movl 0x1317f6(%rip), %r14d   # 0x154050
leaq -0x140(%rbp), %r12
testl %r14d, %r14d
jle 0x2289c
decl %r14d
movl %r14d, %edi
callq 0x21fd1
movq %r12, %rdi
movl %ebx, %esi
leaq 0x3039a3(%rip), %rdx    # 0x326220
callq 0x2255d
leal 0x1(%r13), %r15d
movl %r13d, %edi
pushq $0x1
popq %rsi
pushq $0xf
popq %rdx
movq %r12, %rcx
callq 0xe2d2
movl %r15d, %r13d
jmp 0x22861
leaq 0x1eaca1(%rip), %rax    # 0x20d544
movl -0x30(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1eac91(%rip), %rax    # 0x20d540
movl -0x34(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1dff55(%rip), %rax    # 0x202810
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1dff4d(%rip), %rax    # 0x202814
movl -0x38(%rbp), %ecx
movl %ecx, (%rax)
xorl %edi, %edi
callq 0x21fd1
leaq 0x3060c6(%rip), %rdi    # 0x3289a0
leaq 0x30393f(%rip), %r14    # 0x326220
movl %ebx, %esi
movq %r14, %rdx
callq 0x2255d
pushq $0x1
popq %rdi
callq 0x21fd1
leaq 0x3061f6(%rip), %rdi    # 0x328af0
movl %ebx, %esi
movq %r14, %rdx
callq 0x2255d
pushq $0x2
popq %rdi
callq 0x21fd1
leaq 0x30632d(%rip), %rdi    # 0x328c40
movl %ebx, %esi
movq %r14, %rdx
callq 0x2255d
pushq $0x3
popq %rdi
callq 0x21fd1
leaq 0x306464(%rip), %rdi    # 0x328d90
movl %ebx, %esi
movq %r14, %rdx
callq 0x2255d
cmpl $0x5, 0x131713(%rip)    # 0x154050
jl 0x22982
pushq $0x4
popq %rdi
callq 0x21fd1
leaq 0x306592(%rip), %rdi    # 0x328ee0
leaq 0x3038cb(%rip), %rdx    # 0x326220
movl %ebx, %esi
callq 0x2255d
cmpl $0x6, 0x1316ed(%rip)    # 0x154050
jl 0x22982
pushq $0x5
popq %rdi
callq 0x21fd1
leaq 0x3066bc(%rip), %rdi    # 0x329030
leaq 0x3038a5(%rip), %rdx    # 0x326220
movl %ebx, %esi
callq 0x2255d
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq