// File: AgathokakologicalBit[P]wit/src/annotation/tree_preprocessing.cpp
// Function: akbit::system::annotation::(anonymous namespace)::convert_to_declarations(std::vector<std::shared_ptr<akbit::system::Node>, std::allocator<std::shared_ptr<akbit::system::Node>>>&)
std::vector<std::shared_ptr<Node>> convert_to_declarations(std::vector<std::shared_ptr<Node>>& nodes)
    {
      // TODO: Handle errors
      std::vector<std::shared_ptr<Node>> res;

      for (auto&& n : nodes)
      {
        if (n->value.index() == 5)
        {
          res.push_back(std::make_shared<Node>(Node(Node::declaration_t{
            .variable = std::get<Node::binary_operation_t>(n->value).operands[0],
            .type = std::get<Node::binary_operation_t>(n->value).operands[1],
            .value = nullptr
          })));
        }
        else
        {
          res.push_back(std::make_shared<Node>(Node(Node::declaration_t{
            .variable = n,
            .type = nullptr,
            .value = nullptr
          })));
        }
      }

      return res;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x188(%rbp)
movq %rdi, %rax
movq %rax, -0x180(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x15f60
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x18160
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x17fa0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x22a70
testb $0x1, %al
jne 0x21e05
jmp 0x220ef
leaq -0x28(%rbp), %rdi
callq 0x184a0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
callq 0x9e50
cmpq $0x5, %rax
jne 0x21fd9
leaq -0xd0(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x38(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
callq 0x18780
movq %rax, -0x190(%rbp)
jmp 0x21e5d
movq -0x190(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xcaa0
movq -0x198(%rbp), %rdi
movq %rax, %rsi
callq 0x9b20
leaq -0xc0(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x38(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
callq 0x18780
movq %rax, -0x1a0(%rbp)
jmp 0x21eac
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0xcaa0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
callq 0x9b20
leaq -0xb0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x15c40
leaq -0xa0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x18ae0
jmp 0x21ef5
leaq -0x48(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x18580
jmp 0x21f07
movq -0x188(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x15fe0
jmp 0x21f19
leaq -0x48(%rbp), %rdi
callq 0x9b50
leaq -0xa0(%rbp), %rdi
callq 0x17b50
leaq -0xd0(%rbp), %rdi
callq 0xaf50
jmp 0x220df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x22115
movq -0x198(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
callq 0x9b50
jmp 0x22115
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x21fc8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x21fbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x9b50
leaq -0xa0(%rbp), %rdi
callq 0x17b50
leaq -0xd0(%rbp), %rdi
callq 0xaf50
jmp 0x22115
movq -0x38(%rbp), %rsi
leaq -0x178(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x9b20
leaq -0x168(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x1b8(%rbp)
callq 0x15c40
movq -0x1b8(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x15c40
movq -0x1b0(%rbp), %rsi
leaq -0x148(%rbp), %rdi
callq 0x18ae0
jmp 0x2202f
leaq -0xf0(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x18580
jmp 0x22044
movq -0x188(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x15fe0
jmp 0x22059
leaq -0xf0(%rbp), %rdi
callq 0x9b50
leaq -0x148(%rbp), %rdi
callq 0x17b50
leaq -0x178(%rbp), %rdi
callq 0xaf50
jmp 0x220df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x220d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x220c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x9b50
leaq -0x148(%rbp), %rdi
callq 0x17b50
leaq -0x178(%rbp), %rdi
callq 0xaf50
jmp 0x22115
jmp 0x220e1
leaq -0x28(%rbp), %rdi
callq 0x22ab0
jmp 0x21def
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x22105
movq -0x188(%rbp), %rdi
callq 0xac10
movq -0x180(%rbp), %rax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq -0x188(%rbp), %rdi
callq 0xac10
movq -0xd8(%rbp), %rdi
callq 0x4560
nopl (%rax)