// File: jkingan[P]ladyheather/heathui.cpp
// Function: get_rpn_num()
double get_rpn_num()
{
double val;
unsigned i, j;
int c;

   // decode ascii value (can be integer hex or binary string) and
   // push value onto stack

   if((msg_field[0] == '0') && (msg_field[1] == 'x')) {  // hex integer
      strupr(msg_field);
      i = strlen(msg_field);
      val = 0.0;
      for(j=2; j<i; j++) {
         c = msg_field[j];
         if((c >= '0') && (c <= '9')) c = (c - '0');
         else if((c >= 'A') && (c <= 'F')) c = (c - 'A' + 10);
         val = (val * 16.0) + (double) c;
      }
   }
   else if((msg_field[0] == '0') && (msg_field[1] == 'o')) {  // octal integer
      i = strlen(msg_field);
      val = 0.0;
      for(j=2; j<i; j++) {
         c = msg_field[j] - '0';
         val = (val * 8.0) + (double) c;
      }
   }
   else if((msg_field[0] == '0') && (msg_field[1] == 'b')) {  // binary integer
      i = strlen(msg_field);
      val = 0.0;
      for(j=2; j<i; j++) {
         c = msg_field[j] - '0';
         val = (val * 2.0) + (double) c;
      }
   }
   else val = atof(msg_field);

   last_rpn0 = rpn[0];
   rpn_push(val);
   last_was_clx = 0;
   return rpn[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x367671(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x33674
leaq 0x36765e(%rip), %rax    # 0x39ac20
movsbl 0x1(%rax), %eax
cmpl $0x78, %eax
jne 0x33674
leaq 0x36764a(%rip), %rdi    # 0x39ac20
callq 0x9890
leaq 0x36763e(%rip), %rdi    # 0x39ac20
callq 0x9120
movl %eax, -0xc(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x2, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x3366f
movl -0x10(%rbp), %eax
movl %eax, %ecx
leaq 0x367613(%rip), %rax    # 0x39ac20
movsbl (%rax,%rcx), %eax
movl %eax, -0x14(%rbp)
cmpl $0x30, -0x14(%rbp)
jl 0x3362b
cmpl $0x39, -0x14(%rbp)
jg 0x3362b
movl -0x14(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x14(%rbp)
jmp 0x33645
cmpl $0x41, -0x14(%rbp)
jl 0x33643
cmpl $0x46, -0x14(%rbp)
jg 0x33643
movl -0x14(%rbp), %eax
subl $0x41, %eax
addl $0xa, %eax
movl %eax, -0x14(%rbp)
jmp 0x33645
movsd -0x8(%rbp), %xmm0
cvtsi2sdl -0x14(%rbp), %xmm1
movsd 0x13df89(%rip), %xmm2   # 0x1715e0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x335f9
jmp 0x33792
leaq 0x3675a5(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x336fe
leaq 0x367596(%rip), %rax    # 0x39ac20
movsbl 0x1(%rax), %eax
cmpl $0x6f, %eax
jne 0x336fe
leaq 0x367586(%rip), %rdi    # 0x39ac20
callq 0x9120
movl %eax, -0xc(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x2, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x336f9
movl -0x10(%rbp), %eax
movl %eax, %ecx
leaq 0x36755b(%rip), %rax    # 0x39ac20
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
movl %eax, -0x14(%rbp)
movsd -0x8(%rbp), %xmm0
cvtsi2sdl -0x14(%rbp), %xmm1
movsd 0x13def7(%rip), %xmm2   # 0x1715d8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x336b1
jmp 0x33790
leaq 0x36751b(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x3377d
leaq 0x36750c(%rip), %rax    # 0x39ac20
movsbl 0x1(%rax), %eax
cmpl $0x62, %eax
jne 0x3377d
leaq 0x3674fc(%rip), %rdi    # 0x39ac20
callq 0x9120
movl %eax, -0xc(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x2, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x3377b
movl -0x10(%rbp), %eax
movl %eax, %ecx
leaq 0x3674d1(%rip), %rax    # 0x39ac20
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
movl %eax, -0x14(%rbp)
movsd -0x8(%rbp), %xmm0
cvtsi2sdl -0x14(%rbp), %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x3373b
jmp 0x3378e
leaq 0x36749c(%rip), %rdi    # 0x39ac20
callq 0x9480
movsd %xmm0, -0x8(%rbp)
jmp 0x33790
jmp 0x33792
movsd 0x36e3b6(%rip), %xmm0   # 0x3a1b50
movsd %xmm0, 0x36e776(%rip)   # 0x3a1f18
movsd -0x8(%rbp), %xmm0
callq 0x2eba0
movl $0x0, 0x36e75a(%rip)    # 0x3a1f10
movsd 0x36e392(%rip), %xmm0   # 0x3a1b50
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)