// File: /workspace/github_c_makefile_star2_O3/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 0x4300
movq 0x740a(%rip), %rcx      # 0xbed0
movq 0x74c3(%rip), %rsi      # 0xbf90
subl (%rcx), %eax
movl %eax, (%rsi)
je 0x4b8f
movq 0x74ea(%rip), %r12      # 0xbfc8
movq (%r12), %rcx
movq 0x74b7(%rip), %r13      # 0xbfa0
movq 0x7488(%rip), %r14      # 0xbf78
decl %eax
incl (%r13)
movl %eax, (%rsi)
jne 0x4b0e
movq 0x7387(%rip), %rdi      # 0xbe88
movq (%rdi), %rdx
movq %rdx, (%r12)
movq %rcx, (%rdi)
movq %rdx, %rcx
cmpq $0x0, (%rcx)
je 0x4b87
movq 0x18(%rcx), %rax
movq 0x18(%rax), %r15
testq %r15, %r15
je 0x4b7e
movl (%r13), %eax
cmpl 0x8(%r15), %eax
jb 0x4b7e
leaq 0x8(%r15), %rbx
callq 0x4310
movq %rbx, %rdi
callq 0x4040
cmpq $0x0, 0x50(%r15)
je 0x4b4c
leaq 0x30(%r15), %rdi
callq 0x4040
callq 0x43c0
movq 0x58(%r15), %rax
cmpq (%r14), %rax
jbe 0x4b5d
movq %rax, (%r14)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x7334(%rip), %rdi      # 0xbea0
movq %rbx, %rsi
callq 0x4730
movq (%r12), %rcx
cmpq $0x0, (%rcx)
jne 0x4b14
movq 0x740b(%rip), %rsi      # 0xbf90
movl (%rsi), %eax
testl %eax, %eax
jne 0x4af0
movq 0x740a(%rip), %rax      # 0xbfa0
movl (%rax), %eax
movq 0x7331(%rip), %rcx      # 0xbed0
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq