// File: /workspace/github_cpp_makefile_star2_O3/ArashPartow[P]exprtk-extras/exprtk_gnuplot.cpp
// Function: exprtk_gnuplot_fx::generate_data()
bool generate_data()
   {
      typedef exprtk::symbol_table<double> symbol_table_t;
      typedef exprtk::expression<double>   expression_t;
      typedef exprtk::parser<double>       parser_t;

      double x = 0.0;

      symbol_table_t symbol_table;
      symbol_table.add_constants();
      symbol_table.add_variable("x",x);

      expression_t expression;
      expression.register_symbol_table(symbol_table);

      parser_t parser;

      if (!parser.compile(expression_,expression))
      {
         return false;
      }

      std::ofstream stream("data.dat");

      if (!stream)
      {
         return false;
      }

      min_y_ = +std::numeric_limits<double>::max();
      max_y_ = -std::numeric_limits<double>::max();

      stream << std::setprecision(10);

      const double increment = std::min(0.00005,std::abs(max_x_ - min_x_) / 1000.0);

      for (x = min_x_; x <= max_x_; x += increment)
      {
         const double y = expression.value();

              if (y < min_y_) min_y_ = y;
         else if (y > max_y_) max_y_ = y;

         stream << x << "\t" << y << "\n";
      }

      const double diff_y  = std::abs(max_y_ - min_y_);
      const double perc7_5 = diff_y * 0.075; //7.5%

      min_y_ -= perc7_5;
      max_y_ += perc7_5;

      return true;
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb78, %rsp            # imm = 0xB78
movq %rdi, %rbx
movq $0x0, 0x8(%rsp)
movq %rsp, %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x117b08
movq %r14, %rdi
callq 0x117b50
leaq 0x260(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x18e321(%rip), %rsi    # 0x2a58d9
leaq 0x18e31b(%rip), %rdx    # 0x2a58da
leaq 0x250(%rsp), %rdi
callq 0x17f9d0
movq %rsp, %r14
leaq 0x250(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x117c96
movq 0x250(%rsp), %rdi
cmpq %r15, %rdi
je 0x117603
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x114080
leaq 0x20(%rsp), %rdi
callq 0x117de6
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
subq %rax, %rcx
je 0x11763f
sarq $0x3, %rcx
movq (%rsp), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
cmpq %r14, %rax
je 0x11764c
cmpq (%rax), %rdx
je 0x11764c
addq $0x8, %rax
decq %rcx
jne 0x11762c
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0x11c066
leaq 0x50(%rsp), %rdi
movl $0x7f, %esi
callq 0x117e72
leaq 0x250(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x117f72
leaq 0x150(%rsp), %rdi
callq 0x11c268
leaq 0x120(%rsp), %rdi
callq 0x11c268
leaq 0xf0(%rsp), %rdi
callq 0x11c268
leaq 0xc0(%rsp), %rdi
callq 0x11c268
leaq 0x90(%rsp), %rdi
callq 0x11c268
leaq 0x60(%rsp), %rdi
callq 0x11c268
leaq 0x20(%rbx), %rsi
leaq 0x250(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x118796
testb %al, %al
je 0x11774b
leaq 0x18e2c8(%rip), %rsi    # 0x2a59a1
leaq 0x50(%rsp), %rdi
movl $0x10, %edx
callq 0x114150
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rcx
testb $0x5, 0x70(%rsp,%rcx)
sete %r15b
jne 0x11785a
leaq 0x50(%rbx), %r14
leaq 0x58(%rbx), %rbp
movaps 0x189911(%rip), %xmm0   # 0x2a1020
movups %xmm0, 0x50(%rbx)
movq -0x18(%rax), %rax
movq $0xa, 0x58(%rsp,%rax)
movsd 0x40(%rbx), %xmm0
movsd 0x48(%rbx), %xmm1
movsd %xmm0, 0x8(%rsp)
ucomisd %xmm0, %xmm1
jae 0x117753
movsd 0x189992(%rip), %xmm0   # 0x2a10d0
movsd 0x189992(%rip), %xmm1   # 0x2a10d8
jmp 0x117830
xorl %r15d, %r15d
jmp 0x11788c
movl %r15d, 0x14(%rsp)
subsd %xmm0, %xmm1
andpd 0x1898cc(%rip), %xmm1   # 0x2a1030
divsd 0x189954(%rip), %xmm1   # 0x2a10c0
minsd 0x189954(%rip), %xmm1   # 0x2a10c8
movapd %xmm1, 0x40(%rsp)
leaq 0x18e229(%rip), %r15    # 0x2a59aa
leaq 0x192cf6(%rip), %r12    # 0x2aa47e
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movsd %xmm0, 0x18(%rsp)
movsd (%r14), %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm1, %xmm0
movq %r14, %rax
ja 0x1177bb
ucomisd (%rbp), %xmm1
movq %rbp, %rax
jbe 0x1177bf
movsd %xmm1, (%rax)
movsd 0x8(%rsp), %xmm0
leaq 0x50(%rsp), %rdi
callq 0x1143a0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x1144f0
movq %r13, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x1143a0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1144f0
movsd 0x8(%rsp), %xmm0
addsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x48(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jae 0x117788
movsd (%rbp), %xmm0
movsd (%r14), %xmm1
movl 0x14(%rsp), %r15d
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
andpd 0x1897f0(%rip), %xmm2   # 0x2a1030
mulsd 0x189898(%rip), %xmm2   # 0x2a10e0
subsd %xmm2, %xmm1
movsd %xmm1, (%r14)
addsd %xmm0, %xmm2
movsd %xmm2, (%rbp)
movq 0x2e9767(%rip), %rax    # 0x400fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x58(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x50(%rsp,%rcx)
callq 0x1142d0
leaq 0x148(%rsp), %rdi
callq 0x114360
leaq 0x250(%rsp), %rdi
callq 0x119332
leaq 0x20(%rsp), %rdi
callq 0x1195f4
movq %rsp, %rdi
callq 0x119642
movl %r15d, %eax
addq $0xb78, %rsp            # imm = 0xB78
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1178c4
jmp 0x1178d8
movq %rax, %rbx
jmp 0x117915
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x11874e
jmp 0x117922
movq %rax, %rbx
jmp 0x117922
jmp 0x117903
movq %rax, %rbx
movq 0x250(%rsp), %rdi
cmpq %r15, %rdi
je 0x11792c
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x114080
jmp 0x11792c
jmp 0x117903
movq %rax, %rbx
jmp 0x11792c
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x1143c0
leaq 0x250(%rsp), %rdi
callq 0x119332
leaq 0x20(%rsp), %rdi
callq 0x1195f4
movq %rsp, %rdi
callq 0x119642
movq %rbx, %rdi
callq 0x1142f0