// File: /workspace/github_cpp_makefile_star2_O3/MechaDragonX[P]CPPCollections/queue.cpp
// Function: Queue<int>::toString[abi:cxx11]()
std::string Queue<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(current->previous != 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->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), %r14
leaq 0x10(%rdi), %rax
movq %rax, -0x58(%rbp)
movq %rax, (%rdi)
leaq 0x82eb(%rip), %rdx      # 0x103be
movq %rdi, -0x30(%rbp)
movq %rdx, %rsi
callq 0x5bdc
testq %r14, %r14
je 0x82ff
leaq -0x40(%rbp), %rbx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
leaq -0x78(%rbp), %r15
cmpq $0x0, 0x8(%r14)
je 0x8162
movq %r14, -0x80(%rbp)
movl (%r14), %r13d
movl %r13d, %r14d
negl %r14d
cmovsl %r13d, %r14d
movl $0x1, %r12d
cmpl $0xa, %r14d
jb 0x81d3
movl $0x4, %r12d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x81ca
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x81d0
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x81d3
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x8126
addl $-0x3, %r12d
jmp 0x81d3
movq %r14, %r15
movl (%r14), %r13d
movl %r13d, %r14d
negl %r14d
cmovsl %r13d, %r14d
movl $0x1, %r12d
cmpl $0xa, %r14d
jb 0x8294
movl $0x4, %r12d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x828b
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x8291
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x8294
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x818b
addl $-0x3, %r12d
jmp 0x8294
addl $-0x2, %r12d
jmp 0x81d3
decl %r12d
shrl $0x1f, %r13d
leal (%r12,%r13), %esi
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %r15, %rdi
movl $0x2d, %edx
callq 0x3170
addq -0x78(%rbp), %r13
movq %r13, %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0x5828
movq %r15, %rdi
leaq 0x7df8(%rip), %rsi      # 0x10004
callq 0x3200
movq %rbx, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq -0x80(%rbp), %r14
je 0x8235
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x823b
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x3070
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0x8278
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x82e9
movq -0x68(%rbp), %rsi
jmp 0x82e1
addl $-0x2, %r12d
jmp 0x8294
decl %r12d
shrl $0x1f, %r13d
leal (%r12,%r13), %esi
movq %rbx, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
movl $0x2d, %edx
callq 0x3170
addq -0x50(%rbp), %r13
movq %r13, %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0x5828
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x3070
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
movq %r15, %r14
je 0x82e9
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3140
movq 0x8(%r14), %r14
testq %r14, %r14
movl $0xd1b71759, %edx       # imm = 0xD1B71759
leaq -0x78(%rbp), %r15
jne 0x80f5
movq -0x30(%rbp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8340
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0x8361
movq -0x40(%rbp), %rsi
jmp 0x8359
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0x8348
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3140
jmp 0x8348
movq %rax, %r14
jmp 0x8361
movq %rax, %r14
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x8361
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x58(%rbp), %rdi
je 0x837d
movq -0x58(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3140
movq %r14, %rdi
callq 0x31e0
nop