// File: /workspace/github_cpp_makefile_star2_O3/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, 0x145e3f(%rip)    # 0x16a050
jle 0x2424e
xorl %r12d, %r12d
leaq 0x318003(%rip), %r14    # 0x33c220
xorl %r15d, %r15d
movl %r15d, %edi
callq 0x23b9b
movq %r14, %rdi
callq 0x9120
movq %rax, %rbx
movl %r12d, %eax
cmpq %rax, %rbx
cmovbel %r12d, %ebx
incl %r15d
movl %ebx, %r12d
cmpl 0x145e06(%rip), %r15d   # 0x16a050
jl 0x24220
jmp 0x24250
xorl %ebx, %ebx
leaq 0x2e8551(%rip), %rax    # 0x30c7a8
cmpb $0x60, (%rax)
jne 0x24532
leaq 0x1f4599(%rip), %r14    # 0x218800
movl (%r14), %edx
decl %edx
leaq 0x1f4609(%rip), %rax    # 0x21887c
movl (%rax), %ecx
decl %ecx
xorl %edi, %edi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0xf298
leaq 0x3175a2(%rip), %rax    # 0x33b82c
movl (%rax), %eax
testl %eax, %eax
je 0x242b6
cmpl $0x2, %eax
jne 0x24388
xorl %edi, %edi
movl $0x1, %esi
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20ba5
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 0x31b336(%rip), %rax    # 0x33f60c
leaq 0x1f4537(%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 0x145d55(%rip)          # 0x16a050
cmpl %r14d, %eax
cmovll %eax, %r14d
movl $0x1f4, %eax            # imm = 0x1F4
cmpl %eax, %r14d
cmovgel %eax, %r14d
leaq 0x1ff22b(%rip), %rax    # 0x223540
movl (%rax), %ecx
movl %ecx, -0x34(%rbp)
leaq 0x1ff223(%rip), %r12    # 0x223544
movl (%r12), %ecx
movl %ecx, -0x30(%rbp)
leaq 0x1f44e1(%rip), %rcx    # 0x218810
movl (%rcx), %ecx
movl %ecx, -0x2c(%rbp)
movl $0x1, (%rax)
leaq 0xfe813(%rip), %rcx     # 0x122b54
xorl %edi, %edi
xorl %esi, %esi
movl $0xf, %edx
callq 0xe787
movl 0x31e9eb(%rip), %eax    # 0x342d40
cmpl $0x2, %eax
movl %r15d, -0x38(%rbp)
je 0x243bb
cmpl $0x8, %eax
je 0x2439e
cmpl $0x10, %eax
jne 0x243d8
movl 0x145cf2(%rip), %eax    # 0x16a060
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x317ea4(%rip), %rdi    # 0x33c220
leaq 0xe94e0(%rip), %rsi     # 0x10d863
jmp 0x24424
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20c6b
movl 0x145cbc(%rip), %eax    # 0x16a060
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x317e6e(%rip), %rdi    # 0x33c220
leaq 0xe94b0(%rip), %rsi     # 0x10d869
jmp 0x24424
movl 0x145c9f(%rip), %eax    # 0x16a060
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x317e51(%rip), %rdi    # 0x33c220
leaq 0xe9499(%rip), %rsi     # 0x10d86f
jmp 0x24424
cmpl $0x0, 0x31e969(%rip)    # 0x342d48
movl 0x145c7b(%rip), %edx    # 0x16a060
je 0x24400
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
leaq 0x317e2b(%rip), %rdi    # 0x33c220
leaq 0xe9479(%rip), %rsi     # 0x10d875
movl %eax, %edx
jmp 0x24424
testl %edx, %edx
js 0x24414
leaq 0x317e15(%rip), %rdi    # 0x33c220
leaq 0xe946f(%rip), %rsi     # 0x10d881
jmp 0x24424
negl %edx
leaq 0x317e03(%rip), %rdi    # 0x33c220
leaq 0xe9457(%rip), %rsi     # 0x10d87b
xorl %eax, %eax
callq 0x9060
movsd 0x145c25(%rip), %xmm0   # 0x16a058
movsd %xmm0, -0x40(%rbp)
leaq 0x317de1(%rip), %r15    # 0x33c220
movq %r15, %rdi
callq 0x9120
addq %r15, %rax
movsd -0x40(%rbp), %xmm0
ucomisd 0xe4c19(%rip), %xmm0    # 0x109070
jne 0x24467
jp 0x24467
movabsq $0x4e41494441522020, %rcx # imm = 0x4E41494441522020
jmp 0x24471
movabsq $0x4545524745442020, %rcx # imm = 0x4545524745442020
movq %rcx, (%rax)
movw $0x53, 0x8(%rax)
leaq 0x317d9f(%rip), %rcx    # 0x33c220
xorl %r15d, %r15d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0xf, %edx
callq 0xe787
movl %r14d, (%r12)
leaq 0xfe6b4(%rip), %rcx     # 0x122b54
xorl %edi, %edi
movl $0x1, %esi
movl $0xf, %edx
callq 0xe787
movl 0x145b98(%rip), %r14d   # 0x16a050
testl %r14d, %r14d
jle 0x24502
decl %r14d
leaq -0x140(%rbp), %r13
movl %r14d, %edi
callq 0x23b9b
movq %r13, %rdi
movl %ebx, %esi
leaq 0x317d45(%rip), %rdx    # 0x33c220
callq 0x24189
leal 0x1(%r15), %r12d
movl %r15d, %edi
movl $0x1, %esi
movl $0xf, %edx
movq %r13, %rcx
callq 0xe787
movl %r12d, %r15d
addl $-0x1, %r14d
jb 0x244c7
leaq 0x1ff03b(%rip), %rax    # 0x223544
movl -0x30(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1ff02b(%rip), %rax    # 0x223540
movl -0x34(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1f42ef(%rip), %rax    # 0x218810
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1f42e7(%rip), %rax    # 0x218814
movl -0x38(%rbp), %ecx
movl %ecx, (%rax)
xorl %edi, %edi
callq 0x23b9b
leaq 0x31a460(%rip), %rdi    # 0x33e9a0
leaq 0x317cd9(%rip), %r14    # 0x33c220
movl %ebx, %esi
movq %r14, %rdx
callq 0x24189
movl $0x1, %edi
callq 0x23b9b
leaq 0x31a58e(%rip), %rdi    # 0x33eaf0
movl %ebx, %esi
movq %r14, %rdx
callq 0x24189
movl $0x2, %edi
callq 0x23b9b
leaq 0x31a6c3(%rip), %rdi    # 0x33ec40
movl %ebx, %esi
movq %r14, %rdx
callq 0x24189
movl $0x3, %edi
callq 0x23b9b
leaq 0x31a7f8(%rip), %rdi    # 0x33ed90
movl %ebx, %esi
movq %r14, %rdx
callq 0x24189
cmpl $0x5, 0x145aa7(%rip)    # 0x16a050
jl 0x245f2
movl $0x4, %edi
callq 0x23b9b
leaq 0x31a924(%rip), %rdi    # 0x33eee0
leaq 0x317c5d(%rip), %rdx    # 0x33c220
movl %ebx, %esi
callq 0x24189
cmpl $0x6, 0x145a7f(%rip)    # 0x16a050
jl 0x245f2
movl $0x5, %edi
callq 0x23b9b
leaq 0x31aa4c(%rip), %rdi    # 0x33f030
leaq 0x317c35(%rip), %rdx    # 0x33c220
movl %ebx, %esi
callq 0x24189
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq