// File: /workspace/github_cpp_makefile_star2_O3/ArashPartow[P]exprtk-extras/exprtk_calc.cpp
// Function: main
int main()
{
   typedef exprtk::symbol_table<double> symbol_table_t;
   typedef exprtk::expression<double>   expression_t;
   typedef exprtk::parser<double>       parser_t;
   typedef exprtk::parser_error::type   err_t;

   for ( ; ; )
   {
      double x = 1.0;
      double y = 2.0;
      double z = 3.0;
      double w = 4.0;
      double u = 5.0;
      double v = 6.0;

      symbol_table_t symbol_table;
      symbol_table.add_variable("x",x);
      symbol_table.add_variable("y",y);
      symbol_table.add_variable("z",z);
      symbol_table.add_variable("w",w);
      symbol_table.add_variable("u",u);
      symbol_table.add_variable("v",v);
      symbol_table.add_constants();

      expression_t expression;
      expression.register_symbol_table(symbol_table);

      std::string expression_str;

      printf(">> ");
      std::getline(std::cin,expression_str);

      if (expression_str.empty())
         continue;
      else if ("exit" == expression_str)
         break;
      else if ("quit" == expression_str)
         break;

      parser_t parser;

      if (!parser.compile(expression_str,expression))
      {
         printf("Error: %s\tExpression: %s\n",
                parser.error().c_str(),
                expression_str.c_str());

         for (std::size_t i = 0; i < parser.error_count(); ++i)
         {
            err_t error = parser.get_error(i);
            printf("Error: %02d Pos: %02d Type: [%14s] Message: %s\tExpression: %s\n",
                   static_cast<unsigned int>(i),
                   static_cast<unsigned int>(error.token.position),
                   exprtk::parser_error::to_str(error.mode).c_str(),
                   error.diagnostic.c_str(),
                   expression_str.c_str());
         }

         continue;
      }

      double result = expression.value();

      printf("result: %20.10f\n",result);
   }

   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb18, %rsp            # imm = 0xB18
leaq 0x200(%rsp), %r12
leaq 0x18(%rsp), %r14
leaq 0x28(%rsp), %r15
leaq 0x1f0(%rsp), %rbp
movq 0x2e9cda(%rip), %rbx    # 0x400fe8
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x78(%rsp)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x70(%rsp)
movabsq $0x4008000000000000, %rax # imm = 0x4008000000000000
movq %rax, 0x68(%rsp)
movabsq $0x4010000000000000, %rax # imm = 0x4010000000000000
movq %rax, 0x60(%rsp)
movabsq $0x4014000000000000, %rax # imm = 0x4014000000000000
movq %rax, 0x58(%rsp)
movabsq $0x4018000000000000, %rax # imm = 0x4018000000000000
movq %rax, 0x50(%rsp)
movq %r15, %rdi
movl $0x1, %esi
callq 0x117ba8
movq %r12, 0x1f0(%rsp)
movq %rbp, %rdi
leaq 0x18e536(%rip), %rsi    # 0x2a58bd
leaq 0x18e530(%rip), %rdx    # 0x2a58be
callq 0x11992c
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x78(%rsp), %rdx
xorl %ecx, %ecx
callq 0x117bf0
movq 0x1f0(%rsp), %rdi
cmpq %r12, %rdi
je 0x1173c2
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq %r12, 0x1f0(%rsp)
movq %rbp, %rdi
leaq 0x18e76e(%rip), %rsi    # 0x2a5b42
leaq 0x18e768(%rip), %rdx    # 0x2a5b43
callq 0x11992c
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x70(%rsp), %rdx
xorl %ecx, %ecx
callq 0x117bf0
movq 0x1f0(%rsp), %rdi
cmpq %r12, %rdi
je 0x11740f
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq %r12, 0x1f0(%rsp)
movq %rbp, %rdi
leaq 0x18e51a(%rip), %rsi    # 0x2a593b
leaq 0x18e514(%rip), %rdx    # 0x2a593c
callq 0x11992c
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x68(%rsp), %rdx
xorl %ecx, %ecx
callq 0x117bf0
movq 0x1f0(%rsp), %rdi
cmpq %r12, %rdi
je 0x11745c
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq %r12, 0x1f0(%rsp)
movq %rbp, %rdi
leaq 0x18e472(%rip), %rsi    # 0x2a58e0
leaq 0x18e46c(%rip), %rdx    # 0x2a58e1
callq 0x11992c
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x60(%rsp), %rdx
xorl %ecx, %ecx
callq 0x117bf0
movq 0x1f0(%rsp), %rdi
cmpq %r12, %rdi
je 0x1174a9
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq %r12, 0x1f0(%rsp)
movq %rbp, %rdi
leaq 0x18e482(%rip), %rsi    # 0x2a593d
leaq 0x18e47c(%rip), %rdx    # 0x2a593e
callq 0x11992c
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x58(%rsp), %rdx
xorl %ecx, %ecx
callq 0x117bf0
movq 0x1f0(%rsp), %rdi
cmpq %r12, %rdi
je 0x1174f6
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq %r12, 0x1f0(%rsp)
movq %rbp, %rdi
leaq 0x18e437(%rip), %rsi    # 0x2a593f
leaq 0x18e431(%rip), %rdx    # 0x2a5940
callq 0x11992c
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x50(%rsp), %rdx
xorl %ecx, %ecx
callq 0x117bf0
movq 0x1f0(%rsp), %rdi
cmpq %r12, %rdi
je 0x117543
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq %r15, %rdi
callq 0x117d40
leaq 0x30(%rsp), %rdi
callq 0x117e86
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
subq %rax, %rcx
je 0x117588
sarq $0x3, %rcx
movq 0x28(%rsp), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
cmpq %r15, %rax
je 0x117595
cmpq (%rax), %rdx
je 0x117595
addq $0x8, %rax
decq %rcx
jne 0x117575
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x11c48c
movq %r14, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x18e392(%rip), %rdi    # 0x2a5941
xorl %eax, %eax
callq 0x114060
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1144f0
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x114030
cmpq $0x0, 0x10(%rsp)
je 0x1176db
leaq 0x8(%rsp), %r13
movq %r13, %rdi
leaq 0x18e350(%rip), %rsi    # 0x2a5945
callq 0x114460
movb $0x1, %bl
testl %eax, %eax
je 0x1176dd
movq %r13, %rdi
leaq 0x18e33c(%rip), %rsi    # 0x2a594a
callq 0x114460
testl %eax, %eax
je 0x1176dd
movl $0x7f, %esi
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x117f12
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x118012
leaq 0xb0(%rsp), %rbx
leaq 0x8(%rsp), %r12
leaq 0x1a0(%rsp), %rdi
callq 0x11988e
leaq 0x170(%rsp), %rdi
callq 0x11988e
leaq 0x140(%rsp), %rdi
callq 0x11988e
leaq 0x110(%rsp), %rdi
callq 0x11988e
leaq 0xe0(%rsp), %rdi
callq 0x11988e
movq %rbx, %rdi
callq 0x11988e
movq %rbp, %rdi
movq %r12, %rsi
leaq 0x30(%rsp), %rdx
callq 0x118836
testb %al, %al
je 0x11771a
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x18e2ed(%rip), %rdi    # 0x2a59a8
movb $0x1, %al
callq 0x114060
movq %rbp, %rdi
callq 0x1194e8
xorl %ebx, %ebx
leaq 0x18(%rsp), %r14
leaq 0x200(%rsp), %r12
jmp 0x1176dd
xorl %ebx, %ebx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1176f4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x1140a0
leaq 0x30(%rsp), %rdi
callq 0x1197aa
movq %r15, %rdi
callq 0x1197f8
testb %bl, %bl
movq 0x2e98d9(%rip), %rbx    # 0x400fe8
je 0x11730e
jmp 0x117a32
movq 0x508(%rsp), %rdi
cmpq %rdi, 0x528(%rsp)
je 0x117775
movq 0x520(%rsp), %rsi
movq %rdi, %rcx
subq 0x510(%rsp), %rcx
movq %rcx, %rax
sarq $0x3, %rax
movabsq $-0x30c30c30c30c30c3, %rdx # imm = 0xCF3CF3CF3CF3CF3D
imulq %rdx, %rax
cmpq $-0xa7, %rcx
jl 0x1177a8
cmpq $0x3, %rax
jb 0x1177cc
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq %rdx
jmp 0x1177be
movq %rbx, 0xa0(%rsp)
movabsq $0x726f727245206f4e, %rax # imm = 0x726F727245206F4E
movq %rax, 0xb0(%rsp)
movq $0x8, 0xa8(%rsp)
movb $0x0, 0xb8(%rsp)
movq %rbx, %rsi
jmp 0x1177f4
notq %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq %rdx
notq %rdx
imulq $-0x1f8, %rdx, %rdi     # imm = 0xFE08
addq (%rsi,%rdx,8), %rdi
addq %rcx, %rdi
movq %rbx, 0xa0(%rsp)
movq 0x38(%rdi), %rsi
movq 0x40(%rdi), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x11a00e
movq 0xa0(%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x18e14f(%rip), %rdi    # 0x2a594f
xorl %eax, %eax
callq 0x114060
movq 0xa0(%rsp), %rdi
cmpq %rbx, %rdi
movabsq $-0x30c30c30c30c30c3, %r14 # imm = 0xCF3CF3CF3CF3CF3D
je 0x11782e
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq $-0x1, %r13
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x540(%rsp), %rax
movq 0x520(%rsp), %rdi
movq %rax, %rcx
subq %rdi, %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
leaq (%rcx,%rcx,2), %rax
movq 0x528(%rsp), %rcx
subq 0x530(%rsp), %rcx
sarq $0x3, %rcx
imulq %r14, %rcx
addq %rax, %rcx
movq 0x508(%rsp), %rsi
movq 0x518(%rsp), %rax
subq %rsi, %rax
sarq $0x3, %rax
imulq %r14, %rax
addq %rcx, %rax
cmpq %rax, %r12
jae 0x1176c2
movq %rsi, %rdx
subq 0x510(%rsp), %rdx
sarq $0x3, %rdx
imulq %r14, %rdx
movq %r12, %rcx
addq %rdx, %rcx
js 0x1178c8
cmpq $0x2, %rcx
ja 0x1178e3
addq %rbx, %rsi
jmp 0x11790b
movq %r13, %rax
subq %rdx, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq %rdx
notq %rdx
jmp 0x1178f6
movq %rcx, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq %rdx
imulq $-0x1f8, %rdx, %rax     # imm = 0xFE08
addq (%rdi,%rdx,8), %rax
imulq $0xa8, %rcx, %rsi
addq %rax, %rsi
leaq 0xa0(%rsp), %rdi
callq 0x17e760
movq 0xc8(%rsp), %r14
movl 0xd0(%rsp), %esi
leaq 0x80(%rsp), %rdi
callq 0x1193d1
movq 0x80(%rsp), %rcx
movq 0xd8(%rsp), %r8
movq 0x8(%rsp), %r9
leaq 0x18e019(%rip), %rdi    # 0x2a5969
movl %r12d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x114060
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x117982
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
movabsq $-0x30c30c30c30c30c3, %r14 # imm = 0xCF3CF3CF3CF3CF3D
je 0x1179b1
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x1179d6
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x1179fb
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x1140a0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x117a20
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x1140a0
incq %r12
addq $0xa8, %rbx
decq %r13
jmp 0x11783a
xorl %eax, %eax
addq $0xb18, %rsp            # imm = 0xB18
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x117a4a
jmp 0x117ac1
movq %rax, %rbx
jmp 0x117ac9
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x1187ee
jmp 0x117ad6
jmp 0x117aaa
movq %rax, %rbx
jmp 0x117aed
jmp 0x117aa5
jmp 0x117a81
jmp 0x117aa5
jmp 0x117a81
jmp 0x117aa5
jmp 0x117a81
jmp 0x117aa5
jmp 0x117a81
jmp 0x117aa5
jmp 0x117a81
jmp 0x117aa5
movq %rax, %rbx
movq 0x1f0(%rsp), %rdi
cmpq %r12, %rdi
je 0x117af7
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x1140a0
jmp 0x117af7
jmp 0x117aa5
movq %rax, %rbx
jmp 0x117af7
movq %rax, %rbx
jmp 0x117ad6
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x11947e
jmp 0x117ac4
movq %rax, %rbx
leaq 0x18(%rsp), %r14
leaq 0x1f0(%rsp), %rdi
callq 0x1194e8
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x117aed
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x1140a0
leaq 0x30(%rsp), %rdi
callq 0x1197aa
leaq 0x28(%rsp), %rdi
callq 0x1197f8
movq %rbx, %rdi
callq 0x1142f0