// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk/exprtk_simple_example_05.cpp
// Function: void custom_function<double>()
void custom_function()
{
   typedef exprtk::symbol_table<T> symbol_table_t;
   typedef exprtk::expression<T>   expression_t;
   typedef exprtk::parser<T>       parser_t;

   const std::string expression_string =
      "myfunc(sin(x / pi), otherfunc(3 * y, x / 2, x * y))";

   T x = T(1);
   T y = T(2);
   myfunc<T> mf;

   symbol_table_t symbol_table;
   symbol_table.add_variable("x",x);
   symbol_table.add_variable("y",y);
   symbol_table.add_function("myfunc",mf);
   symbol_table.add_function("otherfunc",myotherfunc);
   symbol_table.add_constants();

   expression_t expression;
   expression.register_symbol_table(symbol_table);

   parser_t parser;
   parser.compile(expression_string,expression);

   const T result = expression.value();
   printf("Result: %10.5f\n",result);
}

// Assembly:
pushq %rbx
subq $0xb00, %rsp            # imm = 0xB00
leaq 0x12adff(%rip), %rsi    # 0x23b101
leaq 0x68(%rsp), %rdi
leaq 0x1d8(%rsp), %rdx
callq 0x1102b8
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
andw $0x0, 0x48(%rsp)
movq %rax, 0x18(%rsp)
andq $0x0, 0x50(%rsp)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
orq $-0x1, 0x58(%rsp)
movq %rax, 0x10(%rsp)
movq $0x2, 0x60(%rsp)
leaq 0x24f0e4(%rip), %rax    # 0x35f438
movq %rax, 0x40(%rsp)
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x110648
leaq 0x12acec(%rip), %rsi    # 0x23b059
leaq 0x1d8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x1102b8
leaq 0x8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
xorl %ecx, %ecx
callq 0x11066c
leaq 0x1d8(%rsp), %rdi
callq 0x10e5b8
leaq 0x12ae93(%rip), %rsi    # 0x23b242
leaq 0x1d8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x1102b8
leaq 0x8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
xorl %ecx, %ecx
callq 0x11066c
leaq 0x1d8(%rsp), %rdi
callq 0x10e5b8
leaq 0x12ad44(%rip), %rsi    # 0x23b135
leaq 0x1d8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x1102b8
leaq 0x8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x1106d8
leaq 0x1d8(%rsp), %rdi
callq 0x10e5b8
leaq 0x12ad0b(%rip), %rsi    # 0x23b13c
leaq 0x1d8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x1102b8
leaq 0x39f(%rip), %rdx       # 0x1107ec
leaq 0x8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x110738
leaq 0x1d8(%rsp), %rdi
callq 0x10e5b8
leaq 0x8(%rsp), %rdi
callq 0x1107fe
leaq 0x20(%rsp), %rdi
callq 0x110824
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x110884
leaq 0x88(%rsp), %rdi
pushq $0x7f
popq %rsi
callq 0x1108e0
leaq 0x1d8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x1109f0
leaq 0x88(%rsp), %rdi
callq 0x111008
leaq 0x1d8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x111050
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x12ac58(%rip), %rdi    # 0x23b146
movb $0x1, %al
callq 0x10e060
leaq 0x1d8(%rsp), %rdi
callq 0x1114d2
leaq 0x20(%rsp), %rdi
callq 0x11160c
leaq 0x8(%rsp), %rdi
callq 0x111622
leaq 0x68(%rsp), %rdi
callq 0x10e5b8
addq $0xb00, %rsp            # imm = 0xB00
popq %rbx
retq
jmp 0x11052b
movq %rax, %rbx
leaq 0x1d8(%rsp), %rdi
callq 0x1114d2
jmp 0x110554
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x111008
jmp 0x110554
jmp 0x110551
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x11160c
jmp 0x110585
jmp 0x110582
jmp 0x110582
jmp 0x110570
jmp 0x110582
jmp 0x110570
jmp 0x110582
jmp 0x110570
jmp 0x110582
movq %rax, %rbx
leaq 0x1d8(%rsp), %rdi
callq 0x10e5b8
jmp 0x110585
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x111622
leaq 0x68(%rsp), %rdi
callq 0x10e5b8
movq %rbx, %rdi
callq 0x10e310
movq %rax, %rbx
jmp 0x11058f