// File: /workspace/github_cpp_makefile_star2_O1/ArashPartow[P]exprtk-extras/exprtk_vector_benchmark_multithreaded.cpp
// Function: void run_expression_benchmark<double>(unsigned long const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long const&)
void run_expression_benchmark(const std::size_t& vec_size,
                              const std::string& expression_string,
                              const std::size_t& cost)
{
   typedef exprtk::symbol_table<numeric_type> symbol_table_t;
   typedef exprtk::expression<numeric_type>   expression_t;
   typedef exprtk::parser<numeric_type>       parser_t;

   std::vector<T> v0(vec_size, T(3.1234567890));
   std::vector<T> v1(vec_size, T(5.1234567890));
   std::vector<T> v2(vec_size, T(7.1234567890));

   exprtk::rtl::vecops::package<T> vecops_package;

   symbol_table_t symbol_table;
   symbol_table.add_vector("v0",v0);
   symbol_table.add_vector("v1",v1);
   symbol_table.add_vector("v2",v2);
   symbol_table.add_package(vecops_package);

   expression_t expression;
   expression.register_symbol_table(symbol_table);

   parser_t parser;

   if (!parser.compile(expression_string,expression))
   {
      printf("[load_expression] - Parser Error: %s\tExpression: %s\n",
             parser.error().c_str(),
             expression_string.c_str());

      return;
   }

   exprtk::timer timer;

   T total = T(0);

   timer.start();

   for (std::size_t r = 0; r < rounds; ++r)
   {
      total += expression.value();
   }

   timer.stop();

   if (T(0) != total)
      printf("Total Time:%10.7f Rate:%11.3fevals/sec Perf: %5.3fGFLOPS Expression: %s\n",
             timer.time(),
             rounds / timer.time(),
             (rounds * vec_size * cost) / (1e+9 * timer.time()),
             expression_string.c_str());
   else
      printf("run_expression_benchmark() - Error running benchmark for expression: %s\n",
             expression_string.c_str());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x12d8, %rsp           # imm = 0x12D8
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq (%rdi), %rsi
movabsq $0x4008fcd6e9b9cb1b, %rax # imm = 0x4008FCD6E9B9CB1B
leaq 0x1d0(%rsp), %r12
movq %rax, (%r12)
leaq 0x68(%rsp), %rdi
leaq 0xaf8(%rsp), %rcx
movq %r12, %rdx
callq 0x11e3c6
movq (%r15), %rsi
movabsq $0x40147e6b74dce58d, %rax # imm = 0x40147E6B74DCE58D
movq %rax, (%r12)
leaq 0x50(%rsp), %rdi
leaq 0x1d0(%rsp), %rdx
leaq 0xaf8(%rsp), %rcx
callq 0x11e3c6
movq (%r15), %rsi
movabsq $0x401c7e6b74dce58d, %rax # imm = 0x401C7E6B74DCE58D
leaq 0x1d0(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x38(%rsp), %rdi
leaq 0xaf8(%rsp), %rcx
callq 0x11e3c6
leaq 0xaf8(%rsp), %rdi
callq 0x11e4de
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x11eb88
leaq 0x1e0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1b7bbb(%rip), %rsi    # 0x2d5900
leaq 0x1b7bb6(%rip), %rdx    # 0x2d5902
leaq 0x1d0(%rsp), %rdi
callq 0x11d944
leaq 0x8(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x11ebd0
movq 0x1d0(%rsp), %rdi
cmpq %r12, %rdi
je 0x11dd8d
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x118090
leaq 0x1d0(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1b7bac(%rip), %rsi    # 0x2d594b
leaq 0x1b7ba7(%rip), %rdx    # 0x2d594d
callq 0x11d944
leaq 0x8(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x11ebd0
movq 0x1d0(%rsp), %rdi
cmpq %r12, %rdi
je 0x11dddf
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x118090
leaq 0x1d0(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1b7b94(%rip), %rsi    # 0x2d5985
leaq 0x1b7b8f(%rip), %rdx    # 0x2d5987
callq 0x11d944
leaq 0x8(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x11ebd0
movq 0x1d0(%rsp), %rdi
cmpq %r12, %rdi
je 0x11de31
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x118090
leaq 0xaf8(%rsp), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0x128cc4
leaq 0x18(%rsp), %rdi
callq 0x11ece8
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
subq %rcx, %rax
je 0x11deac
sarq $0x3, %rax
cmpq $0x1, %rax
movq %rax, %rsi
adcq $0x0, %rsi
cmpq %r12, %rcx
je 0x11debb
movq 0x8(%rsp), %rdx
cmpq (%rcx), %rdx
je 0x11debb
addq $0x8, %rcx
movl $0x1, %edi
subq %rsi, %rdi
xorl %esi, %esi
cmpq %rsi, %rdi
je 0x11deac
decq %rsi
cmpq %r12, %rcx
je 0x11dea4
leaq 0x8(%rcx), %r8
cmpq (%rcx), %rdx
movq %r8, %rcx
jne 0x11de8b
negq %rsi
cmpq %rax, %rsi
jb 0x11debb
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x12b2da
leaq 0x80(%rsp), %rdi
movl $0x7f, %esi
callq 0x11ed82
leaq 0x1d0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x11ee82
leaq 0x180(%rsp), %rdi
callq 0x12b4dc
leaq 0x150(%rsp), %rdi
callq 0x12b4dc
leaq 0x120(%rsp), %rdi
callq 0x12b4dc
leaq 0xf0(%rsp), %rdi
callq 0x12b4dc
leaq 0xc0(%rsp), %rdi
callq 0x12b4dc
leaq 0x90(%rsp), %r12
movq %r12, %rdi
callq 0x12b4dc
leaq 0x1d0(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %rbx, %rsi
callq 0x11f6a6
testb %al, %al
je 0x11e0ab
leaq 0x88(%rsp), %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%rdi)
movupd %xmm0, (%rdi)
movb $0x1, -0x8(%rdi)
xorl %esi, %esi
callq 0x118270
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x7d0, %r12d           # imm = 0x7D0
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
decq %r12
jne 0x11df80
leaq 0x98(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x118270
movb $0x0, -0x18(%r12)
xorpd %xmm0, %xmm0
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jne 0x11dfd2
jnp 0x11e140
movq 0x98(%rsp), %rax
movsd 0x1b3026(%rip), %xmm3   # 0x2d1008
movapd %xmm3, %xmm0
subq 0x88(%rsp), %rax
jl 0x11e030
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
addq 0xa0(%rsp), %rax
subq 0x90(%rsp), %rax
movq %rax, %xmm1
punpckldq 0x1b30dc(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b30e4(%rip), %xmm1   # 0x2d1100
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x1b2fe0(%rip), %xmm0   # 0x2d1010
movq 0x98(%rsp), %rax
subq 0x88(%rsp), %rax
jl 0x11e082
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
addq 0xa0(%rsp), %rax
subq 0x90(%rsp), %rax
movq %rax, %xmm1
punpckldq 0x1b308a(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b3092(%rip), %xmm1   # 0x2d1100
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
addsd %xmm1, %xmm3
mulsd 0x1b2f8e(%rip), %xmm3   # 0x2d1010
movq (%r15), %rax
movq (%r14), %rcx
movq 0x98(%rsp), %rdx
subq 0x88(%rsp), %rdx
jge 0x11e156
movsd 0x1b2f72(%rip), %xmm1   # 0x2d1018
jmp 0x11e19e
movq 0x4e8(%rsp), %r8
cmpq %r8, 0x508(%rsp)
je 0x11e10d
movq %r8, %rcx
subq 0x4f0(%rsp), %rcx
movq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rax # imm = 0xCF3CF3CF3CF3CF3D
imulq %rdx, %rax
cmpq $0x3, %rax
jb 0x11e211
movq 0x500(%rsp), %rsi
testq %rcx, %rcx
jle 0x11e1ed
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq %rdx
jmp 0x11e203
movq %r12, 0x80(%rsp)
movabsq $0x726f727245206f4e, %rax # imm = 0x726F727245206F4E
movq %rax, 0x90(%rsp)
movq $0x8, 0x88(%rsp)
movb $0x0, 0x98(%rsp)
jmp 0x11e22c
movq (%rbx), %rsi
leaq 0x1b7ba6(%rip), %rdi    # 0x2d5cf0
xorl %eax, %eax
callq 0x118050
jmp 0x11e262
imulq $0xf4240, %rdx, %rdx    # imm = 0xF4240
addq 0xa0(%rsp), %rdx
subq 0x90(%rsp), %rdx
movq %rdx, %xmm2
punpckldq 0x1b2f76(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x1b2f7e(%rip), %xmm2   # 0x2d1100
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
mulsd 0x1b2e7a(%rip), %xmm1   # 0x2d1010
mulsd 0x1b2e82(%rip), %xmm1   # 0x2d1020
imulq %rcx, %rax
imulq $0x7d0, %rax, %rax      # imm = 0x7D0
movq %rax, %xmm4
punpckldq 0x1b2f3a(%rip), %xmm4 # xmm4 = xmm4[0],mem[0],xmm4[1],mem[1]
subpd 0x1b2f42(%rip), %xmm4   # 0x2d1100
movapd %xmm4, %xmm2
unpckhpd %xmm4, %xmm2            # xmm2 = xmm2[1],xmm4[1]
addsd %xmm4, %xmm2
divsd %xmm1, %xmm2
movsd 0x1b2e52(%rip), %xmm1   # 0x2d1028
divsd %xmm3, %xmm1
movq (%rbx), %rsi
leaq 0x1b7ac3(%rip), %rdi    # 0x2d5ca7
movb $0x3, %al
callq 0x118050
jmp 0x11e262
notq %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq %rdx
notq %rdx
imulq $-0x1f8, %rdx, %r8      # imm = 0xFE08
addq (%rsi,%rdx,8), %r8
addq %rcx, %r8
leaq 0x80(%rsp), %rdi
movq %r12, (%rdi)
movq 0x38(%r8), %rsi
movq 0x40(%r8), %rdx
addq %rsi, %rdx
callq 0x11d8a8
movq 0x80(%rsp), %rsi
movq (%rbx), %rdx
leaq 0x1b7a34(%rip), %rdi    # 0x2d5c72
xorl %eax, %eax
callq 0x118050
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x11e262
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x118090
leaq 0x1d0(%rsp), %rdi
callq 0x120078
leaq 0x18(%rsp), %rdi
callq 0x12033a
leaq 0x8(%rsp), %rdi
callq 0x120388
leaq 0xaf8(%rsp), %rdi
callq 0x12041e
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x11e2a7
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x118090
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x11e2be
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x118090
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x11e2d5
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x118090
addq $0x12d8, %rsp           # imm = 0x12D8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x11e348
jmp 0x11e2fc
jmp 0x11e348
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x11f65e
jmp 0x11e358
movq %rax, %rbx
jmp 0x11e358
jmp 0x11e32f
jmp 0x11e32f
jmp 0x11e30d
jmp 0x11e32f
jmp 0x11e30d
jmp 0x11e32f
movq %rax, %rbx
movq 0x1d0(%rsp), %rdi
cmpq %r12, %rdi
je 0x11e362
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x118090
jmp 0x11e362
movq %rax, %rbx
jmp 0x11e362
movq %rax, %rbx
jmp 0x11e36c
movq %rax, %rbx
jmp 0x11e379
movq %rax, %rbx
jmp 0x11e390
movq %rax, %rbx
jmp 0x11e3a7
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x120078
leaq 0x18(%rsp), %rdi
callq 0x12033a
leaq 0x8(%rsp), %rdi
callq 0x120388
leaq 0xaf8(%rsp), %rdi
callq 0x12041e
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x11e390
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x118090
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x11e3a7
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x118090
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x11e3be
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x118090
movq %rbx, %rdi
callq 0x118320