// File: MechaDragonX[P]CPPCollections/double_linked_list.cpp
// Function: DoubleLinkedList<int>::toString[abi:cxx11]()
std::string DoubleLinkedList<T>::toString() {
    DoubleListNode<T>* current = head_;
    std::string output = "";
    while(current != nullptr) {
        if(current->next != nullptr) {
            // If type is Student
            if constexpr (std::is_same<T, Student>::value)
                output += current->value.toString(false) + " => ";
            // If type is std::string
            else if constexpr (std::is_same<T, std::string>::value)
                output += current->value + " => ";
            // Otherwise, it's a primitive
            else
                output += std::to_string(current->value) + " => ";
        }
        else {
            // If type is Student
            if constexpr (std::is_same<T, Student>::value)
                output += current->value.toString(false);
            // If type is std::string
            else if constexpr (std::is_same<T, std::string>::value)
                output += current->value;
            // Otherwise, it's a primitive
            else
                output += std::to_string(current->value);
        }

        current = current->next;
    }
    return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0xa0(%rbp)
movq %rdi, %rax
movq %rax, -0xa8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
leaq -0x1a(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x4310
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rdx
leaq 0x109d5(%rip), %rsi     # 0x153be
callq 0x4b60
jmp 0x49f0
leaq -0x1a(%rbp), %rdi
callq 0x4210
cmpq $0x0, -0x18(%rbp)
je 0x4b21
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4abf
movq -0x18(%rbp), %rax
movl (%rax), %esi
leaq -0x70(%rbp), %rdi
callq 0x4c60
jmp 0x4a24
leaq 0x105d9(%rip), %rdx     # 0x15004
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4c10
jmp 0x4a3a
movq -0xa0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4270
jmp 0x4a4c
leaq -0x50(%rbp), %rdi
callq 0x4120
leaq -0x70(%rbp), %rdi
callq 0x4120
jmp 0x4b10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1a(%rbp), %rdi
callq 0x4210
jmp 0x4b53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4b47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4ab1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4120
leaq -0x70(%rbp), %rdi
callq 0x4120
jmp 0x4b47
movq -0x18(%rbp), %rax
movl (%rax), %esi
leaq -0x90(%rbp), %rdi
callq 0x4c60
jmp 0x4ad3
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4270
jmp 0x4ae8
leaq -0x90(%rbp), %rdi
callq 0x4120
jmp 0x4b10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x4120
jmp 0x4b47
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x49f9
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x4b37
movq -0xa0(%rbp), %rdi
callq 0x4120
movq -0xa8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0x4120
movq -0x28(%rbp), %rdi
callq 0x4300
nopl (%rax)