// File: AgathokakologicalBit[P]wit/src/annotation/tree_preprocessing.cpp
// Function: akbit::system::annotation::(anonymous namespace)::tp_visit_binary_operation(std::shared_ptr<akbit::system::Node>)
void tp_visit_binary_operation(std::shared_ptr<Node> node_)
    {
      Node::binary_operation_t& node = std::get<Node::binary_operation_t>(node_->value);
      for (auto operand : node.operands)
        tp_visit(operand);

      if (node.operation == find_operator("->"))
      {
        auto function_node = node.operands.at(node.operands.size() - 1);

        // because i is unsigned, going towards 0 should be done using a special operator
        std::size_t i = node.operands.size() - 1;
        while (i --> 0)
        {
          auto tmp_tuple = parsing::convert_to_tuple(node.operands[i]);
          auto nfn = std::make_shared<Node>(Node::value_function_t{
            .parameters = convert_to_declarations(std::get<Node::value_tuple_t>(tmp_tuple->value).entries),
          });
          std::get<Node::value_function_t>(nfn->value).body = function_node;
          function_node = nfn;
        }

        *node_ = *function_node;
      }
      else if (node.operation == find_operator(","))
      {
        Node tuple(Node::value_tuple_t{
          .entries = {},
        });

        for (auto op : node.operands)
          std::get<Node::value_tuple_t>(tuple.value).entries.push_back(op);
        
        *node_ = tuple;
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x1d0(%rbp)
movq %rdi, -0x8(%rbp)
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
callq 0x18780
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x18160
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x17fa0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x22a70
testb $0x1, %al
jne 0x217c7
jmp 0x21848
leaq -0x20(%rbp), %rdi
callq 0x184a0
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x9b20
movq -0x1e0(%rbp), %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x9b20
movq -0x1d8(%rbp), %rdi
callq 0x20b70
jmp 0x21808
leaq -0x48(%rbp), %rdi
callq 0x9b50
leaq -0x38(%rbp), %rdi
callq 0x9b50
leaq -0x20(%rbp), %rdi
callq 0x22ab0
jmp 0x217b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x9b50
leaq -0x38(%rbp), %rdi
callq 0x9b50
jmp 0x21d8e
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x4570
movq -0x1e8(%rbp), %rdx
leaq 0x14afc(%rip), %rsi     # 0x36370
leaq -0x78(%rbp), %rdi
callq 0x9e70
jmp 0x2187f
leaq -0x78(%rbp), %rdi
callq 0xfbf0
movq %rax, -0x1f8(%rbp)
jmp 0x21891
leaq -0x78(%rbp), %rdi
callq 0x4210
leaq -0x79(%rbp), %rdi
callq 0x4370
movq -0x1f8(%rbp), %rcx
movq -0x1f0(%rbp), %rax
cmpq %rcx, %rax
jne 0x21b59
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x200(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0xa3b0
movq -0x200(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x22ad0
movq %rax, %rsi
leaq -0x90(%rbp), %rdi
callq 0x9b20
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0xa3b0
subq $0x1, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x98(%rbp)
cmpq $0x0, %rax
jbe 0x21afb
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x98(%rbp), %rsi
callq 0xcaa0
movq %rax, %rsi
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x9b20
movq -0x208(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x131a0
jmp 0x2196e
leaq -0xb8(%rbp), %rdi
callq 0x9b50
leaq -0x100(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
callq 0x15c60
movq %rax, -0x210(%rbp)
jmp 0x219a9
movq -0x210(%rbp), %rsi
movq -0x218(%rbp), %rdi
callq 0x21da0
jmp 0x219be
leaq -0xe8(%rbp), %rdi
callq 0x18560
leaq -0xd8(%rbp), %rdi
callq 0x15f80
leaq -0xc8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x22b10
jmp 0x219eb
leaq -0x100(%rbp), %rdi
callq 0xc530
leaq -0xc8(%rbp), %rdi
callq 0x9b90
movq %rax, %rdi
addq $0x10, %rdi
callq 0x22b80
movq %rax, -0x220(%rbp)
jmp 0x21a18
movq -0x220(%rbp), %rdi
addq $0x18, %rdi
leaq -0x90(%rbp), %rsi
callq 0x187a0
leaq -0x90(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x187a0
leaq -0xc8(%rbp), %rdi
callq 0x9b50
leaq -0xa8(%rbp), %rdi
callq 0x9b50
jmp 0x21910
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21a82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4210
leaq -0x79(%rbp), %rdi
callq 0x4370
jmp 0x21d8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x9b50
jmp 0x21b48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21aed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x100(%rbp), %rdi
callq 0xc530
jmp 0x21aed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x9b50
leaq -0xa8(%rbp), %rdi
callq 0x9b50
jmp 0x21b48
leaq -0x90(%rbp), %rdi
callq 0x9700
movq -0x1d0(%rbp), %rdi
movq %rax, -0x228(%rbp)
callq 0x9700
movq -0x228(%rbp), %rsi
movq %rax, %rdi
callq 0x22ba0
jmp 0x21b2b
leaq -0x90(%rbp), %rdi
callq 0x9b50
jmp 0x21d85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x9b50
jmp 0x21d8e
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x238(%rbp)
leaq -0x121(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x4570
movq -0x230(%rbp), %rdx
leaq 0x147eb(%rip), %rsi     # 0x36373
leaq -0x120(%rbp), %rdi
callq 0x9e70
jmp 0x21b96
leaq -0x120(%rbp), %rdi
callq 0xfbf0
movq %rax, -0x240(%rbp)
jmp 0x21bab
leaq -0x120(%rbp), %rdi
callq 0x4210
leaq -0x121(%rbp), %rdi
callq 0x4370
movq -0x240(%rbp), %rcx
movq -0x238(%rbp), %rax
cmpq %rcx, %rax
jne 0x21d83
xorps %xmm0, %xmm0
movaps %xmm0, -0x1a0(%rbp)
movq $0x0, -0x190(%rbp)
leaq -0x1a0(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x15f60
movq -0x248(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0x20620
jmp 0x21c17
leaq -0x1a0(%rbp), %rdi
callq 0xc7d0
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rdi
callq 0x18160
movq %rax, -0x1b0(%rbp)
movq -0x1a8(%rbp), %rdi
callq 0x17fa0
movq %rax, -0x1b8(%rbp)
leaq -0x1b0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x22a70
testb $0x1, %al
jne 0x21c74
jmp 0x21d3e
leaq -0x1b0(%rbp), %rdi
callq 0x184a0
movq %rax, %rsi
leaq -0x1c8(%rbp), %rdi
callq 0x9b20
leaq -0x170(%rbp), %rdi
callq 0x15c60
movq %rax, -0x250(%rbp)
jmp 0x21ca4
movq -0x250(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x1ca20
jmp 0x21cb9
leaq -0x1c8(%rbp), %rdi
callq 0x9b50
leaq -0x1b0(%rbp), %rdi
callq 0x22ab0
jmp 0x21c58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21cf9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x4210
leaq -0x121(%rbp), %rdi
callq 0x4370
jmp 0x21d8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0xc7d0
jmp 0x21d8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x9b50
jmp 0x21d75
movq -0x1d0(%rbp), %rdi
callq 0x9700
movq %rax, %rdi
leaq -0x180(%rbp), %rsi
callq 0x22ba0
jmp 0x21d5b
leaq -0x180(%rbp), %rdi
callq 0x17b50
jmp 0x21d83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x17b50
jmp 0x21d8e
jmp 0x21d85
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x4560
nopw (%rax,%rax)