// File: ArashPartow[P]exprtk/./exprtk.hpp
// Function: exprtk::parser<double>::expression_generator<double>::for_loop(exprtk::details::expression_node<double>*&, exprtk::details::expression_node<double>*&, exprtk::details::expression_node<double>*&, exprtk::details::expression_node<double>*&, bool) const
inline expression_node_ptr for_loop(expression_node_ptr& initialiser,
                                             expression_node_ptr& condition,
                                             expression_node_ptr& incrementor,
                                             expression_node_ptr& loop_body,
                                             bool break_continue_present = false) const
         {
            if (
                 !break_continue_present              &&
                 !parser_->state_.return_stmt_present &&
                 details::is_constant_node(condition)
               )
            {
               expression_node_ptr result = error_node();

               if (details::is_true(condition))
               {
                  // Infinite loops are not allowed.

                  parser_->set_error(parser_error::make_error(
                     parser_error::e_parser,
                     parser_->current_state().token,
                     "ERR261 - Infinite loop condition without 'break' or 'return' not allowed in for-loop",
                     exprtk_error_location));

                  result = error_node();
               }
               else
                  result = node_allocator_->allocate<details::null_node<Type> >();

               details::free_node(*node_allocator_, initialiser);
               details::free_node(*node_allocator_, condition  );
               details::free_node(*node_allocator_, incrementor);
               details::free_node(*node_allocator_, loop_body  );

               return result;
            }
            else if (details::is_null_node(condition) || (0 == condition))
            {
               details::free_node(*node_allocator_, initialiser);
               details::free_node(*node_allocator_, condition  );
               details::free_node(*node_allocator_, incrementor);

               return loop_body;
            }

            loop_runtime_check_ptr rtc = get_loop_runtime_check(loop_runtime_check::e_for_loop);

            if (!break_continue_present)
            {
               if (rtc)
                  return node_allocator_->allocate<for_loop_rtc_node_t>
                                          (
                                             initialiser,
                                             condition,
                                             incrementor,
                                             loop_body,
                                             rtc
                                          );
               else
                  return node_allocator_->allocate<for_loop_node_t>
                                          (
                                             initialiser,
                                             condition,
                                             incrementor,
                                             loop_body
                                          );
            }
            #ifndef exprtk_disable_break_continue
            else
            {
               if (rtc)
                  return node_allocator_->allocate<for_loop_bc_rtc_node_t>
                                          (
                                             initialiser,
                                             condition,
                                             incrementor,
                                             loop_body,
                                             rtc
                                          );
               else
                  return node_allocator_->allocate<for_loop_bc_node_t>
                                          (
                                             initialiser,
                                             condition,
                                             incrementor,
                                             loop_body
                                          );
            }
            #else
            return error_node();
            #endif
         }

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movb %r9b, %al
movq %rdi, 0x1b8(%rsp)
movq %rsi, 0x1b0(%rsp)
movq %rdx, 0x1a8(%rsp)
movq %rcx, 0x1a0(%rsp)
movq %r8, 0x198(%rsp)
andb $0x1, %al
movb %al, 0x197(%rsp)
movq 0x1b8(%rsp), %rax
movq %rax, 0x18(%rsp)
testb $0x1, 0x197(%rsp)
jne 0x4e8970
movq 0x18(%rsp), %rax
movq 0x68(%rax), %rax
testb $0x1, 0x3ab(%rax)
jne 0x4e8970
movq 0x1a8(%rsp), %rax
movq (%rax), %rdi
callq 0x39cbf0
testb $0x1, %al
jne 0x4e8725
jmp 0x4e8970
callq 0x2821f0
movq %rax, 0x188(%rsp)
movq 0x1a8(%rsp), %rax
movq (%rax), %rdi
callq 0x39d260
testb $0x1, %al
jne 0x4e874b
jmp 0x4e88ed
movq 0x18(%rsp), %rax
movq 0x68(%rax), %rsi
movq %rsi, (%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x3dc450
leaq 0xb0(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x7f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x11b6f0
movq 0x10(%rsp), %rdx
leaq 0xc04bc(%rip), %rsi     # 0x5a8c49
leaq 0x80(%rsp), %rdi
callq 0x134520
jmp 0x4e879c
leaq 0x28(%rsp), %rdi
movl $0x808b, %esi           # imm = 0x808B
callq 0x371f20
jmp 0x4e87ad
leaq 0xbe75f(%rip), %rsi     # 0x5a6f13
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x29dd70
jmp 0x4e87c5
movq 0x8(%rsp), %rdx
leaq 0xe0(%rsp), %rdi
movl $0x9, %esi
leaq 0x80(%rsp), %rcx
leaq 0x48(%rsp), %r8
callq 0x3741e0
jmp 0x4e87eb
movq (%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x371e40
jmp 0x4e87fe
leaq 0xe0(%rsp), %rdi
callq 0x371330
leaq 0x48(%rsp), %rdi
callq 0x11b838
leaq 0x28(%rsp), %rdi
callq 0x11b838
leaq 0x80(%rsp), %rdi
callq 0x11b838
leaq 0x7f(%rsp), %rdi
callq 0x11b820
leaq 0xa0(%rsp), %rdi
callq 0x3706b0
callq 0x2821f0
movq %rax, 0x188(%rsp)
jmp 0x4e8903
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x4e88d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x4e88c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x4e88ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x4e88b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x371330
leaq 0x48(%rsp), %rdi
callq 0x11b838
leaq 0x28(%rsp), %rdi
callq 0x11b838
leaq 0x80(%rsp), %rdi
callq 0x11b838
leaq 0x7f(%rsp), %rdi
callq 0x11b820
leaq 0xa0(%rsp), %rdi
callq 0x3706b0
jmp 0x4e8b1c
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x39c7b0
movq %rax, 0x188(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1b0(%rsp), %rsi
callq 0x284bd0
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1a8(%rsp), %rsi
callq 0x284bd0
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1a0(%rsp), %rsi
callq 0x284bd0
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x198(%rsp), %rsi
callq 0x284bd0
movq 0x188(%rsp), %rax
movq %rax, 0x1c0(%rsp)
jmp 0x4e8b0c
movq 0x1a8(%rsp), %rax
movq (%rax), %rdi
callq 0x3af620
testb $0x1, %al
jne 0x4e8993
movq 0x1a8(%rsp), %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
jne 0x4e89ed
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1b0(%rsp), %rsi
callq 0x284bd0
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1a8(%rsp), %rsi
callq 0x284bd0
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1a0(%rsp), %rsi
callq 0x284bd0
movq 0x198(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x1c0(%rsp)
jmp 0x4e8b0c
jmp 0x4e89ef
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x4e6830
movq %rax, 0x20(%rsp)
testb $0x1, 0x197(%rsp)
jne 0x4e8a91
cmpq $0x0, 0x20(%rsp)
je 0x4e8a59
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1b0(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
movq 0x1a0(%rsp), %rcx
movq 0x198(%rsp), %r8
leaq 0x20(%rsp), %r9
callq 0x4eaeb0
movq %rax, 0x1c0(%rsp)
jmp 0x4e8b0c
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1b0(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
movq 0x1a0(%rsp), %rcx
movq 0x198(%rsp), %r8
callq 0x4eaf70
movq %rax, 0x1c0(%rsp)
jmp 0x4e8b0c
cmpq $0x0, 0x20(%rsp)
je 0x4e8ad6
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1b0(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
movq 0x1a0(%rsp), %rcx
movq 0x198(%rsp), %r8
leaq 0x20(%rsp), %r9
callq 0x4eb020
movq %rax, 0x1c0(%rsp)
jmp 0x4e8b0c
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1b0(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
movq 0x1a0(%rsp), %rcx
movq 0x198(%rsp), %r8
callq 0x4eb0e0
movq %rax, 0x1c0(%rsp)
movq 0x1c0(%rsp), %rax
addq $0x1c8, %rsp            # imm = 0x1C8
retq
movq 0x70(%rsp), %rdi
callq 0x11b4e0
nopw %cs:(%rax,%rax)