// File: /workspace/github_cpp_makefile_star2_O3/Mulan-Szechuan-Sauce[P]javelin/src/node.cpp
// Function: NList::NList(NExpressionArgs*)
NList::NList(NExpressionArgs *contents) : contents(contents) {
  // Validate the type of the list - for now, you must have at least one element.
  if (contents == NULL) {
    throw std::runtime_error("No type associated with list declaration");
  } else {
    type = new ListType(contents->expr->get_type());
  }

  Type *itr_type = type->get_itr_type();
  for (contents = contents->next; contents != NULL; contents = contents->next) {
    Type *content_type = contents->expr->get_type();
    if (content_type->cpp_type_string() != itr_type->cpp_type_string()) {
      throw std::runtime_error("Type mismatch in " + itr_type->cpp_type_string() + " list");
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x84ea(%rip), %rax      # 0x152d8
movq (%rax), %rax
movq %rax, 0x8(%rdi)
leaq 0x7e3c(%rip), %rax      # 0x14c38
movq %rax, (%rdi)
movq %rsi, 0x10(%rdi)
testq %rsi, %rsi
je 0xcf8c
movq %rsi, %rbx
movq %rdi, %r15
movl $0x10, %edi
callq 0x51d0
movq %rax, %r12
movq (%rbx), %rdi
movq (%rdi), %rax
callq *(%rax)
movq %rax, %r14
leaq 0x7caf(%rip), %rax      # 0x14ae0
movq %rax, (%r12)
movq %r14, 0x8(%r12)
movq %r12, 0x18(%r15)
leaq -0x68(%rbp), %r12
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0xcf33
movq (%rbx), %rdi
movq (%rdi), %rax
callq *(%rax)
movq (%rax), %rcx
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq *(%rcx)
movq (%r14), %rax
movq %r12, %rdi
movq %r14, %rsi
callq *(%rax)
movq -0x40(%rbp), %rdx
cmpq -0x60(%rbp), %rdx
jne 0xce95
movq -0x68(%rbp), %r13
testq %rdx, %rdx
je 0xce9e
movq -0x48(%rbp), %rdi
movq %r13, %rsi
callq 0x51e0
testl %eax, %eax
setne %r15b
jmp 0xcea1
movb $0x1, %r15b
movq -0x68(%rbp), %r13
jmp 0xcea1
xorl %r15d, %r15d
leaq -0x58(%rbp), %rax
cmpq %rax, %r13
je 0xceb2
movq %r13, %rdi
callq 0x51b0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcec4
callq 0x51b0
testb %r15b, %r15b
je 0xce42
movl $0x10, %edi
callq 0x5120
movq %rax, %rbx
movq (%r14), %rax
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq *(%rax)
leaq 0x2e70(%rip), %rsi      # 0xfd60
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x91df
leaq 0x2e6b(%rip), %rsi      # 0xfd72
leaq -0x68(%rbp), %rdi
callq 0x5370
leaq -0x38(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xcf42
movups (%rcx), %xmm0
leaq -0x38(%rbp), %rdx
movups %xmm0, (%rdx)
jmp 0xcf4d
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
movq 0x8(%rax), %rdx
leaq -0x48(%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 0x8073(%rip), %rsi      # 0x14ff0
movq 0x803c(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x5320
movl $0x10, %edi
callq 0x5120
movq %rax, %rbx
leaq 0x2d97(%rip), %rsi      # 0xfd37
movq %rax, %rdi
callq 0x50e0
movq 0x8041(%rip), %rsi      # 0x14ff0
movq 0x800a(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x5320
jmp 0xd027
movq %rax, %r14
movq %r12, %rdi
jmp 0xd044
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcfe5
callq 0x51b0
jmp 0xcfe5
movq %rax, %r14
movb $0x1, %r15b
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xcff7
callq 0x51b0
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd009
callq 0x51b0
testb %r15b, %r15b
jne 0xd02a
jmp 0xd049
movq %rax, %r14
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd02a
callq 0x51b0
jmp 0xd02a
movq %rax, %r14
movq %rbx, %rdi
callq 0x5170
jmp 0xd049
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xd049
callq 0x51b0
movq %r14, %rdi
callq 0x5340
nop