// File: /workspace/github_c_makefile_star2_O3/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 0x5910(%rip), %rax      # 0xbfb8
movl (%rax), %r14d
incl %r14d
movq 0x585b(%rip), %r15      # 0xbf10
decl %r14d
movzwl %r14w, %eax
leaq (%rax,%rax,4), %rax
cmpq $0x0, (%r15,%rax,8)
je 0x6711
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 0x66ec
movq 0x8(%rax), %rax
movq %rax, 0x8(%r12)
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 0x66d0
testw %r14w, %r14w
jne 0x66b5
movq 0x582a(%rip), %r14      # 0xbf48
cmpq $0x0, (%r14)
je 0x6765
leaq 0x10(%r14), %r15
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
cmpq %r15, %rax
jne 0x6741
movq 0x18(%r14), %rax
movq %rax, 0x8(%r14)
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 0x6728
movq 0x573c(%rip), %r14      # 0xbea8
cmpq $0x0, (%r14)
je 0x67b3
leaq 0x10(%r14), %r15
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
cmpq %r15, %rax
jne 0x678f
movq 0x18(%r14), %rax
movq %rax, 0x8(%r14)
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 0x6776
movq 0x574e(%rip), %r14      # 0xbf08
cmpq $0x0, (%r14)
je 0x6801
leaq 0x10(%r14), %r15
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
cmpq %r15, %rax
jne 0x67dd
movq 0x18(%r14), %rax
movq %rax, 0x8(%r14)
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 0x67c4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq