// File: /workspace/github_cpp_makefile_star2_O3/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 0x649f(%rip), %rdx      # 0x103be
movq %rdi, -0x30(%rbp)
movq %rdx, %rsi
callq 0x5bdc
testq %r12, %r12
je 0xa079
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 0x9fa1
movl $0x4, %r15d
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x9f98
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x9f9e
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x9fa1
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r15d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x9f68
addl $-0x3, %r15d
jmp 0x9fa1
addl $-0x2, %r15d
jmp 0x9fa1
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 0x5828
movq %rbx, %r15
movq %rbx, %rdi
leaq 0x63e0(%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 0xa006
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0xa00d
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 0xa04a
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xa063
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3140
movq 0x8(%r12), %r12
testq %r12, %r12
movq %r15, %rbx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
jne 0x9f41
movq -0x30(%rbp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xa0c7
movq %rax, %rbx
jmp 0xa0ae
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0xa0ae
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xa0c7
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x38(%rbp), %rdi
je 0xa0e3
movq -0x38(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3140
movq %rbx, %rdi
callq 0x31e0
nop