// File: /workspace/github_cpp_makefile_star2_O1/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 0x8337(%rip), %rdx      # 0x103be
movq %rdi, -0x30(%rbp)
movq %rdx, %rsi
callq 0x5bd8
testq %r14, %r14
je 0x82b3
leaq -0x40(%rbp), %rbx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
leaq -0x78(%rbp), %r15
cmpq $0x0, 0x8(%r14)
je 0x8116
movq %r14, -0x80(%rbp)
movl (%r14), %r13d
movl %r13d, %r14d
negl %r14d
cmovsl %r13d, %r14d
movl $0x1, %r12d
cmpl $0xa, %r14d
jb 0x8187
movl $0x4, %r12d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x817e
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x8184
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x8187
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x80da
addl $-0x3, %r12d
jmp 0x8187
movq %r14, %r15
movl (%r14), %r13d
movl %r13d, %r14d
negl %r14d
cmovsl %r13d, %r14d
movl $0x1, %r12d
cmpl $0xa, %r14d
jb 0x8248
movl $0x4, %r12d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x823f
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x8245
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x8248
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x813f
addl $-0x3, %r12d
jmp 0x8248
addl $-0x2, %r12d
jmp 0x8187
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 0x582c
movq %r15, %rdi
leaq 0x7e44(%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 0x81e9
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x81ef
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 0x822c
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x829d
movq -0x68(%rbp), %rsi
jmp 0x8295
addl $-0x2, %r12d
jmp 0x8248
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 0x582c
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 0x829d
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 0x80a9
movq -0x30(%rbp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x82f4
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0x8315
movq -0x40(%rbp), %rsi
jmp 0x830d
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0x82fc
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3140
jmp 0x82fc
movq %rax, %r14
jmp 0x8315
movq %rax, %r14
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x8315
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3140
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x58(%rbp), %rdi
je 0x8331
movq -0x58(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3140
movq %r14, %rdi
callq 0x31e0
nop