// File: /workspace/github_cpp_makefile_star2_O3/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 0x8f45(%rip), %rax      # 0x152d8
movq (%rax), %rax
movq %rax, 0x8(%rdi)
leaq 0x8877(%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 -0xc0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %r13
movq %r13, %rdi
callq 0x9fb4
movq (%r15), %rax
movq %r15, %rdi
movq %r13, %rsi
callq *(%rax)
movq %rax, %r15
movq -0xd0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xc401
callq 0x51b0
testq %r15, %r15
je 0xc441
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
testb %al, %al
je 0xc4af
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 0xc524
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 0x9fb4
movl $0x18, %edi
callq 0x51d0
leaq 0x8301(%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 0xa054
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0xc524
callq 0x51b0
jmp 0xc524
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
cmpq -0x68(%rbp), %rdx
jne 0xc4f0
movq -0x70(%rbp), %rbx
testq %rdx, %rdx
je 0xc4f9
movq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x51e0
testl %eax, %eax
setne %r12b
jmp 0xc4fc
movb $0x1, %r12b
movq -0x70(%rbp), %rbx
jmp 0xc4fc
xorl %r12d, %r12d
leaq -0x60(%rbp), %rax
cmpq %rax, %rbx
je 0xc50d
movq %rbx, %rdi
callq 0x51b0
leaq -0x40(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0xc51f
callq 0x51b0
testb %r12b, %r12b
jne 0xc536
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 0x37a3(%rip), %rdx      # 0xfcf1
leaq -0xb0(%rbp), %rdi
movq %r14, %rsi
callq 0xd23c
movq 0x8(%r15), %rsi
movq (%rsi), %rax
leaq -0xf0(%rbp), %rdi
callq *(%rax)
leaq -0x70(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0xd296
leaq 0x344e(%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 0xc5b1
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0xc5bc
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 0x8a04(%rip), %rsi      # 0x14ff0
movq 0x89cd(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x5320
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc614
callq 0x51b0
jmp 0xc614
movq %rax, %r14
movb $0x1, %r15b
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc62e
callq 0x51b0
jmp 0xc62e
movq %rax, %r14
movb $0x1, %r15b
leaq -0xe0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc643
callq 0x51b0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc658
callq 0x51b0
testb %r15b, %r15b
jne 0xc67c
jmp 0xc6bd
movq %rax, %r14
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc67c
callq 0x51b0
jmp 0xc67c
movq %rax, %r14
movq %rbx, %rdi
callq 0x5170
jmp 0xc6bd
movq %rax, %r14
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xc6b8
jmp 0xc6bd
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
jne 0xc6b8
jmp 0xc6bd
movq %rax, %r14
movq -0xd0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xc6bd
callq 0x51b0
movq %r14, %rdi
callq 0x5340
nop