// File: Mulan-Szechuan-Sauce[P]javelin/src/node.cpp
// Function: NIdentifier::set_type(Type*)
void NIdentifier::set_type(Type *type) {
  auto vd = (VariableDefinition *)scope->findDefinition(name);
  if (vd->get_type()->isUnset()) {
    vd->set_type(type);
  } else if (vd->get_type()->cpp_type_string() != type->cpp_type_string()) {
    throw std::runtime_error(name + " is already a "
                             + vd->type->cpp_type_string());
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x110(%rbp)
movq 0x8(%rsi), %rax
movq %rax, -0x108(%rbp)
addq $0x10, %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x5100
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movq %rax, -0xf8(%rbp)
jmp 0x12aec
leaq -0x38(%rbp), %rdi
callq 0x5190
movq -0xf8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %rdi
movq (%rdi), %rax
callq *0x10(%rax)
testb $0x1, %al
jne 0x12b19
jmp 0x12b46
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
callq *0x20(%rax)
jmp 0x12ce5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x5190
jmp 0x12cee
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x68(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x88(%rbp), %rdi
callq *%rax
jmp 0x12b77
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xcbe0
movb %al, -0x111(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5190
leaq -0x68(%rbp), %rdi
callq 0x5190
movb -0x111(%rbp), %al
testb $0x1, %al
jne 0x12bb1
jmp 0x12ce3
movb $0x1, -0xe9(%rbp)
movl $0x10, %edi
callq 0x5130
movq -0x110(%rbp), %rsi
movq %rax, -0x120(%rbp)
addq $0x10, %rsi
leaq 0x41f1(%rip), %rdx      # 0x16dcc
leaq -0xc8(%rbp), %rdi
callq 0x13930
jmp 0x12be9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0xe8(%rbp), %rdi
callq *%rax
jmp 0x12c02
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
callq 0x139b0
jmp 0x12c1e
movq -0x120(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x5390
jmp 0x12c33
movq -0x120(%rbp), %rdi
movb $0x0, -0xe9(%rbp)
movq 0xc3a0(%rip), %rsi      # 0x1efe8
movq 0xc369(%rip), %rdx      # 0x1efb8
callq 0x53d0
jmp 0x12cf7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5190
jmp 0x12cee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12cca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12cbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12cb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x5190
leaq -0xe8(%rbp), %rdi
callq 0x5190
leaq -0xc8(%rbp), %rdi
callq 0x5190
testb $0x1, -0xe9(%rbp)
jne 0x12cd5
jmp 0x12ce1
movq -0x120(%rbp), %rdi
callq 0x51b0
jmp 0x12cee
jmp 0x12ce5
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5400
nopw (%rax,%rax)