// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk/exprtk_simple_example_19.cpp
// Function: void vector_randu<double>()
void vector_randu()
{
   typedef exprtk::symbol_table<T> symbol_table_t;
   typedef exprtk::expression<T>   expression_t;
   typedef exprtk::parser<T>       parser_t;

   const std::string vecrandu_program =
      " var noise[6] := [0];                          "
      "                                               "
      " if (randu(noise, 0, 5) == false)              "
      " {                                             "
      "    println('Failed to generate noise');       "
      "    return [false];                            "
      " };                                            "
      "                                               "
      " var noisy[noise[]] := signal + (noise - 1/2); "
      "                                               "
      " for (var i := 0; i < noisy[]; i += 1)         "
      " {                                             "
      "    println('noisy[',i,'] = ', noisy[i]);      "
      " };                                            "
      "                                               "
      " println('avg: ', avg(noisy));                 "
      "                                               ";

   T signal[] = { T(1.1), T(2.2), T(3.3), T(4.4), T(5.5), T(6.6), T(7.7) };

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

   symbol_table_t symbol_table;
   symbol_table.add_vector  ("signal" , signal );
   symbol_table.add_function("println", println);
   symbol_table.add_function("randu"  , randu  );

   expression_t expression;
   expression.register_symbol_table(symbol_table);

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

   expression.value();
}

// Assembly:
pushq %rbx
subq $0xbb0, %rsp            # imm = 0xBB0
leaq 0x12adc7(%rip), %rsi    # 0x23b109
leaq 0x30(%rsp), %rdi
leaq 0x288(%rsp), %rdx
callq 0x1102f8
movaps 0x12fc25(%rip), %xmm0   # 0x23ff80
movaps %xmm0, 0x70(%rsp)
movaps 0x12fc09(%rip), %xmm0   # 0x23ff70
movaps %xmm0, 0x60(%rsp)
movaps 0x12fbed(%rip), %xmm0   # 0x23ff60
movaps %xmm0, 0x50(%rsp)
movabsq $0x401ecccccccccccd, %rax # imm = 0x401ECCCCCCCCCCCD
movq %rax, 0x80(%rsp)
leaq 0x12b098(%rip), %rsi    # 0x23b429
leaq 0x288(%rsp), %rdi
leaq 0x138(%rsp), %rdx
callq 0x1102f8
leaq 0xd0(%rsp), %rdi
leaq 0x288(%rsp), %rsi
callq 0x1106b4
leaq 0x288(%rsp), %rdi
callq 0x10e5f8
leaq 0x88(%rsp), %rdi
callq 0x110746
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x1107b6
leaq 0x12b047(%rip), %rsi    # 0x23b430
leaq 0x288(%rsp), %rdi
leaq 0x138(%rsp), %rdx
callq 0x1102f8
leaq 0x8(%rsp), %rdi
leaq 0x288(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x1107da
leaq 0x288(%rsp), %rdi
callq 0x10e5f8
leaq 0x12b00e(%rip), %rsi    # 0x23b437
leaq 0x288(%rsp), %rdi
leaq 0x138(%rsp), %rdx
callq 0x1102f8
leaq 0x8(%rsp), %rdi
leaq 0x288(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x11083c
leaq 0x288(%rsp), %rdi
callq 0x10e5f8
leaq 0x12afd3(%rip), %rsi    # 0x23b43f
leaq 0x288(%rsp), %rdi
leaq 0x138(%rsp), %rdx
callq 0x1102f8
leaq 0x8(%rsp), %rdi
leaq 0x288(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x11083c
leaq 0x288(%rsp), %rdi
callq 0x10e5f8
leaq 0x10(%rsp), %rdi
callq 0x110904
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x110964
leaq 0x138(%rsp), %rdi
pushq $0x7f
popq %rsi
callq 0x1109c0
leaq 0x288(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x110ad0
leaq 0x138(%rsp), %rdi
callq 0x1110e8
leaq 0x288(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x111130
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x288(%rsp), %rdi
callq 0x1115b2
leaq 0x10(%rsp), %rdi
callq 0x1116ec
leaq 0x8(%rsp), %rdi
callq 0x111702
leaq 0x88(%rsp), %rdi
callq 0x111744
leaq 0xd0(%rsp), %rdi
callq 0x111758
leaq 0x30(%rsp), %rdi
callq 0x10e5f8
addq $0xbb0, %rsp            # imm = 0xBB0
popq %rbx
retq
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x1110e8
jmp 0x1105d2
jmp 0x11057b
movq %rax, %rbx
jmp 0x1105d2
jmp 0x11059c
jmp 0x11058a
jmp 0x11059c
jmp 0x11058a
jmp 0x11059c
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0x10e5f8
jmp 0x1105dc
movq %rax, %rbx
jmp 0x1105dc
movq %rax, %rbx
jmp 0x1105e6
movq %rax, %rbx
jmp 0x1105f3
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0x10e5f8
jmp 0x110600
movq %rax, %rbx
jmp 0x110600
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0x1115b2
leaq 0x10(%rsp), %rdi
callq 0x1116ec
leaq 0x8(%rsp), %rdi
callq 0x111702
leaq 0x88(%rsp), %rdi
callq 0x111744
leaq 0xd0(%rsp), %rdi
callq 0x111758
leaq 0x30(%rsp), %rdi
callq 0x10e5f8
movq %rbx, %rdi
callq 0x10e310