// File: /workspace/github_cpp_makefile_star2_O1/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 0x7c3a(%rip), %rax      # 0x14c68
movq %rax, (%rdi)
leaq 0x82a0(%rip), %rax      # 0x152d8
movq (%rax), %rax
movq %rax, 0x8(%rdi)
leaq 0x7bf2(%rip), %rax      # 0x14c38
movq %rax, (%rdi)
movq %rsi, 0x10(%rdi)
testq %rsi, %rsi
je 0xd1cd
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 0x7a65(%rip), %rax      # 0x14ae0
movq %rax, (%r12)
movq %r14, 0x8(%r12)
movq %r12, 0x18(%r15)
leaq -0x48(%rbp), %r15
leaq -0x68(%rbp), %r12
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0xd174
movq (%rbx), %rdi
movq (%rdi), %rax
callq *(%rax)
movq (%rax), %rcx
movq %r15, %rdi
movq %rax, %rsi
callq *(%rcx)
movq (%r14), %rax
movq %r12, %rdi
movq %r14, %rsi
callq *(%rax)
movq -0x40(%rbp), %rdx
movb $0x1, %r13b
cmpq -0x60(%rbp), %rdx
jne 0xd0e5
testq %rdx, %rdx
je 0xd0e2
movq -0x68(%rbp), %rsi
movq -0x48(%rbp), %rdi
callq 0x51e0
testl %eax, %eax
setne %r13b
jmp 0xd0e5
xorl %r13d, %r13d
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xd0f7
callq 0x51b0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xd109
callq 0x51b0
testb %r13b, %r13b
je 0xd090
movl $0x10, %edi
callq 0x5120
movq %rax, %rbx
movq (%r14), %rax
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq *(%rax)
leaq 0x2c2f(%rip), %rsi      # 0xfd60
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x941d
leaq 0x2c2a(%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 0xd183
movups (%rcx), %xmm0
leaq -0x38(%rbp), %rdx
movups %xmm0, (%rdx)
jmp 0xd18e
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 0x7e32(%rip), %rsi      # 0x14ff0
movq 0x7dfb(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x5320
movl $0x10, %edi
callq 0x5120
movq %rax, %rbx
leaq 0x2b56(%rip), %rsi      # 0xfd37
movq %rax, %rdi
callq 0x50e0
movq 0x7e00(%rip), %rsi      # 0x14ff0
movq 0x7dc9(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x5320
movq %rax, %r14
jmp 0xd262
movq %rax, %r14
movq %r12, %rdi
jmp 0xd27c
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xd229
callq 0x51b0
jmp 0xd229
movq %rax, %r14
movb $0x1, %r15b
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xd243
callq 0x51b0
jmp 0xd243
movq %rax, %r14
movb $0x1, %r15b
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd25d
callq 0x51b0
jmp 0xd25d
movq %rax, %r14
movb $0x1, %r15b
testb %r15b, %r15b
je 0xd281
movq %rbx, %rdi
callq 0x5170
jmp 0xd281
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xd281
callq 0x51b0
movq %r14, %rdi
callq 0x5340
nop