// File: AgathokakologicalBit[P]wit/src/parsing/parsing.cpp
// Function: akbit::system::parsing::(anonymous namespace)::parse_value(akbit::system::parsing::ParserState&)
std::shared_ptr<Node> parse_value(ParserState &state)
    {
      Token tok;
      auto container = std::make_shared<Node>();

      {
        state.save();
        tok = state.consume(TokenSubType::t_integer);
        if (not state.is_failed())
        {
          state.drop();
          container->value = Node::value_integer_t({ .value = tok.value });
          return container;
        }
        state.restore();
      }

      {
        state.save();
        tok = state.consume(TokenSubType::t_decimal);
        if (not state.is_failed())
        {
          state.drop();
          container->value = Node::value_decimal_t({ .value = tok.value });
          return container;
        }
        state.restore();
      }

      {
        state.save();
        tok = state.consume(TokenSubType::t_identifier);
        if (not state.is_failed())
        {
          state.drop();
          container->value = Node::value_variable_t({ .name = tok.value });
          return container;
        }
        state.restore();
      }

      {
        state.save();
        tok = state.consume(TokenSubType::t_string);
        if (not state.is_failed())
        {
          state.drop();
          container->value = Node::value_string_t({ .value = tok.value });
          return container;
        }
        state.drop();
      }
      
      return container;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x1e0(%rbp)
movq %rdi, %rax
movq %rax, -0x1e8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x1e140
movq -0x1e0(%rbp), %rdi
movb $0x0, -0x49(%rbp)
callq 0x186d0
jmp 0x1554f
movq -0x10(%rbp), %rdi
callq 0x1c950
jmp 0x1555a
movq -0x10(%rbp), %rsi
leaq -0x98(%rbp), %rdi
movl $0x4, %edx
callq 0x12880
jmp 0x15571
leaq -0x48(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x1e160
leaq -0x98(%rbp), %rdi
callq 0xec00
movq -0x10(%rbp), %rdi
callq 0x15c20
testb $0x1, %al
jne 0x15625
movq -0x10(%rbp), %rdi
callq 0x1ca00
leaq -0x38(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x4160
jmp 0x155b9
movq -0x1e0(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x1e1b0
leaq -0xb8(%rbp), %rdi
callq 0xbbf0
movb $0x1, -0x49(%rbp)
movl $0x1, -0xbc(%rbp)
jmp 0x15874
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1589f
movq -0x1e0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x9b50
jmp 0x1589f
movq -0x10(%rbp), %rdi
callq 0x1c980
jmp 0x15630
movq -0x10(%rbp), %rdi
callq 0x1c950
jmp 0x1563b
movq -0x10(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
movl $0x5, %edx
callq 0x12880
jmp 0x15652
leaq -0x48(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x1e160
leaq -0xf8(%rbp), %rdi
callq 0xec00
movq -0x10(%rbp), %rdi
callq 0x15c20
testb $0x1, %al
jne 0x156d4
movq -0x10(%rbp), %rdi
callq 0x1ca00
leaq -0x38(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x4160
jmp 0x15696
movq -0x1e0(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
leaq -0x118(%rbp), %rsi
callq 0x1e230
leaq -0x118(%rbp), %rdi
callq 0xbe10
movb $0x1, -0x49(%rbp)
movl $0x1, -0xbc(%rbp)
jmp 0x15874
movq -0x10(%rbp), %rdi
callq 0x1c980
jmp 0x156df
movq -0x10(%rbp), %rdi
callq 0x1c950
jmp 0x156ea
movq -0x10(%rbp), %rsi
leaq -0x150(%rbp), %rdi
movl $0x3, %edx
callq 0x12880
jmp 0x15701
leaq -0x48(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x1e160
leaq -0x150(%rbp), %rdi
callq 0xec00
movq -0x10(%rbp), %rdi
callq 0x15c20
testb $0x1, %al
jne 0x157b1
movq -0x10(%rbp), %rdi
callq 0x1ca00
leaq -0x38(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0x4160
jmp 0x15749
leaq -0x180(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0x1f0(%rbp)
xorl %esi, %esi
movl $0x10, %edx
callq 0x41e0
movq -0x1f0(%rbp), %rdi
callq 0x185f0
movq -0x1e0(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
leaq -0x180(%rbp), %rsi
callq 0x1e2b0
leaq -0x180(%rbp), %rdi
callq 0xc060
movb $0x1, -0x49(%rbp)
movl $0x1, -0xbc(%rbp)
jmp 0x15874
movq -0x10(%rbp), %rdi
callq 0x1c980
jmp 0x157bc
movq -0x10(%rbp), %rdi
callq 0x1c950
jmp 0x157c7
movq -0x10(%rbp), %rsi
leaq -0x1b8(%rbp), %rdi
movl $0x6, %edx
callq 0x12880
jmp 0x157de
leaq -0x48(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x1e160
leaq -0x1b8(%rbp), %rdi
callq 0xec00
movq -0x10(%rbp), %rdi
callq 0x15c20
testb $0x1, %al
jne 0x1585d
movq -0x10(%rbp), %rdi
callq 0x1ca00
leaq -0x38(%rbp), %rsi
leaq -0x1d8(%rbp), %rdi
callq 0x4160
jmp 0x15822
movq -0x1e0(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1e330
leaq -0x1d8(%rbp), %rdi
callq 0xb8a0
movb $0x1, -0x49(%rbp)
movl $0x1, -0xbc(%rbp)
jmp 0x15874
movq -0x10(%rbp), %rdi
callq 0x1ca00
movb $0x1, -0x49(%rbp)
movl $0x1, -0xbc(%rbp)
testb $0x1, -0x49(%rbp)
jne 0x15886
movq -0x1e0(%rbp), %rdi
callq 0x9b50
leaq -0x48(%rbp), %rdi
callq 0xec00
movq -0x1e8(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0xec00
movq -0x58(%rbp), %rdi
callq 0x4560
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)