// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/exprtk_repl.cpp
// Function: expression_processor<double>::process_function_definition(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
void process_function_definition(const std::string& func_def_header, bool read_stdin = true)
   {
      std::string func_def = func_def_header;

      if (read_stdin)
      {
         func_def += read_from_stdin();

         if (!func_def.empty() && ('$' == func_def[0]))
            func_def.erase(func_def.begin());
      }

      do
      {
         function_definition fd;

         func_parse_result fp_result = parse_function_definition(func_def,fd);

         if (e_parse_success == fp_result)
         {
            std::string vars;

            for (std::size_t i = 0; i < fd.var_list.size(); ++i)
            {
               vars += fd.var_list[i] + ((i < fd.var_list.size() - 1) ? "," : "");
            }

            function_t f(fd.name);

            for (std::size_t i = 0; i < fd.var_list.size(); ++i)
            {
               f.var(fd.var_list[i]);
            }

            f.expression(fd.body);

            if (function_symbol_table_.get_function(fd.name))
            {
               function_symbol_table_.remove_function(fd.name);

               for (std::size_t i = 0; i < func_def_list_.size(); ++i)
               {
                  if (exprtk::details::imatch(fd.name, func_def_list_[i].name))
                  {
                     func_def_list_.erase(func_def_list_.begin() + i);

                     break;
                  }
               }
            }

            if (!compositor_.add(f,true))
            {
               function_symbol_table_.remove_function(fd.name);

               printf("Error - Failed to add function: %s\n",fd.name.c_str());

               return;
            }

            printf("Function[%02d]\n",static_cast<int>(func_def_list_.size()));
            printf("Name: %s      \n",fd.name.c_str()                        );
            printf("Vars: (%s)    \n",vars.c_str()                           );
            printf("------------------------------------------------------\n");

            func_def_list_.push_back(fd);
         }
         else if (e_parse_notfunc != fp_result)
         {
            printf("Error - Critical parsing error - partial parse occurred\n");
            return;
         }
         else
            break;
      }
      while (!func_def.empty());

      if (!func_def.empty())
      {
         process(func_def);
      }
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
callq 0x116360
testl %ebp, %ebp
je 0x18213b
leaq 0xd8(%rsp), %rdi
movq %rbx, %rsi
callq 0x182678
leaq 0x18(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x116530
leaq 0xd8(%rsp), %rdi
callq 0x116778
cmpq $0x0, 0x20(%rsp)
je 0x18213b
movq 0x18(%rsp), %rsi
cmpb $0x24, (%rsi)
jne 0x18213b
leaq 0x18(%rsp), %rdi
callq 0x116150
leaq 0x18(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x1fa8(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x948(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x60(%rsp), %r12
leaq 0xd8(%rsp), %r14
leaq 0x40(%rsp), %rbp
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
andq $0x0, 0x68(%rsp)
xorl %edx, %edx
movb %dl, 0x70(%rsp)
leaq 0x90(%rsp), %rcx
movq %rcx, 0x80(%rsp)
andq $0x0, 0x88(%rsp)
movb %dl, 0x90(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
andq $0x0, 0x40(%rax)
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
movq %r12, %rdx
callq 0x18279e
cmpl $0x1, %eax
jne 0x1823cd
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
andq $0x0, 0x48(%rsp)
movb $0x0, 0x50(%rsp)
xorl %r13d, %r13d
xorl %r15d, %r15d
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %r15
jae 0x18223d
decq %rax
leaq 0xd5ef9(%rip), %rdx     # 0x258103
cmpq %rax, %r15
jb 0x182216
leaq 0xd818a(%rip), %rdx     # 0x25a3a0
addq %r13, %rsi
movq %r14, %rdi
callq 0x1827f5
movq %rbp, %rdi
movq %r14, %rsi
callq 0x116530
movq %r14, %rdi
callq 0x116778
incq %r15
addq $0x20, %r13
jmp 0x1821e4
movq %r14, %rdi
movq %r12, %rsi
callq 0x18282e
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %r13
jae 0x182283
addq %r15, %rsi
leaq 0x118(%rsp), %rdi
callq 0x18407c
incq %r13
addq $0x20, %r15
jmp 0x18224e
leaq 0xf8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x1166d0
movq %r12, %rsi
movq 0x8(%rsp), %rdi
callq 0x18287a
testq %rax, %rax
je 0x182303
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x1828c4
xorl %r13d, %r13d
xorl %r15d, %r15d
movq 0x1fa8(%rbx), %rsi
movq 0x1fb0(%rbx), %rax
subq %rsi, %rax
cqto
pushq $0x58
popq %rcx
idivq %rcx
cmpq %rax, %r15
jae 0x182303
addq %r13, %rsi
movq %r12, %rdi
callq 0x17c385
testb %al, %al
jne 0x1822f3
incq %r15
addq $0x58, %r13
jmp 0x1822bd
movq 0x10(%rsp), %rdi
addq (%rdi), %r13
movq %r13, %rsi
callq 0x1828e4
movq 0x38(%rsp), %rdi
movq %r14, %rsi
pushq $0x1
popq %rdx
callq 0x1828ea
movl %eax, %r13d
testb %al, %al
je 0x182381
movq 0x1fb0(%rbx), %rax
subq 0x1fa8(%rbx), %rax
cqto
pushq $0x58
popq %rcx
idivq %rcx
leaq 0xd37fa(%rip), %rdi     # 0x255b31
movl %eax, %esi
xorl %eax, %eax
callq 0x116080
movq 0x60(%rsp), %rsi
leaq 0xd37f5(%rip), %rdi     # 0x255b41
xorl %eax, %eax
callq 0x116080
movq 0x40(%rsp), %rsi
leaq 0xd37f2(%rip), %rdi     # 0x255b51
xorl %eax, %eax
callq 0x116080
leaq 0xd812b(%rip), %rdi     # 0x25a498
callq 0x116660
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x1828fa
jmp 0x1823a1
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x1828c4
movq 0x60(%rsp), %rsi
leaq 0xd3773(%rip), %rdi     # 0x255b0d
xorl %eax, %eax
callq 0x116080
movq %r14, %rdi
callq 0x182926
movq %rbp, %rdi
callq 0x116778
movq %r12, %rdi
callq 0x181d26
cmpq $0x0, 0x20(%rsp)
setne %al
testb %al, %r13b
jne 0x18216e
jmp 0x18242b
cmpl $0x8, %eax
jne 0x182415
leaq 0x60(%rsp), %rdi
callq 0x181d26
cmpq $0x0, 0x20(%rsp)
je 0x18242b
leaq 0xb8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x116360
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0x119a46
leaq 0xb8(%rsp), %rdi
callq 0x116778
jmp 0x18242b
leaq 0xd8044(%rip), %rdi     # 0x25a460
callq 0x116660
leaq 0x60(%rsp), %rdi
callq 0x181d26
leaq 0x18(%rsp), %rdi
callq 0x116778
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x18246a
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x182463
jmp 0x18246a
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x116778
jmp 0x1824b5
movq %rax, %rbx
jmp 0x1824b5
jmp 0x18247a
jmp 0x18249e
movq %rax, %rbx
jmp 0x1824ab
jmp 0x18247a
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x182926
jmp 0x1824a1
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x116778
jmp 0x1824a1
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x116778
leaq 0x60(%rsp), %rdi
callq 0x181d26
leaq 0x18(%rsp), %rdi
callq 0x116778
movq %rbx, %rdi
callq 0x116400
nop