// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1578, %rsp           # imm = 0x1578
leaq 0x198(%rsp), %rdi
callq 0x11cb74
movq %rsp, %rdi
movl $0x1, %esi
callq 0x11cc54
leaq 0x198(%rsp), %rdi
movq %rsp, %rsi
callq 0x11f780
leaq 0xb90(%rsp), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x11cc9c
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1b9391(%rip), %rsi    # 0x2d58ed
leaq 0x1b9393(%rip), %rdx    # 0x2d58f6
leaq 0x48(%rsp), %rdi
callq 0x11cae4
leaq 0x268(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x11ce24
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1b9229(%rip), %rsi    # 0x2d57b8
leaq 0x1b9223(%rip), %rdx    # 0x2d57b9
leaq 0x8(%rsp), %rdi
callq 0x11cae4
leaq 0x2a8(%rsp), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x12c69a
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1b9332(%rip), %rsi    # 0x2d58f7
leaq 0x1b935f(%rip), %rdx    # 0x2d592b
leaq 0x28(%rsp), %rdi
callq 0x11cae4
leaq 0x288(%rsp), %r12
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x119530
leaq 0x14c0(%rsp), %r15
leaq 0x268(%rsp), %rsi
movq %r15, %rdi
callq 0x122942
leaq 0x14c8(%rsp), %rcx
cmpq %rax, %rcx
jne 0x11c6bd
leaq 0xb90(%rsp), %rdi
leaq 0x268(%rsp), %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x1216a0
testb %al, %al
je 0x11c6bd
leaq 0x268(%rsp), %rsi
movq 0x88(%rsi), %rax
movq %rax, %rcx
subq 0x68(%rsi), %rcx
shrq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
movq 0x60(%rsi), %rax
movq 0x70(%rsi), %rdx
subq 0x78(%rsi), %rdx
subq 0x50(%rsi), %rax
sarq $0x5, %rdx
sarq $0x5, %rax
leaq (%rcx,%rcx,2), %rcx
shlq $0x8, %rcx
addq 0x14f0(%rsp), %rcx
leaq (%rdx,%rdx,2), %rdx
shlq $0x4, %rdx
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq %rdx, %rdi
addq %rcx, %rdi
callq 0x122572
movq (%rax), %r12
leaq 0x268(%rsp), %rsi
movq %r15, %rdi
callq 0x1228c6
movq %r12, %rdi
movq %rax, %rsi
callq 0x1225ee
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x11c6d4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r15
cmpq %r15, %rdi
je 0x11c6f0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x119090
movq %r14, %rdi
callq 0x12c934
leaq 0x298(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c719
movq 0x298(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x278(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c73a
movq 0x278(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11c751
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1b91cc(%rip), %rsi    # 0x2d592c
leaq 0x1b92c8(%rip), %rdx    # 0x2d5a2f
callq 0x11cae4
leaq 0x28(%rsp), %rdi
callq 0x11cefe
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
subq %rcx, %rax
je 0x11c7d1
sarq $0x3, %rax
cmpq $0x1, %rax
movq %rax, %rsi
adcq $0x0, %rsi
cmpq %rbx, %rcx
je 0x11c7de
movq (%rsp), %rdx
cmpq (%rcx), %rdx
je 0x11c7de
addq $0x8, %rcx
movl $0x1, %edi
subq %rsi, %rdi
xorl %esi, %esi
cmpq %rsi, %rdi
je 0x11c7d1
decq %rsi
cmpq %rbx, %rcx
je 0x11c7c9
leaq 0x8(%rcx), %r8
cmpq (%rcx), %rdx
movq %r8, %rcx
jne 0x11c7b0
negq %rsi
cmpq %rax, %rsi
jb 0x11c7de
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x12cba6
leaq 0x48(%rsp), %rdi
movl $0x7f, %esi
callq 0x11cf98
leaq 0x268(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x11d098
leaq 0x148(%rsp), %rdi
callq 0x12cd8c
leaq 0x118(%rsp), %rdi
callq 0x12cd8c
leaq 0xe8(%rsp), %rdi
callq 0x12cd8c
leaq 0xb8(%rsp), %rdi
callq 0x12cd8c
leaq 0x88(%rsp), %rdi
callq 0x12cd8c
leaq 0x58(%rsp), %rdi
callq 0x12cd8c
leaq 0x268(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x11d8bc
leaq 0x50(%rsp), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movb $0x1, -0x8(%rdi)
xorl %esi, %esi
callq 0x119240
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x119240
movb $0x0, -0x18(%rbx)
movq (%rbx), %rax
subq -0x10(%rbx), %rax
jge 0x11c8b0
movsd 0x1b475a(%rip), %xmm0   # 0x2d1008
jmp 0x11c8ea
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
addq 0x68(%rsp), %rax
subq 0x58(%rsp), %rax
movq %rax, %xmm1
punpckldq 0x1b4812(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b481a(%rip), %xmm1   # 0x2d10f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x1b4726(%rip), %xmm0   # 0x2d1010
leaq 0x1b913f(%rip), %rdi    # 0x2d5a30
movb $0x1, %al
callq 0x119050
leaq 0x268(%rsp), %rdi
callq 0x11e28e
leaq 0x28(%rsp), %rdi
callq 0x11e550
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11c926
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0xb90(%rsp), %rdi
callq 0x11e59e
movq %rsp, %rdi
callq 0x11e600
leaq 0x258(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c95c
movq 0x258(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x2c21d5(%rip), %rbx    # 0x3deb38
leaq 0x230(%rsp), %rax
movq %rbx, -0x30(%rax)
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c988
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x1f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c9a9
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x1c8(%rsp), %rax
movq %rbx, -0x30(%rax)
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c9ce
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x119090
addq $0x1578, %rsp           # imm = 0x1578
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11ca05
jmp 0x11c9e4
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x11e28e
jmp 0x11ca08
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x11d874
jmp 0x11ca08
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x11e550
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11caaf
movq 0x18(%rsp), %rsi
jmp 0x11caa7
movq %rax, %rbx
jmp 0x11ca12
jmp 0x11ca44
jmp 0x11ca35
movq %rax, %rbx
jmp 0x11ca6f
movq %rax, %rbx
jmp 0x11ca8b
movq %rax, %rbx
jmp 0x11ca98
movq %rax, %rbx
jmp 0x11caaf
jmp 0x11ca4b
movq %rax, %rbx
jmp 0x11cabc
movq %rax, %rbx
jmp 0x11cac4
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x11ca6f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11ca8b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x268(%rsp), %rdi
callq 0x11cebe
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11caaf
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0xb90(%rsp), %rdi
callq 0x11e59e
movq %rsp, %rdi
callq 0x11e600
leaq 0x198(%rsp), %rdi
callq 0x11e696
movq %rbx, %rdi
callq 0x1192f0