// File: AgathokakologicalBit[P]wit/src/parsing/parsing.cpp
// Function: akbit::system::parsing::(anonymous namespace)::parse_statement_condition(akbit::system::parsing::ParserState&)
std::shared_ptr<Node> parse_statement_condition(ParserState &state)
    {
      state.consume(TokenSubType::t_identifier, "if");
      if (state.is_failed()) return nullptr;
      auto container = std::make_shared<Node>(Node::condition_t{});
      auto &cc = std::get<Node::condition_t>(container->value);
      cc.expression = parse_statement(state);
      if (state.is_failed()) return container;
      state.consume(TokenSubType::t_identifier, "then");
      if (state.is_failed()) return container;
      cc.clause_true = parse_statement(state);
      if (state.is_failed()) return container;

      state.save();
      state.consume(TokenSubType::t_identifier, "else");
      if (state.is_failed())
      {
        state.restore();
        return container;
      }
      state.drop();
      cc.clause_false = parse_statement(state);
      return container;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdi, -0x1d0(%rbp)
movq %rdi, %rax
movq %rax, -0x1c8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x4570
movq -0x1b8(%rbp), %rdx
leaq 0x22c40(%rip), %rsi     # 0x368ed
leaq -0x68(%rbp), %rdi
callq 0x9e70
jmp 0x13cb8
movq -0x1c0(%rbp), %rsi
leaq -0x48(%rbp), %rdi
movl $0x3, %edx
leaq -0x68(%rbp), %rcx
callq 0x12b50
jmp 0x13cd3
leaq -0x48(%rbp), %rdi
callq 0xec00
leaq -0x68(%rbp), %rdi
callq 0x4210
leaq -0x69(%rbp), %rdi
callq 0x4370
movq -0x10(%rbp), %rdi
callq 0x15c20
testb $0x1, %al
jne 0x13cfd
jmp 0x13d43
movq -0x1d0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x15c40
jmp 0x140cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x13d35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4210
leaq -0x69(%rbp), %rdi
callq 0x4370
jmp 0x140db
movb $0x0, -0x7d(%rbp)
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x18560
leaq -0xa0(%rbp), %rdi
callq 0x18560
leaq -0x90(%rbp), %rdi
callq 0x18560
movq -0x1d0(%rbp), %rdi
movq -0x1d8(%rbp), %rsi
callq 0x1f920
jmp 0x13d87
leaq -0xb0(%rbp), %rdi
callq 0xb0c0
movq -0x1d0(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
callq 0x1f990
movq %rax, -0x1e0(%rbp)
jmp 0x13db4
movq -0x1e0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x13390
jmp 0x13dd4
movq -0xb8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x186a0
leaq -0xc8(%rbp), %rdi
callq 0x9b50
movq -0x10(%rbp), %rdi
callq 0x15c20
testb $0x1, %al
jne 0x13e02
jmp 0x13e43
movb $0x1, -0x7d(%rbp)
movl $0x1, -0xcc(%rbp)
jmp 0x140a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xb0c0
jmp 0x140db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x140bd
movq -0x10(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x129(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x4570
movq -0x1e8(%rbp), %rdx
leaq 0x22a81(%rip), %rsi     # 0x368f0
leaq -0x128(%rbp), %rdi
callq 0x9e70
jmp 0x13e7d
movq -0x1f0(%rbp), %rsi
leaq -0x108(%rbp), %rdi
movl $0x3, %edx
leaq -0x128(%rbp), %rcx
callq 0x12b50
jmp 0x13e9e
leaq -0x108(%rbp), %rdi
callq 0xec00
leaq -0x128(%rbp), %rdi
callq 0x4210
leaq -0x129(%rbp), %rdi
callq 0x4370
movq -0x10(%rbp), %rdi
callq 0x15c20
testb $0x1, %al
jne 0x13ed1
jmp 0x13f1b
movb $0x1, -0x7d(%rbp)
movl $0x1, -0xcc(%rbp)
jmp 0x140a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x13f0a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x4210
leaq -0x129(%rbp), %rdi
callq 0x4370
jmp 0x140bd
movq -0x10(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x13390
jmp 0x13f2d
movq -0xb8(%rbp), %rdi
addq $0x10, %rdi
leaq -0x140(%rbp), %rsi
callq 0x186a0
leaq -0x140(%rbp), %rdi
callq 0x9b50
movq -0x10(%rbp), %rdi
callq 0x15c20
testb $0x1, %al
jne 0x13f5f
jmp 0x13f72
movb $0x1, -0x7d(%rbp)
movl $0x1, -0xcc(%rbp)
jmp 0x140a9
movq -0x10(%rbp), %rdi
callq 0x1c950
jmp 0x13f7d
movq -0x10(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0x199(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x4570
movq -0x1f8(%rbp), %rdx
leaq 0x2294c(%rip), %rsi     # 0x368f5
leaq -0x198(%rbp), %rdi
callq 0x9e70
jmp 0x13fb7
movq -0x200(%rbp), %rsi
leaq -0x178(%rbp), %rdi
movl $0x3, %edx
leaq -0x198(%rbp), %rcx
callq 0x12b50
jmp 0x13fd8
leaq -0x178(%rbp), %rdi
callq 0xec00
leaq -0x198(%rbp), %rdi
callq 0x4210
leaq -0x199(%rbp), %rdi
callq 0x4370
movq -0x10(%rbp), %rdi
callq 0x15c20
testb $0x1, %al
jne 0x1400b
jmp 0x1405d
movq -0x10(%rbp), %rdi
callq 0x1c980
jmp 0x14016
movb $0x1, -0x7d(%rbp)
movl $0x1, -0xcc(%rbp)
jmp 0x140a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x1404f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x4210
leaq -0x199(%rbp), %rdi
callq 0x4370
jmp 0x140bd
movq -0x10(%rbp), %rdi
callq 0x1ca00
movq -0x10(%rbp), %rsi
leaq -0x1b0(%rbp), %rdi
callq 0x13390
jmp 0x14078
movq -0xb8(%rbp), %rdi
addq $0x20, %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x186a0
leaq -0x1b0(%rbp), %rdi
callq 0x9b50
movb $0x1, -0x7d(%rbp)
movl $0x1, -0xcc(%rbp)
testb $0x1, -0x7d(%rbp)
jne 0x140bb
movq -0x1d0(%rbp), %rdi
callq 0x9b50
jmp 0x140cb
movq -0x1d0(%rbp), %rdi
callq 0x9b50
jmp 0x140db
movq -0x1c8(%rbp), %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x4560
nopw %cs:(%rax,%rax)