// File: /workspace/github_cpp_makefile_star2_O2/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, %r12
movq %rdi, %r13
leaq 0x8fdf(%rip), %rax      # 0x142f8
movq (%rax), %rax
movq %rax, 0x8(%rdi)
leaq 0x88f1(%rip), %rax      # 0x13c18
movq %rax, (%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
movq (%rdx), %rax
movq %rdx, %rdi
callq *(%rax)
movq %rax, %rbx
movq 0x8(%r13), %r15
leaq 0x10(%r12), %rsi
leaq -0xf0(%rbp), %r14
movq %r14, %rdi
movq %rsi, -0x30(%rbp)
callq 0x5290
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *(%rax)
movq %rax, %r15
leaq -0xf0(%rbp), %rdi
callq 0x5120
testq %r15, %r15
je 0xb3ac
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
testb %al, %al
je 0xb3fe
movq (%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
callq *0x8(%rax)
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
callq *0x20(%rax)
jmp 0xb442
movq 0x8(%r13), %r15
leaq -0x90(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x5290
pushq $0x18
popq %rdi
callq 0x51f0
leaq 0x83a9(%rip), %rcx      # 0x13778
addq $0x10, %rcx
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x90(%rbp), %rsi
movq %r15, %rdi
movq %rax, %rdx
callq 0x9560
leaq -0x90(%rbp), %rdi
callq 0x5120
jmp 0xb442
movq (%rbx), %rax
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq *(%rax)
movq 0x8(%r15), %rsi
movq (%rsi), %rax
leaq -0x70(%rbp), %rdi
callq *(%rax)
leaq -0x50(%rbp), %rbx
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8bdb
movl %eax, %r12d
movq %r14, %rdi
callq 0x5120
movq %rbx, %rdi
callq 0x5120
testb %r12b, %r12b
jne 0xb454
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x5140
movq %rax, %rbx
leaq 0x388b(%rip), %rdx      # 0xecf1
leaq -0xd0(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xbd9e
movq 0x8(%r15), %rsi
movq (%rsi), %rax
leaq -0xb0(%rbp), %rdi
callq *(%rax)
leaq -0x70(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0xbdd6
leaq 0x3535(%rip), %rdx      # 0xe9d9
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x91c8
movb $0x1, %r15b
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x5310
xorl %r15d, %r15d
movq 0x8b26(%rip), %rsi      # 0x13ff0
movq 0x8aef(%rip), %rdx      # 0x13fc0
movq %rbx, %rdi
callq 0x5350
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x5120
jmp 0xb4ed
movq %rax, %r14
movb $0x1, %r15b
leaq -0x70(%rbp), %rdi
callq 0x5120
jmp 0xb4fe
movq %rax, %r14
movb $0x1, %r15b
leaq -0xb0(%rbp), %rdi
callq 0x5120
jmp 0xb512
movq %rax, %r14
movb $0x1, %r15b
leaq -0xd0(%rbp), %rdi
callq 0x5120
testb %r15b, %r15b
jne 0xb528
jmp 0xb556
movq %rax, %r14
movq %rbx, %rdi
callq 0x5180
jmp 0xb556
movq %rax, %r14
leaq -0x50(%rbp), %rdi
jmp 0xb551
movq %rax, %r14
leaq -0x90(%rbp), %rdi
jmp 0xb551
movq %rax, %r14
leaq -0xf0(%rbp), %rdi
callq 0x5120
movq %r14, %rdi
callq 0x5370