// File: /workspace/github_cpp_makefile_star2_O1/Mulan-Szechuan-Sauce[P]javelin/src/node.cpp
// Function: NAssignment::NAssignment(NIdentifier*, NExpression*)
NAssignment::
NAssignment(NIdentifier *lhs, NExpression *rhs) : lhs(lhs), rhs(rhs) {
  Type *type = rhs->get_type();
  Definition *def = scope->findDefinition(lhs->name);
  VariableDefinition *vdef = (VariableDefinition *)def;

  // FIXME accomodate conflicting function & class names

  if (def == NULL) {
    scope->addDefinition(lhs->name, new VariableDefinition(type));
  } else if (vdef->get_type()->isUnset()) {
    // For argument type implication
    lhs->set_type(type);
    vdef->set_type(type);
  // Already defined as a var
  } else if (type->cpp_type_string() != vdef->type->cpp_type_string()) {
    throw std::runtime_error(lhs->name +
                             " was previously declared as a '" +
                             vdef->type->cpp_type_string() + "'");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %r12
leaq 0x7947(%rip), %rax      # 0x13f48
movq %rax, (%rdi)
leaq 0x8ccd(%rip), %rax      # 0x152d8
movq (%rax), %rax
movq %rax, 0x8(%rdi)
leaq 0x85ff(%rip), %rax      # 0x14c18
movq %rax, (%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
movq (%rdx), %rax
movq %rdx, %rdi
callq *(%rax)
movq %rax, -0x30(%rbp)
movq 0x8(%r12), %r15
leaq -0xa0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %r13
movq %r13, %rdi
callq 0xa1d6
movq (%r15), %rax
movq %r15, %rdi
movq %r13, %rsi
callq *(%rax)
movq %rax, %r15
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xc679
callq 0x51b0
testq %r15, %r15
je 0xc6b9
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
testb %al, %al
je 0xc727
movq (%r14), %rax
movq %r14, %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq *0x8(%rax)
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
callq *0x20(%rax)
jmp 0xc791
movq 0x8(%r12), %r15
leaq -0x80(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0xa1d6
movl $0x18, %edi
callq 0x51d0
leaq 0x8089(%rip), %rcx      # 0x14778
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x90(%rbp), %rsi
movq %r15, %rdi
movq %rax, %rdx
callq 0xa270
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0xc791
callq 0x51b0
jmp 0xc791
movq -0x30(%rbp), %rsi
movq (%rsi), %rax
leaq -0x50(%rbp), %rdi
callq *(%rax)
movq 0x8(%r15), %rsi
movq (%rsi), %rax
leaq -0x70(%rbp), %rdi
callq *(%rax)
movq -0x48(%rbp), %rdx
movb $0x1, %bl
cmpq -0x68(%rbp), %rdx
jne 0xc768
testq %rdx, %rdx
je 0xc766
movq -0x70(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x51e0
testl %eax, %eax
setne %bl
jmp 0xc768
xorl %ebx, %ebx
leaq -0x60(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0xc77b
callq 0x51b0
leaq -0x40(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0xc78d
callq 0x51b0
testb %bl, %bl
jne 0xc7a3
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x10, %r14
movl $0x10, %edi
callq 0x5120
movq %rax, %rbx
leaq 0x3536(%rip), %rdx      # 0xfcf1
leaq -0xf0(%rbp), %rdi
movq %r14, %rsi
callq 0xd474
movq 0x8(%r15), %rsi
movq (%rsi), %rax
leaq -0xd0(%rbp), %rdi
callq *(%rax)
leaq -0x70(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0xd4ce
leaq 0x31e1(%rip), %rsi      # 0xf9d9
leaq -0x70(%rbp), %rdi
callq 0x5370
movq %r13, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xc81e
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0xc829
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
movq 0x8(%rax), %rdx
leaq -0x50(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %r15b
movq %rbx, %rdi
callq 0x52e0
xorl %r15d, %r15d
movq 0x8797(%rip), %rsi      # 0x14ff0
movq 0x8760(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x5320
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc881
callq 0x51b0
jmp 0xc881
movq %rax, %r14
movb $0x1, %r15b
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0xc897
callq 0x51b0
jmp 0xc897
movq %rax, %r14
movb $0x1, %r15b
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc8b4
callq 0x51b0
jmp 0xc8b4
movq %rax, %r14
movb $0x1, %r15b
leaq -0xe0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc8d1
callq 0x51b0
jmp 0xc8d1
movq %rax, %r14
movb $0x1, %r15b
testb %r15b, %r15b
je 0xc917
movq %rbx, %rdi
callq 0x5170
jmp 0xc917
movq %rax, %r14
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xc912
jmp 0xc917
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
jne 0xc912
jmp 0xc917
movq %rax, %r14
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xc917
callq 0x51b0
movq %r14, %rdi
callq 0x5340
nop