// File: /workspace/github_cpp_makefile_star2_O1/ArashPartow[P]exprtk-extras/exprtk_riddle.cpp
// Function: void logical_deducation_riddle<double>()
void logical_deducation_riddle()
{
   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;

   symbol_table_t symbol_table;

   exprtk::rtl::io::println<T> println;

   symbol_table.add_function("println", println);

   compositor_t compositor(symbol_table);

   compositor.add(function_t()
      .name("constraint")
      .var("person_x").var("person_y")
      .expression
      (
         " person_x xor person_y; "
      ));

   const std::string logical_deducation_riddle_program =
      " const var number_of_culprits := 1;                                             "
      "                                                                                "
      " for (var Tori := false; Tori <= true; Tori += true)                            "
      " {                                                                              "
      "    for (var Annie := false; Annie <= true; Annie += true)                      "
      "    {                                                                           "
      "       for (var Betsy := false; Betsy <= true; Betsy += true)                   "
      "       {                                                                        "
      "          for (var Chloe := false; Chloe <= true; Chloe += true)                "
      "          {                                                                     "
      "             for (var Zoey := false; Zoey <= true; Zoey += true)                "
      "             {                                                                  "
      "                if (sum(Annie, Betsy, Chloe, Tori, Zoey) != number_of_culprits) "
      "                   continue;                                                    "
      "                                                                                "
      "                var solution :=                                                 "
      "                   constraint( not(Zoey)  , Annie     ) and /* Tori  */         "
      "                   constraint( not(Betsy) , not(Zoey) ) and /* Annie */         "
      "                   constraint( Zoey       , not(Tori) ) and /* Betsy */         "
      "                   constraint( Betsy      , Annie     ) and /* Chloe */         "
      "                   constraint( Chloe      , not(Tori) ) ;   /* Zoey  */         "
      "                                                                                "
      "                if (solution == true)                                           "
      "                {                                                               "
      "                   var culprit := '';                                           "
      "                   [*]                                                          "
      "                   {                                                            "
      "                      case Annie : culprit := 'Annie';                          "
      "                      case Betsy : culprit := 'Betsy';                          "
      "                      case Chloe : culprit := 'Chloe';                          "
      "                      case Tori  : culprit := 'Tori' ;                          "
      "                      case Zoey  : culprit := 'Zoey' ;                          "
      "                   };                                                           "
      "                                                                                "
      "                   println(culprit,' broke the window!');                       "
      "                }                                                               "
      "             }                                                                  "
      "          }                                                                     "
      "       }                                                                        "
      "    }                                                                           "
      " }                                                                              "
      "                                                                                ";

   expression_t expression;
   expression.register_symbol_table(symbol_table);

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

   expression.value();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1538, %rsp           # imm = 0x1538
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x11cc3c
leaq 0x238(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1b93bc(%rip), %rsi    # 0x2d58dd
leaq 0x1b93bb(%rip), %rdx    # 0x2d58e3
leaq 0x228(%rsp), %rdi
callq 0x11cbac
leaq 0x70(%rsp), %rdi
leaq 0x228(%rsp), %rsi
callq 0x11cc84
movq 0x228(%rsp), %rdi
cmpq %r14, %rdi
je 0x11c564
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x228(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b936e(%rip), %rsi    # 0x2d58e4
leaq 0x1b936e(%rip), %rdx    # 0x2d58eb
callq 0x11cbac
leaq 0x8(%rsp), %rdi
leaq 0x228(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x11cd8c
movq 0x228(%rsp), %rdi
cmpq %r14, %rdi
je 0x11c5b6
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x228(%rsp), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x11cf16
leaq 0xc10(%rsp), %rdi
callq 0x11d09e
leaq 0xe8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1b9301(%rip), %rsi    # 0x2d58ec
leaq 0x1b9304(%rip), %rdx    # 0x2d58f6
leaq 0xd8(%rsp), %rdi
callq 0x11cbac
leaq 0xc10(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x119520
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1b92d3(%rip), %rsi    # 0x2d58f7
leaq 0x1b92d4(%rip), %rdx    # 0x2d58ff
leaq 0x30(%rsp), %rdi
callq 0x11cbac
leaq 0xc50(%rsp), %r14
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x12c35a
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1b92a6(%rip), %rsi    # 0x2d5900
leaq 0x1b92a7(%rip), %rdx    # 0x2d5908
leaq 0x10(%rsp), %rdi
callq 0x11cbac
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x12c35a
leaq 0x60(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1b9281(%rip), %rsi    # 0x2d5909
leaq 0x1b9292(%rip), %rdx    # 0x2d5921
leaq 0x50(%rsp), %rdi
callq 0x11cbac
leaq 0xc30(%rsp), %r12
leaq 0x50(%rsp), %rsi
movq %r12, %rdi
callq 0x119520
leaq 0xb58(%rsp), %r15
leaq 0xc10(%rsp), %rsi
movq %r15, %rdi
callq 0x122602
leaq 0xb60(%rsp), %rcx
cmpq %rax, %rcx
jne 0x11c780
leaq 0x228(%rsp), %rdi
leaq 0xc10(%rsp), %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x121360
testb %al, %al
je 0x11c780
leaq 0xc10(%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 0xb88(%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 0x122232
movq (%rax), %r12
leaq 0xc10(%rsp), %rsi
movq %r15, %rdi
callq 0x122586
movq %r12, %rdi
movq %rax, %rsi
callq 0x1222ae
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x11c797
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
leaq 0x40(%rsp), %r15
je 0x11c7b8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x11c7cf
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0xd8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11c7ec
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x119090
movq %r14, %rdi
callq 0x12c5f4
leaq 0xc40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c815
movq 0xc40(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0xc20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c836
movq 0xc20(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x30(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1b90dd(%rip), %rsi    # 0x2d5922
leaq 0x1b9df6(%rip), %rdx    # 0x2d6642
callq 0x11cbac
leaq 0x10(%rsp), %rdi
callq 0x11d16a
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
subq %rcx, %rax
je 0x11c8b7
sarq $0x3, %rax
cmpq $0x1, %rax
movq %rax, %rsi
adcq $0x0, %rsi
cmpq %rbx, %rcx
je 0x11c8c6
movq 0x8(%rsp), %rdx
cmpq (%rcx), %rdx
je 0x11c8c6
addq $0x8, %rcx
movl $0x1, %edi
subq %rsi, %rdi
xorl %esi, %esi
cmpq %rsi, %rdi
je 0x11c8b7
decq %rsi
cmpq %rbx, %rcx
je 0x11c8af
leaq 0x8(%rcx), %r8
cmpq (%rcx), %rdx
movq %r8, %rcx
jne 0x11c896
negq %rsi
cmpq %rax, %rsi
jb 0x11c8c6
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x12c866
leaq 0xd8(%rsp), %rdi
movl $0x7f, %esi
callq 0x11d204
leaq 0xc10(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x11d304
leaq 0x1d8(%rsp), %rdi
callq 0x12ca4c
leaq 0x1a8(%rsp), %rdi
callq 0x12ca4c
leaq 0x178(%rsp), %rdi
callq 0x12ca4c
leaq 0x148(%rsp), %rdi
callq 0x12ca4c
leaq 0x118(%rsp), %rdi
callq 0x12ca4c
leaq 0xe8(%rsp), %rdi
callq 0x12ca4c
leaq 0xc10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x11db28
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0xc10(%rsp), %rdi
callq 0x11e4fa
leaq 0x10(%rsp), %rdi
callq 0x11e7bc
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x11c98f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x228(%rsp), %rdi
callq 0x11e80a
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c9bd
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x2c21cc(%rip), %rax    # 0x3deb90
leaq 0xa0(%rsp), %rcx
movq %rax, -0x30(%rcx)
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x11c9e9
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x8(%rsp), %rdi
callq 0x11e8ae
addq $0x1538, %rsp           # imm = 0x1538
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11ca1c
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x11dae0
jmp 0x11cad0
movq %rax, %rbx
jmp 0x11cad0
movq %rax, %rbx
jmp 0x11cada
jmp 0x11ca54
jmp 0x11ca30
movq %rax, %rbx
jmp 0x11cb16
jmp 0x11ca3a
movq %rax, %rbx
jmp 0x11cb32
jmp 0x11ca44
movq %rax, %rbx
jmp 0x11cb4e
movq %rax, %rbx
jmp 0x11cb6b
movq %rax, %rbx
jmp 0x11cb78
jmp 0x11ca87
movq %rax, %rbx
movq 0x228(%rsp), %rdi
cmpq %r14, %rdi
je 0x11cb85
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x119090
jmp 0x11cb85
movq %rax, %rbx
jmp 0x11cb85
movq %rax, %rbx
movq 0x228(%rsp), %rdi
cmpq %r14, %rdi
je 0x11cb8f
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x119090
jmp 0x11cb8f
movq %rax, %rbx
jmp 0x11cb8f
movq %rax, %rbx
leaq 0xc10(%rsp), %rdi
callq 0x11e4fa
leaq 0x10(%rsp), %rdi
callq 0x11e7bc
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x11cb78
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x119090
jmp 0x11cb78
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x11cb16
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x11cb32
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x11cb4e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0xd8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11cb6b
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0xc10(%rsp), %rdi
callq 0x11d12a
leaq 0x228(%rsp), %rdi
callq 0x11e80a
leaq 0x70(%rsp), %rdi
callq 0x11e86c
leaq 0x8(%rsp), %rdi
callq 0x11e8ae
movq %rbx, %rdi
callq 0x1192e0