// File: /workspace/github_cpp_makefile_star2_O3/ArashPartow[P]exprtk-extras/exprtk_vectornorm.cpp
// Function: void norm_of_vector<double>()
void norm_of_vector()
{
   typedef exprtk::symbol_table<T> symbol_table_t;
   typedef exprtk::expression<T>   expression_t;
   typedef exprtk::parser<T>       parser_t;

   T x[] = { T(1), T(2), T(3), T(4), T(5) };

   std::vector<T> y;

   y.push_back(T(5)); y.push_back(T(6));
   y.push_back(T(7)); y.push_back(T(8));
   y.push_back(T(9)); y.push_back(T(0));

   symbol_table_t symbol_table;
   symbol_table.add_vector("x", x);
   symbol_table.add_vector("y", y);

   norm<T> norm_;

   symbol_table.add_function("norm",norm_);

   const std::string vector_norm_program[] =
      {
         " norm(x)          ",
         " norm(x,1)        ",
         " norm(x,2)        ",
         " norm(x,3)        ",
         " norm(x,4)        ",
         " norm(x,5)        ",
         " norm(2x+1)       ",
         " norm(2x+1,1)     ",
         " norm(2x+1,2)     ",
         " norm(2x+1,3)     ",
         " norm(2x+1,4)     ",
         " norm(2x+1,5)     ",
         " norm(2x+y/3-4)   ",
         " norm(2x+y/3-4,1) ",
         " norm(2x+y/3-4,2) ",
         " norm(2x+y/3-4,3) ",
         " norm(2x+y/3-4,4) ",
         " norm(2x+y/3-4,5) "
      };

   const std::size_t vecnorm_program_size = sizeof(vector_norm_program) / sizeof(std::string);

   parser_t parser;

   for (std::size_t i = 0; i < vecnorm_program_size; ++i)
   {
      expression_t expression;
      expression.register_symbol_table(symbol_table);

      parser.compile(vector_norm_program[i], expression);

      printf("%s = %15.8f\n",
             vector_norm_program[i].c_str(),
             expression.value());
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd48, %rsp            # imm = 0xD48
movaps 0x18bd33(%rip), %xmm0   # 0x2a3010
movaps %xmm0, 0x20(%rsp)
movaps 0x18bd37(%rip), %xmm0   # 0x2a3020
movaps %xmm0, 0x30(%rsp)
movabsq $0x4014000000000000, %rax # imm = 0x4014000000000000
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x420(%rsp), %rdx
movq %rax, (%rdx)
xorl %esi, %esi
callq 0x119b80
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movabsq $0x4018000000000000, %rcx # imm = 0x4018000000000000
movq %rcx, 0x420(%rsp)
cmpq %rax, %rsi
je 0x11734f
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x117369
movq %rsp, %rdi
leaq 0x420(%rsp), %rdx
callq 0x119b80
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movabsq $0x401c000000000000, %rcx # imm = 0x401C000000000000
movq %rcx, 0x420(%rsp)
cmpq %rax, %rsi
je 0x11738e
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x1173a8
movq %rsp, %rdi
leaq 0x420(%rsp), %rdx
callq 0x119b80
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movabsq $0x4020000000000000, %rcx # imm = 0x4020000000000000
movq %rcx, 0x420(%rsp)
cmpq %rax, %rsi
je 0x1173cd
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x1173e7
movq %rsp, %rdi
leaq 0x420(%rsp), %rdx
callq 0x119b80
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movabsq $0x4022000000000000, %rcx # imm = 0x4022000000000000
movq %rcx, 0x420(%rsp)
cmpq %rax, %rsi
je 0x11740c
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x117426
movq %rsp, %rdi
leaq 0x420(%rsp), %rdx
callq 0x119b80
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq $0x0, 0x420(%rsp)
cmpq %rax, %rsi
je 0x117449
movq $0x0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x117459
movq %rsp, %rdi
leaq 0x420(%rsp), %rdx
callq 0x119b80
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x117c48
leaq 0x430(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x19059e(%rip), %rsi    # 0x2a7a19
leaq 0x190598(%rip), %rdx    # 0x2a7a1a
leaq 0x420(%rsp), %rdi
callq 0x117bb2
leaq 0x18(%rsp), %rdi
leaq 0x420(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x117c90
movq 0x420(%rsp), %rdi
cmpq %r14, %rdi
je 0x1174c3
movq 0x430(%rsp), %rsi
incq %rsi
callq 0x114090
leaq 0x420(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x190838(%rip), %rsi    # 0x2a7d0d
leaq 0x190832(%rip), %rdx    # 0x2a7d0e
callq 0x117bb2
leaq 0x18(%rsp), %rdi
leaq 0x420(%rsp), %rsi
movq %rsp, %rdx
callq 0x117e62
movq 0x420(%rsp), %rdi
cmpq %r14, %rdi
je 0x117513
movq 0x430(%rsp), %rsi
incq %rsi
callq 0x114090
leaq 0x48(%rsp), %rdi
callq 0x118042
leaq 0x420(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x190592(%rip), %rsi    # 0x2a7ac1
leaq 0x19058f(%rip), %rdx    # 0x2a7ac5
callq 0x117bb2
leaq 0x18(%rsp), %rbx
leaq 0x420(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
callq 0x1180fe
movq 0x420(%rsp), %rdi
cmpq %r14, %rdi
je 0x117572
movq 0x430(%rsp), %rsi
incq %rsi
callq 0x114090
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x190541(%rip), %rsi    # 0x2a7ac6
leaq 0x19054c(%rip), %rdx    # 0x2a7ad8
leaq 0x90(%rsp), %r12
movq %r12, %rdi
callq 0x117bb2
leaq 0xb0(%rsp), %r15
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x190522(%rip), %rsi    # 0x2a7ad9
leaq 0x19052d(%rip), %rdx    # 0x2a7aeb
movq %r15, %rdi
callq 0x117bb2
leaq 0xd0(%rsp), %r15
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x19050b(%rip), %rsi    # 0x2a7aec
leaq 0x190516(%rip), %rdx    # 0x2a7afe
movq %r15, %rdi
callq 0x117bb2
leaq 0xf0(%rsp), %r15
leaq 0x100(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1904f4(%rip), %rsi    # 0x2a7aff
leaq 0x1904ff(%rip), %rdx    # 0x2a7b11
movq %r15, %rdi
callq 0x117bb2
leaq 0x110(%rsp), %r15
leaq 0x120(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1904dd(%rip), %rsi    # 0x2a7b12
leaq 0x1904e8(%rip), %rdx    # 0x2a7b24
movq %r15, %rdi
callq 0x117bb2
leaq 0x130(%rsp), %r15
leaq 0x140(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1904c6(%rip), %rsi    # 0x2a7b25
leaq 0x1904d1(%rip), %rdx    # 0x2a7b37
movq %r15, %rdi
callq 0x117bb2
leaq 0x150(%rsp), %r15
leaq 0x160(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1904af(%rip), %rsi    # 0x2a7b38
leaq 0x1904ba(%rip), %rdx    # 0x2a7b4a
movq %r15, %rdi
callq 0x117bb2
leaq 0x170(%rsp), %r15
leaq 0x180(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x190498(%rip), %rsi    # 0x2a7b4b
leaq 0x1904a3(%rip), %rdx    # 0x2a7b5d
movq %r15, %rdi
callq 0x117bb2
leaq 0x190(%rsp), %r15
leaq 0x1a0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x190481(%rip), %rsi    # 0x2a7b5e
leaq 0x19048c(%rip), %rdx    # 0x2a7b70
movq %r15, %rdi
callq 0x117bb2
leaq 0x1b0(%rsp), %r15
leaq 0x1c0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x19046a(%rip), %rsi    # 0x2a7b71
leaq 0x190475(%rip), %rdx    # 0x2a7b83
movq %r15, %rdi
callq 0x117bb2
leaq 0x1d0(%rsp), %r15
leaq 0x1e0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x190453(%rip), %rsi    # 0x2a7b84
leaq 0x19045e(%rip), %rdx    # 0x2a7b96
movq %r15, %rdi
callq 0x117bb2
leaq 0x1f0(%rsp), %r15
leaq 0x200(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x19043c(%rip), %rsi    # 0x2a7b97
leaq 0x190447(%rip), %rdx    # 0x2a7ba9
movq %r15, %rdi
callq 0x117bb2
leaq 0x210(%rsp), %r15
leaq 0x220(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x190425(%rip), %rsi    # 0x2a7baa
leaq 0x190430(%rip), %rdx    # 0x2a7bbc
movq %r15, %rdi
callq 0x117bb2
leaq 0x230(%rsp), %r15
leaq 0x240(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x19040e(%rip), %rsi    # 0x2a7bbd
leaq 0x190419(%rip), %rdx    # 0x2a7bcf
movq %r15, %rdi
callq 0x117bb2
leaq 0x250(%rsp), %r15
leaq 0x260(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1903f7(%rip), %rsi    # 0x2a7bd0
leaq 0x190402(%rip), %rdx    # 0x2a7be2
movq %r15, %rdi
callq 0x117bb2
leaq 0x270(%rsp), %r15
leaq 0x280(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1903e0(%rip), %rsi    # 0x2a7be3
leaq 0x1903eb(%rip), %rdx    # 0x2a7bf5
movq %r15, %rdi
callq 0x117bb2
leaq 0x290(%rsp), %r15
leaq 0x2a0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1903c9(%rip), %rsi    # 0x2a7bf6
leaq 0x1903d4(%rip), %rdx    # 0x2a7c08
movq %r15, %rdi
callq 0x117bb2
leaq 0x2b0(%rsp), %r15
leaq 0x2c0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1903b2(%rip), %rsi    # 0x2a7c09
leaq 0x1903bd(%rip), %rdx    # 0x2a7c1b
movq %r15, %rdi
callq 0x117bb2
leaq 0x2d0(%rsp), %rdi
movl $0x7f, %esi
callq 0x118268
leaq 0x420(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x118368
leaq 0x3d0(%rsp), %rdi
callq 0x11d1ac
leaq 0x3a0(%rsp), %rdi
callq 0x11d1ac
leaq 0x370(%rsp), %rdi
callq 0x11d1ac
leaq 0x340(%rsp), %rdi
callq 0x11d1ac
leaq 0x310(%rsp), %rdi
callq 0x11d1ac
leaq 0x2e0(%rsp), %rdi
callq 0x11d1ac
xorl %r12d, %r12d
leaq 0x2d0(%rsp), %r15
leaq 0x19032f(%rip), %r13    # 0x2a7c1c
movq %r15, %rdi
callq 0x118b8c
movq 0x2d8(%rsp), %rax
movq 0x2e0(%rsp), %rcx
subq %rax, %rcx
je 0x11792e
sarq $0x3, %rcx
movq 0x18(%rsp), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
cmpq %rbx, %rax
je 0x11793e
cmpq (%rax), %rdx
je 0x11793e
addq $0x8, %rax
decq %rcx
jne 0x11791b
leaq 0x2d8(%rsp), %rdi
movq %rbx, %rsi
callq 0x17be1a
movq %r12, %rax
shlq $0x5, %rax
leaq (%rsp,%rax), %rbp
addq $0x90, %rbp
leaq 0x420(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x118c18
movq (%rbp), %rbp
movq 0x2d0(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %r13, %rdi
movq %rbp, %rsi
movb $0x1, %al
callq 0x114050
movq %r15, %rdi
callq 0x1197b4
incq %r12
cmpq $0x12, %r12
jne 0x1178ed
leaq 0x420(%rsp), %rdi
callq 0x119802
movq $-0x240, %rbx           # imm = 0xFDC0
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x1179c3
movq (%r14), %rsi
incq %rsi
callq 0x114090
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x1179af
leaq 0x285cbc(%rip), %rax    # 0x39d690
leaq 0x78(%rsp), %rcx
movq %rax, -0x30(%rcx)
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x1179f3
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x114090
leaq 0x18(%rsp), %rdi
callq 0x119aea
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x117a13
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x114090
addq $0xd48, %rsp            # imm = 0xD48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x117b06
jmp 0x117b06
jmp 0x117b06
jmp 0x117b06
jmp 0x117b06
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
callq 0x118b44
jmp 0x117b2d
movq %rax, %rbx
jmp 0x117b2d
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
jmp 0x117a7b
movq %rax, %rbx
addq $-0x10, %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x117a96
movq (%r15), %rsi
incq %rsi
callq 0x114090
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r12, %r15
movq %rax, %r15
jne 0x117a82
jmp 0x117b59
jmp 0x117ad6
movq %rax, %rbx
movq 0x420(%rsp), %rdi
cmpq %r14, %rdi
je 0x117b59
movq 0x430(%rsp), %rsi
incq %rsi
callq 0x114090
jmp 0x117b59
movq %rax, %rbx
jmp 0x117b59
jmp 0x117aff
jmp 0x117ae1
jmp 0x117aff
movq %rax, %rbx
movq 0x420(%rsp), %rdi
cmpq %r14, %rdi
je 0x117b7f
movq 0x430(%rsp), %rsi
jmp 0x117b77
movq %rax, %rbx
jmp 0x117b7f
jmp 0x117b06
movq %rax, %rbx
jmp 0x117b89
movq %rax, %rbx
jmp 0x117b20
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
callq 0x1197b4
leaq 0x420(%rsp), %rdi
callq 0x119802
xorl %r15d, %r15d
movq 0x2b0(%rsp,%r15), %rdi
leaq (%r14,%r15), %rax
cmpq %rdi, %rax
je 0x117b4c
movq (%rax), %rsi
incq %rsi
callq 0x114090
addq $-0x20, %r15
cmpq $-0x240, %r15           # imm = 0xFDC0
jne 0x117b30
leaq 0x285b30(%rip), %rax    # 0x39d690
leaq 0x78(%rsp), %rcx
movq %rax, -0x30(%rcx)
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x117b7f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x114090
leaq 0x18(%rsp), %rdi
callq 0x119aea
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x117b9f
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x114090
movq %rbx, %rdi
callq 0x1142e0