// File: /workspace/github_cpp_makefile_star2_O3/AshOlogn[P]ash-language-interpreter/src/executor.cpp
// Function: executeNewAssignmentStatement(NewAssignmentStatementNode*)
void executeNewAssignmentStatement(NewAssignmentStatementNode* node) {
  
  //get stuff out of the node first
  SymbolTable* symbolTable = node->symbolTable;
  std::string variable = node->variable;
  ParseDataType type = node->type;
	ParseDataType subType = node->subType;
  
  //add variable to table
  if(node->value != NULL) {

    ParseData d = node->value->evaluate();
				
		if(type == ARRAY_T) {

			//if array, change array value's subtype to fit variable's subtype
			Array* arr = (Array*) d.value.allocated;
			arr->subtype = subType;
			symbolTable->declare(variable, d);

		} else {
			//consider implicit casting
    	symbolTable->declare(variable, castHelper(d, type));
		}

  } else {
    
    ParseData d;
    d.type = symbolTable->get(variable).type;
    symbolTable->declare(variable, castHelper(d, type));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %r15
movq 0x10(%rdi), %rbx
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x18(%rdi), %rsi
movq 0x20(%rdi), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x897a
movl 0x38(%r15), %r14d
movq 0x40(%r15), %rdi
testq %rdi, %rdi
je 0x16f63
movl 0x3c(%r15), %r13d
movq (%rdi), %rax
callq *(%rax)
movl %eax, %r12d
movq %rdx, %r15
cmpl $0xc, %r14d
jne 0x1700d
movl %r13d, (%r15)
leaq -0xb8(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x897a
leaq -0xc8(%rbp), %rsi
movq %rbx, %rdi
movl %r12d, %edx
movq %r15, %rcx
leaq -0x38(%rbp), %r13
callq 0x164ea
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
jne 0x16fe8
jmp 0x16fed
leaq -0x78(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x897a
leaq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0x165ec
movl %eax, %r15d
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x16fa6
callq 0x41e0
leaq -0x58(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x897a
movl %r15d, %edi
movl %r14d, %edx
callq 0x15094
movq %rdx, %rcx
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
movl %eax, %edx
callq 0x164ea
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x16fed
callq 0x41e0
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x16ffb
callq 0x41e0
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x897a
movl %r12d, %edi
movq %r15, %rsi
movl %r14d, %edx
callq 0x15094
movq %rdx, %rcx
leaq -0xa8(%rbp), %rsi
movq %rbx, %rdi
movl %eax, %edx
callq 0x164ea
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
leaq -0x38(%rbp), %r13
jne 0x16fe8
jmp 0x16fed
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
jne 0x170a3
jmp 0x170ad
jmp 0x170aa
jmp 0x170aa
movq %rax, %rbx
movq -0x88(%rbp), %rdi
jmp 0x1709e
jmp 0x170aa
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
jne 0x170a3
jmp 0x170ad
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x170ad
callq 0x41e0
jmp 0x170ad
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x170bf
callq 0x41e0
movq %rbx, %rdi
callq 0x4380