// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskCleanUpResources
void vTaskCleanUpResources( void )
	{
	unsigned short usQueue;
	volatile tskTCB *pxTCB;

		usQueue = ( unsigned short ) uxTopUsedPriority + ( unsigned short ) 1;

		/* Remove any TCB's from the ready queues. */
		do
		{
			usQueue--;

			while( !listLIST_IS_EMPTY( &( pxReadyTasksLists[ usQueue ] ) ) )
			{
				listGET_OWNER_OF_NEXT_ENTRY( pxTCB, &( pxReadyTasksLists[ usQueue ] ) );
				vListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) );

				prvDeleteTCB( ( tskTCB * ) pxTCB );
			}
		}while( usQueue > ( unsigned short ) tskIDLE_PRIORITY );

		/* Remove any TCB's from the delayed queue. */
		while( !listLIST_IS_EMPTY( &xDelayedTaskList1 ) )
		{
			listGET_OWNER_OF_NEXT_ENTRY( pxTCB, &xDelayedTaskList1 );
			vListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) );

			prvDeleteTCB( ( tskTCB * ) pxTCB );
		}

		/* Remove any TCB's from the overflow delayed queue. */
		while( !listLIST_IS_EMPTY( &xDelayedTaskList2 ) )
		{
			listGET_OWNER_OF_NEXT_ENTRY( pxTCB, &xDelayedTaskList2 );
			vListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) );

			prvDeleteTCB( ( tskTCB * ) pxTCB );
		}

		while( !listLIST_IS_EMPTY( &xSuspendedTaskList ) )
		{
			listGET_OWNER_OF_NEXT_ENTRY( pxTCB, &xSuspendedTaskList );
			vListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) );

			prvDeleteTCB( ( tskTCB * ) pxTCB );
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x58e4(%rip), %rax      # 0xbfb8
movl (%rax), %r14d
incl %r14d
movq 0x582f(%rip), %r15      # 0xbf10
decl %r14d
movzwl %r14w, %eax
leaq (%rax,%rax,4), %rax
cmpq $0x0, (%r15,%rax,8)
je 0x6742
leaq (%r15,%rax,8), %r12
leaq 0x10(%r12), %r13
movq 0x8(%r12), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%r12)
cmpq %r13, %rax
jne 0x6718
movq 0x8(%rax), %rax
movq %rax, 0x8(%r12)
movq 0x8(%r12), %rax
movq 0x18(%rax), %rbx
leaq 0x8(%rbx), %rdi
callq 0x4040
movq 0x60(%rbx), %rdi
callq 0x4190
movq %rbx, %rdi
callq 0x4190
cmpq $0x0, (%r12)
jne 0x66fc
testw %r14w, %r14w
jne 0x66e1
movq 0x57f9(%rip), %r14      # 0xbf48
cmpq $0x0, (%r14)
je 0x679a
leaq 0x10(%r14), %r15
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
cmpq %r15, %rax
jne 0x6772
movq 0x18(%r14), %rax
movq %rax, 0x8(%r14)
movq 0x8(%r14), %rax
movq 0x18(%rax), %rbx
leaq 0x8(%rbx), %rdi
callq 0x4040
movq 0x60(%rbx), %rdi
callq 0x4190
movq %rbx, %rdi
callq 0x4190
cmpq $0x0, (%r14)
jne 0x6759
movq 0x5707(%rip), %r14      # 0xbea8
cmpq $0x0, (%r14)
je 0x67ec
leaq 0x10(%r14), %r15
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
cmpq %r15, %rax
jne 0x67c4
movq 0x18(%r14), %rax
movq %rax, 0x8(%r14)
movq 0x8(%r14), %rax
movq 0x18(%rax), %rbx
leaq 0x8(%rbx), %rdi
callq 0x4040
movq 0x60(%rbx), %rdi
callq 0x4190
movq %rbx, %rdi
callq 0x4190
cmpq $0x0, (%r14)
jne 0x67ab
movq 0x5715(%rip), %r14      # 0xbf08
cmpq $0x0, (%r14)
je 0x683e
leaq 0x10(%r14), %r15
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
cmpq %r15, %rax
jne 0x6816
movq 0x18(%r14), %rax
movq %rax, 0x8(%r14)
movq 0x8(%r14), %rax
movq 0x18(%rax), %rbx
leaq 0x8(%rbx), %rdi
callq 0x4040
movq 0x60(%rbx), %rdi
callq 0x4190
movq %rbx, %rdi
callq 0x4190
cmpq $0x0, (%r14)
jne 0x67fd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq