// File: /workspace/github_cpp_makefile_star2_O3/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 0x119a9e
leaq 0xaf0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x19648f(%rip), %rsi    # 0x2af955
leaq 0x19648f(%rip), %rdx    # 0x2af95c
leaq 0xae0(%rsp), %rdi
callq 0x119a08
leaq 0x75a(%rip), %rdx       # 0x119c3b
movq %rsp, %rdi
leaq 0xae0(%rsp), %rsi
callq 0x119ae6
movq 0xae0(%rsp), %rdi
cmpq %r14, %rdi
je 0x11950e
movq 0xaf0(%rsp), %rsi
incq %rsi
callq 0x116090
leaq 0xae0(%rsp), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x119c78
leaq 0x78(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x19642c(%rip), %rsi    # 0x2af95d
leaq 0x196428(%rip), %rdx    # 0x2af960
leaq 0x68(%rsp), %rdi
callq 0x119a08
leaq 0x1b8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x119e00
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1962bc(%rip), %rsi    # 0x2af820
leaq 0x1962b6(%rip), %rdx    # 0x2af821
leaq 0x28(%rsp), %rdi
callq 0x119a08
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x19626b(%rip), %rsi    # 0x2af7f0
leaq 0x196265(%rip), %rdx    # 0x2af7f1
leaq 0x8(%rsp), %rdi
callq 0x119a08
leaq 0x1f8(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x1272b4
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1272b4
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x196399(%rip), %rsi    # 0x2af961
leaq 0x19649c(%rip), %rdx    # 0x2afa6b
leaq 0x48(%rsp), %rdi
callq 0x119a08
leaq 0x1d8(%rsp), %r12
leaq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x116520
leaq 0x1410(%rsp), %r15
leaq 0x1b8(%rsp), %rsi
movq %r15, %rdi
callq 0x11edc8
leaq 0x1418(%rsp), %rcx
cmpq %rax, %rcx
jne 0x1196c0
leaq 0xae0(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x11db2e
testb %al, %al
je 0x1196c0
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 0x11e9ec
movq (%rax), %r12
leaq 0x1b8(%rsp), %rsi
movq %r15, %rdi
callq 0x11ed4c
movq %r12, %rdi
movq %rax, %rsi
callq 0x11ea68
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x1196d7
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x116090
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
leaq 0x38(%rsp), %r15
je 0x1196f8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x116090
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x11970f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x116090
movq %r14, %rdi
callq 0x12754e
leaq 0x1e8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x119738
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x116090
leaq 0x1c8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x119759
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x116090
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x119770
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x116090
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1962ed(%rip), %rsi    # 0x2afa6c
leaq 0x196390(%rip), %rdx    # 0x2afb16
callq 0x119a08
leaq 0x8(%rsp), %rdi
callq 0x119eda
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
je 0x1197c7
sarq $0x3, %rcx
movq (%rsp), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
cmpq %rbx, %rax
je 0x1197d4
cmpq (%rax), %rdx
je 0x1197d4
addq $0x8, %rax
decq %rcx
jne 0x1197b4
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x1277d4
leaq 0x68(%rsp), %rdi
movl $0x7f, %esi
callq 0x119f66
leaq 0x1b8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x11a066
leaq 0x168(%rsp), %rdi
callq 0x1279ba
leaq 0x138(%rsp), %rdi
callq 0x1279ba
leaq 0x108(%rsp), %rdi
callq 0x1279ba
leaq 0xd8(%rsp), %rdi
callq 0x1279ba
leaq 0xa8(%rsp), %rdi
callq 0x1279ba
leaq 0x78(%rsp), %rdi
callq 0x1279ba
leaq 0x1b8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x11a88a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x1b8(%rsp), %rdi
callq 0x11b426
leaq 0x8(%rsp), %rdi
callq 0x11b6e8
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x119894
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x116090
leaq 0xae0(%rsp), %rdi
callq 0x11b736
movq %rsp, %rdi
callq 0x11b798
addq $0x14c8, %rsp           # imm = 0x14C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1198cc
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x11a842
jmp 0x119940
movq %rax, %rbx
jmp 0x119940
movq %rax, %rbx
jmp 0x11994a
jmp 0x1198f5
jmp 0x119964
movq %rax, %rbx
jmp 0x11999f
movq %rax, %rbx
jmp 0x1199bb
movq %rax, %rbx
jmp 0x1199c8
movq %rax, %rbx
jmp 0x1199df
jmp 0x119928
movq %rax, %rbx
movq 0xae0(%rsp), %rdi
cmpq %r14, %rdi
je 0x1199ec
movq 0xaf0(%rsp), %rsi
incq %rsi
callq 0x116090
jmp 0x1199ec
movq %rax, %rbx
jmp 0x1199ec
movq %rax, %rbx
leaq 0x1b8(%rsp), %rdi
callq 0x11b426
leaq 0x8(%rsp), %rdi
callq 0x11b6e8
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1199df
movq 0x38(%rsp), %rsi
jmp 0x1199d7
movq %rax, %rbx
jmp 0x119983
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x119983
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x116090
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11999f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x116090
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1199bb
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x116090
leaq 0x1b8(%rsp), %rdi
callq 0x119e9a
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1199df
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x116090
leaq 0xae0(%rsp), %rdi
callq 0x11b736
movq %rsp, %rdi
callq 0x11b798
movq %rbx, %rdi
callq 0x1162e0