// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/exprtk_recursive_fibonacci.cpp
// Function: void recursive_fibonacci_example<double>()
void recursive_fibonacci_example()
{
   typedef exprtk::symbol_table<T>         symbol_table_t;
   typedef exprtk::expression<T>           expression_t;
   typedef exprtk::parser<T>               parser_t;
   typedef exprtk::function_compositor<T>  compositor_t;
   typedef typename compositor_t::function function_t;

   exprtk::rtl::io::package<T> io_package;

   symbol_table_t symbol_table;

   symbol_table.add_package(io_package);

   compositor_t compositor(symbol_table);

   compositor.add(
      function_t("fibonacci")
      .var("n")
      .expression
      ( " (n < 2) ? n : fibonacci(n - 1) + fibonacci(n - 2); " ));


   const std::string fibonacci_program =
      " const var n := 35;                  "
      "                                     "
      " for (var i := 0; i <= n; i += 1)    "
      " {                                   "
      "    var fib_i := fibonacci(i);       "
      "    println('fib(',i,') = ', fib_i); "
      " }                                   ";

   expression_t expression;
   expression.register_symbol_table(symbol_table);

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

   exprtk::timer timer;
   timer.start();

   expression.value();

   timer.stop();

   printf("Total time: %8.4fsec\n",timer.time());
}

// Assembly:
pushq %rbx
subq $0x1580, %rsp           # imm = 0x1580
leaq 0x1a0(%rsp), %rdi
callq 0x11368a
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x11372e
leaq 0x1a0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1156be
leaq 0xb98(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x113752
leaq 0x131db5(%rip), %rsi    # 0x245125
leaq 0x50(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1132e8
leaq 0x270(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x113870
leaq 0x131c58(%rip), %rsi    # 0x244ff0
leaq 0x30(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x1132e8
leaq 0x2b0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x11e85a
leaq 0x131d6f(%rip), %rsi    # 0x24512f
leaq 0x10(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0x1132e8
leaq 0x290(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x111560
leaq 0xb98(%rsp), %rdi
leaq 0x270(%rsp), %rsi
xorl %edx, %edx
callq 0x113860
leaq 0x10(%rsp), %rdi
callq 0x1115e8
leaq 0x30(%rsp), %rdi
callq 0x1115e8
leaq 0x270(%rsp), %rdi
callq 0x1138bc
leaq 0x50(%rsp), %rdi
callq 0x1115e8
leaq 0x131d3a(%rip), %rsi    # 0x245164
leaq 0x30(%rsp), %rdi
leaq 0x270(%rsp), %rdx
callq 0x1132e8
leaq 0x10(%rsp), %rdi
callq 0x1138dc
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x11393c
leaq 0x50(%rsp), %rdi
pushq $0x7f
popq %rsi
callq 0x113998
leaq 0x270(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x113aa8
leaq 0x50(%rsp), %rdi
callq 0x1140c0
leaq 0x270(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x114108
leaq 0x50(%rsp), %rdi
movb $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
callq 0x11458a
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x114598
movq %rbx, %rdi
callq 0x1145ac
leaq 0x131d90(%rip), %rdi    # 0x245268
movb $0x1, %al
callq 0x111060
leaq 0x270(%rsp), %rdi
callq 0x1145de
leaq 0x10(%rsp), %rdi
callq 0x114718
leaq 0x30(%rsp), %rdi
callq 0x1115e8
leaq 0xb98(%rsp), %rdi
callq 0x11472e
leaq 0x8(%rsp), %rdi
callq 0x114782
leaq 0x1a0(%rsp), %rdi
callq 0x1147c4
addq $0x1580, %rsp           # imm = 0x1580
popq %rbx
retq
jmp 0x11356e
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x1140c0
jmp 0x11357e
jmp 0x113540
movq %rax, %rbx
jmp 0x11357e
movq %rax, %rbx
jmp 0x113588
jmp 0x11355d
jmp 0x11354e
movq %rax, %rbx
jmp 0x11359c
movq %rax, %rbx
jmp 0x1135a6
movq %rax, %rbx
jmp 0x1135b3
movq %rax, %rbx
jmp 0x1135bd
jmp 0x113564
movq %rax, %rbx
jmp 0x1135ca
movq %rax, %rbx
jmp 0x1135d4
movq %rax, %rbx
leaq 0x270(%rsp), %rdi
callq 0x1145de
leaq 0x10(%rsp), %rdi
callq 0x114718
leaq 0x30(%rsp), %rdi
jmp 0x1135b8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1115e8
leaq 0x30(%rsp), %rdi
callq 0x1115e8
leaq 0x270(%rsp), %rdi
callq 0x1138bc
leaq 0x50(%rsp), %rdi
callq 0x1115e8
leaq 0xb98(%rsp), %rdi
callq 0x11472e
leaq 0x8(%rsp), %rdi
callq 0x114782
leaq 0x1a0(%rsp), %rdi
callq 0x1147c4
movq %rbx, %rdi
callq 0x111320