// File: /workspace/github_cpp_makefile_star2_O1/ArashPartow[P]exprtk-extras/exprtk_gnuplot_multi.cpp
// Function: exprtk_gnuplot_fx::generate_gp_script()
bool generate_gp_script()
   {
      std::ofstream stream("plot.gp");

      if (!stream)
      {
         return false;
      }

      double min_x = +std::numeric_limits<double>::max();
      double max_x = -std::numeric_limits<double>::max();
      double min_y = +std::numeric_limits<double>::max();
      double max_y = -std::numeric_limits<double>::max();

      for (std::size_t i = 0; i < curve_list_.size(); ++i)
      {
         exprtk_fx_curve& curve = curve_list_[i];

         if (curve.min_x_ < min_x) min_x = curve.min_x_;
         if (curve.max_x_ > max_x) max_x = curve.max_x_;
         if (curve.min_y_ < min_y) min_y = curve.min_y_;
         if (curve.max_y_ > max_y) max_y = curve.max_y_;
      }

      stream << "set term png\n";
      stream << "set output 'plot.png'\n";
      stream << "set xrange[" << min_x << ":" << max_x <<"]\n";
      stream << "set yrange[" << min_y << ":" << max_y <<"]\n";
      stream << "set xzeroaxis\n";
      stream << "set yzeroaxis\n";
      stream << "plot \\\n";

      for (std::size_t i = 0; i < curve_list_.size(); ++i)
      {
         stream << "'data.dat" << i << "' using 1:2:(1.0) smooth unique title '" << curve_list_[i].title_;
         stream << (((i + 1) < curve_list_.size()) ? "',\\\n"  : "'\n");
      }

      return true;
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
leaq 0x1b414a(%rip), %rsi    # 0x2ce429
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x10, %edx
callq 0x116150
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x48(%rsp,%rax), %eax
movl %eax, 0x24(%rsp)
testb $0x5, %al
je 0x11a352
testb $0x5, 0x24(%rsp)
sete %bl
movq 0x31bcb5(%rip), %rax    # 0x435fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x1162e0
leaq 0x120(%rsp), %rdi
callq 0x116370
movl %ebx, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rbx), %r14
movsd 0x1aad6a(%rip), %xmm0   # 0x2c50c8
movsd 0x1aad6a(%rip), %xmm1   # 0x2c50d0
xorl %r15d, %r15d
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
movsd %xmm1, 0x10(%rsp)
movsd %xmm1, (%rsp)
movsd %xmm0, 0x18(%rsp)
movsd %xmm0, 0x8(%rsp)
movq 0x48(%rbx), %rax
movq %rax, %rcx
subq 0x28(%rbx), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
leaq (%rcx,%rcx,4), %rax
movq 0x20(%rbx), %rcx
movq 0x30(%rbx), %rdx
subq 0x38(%rbx), %rdx
sarq $0x5, %rdx
imulq %rbp, %rdx
addq %rax, %rdx
subq 0x10(%rbx), %rcx
sarq $0x5, %rcx
imulq %rbp, %rcx
addq %rdx, %rcx
cmpq %rcx, %r15
jae 0x11a425
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c3f8c
movsd 0x40(%rax), %xmm0
movsd 0x48(%rax), %xmm1
minsd 0x10(%rsp), %xmm0
maxsd 0x18(%rsp), %xmm1
movsd 0x50(%rax), %xmm2
minsd (%rsp), %xmm2
movsd 0x58(%rax), %xmm3
maxsd 0x8(%rsp), %xmm3
incq %r15
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x18(%rsp)
movsd %xmm2, (%rsp)
movsd %xmm3, 0x8(%rsp)
jmp 0x11a38a
leaq 0x1b4005(%rip), %rsi    # 0x2ce431
leaq 0x28(%rsp), %rdi
movl $0xd, %edx
callq 0x116500
leaq 0x1b3ffd(%rip), %rsi    # 0x2ce43f
leaq 0x28(%rsp), %rdi
movl $0x16, %edx
callq 0x116500
leaq 0x1b3ffe(%rip), %rsi    # 0x2ce456
leaq 0x28(%rsp), %rdi
movl $0xb, %edx
callq 0x116500
leaq 0x28(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
callq 0x1163b0
movq %rax, %r15
leaq 0x1afbd8(%rip), %rsi    # 0x2ca059
movl $0x1, %edx
movq %rax, %rdi
callq 0x116500
movq %r15, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x1163b0
leaq 0x1b3fbf(%rip), %rsi    # 0x2ce462
movl $0x2, %edx
movq %rax, %rdi
callq 0x116500
leaq 0x1b3fae(%rip), %rsi    # 0x2ce465
leaq 0x28(%rsp), %rdi
movl $0xb, %edx
callq 0x116500
leaq 0x28(%rsp), %rdi
movsd (%rsp), %xmm0
callq 0x1163b0
movq %rax, %r15
leaq 0x1afb7a(%rip), %rsi    # 0x2ca059
movl $0x1, %edx
movq %rax, %rdi
callq 0x116500
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x1163b0
leaq 0x1b3f61(%rip), %rsi    # 0x2ce462
movl $0x2, %edx
movq %rax, %rdi
callq 0x116500
leaq 0x1b3f5c(%rip), %rsi    # 0x2ce471
leaq 0x28(%rsp), %rdi
movl $0xe, %edx
callq 0x116500
leaq 0x1b3f55(%rip), %rsi    # 0x2ce480
leaq 0x28(%rsp), %rdi
movl $0xe, %edx
callq 0x116500
leaq 0x1b3f4e(%rip), %rsi    # 0x2ce48f
leaq 0x28(%rsp), %rdi
movl $0x7, %edx
callq 0x116500
xorl %r15d, %r15d
leaq 0x28(%rsp), %r13
movq 0x48(%rbx), %rax
movq %rax, %rcx
subq 0x28(%rbx), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
leaq (%rcx,%rcx,4), %rax
movq 0x20(%rbx), %rcx
movq 0x30(%rbx), %rdx
subq 0x38(%rbx), %rdx
sarq $0x5, %rdx
imulq %rbp, %rdx
addq %rax, %rdx
subq 0x10(%rbx), %rcx
sarq $0x5, %rcx
imulq %rbp, %rcx
addq %rdx, %rcx
cmpq %rcx, %r15
jae 0x11a304
movl $0x9, %edx
movq %r13, %rdi
leaq 0x1b3ee6(%rip), %rsi    # 0x2ce497
callq 0x116500
movq %r13, %rdi
movq %r15, %rsi
callq 0x116250
movq %rax, %r12
movl $0x27, %edx
movq %rax, %rdi
leaq 0x1b3ece(%rip), %rsi    # 0x2ce4a1
callq 0x116500
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c3f8c
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r12, %rdi
callq 0x116500
incq %r15
movq 0x48(%rbx), %rax
movq %rax, %rcx
subq 0x28(%rbx), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
leaq (%rcx,%rcx,4), %rax
movq 0x30(%rbx), %rcx
subq 0x38(%rbx), %rcx
movq 0x20(%rbx), %rdx
sarq $0x5, %rcx
imulq %rbp, %rcx
addq %rax, %rcx
subq 0x10(%rbx), %rdx
sarq $0x5, %rdx
imulq %rbp, %rdx
addq %rcx, %rdx
xorl %eax, %eax
cmpq %rdx, %r15
setb %al
leaq 0x1b3e0e(%rip), %rsi    # 0x2ce453
leaq 0x1b3e7d(%rip), %rcx    # 0x2ce4c9
cmovbq %rcx, %rsi
leaq 0x2(,%rax,2), %rdx
movq %r13, %rdi
callq 0x116500
jmp 0x11a558
jmp 0x11a667
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x1163d0
movq %rbx, %rdi
callq 0x116300