// File: ArashPartow[P]exprtk-extras/exprtk_repl.cpp
// Function: void repl<double>(int, char**)
void repl(int argc, char* argv[])
{
   expression_processor<T> processor;

   if (argc > 1)
   {
      for (int i = 1; i < argc; ++i)
      {
         processor.process_from_file(argv[i]);
      }
   }
   else
   {
      for ( ; ; )
      {
         std::string expression;

         std::cout << ">> ";
         std::getline(std::cin,expression);

         if (expression.empty())
            continue;
         else if ("exit" == expression)
            break;
         else if ("quit" == expression)
            break;
         else if ('$' == expression[0])
            processor.process_directive(expression);
         else
            processor.process(expression);
      }
   }
}

// Assembly:
subq $0x2138, %rsp           # imm = 0x2138
movl %edi, 0x2134(%rsp)
movq %rsi, 0x2128(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x121010
cmpl $0x1, 0x2134(%rsp)
jle 0x120b59
movl $0x1, 0xd4(%rsp)
movl 0xd4(%rsp), %eax
cmpl 0x2134(%rsp), %eax
jge 0x120b54
movq 0x2128(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
leaq 0xaf(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x1197d0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0xb0(%rsp), %rdi
callq 0x120970
jmp 0x120ac4
leaq 0xd8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x1234a0
jmp 0x120adb
leaq 0xb0(%rsp), %rdi
callq 0x119968
leaq 0xaf(%rsp), %rdi
callq 0x119950
movl 0xd4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd4(%rsp)
jmp 0x120a6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
jmp 0x120b42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x119968
leaq 0xaf(%rsp), %rdi
callq 0x119950
jmp 0x120d48
jmp 0x120d33
jmp 0x120b5b
leaq 0x78(%rsp), %rdi
callq 0x119300
movq 0x554464(%rip), %rdi    # 0x674fd0
leaq 0x36ba5f(%rip), %rsi    # 0x48c5d2
callq 0x1194e0
jmp 0x120b7a
movq 0x554467(%rip), %rdi    # 0x674fe8
leaq 0x78(%rsp), %rsi
callq 0x119460
jmp 0x120b8d
leaq 0x78(%rsp), %rdi
callq 0x119270
testb $0x1, %al
jne 0x120b9d
jmp 0x120bc3
movl $0x6, 0x74(%rsp)
jmp 0x120cf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
jmp 0x120d25
leaq 0x36ba0c(%rip), %rdi    # 0x48c5d6
leaq 0x78(%rsp), %rsi
callq 0x123630
movb %al, 0x1f(%rsp)
jmp 0x120bda
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x120be4
jmp 0x120bf1
movl $0x5, 0x74(%rsp)
jmp 0x120cf8
leaq 0x36b9e3(%rip), %rdi    # 0x48c5db
leaq 0x78(%rsp), %rsi
callq 0x123630
movb %al, 0x1e(%rsp)
jmp 0x120c08
movb 0x1e(%rsp), %al
testb $0x1, %al
jne 0x120c12
jmp 0x120c1f
movl $0x5, 0x74(%rsp)
jmp 0x120cf8
xorl %eax, %eax
movl %eax, %esi
leaq 0x78(%rsp), %rdi
callq 0x1198a0
movq %rax, 0x10(%rsp)
jmp 0x120c34
movq 0x10(%rsp), %rax
movsbl (%rax), %ecx
movl $0x24, %eax
cmpl %ecx, %eax
jne 0x120c99
leaq 0x50(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x119150
jmp 0x120c56
leaq 0xd8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x123660
jmp 0x120c6a
leaq 0x50(%rsp), %rdi
callq 0x119968
jmp 0x120cea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x119968
jmp 0x120d25
leaq 0x30(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x119150
jmp 0x120caa
leaq 0xd8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x123fa0
jmp 0x120cbe
leaq 0x30(%rsp), %rdi
callq 0x119968
jmp 0x120cea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x119968
jmp 0x120d25
jmp 0x120cec
jmp 0x120cee
jmp 0x120cf0
movl $0x0, 0x74(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x119968
movl 0x74(%rsp), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x120d20
jmp 0x120d10
movl 0xc(%rsp), %eax
subl $0x5, %eax
je 0x120d31
jmp 0x120d1b
jmp 0x120b5b
jmp 0x120b5b
leaq 0x78(%rsp), %rdi
callq 0x119968
jmp 0x120d48
jmp 0x120d33
leaq 0xd8(%rsp), %rdi
callq 0x124d30
addq $0x2138, %rsp           # imm = 0x2138
retq
leaq 0xd8(%rsp), %rdi
callq 0x124d30
movq 0xa0(%rsp), %rdi
callq 0x119570
nopw %cs:(%rax,%rax)
nopl (%rax)