// File: /workspace/github_cpp_makefile_star2_O3/ArashPartow[P]exprtk-extras/exprtk_tower_of_hanoi.cpp
// Function: void tower_of_hanoi_example<double>()
void tower_of_hanoi_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;

   std::vector<T> disks = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

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

   symbol_table_t symbol_table;
   symbol_table.add_vector ("disks", disks);
   symbol_table.add_package(io_package);

   compositor_t compositor(symbol_table);

   compositor.load_variables(true);
   compositor.load_vectors  (true);

   compositor.add(
      function_t("move_disk")
      .vars("disk", "src_rod", "dest_rod")
      .expression
      (
         "println('Move disk', disk ,' from rod[', src_rod ,'] to rod[', dest_rod ,']');"
      ));

   compositor.add(
      function_t("tower_of_hanoi")
      .vars("n", "src", "dest", "aux")
      .expression
      (
         " if (n == 1)                            "
         " {                                      "
         "    move_disk(disks[0], src, dest);     "
         "    return [true];                      "
         " };                                     "
         "                                        "
         " tower_of_hanoi(n - 1, src, aux, dest); "
         "                                        "
         " move_disk(disks[n - 1], src, dest);    "
         "                                        "
         " tower_of_hanoi(n - 1, aux, dest, src); "
         "                                        "
      ));

   const std::string tower_of_hanoi_program =
      " tower_of_hanoi(disks[], 1, 2, 3); ";

   expression_t expression;
   expression.register_symbol_table(symbol_table);

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

   expression.value();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x15f8, %rsp           # imm = 0x15F8
