// File: jkingan[P]ladyheather/heathui.cpp
// Function: rpn_fmt(int)
char *rpn_fmt(int i)
{
int dp;
char *s;
char sign;
int exp;
char ee[32+1];
double val;
double thresh;
char *c;
int stack;
char buf[MAX_TEXT_COLS+1];
unsigned j;
int last_nib;
ITYPE ival;
ITYPE imask;
int inib;
int shift_count;

   // format stack entry i for screen display

   if(i < 0) i = 0-i;
   i = i % RPN_SIZE;
   stack = i;
   val = rpn[i];


   dp = rpn_format;
   if((val > BIG_NUM) || (val < (-BIG_NUM))) {  // to big to display as decimals
      if(dp > 0) dp = (0-dp);
   }

   if(1 && val && (dp > 0)) {  // display is in fixed point notation
      thresh = pow(0.1, dp);     // values below this would show as 0.0
      if(fabs(val) <= thresh) {  // ... so force exponent display
         dp = 0-dp;
      }
   }

   if     (i == 0) c = " X";
   else if(i == 1) c = " Y";
   else if(i == 2) c = " Z";
   else if(i == 3) c = " R";
   else if(i == 4) c = " S";
   else if(i == 5) c = " T";
   else if(i == 6) c = " U";
   else if(i == 7) c = " V";
   else if(i == 8) c = " W";
   else            c = "  ";

   // !!!! we need to use ITYPE here
   if(hex_mode == 16) {  // hexadecimal
      shift_count = 4;
      imask = 0x0F;
      ival = (ITYPE) val;
      i = 0;
      out[i++] = '0';
      out[i++] = 'x';
      out[i] = 0;
      goto fmt_ival;
   }
   else if(hex_mode == 8) {  // octal
      shift_count = 3;
      imask = 0x07;
      ival = (ITYPE) val;
      i = 0;
      out[i++] = '0';
      out[i++] = 'o';
      out[i] = 0;
      goto fmt_ival;
   }
   else if(hex_mode == 2) {  // binary
      shift_count = 1;
      imask = 0x01;
      ival = (ITYPE) val;
      i = 0;
      out[i++] = '0';
      out[i++] = 'b';
      out[i] = 0;

      fmt_ival:
      last_nib = 0;
      buf[0] = 0;
      for(j=0; j<ISIZE; j++) {  // format the value (in reverse order)
         inib = (int) (ival & imask);
         ival >>= shift_count;
         if(inib) {
            if(inib > 9) buf[j] = 'A'+(inib-10);
            else         buf[j] = '0'+inib;
            last_nib = j;
         }
         else buf[j] = '0';
         buf[j+1] = 0;
      }

      if(last_nib < dp) last_nib = dp;
      else ++last_nib;
      for(j=0; j<(unsigned)last_nib; j++) {  // reverse the string, maybe add commas
         out[i++] = buf[last_nib-j-1];
         if(comma_fmt && (last_nib-j-1)) {
            if(((last_nib-j-1) % 4) == 0) out[i++] = comma_fmt;
         }
         out[i] = 0;
      }

      strcat(out, c);
      return &out[0];
   }

   if(val >= 0.0) {
      s = "   ";  // aligns columns if negative value
      sign = ' ';
   }
   else {
      s = "  ";
      sign = '-';
      val = 0.0 - val;
   }
   strcpy(ee,c);


   if(dp < 0) {  // scentific / engineering format
      exp = 0;
      i = 0;
      if(val < 0.0) {
         while(val < 0.0) {
            val *= 10.0;
            --exp;
            if(++i >= 400) break;
         }
      }
      else if(val == 0.0) {
      }
      else if(1 && (val < 1.0)) {
         while(val < 1.0) {
            val *= 10.0;
            --exp;
            if(++i >= 400) break;
         }
      }
      else {
         while(val >= 10.0) {
            val /= 10.0;
            ++exp;
            if(++i >= 400) break;
         }
      }

      if(eng_mode) {  // make exponent a multiple of 3
         if(exp >= 0) {
            i = exp % 3;
            if(i == 1) { exp-=1; val*=10.0; }
            else if(i == 2) { exp-=2; val*=100.0; }
         }
         else {
            i = (0-exp) % 3;
            if(i == 1) { exp-=2; val*=100.0; }
            else if(i == 2) { exp-=1; val*=10.0; }
         }
      }

      if(exp < 0) sprintf(ee, "e-%03d%s", 0-exp, c);  // format exponent
      else        sprintf(ee, "e+%03d%s", exp, c);

      dp = 0-dp;
   }

   // format result string
   if     (dp == 0)  sprintf(out, "  %c%.0f%s",   sign,val,ee);
   else if(dp == 1)  sprintf(out, "  %c%.1f%s",   sign,val,ee);
   else if(dp == 2)  sprintf(out, "  %c%.2f%s",   sign,val,ee);
   else if(dp == 3)  sprintf(out, "  %c%.3f%s",   sign,val,ee);
   else if(dp == 4)  sprintf(out, "  %c%.4f%s",   sign,val,ee);
   else if(dp == 5)  sprintf(out, "  %c%.5f%s",   sign,val,ee);
   else if(dp == 6)  sprintf(out, "  %c%.6f%s",   sign,val,ee);
   else if(dp == 7)  sprintf(out, "  %c%.7f%s",   sign,val,ee);
   else if(dp == 8)  sprintf(out, "  %c%.8f%s",   sign,val,ee);
   else if(dp == 9)  sprintf(out, "  %c%.9f%s",   sign,val,ee);
   else if(dp == 10) sprintf(out, "  %c%.10f%s",  sign,val,ee);
   else if(dp == 11) sprintf(out, "  %c%.11f%s",  sign,val,ee);
   else if(dp == 12) sprintf(out, "  %c%.12f%s",  sign,val,ee);
   else if(dp == 13) sprintf(out, "  %c%.13f%s",  sign,val,ee);
   else if(dp == 14) sprintf(out, "  %c%.14f%s",  sign,val,ee);
   else if(dp == 15) sprintf(out, "  %c%.15f%s",  sign,val,ee);
   else if(dp == 16) sprintf(out, "  %c%.16f%s",  sign,val,ee);
   else              sprintf(out, "  %c%.8f%s",   sign,val,ee);

   s = strchr(out, '.');
   if(s && (comma_fmt == '.')) *s = ',';  // euro format

   if(comma_fmt && val) {  // optionally add commas to integer part
      buf[0] = 0;
      if(s) dp = s - &out[2] - 1;
      else  dp = strlen(out) - 2;

      if(dp > 3) {  // more than 3 digits
         j = dp % 3;
         for(i=0; i<(3+(int)j); i++) { // copy spaces, sign, and digits before the comma
            buf[i] = out[i];
            buf[i+1] = 0;
         }
         dp -= j;

         j = strlen(buf);
         if(i > 3) {
            buf[j++] = comma_fmt;  // add comma if more than 3 digits
            buf[j] = 0;
         }

         while(dp > 3) {  // copy next group of 3 digits and add comma
            dp -= 3;
            buf[j++] = out[i++];
            buf[j++] = out[i++];
            buf[j++] = out[i++];
            if(rpn_format && (dp > 0)) buf[j++] = comma_fmt;
            buf[j] = 0;
         }

         buf[j++] = out[i++];  // copy last group of 3 digits
         buf[j++] = out[i++];
         buf[j++] = out[i++];
         buf[j] = 0;

         while(out[i]) {   // copy fractional part
            buf[j++] = out[i++];
            buf[j] = 0;
         }
         strcpy(out, buf);
      }
   }

   return &out[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movl %edi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x31d7c
xorl %eax, %eax
subl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cltd
idivl 0x1972ba(%rip)          # 0x1c9040
movl %edx, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x6c(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x36fdb6(%rip), %rax    # 0x3a1b50
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movl 0x1972a6(%rip), %eax    # 0x1c9050
movl %eax, -0x10(%rbp)
movsd -0x58(%rbp), %xmm0
movsd 0x13d29e(%rip), %xmm1   # 0x16f058
ucomisd %xmm1, %xmm0
ja 0x31dcf
movsd 0x13d298(%rip), %xmm0   # 0x16f060
ucomisd -0x58(%rbp), %xmm0
jbe 0x31ddf
cmpl $0x0, -0x10(%rbp)
jle 0x31ddd
xorl %eax, %eax
subl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x31ddf
movsd -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x31df1
jp 0x31df1
jmp 0x31e31
cmpl $0x0, -0x10(%rbp)
jle 0x31e31
movl -0x10(%rbp), %edi
movsd 0x13d326(%rip), %xmm0   # 0x16f128
callq 0x798a0
movsd %xmm0, -0x60(%rbp)
movsd -0x58(%rbp), %xmm1
movaps 0x13d478(%rip), %xmm0   # 0x16f290
pand %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x31e2f
xorl %eax, %eax
subl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x31e31
cmpl $0x0, -0xc(%rbp)
jne 0x31e47
leaq 0x140206(%rip), %rax    # 0x172044
movq %rax, -0x68(%rbp)
jmp 0x31f00
cmpl $0x1, -0xc(%rbp)
jne 0x31e5d
leaq 0x1401f3(%rip), %rax    # 0x172047
movq %rax, -0x68(%rbp)
jmp 0x31efe
cmpl $0x2, -0xc(%rbp)
jne 0x31e73
leaq 0x1401e0(%rip), %rax    # 0x17204a
movq %rax, -0x68(%rbp)
jmp 0x31efc
cmpl $0x3, -0xc(%rbp)
jne 0x31e86
leaq 0x1475b8(%rip), %rax    # 0x179438
movq %rax, -0x68(%rbp)
jmp 0x31efa
cmpl $0x4, -0xc(%rbp)
jne 0x31e99
leaq 0x153821(%rip), %rax    # 0x1856b4
movq %rax, -0x68(%rbp)
jmp 0x31ef8
cmpl $0x5, -0xc(%rbp)
jne 0x31eac
leaq 0x1401a7(%rip), %rax    # 0x17204d
movq %rax, -0x68(%rbp)
jmp 0x31ef6
cmpl $0x6, -0xc(%rbp)
jne 0x31ebf
leaq 0x140197(%rip), %rax    # 0x172050
movq %rax, -0x68(%rbp)
jmp 0x31ef4
cmpl $0x7, -0xc(%rbp)
jne 0x31ed2
leaq 0x1603a3(%rip), %rax    # 0x19226f
movq %rax, -0x68(%rbp)
jmp 0x31ef2
cmpl $0x8, -0xc(%rbp)
jne 0x31ee5
leaq 0x153dbc(%rip), %rax    # 0x185c9b
movq %rax, -0x68(%rbp)
jmp 0x31ef0
leaq 0x153ef7(%rip), %rax    # 0x185de3
movq %rax, -0x68(%rbp)
jmp 0x31ef2
jmp 0x31ef4
jmp 0x31ef6
jmp 0x31ef8
jmp 0x31efa
jmp 0x31efc
jmp 0x31efe
jmp 0x31f00
cmpl $0x10, 0x370019(%rip)   # 0x3a1f20
jne 0x31fa1
movl $0x4, -0x290(%rbp)
movq $0xf, -0x288(%rbp)
movsd -0x58(%rbp), %xmm0
movsd 0x13f6a1(%rip), %xmm2   # 0x1715d0
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rcx
cvttsd2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x280(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x369490(%rip), %rax    # 0x39b400
movb $0x30, (%rax,%rcx)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x369477(%rip), %rax    # 0x39b400
movb $0x78, (%rax,%rcx)
movslq -0xc(%rbp), %rcx
leaq 0x369468(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
jmp 0x320de
cmpl $0x8, 0x36ff78(%rip)    # 0x3a1f20
jne 0x32042
movl $0x3, -0x290(%rbp)
movq $0x7, -0x288(%rbp)
movsd -0x58(%rbp), %xmm0
movsd 0x13f600(%rip), %xmm2   # 0x1715d0
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rcx
cvttsd2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x280(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x3693ef(%rip), %rax    # 0x39b400
movb $0x30, (%rax,%rcx)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x3693d6(%rip), %rax    # 0x39b400
movb $0x6f, (%rax,%rcx)
movslq -0xc(%rbp), %rcx
leaq 0x3693c7(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
jmp 0x320de
cmpl $0x2, 0x36fed7(%rip)    # 0x3a1f20
jne 0x322c7
movl $0x1, -0x290(%rbp)
movq $0x1, -0x288(%rbp)
movsd -0x58(%rbp), %xmm0
movsd 0x13f55f(%rip), %xmm2   # 0x1715d0
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rcx
cvttsd2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x280(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x36934e(%rip), %rax    # 0x39b400
movb $0x30, (%rax,%rcx)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x369335(%rip), %rax    # 0x39b400
movb $0x62, (%rax,%rcx)
movslq -0xc(%rbp), %rcx
leaq 0x369326(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl $0x0, -0x278(%rbp)
movb $0x0, -0x270(%rbp)
movl $0x0, -0x274(%rbp)
cmpl $0x40, -0x274(%rbp)
jae 0x321bd
movq -0x280(%rbp), %rax
andq -0x288(%rbp), %rax
movl %eax, -0x28c(%rbp)
movl -0x290(%rbp), %ecx
movq -0x280(%rbp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, -0x280(%rbp)
cmpl $0x0, -0x28c(%rbp)
je 0x32188
cmpl $0x9, -0x28c(%rbp)
jle 0x32162
movl -0x28c(%rbp), %eax
subl $0xa, %eax
addl $0x41, %eax
movb %al, %cl
movl -0x274(%rbp), %eax
movb %cl, -0x270(%rbp,%rax)
jmp 0x3217a
movl -0x28c(%rbp), %eax
addl $0x30, %eax
movb %al, %cl
movl -0x274(%rbp), %eax
movb %cl, -0x270(%rbp,%rax)
movl -0x274(%rbp), %eax
movl %eax, -0x278(%rbp)
jmp 0x32196
movl -0x274(%rbp), %eax
movb $0x30, -0x270(%rbp,%rax)
movl -0x274(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movb $0x0, -0x270(%rbp,%rax)
movl -0x274(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x274(%rbp)
jmp 0x320f9
movl -0x278(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x321d3
movl -0x10(%rbp), %eax
movl %eax, -0x278(%rbp)
jmp 0x321e2
movl -0x278(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x278(%rbp)
movl $0x0, -0x274(%rbp)
movl -0x274(%rbp), %eax
cmpl -0x278(%rbp), %eax
jae 0x322a7
movl -0x278(%rbp), %eax
subl -0x274(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
movb -0x270(%rbp,%rax), %dl
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x3691d5(%rip), %rax    # 0x39b400
movb %dl, (%rax,%rcx)
cmpl $0x0, 0x36fcef(%rip)    # 0x3a1f24
je 0x32284
movl -0x278(%rbp), %eax
subl -0x274(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
je 0x32284
movl -0x278(%rbp), %eax
subl -0x274(%rbp), %eax
subl $0x1, %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x32282
movl 0x36fcbc(%rip), %eax    # 0x3a1f24
movb %al, %dl
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x369181(%rip), %rax    # 0x39b400
movb %dl, (%rax,%rcx)
jmp 0x32284
movslq -0xc(%rbp), %rcx
leaq 0x369171(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl -0x274(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x274(%rbp)
jmp 0x321ec
movq -0x68(%rbp), %rsi
leaq 0x36914e(%rip), %rdi    # 0x39b400
callq 0x96a0
leaq 0x369142(%rip), %rax    # 0x39b400
movq %rax, -0x8(%rbp)
jmp 0x32bb2
jmp 0x322c9
jmp 0x322cb
movsd -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x322ea
leaq 0x153b02(%rip), %rax    # 0x185de2
movq %rax, -0x18(%rbp)
movb $0x20, -0x19(%rbp)
jmp 0x32306
leaq 0x153af2(%rip), %rax    # 0x185de3
movq %rax, -0x18(%rbp)
movb $0x2d, -0x19(%rbp)
xorps %xmm0, %xmm0
subsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x9350
cmpl $0x0, -0x10(%rbp)
jge 0x32530
movl $0x0, -0x20(%rbp)
movl $0x0, -0xc(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x58(%rbp), %xmm0
jbe 0x32375
jmp 0x32337
xorps %xmm0, %xmm0
ucomisd -0x58(%rbp), %xmm0
jbe 0x32370
movsd 0x13cd77(%rip), %xmm0   # 0x16f0c0
mulsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x190, %eax            # imm = 0x190
jl 0x3236e
jmp 0x32370
jmp 0x32337
jmp 0x32429
movsd -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3238a
jp 0x3238a
jmp 0x32427
movsd 0x13ccd6(%rip), %xmm0   # 0x16f068
ucomisd -0x58(%rbp), %xmm0
jbe 0x323db
jmp 0x3239b
movsd 0x13ccc5(%rip), %xmm0   # 0x16f068
ucomisd -0x58(%rbp), %xmm0
jbe 0x323d9
movsd 0x13cd0e(%rip), %xmm0   # 0x16f0c0
mulsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x190, %eax            # imm = 0x190
jl 0x323d7
jmp 0x323d9
jmp 0x3239b
jmp 0x32425
jmp 0x323dd
movsd -0x58(%rbp), %xmm0
movsd 0x13ccd6(%rip), %xmm1   # 0x16f0c0
ucomisd %xmm1, %xmm0
jb 0x32423
movsd -0x58(%rbp), %xmm0
movsd 0x13ccc3(%rip), %xmm1   # 0x16f0c0
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x190, %eax            # imm = 0x190
jl 0x32421
jmp 0x32423
jmp 0x323dd
jmp 0x32425
jmp 0x32427
jmp 0x32429
cmpl $0x0, 0x36faf8(%rip)    # 0x3a1f28
je 0x324ec
cmpl $0x0, -0x20(%rbp)
jl 0x32492
movl -0x20(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, -0xc(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x3246d
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
movsd 0x13cc5f(%rip), %xmm0   # 0x16f0c0
mulsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x32490
cmpl $0x2, -0xc(%rbp)
jne 0x3248e
movl -0x20(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x20(%rbp)
movsd 0x13cbcc(%rip), %xmm0   # 0x16f050
mulsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x32490
jmp 0x324ea
xorl %eax, %eax
subl -0x20(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, -0xc(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x324c5
movl -0x20(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x20(%rbp)
movsd 0x13cb97(%rip), %xmm0   # 0x16f050
mulsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x324e8
cmpl $0x2, -0xc(%rbp)
jne 0x324e6
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
movsd 0x13cbe4(%rip), %xmm0   # 0x16f0c0
mulsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x324e8
jmp 0x324ea
jmp 0x324ec
cmpl $0x0, -0x20(%rbp)
jge 0x3250f
leaq -0x50(%rbp), %rdi
xorl %edx, %edx
subl -0x20(%rbp), %edx
movq -0x68(%rbp), %rcx
leaq 0x13fb4d(%rip), %rsi    # 0x172053
movb $0x0, %al
callq 0x9060
jmp 0x32528
leaq -0x50(%rbp), %rdi
movl -0x20(%rbp), %edx
movq -0x68(%rbp), %rcx
leaq 0x13fb3b(%rip), %rsi    # 0x17205c
movb $0x0, %al
callq 0x9060
xorl %eax, %eax
subl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x3255d
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368eb6(%rip), %rdi    # 0x39b400
leaq 0x13fb14(%rip), %rsi    # 0x172065
movb $0x1, %al
callq 0x9060
jmp 0x32866
cmpl $0x1, -0x10(%rbp)
jne 0x3258a
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368e89(%rip), %rdi    # 0x39b400
leaq 0x13faf2(%rip), %rsi    # 0x172070
movb $0x1, %al
callq 0x9060
jmp 0x32864
cmpl $0x2, -0x10(%rbp)
jne 0x325b7
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368e5c(%rip), %rdi    # 0x39b400
leaq 0x13fad0(%rip), %rsi    # 0x17207b
movb $0x1, %al
callq 0x9060
jmp 0x32862
cmpl $0x3, -0x10(%rbp)
jne 0x325e4
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368e2f(%rip), %rdi    # 0x39b400
leaq 0x13faae(%rip), %rsi    # 0x172086
movb $0x1, %al
callq 0x9060
jmp 0x32860
cmpl $0x4, -0x10(%rbp)
jne 0x32611
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368e02(%rip), %rdi    # 0x39b400
leaq 0x13fa8c(%rip), %rsi    # 0x172091
movb $0x1, %al
callq 0x9060
jmp 0x3285e
cmpl $0x5, -0x10(%rbp)
jne 0x3263e
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368dd5(%rip), %rdi    # 0x39b400
leaq 0x13fa6a(%rip), %rsi    # 0x17209c
movb $0x1, %al
callq 0x9060
jmp 0x3285c
cmpl $0x6, -0x10(%rbp)
jne 0x3266b
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368da8(%rip), %rdi    # 0x39b400
leaq 0x13fa48(%rip), %rsi    # 0x1720a7
movb $0x1, %al
callq 0x9060
jmp 0x3285a
cmpl $0x7, -0x10(%rbp)
jne 0x32698
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368d7b(%rip), %rdi    # 0x39b400
leaq 0x13fa26(%rip), %rsi    # 0x1720b2
movb $0x1, %al
callq 0x9060
jmp 0x32858
cmpl $0x8, -0x10(%rbp)
jne 0x326c5
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368d4e(%rip), %rdi    # 0x39b400
leaq 0x13fa04(%rip), %rsi    # 0x1720bd
movb $0x1, %al
callq 0x9060
jmp 0x32856
cmpl $0x9, -0x10(%rbp)
jne 0x326f2
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368d21(%rip), %rdi    # 0x39b400
leaq 0x13f9e2(%rip), %rsi    # 0x1720c8
movb $0x1, %al
callq 0x9060
jmp 0x32854
cmpl $0xa, -0x10(%rbp)
jne 0x3271f
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368cf4(%rip), %rdi    # 0x39b400
leaq 0x13f9c0(%rip), %rsi    # 0x1720d3
movb $0x1, %al
callq 0x9060
jmp 0x32852
cmpl $0xb, -0x10(%rbp)
jne 0x3274c
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368cc7(%rip), %rdi    # 0x39b400
leaq 0x13f99f(%rip), %rsi    # 0x1720df
movb $0x1, %al
callq 0x9060
jmp 0x32850
cmpl $0xc, -0x10(%rbp)
jne 0x32779
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368c9a(%rip), %rdi    # 0x39b400
leaq 0x13f97e(%rip), %rsi    # 0x1720eb
movb $0x1, %al
callq 0x9060
jmp 0x3284e
cmpl $0xd, -0x10(%rbp)
jne 0x327a6
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368c6d(%rip), %rdi    # 0x39b400
leaq 0x13f95d(%rip), %rsi    # 0x1720f7
movb $0x1, %al
callq 0x9060
jmp 0x3284c
cmpl $0xe, -0x10(%rbp)
jne 0x327d0
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368c40(%rip), %rdi    # 0x39b400
leaq 0x13f93c(%rip), %rsi    # 0x172103
movb $0x1, %al
callq 0x9060
jmp 0x3284a
cmpl $0xf, -0x10(%rbp)
jne 0x327fa
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368c16(%rip), %rdi    # 0x39b400
leaq 0x13f91e(%rip), %rsi    # 0x17210f
movb $0x1, %al
callq 0x9060
jmp 0x32848
cmpl $0x10, -0x10(%rbp)
jne 0x32824
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368bec(%rip), %rdi    # 0x39b400
leaq 0x13f900(%rip), %rsi    # 0x17211b
movb $0x1, %al
callq 0x9060
jmp 0x32846
movsbl -0x19(%rbp), %edx
movsd -0x58(%rbp), %xmm0
leaq -0x50(%rbp), %rcx
leaq 0x368bc8(%rip), %rdi    # 0x39b400
leaq 0x13f87e(%rip), %rsi    # 0x1720bd
movb $0x1, %al
callq 0x9060
jmp 0x32848
jmp 0x3284a
jmp 0x3284c
jmp 0x3284e
jmp 0x32850
jmp 0x32852
jmp 0x32854
jmp 0x32856
jmp 0x32858
jmp 0x3285a
jmp 0x3285c
jmp 0x3285e
jmp 0x32860
jmp 0x32862
jmp 0x32864
jmp 0x32866
leaq 0x368b93(%rip), %rdi    # 0x39b400
movl $0x2e, %esi
callq 0x9100
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x32892
cmpl $0x2e, 0x36f69b(%rip)   # 0x3a1f24
jne 0x32892
movq -0x18(%rbp), %rax
movb $0x2c, (%rax)
cmpl $0x0, 0x36f68b(%rip)    # 0x3a1f24
je 0x32ba7
movsd -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x328b4
jp 0x328b4
jmp 0x32ba7
movb $0x0, -0x270(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x328dd
movq -0x18(%rbp), %rax
leaq 0x368b33(%rip), %rcx    # 0x39b400
addq $0x2, %rcx
subq %rcx, %rax
subq $0x1, %rax
movl %eax, -0x10(%rbp)
jmp 0x328f0
leaq 0x368b1c(%rip), %rdi    # 0x39b400
callq 0x9120
subq $0x2, %rax
movl %eax, -0x10(%rbp)
cmpl $0x3, -0x10(%rbp)
jle 0x32ba5
movl -0x10(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, -0x274(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl -0x274(%rbp), %ecx
addl $0x3, %ecx
cmpl %ecx, %eax
jge 0x32956
movslq -0xc(%rbp), %rcx
leaq 0x368ad3(%rip), %rax    # 0x39b400
movb (%rax,%rcx), %cl
movslq -0xc(%rbp), %rax
movb %cl, -0x270(%rbp,%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
cltq
movb $0x0, -0x270(%rbp,%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x32912
movl -0x274(%rbp), %ecx
movl -0x10(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x10(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x9120
movl %eax, -0x274(%rbp)
cmpl $0x3, -0xc(%rbp)
jle 0x329ac
movl 0x36f5a2(%rip), %eax    # 0x3a1f24
movb %al, %cl
movl -0x274(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x274(%rbp)
movl %eax, %eax
movb %cl, -0x270(%rbp,%rax)
movl -0x274(%rbp), %eax
movb $0x0, -0x270(%rbp,%rax)
jmp 0x329ae
cmpl $0x3, -0x10(%rbp)
jle 0x32a9b
movl -0x10(%rbp), %eax
subl $0x3, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x368a2a(%rip), %rax    # 0x39b400
movb (%rax,%rcx), %cl
movl -0x274(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x274(%rbp)
movl %eax, %eax
movb %cl, -0x270(%rbp,%rax)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x3689f8(%rip), %rax    # 0x39b400
movb (%rax,%rcx), %cl
movl -0x274(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x274(%rbp)
movl %eax, %eax
movb %cl, -0x270(%rbp,%rax)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x3689c6(%rip), %rax    # 0x39b400
movb (%rax,%rcx), %cl
movl -0x274(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x274(%rbp)
movl %eax, %eax
movb %cl, -0x270(%rbp,%rax)
cmpl $0x0, 0x1965f2(%rip)    # 0x1c9050
je 0x32a88
cmpl $0x0, -0x10(%rbp)
jle 0x32a88
movl 0x36f4b8(%rip), %eax    # 0x3a1f24
movb %al, %cl
movl -0x274(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x274(%rbp)
movl %eax, %eax
movb %cl, -0x270(%rbp,%rax)
movl -0x274(%rbp), %eax
movb $0x0, -0x270(%rbp,%rax)
jmp 0x329ae
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x368950(%rip), %rax    # 0x39b400
movb (%rax,%rcx), %cl
movl -0x274(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x274(%rbp)
movl %eax, %eax
movb %cl, -0x270(%rbp,%rax)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x36891e(%rip), %rax    # 0x39b400
movb (%rax,%rcx), %cl
movl -0x274(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x274(%rbp)
movl %eax, %eax
movb %cl, -0x270(%rbp,%rax)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x3688ec(%rip), %rax    # 0x39b400
movb (%rax,%rcx), %cl
movl -0x274(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x274(%rbp)
movl %eax, %eax
movb %cl, -0x270(%rbp,%rax)
movl -0x274(%rbp), %eax
movb $0x0, -0x270(%rbp,%rax)
movslq -0xc(%rbp), %rcx
leaq 0x3688b6(%rip), %rax    # 0x39b400
cmpb $0x0, (%rax,%rcx)
je 0x32b92
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rcx
leaq 0x36889b(%rip), %rax    # 0x39b400
movb (%rax,%rcx), %cl
movl -0x274(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x274(%rbp)
movl %eax, %eax
movb %cl, -0x270(%rbp,%rax)
movl -0x274(%rbp), %eax
movb $0x0, -0x270(%rbp,%rax)
jmp 0x32b3f
leaq -0x270(%rbp), %rsi
leaq 0x368860(%rip), %rdi    # 0x39b400
callq 0x9350
jmp 0x32ba7
leaq 0x368852(%rip), %rax    # 0x39b400
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
nop