// File: /workspace/github_cpp_makefile_star2_O1/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 $0x158, %rsp            # imm = 0x158
movl %ecx, 0xc(%rsp)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
leaq 0x8(%rdx), %rbx
movq 0x40(%rdx), %rsi
cmpq 0x48(%rdx), %rsi
je 0xa5b3
movq 0x8(%r15), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x40(%r15)
jmp 0xa5bf
leaq 0x38(%r15), %rdi
movq %rbx, %rdx
callq 0xd056
movq %r15, %rdi
callq 0xaebe
movq %rax, %r13
leaq 0x12387(%rip), %rax     # 0x1c958
cmpq (%rax), %r13
je 0xa63c
movl 0xc(%rsp), %eax
cmpl %eax, 0x4(%r13)
jb 0xa63c
movq %r12, 0xe0(%rsp)
addq $-0x8, 0x40(%r15)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xb278
cmpl $0x0, 0x10(%r15)
je 0xa6a1
movq (%r14), %rax
movq 0xe0(%rsp), %r12
movq %rax, (%r12)
xorl %eax, %eax
movq %rax, 0x8(%r12)
movq 0x8(%r14), %rcx
movq %rax, 0x8(%r14)
movq %rcx, 0x8(%r12)
movq %rax, (%r14)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xa68c
callq 0x6da4
jmp 0xa68c
movq 0x20(%r15), %rdx
movq 0x40(%r15), %rax
movq -0x8(%rax), %rax
movq %rax, 0x8(%r15)
movl $0x0, 0x10(%r15)
leaq 0x18(%r15), %rdi
leaq 0xacc2(%rip), %rcx      # 0x15321
xorl %ebx, %ebx
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x32d0
addq $-0x8, 0x40(%r15)
movq (%r14), %rax
movq %rax, (%r12)
movq %rbx, 0x8(%r12)
movq 0x8(%r14), %rax
movq %rbx, 0x8(%r14)
movq %rax, 0x8(%r12)
movq %rbx, (%r14)
movq %r12, %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x40(%r15), %rsi
cmpq 0x48(%r15), %rsi
je 0xa6bc
movq 0x8(%r15), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x40(%r15)
jmp 0xa6c8
leaq 0x38(%r15), %rdi
movq %rbx, %rdx
callq 0xd056
movq %r15, %rdi
callq 0xaebe
movq %rax, %rbp
cmpl $0x0, 0x10(%r15)
je 0xa707
movq 0x20(%r15), %rdx
movq 0x40(%r15), %rax
movq -0x8(%rax), %rax
movq %rax, 0x8(%r15)
movl $0x0, 0x10(%r15)
leaq 0x18(%r15), %rdi
leaq 0xac24(%rip), %rcx      # 0x15321
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x32d0
leaq 0x38(%r15), %rax
movq %rax, 0x88(%rsp)
movq %r14, 0x80(%rsp)
movq %rbx, 0x90(%rsp)
addq $-0x8, 0x40(%r15)
movl 0x4(%rbp), %eax
cmpl 0xc(%rsp), %eax
jbe 0xacf5
cmpl 0x4(%r13), %eax
jbe 0xa76c
movq 0x18(%rbp), %rax
subq %rax, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x18(%rsp), %r12
testq %r12, %r12
je 0xa77a
movq 0x12858(%rip), %rax     # 0x1cfb8
cmpb $0x0, (%rax)
je 0xa774
incl 0x8(%r12)
jmp 0xa77a
movq %rbp, %r12
jmp 0xaaf1
lock
incl 0x8(%r12)
movl 0x4(%r13), %eax
movl %eax, 0x6c(%rsp)
movq (%r15), %rax
movq (%rax), %rbx
imulq $0x38, 0x8(%r15), %rbp
movl 0x8(%rbx,%rbp), %eax
movl %eax, 0x28(%rsp)
movq (%rbx,%rbp), %rax
movq %rax, 0x20(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x10(%rbx,%rbp), %rsi
movq 0x18(%rbx,%rbp), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x6e14
addq %rbp, %rbx
movq 0x30(%rbx), %rax
movq %rax, 0x50(%rsp)
movl 0x54(%rsp), %ebx
cmpl $0x3, %ebx
movq %r12, 0x60(%rsp)
jne 0xa855
movq (%r15), %rax
movq (%rax), %rbp
imulq $0x38, 0x8(%r15), %r12
movl 0x8(%rbp,%r12), %eax
movl %eax, 0x128(%rsp)
movq (%rbp,%r12), %rax
movq %rax, 0x120(%rsp)
leaq 0x140(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x10(%rbp,%r12), %rsi
movq 0x18(%rbp,%r12), %rdx
addq %rsi, %rdx
leaq 0x130(%rsp), %r14
movq %r14, %rdi
callq 0x6e14
addq %r12, %rbp
movq 0x30(%rbp), %rax
movq %rax, 0x150(%rsp)
movq %r14, %rdi
leaq 0xaf9b(%rip), %rsi      # 0x157de
callq 0x30b0
testl %eax, %eax
sete %bpl
movq 0x60(%rsp), %r12
jmp 0xa857
xorl %ebp, %ebp
cmpl $0x3, %ebx
movq 0x90(%rsp), %rbx
jne 0xa889
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0xa889
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x31f0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa8a5
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x31f0
testb %bpl, %bpl
je 0xa8c4
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x9c49
movq 0x80(%rsp), %r14
jmp 0xaa54
movq (%r15), %rax
movq (%rax), %rbx
imulq $0x38, 0x8(%r15), %r12
movl 0x8(%rbx,%r12), %eax
movl %eax, 0x28(%rsp)
movq (%rbx,%r12), %rax
movq %rax, 0x20(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x10(%rbx,%r12), %rsi
movq 0x18(%rbx,%r12), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x6e14
addq %r12, %rbx
movq 0x30(%rbx), %rax
movq %rax, 0x50(%rsp)
movl 0x54(%rsp), %ebx
cmpl $0x3, %ebx
jne 0xa98e
movq (%r15), %rax
movq (%rax), %rbp
imulq $0x38, 0x8(%r15), %r12
movl 0x8(%rbp,%r12), %eax
movl %eax, 0xf0(%rsp)
movq (%rbp,%r12), %rax
movq %rax, 0xe8(%rsp)
leaq 0x108(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x10(%rbp,%r12), %rsi
movq 0x18(%rbp,%r12), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %r14
movq %r14, %rdi
callq 0x6e14
addq %r12, %rbp
movq 0x30(%rbp), %rax
movq %rax, 0x118(%rsp)
movq %r14, %rdi
leaq 0xae61(%rip), %rsi      # 0x157e2
callq 0x30b0
testl %eax, %eax
sete %bpl
jmp 0xa990
xorl %ebp, %ebp
cmpl $0x3, %ebx
movq 0x90(%rsp), %rbx
movq 0x80(%rsp), %r14
movq 0x60(%rsp), %r12
jne 0xa9cf
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0xa9cf
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x31f0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xa9eb
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x31f0
testb %bpl, %bpl
je 0xa9ff
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0xa1c9
jmp 0xaa54
movq 0xd8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r12, 0x28(%rsp)
testq %r12, %r12
je 0xaa2f
movq 0x1259b(%rip), %rax     # 0x1cfb8
cmpb $0x0, (%rax)
je 0xaa29
incl 0x8(%r12)
jmp 0xaa2f
lock
incl 0x8(%r12)
leaq 0x70(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
movl 0x6c(%rsp), %ecx
callq 0xa576
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xaa54
callq 0x6da4
movaps 0x70(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x70(%rsp)
movq 0x18(%rsp), %rdi
movups %xmm0, 0x10(%rsp)
testq %rdi, %rdi
je 0xaa75
callq 0x6da4
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xaa84
callq 0x6da4
testq %r12, %r12
je 0xaa91
movq %r12, %rdi
callq 0x6da4
cmpl $0x0, 0x10(%r15)
jne 0xa605
movq 0x40(%r15), %rsi
cmpq 0x48(%r15), %rsi
je 0xaab7
movq 0x8(%r15), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x40(%r15)
jmp 0xaac7
movq 0x88(%rsp), %rdi
movq %rbx, %rdx
callq 0xd056
movq %r15, %rdi
callq 0xaebe
movq %rax, %r12
cmpl $0x0, 0x10(%r15)
jne 0xacc0
addq $-0x8, 0x40(%r15)
movl 0xc(%rsp), %eax
cmpl %eax, 0x4(%r12)
jbe 0xacf2
movq (%r14), %rdi
cmpb $0x5, 0x48(%rdi)
jne 0xab0c
addq $0x10, %rdi
callq 0xd7b9
cmpq %r13, (%rax)
je 0xabe2
movq (%r14), %rax
movq %rax, 0xc8(%rsp)
movq 0x8(%r14), %rax
movq %rax, 0xd0(%rsp)
testq %rax, %rax
je 0xab3d
movq 0x12489(%rip), %rcx     # 0x1cfb8
cmpb $0x0, (%rcx)
je 0xab39
incl 0x8(%rax)
jmp 0xab3d
lock
incl 0x8(%rax)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0xb8(%rsp)
movq %rax, 0xc0(%rsp)
testq %rax, %rax
je 0xab71
movq 0x12455(%rip), %rcx     # 0x1cfb8
cmpb $0x0, (%rcx)
je 0xab6d
incl 0x8(%rax)
jmp 0xab71
lock
incl 0x8(%rax)
leaq 0x20(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
movq %r13, %rcx
callq 0xcf59
movaps 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x20(%rsp)
movq 0x8(%r14), %rdi
movups %xmm0, (%r14)
testq %rdi, %rdi
je 0xabad
callq 0x6da4
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xabbc
callq 0x6da4
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xabce
callq 0x6da4
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0xabff
callq 0x6da4
jmp 0xabff
movq (%r14), %rdi
addq $0x10, %rdi
callq 0xd7b9
addq $0x8, %rax
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0xcf1a
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0xb278
movaps 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x20(%rsp)
movq 0x18(%rsp), %rdi
movups %xmm0, 0x10(%rsp)
testq %rdi, %rdi
je 0xac2d
callq 0x6da4
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xac3c
callq 0x6da4
cmpl $0x0, 0x10(%r15)
jne 0xa605
movq 0x40(%r15), %rsi
cmpq 0x48(%r15), %rsi
je 0xac62
movq 0x8(%r15), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x40(%r15)
jmp 0xac72
movq 0x88(%rsp), %rdi
movq %rbx, %rdx
callq 0xd056
movq %r15, %rdi
callq 0xaebe
movq %rax, %rbp
cmpl $0x0, 0x10(%r15)
movq %r12, %r13
je 0xa723
movq 0x20(%r15), %rdx
movq 0x40(%r15), %rax
movq -0x8(%rax), %rax
movq %rax, 0x8(%r15)
movl $0x0, 0x10(%r15)
leaq 0x18(%r15), %rdi
leaq 0xa673(%rip), %rcx      # 0x15321
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x32d0
movq %r12, %r13
movq %rbp, %r12
jmp 0xaced
movq 0x20(%r15), %rdx
movq 0x40(%r15), %rax
movq -0x8(%rax), %rax
movq %rax, 0x8(%r15)
movl $0x0, 0x10(%r15)
leaq 0x18(%r15), %rdi
leaq 0xa63e(%rip), %rcx      # 0x15321
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x32d0
addq $-0x8, 0x40(%r15)
movq %r12, %rbp
movl 0xc(%rsp), %eax
cmpl %eax, 0x4(%rbp)
ja 0xad05
movq 0x18(%rbp), %rax
subq %rax, (%rbx)
movq (%r14), %rdi
cmpb $0x5, 0x48(%rdi)
jne 0xad20
addq $0x10, %rdi
callq 0xd7b9
cmpq %r13, (%rax)
je 0xadfd
movq (%r14), %rax
movq %rax, 0xa8(%rsp)
movq 0x8(%r14), %rax
movq %rax, 0xb0(%rsp)
testq %rax, %rax
je 0xad51
movq 0x12275(%rip), %rcx     # 0x1cfb8
cmpb $0x0, (%rcx)
je 0xad4d
incl 0x8(%rax)
jmp 0xad51
lock
incl 0x8(%rax)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
testq %rax, %rax
je 0xad85
movq 0x12241(%rip), %rcx     # 0x1cfb8
cmpb $0x0, (%rcx)
je 0xad81
incl 0x8(%rax)
jmp 0xad85
lock
incl 0x8(%rax)
leaq 0x20(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
movq %r13, %rcx
callq 0xcf59
movaps 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x20(%rsp)
movq 0x8(%r14), %rdi
movups %xmm0, (%r14)
testq %rdi, %rdi
je 0xadc1
callq 0x6da4
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xadd0
callq 0x6da4
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0xade2
callq 0x6da4
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xa605
callq 0x6da4
jmp 0xa605
movq (%r14), %rdi
addq $0x10, %rdi
callq 0xd7b9
addq $0x8, %rax
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xcf1a
jmp 0xa605
jmp 0xaea4
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0xae39
callq 0x6da4
movq 0xb0(%rsp), %rdi
jmp 0xae96
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xae62
callq 0x6da4
jmp 0xae62
jmp 0xae71
jmp 0xae71
jmp 0xae71
jmp 0xaea4
movq %rax, %rbx
cmpq $0x0, 0x60(%rsp)
je 0xaea7
movq 0x60(%rsp), %rdi
jmp 0xae9b
movq %rax, %rdi
callq 0x6c96
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xae8e
callq 0x6da4
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0xaea7
callq 0x6da4
jmp 0xaea7
jmp 0xaea4
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xaeb6
callq 0x6da4
movq %rbx, %rdi
callq 0x3350