// File: AgathokakologicalBit[P]wit/src/annotation/context_generation.cpp
// Function: akbit::system::annotation::(anonymous namespace)::cg_visit_value_variable(std::shared_ptr<akbit::system::Node>, akbit::system::Node::value_variable_t&, std::shared_ptr<akbit::system::Context>, bool)
void cg_visit_value_variable(std::shared_ptr<Node> node, Node::value_variable_t &val, std::shared_ptr<Context> ctx, bool reg_vars)
    {
      // Assumes that the first found instance is the correct one
      // TODO: Enhance the type checking algorithm
      auto possible_values = ctx->find(val.name);
      val.record = possible_values.empty() ? nullptr : possible_values[0];
      if (val.record.lock()) node->result_type = val.record.lock()->type;
      if (!reg_vars) return;
      if (!ctx->get(val.name).empty()) return;
      val.record = ctx->add(ctx, val.name, node->result_type);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movl %ecx, %eax
movq %rdx, -0xc8(%rbp)
movq %rdi, %rcx
movq -0xc8(%rbp), %rdi
movq %rcx, -0xc0(%rbp)
movq %rcx, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
callq 0xda20
movq %rax, %rsi
movq -0x10(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x2e180
leaq -0x38(%rbp), %rdi
callq 0x2e440
testb $0x1, %al
jne 0x2c7ea
jmp 0x2c7f9
leaq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2e480
jmp 0x2c812
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2e4a0
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x2d2d0
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
leaq -0x48(%rbp), %rsi
callq 0x2d1f0
leaq -0x48(%rbp), %rdi
callq 0xd940
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
leaq -0x58(%rbp), %rdi
callq 0xd8f0
leaq -0x58(%rbp), %rdi
callq 0xd920
movb %al, -0xc9(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xd940
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x2c861
jmp 0x2c8a2
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
leaq -0x68(%rbp), %rdi
callq 0xd8f0
leaq -0x68(%rbp), %rdi
callq 0xd9d0
movq -0xc0(%rbp), %rdi
movl 0x30(%rax), %eax
movl %eax, -0xd0(%rbp)
callq 0x9b90
movl -0xd0(%rbp), %ecx
movl %ecx, 0x50(%rax)
leaq -0x68(%rbp), %rdi
callq 0xd940
testb $0x1, -0x19(%rbp)
jne 0x2c8b4
movl $0x1, -0x6c(%rbp)
jmp 0x2c9c2
movq -0xc8(%rbp), %rdi
callq 0xda20
movq %rax, %rsi
movq -0x10(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0x2e4c0
jmp 0x2c8d5
leaq -0x88(%rbp), %rdi
callq 0x2e440
xorb $-0x1, %al
movb %al, -0xd1(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x2e5b0
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x2c901
jmp 0x2c924
movl $0x1, -0x6c(%rbp)
jmp 0x2c9c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x2c9f2
movq -0xc8(%rbp), %rdi
callq 0xda20
movq -0xc8(%rbp), %rsi
movq %rax, -0xf0(%rbp)
leaq -0xb8(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0xa380
movq -0xc0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
callq 0x9b90
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq -0xe0(%rbp), %rcx
movl 0x50(%rax), %r8d
leaq -0xa8(%rbp), %rdi
callq 0x2d110
jmp 0x2c98f
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x2d1f0
leaq -0xa8(%rbp), %rdi
callq 0xd940
leaq -0xb8(%rbp), %rdi
callq 0xabf0
movl $0x0, -0x6c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x2e5b0
addq $0xf0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0xabf0
leaq -0x38(%rbp), %rdi
callq 0x2e5b0
movq -0x90(%rbp), %rdi
callq 0x4560
nopw (%rax,%rax)