// File: ridgelab[P]Kmer-SSR/src/TaskQueue.cpp
// Function: TaskQueue::toJson[abi:cxx11]()
string TaskQueue::toJson()
{
	queue<Task*>* new_tasks = new queue<Task*>();

	string json = "TaskQueue: {";
	
	sem_wait(&(this->lock));
	
	Task* front_task = this->tasks->front();

	if (this->size() != 0)
	{
		json += "\n\t";
		
		while (!this->tasks->empty())
		{
			if (!front_task->equalTo(this->tasks->front()))
			{
				json += ",\n\t";
			}
			
			json += this->tasks->front()->toString();;

			new_tasks->push(this->tasks->front());
			this->tasks->pop();
		}

		json += '\n';
	}
	else
	{
		json += ' ';
	}

	json += '}';

	queue<Task*>* temp_ptr = this->tasks;
	this->tasks = new_tasks;
	delete temp_ptr;
	
	sem_post(&(this->lock));

	return json;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x50, %edi
callq 0x2210
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x60(%rbp)
callq 0x6a80
jmp 0x6791
movq -0x60(%rbp), %rax
movq %rax, -0x18(%rbp)
movb $0x0, -0x25(%rbp)
leaq -0x26(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x2370
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rdx
leaq 0x3723(%rip), %rsi      # 0x9edc
callq 0x4450
jmp 0x67c0
leaq -0x26(%rbp), %rdi
callq 0x2260
movq -0x68(%rbp), %rdi
addq $0x8, %rdi
callq 0x20e0
jmp 0x67d8
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x6b20
movq %rax, -0x88(%rbp)
jmp 0x67ed
movq -0x68(%rbp), %rdi
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x6390
movl %eax, -0x8c(%rbp)
jmp 0x680c
movl -0x8c(%rbp), %eax
cmpl $0x0, %eax
je 0x69b2
movq -0x78(%rbp), %rdi
leaq 0x36c4(%rip), %rsi      # 0x9eea
callq 0x21e0
jmp 0x682d
jmp 0x682f
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x6ad0
movb %al, -0x8d(%rbp)
jmp 0x6843
movb -0x8d(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x6854
jmp 0x69a0
movq -0x68(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, -0xa0(%rbp)
movq (%rax), %rdi
callq 0x6b20
movq %rax, -0x98(%rbp)
jmp 0x6874
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rax
movq (%rax), %rsi
callq 0x83d0
movb %al, -0xa1(%rbp)
jmp 0x6892
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x68fc
jmp 0x689e
movq -0x78(%rbp), %rdi
leaq 0x3640(%rip), %rsi      # 0x9ee9
callq 0x21e0
jmp 0x68b0
jmp 0x68fc
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x50, %esi
callq 0x2220
jmp 0x6a4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x26(%rbp), %rdi
callq 0x2260
jmp 0x6a4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x6a41
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x6b20
movq %rax, -0xb0(%rbp)
jmp 0x6911
movq -0xb0(%rbp), %rax
movq (%rax), %rsi
leaq -0x50(%rbp), %rdi
callq 0x84c0
jmp 0x6926
movq -0x78(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x22b0
jmp 0x6935
leaq -0x50(%rbp), %rdi
callq 0x2100
movq -0x68(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, -0xc0(%rbp)
movq (%rax), %rdi
callq 0x6b20
movq %rax, -0xb8(%rbp)
jmp 0x695e
movq -0xb8(%rbp), %rsi
movq -0xc0(%rbp), %rdi
callq 0x6af0
jmp 0x6973
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x6b40
jmp 0x6981
jmp 0x682f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2100
jmp 0x6a41
movq -0x78(%rbp), %rdi
movl $0xa, %esi
callq 0x2110
jmp 0x69b0
jmp 0x69c4
movq -0x78(%rbp), %rdi
movl $0x20, %esi
callq 0x2110
jmp 0x69c2
jmp 0x69c4
movq -0x78(%rbp), %rdi
movl $0x7d, %esi
callq 0x2110
jmp 0x69d4
movq -0x68(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x58(%rbp)
movq -0x18(%rbp), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
je 0x6a14
movq -0xc8(%rbp), %rdi
callq 0x6a60
movq -0xc8(%rbp), %rdi
movl $0x50, %esi
callq 0x2220
movq -0x68(%rbp), %rdi
addq $0x8, %rdi
callq 0x2340
movb $0x1, -0x25(%rbp)
testb $0x1, -0x25(%rbp)
jne 0x6a34
movq -0x78(%rbp), %rdi
callq 0x2100
movq -0x70(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x2100
movq -0x20(%rbp), %rdi
callq 0x2360
nopw %cs:(%rax,%rax)
nopl (%rax)