// File: /workspace/github_cpp_makefile_star2_O2/AgathokakologicalBit[P]wit/src/parsing/parsing.cpp
// Function: akbit::system::parsing::(anonymous namespace)::parse_expression(std::shared_ptr<akbit::system::Node>, akbit::system::parsing::ParserState&, unsigned int)
std::shared_ptr<Node> parse_expression(std::shared_ptr<Node> left_operand, ParserState &state, uint32_t base_priority)
    {
      state.save();
      operator_t const * operation = &parse_operator(state);
      if (operation == &operator_unknown || operation->precedence < base_priority)
      {
        state.restore();
        return left_operand;
      }
      state.drop();

      std::shared_ptr<Node> right_operand = parse_statement_or_composite_unit(state);
      if (state.is_failed())
        return left_operand;

      // Get next operator
      state.save();
      operator_t const * next_operation = &parse_operator(state);
      if (state.is_failed()) { state.restore(); }
      else state.drop();

      while (next_operation->precedence > base_priority)
      {
          if (next_operation->precedence > operation->precedence)
          {
            // If the following operator has the higher priority
            // parse that subexpression first
            state.index -= next_operation->representation.size();
            right_operand = parse_statement(right_operand, state, operation->precedence);
            if (state.is_failed())
              return left_operand;

            state.save();
            next_operation = &parse_operator(state);
            if (state.is_failed()) { state.restore(); break; }
            else state.drop();

            if (next_operation->precedence <= base_priority)
              break;
          }

          if (left_operand->value.index() == 5 && std::get<Node::binary_operation_t>(left_operand->value).operation == operation)
          {
            std::get<Node::binary_operation_t>(left_operand->value).operands.push_back(right_operand);
          }
          else
          {
            left_operand = make_node_bop(left_operand, right_operand, operation);
          }

          operation = next_operation;

          right_operand = parse_statement_or_composite_unit(state);
          if (state.is_failed())
            return left_operand;

          state.save();
          next_operation = &parse_operator(state);
          if (state.is_failed()) { state.restore(); break; }
          else state.drop();
      }

      if (next_operation->precedence <= base_priority)
        state.index -= next_operation->representation.size();

      if (left_operand->value.index() == 5 && std::get<Node::binary_operation_t>(left_operand->value).operation == operation)
      {
        std::get<Node::binary_operation_t>(left_operand->value).operands.push_back(right_operand);
      }
      else
      {
        left_operand = make_node_bop(left_operand, right_operand, operation);
      }

      return left_operand;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
movq %rdx, %rdi
callq 0xa7fc
movq %r15, %rdi
callq 0x93a7
movq %rax, %rbp
leaq 0x11a1f(%rip), %rax     # 0x1a900
cmpq (%rax), %rbp
je 0x8f30
cmpl %ebx, 0x4(%rbp)
jb 0x8f30
movl %ebx, 0xc(%rsp)
addq $-0x8, 0x40(%r15)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x9542
cmpl $0x0, 0x10(%r15)
jne 0x92e4
movq %r15, %rdi
callq 0xa7fc
movq %r15, %rdi
callq 0x93a7
movq %rax, %r12
cmpl $0x0, 0x10(%r15)
je 0x8f52
movq %r15, %rdi
callq 0xa80c
jmp 0x8f57
movq %r15, %rdi
callq 0xa80c
movups (%r14), %xmm0
andq $0x0, 0x8(%r14)
movq 0x20(%rsp), %rbx
movups %xmm0, (%rbx)
andq $0x0, (%r14)
jmp 0x9303
addq $-0x8, 0x40(%r15)
leaq 0x38(%rsp), %r13
movl 0x4(%r12), %eax
cmpl 0xc(%rsp), %eax
jbe 0x922f
cmpl 0x4(%rbp), %eax
jbe 0x9005
movq 0x18(%r12), %rax
subq %rax, 0x8(%r15)
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x6d30
movl 0x4(%rbp), %ebx
movq %r13, %rdi
movq %r15, %rsi
callq 0x7236
cmpl $0x3, 0x6c(%rsp)
jne 0x900d
leaq 0xd0(%rsp), %rdi
movq %r15, %rsi
callq 0x7236
movl %ebx, %r12d
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
leaq 0x8838(%rip), %rsi      # 0x11801
callq 0xa200
movl %eax, %r13d
movq %rbx, %rdi
movl %r12d, %ebx
callq 0x4120
leaq 0x48(%rsp), %rdi
callq 0x4120
testb %r13b, %r13b
leaq 0x38(%rsp), %r13
je 0x9017
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x8931
jmp 0x90c2
movq %r12, %rbx
jmp 0x9121
leaq 0x48(%rsp), %rdi
callq 0x4120
movq %r13, %rdi
movq %r15, %rsi
callq 0x7236
cmpl $0x3, 0x6c(%rsp)
jne 0x907c
leaq 0xd0(%rsp), %rdi
movq %r15, %rsi
callq 0x7236
leaq 0xe0(%rsp), %r12
movq %r12, %rdi
leaq 0x87ba(%rip), %rsi      # 0x11805
callq 0xa200
movl %eax, %r13d
movq %r12, %rdi
callq 0x4120
leaq 0x48(%rsp), %rdi
callq 0x4120
testb %r13b, %r13b
je 0x9086
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x8c7d
jmp 0x90c2
leaq 0x48(%rsp), %rdi
callq 0x4120
leaq 0xc0(%rsp), %r12
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x6d30
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x8ea9
leaq 0xc8(%rsp), %rdi
callq 0x69e2
leaq 0x28(%rsp), %r12
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0xa740
leaq 0x30(%rsp), %rdi
callq 0x69e2
leaq 0x88(%rsp), %rdi
callq 0x69e2
cmpl $0x0, 0x10(%r15)
jne 0x92e4
movq %r15, %rdi
callq 0xa7fc
movq %r15, %rdi
callq 0x93a7
movq %rax, %rbx
cmpl $0x0, 0x10(%r15)
jne 0x9244
addq $-0x8, 0x40(%r15)
movl 0xc(%rsp), %eax
cmpl %eax, 0x4(%rbx)
jbe 0x924c
movq (%r14), %rdi
cmpb $0x5, 0x48(%rdi)
jne 0x913c
addq $0x10, %rdi
callq 0xb277
cmpq %rbp, (%rax)
je 0x9210
movq %r15, %r13
movq %rbx, %r15
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0x6d30
movq %rbp, %rbx
movq %r14, %rbp
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x6d30
leaq 0x38(%rsp), %r12
movq %r12, %rdi
leaq 0x70(%rsp), %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xa864
movq %rbp, %rdi
movq %r12, %rsi
callq 0xa740
leaq 0x40(%rsp), %rdi
callq 0x69e2
leaq 0xb8(%rsp), %rdi
callq 0x69e2
leaq 0x78(%rsp), %rdi
callq 0x69e2
movq %rbp, %r14
movq %r15, %rbx
movq %r13, %r15
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x9542
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0xa740
leaq 0x40(%rsp), %rdi
callq 0x69e2
cmpl $0x0, 0x10(%r15)
jne 0x92e4
movq %r15, %rdi
callq 0xa7fc
movq %r15, %rdi
callq 0x93a7
movq %rax, %r12
cmpl $0x0, 0x10(%r15)
jne 0x9234
addq $-0x8, 0x40(%r15)
movq %rbx, %rbp
jmp 0x8f57
movq (%r14), %rdi
addq $0x10, %rdi
callq 0xb277
addq $0x8, %rax
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0xa838
jmp 0x91b7
movq %r12, %rbx
jmp 0x924c
movq %r15, %rdi
callq 0xa80c
movq %rbx, %rbp
movq %r12, %rbx
jmp 0x924c
movq %r15, %rdi
callq 0xa80c
movl 0xc(%rsp), %eax
cmpl %eax, 0x4(%rbx)
ja 0x925d
movq 0x18(%rbx), %rax
subq %rax, 0x8(%r15)
movq (%r14), %rdi
cmpb $0x5, 0x48(%rdi)
jne 0x9278
addq $0x10, %rdi
callq 0xb277
cmpq %rbp, (%rax)
je 0x9318
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6d30
leaq 0x90(%rsp), %r15
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x6d30
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq 0xa864
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0xa740
leaq 0x40(%rsp), %rdi
callq 0x69e2
leaq 0x98(%rsp), %rdi
callq 0x69e2
leaq 0xa8(%rsp), %rdi
callq 0x69e2
movups (%r14), %xmm0
andq $0x0, 0x8(%r14)
movq 0x20(%rsp), %rbx
movups %xmm0, (%rbx)
andq $0x0, (%r14)
leaq 0x18(%rsp), %rdi
callq 0x69e2
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
addq $0x10, %rdi
callq 0xb277
addq $0x8, %rax
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xa838
jmp 0x92e4
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x69e2
leaq 0xa8(%rsp), %rdi
jmp 0x9389
jmp 0x9392
movq %rax, %rbx
jmp 0x9368
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x69e2
leaq 0x88(%rsp), %rdi
jmp 0x9389
jmp 0x9392
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x69e2
leaq 0x78(%rsp), %rdi
callq 0x69e2
jmp 0x9395
jmp 0x9392
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x69e2
movq %rbx, %rdi
callq 0x43c0