// File: RuiDGPires[P]CrimLang/src/semantic_analiser.cpp
// Function: sc_Tracker::cas(crl::Node*)
void _sc_Tracker::cas(crl::Node *node){
	Context::Item item;
	item.type = Context::Item::Type::CAS;
	item.subtype = ((crl::Leaf *)node->get_child(0))->token.str;
	item.name = ((crl::Leaf *)node->get_child(1))->token.str;

	i32 i;
	for (i = 2; node->get_child(i)->type == crl::Node::Type::ARG; i++){
		crl::Node *arg = node->get_child(i);
		std::string var_type = ((crl::Leaf *) arg->get_child(0))->token.str;

		item.args.push_back(std::pair<std::string, bool>(var_type, arg->annotation == "mut"));
	}

	node->argc = i - 2;
	this->add(item);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x6c30
movl $0x2, -0x80(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorl %esi, %esi
callq *%rax
movq %rax, -0x160(%rbp)
jmp 0x20346
movq -0x160(%rbp), %rsi
addq $0x58, %rsi
leaq -0x58(%rbp), %rdi
callq 0x4050
jmp 0x2035c
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movl $0x1, %esi
callq *%rax
movq %rax, -0x170(%rbp)
jmp 0x20377
movq -0x170(%rbp), %rsi
addq $0x58, %rsi
leaq -0x78(%rbp), %rdi
callq 0x4050
jmp 0x2038d
movl $0x2, -0x90(%rbp)
movq -0x10(%rbp), %rdi
movl -0x90(%rbp), %esi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movq %rax, -0x178(%rbp)
jmp 0x203b3
movq -0x178(%rbp), %rax
cmpl $0x12, 0x8(%rax)
jne 0x2050e
movq -0x10(%rbp), %rdi
movl -0x90(%rbp), %esi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movq %rax, -0x180(%rbp)
jmp 0x203e0
movq -0x180(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
xorl %esi, %esi
callq *%rax
movq %rax, -0x188(%rbp)
jmp 0x20409
movq -0x188(%rbp), %rsi
addq $0x58, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x4150
jmp 0x20422
leaq -0x28(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x98(%rbp), %rdi
addq $0x30, %rdi
leaq 0xb011(%rip), %rsi      # 0x2b450
callq 0x66e0
movb %al, -0x189(%rbp)
jmp 0x2044c
movb -0x189(%rbp), %al
andb $0x1, %al
movb %al, -0xe1(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0xe1(%rbp), %rdx
callq 0x25cc0
jmp 0x20476
movq -0x198(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x25c90
jmp 0x2048b
leaq -0xe0(%rbp), %rdi
callq 0x7cd0
leaq -0xb8(%rbp), %rdi
callq 0x41e0
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x20397
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x20581
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x20500
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x7cd0
leaq -0xb8(%rbp), %rdi
callq 0x41e0
jmp 0x20581
movl -0x90(%rbp), %ecx
addl $-0x2, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x50(%rax)
leaq -0x158(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x6d30
jmp 0x20530
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x20120
jmp 0x20545
leaq -0x158(%rbp), %rdi
callq 0x6df0
leaq -0x80(%rbp), %rdi
callq 0x6df0
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x6df0
leaq -0x80(%rbp), %rdi
callq 0x6df0
movq -0x88(%rbp), %rdi
callq 0x4580
nopw %cs:(%rax,%rax)