leaq 0x19c253(%rip), %rsi    # 0x2b6700
leaq 0xc10(%rsp), %rax
movl $0xa, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x90(%rsp), %rdi
leaq 0x2e8(%rsp), %rcx
movl $0xa, %edx
movq %rax, %rsi
callq 0x11b02a
leaq 0x218(%rsp), %rdi
callq 0x11b070
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x11b150
leaq 0xc20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x197449(%rip), %rsi    # 0x2b1955
leaq 0x197447(%rip), %rdx    # 0x2b195a
leaq 0xc10(%rsp), %rdi
callq 0x11af94
leaq 0x8(%rsp), %rdi
leaq 0xc10(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x11b198
movq 0xc10(%rsp), %rdi
cmpq %r14, %rdi
je 0x11a557
movq 0xc20(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0x218(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x11f136
leaq 0xc10(%rsp), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x11b378
movw $0x101, 0x15f0(%rsp)    # imm = 0x101
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1973c0(%rip), %rsi    # 0x2b195b
leaq 0x1973c2(%rip), %rdx    # 0x2b1964
leaq 0xc8(%rsp), %rdi
callq 0x11af94
leaq 0x2e8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x11b500
leaq 0x40(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x19738c(%rip), %rsi    # 0x2b1960
leaq 0x197389(%rip), %rdx    # 0x2b1964
leaq 0x30(%rsp), %rdi
callq 0x11af94
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x197370(%rip), %rsi    # 0x2b1965
leaq 0x197370(%rip), %rdx    # 0x2b196c
leaq 0x10(%rsp), %rdi
callq 0x11af94
leaq 0x80(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x197354(%rip), %rsi    # 0x2b196d
leaq 0x197355(%rip), %rdx    # 0x2b1975
leaq 0x70(%rsp), %rdi
callq 0x11af94
leaq 0x328(%rsp), %r15
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
callq 0x128f7e
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x128f7e
leaq 0x70(%rsp), %rsi
movq %r15, %rdi
callq 0x128f7e
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x19730d(%rip), %rsi    # 0x2b1976
leaq 0x197354(%rip), %rdx    # 0x2b19c4
leaq 0x50(%rsp), %rdi
callq 0x11af94
leaq 0x308(%rsp), %r12
leaq 0x50(%rsp), %rsi
movq %r12, %rdi
callq 0x117520
leaq 0x1540(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
callq 0x121394
leaq 0x1548(%rsp), %rcx
cmpq %rax, %rcx
jne 0x11a763
leaq 0xc10(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x1200fa
testb %al, %al
je 0x11a763
leaq 0x2e8(%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 0x1570(%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 0x120fb8
movq (%rax), %r12
leaq 0x2e8(%rsp), %rsi
leaq 0x1540(%rsp), %rdi
callq 0x121318
movq %r12, %rdi
movq %rax, %rsi
callq 0x121034
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x11a77f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x11a799
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x11a7b0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11a7c7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x117090
movq %r15, %rdi
callq 0x129218
leaq 0x318(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x11a7f0
movq 0x318(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0x2f8(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
leaq 0xd8(%rsp), %r15
je 0x11a819
movq 0x2f8(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11a836
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0xc8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x19717d(%rip), %rsi    # 0x2b19c5
leaq 0x197184(%rip), %rdx    # 0x2b19d3
callq 0x11af94
leaq 0x2e8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x11b500
leaq 0x30(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x196fa8(%rip), %rsi    # 0x2b1820
leaq 0x196fa2(%rip), %rdx    # 0x2b1821
callq 0x11af94
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
movq %rax, (%rdi)
leaq 0x19713c(%rip), %rsi    # 0x2b19d4
leaq 0x197138(%rip), %rdx    # 0x2b19d7
callq 0x11af94
leaq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
movq %rax, (%rdi)
leaq 0x19711d(%rip), %rsi    # 0x2b19d8
leaq 0x19711a(%rip), %rdx    # 0x2b19dc
callq 0x11af94
leaq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
movq %rax, (%rdi)
leaq 0x19bdfd(%rip), %rsi    # 0x2b66d8
leaq 0x19bdf9(%rip), %rdx    # 0x2b66db
callq 0x11af94
leaq 0x328(%rsp), %r15
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
callq 0x128f7e
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x128f7e
leaq 0x70(%rsp), %rsi
movq %r15, %rdi
callq 0x128f7e
leaq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0x128f7e
leaq 0xb8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1970a7(%rip), %rsi    # 0x2b19dd
leaq 0x197280(%rip), %rdx    # 0x2b1bbd
leaq 0xa8(%rsp), %rdi
callq 0x11af94
leaq 0x308(%rsp), %r12
leaq 0xa8(%rsp), %rsi
movq %r12, %rdi
callq 0x117520
leaq 0x2e8(%rsp), %rsi
leaq 0x1540(%rsp), %rdi
callq 0x121394
leaq 0x1548(%rsp), %rcx
cmpq %rax, %rcx
jne 0x11aa36
leaq 0xc10(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x1200fa
testb %al, %al
je 0x11aa36
leaq 0x2e8(%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 0x1570(%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 0x120fb8
movq (%rax), %r12
leaq 0x2e8(%rsp), %rsi
leaq 0x1540(%rsp), %rdi
callq 0x121318
movq %r12, %rdi
movq %rax, %rsi
callq 0x121034
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11aa53
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
leaq 0x40(%rsp), %r12
je 0x11aa74
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x11aa96
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x11aab2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x11aac9
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x117090
movq %r15, %rdi
callq 0x129218
movq 0x308(%rsp), %rdi
cmpq %r13, %rdi
je 0x11aaee
movq 0x318(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x2e8(%rsp), %rdi
cmpq %r14, %rdi
leaq 0xd8(%rsp), %r14
je 0x11ab13
movq 0x2f8(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x11ab30
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0x30(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x19707f(%rip), %rsi    # 0x2b1bbe
leaq 0x19709b(%rip), %rdx    # 0x2b1be1
callq 0x11af94
leaq 0x10(%rsp), %rdi
callq 0x11b5da
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
subq %rax, %rcx
je 0x11ab88
sarq $0x3, %rcx
movq 0x8(%rsp), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
cmpq %rbx, %rax
je 0x11ab97
cmpq (%rax), %rdx
je 0x11ab97
addq $0x8, %rax
decq %rcx
jne 0x11ab75
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x12949e
leaq 0xc8(%rsp), %rdi
movl $0x7f, %esi
callq 0x11b666
leaq 0x2e8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x11b766
leaq 0x1c8(%rsp), %rdi
callq 0x129684
leaq 0x198(%rsp), %rdi
callq 0x129684
leaq 0x168(%rsp), %rdi
callq 0x129684
leaq 0x138(%rsp), %rdi
callq 0x129684
leaq 0x108(%rsp), %rdi
callq 0x129684
leaq 0xd8(%rsp), %rdi
callq 0x129684
leaq 0x2e8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x11bf8a
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x2e8(%rsp), %rdi
callq 0x11cb26
leaq 0x10(%rsp), %rdi
callq 0x11cde8
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x11ac60
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0xc10(%rsp), %rdi
callq 0x11ce36
leaq 0x8(%rsp), %rdi
callq 0x11ce98
leaq 0x2d8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11ac98
movq 0x2d8(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0x28fae9(%rip), %rbx    # 0x3aa788
leaq 0x2b0(%rsp), %rax
movq %rbx, -0x30(%rax)
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11acc4
movq 0x2b0(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0x270(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11ace5
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0x248(%rsp), %rax
movq %rbx, -0x30(%rax)
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11ad0a
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x11ad27
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x117090
addq $0x15f8, %rsp           # imm = 0x15F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11ad50
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x11bf42
jmp 0x11ae01
movq %rax, %rbx
jmp 0x11ae01
movq %rax, %rbx
jmp 0x11ae0b
jmp 0x11ada4
jmp 0x11ae94
movq %rax, %rbx
jmp 0x11aeb3
movq %rax, %rbx
jmp 0x11aed5
jmp 0x11ad8c
jmp 0x11ad94
jmp 0x11ad9c
jmp 0x11ada4
jmp 0x11ae6b
movq %rax, %rbx
jmp 0x11ae88
movq %rax, %rbx
jmp 0x11aef1
movq %rax, %rbx
jmp 0x11af0d
movq %rax, %rbx
jmp 0x11af1a
movq %rax, %rbx
jmp 0x11af3f
jmp 0x11add9
jmp 0x11add9
movq %rax, %rbx
movq 0xc10(%rsp), %rdi
cmpq %r14, %rdi
je 0x11af4c
movq 0xc20(%rsp), %rsi
incq %rsi
callq 0x117090
jmp 0x11af4c
movq %rax, %rbx
jmp 0x11af4c
movq %rax, %rbx
jmp 0x11af56
movq %rax, %rbx
jmp 0x11af63
movq %rax, %rbx
leaq 0x2e8(%rsp), %rdi
callq 0x11cb26
leaq 0x10(%rsp), %rdi
callq 0x11cde8
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x11af3f
movq 0x40(%rsp), %rsi
jmp 0x11af37
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11ae97
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x117090
jmp 0x11ae97
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x11ae6e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x117090
jmp 0x11ae6e
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x11ae88
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
jne 0x11aee4
jmp 0x11aef1
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x11aeb3
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x11aed5
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x11aef1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x117090
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x11af0d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0x2e8(%rsp), %rdi
callq 0x11b59a
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x11af3f
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x117090
leaq 0xc10(%rsp), %rdi
callq 0x11ce36
leaq 0x8(%rsp), %rdi
callq 0x11ce98
leaq 0x218(%rsp), %rdi
callq 0x11cf2e
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x11af80
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x117090
movq %rbx, %rdi
callq 0x1172e0