// File: /workspace/github_cpp_makefile_star2_O1/MechaDragonX[P]CPPCollections/stack.cpp
// Function: Stack<int>::toString[abi:cxx11]()
std::string Stack<T>::toString() {
    DoubleListNode<T>* current = tail_;
    std::string output = "";
    // Print each element backwards so it looks like the back is facing the element in front of it
    while(current != nullptr) {
        // If type is Student
        if constexpr (std::is_same<T, Student>::value)
            output += current->value.toString(false) + "\n";
        // If type is std::string
        else if constexpr (std::is_same<T, std::string>::value)
            output += current->value + "\n";
        // Otherwise, it's a primitive
        else
            output += std::to_string(current->value) + "\n";

        current = current->previous;
    }
    return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq 0x10(%rsi), %r12
leaq 0x10(%rdi), %rax
movq %rax, -0x38(%rbp)
movq %rax, (%rdi)
leaq 0x652d(%rip), %rdx      # 0x103be
movq %rdi, -0x30(%rbp)
movq %rdx, %rsi
callq 0x5bd8
testq %r12, %r12
je 0x9feb
leaq -0x48(%rbp), %r14
leaq -0x78(%rbp), %rbx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
movq %r12, -0x80(%rbp)
movl (%r12), %r12d
movl %r12d, %r13d
negl %r13d
cmovsl %r12d, %r13d
movl $0x1, %r15d
cmpl $0xa, %r13d
jb 0x9f13
movl $0x4, %r15d
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x9f0a
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x9f10
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x9f13
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r15d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x9eda
addl $-0x3, %r15d
jmp 0x9f13
addl $-0x2, %r15d
jmp 0x9f13
decl %r15d
shrl $0x1f, %r12d
leal (%r15,%r12), %esi
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %rbx, %rdi
movl $0x2d, %edx
callq 0x3170
addq -0x78(%rbp), %r12
movq %r12, %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0x582c
movq %rbx, %r15
movq %rbx, %rdi
leaq 0x646e(%rip), %rsi      # 0x103bd
callq 0x3200
movq %r14, -0x58(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq -0x80(%rbp), %r12
je 0x9f78
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0x9f7f
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0x50(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x3070
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0x9fbc
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x9fd5
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3140
movq 0x8(%r12), %r12
testq %r12, %r12
movq %r15, %rbx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
jne 0x9eb3
movq -0x30(%rbp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xa039
movq %rax, %rbx
jmp 0xa020
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0xa020
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xa039
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x38(%rbp), %rdi
je 0xa055
movq -0x38(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3140
movq %rbx, %rdi
callq 0x31e0
nop