// File: /workspace/github_cpp_makefile_star2_O1/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
cmpl $0x0, 0x145c52(%rip)    # 0x16a050
jle 0x2443b
xorl %r12d, %r12d
leaq 0x317e16(%rip), %r14    # 0x33c220
xorl %r15d, %r15d
movl %r15d, %edi
callq 0x23dc7
movq %r14, %rdi
callq 0x9120
movq %rax, %rbx
movl %r12d, %eax
cmpq %rax, %rbx
cmovbel %r12d, %ebx
incl %r15d
movl %ebx, %r12d
cmpl 0x145c19(%rip), %r15d   # 0x16a050
jl 0x2440d
jmp 0x2443d
xorl %ebx, %ebx
leaq 0x2e8364(%rip), %rax    # 0x30c7a8
cmpb $0x60, (%rax)
jne 0x2471f
leaq 0x1f43ac(%rip), %r14    # 0x218800
movl (%r14), %edx
decl %edx
leaq 0x1f441c(%rip), %rax    # 0x21887c
movl (%rax), %ecx
decl %ecx
xorl %edi, %edi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0xf30c
leaq 0x3173b5(%rip), %rax    # 0x33b82c
movl (%rax), %eax
testl %eax, %eax
je 0x244a3
cmpl $0x2, %eax
jne 0x24575
xorl %edi, %edi
movl $0x1, %esi
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20bdd
imull $0x64, (%r14), %ecx
leal 0x7(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x3, %eax
leal 0x8(%rbx), %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %r14d
leaq 0x31b149(%rip), %rax    # 0x33f60c
leaq 0x1f434a(%rip), %rcx    # 0x218814
movl (%rcx), %r15d
movl (%rax), %eax
imull %r15d, %eax
imull $0x64, %eax, %ecx
leal 0xf(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x4, %eax
cltd
idivl 0x145b68(%rip)          # 0x16a050
cmpl %r14d, %eax
cmovll %eax, %r14d
movl $0x1f4, %eax            # imm = 0x1F4
cmpl %eax, %r14d
cmovgel %eax, %r14d
leaq 0x1ff03e(%rip), %rax    # 0x223540
movl (%rax), %ecx
movl %ecx, -0x34(%rbp)
leaq 0x1ff036(%rip), %r12    # 0x223544
movl (%r12), %ecx
movl %ecx, -0x30(%rbp)
leaq 0x1f42f4(%rip), %rcx    # 0x218810
movl (%rcx), %ecx
movl %ecx, -0x2c(%rbp)
movl $0x1, (%rax)
leaq 0xfe546(%rip), %rcx     # 0x122a74
xorl %edi, %edi
xorl %esi, %esi
movl $0xf, %edx
callq 0xe7d0
movl 0x31e7fe(%rip), %eax    # 0x342d40
cmpl $0x2, %eax
movl %r15d, -0x38(%rbp)
je 0x245a8
cmpl $0x8, %eax
je 0x2458b
cmpl $0x10, %eax
jne 0x245c5
movl 0x145b05(%rip), %eax    # 0x16a060
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x317cb7(%rip), %rdi    # 0x33c220
leaq 0xe925f(%rip), %rsi     # 0x10d7cf
jmp 0x24611
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20ca0
movl 0x145acf(%rip), %eax    # 0x16a060
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x317c81(%rip), %rdi    # 0x33c220
leaq 0xe922f(%rip), %rsi     # 0x10d7d5
jmp 0x24611
movl 0x145ab2(%rip), %eax    # 0x16a060
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x317c64(%rip), %rdi    # 0x33c220
leaq 0xe9218(%rip), %rsi     # 0x10d7db
jmp 0x24611
cmpl $0x0, 0x31e77c(%rip)    # 0x342d48
movl 0x145a8e(%rip), %edx    # 0x16a060
je 0x245ed
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
leaq 0x317c3e(%rip), %rdi    # 0x33c220
leaq 0xe91f8(%rip), %rsi     # 0x10d7e1
movl %eax, %edx
jmp 0x24611
testl %edx, %edx
js 0x24601
leaq 0x317c28(%rip), %rdi    # 0x33c220
leaq 0xe91ee(%rip), %rsi     # 0x10d7ed
jmp 0x24611
negl %edx
leaq 0x317c16(%rip), %rdi    # 0x33c220
leaq 0xe91d6(%rip), %rsi     # 0x10d7e7
xorl %eax, %eax
callq 0x9060
movsd 0x145a38(%rip), %xmm0   # 0x16a058
movsd %xmm0, -0x40(%rbp)
leaq 0x317bf4(%rip), %r15    # 0x33c220
movq %r15, %rdi
callq 0x9120
addq %r15, %rax
movsd -0x40(%rbp), %xmm0
ucomisd 0xe4a2c(%rip), %xmm0    # 0x109070
jne 0x24654
jp 0x24654
movabsq $0x4e41494441522020, %rcx # imm = 0x4E41494441522020
jmp 0x2465e
movabsq $0x4545524745442020, %rcx # imm = 0x4545524745442020
movq %rcx, (%rax)
movw $0x53, 0x8(%rax)
leaq 0x317bb2(%rip), %rcx    # 0x33c220
xorl %r15d, %r15d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0xf, %edx
callq 0xe7d0
movl %r14d, (%r12)
leaq 0xfe3e7(%rip), %rcx     # 0x122a74
xorl %edi, %edi
movl $0x1, %esi
movl $0xf, %edx
callq 0xe7d0
movl 0x1459ab(%rip), %r14d   # 0x16a050
testl %r14d, %r14d
jle 0x246ef
decl %r14d
leaq -0x140(%rbp), %r13
movl %r14d, %edi
callq 0x23dc7
movq %r13, %rdi
movl %ebx, %esi
leaq 0x317b58(%rip), %rdx    # 0x33c220
callq 0x24376
leal 0x1(%r15), %r12d
movl %r15d, %edi
movl $0x1, %esi
movl $0xf, %edx
movq %r13, %rcx
callq 0xe7d0
movl %r12d, %r15d
addl $-0x1, %r14d
jb 0x246b4
leaq 0x1fee4e(%rip), %rax    # 0x223544
movl -0x30(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1fee3e(%rip), %rax    # 0x223540
movl -0x34(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1f4102(%rip), %rax    # 0x218810
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1f40fa(%rip), %rax    # 0x218814
movl -0x38(%rbp), %ecx
movl %ecx, (%rax)
xorl %edi, %edi
callq 0x23dc7
leaq 0x31a273(%rip), %rdi    # 0x33e9a0
leaq 0x317aec(%rip), %r14    # 0x33c220
movl %ebx, %esi
movq %r14, %rdx
callq 0x24376
movl $0x1, %edi
callq 0x23dc7
leaq 0x31a3a1(%rip), %rdi    # 0x33eaf0
movl %ebx, %esi
movq %r14, %rdx
callq 0x24376
movl $0x2, %edi
callq 0x23dc7
leaq 0x31a4d6(%rip), %rdi    # 0x33ec40
movl %ebx, %esi
movq %r14, %rdx
callq 0x24376
movl $0x3, %edi
callq 0x23dc7
leaq 0x31a60b(%rip), %rdi    # 0x33ed90
movl %ebx, %esi
movq %r14, %rdx
callq 0x24376
cmpl $0x5, 0x1458ba(%rip)    # 0x16a050
jl 0x247b7
movl $0x4, %edi
callq 0x23dc7
leaq 0x31a737(%rip), %rdi    # 0x33eee0
leaq 0x317a70(%rip), %rdx    # 0x33c220
movl %ebx, %esi
callq 0x24376
cmpl $0x6, 0x145892(%rip)    # 0x16a050
jl 0x247df
movl $0x5, %edi
callq 0x23dc7
leaq 0x31a85f(%rip), %rdi    # 0x33f030
leaq 0x317a48(%rip), %rdx    # 0x33c220
movl %ebx, %esi
callq 0x24376
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq