// File: /workspace/github_c_makefile_star2_O2/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/croutine.c
// Function: prvCheckDelayedList
static void prvCheckDelayedList( void )
{
corCRCB *pxCRCB;

	xPassedTicks = xTaskGetTickCount() - xLastTickCount;
	while( xPassedTicks )
	{
		xCoRoutineTickCount++;
		xPassedTicks--;

		/* If the tick count has overflowed we need to swap the ready lists. */
		if( xCoRoutineTickCount == 0 )
		{
			xList * pxTemp;

			/* Tick count has overflowed so we need to swap the delay lists.  If there are
			any items in pxDelayedCoRoutineList here then there is an error! */
			pxTemp = pxDelayedCoRoutineList;
			pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList;
			pxOverflowDelayedCoRoutineList = pxTemp;
		}

		/* See if this tick has made a timeout expire. */
		while( ( pxCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList ) ) != NULL )
		{	
			if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )				
			{			
				/* Timeout not yet expired. */																			
				break;																				
			}																						

			portDISABLE_INTERRUPTS();
			{
				/* The event could have occurred just before this critical
				section.  If this is the case then the generic list item will
				have been moved to the pending ready list and the following
				line is still valid.  Also the pvContainer parameter will have
				been set to NULL so the following lines are also valid. */
				vListRemove( &( pxCRCB->xGenericListItem ) );											

				/* Is the co-routine waiting on an event also? */												
				if( pxCRCB->xEventListItem.pvContainer )													
				{															
					vListRemove( &( pxCRCB->xEventListItem ) );											
				}
			}
			portENABLE_INTERRUPTS();

			prvAddCoRoutineToReadyQueue( pxCRCB );													
		}																									
	}

	xLastTickCount = xCoRoutineTickCount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x4320
movq 0x63df(%rip), %rcx      # 0xaed0
subl (%rcx), %eax
movq 0x6496(%rip), %rdx      # 0xaf90
movl %eax, (%rdx)
movq 0x649d(%rip), %r12      # 0xafa0
movq 0x64be(%rip), %r13      # 0xafc8
movq 0x6467(%rip), %r14      # 0xaf78
movl (%r12), %ecx
testl %eax, %eax
je 0x4bb4
decl %eax
movl %eax, (%rdx)
incl %ecx
movl %ecx, (%r12)
jne 0x4b3e
movq (%r13), %rax
movq 0x6354(%rip), %rdx      # 0xae88
movq (%rdx), %rcx
movq %rcx, (%r13)
movq %rax, (%rdx)
movq (%r13), %rax
cmpq $0x0, (%rax)
je 0x4ba6
movq 0x18(%rax), %rax
movq 0x18(%rax), %r15
testq %r15, %r15
je 0x4ba6
movl (%r12), %eax
cmpl 0x8(%r15), %eax
jb 0x4ba6
leaq 0x8(%r15), %rbx
callq 0x4330
movq %rbx, %rdi
callq 0x4040
cmpq $0x0, 0x50(%r15)
je 0x4b80
leaq 0x30(%r15), %rdi
callq 0x4040
callq 0x43f0
movq 0x58(%r15), %rax
cmpq (%r14), %rax
jbe 0x4b91
movq %rax, (%r14)
imulq $0x28, %rax, %rdi
addq 0x6304(%rip), %rdi      # 0xaea0
movq %rbx, %rsi
callq 0x4760
jmp 0x4b3e
movq 0x63e3(%rip), %rdx      # 0xaf90
movl (%rdx), %eax
jmp 0x4b11
movq 0x6315(%rip), %rax      # 0xaed0
movl %ecx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq