// File: /workspace/github_cpp_makefile_star2_O1/ArashPartow[P]exprtk-extras/exprtk_binomial_coefficient.cpp
// Function: void n_choose_r<double>()
void n_choose_r()
{
   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;
   symbol_table.add_function("println",ncr_println);

   compositor_t compositor(symbol_table);

   // define function: ncr(n,r)
   compositor.add(
      function_t("ncr")
      .vars("n", "r")
      .expression
      (
        " switch                               "
        " {                                    "
        "    case n <= r : 1;                  "
        "    case r <= 0 : 1;                  "
        "    default     : ncr(n - 1, r - 1) + "
        "                  ncr(n - 1, r    ) ; "
        " }                                    "
      ));

   const std::string ncr_program =
      " var n := 25;                     "
      " for (var r := 1; r < n; r += 1)  "
      " {                                "
      "    println(n, r, ncr(n,r));      "
      " };                               ";

   expression_t expression;
   expression.register_symbol_table(symbol_table);

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

   expression.value();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x14c8, %rsp           # imm = 0x14C8
movq %rsp, %rdi
movl $0x1, %esi
callq 0x11cb1a
leaq 0xaf0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1b93be(%rip), %rsi    # 0x2d58dd
leaq 0x1b93be(%rip), %rdx    # 0x2d58e4
leaq 0xae0(%rsp), %rdi
callq 0x11ca8a
leaq 0x7a5(%rip), %rdx       # 0x11ccdf
movq %rsp, %rdi
leaq 0xae0(%rsp), %rsi
callq 0x11cb62
movq 0xae0(%rsp), %rdi
cmpq %r14, %rdi
je 0x11c567
movq 0xaf0(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0xae0(%rsp), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x11cd1c
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1b935b(%rip), %rsi    # 0x2d58e5
leaq 0x1b9357(%rip), %rdx    # 0x2d58e8
leaq 0x68(%rsp), %rdi
callq 0x11ca8a
leaq 0x1b8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x11cea4
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1b91eb(%rip), %rsi    # 0x2d57a8
leaq 0x1b91e5(%rip), %rdx    # 0x2d57a9
leaq 0x8(%rsp), %rdi
callq 0x11ca8a
leaq 0x38(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1b919a(%rip), %rsi    # 0x2d5778
leaq 0x1b9194(%rip), %rdx    # 0x2d5779
leaq 0x28(%rsp), %rdi
callq 0x11ca8a
leaq 0x1f8(%rsp), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x12c20e
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x12c20e
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1b92c8(%rip), %rsi    # 0x2d58e9
leaq 0x1b93cb(%rip), %rdx    # 0x2d59f3
leaq 0x48(%rsp), %rdi
callq 0x11ca8a
leaq 0x1d8(%rsp), %r12
leaq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x119520
leaq 0x1410(%rsp), %r15
leaq 0x1b8(%rsp), %rsi
movq %r15, %rdi
callq 0x1224ee
leaq 0x1418(%rsp), %rcx
cmpq %rax, %rcx
jne 0x11c719
leaq 0xae0(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x12124c
testb %al, %al
je 0x11c719
leaq 0x1b8(%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 0x1440(%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 0x12211e
movq (%rax), %r12
leaq 0x1b8(%rsp), %rsi
movq %r15, %rdi
callq 0x122472
movq %r12, %rdi
movq %rax, %rsi
callq 0x12219a
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x11c730
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
leaq 0x18(%rsp), %r15
je 0x11c74c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11c763
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x119090
movq %r14, %rdi
callq 0x12c4a8
leaq 0x1e8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11c78c
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x1c8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq 0x78(%rsp), %r14
je 0x11c7b2
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x11c7c9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1b921c(%rip), %rsi    # 0x2d59f4
leaq 0x1b92bf(%rip), %rdx    # 0x2d5a9e
callq 0x11ca8a
leaq 0x28(%rsp), %rdi
callq 0x11cf7e
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
subq %rcx, %rax
je 0x11c849
sarq $0x3, %rax
cmpq $0x1, %rax
movq %rax, %rsi
adcq $0x0, %rsi
cmpq %rbx, %rcx
je 0x11c856
movq (%rsp), %rdx
cmpq (%rcx), %rdx
je 0x11c856
addq $0x8, %rcx
movl $0x1, %edi
subq %rsi, %rdi
xorl %esi, %esi
cmpq %rsi, %rdi
je 0x11c849
decq %rsi
cmpq %rbx, %rcx
je 0x11c841
leaq 0x8(%rcx), %r8
cmpq (%rcx), %rdx
movq %r8, %rcx
jne 0x11c828
negq %rsi
cmpq %rax, %rsi
jb 0x11c856
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x12c71a
leaq 0x68(%rsp), %rdi
movl $0x7f, %esi
callq 0x11d018
leaq 0x1b8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x11d118
leaq 0x168(%rsp), %rdi
callq 0x12c900
leaq 0x138(%rsp), %rdi
callq 0x12c900
leaq 0x108(%rsp), %rdi
callq 0x12c900
leaq 0xd8(%rsp), %rdi
callq 0x12c900
leaq 0xa8(%rsp), %rdi
callq 0x12c900
leaq 0x78(%rsp), %rdi
callq 0x12c900
leaq 0x1b8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x11d93c
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x1b8(%rsp), %rdi
callq 0x11e30e
leaq 0x28(%rsp), %rdi
callq 0x11e5d0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11c916
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0xae0(%rsp), %rdi
callq 0x11e61e
movq %rsp, %rdi
callq 0x11e680
addq $0x14c8, %rsp           # imm = 0x14C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11c94e
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x11d8f4
jmp 0x11c9c2
movq %rax, %rbx
jmp 0x11c9c2
movq %rax, %rbx
jmp 0x11c9cc
jmp 0x11c977
jmp 0x11c9e6
movq %rax, %rbx
jmp 0x11ca1c
movq %rax, %rbx
jmp 0x11ca38
movq %rax, %rbx
jmp 0x11ca45
movq %rax, %rbx
jmp 0x11ca61
jmp 0x11c9aa
movq %rax, %rbx
movq 0xae0(%rsp), %rdi
cmpq %r14, %rdi
je 0x11ca6e
movq 0xaf0(%rsp), %rsi
incq %rsi
callq 0x119090
jmp 0x11ca6e
movq %rax, %rbx
jmp 0x11ca6e
movq %rax, %rbx
leaq 0x1b8(%rsp), %rdi
callq 0x11e30e
leaq 0x28(%rsp), %rdi
callq 0x11e5d0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11ca61
movq 0x18(%rsp), %rsi
jmp 0x11ca59
movq %rax, %rbx
jmp 0x11ca05
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x11ca05
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11ca1c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x119090
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11ca38
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0x1b8(%rsp), %rdi
callq 0x11cf3e
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x11ca61
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x119090
leaq 0xae0(%rsp), %rdi
callq 0x11e61e
movq %rsp, %rdi
callq 0x11e680
movq %rbx, %rdi
callq 0x1192e0